@cuemath/leap 3.3.26-j.7 → 3.3.26-jj1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/line-icons/icons/chevron-right.js.map +1 -1
- package/dist/features/auth/pla-signup/pla-analytics-events.js +3 -9
- package/dist/features/auth/pla-signup/pla-analytics-events.js.map +1 -1
- package/dist/features/auth/signup/circular-step-wrapper/circular-step-wrapper.js.map +1 -1
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js +8 -8
- package/dist/features/auth/signup/custom-input-field/custom-input-field.js.map +1 -1
- package/dist/features/circle-games/sign-up/sign-up.js +6 -6
- package/dist/features/circle-games/sign-up/sign-up.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +17 -17
- package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js +6 -6
- package/dist/features/milestone/create/comps/sheets-list/sheets-list-styled.js +2 -2
- package/dist/features/milestone/create/milestone-create-helpers.js +7 -13
- package/dist/features/milestone/create/milestone-create-helpers.js.map +1 -1
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js +22 -28
- package/dist/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js +1 -1
- package/dist/features/parent-dashboard/hooks/use-fetch-parent-home.js.map +1 -1
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js +43 -45
- package/dist/features/parent-dashboard/hooks/use-parent-home-data.js.map +1 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js +14 -12
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change-styled.js.map +1 -1
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js +6 -6
- package/dist/features/parent-dashboard/modals/tutor-change/tutor-change.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-constants.js +4 -45
- package/dist/features/parent-dashboard/parent-dashboard-constants.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-types.js +3 -3
- package/dist/features/parent-dashboard/parent-dashboard-types.js.map +1 -1
- package/dist/features/parent-dashboard/parent-dashboard-view.js +173 -198
- package/dist/features/parent-dashboard/parent-dashboard-view.js.map +1 -1
- package/dist/features/student-details/class-details/class-details-utils.js +6 -6
- package/dist/features/trial-session/comps/class-preference/class-preference.js +49 -61
- package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-constants.js +1 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-constants.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps-styled.js +1 -1
- package/dist/features/trial-session/comps/pla/next-steps/next-steps-styled.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/next-steps/next-steps.js +5 -5
- package/dist/features/trial-session/comps/pla/next-steps/next-steps.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js +29 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-countdown.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js +132 -0
- package/dist/features/trial-session/comps/pla/session-status/hooks/use-session-status-config.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js +11 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-constants.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js +19 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status-helpers.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-status/session-status-styled.js +2 -2
- package/dist/features/trial-session/comps/pla/session-status/session-status-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status.js +127 -0
- package/dist/features/trial-session/comps/pla/session-status/session-status.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/session-summary-constants.js +2 -2
- package/dist/features/trial-session/comps/pla/session-summary/session-summary-constants.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js +53 -0
- package/dist/features/trial-session/comps/pla/session-summary/session-summary.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/session-summary/summary-card/summary-card-styled.js +1 -1
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js +56 -0
- package/dist/features/trial-session/comps/pla/session-summary/summary-card/summary-card.js.map +1 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-constants.js.map +1 -0
- package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-styled.js +1 -1
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-styled.js.map +1 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types.js.map +1 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js +101 -0
- package/dist/features/trial-session/comps/pla/upcoming-sessions/upcoming-sessions.js.map +1 -0
- package/dist/features/trial-session/comps/session-report/session-report.js +15 -15
- package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js +0 -5
- package/dist/features/trial-session/comps/student-feedback/student-feedback-constants.js.map +1 -1
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js +51 -96
- package/dist/features/trial-session/comps/student-feedback/student-feedback.js.map +1 -1
- package/dist/features/trial-session/comps/student-profile/student-profile.js +63 -70
- package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +44 -43
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +1 -1
- package/dist/features/trial-session/helper.js +54 -71
- package/dist/features/trial-session/helper.js.map +1 -1
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +130 -149
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/trial-session/trial-session-view.js +98 -107
- package/dist/features/trial-session/trial-session-view.js.map +1 -1
- package/dist/index.d.ts +80 -80
- package/dist/index.js +309 -310
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +10 -0
- package/dist/node_modules/date-fns/_lib/getRoundingMethod.js.map +1 -0
- package/dist/node_modules/date-fns/differenceInMilliseconds.js +9 -0
- package/dist/node_modules/date-fns/differenceInMilliseconds.js.map +1 -0
- package/dist/node_modules/date-fns/differenceInSeconds.js +11 -0
- package/dist/node_modules/date-fns/differenceInSeconds.js.map +1 -0
- package/package.json +1 -1
- package/dist/features/parent-dashboard/api/cancel-subscription.js +0 -9
- package/dist/features/parent-dashboard/api/cancel-subscription.js.map +0 -1
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js +0 -20
- package/dist/features/parent-dashboard/comps/billing-information/billing-information-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js +0 -96
- package/dist/features/parent-dashboard/comps/billing-information/billing-information.js.map +0 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/next-steps/next-steps.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js +0 -34
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-countdown.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js +0 -137
- package/dist/features/parent-dashboard/comps/session-status/hooks/use-session-status-config.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js +0 -20
- package/dist/features/parent-dashboard/comps/session-status/session-status-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js +0 -19
- package/dist/features/parent-dashboard/comps/session-status/session-status-helpers.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-status/session-status.js +0 -124
- package/dist/features/parent-dashboard/comps/session-status/session-status.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/session-summary-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js +0 -53
- package/dist/features/parent-dashboard/comps/session-summary/session-summary.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js +0 -63
- package/dist/features/parent-dashboard/comps/session-summary/summary-card/summary-card.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-constants.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-styled.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions-types.js.map +0 -1
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions.js +0 -96
- package/dist/features/parent-dashboard/comps/upcoming-sessions/upcoming-sessions.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js +0 -21
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription-constants.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js +0 -85
- package/dist/features/parent-dashboard/modals/cancel-subscription/cancel-subscription.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js +0 -23
- package/dist/features/parent-dashboard/modals/cancellation-confirmation/cancellation-confirmation.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js +0 -55
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-constant.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js +0 -59
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason-styled.js.map +0 -1
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js +0 -93
- package/dist/features/parent-dashboard/modals/cancellation-reason/cancellation-reason.js.map +0 -1
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js +0 -66
- package/dist/features/parent-dashboard/modals/hooks/use-pla-model-handlers.js.map +0 -1
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js +0 -76
- package/dist/features/parent-dashboard/modals/view-payment-method/view-payment-method.js.map +0 -1
- package/dist/features/student-username/add/add-student-username-constants.js +0 -6
- package/dist/features/student-username/add/add-student-username-constants.js.map +0 -1
- package/dist/features/student-username/add/add-student-username-helpers.js +0 -6
- package/dist/features/student-username/add/add-student-username-helpers.js.map +0 -1
- package/dist/features/student-username/add/add-student-username-styled.js +0 -10
- package/dist/features/student-username/add/add-student-username-styled.js.map +0 -1
- package/dist/features/student-username/add/add-student-username.js +0 -78
- package/dist/features/student-username/add/add-student-username.js.map +0 -1
- package/dist/features/student-username/add/api/update-username.js +0 -9
- package/dist/features/student-username/add/api/update-username.js.map +0 -1
- package/dist/features/student-username/add/api/username-availability.js +0 -10
- package/dist/features/student-username/add/api/username-availability.js.map +0 -1
- package/dist/features/student-username/add/hooks/use-check-username-availability.js +0 -41
- package/dist/features/student-username/add/hooks/use-check-username-availability.js.map +0 -1
- package/dist/features/trial-session/api/teacher-availability.js +0 -9
- package/dist/features/trial-session/api/teacher-availability.js.map +0 -1
- package/dist/features/trial-session/comps/class-preference/helpers.js +0 -28
- package/dist/features/trial-session/comps/class-preference/helpers.js.map +0 -1
- /package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-constants.js +0 -0
- /package/dist/features/{parent-dashboard/comps → trial-session/comps/pla}/upcoming-sessions/upcoming-sessions-types.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"milestone-create-helpers.js","sources":["../../../../src/features/milestone/create/milestone-create-helpers.ts"],"sourcesContent":["import type { LOTTIE } from '../../../assets/lottie/lottie';\nimport type IStudentSchool from '../../../types/models/school';\nimport type { ISectionOption } from '../../ui/section-list/section-list-types';\nimport type { TTestType } from '../types';\nimport type {\n ICurriculumStandards,\n IFormStep,\n IGoalCurriculumMap,\n IMileStoneFormFields,\n IMilestoneConfig,\n IMilestoneFormData,\n IPreferencesCurriculumMap,\n TCourseStream,\n TCurriculumStandardOption,\n TEnrollmentTypes,\n TFormStepNames,\n TGoalCategory,\n TMilestoneFormFlow,\n TPreferenceCategory,\n} from './milestone-create-types';\n\nimport { COUNTRY_MAP } from '../../../constants/country';\nimport {\n getIfGoalCurriculumStandardIsAccessible,\n getStudentEnrollmentSupported,\n} from './comps/chapters-selection-step/utils';\nimport {\n checkEnrollmentAvailable,\n getTestTypeBasedCategory,\n} from './comps/test-type-step/test-type-utils';\nimport { GOAL_EDIT_FLOWS } from './milestone-create-constants';\n\ninterface IGetCurrenStep {\n (\n formStep: IFormStep,\n milestoneFormData: IMilestoneFormData,\n flow: TMilestoneFormFlow,\n ): IFormStep | undefined;\n}\n\ninterface IClearNextFields {\n (\n formStep: IFormStep,\n milestoneFormData: IMilestoneFormData,\n currentStepName: TFormStepNames | undefined,\n shouldStartClearing: boolean,\n fieldsToClear: (keyof IMileStoneFormFields)[],\n ): IMilestoneFormData | undefined;\n}\n\n/**\n * Impure method that Removes specified fields from an object.\n *\n * @param obj The object from which fields are to be removed.\n * @param fieldsList An array of field names to be removed.\n */\nconst clearFields = (obj: Record<string, unknown>, fieldsList: string[]) => {\n fieldsList.forEach(field => {\n obj[field] = undefined;\n });\n};\n\nconst clearNextFields: IClearNextFields = (\n formStep,\n milestoneFormData,\n currentStepName,\n startClearing,\n fieldsToClear = [],\n) => {\n const { isLeafNode, next, reset } = formStep;\n const updatedFormData = { ...milestoneFormData };\n\n if (isLeafNode) {\n clearFields(updatedFormData, [...reset, ...fieldsToClear]);\n\n return updatedFormData;\n }\n\n if (next) {\n let shouldStartClearing = startClearing;\n let nextStep: IFormStep | undefined;\n\n next.every(step => {\n let conditionFulfilled = false;\n\n if (step.when !== undefined) {\n conditionFulfilled = step.when.every(([field, value]) => updatedFormData[field] === value);\n } else conditionFulfilled = true;\n\n if (conditionFulfilled) {\n if (shouldStartClearing) {\n step?.reset?.forEach(field => {\n fieldsToClear.push(field);\n });\n } else if (currentStepName === step?.name) {\n shouldStartClearing = true;\n }\n\n nextStep = step;\n\n return false;\n }\n\n return true;\n });\n if (nextStep) {\n return clearNextFields(\n nextStep,\n updatedFormData,\n currentStepName,\n shouldStartClearing,\n fieldsToClear,\n );\n }\n }\n\n return undefined;\n};\n\nconst getCurrenStep: IGetCurrenStep = (formStep, milestoneFormData, flow) => {\n const { isLeafNode, required, next } = formStep;\n\n if (isLeafNode) {\n return formStep;\n }\n\n const requiredFieldsFilled = required.every(field => milestoneFormData[field] !== undefined);\n\n if (GOAL_EDIT_FLOWS.includes(flow)) {\n const requiredFieldsReviewed = required.every(\n field => milestoneFormData.reviewed[field] === true,\n );\n\n if (!requiredFieldsFilled || !requiredFieldsReviewed) {\n return {\n ...formStep,\n next: undefined,\n };\n }\n } else {\n const requiredFieldsCommitted = required.every(\n field => milestoneFormData.committed[field] === true,\n );\n\n if (!requiredFieldsFilled || !requiredFieldsCommitted) {\n return {\n ...formStep,\n next: undefined,\n };\n }\n }\n\n if (next) {\n let nextStep: IFormStep | undefined;\n\n next.every(step => {\n if (step.when === undefined) {\n nextStep = step;\n\n return false;\n }\n\n const conditionFulfilled = step.when.every(\n ([field, value]) => milestoneFormData[field] === value,\n );\n\n if (conditionFulfilled) {\n nextStep = step;\n\n return false;\n }\n\n return true;\n });\n\n if (nextStep) {\n return getCurrenStep(nextStep, milestoneFormData, flow);\n }\n }\n\n return undefined;\n};\n\ntype TOptions = {\n id: string;\n label: string;\n description?: string;\n lottie?: keyof typeof LOTTIE;\n};\n\ninterface IGetSchoolTestsFromConfig {\n (config: IMilestoneConfig): TOptions[];\n}\n\nconst getSchoolTestsFromConfig: IGetSchoolTestsFromConfig = config => {\n return config.academic_events.reduce<TOptions[]>((acc, event) => {\n const { id, event_name: eventName, event_type: eventType } = event;\n\n if (eventType === 'SCHOOL_TEST') {\n acc.push({\n id,\n label: eventName,\n });\n }\n\n return acc;\n }, []);\n};\n\ninterface IGetCountriesFromConfig {\n (config: IMilestoneConfig): TOptions[];\n}\n\nconst computeCanIncludeCurrentGoal = (props: {\n currentGoalData: IGoalCurriculumMap;\n enrollmentType: TEnrollmentTypes;\n currentCountryCode?: string;\n grade?: string;\n selectedCategory?: string;\n isTeacherTrainingAccount?: boolean;\n}) => {\n const {\n currentGoalData,\n enrollmentType,\n currentCountryCode,\n grade,\n selectedCategory,\n isTeacherTrainingAccount,\n } = props;\n\n const {\n blocked_countries: blockedCountries,\n available_countries: availableCountries,\n available_grades: availableGrades,\n goal_category: goalCategory,\n available_enrollment_types: availableEnrollmentTypes,\n blocked_enrollment_types: blockedEnrollmentTypes,\n } = currentGoalData;\n\n const isStudentEnrollmentTypeSupported = getStudentEnrollmentSupported(\n blockedEnrollmentTypes,\n availableEnrollmentTypes,\n enrollmentType,\n );\n const isStudentRegionBlocked = blockedCountries.some(\n blockedCountry => blockedCountry === currentCountryCode,\n );\n const isStudentRegionAvailable =\n availableCountries.length > 0\n ? availableCountries.some(availableCountry => availableCountry === currentCountryCode)\n : true;\n\n const isCurrentGradeAvailable = availableGrades.some(gradeInfo => gradeInfo === grade);\n const isGoalCategoryAvailable = selectedCategory === goalCategory;\n\n if (isTeacherTrainingAccount) return isGoalCategoryAvailable && isCurrentGradeAvailable;\n\n return (\n isStudentEnrollmentTypeSupported &&\n !isStudentRegionBlocked &&\n isStudentRegionAvailable &&\n isCurrentGradeAvailable &&\n isGoalCategoryAvailable\n );\n};\n\ninterface IGetCurriculumStandardsFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n countryCode: string;\n goalCategory: TGoalCategory;\n courseStream: TCourseStream;\n enrollmentType: TEnrollmentTypes;\n classRatio?: number;\n flow?: TMilestoneFormFlow | null;\n isTeacherTrainingAccount?: boolean;\n },\n ): TCurriculumStandardOption[];\n}\n\nconst getCurriculumStandardsFromConfig: IGetCurriculumStandardsFromConfig = (\n config,\n {\n grade,\n countryCode,\n goalCategory,\n courseStream,\n classRatio,\n enrollmentType,\n flow,\n isTeacherTrainingAccount,\n },\n) => {\n const { goal_curriculum_map: goals, curriculum_standards: curriculumStandards } = config;\n // check if atleast one goal present for the curriculum standard\n\n const filteredGoalCurriculumMap = goals.filter(item => {\n const isSameCourseStream = item.course_stream === courseStream;\n\n if (flow === 'CREATE') {\n return isSameCourseStream && item.is_live;\n }\n\n return isSameCourseStream;\n });\n\n const hasGoalForCurriculumStandards = (standard: ICurriculumStandards) =>\n filteredGoalCurriculumMap.some(goal => {\n // check goal category\n if (goal.goal_category !== goalCategory) return false;\n\n // check grade availability\n if (!goal.available_grades.includes(grade)) return false;\n\n // check goal curriculum standard\n // if goal_curriculum_standard is undefined then it's available for all standard\n if (goal.goal_curriculum_standard && goal.goal_curriculum_standard !== standard.code)\n return false;\n\n if (goalCategory === 'SCHOOL_SUCCESS' && !goal.goal_curriculum_standard) return false;\n\n if (isTeacherTrainingAccount) return true;\n\n if (\n classRatio &&\n goal.available_class_ratios.length > 0 &&\n !goal.available_class_ratios.includes(classRatio)\n )\n return false;\n\n // check country availability\n if (goal.available_countries.length > 0 && !goal.available_countries.includes(countryCode))\n return false;\n\n if (goal.available_countries.length === 0 && goal.blocked_countries.includes(countryCode))\n return false;\n\n return checkEnrollmentAvailable(goal, enrollmentType);\n });\n\n return curriculumStandards\n .filter(hasGoalForCurriculumStandards)\n .map(\n ({\n code,\n name,\n default_in_countries: defaultInCountries,\n recommended_in_countries: recommendedInCountries,\n }) => ({\n id: code,\n label: name,\n isDefault: defaultInCountries.includes(countryCode),\n isRecommended: recommendedInCountries.includes(countryCode),\n }),\n )\n .sort((a, b) => (a.label.toUpperCase() > b.label.toUpperCase() ? 1 : -1));\n};\n\ninterface IGetGoalsFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n countryCode: string;\n goalCategory: TGoalCategory;\n curriculumStandard?: string;\n courseStream: TCourseStream;\n enrollmentType: TEnrollmentTypes;\n },\n ): TOptions[];\n}\n\nconst getGoalsFromConfig: IGetGoalsFromConfig = (config, options) => {\n const { goal_curriculum_map: goals } = config;\n const { grade, countryCode, goalCategory, curriculumStandard, courseStream, enrollmentType } =\n options;\n const filteredGoalCurriculumMap = goals.filter(item => item.course_stream === courseStream);\n\n const isEligibleGoal = (goal: IGoalCurriculumMap) => {\n if (goal.goal_category !== goalCategory) return false;\n\n if (curriculumStandard && goal.goal_curriculum_standard !== curriculumStandard) return false;\n\n if (goal.available_countries.length > 0 && !goal.available_countries.includes(countryCode))\n return false;\n\n if (goal.available_countries.length === 0 && goal.blocked_countries.includes(countryCode))\n return false;\n\n if (!goal.available_grades.includes(grade)) return false;\n\n if (!goal.is_live) return false;\n\n return checkEnrollmentAvailable(goal, enrollmentType);\n };\n\n return filteredGoalCurriculumMap\n ?.filter(isEligibleGoal)\n .map(({ goal_code: id, goal_name: label }) => ({\n id,\n label,\n }))\n .sort((a, b) => (a.label.toUpperCase() > b.label.toUpperCase() ? 1 : -1));\n};\n\nconst getGradesFromConfig: IGetCountriesFromConfig = config => {\n return config.grades.reduce<TOptions[]>((acc, grade) => {\n if (grade === '-1' || grade === '0') {\n acc.push({\n id: grade,\n label: grade === '-1' ? `Pre-K` : `KG`,\n });\n } else {\n acc.push({\n id: grade,\n label: `Grade ${grade}`,\n });\n }\n\n return acc;\n }, []);\n};\n\ninterface IGetPreferencesFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n preferenceCategory: TPreferenceCategory;\n courseStream: TCourseStream;\n },\n ): TOptions[];\n}\n\nconst getPreferencesFromConfig: IGetPreferencesFromConfig = (config, options) => {\n const { preference_config: preferenceConfig } = config;\n\n const isEligiblePreferences = (preference: IPreferencesCurriculumMap) => {\n const { grade, courseStream, preferenceCategory } = options;\n\n if (preference.course_stream !== courseStream) return false;\n\n if (preference.preference_category !== preferenceCategory) return false;\n\n if (preference.preference_grades.length > 0 && !preference.preference_grades.includes(grade))\n return false;\n\n if (!preference.is_live) return false;\n\n return true;\n };\n\n return preferenceConfig\n ?.filter(isEligiblePreferences)\n .map(\n ({\n preference_code: id,\n preference_name: label,\n preference_description: description,\n lottie_key: lottie,\n }) => ({\n id,\n label,\n description,\n lottie: lottie as keyof typeof LOTTIE,\n }),\n );\n};\n\ninterface IGetGradeBasedOnGoalAvailability {\n (\n config: IMilestoneConfig,\n selectedGoalCategory: string,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n isTeacherTrainingAccount?: boolean,\n ): TOptions[];\n}\n\n//* Grades where goals are available for selected goal category.\nconst getGradesBasedOnGoalAvailability: IGetGradeBasedOnGoalAvailability = (\n config,\n selectedGoalCategory,\n courseStream,\n enrollmentType,\n isTeacherTrainingAccount,\n) => {\n const { goal_curriculum_map: goals } = config;\n\n const grades = getGradesFromConfig(config);\n\n const gradeAvailableGoals = ({ id }: TOptions) => {\n return goals\n .filter(item => item.course_stream === courseStream && item.is_live)\n .some((goalData: IGoalCurriculumMap) => {\n const {\n available_grades: availableGrades,\n goal_category: goalCategory,\n available_enrollment_types: availableEnrollmentTypes,\n blocked_enrollment_types: blockedEnrollmentTypes,\n } = goalData;\n\n const isGoalCategoryAndGradeAvailable =\n goalCategory === selectedGoalCategory && availableGrades.includes(id);\n\n if (isTeacherTrainingAccount) return isGoalCategoryAndGradeAvailable;\n\n // check enrollment type availability\n if (\n availableEnrollmentTypes.length > 0 &&\n !availableEnrollmentTypes.includes(enrollmentType)\n )\n return false;\n\n if (\n availableEnrollmentTypes.length === 0 &&\n blockedEnrollmentTypes.includes(enrollmentType)\n )\n return false;\n\n //* Check for grade availability only for selected goal category\n return isGoalCategoryAndGradeAvailable;\n });\n };\n\n return grades.filter(gradeAvailableGoals);\n};\n\ninterface IGetMajorsFromConfigBasedOnBoardAndGrade {\n (\n config: IMilestoneConfig,\n boardCode: string,\n grade: string,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n isTeacherTrainingAccount?: boolean,\n ): TOptions[];\n}\n\nconst getMajorsFromConfigBasedOnBoardAndGrade: IGetMajorsFromConfigBasedOnBoardAndGrade = (\n config,\n boardCode,\n grade,\n courseStream,\n enrollmentType,\n isTeacherTrainingAccount,\n) => {\n //* We have US courses for grade 7 & above\n if (grade === 'KG' || Number(grade) < 7) return [];\n\n const { goal_curriculum_map: goalCurriculumMap } = config;\n const filterOnCourseStreamAndEnrollmentType = (goalData: IGoalCurriculumMap) => {\n if (goalData.course_stream !== courseStream && goalData.is_live) return false;\n\n return isTeacherTrainingAccount || checkEnrollmentAvailable(goalData, enrollmentType);\n };\n\n const majorsWithLabelId = goalCurriculumMap\n .filter(filterOnCourseStreamAndEnrollmentType)\n .reduce<TOptions[]>((acc, goalData) => {\n const {\n available_grades: availableGrades,\n goal_curriculum_standard: goalCurriculumStandard,\n program_name: programName,\n program_code: programCode,\n } = goalData;\n\n const isGradeAvailable = availableGrades.some(availableGrade => availableGrade === grade);\n const isBoardAvailable = goalCurriculumStandard === boardCode;\n\n if (isGradeAvailable && isBoardAvailable) {\n acc.push({\n id: programCode,\n label: programName,\n });\n }\n\n return acc;\n }, []);\n\n return majorsWithLabelId;\n};\n\nconst getRegionCodeBasedOnCountryCode = (countryCode: string) => {\n const regionCode = COUNTRY_MAP.find(countryInfo => countryInfo.country_code === countryCode)\n ?.region_code;\n\n return regionCode;\n};\n\nconst generateFormStateWithPrefilledSchoolData = (\n schoolData: IStudentSchool | undefined,\n board: string | undefined,\n grade: string | undefined,\n currentCountryCode: string | undefined,\n): IMilestoneFormData => {\n if (schoolData && grade) {\n const { country_code: countryCode, place_id: placeId } = schoolData;\n\n return {\n committed: {},\n reviewed: {},\n grade: grade,\n schoolInfo: {\n countryCode: countryCode,\n stateCode: '',\n id: placeId,\n },\n region: countryCode,\n board: board ?? undefined,\n };\n }\n\n const regionCode = currentCountryCode\n ? getRegionCodeBasedOnCountryCode(currentCountryCode)\n : undefined;\n\n if (grade) {\n return {\n committed: {},\n reviewed: {},\n grade: grade,\n region: regionCode,\n board: board ?? undefined,\n };\n }\n\n return {\n committed: {},\n reviewed: {},\n };\n};\n\nconst appendSchoolDataToFormState = (\n formData: IMilestoneFormData,\n schoolData: IStudentSchool | undefined,\n board: string | undefined,\n grade: string | undefined,\n): IMilestoneFormData => {\n if (schoolData && grade) {\n const { country_code: countryCode, place_id: placeId } = schoolData;\n\n return {\n ...formData,\n grade: grade,\n schoolInfo: {\n countryCode: countryCode,\n stateCode: '',\n id: placeId,\n },\n board: formData.board ?? board ?? undefined,\n };\n }\n\n return formData;\n};\n\nconst appendPrimaryGoalCategoryToFormState = (\n config: IMilestoneConfig,\n testType: TTestType,\n grade: string | undefined,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n board?: string | undefined,\n country?: string | undefined,\n flow?: TMilestoneFormFlow | null,\n isTeacherTrainingAccount?: boolean,\n) => {\n const { goal_curriculum_map: goalCurriculumMap } = config;\n const isSchoolSuccessCategory = testType === 'no-test';\n const selectedGoalCategory = getTestTypeBasedCategory(testType);\n\n //TODO: This needs to compensate the course selection for US curriculum grade 8 & above\n const primaryGoalCurriculum = goalCurriculumMap.find(goalInfo => {\n const isCurrentGoalAvailable = computeCanIncludeCurrentGoal({\n currentGoalData: goalInfo,\n grade,\n currentCountryCode: country,\n selectedCategory: selectedGoalCategory,\n enrollmentType,\n isTeacherTrainingAccount,\n });\n\n const { goal_curriculum_standard: goalCurriculumStandard, is_live: isLive } = goalInfo;\n\n const currentBoardAvailable = getIfGoalCurriculumStandardIsAccessible({\n goalCurriculumStandard,\n referenceStandard: board,\n });\n\n const isSameCourse = goalInfo.course_stream === courseStream;\n const canIncludeCurrentGoal = flow === 'CREATE' ? isLive : true;\n\n const isEligiblePrimaryGoal = canIncludeCurrentGoal && isSameCourse && isCurrentGoalAvailable;\n\n if (isTeacherTrainingAccount)\n return isEligiblePrimaryGoal && (isSchoolSuccessCategory ? currentBoardAvailable : true);\n\n if (isSchoolSuccessCategory) {\n return isEligiblePrimaryGoal && currentBoardAvailable;\n }\n\n return isEligiblePrimaryGoal;\n });\n\n return primaryGoalCurriculum;\n};\n\nconst getDefaultBoard = (data: ISectionOption<TCurriculumStandardOption>[]) => {\n let recommendedBoards: TCurriculumStandardOption[] = [];\n let otherBoards: TCurriculumStandardOption[] = [];\n\n // Iterate through the data categories\n for (const category of data) {\n if (category.title === 'recommended') {\n recommendedBoards = category.data;\n } else if (category.title === 'others') {\n otherBoards = category.data;\n }\n }\n\n // 1. Check if any recommended board has isDefault: true\n const defaultBoard = recommendedBoards.find(board => board.isDefault && board.isRecommended);\n\n if (defaultBoard) {\n return defaultBoard.id;\n }\n\n // 2. If no default, return the first recommended board\n if (recommendedBoards.length > 0) {\n return recommendedBoards[0]?.id;\n }\n\n // 3. If no recommended, return the first board from others\n if (otherBoards.length > 0) {\n return otherBoards[0]?.id;\n }\n\n // 4. Return null if no boards are found\n return undefined;\n};\n\nexport {\n appendSchoolDataToFormState,\n appendPrimaryGoalCategoryToFormState,\n clearNextFields,\n generateFormStateWithPrefilledSchoolData,\n getCurrenStep,\n getGradesFromConfig,\n getCurriculumStandardsFromConfig,\n getGoalsFromConfig,\n getGradesBasedOnGoalAvailability,\n getMajorsFromConfigBasedOnBoardAndGrade,\n getSchoolTestsFromConfig,\n getRegionCodeBasedOnCountryCode,\n getDefaultBoard,\n getPreferencesFromConfig,\n};\n"],"names":["clearFields","obj","fieldsList","field","clearNextFields","formStep","milestoneFormData","currentStepName","startClearing","fieldsToClear","isLeafNode","next","reset","updatedFormData","shouldStartClearing","nextStep","step","conditionFulfilled","value","_a","getCurrenStep","flow","required","requiredFieldsFilled","GOAL_EDIT_FLOWS","requiredFieldsReviewed","requiredFieldsCommitted","getSchoolTestsFromConfig","config","acc","event","id","eventName","eventType","computeCanIncludeCurrentGoal","props","currentGoalData","enrollmentType","currentCountryCode","grade","selectedCategory","isTeacherTrainingAccount","blockedCountries","availableCountries","availableGrades","goalCategory","availableEnrollmentTypes","blockedEnrollmentTypes","isStudentEnrollmentTypeSupported","getStudentEnrollmentSupported","isStudentRegionBlocked","blockedCountry","isStudentRegionAvailable","availableCountry","isCurrentGradeAvailable","gradeInfo","isGoalCategoryAvailable","getCurriculumStandardsFromConfig","countryCode","courseStream","classRatio","goals","curriculumStandards","filteredGoalCurriculumMap","item","isSameCourseStream","hasGoalForCurriculumStandards","standard","goal","checkEnrollmentAvailable","code","name","defaultInCountries","recommendedInCountries","a","b","getGoalsFromConfig","options","curriculumStandard","isEligibleGoal","label","getGradesFromConfig","getPreferencesFromConfig","preferenceConfig","isEligiblePreferences","preference","preferenceCategory","description","lottie","getGradesBasedOnGoalAvailability","selectedGoalCategory","grades","gradeAvailableGoals","goalData","isGoalCategoryAndGradeAvailable","getMajorsFromConfigBasedOnBoardAndGrade","boardCode","goalCurriculumMap","filterOnCourseStreamAndEnrollmentType","goalCurriculumStandard","programName","programCode","availableGrade","getRegionCodeBasedOnCountryCode","COUNTRY_MAP","countryInfo","generateFormStateWithPrefilledSchoolData","schoolData","board","placeId","regionCode","appendSchoolDataToFormState","formData","appendPrimaryGoalCategoryToFormState","testType","country","isSchoolSuccessCategory","getTestTypeBasedCategory","goalInfo","isCurrentGoalAvailable","isLive","currentBoardAvailable","getIfGoalCurriculumStandardIsAccessible","isSameCourse","isEligiblePrimaryGoal","getDefaultBoard","data","recommendedBoards","otherBoards","category","defaultBoard","_b"],"mappings":";;;;AAwDA,MAAMA,IAAc,CAACC,GAA8BC,MAAyB;AAC1E,EAAAA,EAAW,QAAQ,CAASC,MAAA;AAC1B,IAAAF,EAAIE,CAAK,IAAI;AAAA,EAAA,CACd;AACH,GAEMC,IAAoC,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mG,IAAS,OAEJG,KAAgBJ;AAEnE,WAAA9E,IACKmF,MAA0BR,IAA0BK,IAAwB,MAEjFL,IACKQ,KAAyBH,IAG3BG;AAAA,EAAA,CACR;AAGH,GAEMC,IAAkB,CAACC,MAAsD;;AAC7E,MAAIC,IAAiD,CAAA,GACjDC,IAA2C,CAAA;AAG/C,aAAWC,KAAYH;AACjB,IAAAG,EAAS,UAAU,gBACrBF,IAAoBE,EAAS,OACpBA,EAAS,UAAU,aAC5BD,IAAcC,EAAS;AAK3B,QAAMC,IAAeH,EAAkB,KAAK,OAASnB,EAAM,aAAaA,EAAM,aAAa;AAE3F,MAAIsB;AACF,WAAOA,EAAa;AAIlB,MAAAH,EAAkB,SAAS;AACtB,YAAA5G,IAAA4G,EAAkB,CAAC,MAAnB,gBAAA5G,EAAsB;AAI3B,MAAA6G,EAAY,SAAS;AAChB,YAAAG,IAAAH,EAAY,CAAC,MAAb,gBAAAG,EAAgB;AAK3B;"}
|
|
1
|
+
{"version":3,"file":"milestone-create-helpers.js","sources":["../../../../src/features/milestone/create/milestone-create-helpers.ts"],"sourcesContent":["import type IStudentSchool from '../../../types/models/school';\nimport type { ISectionOption } from '../../ui/section-list/section-list-types';\nimport type { TTestType } from '../types';\nimport type {\n ICurriculumStandards,\n IFormStep,\n IGoalCurriculumMap,\n IMileStoneFormFields,\n IMilestoneConfig,\n IMilestoneFormData,\n IPreferencesCurriculumMap,\n TCourseStream,\n TCurriculumStandardOption,\n TEnrollmentTypes,\n TFormStepNames,\n TGoalCategory,\n TMilestoneFormFlow,\n TPreferenceCategory,\n} from './milestone-create-types';\n\nimport { COUNTRY_MAP } from '../../../constants/country';\nimport {\n getIfGoalCurriculumStandardIsAccessible,\n getStudentEnrollmentSupported,\n} from './comps/chapters-selection-step/utils';\nimport {\n checkEnrollmentAvailable,\n getTestTypeBasedCategory,\n} from './comps/test-type-step/test-type-utils';\nimport { GOAL_EDIT_FLOWS } from './milestone-create-constants';\n\ninterface IGetCurrenStep {\n (\n formStep: IFormStep,\n milestoneFormData: IMilestoneFormData,\n flow: TMilestoneFormFlow,\n ): IFormStep | undefined;\n}\n\ninterface IClearNextFields {\n (\n formStep: IFormStep,\n milestoneFormData: IMilestoneFormData,\n currentStepName: TFormStepNames | undefined,\n shouldStartClearing: boolean,\n fieldsToClear: (keyof IMileStoneFormFields)[],\n ): IMilestoneFormData | undefined;\n}\n\n/**\n * Impure method that Removes specified fields from an object.\n *\n * @param obj The object from which fields are to be removed.\n * @param fieldsList An array of field names to be removed.\n */\nconst clearFields = (obj: Record<string, unknown>, fieldsList: string[]) => {\n fieldsList.forEach(field => {\n obj[field] = undefined;\n });\n};\n\nconst clearNextFields: IClearNextFields = (\n formStep,\n milestoneFormData,\n currentStepName,\n startClearing,\n fieldsToClear = [],\n) => {\n const { isLeafNode, next, reset } = formStep;\n const updatedFormData = { ...milestoneFormData };\n\n if (isLeafNode) {\n clearFields(updatedFormData, [...reset, ...fieldsToClear]);\n\n return updatedFormData;\n }\n\n if (next) {\n let shouldStartClearing = startClearing;\n let nextStep: IFormStep | undefined;\n\n next.every(step => {\n let conditionFulfilled = false;\n\n if (step.when !== undefined) {\n conditionFulfilled = step.when.every(([field, value]) => updatedFormData[field] === value);\n } else conditionFulfilled = true;\n\n if (conditionFulfilled) {\n if (shouldStartClearing) {\n step?.reset?.forEach(field => {\n fieldsToClear.push(field);\n });\n } else if (currentStepName === step?.name) {\n shouldStartClearing = true;\n }\n\n nextStep = step;\n\n return false;\n }\n\n return true;\n });\n if (nextStep) {\n return clearNextFields(\n nextStep,\n updatedFormData,\n currentStepName,\n shouldStartClearing,\n fieldsToClear,\n );\n }\n }\n\n return undefined;\n};\n\nconst getCurrenStep: IGetCurrenStep = (formStep, milestoneFormData, flow) => {\n const { isLeafNode, required, next } = formStep;\n\n if (isLeafNode) {\n return formStep;\n }\n\n const requiredFieldsFilled = required.every(field => milestoneFormData[field] !== undefined);\n\n if (GOAL_EDIT_FLOWS.includes(flow)) {\n const requiredFieldsReviewed = required.every(\n field => milestoneFormData.reviewed[field] === true,\n );\n\n if (!requiredFieldsFilled || !requiredFieldsReviewed) {\n return {\n ...formStep,\n next: undefined,\n };\n }\n } else {\n const requiredFieldsCommitted = required.every(\n field => milestoneFormData.committed[field] === true,\n );\n\n if (!requiredFieldsFilled || !requiredFieldsCommitted) {\n return {\n ...formStep,\n next: undefined,\n };\n }\n }\n\n if (next) {\n let nextStep: IFormStep | undefined;\n\n next.every(step => {\n if (step.when === undefined) {\n nextStep = step;\n\n return false;\n }\n\n const conditionFulfilled = step.when.every(\n ([field, value]) => milestoneFormData[field] === value,\n );\n\n if (conditionFulfilled) {\n nextStep = step;\n\n return false;\n }\n\n return true;\n });\n\n if (nextStep) {\n return getCurrenStep(nextStep, milestoneFormData, flow);\n }\n }\n\n return undefined;\n};\n\ntype TOptions = {\n id: string;\n label: string;\n description?: string;\n};\n\ninterface IGetSchoolTestsFromConfig {\n (config: IMilestoneConfig): TOptions[];\n}\n\nconst getSchoolTestsFromConfig: IGetSchoolTestsFromConfig = config => {\n return config.academic_events.reduce<TOptions[]>((acc, event) => {\n const { id, event_name: eventName, event_type: eventType } = event;\n\n if (eventType === 'SCHOOL_TEST') {\n acc.push({\n id,\n label: eventName,\n });\n }\n\n return acc;\n }, []);\n};\n\ninterface IGetCountriesFromConfig {\n (config: IMilestoneConfig): TOptions[];\n}\n\nconst computeCanIncludeCurrentGoal = (props: {\n currentGoalData: IGoalCurriculumMap;\n enrollmentType: TEnrollmentTypes;\n currentCountryCode?: string;\n grade?: string;\n selectedCategory?: string;\n isTeacherTrainingAccount?: boolean;\n}) => {\n const {\n currentGoalData,\n enrollmentType,\n currentCountryCode,\n grade,\n selectedCategory,\n isTeacherTrainingAccount,\n } = props;\n\n const {\n blocked_countries: blockedCountries,\n available_countries: availableCountries,\n available_grades: availableGrades,\n goal_category: goalCategory,\n available_enrollment_types: availableEnrollmentTypes,\n blocked_enrollment_types: blockedEnrollmentTypes,\n } = currentGoalData;\n\n const isStudentEnrollmentTypeSupported = getStudentEnrollmentSupported(\n blockedEnrollmentTypes,\n availableEnrollmentTypes,\n enrollmentType,\n );\n const isStudentRegionBlocked = blockedCountries.some(\n blockedCountry => blockedCountry === currentCountryCode,\n );\n const isStudentRegionAvailable =\n availableCountries.length > 0\n ? availableCountries.some(availableCountry => availableCountry === currentCountryCode)\n : true;\n\n const isCurrentGradeAvailable = availableGrades.some(gradeInfo => gradeInfo === grade);\n const isGoalCategoryAvailable = selectedCategory === goalCategory;\n\n if (isTeacherTrainingAccount) return isGoalCategoryAvailable && isCurrentGradeAvailable;\n\n return (\n isStudentEnrollmentTypeSupported &&\n !isStudentRegionBlocked &&\n isStudentRegionAvailable &&\n isCurrentGradeAvailable &&\n isGoalCategoryAvailable\n );\n};\n\ninterface IGetCurriculumStandardsFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n countryCode: string;\n goalCategory: TGoalCategory;\n courseStream: TCourseStream;\n enrollmentType: TEnrollmentTypes;\n classRatio?: number;\n flow?: TMilestoneFormFlow | null;\n isTeacherTrainingAccount?: boolean;\n },\n ): TCurriculumStandardOption[];\n}\n\nconst getCurriculumStandardsFromConfig: IGetCurriculumStandardsFromConfig = (\n config,\n {\n grade,\n countryCode,\n goalCategory,\n courseStream,\n classRatio,\n enrollmentType,\n flow,\n isTeacherTrainingAccount,\n },\n) => {\n const { goal_curriculum_map: goals, curriculum_standards: curriculumStandards } = config;\n // check if atleast one goal present for the curriculum standard\n\n const filteredGoalCurriculumMap = goals.filter(item => {\n const isSameCourseStream = item.course_stream === courseStream;\n\n if (flow === 'CREATE') {\n return isSameCourseStream && item.is_live;\n }\n\n return isSameCourseStream;\n });\n\n const hasGoalForCurriculumStandards = (standard: ICurriculumStandards) =>\n filteredGoalCurriculumMap.some(goal => {\n // check goal category\n if (goal.goal_category !== goalCategory) return false;\n\n // check grade availability\n if (!goal.available_grades.includes(grade)) return false;\n\n // check goal curriculum standard\n // if goal_curriculum_standard is undefined then it's available for all standard\n if (goal.goal_curriculum_standard && goal.goal_curriculum_standard !== standard.code)\n return false;\n\n if (goalCategory === 'SCHOOL_SUCCESS' && !goal.goal_curriculum_standard) return false;\n\n if (isTeacherTrainingAccount) return true;\n\n if (\n classRatio &&\n goal.available_class_ratios.length > 0 &&\n !goal.available_class_ratios.includes(classRatio)\n )\n return false;\n\n // check country availability\n if (goal.available_countries.length > 0 && !goal.available_countries.includes(countryCode))\n return false;\n\n if (goal.available_countries.length === 0 && goal.blocked_countries.includes(countryCode))\n return false;\n\n return checkEnrollmentAvailable(goal, enrollmentType);\n });\n\n return curriculumStandards\n .filter(hasGoalForCurriculumStandards)\n .map(\n ({\n code,\n name,\n default_in_countries: defaultInCountries,\n recommended_in_countries: recommendedInCountries,\n }) => ({\n id: code,\n label: name,\n isDefault: defaultInCountries.includes(countryCode),\n isRecommended: recommendedInCountries.includes(countryCode),\n }),\n )\n .sort((a, b) => (a.label.toUpperCase() > b.label.toUpperCase() ? 1 : -1));\n};\n\ninterface IGetGoalsFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n countryCode: string;\n goalCategory: TGoalCategory;\n curriculumStandard?: string;\n courseStream: TCourseStream;\n enrollmentType: TEnrollmentTypes;\n },\n ): TOptions[];\n}\n\nconst getGoalsFromConfig: IGetGoalsFromConfig = (config, options) => {\n const { goal_curriculum_map: goals } = config;\n const { grade, countryCode, goalCategory, curriculumStandard, courseStream, enrollmentType } =\n options;\n const filteredGoalCurriculumMap = goals.filter(item => item.course_stream === courseStream);\n\n const isEligibleGoal = (goal: IGoalCurriculumMap) => {\n if (goal.goal_category !== goalCategory) return false;\n\n if (curriculumStandard && goal.goal_curriculum_standard !== curriculumStandard) return false;\n\n if (goal.available_countries.length > 0 && !goal.available_countries.includes(countryCode))\n return false;\n\n if (goal.available_countries.length === 0 && goal.blocked_countries.includes(countryCode))\n return false;\n\n if (!goal.available_grades.includes(grade)) return false;\n\n if (!goal.is_live) return false;\n\n return checkEnrollmentAvailable(goal, enrollmentType);\n };\n\n return filteredGoalCurriculumMap\n ?.filter(isEligibleGoal)\n .map(({ goal_code: id, goal_name: label }) => ({\n id,\n label,\n }))\n .sort((a, b) => (a.label.toUpperCase() > b.label.toUpperCase() ? 1 : -1));\n};\n\nconst getGradesFromConfig: IGetCountriesFromConfig = config => {\n return config.grades.reduce<TOptions[]>((acc, grade) => {\n if (grade === '-1' || grade === '0') {\n acc.push({\n id: grade,\n label: grade === '-1' ? `Pre-K` : `KG`,\n });\n } else {\n acc.push({\n id: grade,\n label: `Grade ${grade}`,\n });\n }\n\n return acc;\n }, []);\n};\n\ninterface IGetPreferencesFromConfig {\n (\n config: IMilestoneConfig,\n options: {\n grade: string;\n preferenceCategory: TPreferenceCategory;\n courseStream: TCourseStream;\n },\n ): TOptions[];\n}\n\nconst getPreferencesFromConfig: IGetPreferencesFromConfig = (config, options) => {\n const { preference_config: preferenceConfig } = config;\n\n const isEligiblePreferences = (preference: IPreferencesCurriculumMap) => {\n const { grade, courseStream, preferenceCategory } = options;\n\n if (preference.course_stream !== courseStream) return false;\n\n if (preference.preference_category !== preferenceCategory) return false;\n\n if (preference.preference_grades.length > 0 && !preference.preference_grades.includes(grade))\n return false;\n\n if (!preference.is_live) return false;\n\n return true;\n };\n\n return preferenceConfig\n ?.filter(isEligiblePreferences)\n .map(\n ({ preference_code: id, preference_name: label, preference_description: description }) => ({\n id,\n label,\n description,\n }),\n );\n};\n\ninterface IGetGradeBasedOnGoalAvailability {\n (\n config: IMilestoneConfig,\n selectedGoalCategory: string,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n isTeacherTrainingAccount?: boolean,\n ): TOptions[];\n}\n\n//* Grades where goals are available for selected goal category.\nconst getGradesBasedOnGoalAvailability: IGetGradeBasedOnGoalAvailability = (\n config,\n selectedGoalCategory,\n courseStream,\n enrollmentType,\n isTeacherTrainingAccount,\n) => {\n const { goal_curriculum_map: goals } = config;\n\n const grades = getGradesFromConfig(config);\n\n const gradeAvailableGoals = ({ id }: TOptions) => {\n return goals\n .filter(item => item.course_stream === courseStream && item.is_live)\n .some((goalData: IGoalCurriculumMap) => {\n const {\n available_grades: availableGrades,\n goal_category: goalCategory,\n available_enrollment_types: availableEnrollmentTypes,\n blocked_enrollment_types: blockedEnrollmentTypes,\n } = goalData;\n\n const isGoalCategoryAndGradeAvailable =\n goalCategory === selectedGoalCategory && availableGrades.includes(id);\n\n if (isTeacherTrainingAccount) return isGoalCategoryAndGradeAvailable;\n\n // check enrollment type availability\n if (\n availableEnrollmentTypes.length > 0 &&\n !availableEnrollmentTypes.includes(enrollmentType)\n )\n return false;\n\n if (\n availableEnrollmentTypes.length === 0 &&\n blockedEnrollmentTypes.includes(enrollmentType)\n )\n return false;\n\n //* Check for grade availability only for selected goal category\n return isGoalCategoryAndGradeAvailable;\n });\n };\n\n return grades.filter(gradeAvailableGoals);\n};\n\ninterface IGetMajorsFromConfigBasedOnBoardAndGrade {\n (\n config: IMilestoneConfig,\n boardCode: string,\n grade: string,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n isTeacherTrainingAccount?: boolean,\n ): TOptions[];\n}\n\nconst getMajorsFromConfigBasedOnBoardAndGrade: IGetMajorsFromConfigBasedOnBoardAndGrade = (\n config,\n boardCode,\n grade,\n courseStream,\n enrollmentType,\n isTeacherTrainingAccount,\n) => {\n //* We have US courses for grade 7 & above\n if (grade === 'KG' || Number(grade) < 7) return [];\n\n const { goal_curriculum_map: goalCurriculumMap } = config;\n const filterOnCourseStreamAndEnrollmentType = (goalData: IGoalCurriculumMap) => {\n if (goalData.course_stream !== courseStream && goalData.is_live) return false;\n\n return isTeacherTrainingAccount || checkEnrollmentAvailable(goalData, enrollmentType);\n };\n\n const majorsWithLabelId = goalCurriculumMap\n .filter(filterOnCourseStreamAndEnrollmentType)\n .reduce<TOptions[]>((acc, goalData) => {\n const {\n available_grades: availableGrades,\n goal_curriculum_standard: goalCurriculumStandard,\n program_name: programName,\n program_code: programCode,\n } = goalData;\n\n const isGradeAvailable = availableGrades.some(availableGrade => availableGrade === grade);\n const isBoardAvailable = goalCurriculumStandard === boardCode;\n\n if (isGradeAvailable && isBoardAvailable) {\n acc.push({\n id: programCode,\n label: programName,\n });\n }\n\n return acc;\n }, []);\n\n return majorsWithLabelId;\n};\n\nconst getRegionCodeBasedOnCountryCode = (countryCode: string) => {\n const regionCode = COUNTRY_MAP.find(countryInfo => countryInfo.country_code === countryCode)\n ?.region_code;\n\n return regionCode;\n};\n\nconst generateFormStateWithPrefilledSchoolData = (\n schoolData: IStudentSchool | undefined,\n board: string | undefined,\n grade: string | undefined,\n currentCountryCode: string | undefined,\n): IMilestoneFormData => {\n if (schoolData && grade) {\n const { country_code: countryCode, place_id: placeId } = schoolData;\n\n return {\n committed: {},\n reviewed: {},\n grade: grade,\n schoolInfo: {\n countryCode: countryCode,\n stateCode: '',\n id: placeId,\n },\n region: countryCode,\n board: board ?? undefined,\n };\n }\n\n const regionCode = currentCountryCode\n ? getRegionCodeBasedOnCountryCode(currentCountryCode)\n : undefined;\n\n if (grade) {\n return {\n committed: {},\n reviewed: {},\n grade: grade,\n region: regionCode,\n board: board ?? undefined,\n };\n }\n\n return {\n committed: {},\n reviewed: {},\n };\n};\n\nconst appendSchoolDataToFormState = (\n formData: IMilestoneFormData,\n schoolData: IStudentSchool | undefined,\n board: string | undefined,\n grade: string | undefined,\n): IMilestoneFormData => {\n if (schoolData && grade) {\n const { country_code: countryCode, place_id: placeId } = schoolData;\n\n return {\n ...formData,\n grade: grade,\n schoolInfo: {\n countryCode: countryCode,\n stateCode: '',\n id: placeId,\n },\n board: formData.board ?? board ?? undefined,\n };\n }\n\n return formData;\n};\n\nconst appendPrimaryGoalCategoryToFormState = (\n config: IMilestoneConfig,\n testType: TTestType,\n grade: string | undefined,\n courseStream: TCourseStream,\n enrollmentType: TEnrollmentTypes,\n board?: string | undefined,\n country?: string | undefined,\n flow?: TMilestoneFormFlow | null,\n isTeacherTrainingAccount?: boolean,\n) => {\n const { goal_curriculum_map: goalCurriculumMap } = config;\n const isSchoolSuccessCategory = testType === 'no-test';\n const selectedGoalCategory = getTestTypeBasedCategory(testType);\n\n //TODO: This needs to compensate the course selection for US curriculum grade 8 & above\n const primaryGoalCurriculum = goalCurriculumMap.find(goalInfo => {\n const isCurrentGoalAvailable = computeCanIncludeCurrentGoal({\n currentGoalData: goalInfo,\n grade,\n currentCountryCode: country,\n selectedCategory: selectedGoalCategory,\n enrollmentType,\n isTeacherTrainingAccount,\n });\n\n const { goal_curriculum_standard: goalCurriculumStandard, is_live: isLive } = goalInfo;\n\n const currentBoardAvailable = getIfGoalCurriculumStandardIsAccessible({\n goalCurriculumStandard,\n referenceStandard: board,\n });\n\n const isSameCourse = goalInfo.course_stream === courseStream;\n const canIncludeCurrentGoal = flow === 'CREATE' ? isLive : true;\n\n const isEligiblePrimaryGoal = canIncludeCurrentGoal && isSameCourse && isCurrentGoalAvailable;\n\n if (isTeacherTrainingAccount)\n return isEligiblePrimaryGoal && (isSchoolSuccessCategory ? currentBoardAvailable : true);\n\n if (isSchoolSuccessCategory) {\n return isEligiblePrimaryGoal && currentBoardAvailable;\n }\n\n return isEligiblePrimaryGoal;\n });\n\n return primaryGoalCurriculum;\n};\n\nconst getDefaultBoard = (data: ISectionOption<TCurriculumStandardOption>[]) => {\n let recommendedBoards: TCurriculumStandardOption[] = [];\n let otherBoards: TCurriculumStandardOption[] = [];\n\n // Iterate through the data categories\n for (const category of data) {\n if (category.title === 'recommended') {\n recommendedBoards = category.data;\n } else if (category.title === 'others') {\n otherBoards = category.data;\n }\n }\n\n // 1. Check if any recommended board has isDefault: true\n const defaultBoard = recommendedBoards.find(board => board.isDefault && board.isRecommended);\n\n if (defaultBoard) {\n return defaultBoard.id;\n }\n\n // 2. If no default, return the first recommended board\n if (recommendedBoards.length > 0) {\n return recommendedBoards[0]?.id;\n }\n\n // 3. If no recommended, return the first board from others\n if (otherBoards.length > 0) {\n return otherBoards[0]?.id;\n }\n\n // 4. Return null if no boards are found\n return undefined;\n};\n\nexport {\n appendSchoolDataToFormState,\n appendPrimaryGoalCategoryToFormState,\n clearNextFields,\n generateFormStateWithPrefilledSchoolData,\n getCurrenStep,\n getGradesFromConfig,\n getCurriculumStandardsFromConfig,\n getGoalsFromConfig,\n getGradesBasedOnGoalAvailability,\n getMajorsFromConfigBasedOnBoardAndGrade,\n getSchoolTestsFromConfig,\n getRegionCodeBasedOnCountryCode,\n getDefaultBoard,\n getPreferencesFromConfig,\n};\n"],"names":["clearFields","obj","fieldsList","field","clearNextFields","formStep","milestoneFormData","currentStepName","startClearing","fieldsToClear","isLeafNode","next","reset","updatedFormData","shouldStartClearing","nextStep","step","conditionFulfilled","value","_a","getCurrenStep","flow","required","requiredFieldsFilled","GOAL_EDIT_FLOWS","requiredFieldsReviewed","requiredFieldsCommitted","getSchoolTestsFromConfig","config","acc","event","id","eventName","eventType","computeCanIncludeCurrentGoal","props","currentGoalData","enrollmentType","currentCountryCode","grade","selectedCategory","isTeacherTrainingAccount","blockedCountries","availableCountries","availableGrades","goalCategory","availableEnrollmentTypes","blockedEnrollmentTypes","isStudentEnrollmentTypeSupported","getStudentEnrollmentSupported","isStudentRegionBlocked","blockedCountry","isStudentRegionAvailable","availableCountry","isCurrentGradeAvailable","gradeInfo","isGoalCategoryAvailable","getCurriculumStandardsFromConfig","countryCode","courseStream","classRatio","goals","curriculumStandards","filteredGoalCurriculumMap","item","isSameCourseStream","hasGoalForCurriculumStandards","standard","goal","checkEnrollmentAvailable","code","name","defaultInCountries","recommendedInCountries","a","b","getGoalsFromConfig","options","curriculumStandard","isEligibleGoal","label","getGradesFromConfig","getPreferencesFromConfig","preferenceConfig","isEligiblePreferences","preference","preferenceCategory","description","getGradesBasedOnGoalAvailability","selectedGoalCategory","grades","gradeAvailableGoals","goalData","isGoalCategoryAndGradeAvailable","getMajorsFromConfigBasedOnBoardAndGrade","boardCode","goalCurriculumMap","filterOnCourseStreamAndEnrollmentType","goalCurriculumStandard","programName","programCode","availableGrade","getRegionCodeBasedOnCountryCode","COUNTRY_MAP","countryInfo","generateFormStateWithPrefilledSchoolData","schoolData","board","placeId","regionCode","appendSchoolDataToFormState","formData","appendPrimaryGoalCategoryToFormState","testType","country","isSchoolSuccessCategory","getTestTypeBasedCategory","goalInfo","isCurrentGoalAvailable","isLive","currentBoardAvailable","getIfGoalCurriculumStandardIsAccessible","isSameCourse","isEligiblePrimaryGoal","getDefaultBoard","data","recommendedBoards","otherBoards","category","defaultBoard","_b"],"mappings":";;;;AAuDA,MAAMA,IAAc,CAACC,GAA8BC,MAAyB;AAC1E,EAAAA,EAAW,QAAQ,CAASC,MAAA;AAC1B,IAAAF,EAAIE,CAAK,IAAI;AAAA,EAAA,CACd;AACH,GAEMC,IAAoC,CACxCC,GACAC,GACAC,GACAC,GACAC,IAAgB,OACb;AACH,QAAM,EAAE,YAAAC,GAAY,MAAAC,GAAM,OAAAC,EAAA,IAAUP,GAC9BQ,IAAkB,EAAE,GAAGP;AAE7B,MAAII;AACF,WAAAV,EAAYa,GAAiB,CAAC,GAAGD,GAAO,GAAGH,CAAa,CAAC,GAElDI;AAGT,MAAIF,GAAM;AACR,QAAIG,IAAsBN,GACtBO;AAyBJ,QAvBAJ,EAAK,MAAM,CAAQK,MAAA;;AACjB,UAAIC,IAAqB;AAMzB,aAJID,EAAK,SAAS,SACKC,IAAAD,EAAK,KAAK,MAAM,CAAC,CAACb,GAAOe,CAAK,MAAML,EAAgBV,CAAK,MAAMe,CAAK,IAC/DD,IAAA,IAExBA,KACEH,KACIK,IAAAH,KAAA,gBAAAA,EAAA,UAAA,QAAAG,EAAO,QAAQ,CAAShB,MAAA;AAC5B,QAAAM,EAAc,KAAKN,CAAK;AAAA,MAAA,KAEjBI,OAAoBS,KAAA,gBAAAA,EAAM,UACbF,IAAA,KAGbC,IAAAC,GAEJ,MAGF;AAAA,IAAA,CACR,GACGD;AACK,aAAAX;AAAA,QACLW;AAAA,QACAF;AAAA,QACAN;AAAA,QACAO;AAAA,QACAL;AAAA,MAAA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B,KAAK,CAAYqB,MAAA;AAC/D,UAAMC,IAAyBpF,EAA6B;AAAA,MAC1D,iBAAiBmF;AAAA,MACjB,OAAA9E;AAAA,MACA,oBAAoB2E;AAAA,MACpB,kBAAkBzB;AAAA,MAClB,gBAAApD;AAAA,MACA,0BAAAI;AAAA,IAAA,CACD,GAEK,EAAE,0BAA0ByD,GAAwB,SAASqB,MAAWF,GAExEG,IAAwBC,EAAwC;AAAA,MACpE,wBAAAvB;AAAA,MACA,mBAAmBS;AAAA,IAAA,CACpB,GAEKe,IAAeL,EAAS,kBAAkB1D,GAG1CgE,KAFwBtG,MAAS,WAAWkG,IAAS,OAEJG,KAAgBJ;AAEnE,WAAA7E,IACKkF,MAA0BR,IAA0BK,IAAwB,MAEjFL,IACKQ,KAAyBH,IAG3BG;AAAA,EAAA,CACR;AAGH,GAEMC,IAAkB,CAACC,MAAsD;;AAC7E,MAAIC,IAAiD,CAAA,GACjDC,IAA2C,CAAA;AAG/C,aAAWC,KAAYH;AACjB,IAAAG,EAAS,UAAU,gBACrBF,IAAoBE,EAAS,OACpBA,EAAS,UAAU,aAC5BD,IAAcC,EAAS;AAK3B,QAAMC,IAAeH,EAAkB,KAAK,OAASnB,EAAM,aAAaA,EAAM,aAAa;AAE3F,MAAIsB;AACF,WAAOA,EAAa;AAIlB,MAAAH,EAAkB,SAAS;AACtB,YAAA3G,IAAA2G,EAAkB,CAAC,MAAnB,gBAAA3G,EAAsB;AAI3B,MAAA4G,EAAY,SAAS;AAChB,YAAAG,IAAAH,EAAY,CAAC,MAAb,gBAAAG,EAAgB;AAK3B;"}
|
|
@@ -1,50 +1,44 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import { ILLUSTRATIONS as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { memo as a } from "react";
|
|
3
|
+
import { ILLUSTRATIONS as c } from "../../../../assets/illustrations/illustrations.js";
|
|
4
|
+
import h from "../../../ui/buttons/button/button.js";
|
|
5
|
+
import l from "../../../ui/image/image.js";
|
|
6
|
+
import n from "../../../ui/layout/flex-view.js";
|
|
7
7
|
import r from "../../../ui/separator/separator.js";
|
|
8
8
|
import o from "../../../ui/text/text.js";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { ImageWrapper as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
studentId: i,
|
|
16
|
-
onRunSystemCheck: a
|
|
9
|
+
import d from "../../hooks/use-fetch-parent-home.js";
|
|
10
|
+
import p from "../../hooks/use-parent-home-data.js";
|
|
11
|
+
import { ImageWrapper as f } from "./pla-first-session-introduction-styled.js";
|
|
12
|
+
const u = ({
|
|
13
|
+
studentId: t,
|
|
14
|
+
onRunSystemCheck: m
|
|
17
15
|
}) => {
|
|
18
|
-
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, [t]);
|
|
24
|
-
return /* @__PURE__ */ s(m, { $justifyContent: "center", $alignItems: "center", $height: "100vh", $width: "100%", children: [
|
|
25
|
-
n && c && /* @__PURE__ */ s(m, { children: [
|
|
26
|
-
/* @__PURE__ */ e(o, { $renderAs: "ab1", $color: "BLACK_1", $align: "center", children: `We’re excited for your ${h ? "next" : "first"} session on` }),
|
|
16
|
+
d(t);
|
|
17
|
+
const { formattedNextSessionStart: i } = p(t);
|
|
18
|
+
return /* @__PURE__ */ s(n, { $justifyContent: "center", $alignItems: "center", $height: "100vh", $width: "100%", children: [
|
|
19
|
+
i && /* @__PURE__ */ s(n, { children: [
|
|
20
|
+
/* @__PURE__ */ e(o, { $renderAs: "ab1", $color: "BLACK_1", $align: "center", children: "We’re excited for your first session on" }),
|
|
27
21
|
/* @__PURE__ */ e(r, { height: 4 }),
|
|
28
|
-
/* @__PURE__ */ e(o, { $renderAs: "ab1-bold", $align: "center", children:
|
|
22
|
+
/* @__PURE__ */ e(o, { $renderAs: "ab1-bold", $align: "center", children: i })
|
|
29
23
|
] }),
|
|
30
24
|
/* @__PURE__ */ e(r, { heightX: 2.5 }),
|
|
31
|
-
/* @__PURE__ */ e(
|
|
25
|
+
/* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(l, { src: c.LEARNING_PUZZLE_BOT, width: "100%" }) }),
|
|
32
26
|
/* @__PURE__ */ e(r, { heightX: 3.5 }),
|
|
33
27
|
/* @__PURE__ */ e(o, { $renderAs: "ab2", $color: "BLACK_1", $align: "center", children: "Let's make sure your device is ready for your child's session." }),
|
|
34
28
|
/* @__PURE__ */ e(r, { heightX: 1 }),
|
|
35
29
|
/* @__PURE__ */ e(
|
|
36
|
-
|
|
30
|
+
h,
|
|
37
31
|
{
|
|
38
32
|
renderAs: "primary",
|
|
39
33
|
label: "Run a system check",
|
|
40
34
|
shape: "square",
|
|
41
35
|
size: "small",
|
|
42
|
-
onClick:
|
|
36
|
+
onClick: m
|
|
43
37
|
}
|
|
44
38
|
)
|
|
45
39
|
] });
|
|
46
|
-
},
|
|
40
|
+
}, F = a(u);
|
|
47
41
|
export {
|
|
48
|
-
|
|
42
|
+
F as default
|
|
49
43
|
};
|
|
50
44
|
//# sourceMappingURL=pla-first-session-introduction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pla-first-session-introduction.js","sources":["../../../../../src/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.tsx"],"sourcesContent":["import type { IFirstSessionIntroductionProps } from './pla-first-session-introduction-types';\n\nimport {
|
|
1
|
+
{"version":3,"file":"pla-first-session-introduction.js","sources":["../../../../../src/features/parent-dashboard/comps/pla-first-session-introduction/pla-first-session-introduction.tsx"],"sourcesContent":["import type { IFirstSessionIntroductionProps } from './pla-first-session-introduction-types';\n\nimport { memo, type FC } from 'react';\n\nimport { ILLUSTRATIONS } from '../../../../assets/illustrations/illustrations';\nimport Button from '../../../ui/buttons/button/button';\nimport Image from '../../../ui/image/image';\nimport FlexView from '../../../ui/layout/flex-view';\nimport Separator from '../../../ui/separator/separator';\nimport Text from '../../../ui/text/text';\nimport useFetchParentHome from '../../hooks/use-fetch-parent-home';\nimport useParentHomeData from '../../hooks/use-parent-home-data';\nimport * as Styled from './pla-first-session-introduction-styled';\n\nconst PlaFirstSessionIntroduction: FC<IFirstSessionIntroductionProps> = ({\n studentId,\n onRunSystemCheck,\n}) => {\n useFetchParentHome(studentId);\n const { formattedNextSessionStart } = useParentHomeData(studentId);\n\n return (\n <FlexView $justifyContent=\"center\" $alignItems=\"center\" $height=\"100vh\" $width={'100%'}>\n {formattedNextSessionStart && (\n <FlexView>\n <Text $renderAs=\"ab1\" $color=\"BLACK_1\" $align=\"center\">\n We’re excited for your first session on\n </Text>\n <Separator height={4} />\n <Text $renderAs=\"ab1-bold\" $align=\"center\">\n {formattedNextSessionStart}\n </Text>\n </FlexView>\n )}\n <Separator heightX={2.5} />\n <Styled.ImageWrapper>\n <Image src={ILLUSTRATIONS.LEARNING_PUZZLE_BOT} width=\"100%\" />\n </Styled.ImageWrapper>\n <Separator heightX={3.5} />\n <Text $renderAs=\"ab2\" $color=\"BLACK_1\" $align=\"center\">\n Let's make sure your device is ready for your child's session.\n </Text>\n <Separator heightX={1} />\n <Button\n renderAs=\"primary\"\n label=\"Run a system check\"\n shape=\"square\"\n size=\"small\"\n onClick={onRunSystemCheck}\n />\n </FlexView>\n );\n};\n\nexport default memo(PlaFirstSessionIntroduction);\n"],"names":["PlaFirstSessionIntroduction","studentId","onRunSystemCheck","useFetchParentHome","formattedNextSessionStart","useParentHomeData","jsxs","FlexView","jsx","Text","Separator","Styled.ImageWrapper","Image","ILLUSTRATIONS","Button","plaFirstSessionIntroduction","memo"],"mappings":";;;;;;;;;;;AAcA,MAAMA,IAAkE,CAAC;AAAA,EACvE,WAAAC;AAAA,EACA,kBAAAC;AACF,MAAM;AACJ,EAAAC,EAAmBF,CAAS;AAC5B,QAAM,EAAE,2BAAAG,EAAA,IAA8BC,EAAkBJ,CAAS;AAG/D,SAAA,gBAAAK,EAACC,KAAS,iBAAgB,UAAS,aAAY,UAAS,SAAQ,SAAQ,QAAQ,QAC7E,UAAA;AAAA,IAAAH,uBACEG,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAC,EAACC,KAAK,WAAU,OAAM,QAAO,WAAU,QAAO,UAAS,UAEvD,0CAAA,CAAA;AAAA,MACA,gBAAAD,EAACE,GAAU,EAAA,QAAQ,EAAG,CAAA;AAAA,wBACrBD,GAAK,EAAA,WAAU,YAAW,QAAO,UAC/B,UACHL,GAAA;AAAA,IAAA,GACF;AAAA,IAEF,gBAAAI,EAACE,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,IACzB,gBAAAF,EAACG,GAAA,EACC,UAAA,gBAAAH,EAACI,GAAM,EAAA,KAAKC,EAAc,qBAAqB,OAAM,OAAA,CAAO,EAC9D,CAAA;AAAA,IACA,gBAAAL,EAACE,GAAU,EAAA,SAAS,IAAK,CAAA;AAAA,IACzB,gBAAAF,EAACC,KAAK,WAAU,OAAM,QAAO,WAAU,QAAO,UAAS,UAEvD,iEAAA,CAAA;AAAA,IACA,gBAAAD,EAACE,GAAU,EAAA,SAAS,EAAG,CAAA;AAAA,IACvB,gBAAAF;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,UAAS;AAAA,QACT,OAAM;AAAA,QACN,OAAM;AAAA,QACN,MAAK;AAAA,QACL,SAASZ;AAAA,MAAA;AAAA,IACX;AAAA,EACF,EAAA,CAAA;AAEJ,GAEea,IAAAC,EAAKhB,CAA2B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-fetch-parent-home.js","sources":["../../../../src/features/parent-dashboard/hooks/use-fetch-parent-home.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo } from 'react';\n\nimport { useParentHomeGet } from '../api/parent-home';\n\n/**\n * This hook is intended only for **triggering** the Parent Home API\n * if it's needed outside the Parent Router.\n * This hook is being called at the level of the Parent Dashboard: <ParentRoutesWrapper />\n * To **consume** the parent home data elsewhere in the app,\n * use the `useParentHomeData()` hook instead.\n */\n\nconst useFetchParentHome = (studentId: string) => {\n const {\n get: getParentHome,\n data,\n isStale,\n isProcessing,\n isProcessingFailed,\n } = useParentHomeGet(studentId);\n\n const fetchData = useCallback(() => {\n studentId && getParentHome(studentId);\n }, [getParentHome, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isStale) {\n fetchData();\n }\n }, [fetchData, isStale]);\n\n const result = useMemo(\n () => ({\n isLoading: isProcessing
|
|
1
|
+
{"version":3,"file":"use-fetch-parent-home.js","sources":["../../../../src/features/parent-dashboard/hooks/use-fetch-parent-home.ts"],"sourcesContent":["import { useCallback, useEffect, useMemo } from 'react';\n\nimport { useParentHomeGet } from '../api/parent-home';\n\n/**\n * This hook is intended only for **triggering** the Parent Home API\n * if it's needed outside the Parent Router.\n * This hook is being called at the level of the Parent Dashboard: <ParentRoutesWrapper />\n * To **consume** the parent home data elsewhere in the app,\n * use the `useParentHomeData()` hook instead.\n */\n\nconst useFetchParentHome = (studentId: string) => {\n const {\n get: getParentHome,\n data,\n isStale,\n isProcessing,\n isProcessingFailed,\n } = useParentHomeGet(studentId);\n\n const fetchData = useCallback(() => {\n studentId && getParentHome(studentId);\n }, [getParentHome, studentId]);\n\n useEffect(() => {\n fetchData();\n }, [fetchData]);\n\n useEffect(() => {\n if (isStale) {\n fetchData();\n }\n }, [fetchData, isStale]);\n\n const result = useMemo(\n () => ({\n isLoading: isProcessing || !data,\n isProcessingFailed,\n }),\n [isProcessing, data, isProcessingFailed],\n );\n\n return result;\n};\n\nexport default useFetchParentHome;\n"],"names":["useFetchParentHome","studentId","getParentHome","data","isStale","isProcessing","isProcessingFailed","useParentHomeGet","fetchData","useCallback","useEffect","useMemo","useFetchParentHome$1"],"mappings":";;AAYA,MAAMA,IAAqB,CAACC,MAAsB;AAC1C,QAAA;AAAA,IACJ,KAAKC;AAAA,IACL,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,oBAAAC;AAAA,EAAA,IACEC,EAAiBN,CAAS,GAExBO,IAAYC,EAAY,MAAM;AAClC,IAAAR,KAAaC,EAAcD,CAAS;AAAA,EAAA,GACnC,CAACC,GAAeD,CAAS,CAAC;AAE7B,SAAAS,EAAU,MAAM;AACJ,IAAAF;EAAA,GACT,CAACA,CAAS,CAAC,GAEdE,EAAU,MAAM;AACd,IAAIN,KACQI;EACZ,GACC,CAACA,GAAWJ,CAAO,CAAC,GAERO;AAAA,IACb,OAAO;AAAA,MACL,WAAWN,KAAgB,CAACF;AAAA,MAC5B,oBAAAG;AAAA,IAAA;AAAA,IAEF,CAACD,GAAcF,GAAMG,CAAkB;AAAA,EAAA;AAI3C,GAEAM,IAAeZ;"}
|
|
@@ -1,56 +1,54 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { useParentHomeGet as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { useMemo as M } from "react";
|
|
2
|
+
import { useParentHomeGet as E } from "../api/parent-home.js";
|
|
3
|
+
import { formatDate as H } from "../../../node_modules/date-fns/format.js";
|
|
4
|
+
const O = (r) => {
|
|
5
|
+
const { data: t, isProcessingFailed: n } = E(r);
|
|
6
|
+
return M(() => {
|
|
7
|
+
var m;
|
|
8
|
+
const { teacher_details: o = null, session_details: s } = t ?? {};
|
|
9
|
+
if (!s)
|
|
9
10
|
return {
|
|
10
|
-
|
|
11
|
+
sessionDetails: null,
|
|
12
|
+
teacherDetails: null,
|
|
13
|
+
isOnlyOneSessionCompleted: !1,
|
|
14
|
+
isMoreThanOneSessionCompleted: !1,
|
|
15
|
+
isDemoDone: !1,
|
|
16
|
+
isSubscriptionCancelled: !1,
|
|
17
|
+
completedSessions: 0,
|
|
18
|
+
nextSessionEnd: 0,
|
|
19
|
+
nextSessionStart: 0,
|
|
20
|
+
upcomingSessions: [],
|
|
21
|
+
showLoading: !0,
|
|
11
22
|
isProcessingFailed: n
|
|
12
23
|
};
|
|
13
24
|
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
upcoming_sessions: T = [],
|
|
23
|
-
student_demo_id: E = "",
|
|
24
|
-
user_attempt_id: m = ""
|
|
25
|
-
} = i ?? {}, S = o ? `${o.first_name || ""} ${o.last_name || ""}`.trim() : "", L = s === e.TRIAL_COMPLETED_CARD_DECLINED, A = s === e.NO_CARD_ON_FILE, D = g.includes(s), u = s === e.TRIAL_TUTOR_NO_SHOW, C = s === e.TRIAL_STUDENT_NO_SHOW, a = M.includes(s), I = a && s !== e.REGULAR_CLASS_COMPLETED, N = s === e.REGULAR_CLASS_COMPLETED, O = s === e.TRIAL_COMPLETED_PAYMENT_PENDING, p = h.includes(s);
|
|
25
|
+
completed_sessions: e = 0,
|
|
26
|
+
next_session_end: l,
|
|
27
|
+
next_session_start: a,
|
|
28
|
+
demo_class_status: d,
|
|
29
|
+
upcoming_sessions: c = [],
|
|
30
|
+
student_demo_id: u = null,
|
|
31
|
+
user_attempt_id: p = null
|
|
32
|
+
} = s, { first_name: S = "", last_name: _ = "" } = o ?? {}, D = (m = `${S} ${_}`) == null ? void 0 : m.trim(), i = e > 0, f = i && e === 1, h = e > 1, x = H(a, "EEEE, MMM d 'at' h:mm a");
|
|
26
33
|
return {
|
|
27
|
-
|
|
28
|
-
sessionDetails: i,
|
|
34
|
+
sessionDetails: s,
|
|
29
35
|
teacherDetails: o,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
completedSessions: c,
|
|
36
|
+
teacherName: D,
|
|
37
|
+
completedSessions: e,
|
|
33
38
|
nextSessionEnd: l,
|
|
34
|
-
nextSessionStart:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
isStudentNoShow: C,
|
|
44
|
-
showLoading: !1,
|
|
45
|
-
demoId: E,
|
|
46
|
-
userAttemptId: m,
|
|
47
|
-
isProcessingFailed: !1,
|
|
48
|
-
canChangeTutor: O,
|
|
49
|
-
showPLAIntroduction: p
|
|
39
|
+
nextSessionStart: a,
|
|
40
|
+
classStatus: d,
|
|
41
|
+
upcomingSessions: c,
|
|
42
|
+
isDemoDone: i,
|
|
43
|
+
isOnlyOneSessionCompleted: f,
|
|
44
|
+
isMoreThanOneSessionCompleted: h,
|
|
45
|
+
demoId: u,
|
|
46
|
+
userAttemptId: p,
|
|
47
|
+
formattedNextSessionStart: x
|
|
50
48
|
};
|
|
51
|
-
}, [
|
|
52
|
-
},
|
|
49
|
+
}, [n, t]);
|
|
50
|
+
}, y = O;
|
|
53
51
|
export {
|
|
54
|
-
|
|
52
|
+
y as default
|
|
55
53
|
};
|
|
56
54
|
//# sourceMappingURL=use-parent-home-data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-parent-home-data.js","sources":["../../../../src/features/parent-dashboard/hooks/use-parent-home-data.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"use-parent-home-data.js","sources":["../../../../src/features/parent-dashboard/hooks/use-parent-home-data.ts"],"sourcesContent":["import type { TSession } from '../../trial-session/comps/pla/upcoming-sessions/upcoming-sessions-types';\nimport type { EClassStatus, ISessionDetails, ITeacherDetails } from '../parent-dashboard-types';\n\nimport { format } from 'date-fns';\nimport { useMemo } from 'react';\n\nimport { useParentHomeGet } from '../api/parent-home';\n\ninterface IUseParentHomeDataReturn {\n sessionDetails: ISessionDetails | null;\n teacherDetails: ITeacherDetails | null;\n completedSessions: number;\n nextSessionEnd: number;\n nextSessionStart: number;\n classStatus?: EClassStatus | null;\n teacherName?: string;\n upcomingSessions?: TSession[];\n isDemoDone: boolean;\n isOnlyOneSessionCompleted: boolean;\n isMoreThanOneSessionCompleted: boolean;\n showLoading?: boolean;\n demoId?: string | null;\n userAttemptId?: string | null;\n isProcessingFailed?: boolean;\n formattedNextSessionStart?: string;\n}\n/**\n * Hook to consume processed parent home data.\n * - Automatically fetches on mount and when stale using useFetchParentHome() at <ParentRoutesWrapper/>.\n * - Use this to **read** parent home data.\n */\n\nconst useParentHomeData = (studentId: string): IUseParentHomeDataReturn => {\n const { data: parentHomeData, isProcessingFailed } = useParentHomeGet(studentId);\n\n const parentHomeDataMemoised = useMemo(() => {\n const { teacher_details: teacherDetails = null, session_details: sessionDetails } =\n parentHomeData ?? {};\n\n if (!sessionDetails) {\n return {\n sessionDetails: null,\n teacherDetails: null,\n isOnlyOneSessionCompleted: false,\n isMoreThanOneSessionCompleted: false,\n isDemoDone: false,\n isSubscriptionCancelled: false,\n completedSessions: 0,\n nextSessionEnd: 0,\n nextSessionStart: 0,\n upcomingSessions: [],\n showLoading: true,\n isProcessingFailed,\n };\n }\n\n const {\n completed_sessions: completedSessions = 0,\n next_session_end: nextSessionEnd,\n next_session_start: nextSessionStart,\n demo_class_status: classStatus,\n upcoming_sessions: upcomingSessions = [],\n student_demo_id: demoId = null,\n user_attempt_id: userAttemptId = null,\n } = sessionDetails;\n\n const { first_name = '', last_name = '' } = teacherDetails ?? {};\n const teacherName = `${first_name} ${last_name}`?.trim();\n\n const isDemoDone = completedSessions > 0;\n const isOnlyOneSessionCompleted = isDemoDone && completedSessions === 1;\n const isMoreThanOneSessionCompleted = completedSessions > 1;\n\n const formattedNextSessionStart = format(nextSessionStart, \"EEEE, MMM d 'at' h:mm a\");\n\n return {\n sessionDetails,\n teacherDetails,\n teacherName,\n completedSessions,\n nextSessionEnd,\n nextSessionStart,\n classStatus,\n upcomingSessions,\n isDemoDone,\n isOnlyOneSessionCompleted,\n isMoreThanOneSessionCompleted,\n demoId,\n userAttemptId,\n formattedNextSessionStart,\n };\n }, [isProcessingFailed, parentHomeData]);\n\n return parentHomeDataMemoised;\n};\n\nexport default useParentHomeData;\n"],"names":["useParentHomeData","studentId","parentHomeData","isProcessingFailed","useParentHomeGet","useMemo","teacherDetails","sessionDetails","completedSessions","nextSessionEnd","nextSessionStart","classStatus","upcomingSessions","demoId","userAttemptId","first_name","last_name","teacherName","_a","isDemoDone","isOnlyOneSessionCompleted","isMoreThanOneSessionCompleted","formattedNextSessionStart","format","useParentHomeData$1"],"mappings":";;;AAgCA,MAAMA,IAAoB,CAACC,MAAgD;AACzE,QAAM,EAAE,MAAMC,GAAgB,oBAAAC,EAAmB,IAAIC,EAAiBH,CAAS;AA4DxE,SA1DwBI,EAAQ,MAAM;;AACrC,UAAA,EAAE,iBAAiBC,IAAiB,MAAM,iBAAiBC,EAAe,IAC9EL,KAAkB;AAEpB,QAAI,CAACK;AACI,aAAA;AAAA,QACL,gBAAgB;AAAA,QAChB,gBAAgB;AAAA,QAChB,2BAA2B;AAAA,QAC3B,+BAA+B;AAAA,QAC/B,YAAY;AAAA,QACZ,yBAAyB;AAAA,QACzB,mBAAmB;AAAA,QACnB,gBAAgB;AAAA,QAChB,kBAAkB;AAAA,QAClB,kBAAkB,CAAC;AAAA,QACnB,aAAa;AAAA,QACb,oBAAAJ;AAAA,MAAA;AAIE,UAAA;AAAA,MACJ,oBAAoBK,IAAoB;AAAA,MACxC,kBAAkBC;AAAA,MAClB,oBAAoBC;AAAA,MACpB,mBAAmBC;AAAA,MACnB,mBAAmBC,IAAmB,CAAC;AAAA,MACvC,iBAAiBC,IAAS;AAAA,MAC1B,iBAAiBC,IAAgB;AAAA,IAC/B,IAAAP,GAEE,EAAE,YAAAQ,IAAa,IAAI,WAAAC,IAAY,GAAG,IAAIV,KAAkB,IACxDW,KAAcC,IAAA,GAAGH,CAAU,IAAIC,CAAS,OAA1B,gBAAAE,EAA8B,QAE5CC,IAAaX,IAAoB,GACjCY,IAA4BD,KAAcX,MAAsB,GAChEa,IAAgCb,IAAoB,GAEpDc,IAA4BC,EAAOb,GAAkB,yBAAyB;AAE7E,WAAA;AAAA,MACL,gBAAAH;AAAA,MACA,gBAAAD;AAAA,MACA,aAAAW;AAAA,MACA,mBAAAT;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,aAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,YAAAO;AAAA,MACA,2BAAAC;AAAA,MACA,+BAAAC;AAAA,MACA,QAAAR;AAAA,MACA,eAAAC;AAAA,MACA,2BAAAQ;AAAA,IAAA;AAAA,EACF,GACC,CAACnB,GAAoBD,CAAc,CAAC;AAGzC,GAEAsB,IAAexB;"}
|
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
import o from "styled-components";
|
|
2
2
|
import t from "../../../ui/layout/flex-view.js";
|
|
3
3
|
const s = o(t)`
|
|
4
|
-
max-width: 560px;
|
|
5
4
|
border: ${({ theme: e }) => `1px solid ${e.colors.BLACK_5}`};
|
|
6
|
-
|
|
5
|
+
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
6
|
+
max-width: 560px;
|
|
7
|
+
}
|
|
8
|
+
`, h = o(t)`
|
|
7
9
|
overflow-y: auto;
|
|
8
10
|
max-height: 468px;
|
|
9
11
|
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
10
12
|
max-height: unset;
|
|
11
13
|
overflow-y: hidden;
|
|
12
|
-
}
|
|
13
|
-
`,
|
|
14
|
+
})}
|
|
15
|
+
`, m = o(t)`
|
|
14
16
|
padding-top: 0;
|
|
15
17
|
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
16
18
|
max-height: 300px;
|
|
17
19
|
overflow-y: auto;
|
|
18
|
-
}
|
|
19
|
-
`,
|
|
20
|
+
})}
|
|
21
|
+
`, x = o(t)`
|
|
20
22
|
padding-bottom: 24px;
|
|
21
23
|
${({ theme: e }) => e.mediaQueries.minWidthTablet} {
|
|
22
24
|
border-top: ${({ theme: e }) => `1px solid ${e.colors.BLACK_5}`};
|
|
23
25
|
padding-bottom: 40px;
|
|
24
|
-
}
|
|
26
|
+
})}
|
|
25
27
|
`, c = o.textarea(({ theme: e }) => {
|
|
26
28
|
const {
|
|
27
29
|
colors: { WHITE: i, WHITE_T_38: r, BLACK_2: n, BLACK_5: a },
|
|
28
|
-
layout: { gutter:
|
|
30
|
+
layout: { gutter: d }
|
|
29
31
|
} = e;
|
|
30
32
|
return `border: 1px solid ${a};
|
|
31
33
|
width: 100%;
|
|
32
|
-
min-height: ${
|
|
34
|
+
min-height: ${d * 5}px;
|
|
33
35
|
padding: 16px;
|
|
34
36
|
background-color: ${n};
|
|
35
37
|
white-space: pre-line;
|
|
@@ -51,9 +53,9 @@ const s = o(t)`
|
|
|
51
53
|
});
|
|
52
54
|
export {
|
|
53
55
|
s as Container,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
m as ContentWrapper,
|
|
57
|
+
x as FooterWrapper,
|
|
58
|
+
h as OuterWrapper,
|
|
57
59
|
c as StyledTextArea
|
|
58
60
|
};
|
|
59
61
|
//# sourceMappingURL=tutor-change-styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tutor-change-styled.js","sources":["../../../../../src/features/parent-dashboard/modals/tutor-change/tutor-change-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const Container = styled(FlexView)`\n
|
|
1
|
+
{"version":3,"file":"tutor-change-styled.js","sources":["../../../../../src/features/parent-dashboard/modals/tutor-change/tutor-change-styled.tsx"],"sourcesContent":["import styled from 'styled-components';\n\nimport FlexView from '../../../ui/layout/flex-view';\n\nexport const Container = styled(FlexView)`\n border: ${({ theme }) => `1px solid ${theme.colors.BLACK_5}`};\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n max-width: 560px;\n }\n`;\n\nexport const OuterWrapper = styled(FlexView)`\n overflow-y: auto;\n max-height: 468px;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n max-height: unset;\n overflow-y: hidden;\n })}\n`;\n\nexport const ContentWrapper = styled(FlexView)`\n padding-top: 0;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n max-height: 300px;\n overflow-y: auto;\n })}\n`;\n\nexport const FooterWrapper = styled(FlexView)`\n padding-bottom: 24px;\n ${({ theme }) => theme.mediaQueries.minWidthTablet} {\n border-top: ${({ theme }) => `1px solid ${theme.colors.BLACK_5}`};\n padding-bottom: 40px;\n })}\n`;\n\nexport const StyledTextArea = styled.textarea(({ theme }) => {\n const {\n colors: { WHITE, WHITE_T_38, BLACK_2, BLACK_5 },\n layout: { gutter },\n } = theme;\n\n return `border: 1px solid ${BLACK_5};\n width: 100%;\n min-height: ${gutter * 5}px;\n padding: 16px;\n background-color: ${BLACK_2};\n white-space: pre-line;\n font-family: 'Untitled Sans Regular';\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n color: ${WHITE};\n resize: none;\n outline: none;\n &::placeholder {\n color: ${WHITE_T_38};\n }\n\n &:focus {\n outline: none;\n }\n`;\n});\n"],"names":["Container","styled","FlexView","theme","OuterWrapper","ContentWrapper","FooterWrapper","StyledTextArea","WHITE","WHITE_T_38","BLACK_2","BLACK_5","gutter"],"mappings":";;AAIa,MAAAA,IAAYC,EAAOC,CAAQ;AAAA,YAC5B,CAAC,EAAE,OAAAC,EAAM,MAAM,aAAaA,EAAM,OAAO,OAAO,EAAE;AAAA,IAC1D,CAAC,EAAE,OAAAA,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA,GAKvCC,IAAeH,EAAOC,CAAQ;AAAA;AAAA;AAAA,IAGvC,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA;AAAA,GAMvCE,IAAiBJ,EAAOC,CAAQ;AAAA;AAAA,IAEzC,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA;AAAA;AAAA;AAAA,GAMvCG,IAAgBL,EAAOC,CAAQ;AAAA;AAAA,IAExC,CAAC,EAAE,OAAAC,EAAA,MAAYA,EAAM,aAAa,cAAc;AAAA,kBAClC,CAAC,EAAE,OAAAA,EAAM,MAAM,aAAaA,EAAM,OAAO,OAAO,EAAE;AAAA;AAAA;AAAA,GAKvDI,IAAiBN,EAAO,SAAS,CAAC,EAAE,OAAAE,QAAY;AACrD,QAAA;AAAA,IACJ,QAAQ,EAAE,OAAAK,GAAO,YAAAC,GAAY,SAAAC,GAAS,SAAAC,EAAQ;AAAA,IAC9C,QAAQ,EAAE,QAAAC,EAAO;AAAA,EACf,IAAAT;AAEJ,SAAO,qBAAqBQ,CAAO;AAAA;AAAA,gBAErBC,IAAS,CAAC;AAAA;AAAA,sBAEJF,CAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMlBF,CAAK;AAAA;AAAA;AAAA;AAAA,aAIHC,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvB,CAAC;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { memo as R, useState as
|
|
2
|
+
import { memo as R, useState as h, useRef as w, useCallback as u, useEffect as A } from "react";
|
|
3
3
|
import { useTheme as E } from "styled-components";
|
|
4
4
|
import O from "../../../auth/comps/pill-button/pill-button.js";
|
|
5
|
-
import
|
|
5
|
+
import p from "../../../ui/buttons/text-button/text-button.js";
|
|
6
6
|
import I from "../../../ui/layout/flex-view.js";
|
|
7
7
|
import X from "../../../ui/modals/use-modal-actions.js";
|
|
8
8
|
import S from "../../../ui/modals/use-modal-params.js";
|
|
@@ -11,10 +11,10 @@ import { EDeviceType as k } from "../../../ui/theme/constants.js";
|
|
|
11
11
|
import { changeTutorReasons as M, TUTOR_CHANGE_REASON_IDS as v } from "./tutor-change-constants.js";
|
|
12
12
|
import { Container as B, OuterWrapper as H, ContentWrapper as _, StyledTextArea as D, FooterWrapper as y } from "./tutor-change-styled.js";
|
|
13
13
|
const G = () => {
|
|
14
|
-
const { device: f } = E(), [n, C] =
|
|
14
|
+
const { device: f } = E(), [n, C] = h(""), [l, $] = h(""), o = f <= k.MOBILE, { closeModal: c } = X(), a = w(null), { onContinue: m, demoId: d } = S(), x = u((e) => C(e), []), b = u((e) => {
|
|
15
15
|
$(e.target.value);
|
|
16
16
|
}, []), t = n === v.OTHER, T = !n || t && !l.trim(), g = u(() => {
|
|
17
|
-
c(), m(d, n, t ? l : "");
|
|
17
|
+
c(), m({ demoId: d, reason: n, otherReason: t ? l : "" });
|
|
18
18
|
}, [c, m, d, n, t, l]);
|
|
19
19
|
return A(() => {
|
|
20
20
|
var e, s;
|
|
@@ -66,7 +66,7 @@ const G = () => {
|
|
|
66
66
|
$flexColumnGapX: 1.5,
|
|
67
67
|
children: [
|
|
68
68
|
/* @__PURE__ */ r(
|
|
69
|
-
|
|
69
|
+
p,
|
|
70
70
|
{
|
|
71
71
|
label: "Continue",
|
|
72
72
|
onClick: g,
|
|
@@ -74,7 +74,7 @@ const G = () => {
|
|
|
74
74
|
disabled: T
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
|
-
/* @__PURE__ */ r(
|
|
77
|
+
/* @__PURE__ */ r(p, { label: "Close", onClick: c, color: "WHITE" })
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tutor-change.js","sources":["../../../../../src/features/parent-dashboard/modals/tutor-change/tutor-change.tsx"],"sourcesContent":["import type { ITutorChangeModalParams } from './tutor-change-types';\n\nimport { memo, useCallback, useEffect, useRef, useState, type ChangeEvent } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport PillButton from '../../../auth/comps/pill-button/pill-button';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport useModalActions from '../../../ui/modals/use-modal-actions';\nimport useModalParams from '../../../ui/modals/use-modal-params';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport { TUTOR_CHANGE_REASON_IDS, changeTutorReasons } from './tutor-change-constants';\nimport * as Styled from './tutor-change-styled';\n\nconst TutorChange = () => {\n const { device } = useTheme();\n const [reason, setReason] = useState('');\n const [otherReason, setOtherReason] = useState('');\n const isMobile = device <= EDeviceType.MOBILE;\n const { closeModal } = useModalActions();\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n const { onContinue, demoId } = useModalParams<ITutorChangeModalParams>();\n const handleSelectReason = useCallback((id: string) => setReason(id), []);\n\n const handleOtherReasonChange = useCallback((event: ChangeEvent<HTMLTextAreaElement>) => {\n setOtherReason(event.target.value);\n }, []);\n const isOtherReasonSelected = reason === TUTOR_CHANGE_REASON_IDS.OTHER;\n const isSubmitDisabled = !reason || (isOtherReasonSelected && !otherReason.trim());\n\n const handleContinue = useCallback(() => {\n closeModal();\n onContinue(demoId, reason, isOtherReasonSelected ? otherReason : '');\n }, [closeModal, onContinue, demoId, reason, isOtherReasonSelected, otherReason]);\n\n useEffect(() => {\n if (isOtherReasonSelected && textAreaRef.current) {\n textAreaRef.current?.scrollIntoView({ behavior: 'smooth' });\n textAreaRef.current?.focus();\n }\n }, [isOtherReasonSelected]);\n\n return (\n <Styled.Container $background=\"BLACK_2\" $width=\"100%\" $borderColor=\"BLACK_5\">\n <Styled.OuterWrapper $flex={1}>\n <FlexView $gutterX={isMobile ? 1 : 2.5} $gapX={isMobile ? 1.5 : 2.5}>\n <Text $renderAs=\"ah4-bold\" $renderOnMobileAs=\"ab1-bold\" $color=\"WHITE\">\n What didn't work well with the current tutor?\n </Text>\n </FlexView>\n <Styled.ContentWrapper\n $flex={1}\n $gutterX={isMobile ? 1 : 2.5}\n $gapX={isMobile ? 1 : 2.5}\n $width={'100%'}\n $alignItems=\"flex-start\"\n $flexRowGapX={1}\n >\n {changeTutorReasons.map(({ id, label }) => (\n <PillButton\n selected={reason === id}\n key={id}\n label={label}\n id={id}\n onClick={handleSelectReason}\n isTransparent\n />\n ))}\n {isOtherReasonSelected && (\n <Styled.StyledTextArea\n placeholder=\"Tell us more about your experience...\"\n id=\"text-area\"\n ref={textAreaRef}\n value={otherReason}\n onChange={handleOtherReasonChange}\n />\n )}\n </Styled.ContentWrapper>\n </Styled.OuterWrapper>\n <Styled.FooterWrapper\n $gutterX={isMobile ? 1 : 2.5}\n $gapX={isMobile ? 1 : 2.5}\n $flexDirection=\"row\"\n $flexColumnGapX={1.5}\n >\n <TextButton\n label=\"Continue\"\n onClick={handleContinue}\n color=\"WHITE\"\n disabled={isSubmitDisabled}\n />\n <TextButton label=\"Close\" onClick={closeModal} color=\"WHITE\" />\n </Styled.FooterWrapper>\n </Styled.Container>\n );\n};\n\nexport default memo(TutorChange);\n"],"names":["TutorChange","device","useTheme","reason","setReason","useState","otherReason","setOtherReason","isMobile","EDeviceType","closeModal","useModalActions","textAreaRef","useRef","onContinue","demoId","useModalParams","handleSelectReason","useCallback","id","handleOtherReasonChange","event","isOtherReasonSelected","TUTOR_CHANGE_REASON_IDS","isSubmitDisabled","handleContinue","useEffect","_a","_b","jsxs","Styled.Container","Styled.OuterWrapper","jsx","FlexView","Text","Styled.ContentWrapper","changeTutorReasons","label","PillButton","Styled.StyledTextArea","Styled.FooterWrapper","TextButton","tutorChange","memo"],"mappings":";;;;;;;;;;;;AAeA,MAAMA,IAAc,MAAM;AAClB,QAAA,EAAE,QAAAC,MAAWC,KACb,CAACC,GAAQC,CAAS,IAAIC,EAAS,EAAE,GACjC,CAACC,GAAaC,CAAc,IAAIF,EAAS,EAAE,GAC3CG,IAAWP,KAAUQ,EAAY,QACjC,EAAE,YAAAC,MAAeC,KACjBC,IAAcC,EAAmC,IAAI,GACrD,EAAE,YAAAC,GAAY,QAAAC,EAAO,IAAIC,EAAwC,GACjEC,IAAqBC,EAAY,CAACC,MAAef,EAAUe,CAAE,GAAG,CAAA,CAAE,GAElEC,IAA0BF,EAAY,CAACG,MAA4C;AACxE,IAAAd,EAAAc,EAAM,OAAO,KAAK;AAAA,EACnC,GAAG,CAAE,CAAA,GACCC,IAAwBnB,MAAWoB,EAAwB,OAC3DC,IAAmB,CAACrB,KAAWmB,KAAyB,CAAChB,EAAY,QAErEmB,IAAiBP,EAAY,MAAM;AAC5B,IAAAR,KACXI,
|
|
1
|
+
{"version":3,"file":"tutor-change.js","sources":["../../../../../src/features/parent-dashboard/modals/tutor-change/tutor-change.tsx"],"sourcesContent":["import type { ITutorChangeModalParams } from './tutor-change-types';\n\nimport { memo, useCallback, useEffect, useRef, useState, type ChangeEvent } from 'react';\nimport { useTheme } from 'styled-components';\n\nimport PillButton from '../../../auth/comps/pill-button/pill-button';\nimport TextButton from '../../../ui/buttons/text-button/text-button';\nimport FlexView from '../../../ui/layout/flex-view';\nimport useModalActions from '../../../ui/modals/use-modal-actions';\nimport useModalParams from '../../../ui/modals/use-modal-params';\nimport Text from '../../../ui/text/text';\nimport { EDeviceType } from '../../../ui/theme/constants';\nimport { TUTOR_CHANGE_REASON_IDS, changeTutorReasons } from './tutor-change-constants';\nimport * as Styled from './tutor-change-styled';\n\nconst TutorChange = () => {\n const { device } = useTheme();\n const [reason, setReason] = useState('');\n const [otherReason, setOtherReason] = useState('');\n const isMobile = device <= EDeviceType.MOBILE;\n const { closeModal } = useModalActions();\n const textAreaRef = useRef<HTMLTextAreaElement | null>(null);\n const { onContinue, demoId } = useModalParams<ITutorChangeModalParams>();\n const handleSelectReason = useCallback((id: string) => setReason(id), []);\n\n const handleOtherReasonChange = useCallback((event: ChangeEvent<HTMLTextAreaElement>) => {\n setOtherReason(event.target.value);\n }, []);\n const isOtherReasonSelected = reason === TUTOR_CHANGE_REASON_IDS.OTHER;\n const isSubmitDisabled = !reason || (isOtherReasonSelected && !otherReason.trim());\n\n const handleContinue = useCallback(() => {\n closeModal();\n onContinue({ demoId, reason, otherReason: isOtherReasonSelected ? otherReason : '' });\n }, [closeModal, onContinue, demoId, reason, isOtherReasonSelected, otherReason]);\n\n useEffect(() => {\n if (isOtherReasonSelected && textAreaRef.current) {\n textAreaRef.current?.scrollIntoView({ behavior: 'smooth' });\n textAreaRef.current?.focus();\n }\n }, [isOtherReasonSelected]);\n\n return (\n <Styled.Container $background=\"BLACK_2\" $width=\"100%\" $borderColor=\"BLACK_5\">\n <Styled.OuterWrapper $flex={1}>\n <FlexView $gutterX={isMobile ? 1 : 2.5} $gapX={isMobile ? 1.5 : 2.5}>\n <Text $renderAs=\"ah4-bold\" $renderOnMobileAs=\"ab1-bold\" $color=\"WHITE\">\n What didn't work well with the current tutor?\n </Text>\n </FlexView>\n <Styled.ContentWrapper\n $flex={1}\n $gutterX={isMobile ? 1 : 2.5}\n $gapX={isMobile ? 1 : 2.5}\n $width={'100%'}\n $alignItems=\"flex-start\"\n $flexRowGapX={1}\n >\n {changeTutorReasons.map(({ id, label }) => (\n <PillButton\n selected={reason === id}\n key={id}\n label={label}\n id={id}\n onClick={handleSelectReason}\n isTransparent\n />\n ))}\n {isOtherReasonSelected && (\n <Styled.StyledTextArea\n placeholder=\"Tell us more about your experience...\"\n id=\"text-area\"\n ref={textAreaRef}\n value={otherReason}\n onChange={handleOtherReasonChange}\n />\n )}\n </Styled.ContentWrapper>\n </Styled.OuterWrapper>\n <Styled.FooterWrapper\n $gutterX={isMobile ? 1 : 2.5}\n $gapX={isMobile ? 1 : 2.5}\n $flexDirection=\"row\"\n $flexColumnGapX={1.5}\n >\n <TextButton\n label=\"Continue\"\n onClick={handleContinue}\n color=\"WHITE\"\n disabled={isSubmitDisabled}\n />\n <TextButton label=\"Close\" onClick={closeModal} color=\"WHITE\" />\n </Styled.FooterWrapper>\n </Styled.Container>\n );\n};\n\nexport default memo(TutorChange);\n"],"names":["TutorChange","device","useTheme","reason","setReason","useState","otherReason","setOtherReason","isMobile","EDeviceType","closeModal","useModalActions","textAreaRef","useRef","onContinue","demoId","useModalParams","handleSelectReason","useCallback","id","handleOtherReasonChange","event","isOtherReasonSelected","TUTOR_CHANGE_REASON_IDS","isSubmitDisabled","handleContinue","useEffect","_a","_b","jsxs","Styled.Container","Styled.OuterWrapper","jsx","FlexView","Text","Styled.ContentWrapper","changeTutorReasons","label","P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