-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Website: Dedicated page for all survey answers #928
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"select-survey": "Select survey", | ||
"multiple-answers": "multiple answers", | ||
"responses-since": "Survey responses since {{sinceDate}}", | ||
"title": "Survey Responses", | ||
"answers": "answers", | ||
"data-points": "data points", | ||
"onboarding": { | ||
"title": "Onboarding Survey", | ||
"description": "Filled out once before recipient is joining the program" | ||
}, | ||
"checkin": { | ||
"title": "Check-in Survey", | ||
"description": "Filled out every 6 months while recipient is in the program" | ||
}, | ||
"offboarding": { | ||
"title": "Offboarding Survey", | ||
"description": "Filled out once when recipient is finishing the program" | ||
}, | ||
"offboarded-checkin": { | ||
"title": "Follow-up Survey", | ||
"description": "Filled out every 6 months after recipient left the program" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,271 @@ | ||
export interface Question { | ||
type: QuestionInputType; | ||
name: string; | ||
choices: any[]; | ||
choicesTranslationKey?: string; | ||
translationKey: string; | ||
descriptionTranslationKey?: string; | ||
} | ||
Gavriil-Tzortzakis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export enum QuestionInputType { | ||
RADIO_GROUP = 'radiogroup', | ||
COMMENT = 'comment', | ||
CHECKBOX = 'checkbox', | ||
RANKING = 'ranking', | ||
} | ||
|
||
export const MARITAL_STATUS: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'maritalStatusV1', | ||
choices: ['married', 'widowed', 'divorced', 'separated', 'neverMarried'], | ||
choicesTranslationKey: 'survey.questions.maritalStatusChoices', | ||
translationKey: 'survey.questions.maritalStatusTitleV1', | ||
}; | ||
|
||
export const LIVING_LOCATION: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'livingLocationV1', | ||
choices: [ | ||
'westernAreaUrbanFreetown', | ||
'westernAreaRural', | ||
'easternProvince', | ||
'northernProvince', | ||
'southernProvince', | ||
'northWestProvince', | ||
], | ||
translationKey: 'survey.questions.livingLocationTitleV1', | ||
choicesTranslationKey: 'survey.questions.livingLocationChoices', | ||
}; | ||
|
||
export const BOOLEAN_CHOICES = { choices: [true, false], choicesTranslationKey: 'survey.questions.yesNoChoices' }; | ||
|
||
export const HAS_DEPENDENTS: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'hasDependentsV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.hasDependentsTitleV1', | ||
descriptionTranslationKey: 'survey.questions.hasDependentsDescV1', | ||
}; | ||
|
||
export const NOT_EMPLOYED: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'notEmployedV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.notEmployedTitleV1', | ||
}; | ||
|
||
export const NUMBER_OF_DEPENDENTS: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'nrDependentsV1', | ||
choices: ['1-2', '3-4', '5-7', '8-10', '10-'], | ||
translationKey: 'survey.questions.nrDependentsTitleV1', | ||
choicesTranslationKey: 'survey.questions.nrDependentsChoices', | ||
}; | ||
|
||
export const SCHOOL_ATTENDANCE: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'schoolAttendanceV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.attendingSchoolV1', | ||
}; | ||
|
||
export const EMPLOYMENT_STATUS: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'employmentStatusV1', | ||
choices: ['employed', 'selfEmployed', 'notEmployed', 'retired'], | ||
translationKey: 'survey.questions.employmentStatusTitleV1', | ||
choicesTranslationKey: 'survey.questions.employmentStatusChoices', | ||
}; | ||
export const DISABILITY: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'disabilityV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.disabilityTitleV1', | ||
}; | ||
|
||
export const SKIPPING_MEALS: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'skippingMealsV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.skippingMealsTitleV1', | ||
}; | ||
|
||
export const SKIPPING_MEALS_LAST_WEEK: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'skippingMealsLastWeekV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.skippingMealsLastWeekTitleV1', | ||
}; | ||
|
||
export const SKIPPING_MEALS_LAST_WEEK_3_MEALS: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'skippingMealsLastWeek3MealsV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.skippingMealsLastWeek3MealsTitleV1', | ||
}; | ||
|
||
export const UNEXPECTED_EXPENSES_COVERED: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'unexpectedExpensesCoveredV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.unexpectedExpensesCoveredTitleV1', | ||
}; | ||
export const SAVINGS: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'savingsV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.savingsTitleV1', | ||
}; | ||
|
||
export const DEBT_PERSONAL: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'debtPersonalV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.debtPersonalTitleV1', | ||
}; | ||
|
||
export const DEBT_PERSONAL_REPAY: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'debtPersonalRepayV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.debtPersonalRepayTitleV1', | ||
}; | ||
|
||
export const DEBT_HOUSEHOLD: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'debtHouseholdV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.debtHouseholdTitleV1', | ||
}; | ||
export const DEBT_HOUSEHOLD_WHO_REPAYS: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'debtHouseholdWhoRepaysV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.debtHouseholdWhoRepaysTitleV1', | ||
}; | ||
export const OTHER_SUPPORT: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'otherSupportV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.otherSupportTitleV1', | ||
}; | ||
|
||
export const PLANNED_ACHIEVEMENT: Question = { | ||
type: QuestionInputType.COMMENT, | ||
name: 'plannedAchievementV1', | ||
translationKey: 'survey.questions.plannedAchievementTitleV1', | ||
choices: [], | ||
}; | ||
|
||
export const SPENDING: Question = { | ||
type: QuestionInputType.CHECKBOX, | ||
name: 'spendingV1', | ||
choices: ['education', 'food', 'housing', 'healthCare', 'mobility', 'saving', 'investment'], | ||
translationKey: 'survey.questions.spendingTitleV1', | ||
choicesTranslationKey: 'survey.questions.spendingChoices', | ||
}; | ||
|
||
export const PLANNED_ACHIEVEMENT_REMAINING: Question = { | ||
type: QuestionInputType.COMMENT, | ||
name: 'plannedAchievementRemainingV1', | ||
translationKey: 'survey.questions.plannedAchievementRemainingTitleV1', | ||
choices: [], | ||
}; | ||
|
||
export const IMPACT_FINANCIAL_INDEPENDENCE: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'impactFinancialIndependenceV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.financialIndependenceTitleV1', | ||
}; | ||
|
||
export const IMPACT_LIFE_GENERAL: Question = { | ||
type: QuestionInputType.COMMENT, | ||
name: 'impactLifeGeneralV1', | ||
translationKey: 'survey.questions.impactLifeGeneralTitleV1', | ||
choices: [], | ||
}; | ||
|
||
export const ACHIEVEMENTS_ACHIEVED: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'achievementsAchievedV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.achievementsAchievedTitleV1', | ||
}; | ||
|
||
export const ACHIEVEMENTS_NOT_ACHIEVED: Question = { | ||
type: QuestionInputType.COMMENT, | ||
name: 'achievementsNotAchievedCommentV1', | ||
choices: [], | ||
translationKey: 'survey.questions.achievementsNotAchievedCommentTitleV1', | ||
}; | ||
|
||
export const HAPPIER: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'happierV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.happierTitleV1', | ||
}; | ||
|
||
export const HAPPIER_COMMENT: Question = { | ||
type: QuestionInputType.COMMENT, | ||
name: 'happierCommentV1', | ||
translationKey: 'survey.questions.happierCommentTitleV1', | ||
choices: [], | ||
}; | ||
export const NOT_HAPPIER_COMMENT: Question = { | ||
type: QuestionInputType.COMMENT, | ||
translationKey: 'survey.questions.notHappierCommentTitleV1', | ||
name: 'notHappierCommentV1', | ||
choices: [], | ||
}; | ||
|
||
export const LONG_ENOUGH: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'longEnough', | ||
translationKey: 'survey.questions.longEnoughTitleV1', | ||
...BOOLEAN_CHOICES, | ||
}; | ||
|
||
export const RANKING: Question = { | ||
type: QuestionInputType.RANKING, | ||
name: 'spendingRankedV1', | ||
choices: [], | ||
translationKey: 'survey.questions.spendingRankingTitleV1', | ||
descriptionTranslationKey: 'survey.questions.spendingRankingDescV1', | ||
}; | ||
Gavriil-Tzortzakis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
const ALL_QUESTIONS = [ | ||
MARITAL_STATUS, | ||
LIVING_LOCATION, | ||
HAS_DEPENDENTS, | ||
NUMBER_OF_DEPENDENTS, | ||
SCHOOL_ATTENDANCE, | ||
EMPLOYMENT_STATUS, | ||
DISABILITY, | ||
SKIPPING_MEALS, | ||
SKIPPING_MEALS_LAST_WEEK, | ||
SKIPPING_MEALS_LAST_WEEK_3_MEALS, | ||
UNEXPECTED_EXPENSES_COVERED, | ||
SAVINGS, | ||
DEBT_PERSONAL, | ||
DEBT_PERSONAL_REPAY, | ||
DEBT_HOUSEHOLD, | ||
DEBT_HOUSEHOLD_WHO_REPAYS, | ||
OTHER_SUPPORT, | ||
PLANNED_ACHIEVEMENT, | ||
SPENDING, | ||
PLANNED_ACHIEVEMENT_REMAINING, | ||
IMPACT_FINANCIAL_INDEPENDENCE, | ||
IMPACT_LIFE_GENERAL, | ||
ACHIEVEMENTS_ACHIEVED, | ||
ACHIEVEMENTS_NOT_ACHIEVED, | ||
HAPPIER, | ||
HAPPIER_COMMENT, | ||
NOT_HAPPIER_COMMENT, | ||
LONG_ENOUGH, | ||
RANKING, | ||
NOT_EMPLOYED, | ||
]; | ||
|
||
export const QUESTIONS_DICTIONARY: Map<string, Question> = new Map(ALL_QUESTIONS.map((obj) => [obj.name, obj])); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Thanks for improving the types here.