-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Add Survey Chart, broken UI for long labels
- Loading branch information
1 parent
671a26e
commit 7c7d6ee
Showing
10 changed files
with
688 additions
and
173 deletions.
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,20 @@ | ||
{ | ||
"select-survey": "Select survey", | ||
"title": "Survey Responses", | ||
"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; | ||
} | ||
|
||
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 DEPT_PERSONAL: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'debtPersonalV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.debtPersonalTitleV1', | ||
}; | ||
|
||
export const DEPT_PERSONAL_REPAY: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'debtPersonalRepayV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.debtPersonalRepayTitleV1', | ||
}; | ||
|
||
export const DEPT_HOUSEHOLD: Question = { | ||
type: QuestionInputType.RADIO_GROUP, | ||
name: 'debtHouseholdV1', | ||
...BOOLEAN_CHOICES, | ||
translationKey: 'survey.questions.debtHouseholdTitleV1', | ||
}; | ||
export const DEPT_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.spendingRankedV1', | ||
descriptionTranslationKey: 'survey.questions.spendingRankingDescV1', | ||
}; | ||
|
||
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, | ||
DEPT_PERSONAL, | ||
DEPT_PERSONAL_REPAY, | ||
DEPT_HOUSEHOLD, | ||
DEPT_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.