@edx/frontend-app-subscription-learner-dashboard 1.55.4 → 1.56.0

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.
Files changed (37) hide show
  1. package/dist/containers/ProgramDashboard/ProgramProgress/InProgressTabData/index.js +4 -1
  2. package/dist/containers/ProgramDashboard/ProgramProgress/InProgressTabData/index.js.map +1 -1
  3. package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.js +4 -1
  4. package/dist/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.js.map +1 -1
  5. package/dist/containers/ProgramDashboard/ProgramProgress/messages.d.ts +5 -0
  6. package/dist/containers/ProgramDashboard/ProgramProgress/messages.js +6 -1
  7. package/dist/containers/ProgramDashboard/ProgramProgress/messages.js.map +1 -1
  8. package/dist/data/services/segment/utils.js +2 -1
  9. package/dist/data/services/segment/utils.js.map +1 -1
  10. package/dist/routes.js +2 -0
  11. package/dist/routes.js.map +1 -1
  12. package/dist/tracking/index.d.ts +1 -0
  13. package/dist/tracking/index.js +1 -0
  14. package/dist/tracking/index.js.map +1 -1
  15. package/dist/tracking/trackingContext.d.ts +11 -0
  16. package/dist/tracking/trackingContext.js +18 -0
  17. package/dist/tracking/trackingContext.js.map +1 -0
  18. package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingElements/ProgressiveProfilingElements.js +1 -1
  19. package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingElements/ProgressiveProfilingElements.js.map +1 -1
  20. package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.js +3 -2
  21. package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.js.map +1 -1
  22. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/BannerEntry.js +1 -1
  23. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/BannerEntry.js.map +1 -1
  24. package/dist/widgets/ProgressiveProfilingQuiz/data/constants.d.ts +1 -0
  25. package/dist/widgets/ProgressiveProfilingQuiz/data/constants.js +1 -0
  26. package/dist/widgets/ProgressiveProfilingQuiz/data/constants.js.map +1 -1
  27. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.js +12 -5
  28. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.js.map +1 -1
  29. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js +9 -2
  30. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js.map +1 -1
  31. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js +10 -3
  32. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js.map +1 -1
  33. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/ViewResultsButton.js +1 -1
  34. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/ViewResultsButton.js.map +1 -1
  35. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.js +11 -3
  36. package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.js.map +1 -1
  37. package/package.json +7 -1
@@ -19,7 +19,7 @@ export const InProgressTabData = () => {
19
19
  const shouldShowCompletedMessage = !inProgressCount && !remainingCount && completedCount > 0;
20
20
  const progressCards = inProgressData.map((course) => {
21
21
  const courseRuns = course.courseRuns || [];
22
- const [{ pacingType = '', enrollmentDate = '', end = '', courseUrl = '', upgradeUrl = '', seats = [], key = '' } = {}] = Array.isArray(courseRuns) ? courseRuns : [];
22
+ const [{ pacingType = '', enrollmentDate = '', end = '', courseUrl = '', upgradeUrl = '', seats = [], key = '', isAudit, canUpgrade, isAuditAccessExpired } = {}] = Array.isArray(courseRuns) ? courseRuns : [];
23
23
  const progressCardData = {
24
24
  title: course.title,
25
25
  enrollment_date: enrollmentDate,
@@ -32,6 +32,9 @@ export const InProgressTabData = () => {
32
32
  seats: seats || [],
33
33
  expired: course.expired || false, // using expired from course object to determine if the course is expired as per condition on confluence and learners dashboard code.
34
34
  courseRunKey: key || '',
35
+ isAudit: isAudit || false,
36
+ canUpgradeCourse: canUpgrade || false,
37
+ isAuditAccessExpired: isAuditAccessExpired || false,
35
38
  };
36
39
  return (_jsx(ProgressCard, { progressCardData: progressCardData, isLoading: isLoading, tabType: inProgressTabType }, course.key));
37
40
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/InProgressTabData/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,iBAAiB,GAAO,GAAG,EAAE;;IACxC,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE,CAAC;IAE7D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,UAAU,CAAC;IACnD,MAAM,cAAc,GAAG,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,0CAAE,MAAM,KAAI,CAAC,CAAC;IAC3D,MAAM,cAAc,GAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,KAAI,EAAE,CAAC;IACpD,MAAM,cAAc,GAAG,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,SAAS,0CAAE,MAAM,KAAI,CAAC,CAAC;IAC1D,MAAM,eAAe,GAAG,cAAc,CAAC,MAAM,CAAC;IAC9C,MAAM,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KAAK,IAAI,EAAE;YAClB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK,EAAE,qIAAqI;YACvK,YAAY,EAAE,GAAG,IAAI,EAAE;SACxB,CAAC;QAEF,OAAO,CACL,KAAC,YAAY,IAEX,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,iBAAiB,IAHrB,MAAM,CAAC,GAAG,CAIf,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,wBACG,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,CACrB,aAAa,CACd,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAC/B,sBAAI,aAAa,CAAC,QAAQ,CAAC,yCAAyC,CAAC,GAAK,CAC3E,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAC/B,sBAAI,aAAa,CAAC,QAAQ,CAAC,yCAAyC,CAAC,GAAK,CAC3E,CAAC,CAAC,CAAC,IAAI,GACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useProgressData } from '@src/hooks';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { ProgressCard } from '../ProgressCard';\nimport messages from '../messages';\n\nexport const InProgressTabData: FC = () => {\n const { programProgressData, isLoading } = useProgressData();\n\n const { formatMessage } = useIntl();\n const courseData = programProgressData?.courseData;\n const remainingCount = courseData?.notStarted?.length || 0;\n const inProgressData = courseData?.inProgress || [];\n const completedCount = courseData?.completed?.length || 0;\n const inProgressCount = inProgressData.length;\n const programType = programProgressData?.programData?.type || '';\n const checkoutUrl = programProgressData?.urls?.buyButtonUrl || '';\n const inProgressTabType = formatMessage(messages.programProgressInProgressTab).toLowerCase();\n\n const shouldShowRemainingMessage = !inProgressCount && remainingCount > 0;\n const shouldShowCompletedMessage = !inProgressCount && !remainingCount && completedCount > 0;\n\n const progressCards = inProgressData.map((course) => {\n const courseRuns = course.courseRuns || [];\n const [{ pacingType = '', enrollmentDate = '', end = '', courseUrl = '', upgradeUrl = '', seats = [], key = '' } = {}] = Array.isArray(courseRuns) ? courseRuns : [];\n\n const progressCardData = {\n title: course.title,\n enrollment_date: enrollmentDate,\n end: end || '',\n pacingType: pacingType,\n courseUrl: courseUrl || '',\n upgradeUrl: upgradeUrl || '',\n programType: programType || '',\n checkoutUrl: checkoutUrl || '',\n seats: seats || [],\n expired: course.expired || false, // using expired from course object to determine if the course is expired as per condition on confluence and learners dashboard code.\n courseRunKey: key || '',\n };\n\n return (\n <ProgressCard\n key={course.key}\n progressCardData={progressCardData}\n isLoading={isLoading}\n tabType={inProgressTabType}\n />\n );\n });\n\n return (\n <div>\n {inProgressCount > 0 ? (\n progressCards\n ) : shouldShowRemainingMessage ? (\n <p>{formatMessage(messages.programProgressInProgressRemainingCourses)}</p>\n ) : shouldShowCompletedMessage ? (\n <p>{formatMessage(messages.programProgressInProgressCompletedCourses)}</p>\n ) : null}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/InProgressTabData/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,MAAM,CAAC,MAAM,iBAAiB,GAAO,GAAG,EAAE;;IACxC,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE,CAAC;IAE7D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,UAAU,CAAC;IACnD,MAAM,cAAc,GAAG,CAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,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AU,CAAC,CAAC,CAAC,EAAE,CAAC;QAEhN,MAAM,gBAAgB,GAAG;YACvB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,eAAe,EAAE,cAAc;YAC/B,GAAG,EAAE,GAAG,IAAI,EAAE;YACd,UAAU,EAAE,UAAU;YACtB,SAAS,EAAE,SAAS,IAAI,EAAE;YAC1B,UAAU,EAAE,UAAU,IAAI,EAAE;YAC5B,WAAW,EAAE,WAAW,IAAI,EAAE;YAC9B,WAAW,EAAE,WAAW,IAAI,EAAE;YAC9B,KAAK,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK,EAAE,qIAAqI;YACvK,YAAY,EAAE,GAAG,IAAI,EAAE;YACvB,OAAO,EAAE,OAAO,IAAI,KAAK;YACzB,gBAAgB,EAAE,UAAU,IAAI,KAAK;YACrC,oBAAoB,EAAE,oBAAoB,IAAI,KAAK;SACpD,CAAC;QAEF,OAAO,CACL,KAAC,YAAY,IAEX,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,iBAAiB,IAHrB,MAAM,CAAC,GAAG,CAIf,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,wBACG,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,CACrB,aAAa,CACd,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAC/B,sBAAI,aAAa,CAAC,QAAQ,CAAC,yCAAyC,CAAC,GAAK,CAC3E,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAC/B,sBAAI,aAAa,CAAC,QAAQ,CAAC,yCAAyC,CAAC,GAAK,CAC3E,CAAC,CAAC,CAAC,IAAI,GACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useProgressData } from '@src/hooks';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { ProgressCard } from '../ProgressCard';\nimport messages from '../messages';\n\nexport const InProgressTabData: FC = () => {\n const { programProgressData, isLoading } = useProgressData();\n\n const { formatMessage } = useIntl();\n const courseData = programProgressData?.courseData;\n const remainingCount = courseData?.notStarted?.length || 0;\n const inProgressData = courseData?.inProgress || [];\n const completedCount = courseData?.completed?.length || 0;\n const inProgressCount = inProgressData.length;\n const programType = programProgressData?.programData?.type || '';\n const checkoutUrl = programProgressData?.urls?.buyButtonUrl || '';\n const inProgressTabType = formatMessage(messages.programProgressInProgressTab).toLowerCase();\n\n const shouldShowRemainingMessage = !inProgressCount && remainingCount > 0;\n const shouldShowCompletedMessage = !inProgressCount && !remainingCount && completedCount > 0;\n\n const progressCards = inProgressData.map((course) => {\n const courseRuns = course.courseRuns || [];\n const [{ pacingType = '', enrollmentDate = '', end = '', courseUrl = '', upgradeUrl = '', seats = [], key = '', isAudit, canUpgrade, isAuditAccessExpired } = {}] = Array.isArray(courseRuns) ? courseRuns : [];\n\n const progressCardData = {\n title: course.title,\n enrollment_date: enrollmentDate,\n end: end || '',\n pacingType: pacingType,\n courseUrl: courseUrl || '',\n upgradeUrl: upgradeUrl || '',\n programType: programType || '',\n checkoutUrl: checkoutUrl || '',\n seats: seats || [],\n expired: course.expired || false, // using expired from course object to determine if the course is expired as per condition on confluence and learners dashboard code.\n courseRunKey: key || '',\n isAudit: isAudit || false,\n canUpgradeCourse: canUpgrade || false,\n isAuditAccessExpired: isAuditAccessExpired || false,\n };\n\n return (\n <ProgressCard\n key={course.key}\n progressCardData={progressCardData}\n isLoading={isLoading}\n tabType={inProgressTabType}\n />\n );\n });\n\n return (\n <div>\n {inProgressCount > 0 ? (\n progressCards\n ) : shouldShowRemainingMessage ? (\n <p>{formatMessage(messages.programProgressInProgressRemainingCourses)}</p>\n ) : shouldShowCompletedMessage ? (\n <p>{formatMessage(messages.programProgressInProgressCompletedCourses)}</p>\n ) : null}\n </div>\n );\n};\n"]}
@@ -11,7 +11,7 @@ import { getCertificatePriceString } from '../../data/util';
11
11
  import { UpgradeCourseButton } from '../ProgressCardActions/UpgradeCourseButton';
12
12
  export const ProgressCard = ({ progressCardData, isLoading, tabType }) => {
13
13
  const { formatMessage, formatDate } = useIntl();
14
- const { title, enrollment_date, certificateIssuedDate, certificateUrl, courseUrl, upgradeUrl, programType, checkoutUrl, expired, seats, description, destinationUrl, courseRunKey } = progressCardData;
14
+ const { title, enrollment_date, certificateIssuedDate, certificateUrl, courseUrl, upgradeUrl, programType, checkoutUrl, expired, seats, description, destinationUrl, courseRunKey, isAudit, canUpgradeCourse } = progressCardData;
15
15
  const inProgressTabKey = formatMessage(messages.programProgressInProgressTab).toLowerCase();
16
16
  const isInProgressTab = tabType === inProgressTabKey;
17
17
  const isRemainingTab = tabType === formatMessage(messages.programProgressRemainingTab).toLowerCase();
@@ -32,6 +32,9 @@ export const ProgressCard = ({ progressCardData, isLoading, tabType }) => {
32
32
  ? formatMessage(messages.programProgressCardIncludedInSubscriptionText)
33
33
  : formatMessage(messages.programProgressCardEnrollText);
34
34
  }
35
+ if (isInProgressTab && isAudit && canUpgradeCourse) {
36
+ enrollmentInfo = `${formatMessage(messages.programProgressCardAuditTrack)} ${formatMessage(messages.programProgressCardEnrollText)}`;
37
+ }
35
38
  // if enrollment start exists
36
39
  if (!isPathwaysTab && !isRemainingTab && enrollment_date) {
37
40
  const enrollment_date_formatted = dateFormatter(formatDate, enrollment_date, 'short');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAA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SAAS,CAAC,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC,UAAU,GAAG,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,GACvE,GACE,IACF,CACP,EACA,qBAAqB;+BACnB,WAAW;+BACX,UAAU;+BACV,CACD,MAAC,GAAG,IAAC,SAAS,EAAC,yEAAyE,aACtF,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,wDAAwD,YACpF,eAAM,SAAS,EAAC,YAAY,YACzB,aAAa,CAAC,QAAQ,CAAC,gDAAgD,CAAC,GACpE,GACH,EACN,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,mDAAmD,YAC/E,KAAC,kBAAkB,IACjB,OAAO,EAAC,OAAO,EACf,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC,kDAAkD,EAAE;gDACrF,KAAK,EAAE,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC;6CAC9C,CAAC,GACF,GACE,IACF,CACP,IACA,CACJ,IAEY,GACV,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { Card, Row, Col } from '@openedx/paragon';\nimport { getSiteConfig, useIntl } from '@openedx/frontend-base';\n\nimport { ProgressCardProps } from '../../data/types';\nimport messages from '../messages';\nimport './index.scss';\nimport { ProgressCardActions } from '../ProgressCardActions';\nimport { dateFormatter } from '@src/utils/dateFormatter';\nimport { ProgressCardButton } from '../ProgressCardActions/ProgressCardButton';\nimport { PROGRAM_TYPE_MAP } from '../../data/constants';\nimport { getCertificatePriceString } from '../../data/util';\nimport { UpgradeCourseButton } from '../ProgressCardActions/UpgradeCourseButton';\n\nexport const ProgressCard: FC<ProgressCardProps> = ({ progressCardData, isLoading, tabType }) => {\n const { formatMessage, formatDate } = useIntl();\n\n const { title, enrollment_date, certificateIssuedDate, certificateUrl, courseUrl, upgradeUrl, programType, checkoutUrl, expired, seats, description, destinationUrl, courseRunKey } = progressCardData;\n\n const inProgressTabKey = formatMessage(messages.programProgressInProgressTab).toLowerCase();\n const isInProgressTab = tabType === inProgressTabKey;\n const isRemainingTab = tabType === formatMessage(messages.programProgressRemainingTab).toLowerCase();\n const isPathwaysTab = tabType === formatMessage(messages.programProgressPathwaysTab).toLowerCase();\n const isProfessionalProgram = programType === PROGRAM_TYPE_MAP.PROFESSIONAL_CERTIFICATE;\n const isXSeriesProgram = programType === PROGRAM_TYPE_MAP.XSERIES;\n const isMicroMastersProgram = programType === PROGRAM_TYPE_MAP.MICROMASTERS;\n /*\n - Formatting pacing type safely\n - replace underscores with spaces\n - capitalize first letter of each word\n - example: 'self_paced' -> 'Self Paced'\n */\n // base string; pathways tab has no enrollment/subscription status\n let enrollmentInfo = '';\n if (!isPathwaysTab) {\n enrollmentInfo = isRemainingTab\n ? formatMessage(messages.programProgressCardIncludedInSubscriptionText)\n : formatMessage(messages.programProgressCardEnrollText);\n }\n\n // if enrollment start exists\n if (!isPathwaysTab && !isRemainingTab && enrollment_date) {\n const enrollment_date_formatted = dateFormatter(formatDate, enrollment_date, 'short');\n\n enrollmentInfo = enrollmentInfo && `${enrollmentInfo} ${enrollment_date_formatted}`;\n }\n\n // using expired key from course object to determine if the course is expired as per condition on confluence and learners dashboard code.\n const canUpgrade = Boolean(upgradeUrl) && !expired;\n return (\n <Card className=\"progress-card mb-3\" data-testid=\"progress-card\" isLoading={isLoading}>\n <Card.Section className=\"pt-3 pb-2 px-4\">\n <Row className=\"mb-2\">\n <Col xs={12}>\n {isPathwaysTab ? (\n <h5 className=\"mb-1 font-weight-bold card-title\">{title}</h5>\n ) : (\n <h4 className=\"mb-1 font-weight-bold card-title\">{title}</h4>\n )}\n <div className=\"card-description\">\n {enrollmentInfo}\n {description && (\n <>\n {description}\n </>\n )}\n </div>\n </Col>\n <ProgressCardActions tabType={tabType} redirectUrl={destinationUrl || courseUrl} />\n </Row>\n\n {tabType === (formatMessage(messages.programProgressCompletedTab).toLowerCase()) && (\n <Row className=\"pt-3 pb-2 px-2 border-top border-2 border-muted mb-2 align-items-center\">\n <Col xs={12} className=\"d-flex justify-content-between align-items-center px-0\">\n <span className=\"text-start\">\n {certificateIssuedDate && (\n formatMessage(messages.programProgressCardCompletedCertificateText, {\n certificateDate: (certificateIssuedDate ? dateFormatter(formatDate, certificateIssuedDate, 'short') : ''),\n })\n )}\n </span>\n\n <ProgressCardButton variant=\"brand\" redirectUrl={certificateUrl ? `${getSiteConfig().lmsBaseUrl}${certificateUrl}` : ''} buttonText={formatMessage(messages.programProgressCardCompletedCertificateButton)} />\n </Col>\n </Row>\n )}\n\n {isInProgressTab && (\n <>\n {(isProfessionalProgram || isXSeriesProgram)\n && canUpgrade\n && getCertificatePriceString(seats)\n && (\n <Row className=\"pt-3 pb-2 px-2 border-top border-2 border-muted mb-2 align-items-center\">\n <Col xs={12} md={8} className=\"d-flex justify-content-between align-items-center px-0\">\n <span className=\"text-start\">\n {formatMessage(messages.programProgressInProgressProfessionalCertificate)}\n </span>\n </Col>\n <Col xs={12} md={4} className=\"d-flex justify-content-between align-items-center px-0\">\n <UpgradeCourseButton\n variant=\"outline-brand\"\n buttonText={formatMessage(messages.programProgressCardUpgradeButton)}\n title={title}\n price={getCertificatePriceString(seats)}\n courseRunKey={courseRunKey || ''}\n courseUrl={courseUrl ? `${getSiteConfig().lmsBaseUrl}${courseUrl}` : ''}\n />\n </Col>\n </Row>\n )}\n {isMicroMastersProgram\n && checkoutUrl\n && canUpgrade\n && (\n <Row className=\"pt-3 pb-2 px-2 border-top border-2 border-muted mb-2 align-items-center\">\n <Col xs={12} md={8} className=\"d-flex justify-content-between align-items-center px-0\">\n <span className=\"text-start\">\n {formatMessage(messages.programProgressInProgressMicromastersCertificate)}\n </span>\n </Col>\n <Col xs={12} md={4} className=\"d-flex justify-content-between align-items-center\">\n <ProgressCardButton\n variant=\"brand\"\n redirectUrl={checkoutUrl}\n buttonText={formatMessage(messages.programProgressInProgressCourseMicromastersUpgrade, {\n price: getCertificatePriceString(seats, true),\n })}\n />\n </Col>\n </Row>\n )}\n </>\n )}\n\n </Card.Section>\n </Card>\n );\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/containers/ProgramDashboard/ProgramProgress/ProgressCard/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF,MAAM,CAAC,MAAM,YAAY,GAA0B,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;IAC9F,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,CAAC;IAEhD,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,CAAC;IAElO,MAAM,gBAAgB,GAAG,aAAa,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC,WAAW,EAAE,CAA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ACf,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC,kDAAkD,EAAE;gDACrF,KAAK,EAAE,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC;6CAC9C,CAAC,GACF,GACE,IACF,CACP,IACA,CACJ,IAEY,GACV,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { Card, Row, Col } from '@openedx/paragon';\nimport { getSiteConfig, useIntl } from '@openedx/frontend-base';\n\nimport { ProgressCardProps } from '../../data/types';\nimport messages from '../messages';\nimport './index.scss';\nimport { ProgressCardActions } from '../ProgressCardActions';\nimport { dateFormatter } from '@src/utils/dateFormatter';\nimport { ProgressCardButton } from '../ProgressCardActions/ProgressCardButton';\nimport { PROGRAM_TYPE_MAP } from '../../data/constants';\nimport { getCertificatePriceString } from '../../data/util';\nimport { UpgradeCourseButton } from '../ProgressCardActions/UpgradeCourseButton';\n\nexport const ProgressCard: FC<ProgressCardProps> = ({ progressCardData, isLoading, tabType }) => {\n const { formatMessage, formatDate } = useIntl();\n\n const { title, enrollment_date, certificateIssuedDate, certificateUrl, courseUrl, upgradeUrl, programType, checkoutUrl, expired, seats, description, destinationUrl, courseRunKey, isAudit, canUpgradeCourse } = progressCardData;\n\n const inProgressTabKey = formatMessage(messages.programProgressInProgressTab).toLowerCase();\n const isInProgressTab = tabType === inProgressTabKey;\n const isRemainingTab = tabType === formatMessage(messages.programProgressRemainingTab).toLowerCase();\n const isPathwaysTab = tabType === formatMessage(messages.programProgressPathwaysTab).toLowerCase();\n const isProfessionalProgram = programType === PROGRAM_TYPE_MAP.PROFESSIONAL_CERTIFICATE;\n const isXSeriesProgram = programType === PROGRAM_TYPE_MAP.XSERIES;\n const isMicroMastersProgram = programType === PROGRAM_TYPE_MAP.MICROMASTERS;\n /*\n - Formatting pacing type safely\n - replace underscores with spaces\n - capitalize first letter of each word\n - example: 'self_paced' -> 'Self Paced'\n */\n // base string; pathways tab has no enrollment/subscription status\n let enrollmentInfo = '';\n if (!isPathwaysTab) {\n enrollmentInfo = isRemainingTab\n ? formatMessage(messages.programProgressCardIncludedInSubscriptionText)\n : formatMessage(messages.programProgressCardEnrollText);\n }\n\n if (isInProgressTab && isAudit && canUpgradeCourse) {\n enrollmentInfo = `${formatMessage(messages.programProgressCardAuditTrack)} ${formatMessage(messages.programProgressCardEnrollText)}`;\n }\n\n // if enrollment start exists\n if (!isPathwaysTab && !isRemainingTab && enrollment_date) {\n const enrollment_date_formatted = dateFormatter(formatDate, enrollment_date, 'short');\n\n enrollmentInfo = enrollmentInfo && `${enrollmentInfo} ${enrollment_date_formatted}`;\n }\n\n // using expired key from course object to determine if the course is expired as per condition on confluence and learners dashboard code.\n const canUpgrade = Boolean(upgradeUrl) && !expired;\n return (\n <Card className=\"progress-card mb-3\" data-testid=\"progress-card\" isLoading={isLoading}>\n <Card.Section className=\"pt-3 pb-2 px-4\">\n <Row className=\"mb-2\">\n <Col xs={12}>\n {isPathwaysTab ? (\n <h5 className=\"mb-1 font-weight-bold card-title\">{title}</h5>\n ) : (\n <h4 className=\"mb-1 font-weight-bold card-title\">{title}</h4>\n )}\n <div className=\"card-description\">\n {enrollmentInfo}\n {description && (\n <>\n {description}\n </>\n )}\n </div>\n </Col>\n <ProgressCardActions tabType={tabType} redirectUrl={destinationUrl || courseUrl} />\n </Row>\n\n {tabType === (formatMessage(messages.programProgressCompletedTab).toLowerCase()) && (\n <Row className=\"pt-3 pb-2 px-2 border-top border-2 border-muted mb-2 align-items-center\">\n <Col xs={12} className=\"d-flex justify-content-between align-items-center px-0\">\n <span className=\"text-start\">\n {certificateIssuedDate && (\n formatMessage(messages.programProgressCardCompletedCertificateText, {\n certificateDate: (certificateIssuedDate ? dateFormatter(formatDate, certificateIssuedDate, 'short') : ''),\n })\n )}\n </span>\n\n <ProgressCardButton variant=\"brand\" redirectUrl={certificateUrl ? `${getSiteConfig().lmsBaseUrl}${certificateUrl}` : ''} buttonText={formatMessage(messages.programProgressCardCompletedCertificateButton)} />\n </Col>\n </Row>\n )}\n\n {isInProgressTab && (\n <>\n {(isProfessionalProgram || isXSeriesProgram)\n && canUpgrade\n && getCertificatePriceString(seats)\n && (\n <Row className=\"pt-3 pb-2 px-2 border-top border-2 border-muted mb-2 align-items-center\">\n <Col xs={12} md={8} className=\"d-flex justify-content-between align-items-center px-0\">\n <span className=\"text-start\">\n {formatMessage(messages.programProgressInProgressProfessionalCertificate)}\n </span>\n </Col>\n <Col xs={12} md={4} className=\"d-flex justify-content-between align-items-center px-0\">\n <UpgradeCourseButton\n variant=\"outline-brand\"\n buttonText={formatMessage(messages.programProgressCardUpgradeButton)}\n title={title}\n price={getCertificatePriceString(seats)}\n courseRunKey={courseRunKey || ''}\n courseUrl={courseUrl ? `${getSiteConfig().lmsBaseUrl}${courseUrl}` : ''}\n />\n </Col>\n </Row>\n )}\n {isMicroMastersProgram\n && checkoutUrl\n && canUpgrade\n && (\n <Row className=\"pt-3 pb-2 px-2 border-top border-2 border-muted mb-2 align-items-center\">\n <Col xs={12} md={8} className=\"d-flex justify-content-between align-items-center px-0\">\n <span className=\"text-start\">\n {formatMessage(messages.programProgressInProgressMicromastersCertificate)}\n </span>\n </Col>\n <Col xs={12} md={4} className=\"d-flex justify-content-between align-items-center\">\n <ProgressCardButton\n variant=\"brand\"\n redirectUrl={checkoutUrl}\n buttonText={formatMessage(messages.programProgressInProgressCourseMicromastersUpgrade, {\n price: getCertificatePriceString(seats, true),\n })}\n />\n </Col>\n </Row>\n )}\n </>\n )}\n\n </Card.Section>\n </Card>\n );\n};\n"]}
@@ -239,5 +239,10 @@ declare const messages: {
239
239
  id: string;
240
240
  description: string;
241
241
  };
242
+ programProgressCardAuditTrack: {
243
+ defaultMessage: string;
244
+ id: string;
245
+ description: string;
246
+ };
242
247
  };
243
248
  export default messages;
@@ -51,7 +51,7 @@ const messages = defineMessages({
51
51
  description: 'text to display on the progress card for the resume course button',
52
52
  },
53
53
  programProgressCardUpgradeButton: {
54
- defaultMessage: 'Upgrade with your subscription',
54
+ defaultMessage: 'Upgrade with my subscription',
55
55
  id: 'program.progress.card.upgrade.button.text',
56
56
  description: 'text to display on the progress card for the upgrade button',
57
57
  },
@@ -240,6 +240,11 @@ const messages = defineMessages({
240
240
  id: 'program.progress.xseries.certificate.label',
241
241
  description: 'Label for the XSeries certificate string.',
242
242
  },
243
+ programProgressCardAuditTrack: {
244
+ defaultMessage: 'Audit-track.',
245
+ id: 'program.progress.card.audit.track',
246
+ description: 'Text to display on the progress card for courses that are on the audit track.',
247
+ },
243
248
  });
244
249
  export default messages;
245
250
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramProgress/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,2BAA2B,EAAE;QAC3B,cAAc,EAAE,cAAc;QAC9B,EAAE,EAAE,+BAA+B;QACnC,WAAW,EAAE,yCAAyC;KACvD;IACD,gBAAgB,EAAE;QAChB,cAAc,EAAE,uBAAuB;QACvC,EAAE,EAAE,qCAAqC;QACzC,WAAW,EAAE,qGAAqG;KACnH;IACD,6BAA6B,EAAE;QAC7B,cAAc,EAAE,kBAAkB;QAClC,EAAE,EAAE,kCAAkC;QACtC,WAAW,EAAE,yEAAyE;KACvF;IACD,2BAA2B,EAAE;QAC3B,cAAc,EAAE,0EAA0E;QAC1F,EAAE,EAAE,gCAAgC;QACpC,WAAW,EAAE,8EAA8E;KAC5F;IACD,+BAA+B,EAAE;QAC/B,cAAc,EAAE,sBAAsB;QACtC,EAAE,EAAE,oCAAoC;QACxC,WAAW,EAAE,sFAAsF;KACpG;IACD,6BAA6B,EAAE;QAC7B,cAAc,EAAE,0KAA0K;QAC1L,EAAE,EAAE,kCAAkC;QACtC,WAAW,EAAE,gFAAgF;KAC9F;IACD,2CAA2C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9F;IACD,6CAA6C,EAAE;QAC7C,cAAc,EAAE,YAAY;QAC5B,EAAE,EAAE,qDAAqD;QACzD,WAAW,EAAE,iFAAiF;KAC/F;IACD,6CAA6C,EAAE;QAC7C,cAAc,EAAE,yBAAyB;QACzC,EAAE,EAAE,8CAA8C;QAClD,WAAW,EAAE,0EAA0E;KACxF;IACD,4CAA4C,EAAE;QAC5C,cAAc,EAAE,oDAAoD;QACpE,EAAE,EAAE,oDAAoD;QACxD,WAAW,EAAE,8EAA8E;KAC5F;IACD,kDAAkD,EAAE;QAClD,cAAc,EAAE,iIAAiI;QACjJ,EAAE,EAAE,0DAA0D;QAC9D,WAAW,EAAE,oFAAoF;KAClG;IACD,oCAAoC,EAAE;QACpC,cAAc,EAAE,qBAAqB;QACrC,EAAE,EAAE,2CAA2C;QAC/C,WAAW,EAAE,wCAAwC;KACtD;IACD,8BAA8B,EAAE;QAC9B,cAAc,EAAE,aAAa;QAC7B,EAAE,EAAE,mCAAmC;QACvC,WAAW,EAAE,mCAAmC;KACjD;IACD,sCAAsC,EAAE;QACtC,cAAc,EAAE,qBAAqB;QACrC,EAAE,EAAE,4CAA4C;QAChD,WAAW,EAAE,2CAA2C;KACzD;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n programProgressInstitutions: {\n defaultMessage: 'Institutions',\n id: 'program.progress.institutions',\n description: 'Label text for organization image logos',\n },\n programTypeLabel: {\n defaultMessage: '{programType} program',\n id: 'program.progress.program.type.label',\n description: 'Label displaying the program type (e.g. \"MicroMasters program\", \"Professional Certificate program\")',\n },\n programProgressCompleteHeader: {\n defaultMessage: 'Congratulations!',\n id: 'program.progress.complete.header',\n description: 'header text for the program progress page when all courses are complete',\n },\n programProgressCompleteText: {\n defaultMessage: 'You have successfully completed all the requirements for {programTitle}.',\n id: 'program.progress.complete.text',\n description: 'text to display when a user has completed all of the courses for the program',\n },\n programProgressIncompleteHeader: {\n defaultMessage: 'Your Program Journey',\n id: 'program.progress.incomplete.header',\n description: 'header text to display when the user has remaining incomplete courses in the program',\n },\n programProgressIncompleteText: {\n defaultMessage: 'Track and plan your progress through the {totalCoursesInProgram} courses in this program. To complete the program, you must earn a verified certificate for each course.',\n id: 'program.progress.incomplete.text',\n description: 'text to display when a user has not completed all of the courses for a program',\n },\n programProgressCardCompletedCertificateText: {\n defaultMessage: 'You earned the certificate on {certificateDate}',\n id: 'program.progress.card.completed.certificate.text',\n description: 'text to display on the progress card completed tab related to the certificate status for the course',\n },\n programProgressCardCompletedCertificateButton: {\n defaultMessage: 'View certificate',\n id: 'program.progress.card.completed.certificate.button.text',\n description: 'text to display on the progress card on certificate button for completed courses',\n },\n programProgressCardViewCourseDetailButton: {\n defaultMessage: 'View course details',\n id: 'program.progress.card.view.course.detail.button.text',\n description: 'text to display on the progress card for the view course details button',\n },\n programProgressCardResumeCourseButton: {\n defaultMessage: 'Resume course',\n id: 'program.progress.card.resume.course.button.text',\n description: 'text to display on the progress card for the resume course button',\n },\n programProgressCardUpgradeButton: {\n defaultMessage: 'Upgrade with your subscription',\n id: 'program.progress.card.upgrade.button.text',\n description: 'text to display on the progress card for the upgrade button',\n },\n programProgressCardEnrollText: {\n defaultMessage: 'Enrolled on:',\n id: 'program.progress.card.enroll.text',\n description: 'text to display on the progress card for the enrolled status of the course',\n },\n programProgressCardIncludedInSubscriptionText: {\n defaultMessage: 'Included in your subscription',\n id: 'program.progress.card.included.in.subscription.text',\n description: 'text to display on the progress card for remaining courses that are included in the subscription',\n },\n programProgressCardStartText: {\n defaultMessage: 'Started',\n id: 'program.progress.card.start.text',\n description: 'text to display on the progress card for the start date of the course',\n },\n programProgressInProgressTab: {\n defaultMessage: 'In progress',\n id: 'program.progress.in.progress.tab',\n description: 'Label for the \"In progress\" tab on the program progress page, which lists courses that the user has started but not yet completed.',\n },\n programProgressRemainingTab: {\n defaultMessage: 'Remaining',\n id: 'program.progress.remaining.tab',\n description: 'Label for the \"Remaining\" tab on the program progress page, which lists courses that the user has not yet started.',\n },\n programProgressCompletedTab: {\n defaultMessage: 'Completed',\n id: 'program.progress.completed.tab',\n description: 'Label for the \"Completed\" tab on the program progress page, which lists courses that the user has completed.',\n },\n programProgressPathwaysTab: {\n defaultMessage: 'Pathways',\n id: 'program.progress.pathways.tab',\n description: 'Label for the \"Pathways\" tab on the program progress page, which gives details of how the program can be used to further the learners education. This tab is only shown for MicroMasters programs.',\n },\n programProgressRemainingCourse: {\n defaultMessage: 'Remaining Courses',\n id: 'program.progress.remaining.course',\n description: 'Header text to be displayed inside the Remaining tab of the program progress page.',\n },\n programProgressRemainingTabNoCourse: {\n defaultMessage: \"You have enrolled in all of this program's courses.\",\n id: 'program.progress.remaining.tab.no.course',\n description: 'Text to display on the Remaining tab of the program progress page when there is no course remaining for the user',\n },\n programProgressCompletedCourse: {\n defaultMessage: 'Completed courses',\n id: 'program.progress.completed.course',\n description: 'Header text to be displayed inside the Completed tab of the program progress page.',\n },\n programProgressCompletedTabNoCourse: {\n defaultMessage: 'As you complete courses, you will see them listed here.',\n id: 'program.progress.completed.tab.no.course',\n description: 'Text to display on the Completed tab of the program progress page when no course is completed for the user',\n },\n programProgressCompletedBannerTitle: {\n defaultMessage: 'Earning a program record',\n id: 'program.progress.completed.banner.title',\n description: 'Title text for the banner displayed on the Completed tab of the program progress page.',\n },\n programProgressCompletedBannerDescription: {\n defaultMessage: 'Once you meet all course and program requirements, you will receive a program record and your professional certificate.',\n id: 'program.progress.completed.banner.description',\n description: 'Description text for the banner displayed on the Completed tab of the program progress page.',\n },\n programProgressCompletedBannerHelpCenterButton: {\n defaultMessage: 'Help center',\n id: 'program.progress.completed.banner.help.center.button',\n description: 'Text for the Help Center button displayed on the banner in the Completed tab of the program progress page.',\n },\n programProgressCompletedBannerMyProgramRecordsButton: {\n defaultMessage: 'My program records',\n id: 'program.progress.completed.banner.my.program.records.button',\n description: 'Text for the My Program Records button displayed on the banner in the Completed tab of the program progress page.',\n },\n programProgressEarnedCertificates: {\n defaultMessage: 'Earned Certificates',\n id: 'program.progress.earned.certificates',\n description: 'Label shown in the program progress circle',\n },\n programProgressCertificateLabel: {\n defaultMessage: 'Program Certificate Progress',\n id: 'program.progress.certificate.program.progress',\n description: 'Label shown under the program progress circle',\n },\n programProgressCertificateContentOne: {\n defaultMessage: 'Earn a {programType} when you meet requirements for all courses in the series.',\n id: 'program.progress.certificate.content.one',\n description: 'First content paragraph shown under the program progress circle',\n },\n programProgressCertificateContentTwo: {\n defaultMessage: 'This program is valued at {price} for non-subscribers.',\n id: 'program.progress.certificate.content.two',\n description: 'Second content paragraph shown under the program progress circle',\n },\n programProgressInProgressCourse: {\n defaultMessage: 'Courses in progress',\n id: 'program.progress.in.progress.course',\n description: 'Header text to be displayed inside the In Progress tab of the program progress page.',\n },\n programProgressInProgressCourseMicromastersUpgrade: {\n defaultMessage: 'Upgrade to verified for {price}',\n id: 'program.progress.in.progress.course.micromasters.upgrade',\n description: 'Upgrade message for Micromasters courses in the In Progress tab.',\n },\n programProgressInProgressRemainingCourses: {\n defaultMessage: 'Enroll in the next course in the program.',\n id: 'program.progress.in.progress.remaining.courses',\n description: 'Message for remaining courses in the In Progress tab.',\n },\n programProgressInProgressCompletedCourses: {\n defaultMessage: 'You have completed all courses in the program.',\n id: 'program.progress.in.progress.completed.courses',\n description: 'Message for completed courses in the In Progress tab.',\n },\n programProgressInProgressCourseProfessionalUpgradeModalTitle: {\n defaultMessage: 'You now have full access to the {title}',\n id: 'program.progress.in.progress.course.professional.upgrade.modal.title',\n description: 'Modal title for Professional Certificate courses in the In Progress tab.',\n },\n programProgressInProgressCourseProfessionalUpgradeModalContent: {\n defaultMessage: \"You're saving as a subscriber. This course is valued at {price}.\",\n id: 'program.progress.in.progress.course.professional.upgrade.modal.content',\n description: 'Modal content for Professional Certificate courses in the In Progress tab.',\n },\n programProgressInProgressProfessionalCertificate: {\n defaultMessage: 'This course is included in your subscription. Upgrade to get full course access.',\n id: 'program.progress.in.progress.professional.certificate.status',\n description: 'Certificate status for courses in the In Progress tab related to professional program.',\n },\n programProgressInProgressMicromastersCertificate: {\n defaultMessage: 'Upgrade to get full course access. This course is not included in your subscription.',\n id: 'program.progress.in.progress.micromasters.certificate.needs.verified',\n description: 'Certificate status indicating that a verified certificate is needed for Micromasters courses in the In Progress tab.',\n },\n programProgressPathwaysCreditPathwayTitle: {\n defaultMessage: 'Credit pathways',\n id: 'program.progress.pathways.credit.pathway.title',\n description: 'Title for the Credit Pathway section in the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayDescriptionLine1: {\n defaultMessage: 'Transform your {org} {type} into a full master’s degree.',\n id: 'program.progress.pathways.credit.pathway.description.line1',\n description: 'First line of description for the Credit Pathway section in the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayDescriptionLine2: {\n defaultMessage: 'Successful completion of <i>{org} {title}</i> credential can be applied towards flexible, rigorous, and affordable masters degrees from the world’s leading universities.',\n id: 'program.progress.pathways.credit.pathway.description.line2',\n description: 'Second line of description for the Credit Pathway section in the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayLearnMore: {\n defaultMessage: 'Learn more',\n id: 'program.progress.pathways.credit.pathway.learn.more',\n description: 'Text for the Learn More link in the Credit Pathway section of the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayFaqButton: {\n defaultMessage: 'MicroMasters Credit FAQ',\n id: 'program.progress.pathways.credit.pathway.faq',\n description: 'Text for the FAQ link in the Credit Pathway section of the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayFaqTitle: {\n defaultMessage: 'Learn more about how to transfer your MicroMasters',\n id: 'program.progress.pathways.credit.pathway.faq.title',\n description: 'Title for the FAQ section in the Credit Pathway section of the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayFaqDescription: {\n defaultMessage: 'Helper copy to be updated here. Information about how to earn and transfer credits from edX partners to university institutions',\n id: 'program.progress.pathways.credit.pathway.faq.description',\n description: 'Description for the FAQ section in the Credit Pathway section of the Pathways tab.',\n },\n programProgressReturnToDashboardText: {\n defaultMessage: 'Return to dashboard',\n id: 'program.progress.return.to.dashboard.text',\n description: 'Text for the return to dashboard link.',\n },\n programProgressCertificateText: {\n defaultMessage: 'certificate',\n id: 'program.progress.certificate.text',\n description: 'Label for the certificate string.',\n },\n programProgressXSeriesCertificateLabel: {\n defaultMessage: 'XSeries Certificate',\n id: 'program.progress.xseries.certificate.label',\n description: 'Label for the XSeries certificate string.',\n },\n});\n\nexport default messages;\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramProgress/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,2BAA2B,EAAE;QAC3B,cAAc,EAAE,cAAc;QAC9B,EAAE,EAAE,+BAA+B;QACnC,WAAW,EAAE,yCAAyC;KACvD;IACD,gBAAgB,EAAE;QAChB,cAAc,EAAE,uBAAuB;QACvC,EAAE,EAAE,qCAAqC;QACzC,WAAW,EAAE,qGAAqG;KACnH;IACD,6BAA6B,EAAE;QAC7B,cAAc,EAAE,kBAAkB;QAClC,EAAE,EAAE,kCAAkC;QACtC,WAAW,EAAE,yEAAyE;KACvF;IACD,2BAA2B,EAAE;QAC3B,cAAc,EAAE,0EAA0E;QAC1F,EAAE,EAAE,gCAAgC;QACpC,WAAW,EAAE,8EAA8E;KAC5F;IACD,+BAA+B,EAAE;QAC/B,cAAc,EAAE,sBAAsB;QACtC,EAAE,EAAE,oCAAoC;QACxC,WAAW,EAAE,sFAAsF;KACpG;IACD,6BAA6B,EAAE;QAC7B,cAAc,EAAE,0KAA0K;QAC1L,EAAE,EAAE,kCAAkC;QACtC,WAAW,EAAE,gFAAgF;KAC9F;IACD,2CAA2C,EAAE;QAC3C,cAAc,EAAE,iDAAiD;QACjE,EAAE,EAAE,kDAAkD;QACtD,WAAW,EAAE,qGAAqG;KACnH;IACD,6CA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;KAC/F;IACD,6CAA6C,EAAE;QAC7C,cAAc,EAAE,yBAAyB;QACzC,EAAE,EAAE,8CAA8C;QAClD,WAAW,EAAE,0EAA0E;KACxF;IACD,4CAA4C,EAAE;QAC5C,cAAc,EAAE,oDAAoD;QACpE,EAAE,EAAE,oDAAoD;QACxD,WAAW,EAAE,8EAA8E;KAC5F;IACD,kDAAkD,EAAE;QAClD,cAAc,EAAE,iIAAiI;QACjJ,EAAE,EAAE,0DAA0D;QAC9D,WAAW,EAAE,oFAAoF;KAClG;IACD,oCAAoC,EAAE;QACpC,cAAc,EAAE,qBAAqB;QACrC,EAAE,EAAE,2CAA2C;QAC/C,WAAW,EAAE,wCAAwC;KACtD;IACD,8BAA8B,EAAE;QAC9B,cAAc,EAAE,aAAa;QAC7B,EAAE,EAAE,mCAAmC;QACvC,WAAW,EAAE,mCAAmC;KACjD;IACD,sCAAsC,EAAE;QACtC,cAAc,EAAE,qBAAqB;QACrC,EAAE,EAAE,4CAA4C;QAChD,WAAW,EAAE,2CAA2C;KACzD;IACD,6BAA6B,EAAE;QAC7B,cAAc,EAAE,cAAc;QAC9B,EAAE,EAAE,mCAAmC;QACvC,WAAW,EAAE,+EAA+E;KAC7F;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n programProgressInstitutions: {\n defaultMessage: 'Institutions',\n id: 'program.progress.institutions',\n description: 'Label text for organization image logos',\n },\n programTypeLabel: {\n defaultMessage: '{programType} program',\n id: 'program.progress.program.type.label',\n description: 'Label displaying the program type (e.g. \"MicroMasters program\", \"Professional Certificate program\")',\n },\n programProgressCompleteHeader: {\n defaultMessage: 'Congratulations!',\n id: 'program.progress.complete.header',\n description: 'header text for the program progress page when all courses are complete',\n },\n programProgressCompleteText: {\n defaultMessage: 'You have successfully completed all the requirements for {programTitle}.',\n id: 'program.progress.complete.text',\n description: 'text to display when a user has completed all of the courses for the program',\n },\n programProgressIncompleteHeader: {\n defaultMessage: 'Your Program Journey',\n id: 'program.progress.incomplete.header',\n description: 'header text to display when the user has remaining incomplete courses in the program',\n },\n programProgressIncompleteText: {\n defaultMessage: 'Track and plan your progress through the {totalCoursesInProgram} courses in this program. To complete the program, you must earn a verified certificate for each course.',\n id: 'program.progress.incomplete.text',\n description: 'text to display when a user has not completed all of the courses for a program',\n },\n programProgressCardCompletedCertificateText: {\n defaultMessage: 'You earned the certificate on {certificateDate}',\n id: 'program.progress.card.completed.certificate.text',\n description: 'text to display on the progress card completed tab related to the certificate status for the course',\n },\n programProgressCardCompletedCertificateButton: {\n defaultMessage: 'View certificate',\n id: 'program.progress.card.completed.certificate.button.text',\n description: 'text to display on the progress card on certificate button for completed courses',\n },\n programProgressCardViewCourseDetailButton: {\n defaultMessage: 'View course details',\n id: 'program.progress.card.view.course.detail.button.text',\n description: 'text to display on the progress card for the view course details button',\n },\n programProgressCardResumeCourseButton: {\n defaultMessage: 'Resume course',\n id: 'program.progress.card.resume.course.button.text',\n description: 'text to display on the progress card for the resume course button',\n },\n programProgressCardUpgradeButton: {\n defaultMessage: 'Upgrade with my subscription',\n id: 'program.progress.card.upgrade.button.text',\n description: 'text to display on the progress card for the upgrade button',\n },\n programProgressCardEnrollText: {\n defaultMessage: 'Enrolled on:',\n id: 'program.progress.card.enroll.text',\n description: 'text to display on the progress card for the enrolled status of the course',\n },\n programProgressCardIncludedInSubscriptionText: {\n defaultMessage: 'Included in your subscription',\n id: 'program.progress.card.included.in.subscription.text',\n description: 'text to display on the progress card for remaining courses that are included in the subscription',\n },\n programProgressCardStartText: {\n defaultMessage: 'Started',\n id: 'program.progress.card.start.text',\n description: 'text to display on the progress card for the start date of the course',\n },\n programProgressInProgressTab: {\n defaultMessage: 'In progress',\n id: 'program.progress.in.progress.tab',\n description: 'Label for the \"In progress\" tab on the program progress page, which lists courses that the user has started but not yet completed.',\n },\n programProgressRemainingTab: {\n defaultMessage: 'Remaining',\n id: 'program.progress.remaining.tab',\n description: 'Label for the \"Remaining\" tab on the program progress page, which lists courses that the user has not yet started.',\n },\n programProgressCompletedTab: {\n defaultMessage: 'Completed',\n id: 'program.progress.completed.tab',\n description: 'Label for the \"Completed\" tab on the program progress page, which lists courses that the user has completed.',\n },\n programProgressPathwaysTab: {\n defaultMessage: 'Pathways',\n id: 'program.progress.pathways.tab',\n description: 'Label for the \"Pathways\" tab on the program progress page, which gives details of how the program can be used to further the learners education. This tab is only shown for MicroMasters programs.',\n },\n programProgressRemainingCourse: {\n defaultMessage: 'Remaining Courses',\n id: 'program.progress.remaining.course',\n description: 'Header text to be displayed inside the Remaining tab of the program progress page.',\n },\n programProgressRemainingTabNoCourse: {\n defaultMessage: \"You have enrolled in all of this program's courses.\",\n id: 'program.progress.remaining.tab.no.course',\n description: 'Text to display on the Remaining tab of the program progress page when there is no course remaining for the user',\n },\n programProgressCompletedCourse: {\n defaultMessage: 'Completed courses',\n id: 'program.progress.completed.course',\n description: 'Header text to be displayed inside the Completed tab of the program progress page.',\n },\n programProgressCompletedTabNoCourse: {\n defaultMessage: 'As you complete courses, you will see them listed here.',\n id: 'program.progress.completed.tab.no.course',\n description: 'Text to display on the Completed tab of the program progress page when no course is completed for the user',\n },\n programProgressCompletedBannerTitle: {\n defaultMessage: 'Earning a program record',\n id: 'program.progress.completed.banner.title',\n description: 'Title text for the banner displayed on the Completed tab of the program progress page.',\n },\n programProgressCompletedBannerDescription: {\n defaultMessage: 'Once you meet all course and program requirements, you will receive a program record and your professional certificate.',\n id: 'program.progress.completed.banner.description',\n description: 'Description text for the banner displayed on the Completed tab of the program progress page.',\n },\n programProgressCompletedBannerHelpCenterButton: {\n defaultMessage: 'Help center',\n id: 'program.progress.completed.banner.help.center.button',\n description: 'Text for the Help Center button displayed on the banner in the Completed tab of the program progress page.',\n },\n programProgressCompletedBannerMyProgramRecordsButton: {\n defaultMessage: 'My program records',\n id: 'program.progress.completed.banner.my.program.records.button',\n description: 'Text for the My Program Records button displayed on the banner in the Completed tab of the program progress page.',\n },\n programProgressEarnedCertificates: {\n defaultMessage: 'Earned Certificates',\n id: 'program.progress.earned.certificates',\n description: 'Label shown in the program progress circle',\n },\n programProgressCertificateLabel: {\n defaultMessage: 'Program Certificate Progress',\n id: 'program.progress.certificate.program.progress',\n description: 'Label shown under the program progress circle',\n },\n programProgressCertificateContentOne: {\n defaultMessage: 'Earn a {programType} when you meet requirements for all courses in the series.',\n id: 'program.progress.certificate.content.one',\n description: 'First content paragraph shown under the program progress circle',\n },\n programProgressCertificateContentTwo: {\n defaultMessage: 'This program is valued at {price} for non-subscribers.',\n id: 'program.progress.certificate.content.two',\n description: 'Second content paragraph shown under the program progress circle',\n },\n programProgressInProgressCourse: {\n defaultMessage: 'Courses in progress',\n id: 'program.progress.in.progress.course',\n description: 'Header text to be displayed inside the In Progress tab of the program progress page.',\n },\n programProgressInProgressCourseMicromastersUpgrade: {\n defaultMessage: 'Upgrade to verified for {price}',\n id: 'program.progress.in.progress.course.micromasters.upgrade',\n description: 'Upgrade message for Micromasters courses in the In Progress tab.',\n },\n programProgressInProgressRemainingCourses: {\n defaultMessage: 'Enroll in the next course in the program.',\n id: 'program.progress.in.progress.remaining.courses',\n description: 'Message for remaining courses in the In Progress tab.',\n },\n programProgressInProgressCompletedCourses: {\n defaultMessage: 'You have completed all courses in the program.',\n id: 'program.progress.in.progress.completed.courses',\n description: 'Message for completed courses in the In Progress tab.',\n },\n programProgressInProgressCourseProfessionalUpgradeModalTitle: {\n defaultMessage: 'You now have full access to the {title}',\n id: 'program.progress.in.progress.course.professional.upgrade.modal.title',\n description: 'Modal title for Professional Certificate courses in the In Progress tab.',\n },\n programProgressInProgressCourseProfessionalUpgradeModalContent: {\n defaultMessage: \"You're saving as a subscriber. This course is valued at {price}.\",\n id: 'program.progress.in.progress.course.professional.upgrade.modal.content',\n description: 'Modal content for Professional Certificate courses in the In Progress tab.',\n },\n programProgressInProgressProfessionalCertificate: {\n defaultMessage: 'This course is included in your subscription. Upgrade to get full course access.',\n id: 'program.progress.in.progress.professional.certificate.status',\n description: 'Certificate status for courses in the In Progress tab related to professional program.',\n },\n programProgressInProgressMicromastersCertificate: {\n defaultMessage: 'Upgrade to get full course access. This course is not included in your subscription.',\n id: 'program.progress.in.progress.micromasters.certificate.needs.verified',\n description: 'Certificate status indicating that a verified certificate is needed for Micromasters courses in the In Progress tab.',\n },\n programProgressPathwaysCreditPathwayTitle: {\n defaultMessage: 'Credit pathways',\n id: 'program.progress.pathways.credit.pathway.title',\n description: 'Title for the Credit Pathway section in the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayDescriptionLine1: {\n defaultMessage: 'Transform your {org} {type} into a full master’s degree.',\n id: 'program.progress.pathways.credit.pathway.description.line1',\n description: 'First line of description for the Credit Pathway section in the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayDescriptionLine2: {\n defaultMessage: 'Successful completion of <i>{org} {title}</i> credential can be applied towards flexible, rigorous, and affordable masters degrees from the world’s leading universities.',\n id: 'program.progress.pathways.credit.pathway.description.line2',\n description: 'Second line of description for the Credit Pathway section in the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayLearnMore: {\n defaultMessage: 'Learn more',\n id: 'program.progress.pathways.credit.pathway.learn.more',\n description: 'Text for the Learn More link in the Credit Pathway section of the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayFaqButton: {\n defaultMessage: 'MicroMasters Credit FAQ',\n id: 'program.progress.pathways.credit.pathway.faq',\n description: 'Text for the FAQ link in the Credit Pathway section of the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayFaqTitle: {\n defaultMessage: 'Learn more about how to transfer your MicroMasters',\n id: 'program.progress.pathways.credit.pathway.faq.title',\n description: 'Title for the FAQ section in the Credit Pathway section of the Pathways tab.',\n },\n programProgressPathwaysCreditPathwayFaqDescription: {\n defaultMessage: 'Helper copy to be updated here. Information about how to earn and transfer credits from edX partners to university institutions',\n id: 'program.progress.pathways.credit.pathway.faq.description',\n description: 'Description for the FAQ section in the Credit Pathway section of the Pathways tab.',\n },\n programProgressReturnToDashboardText: {\n defaultMessage: 'Return to dashboard',\n id: 'program.progress.return.to.dashboard.text',\n description: 'Text for the return to dashboard link.',\n },\n programProgressCertificateText: {\n defaultMessage: 'certificate',\n id: 'program.progress.certificate.text',\n description: 'Label for the certificate string.',\n },\n programProgressXSeriesCertificateLabel: {\n defaultMessage: 'XSeries Certificate',\n id: 'program.progress.xseries.certificate.label',\n description: 'Label for the XSeries certificate string.',\n },\n programProgressCardAuditTrack: {\n defaultMessage: 'Audit-track.',\n id: 'program.progress.card.audit.track',\n description: 'Text to display on the progress card for courses that are on the audit track.',\n },\n});\n\nexport default messages;\n"]}
@@ -1,7 +1,8 @@
1
1
  import { sendTrackEvent } from '@openedx/frontend-base';
2
2
  import { appName } from '../../../tracking/constants';
3
+ import { getCommonTrackingProps } from '../../../tracking';
3
4
  export const LINK_TIMEOUT = 300;
4
- export const createEventTracker = (name, options = {}) => () => sendTrackEvent(name, Object.assign(Object.assign({}, options), { app_name: appName }));
5
+ export const createEventTracker = (name, options = {}) => () => sendTrackEvent(name, Object.assign(Object.assign(Object.assign({}, options), { app_name: appName }), getCommonTrackingProps()));
5
6
  export const createLinkTracker = (tracker, href) => (e) => {
6
7
  e.preventDefault();
7
8
  tracker();
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/data/services/segment/utils.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,cAAc,CAC5E,IAAI,kCACC,OAAO,KAAE,QAAQ,EAAE,OAAO,IAChC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;IACxD,CAAC,CAAC,cAAc,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC;IACV,OAAO,UAAU,CAAC,GAAG,EAAE;QACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC9B,CAAC,EAAE,YAAY,CAAC,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import { sendTrackEvent } from '@openedx/frontend-base';\nimport { appName } from '../../../tracking/constants';\n\nexport const LINK_TIMEOUT = 300;\n\nexport const createEventTracker = (name, options = {}) => () => sendTrackEvent(\n name,\n { ...options, app_name: appName },\n);\n\nexport const createLinkTracker = (tracker, href) => (e) => {\n e.preventDefault();\n tracker();\n return setTimeout(() => {\n global.location.href = href;\n }, LINK_TIMEOUT);\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/data/services/segment/utils.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,cAAc,CAC5E,IAAI,gDACC,OAAO,KAAE,QAAQ,EAAE,OAAO,KAAK,sBAAsB,EAAE,EAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;IACxD,CAAC,CAAC,cAAc,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC;IACV,OAAO,UAAU,CAAC,GAAG,EAAE;QACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC9B,CAAC,EAAE,YAAY,CAAC,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import { sendTrackEvent } from '@openedx/frontend-base';\nimport { appName } from '../../../tracking/constants';\nimport { getCommonTrackingProps } from '../../../tracking';\n\nexport const LINK_TIMEOUT = 300;\n\nexport const createEventTracker = (name, options = {}) => () => sendTrackEvent(\n name,\n { ...options, app_name: appName, ...getCommonTrackingProps(), },\n);\n\nexport const createLinkTracker = (tracker, href) => (e) => {\n e.preventDefault();\n tracker();\n return setTimeout(() => {\n global.location.href = href;\n }, LINK_TIMEOUT);\n};\n"]}
package/dist/routes.js CHANGED
@@ -11,6 +11,7 @@ import { authenticatedLoader, getAuthenticatedHttpClient, getAppConfig } from '@
11
11
  import { appId, subscriptionDashboardRole, subscriptionDashboardUrlPath, subscriptionProgramProgressRole } from './constants';
12
12
  import { getSubsInitApiUrl } from './data/services/subs/urls';
13
13
  import { redirect } from 'react-router-dom';
14
+ import { setCommonTrackingProps, mapSubsInitToTrackingProps } from './tracking';
14
15
  // loader to check if the user has subscription access
15
16
  const subscriptionAccessLoader = () => __awaiter(void 0, void 0, void 0, function* () {
16
17
  try {
@@ -18,6 +19,7 @@ const subscriptionAccessLoader = () => __awaiter(void 0, void 0, void 0, functio
18
19
  if (!(data === null || data === void 0 ? void 0 : data.userSubscription) || !data.userSubscription.isSubscriber || !getAppConfig(appId).ENABLE_SUBSCRIPTION_SITE) {
19
20
  throw redirect('/learner-dashboard'); //redirect to learner dashboard if user does not have subscription access
20
21
  }
22
+ setCommonTrackingProps(mapSubsInitToTrackingProps(data));
21
23
  return null;
22
24
  }
23
25
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.jsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEvG,OAAO,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AM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;gBACtC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;KACF;IACD;QACE,EAAE,EAAE,6DAA6D;QACjE,IAAI,EAAE,sCAAsC;QAC5C,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE;YACN,IAAI,EAAE,+BAA+B;SACtC;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,qDAAqD,CAAC,CAAC;gBACnF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { authenticatedLoader, getAuthenticatedHttpClient, getAppConfig } from '@openedx/frontend-base';\n\nimport { appId, subscriptionDashboardRole, subscriptionDashboardUrlPath, subscriptionProgramProgressRole } from './constants';\nimport { getSubsInitApiUrl } from './data/services/subs/urls';\nimport { redirect } from 'react-router-dom';\n\n// loader to check if the user has subscription access\nconst subscriptionAccessLoader = async () => {\n try {\n const { data } = await getAuthenticatedHttpClient().get(getSubsInitApiUrl());\n\n if (!data?.userSubscription || !data.userSubscription.isSubscriber || !getAppConfig(appId).ENABLE_SUBSCRIPTION_SITE) {\n throw redirect('/learner-dashboard'); //redirect to learner dashboard if user does not have subscription access\n }\n \n return null;\n } catch (error) {\n // Let redirect responses bubble up\n if (error instanceof Response) {\n throw error;\n }\n\n throw redirect('/learner-dashboard'); // redirect to learner dashboard if an error occurs\n }\n};\n\n// composed loader that checks for authentication and subscription access\nconst protectedLoader = async (args) => {\n await authenticatedLoader(args);\n await subscriptionAccessLoader();\n\n return null;\n};\n\nconst routes = [\n {\n id: 'org.edx.frontend.route.subsLearnerDashboard.main',\n path: subscriptionDashboardUrlPath,\n loader: protectedLoader,\n handle: {\n role: subscriptionDashboardRole\n },\n async lazy () {\n const module = await import('./Main');\n return { Component: module.default };\n },\n },\n {\n id: 'org.edx.frontend.route.subsLearnerDashboard.programProgress',\n path: '/subscription-program-progress/:uuid',\n loader: protectedLoader,\n handle: {\n role: subscriptionProgramProgressRole\n },\n async lazy () {\n const module = await import('./containers/ProgramDashboard/ProgramProgress/index');\n return { Component: module.default };\n },\n }\n];\n\nexport default routes;\n"]}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.jsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEvG,OAAO,EAAE,KAAK,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAC9H,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAEhF,sDAAsD;AACtD,MAAM,wBAAwB,GAAG,GAAS,EAAE;IAC1C,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,CAAC;QAE7E,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,CAAA,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,wBAAwB,EAAE,CAAC;YACpH,MAAM,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAE,yEAAyE;QAClH,CAAC;QAED,sBAAsB,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,mCAAmC;QACnC,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;QAED,MAAM,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,mDAAmD;IAC3F,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,yEAAyE;AACzE,MAAM,eAAe,GAAG,CAAO,IAAI,EAAE,EAAE;IACrC,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,wBAAwB,EAAE,CAAC;IAEjC,OAAO,IAAI,CAAC;AACd,CAAC,CAAA,CAAC;AAEF,MAAM,MAAM,GAAG;IACb;QACE,EAAE,EAAE,kDAAkD;QACtD,IAAI,EAAE,4BAA4B;QAClC,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE;YACN,IAAI,EAAE,yBAAyB;SAChC;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;gBACtC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;KACF;IACD;QACE,EAAE,EAAE,6DAA6D;QACjE,IAAI,EAAE,sCAAsC;QAC5C,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE;YACN,IAAI,EAAE,+BAA+B;SACtC;QACK,IAAI;;gBACR,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,qDAAqD,CAAC,CAAC;gBACnF,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACvC,CAAC;SAAA;KACF;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { authenticatedLoader, getAuthenticatedHttpClient, getAppConfig } from '@openedx/frontend-base';\n\nimport { appId, subscriptionDashboardRole, subscriptionDashboardUrlPath, subscriptionProgramProgressRole } from './constants';\nimport { getSubsInitApiUrl } from './data/services/subs/urls';\nimport { redirect } from 'react-router-dom';\nimport { setCommonTrackingProps, mapSubsInitToTrackingProps } from './tracking';\n\n// loader to check if the user has subscription access\nconst subscriptionAccessLoader = async () => {\n try {\n const { data } = await getAuthenticatedHttpClient().get(getSubsInitApiUrl());\n\n if (!data?.userSubscription || !data.userSubscription.isSubscriber || !getAppConfig(appId).ENABLE_SUBSCRIPTION_SITE) {\n throw redirect('/learner-dashboard'); //redirect to learner dashboard if user does not have subscription access\n }\n \n setCommonTrackingProps(mapSubsInitToTrackingProps(data));\n return null;\n } catch (error) {\n // Let redirect responses bubble up\n if (error instanceof Response) {\n throw error;\n }\n\n throw redirect('/learner-dashboard'); // redirect to learner dashboard if an error occurs\n }\n};\n\n// composed loader that checks for authentication and subscription access\nconst protectedLoader = async (args) => {\n await authenticatedLoader(args);\n await subscriptionAccessLoader();\n\n return null;\n};\n\nconst routes = [\n {\n id: 'org.edx.frontend.route.subsLearnerDashboard.main',\n path: subscriptionDashboardUrlPath,\n loader: protectedLoader,\n handle: {\n role: subscriptionDashboardRole\n },\n async lazy () {\n const module = await import('./Main');\n return { Component: module.default };\n },\n },\n {\n id: 'org.edx.frontend.route.subsLearnerDashboard.programProgress',\n path: '/subscription-program-progress/:uuid',\n loader: protectedLoader,\n handle: {\n role: subscriptionProgramProgressRole\n },\n async lazy () {\n const module = await import('./containers/ProgramDashboard/ProgramProgress/index');\n return { Component: module.default };\n },\n }\n];\n\nexport default routes;\n"]}
@@ -8,6 +8,7 @@ declare namespace _default {
8
8
  export { filter };
9
9
  }
10
10
  export default _default;
11
+ export * from "./trackingContext";
11
12
  import course from './trackers/course';
12
13
  import credit from './trackers/credit';
13
14
  import engagement from './trackers/engagement';
@@ -14,4 +14,5 @@ export default {
14
14
  findCourses,
15
15
  filter,
16
16
  };
17
+ export * from './trackingContext';
17
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tracking/index.js"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,eAAe;IACb,MAAM;IACN,MAAM;IACN,UAAU;IACV,YAAY;IACZ,WAAW;IACX,WAAW;IACX,MAAM;CACP,CAAC","sourcesContent":["import course from './trackers/course';\nimport credit from './trackers/credit';\nimport engagement from './trackers/engagement';\nimport entitlements from './trackers/entitlements';\nimport socialShare from './trackers/socialShare';\nimport findCourses from './trackers/findCourses';\nimport filter from './trackers/filter';\n\nexport default {\n course,\n credit,\n engagement,\n entitlements,\n socialShare,\n findCourses,\n filter,\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tracking/index.js"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,UAAU,MAAM,uBAAuB,CAAC;AAC/C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,WAAW,MAAM,wBAAwB,CAAC;AACjD,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,eAAe;IACb,MAAM;IACN,MAAM;IACN,UAAU;IACV,YAAY;IACZ,WAAW;IACX,WAAW;IACX,MAAM;CACP,CAAC;AAEF,cAAc,mBAAmB,CAAC","sourcesContent":["import course from './trackers/course';\nimport credit from './trackers/credit';\nimport engagement from './trackers/engagement';\nimport entitlements from './trackers/entitlements';\nimport socialShare from './trackers/socialShare';\nimport findCourses from './trackers/findCourses';\nimport filter from './trackers/filter';\n\nexport default {\n course,\n credit,\n engagement,\n entitlements,\n socialShare,\n findCourses,\n filter,\n};\n\nexport * from './trackingContext';\n"]}
@@ -0,0 +1,11 @@
1
+ export interface CommonTrackingProps {
2
+ free_trial_status?: string;
3
+ subscription_status?: string;
4
+ subscription_tier?: string;
5
+ session_id?: string | null;
6
+ experimentation?: string | null;
7
+ device_type?: string | null;
8
+ }
9
+ export declare const setCommonTrackingProps: (props: CommonTrackingProps) => void;
10
+ export declare const getCommonTrackingProps: () => CommonTrackingProps;
11
+ export declare const mapSubsInitToTrackingProps: (data: any) => CommonTrackingProps;
@@ -0,0 +1,18 @@
1
+ let commonProps = {};
2
+ export const setCommonTrackingProps = (props) => {
3
+ commonProps = Object.assign(Object.assign({}, commonProps), props);
4
+ };
5
+ export const getCommonTrackingProps = () => commonProps;
6
+ // Single place that maps the subs/init API response -> tracking props
7
+ export const mapSubsInitToTrackingProps = (data) => {
8
+ var _a, _b, _c;
9
+ return ({
10
+ free_trial_status: (_a = data === null || data === void 0 ? void 0 : data.userSubscription) === null || _a === void 0 ? void 0 : _a.trialActive,
11
+ subscription_status: (_b = data === null || data === void 0 ? void 0 : data.userSubscription) === null || _b === void 0 ? void 0 : _b.status,
12
+ subscription_tier: (_c = data === null || data === void 0 ? void 0 : data.userSubscription) === null || _c === void 0 ? void 0 : _c.billingFrequency,
13
+ session_id: '',
14
+ experimentation: '',
15
+ device_type: '',
16
+ });
17
+ };
18
+ //# sourceMappingURL=trackingContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trackingContext.js","sourceRoot":"","sources":["../../src/tracking/trackingContext.ts"],"names":[],"mappings":"AASA,IAAI,WAAW,GAAwB,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAA0B,EAAE,EAAE;IACnE,WAAW,mCAAQ,WAAW,GAAK,KAAK,CAAE,CAAC;AAC7C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAwB,EAAE,CAAC,WAAW,CAAC;AAE7E,sEAAsE;AACtE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,IAAS,EAAuB,EAAE;;IAAC,OAAA,CAAC;QAC7E,iBAAiB,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,0CAAE,WAAW;QACtD,mBAAmB,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,0CAAE,MAAM;QACnD,iBAAiB,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,gBAAgB,0CAAE,gBAAgB;QAC3D,UAAU,EAAE,EAAE;QACd,eAAe,EAAE,EAAE;QACnB,WAAW,EAAE,EAAE;KAChB,CAAC,CAAA;CAAA,CAAC","sourcesContent":["export interface CommonTrackingProps {\n free_trial_status?: string,\n subscription_status?: string,\n subscription_tier?: string,\n session_id?: string | null,\n experimentation?: string | null,\n device_type?: string | null,\n}\n\nlet commonProps: CommonTrackingProps = {};\n\nexport const setCommonTrackingProps = (props: CommonTrackingProps) => {\n commonProps = { ...commonProps, ...props };\n};\n\nexport const getCommonTrackingProps = (): CommonTrackingProps => commonProps;\n\n// Single place that maps the subs/init API response -> tracking props\nexport const mapSubsInitToTrackingProps = (data: any): CommonTrackingProps => ({\n free_trial_status: data?.userSubscription?.trialActive,\n subscription_status: data?.userSubscription?.status,\n subscription_tier: data?.userSubscription?.billingFrequency,\n session_id: '',\n experimentation: '',\n device_type: '',\n});\n"]}
@@ -26,7 +26,7 @@ const ProgressiveProfilingElements = ({ progressiveProfileStatus, orientation })
26
26
  // Handle button click for the banner and track the click event
27
27
  const handleButtonClick = () => {
28
28
  openModal();
29
- trackProgressiveProfilingDashboardBannerClick({ host: window.location.origin, status });
29
+ trackProgressiveProfilingDashboardBannerClick({ eventStatus: status });
30
30
  };
31
31
  return (_jsx("div", { "data-testid": "ProgressiveProfileStatus", children: _jsx(Card, { orientation: orientation, children: _jsxs("div", { className: "d-flex flex-column w-100 p-4", children: [status !== 'complete' && (_jsx("h6", { children: formatMessage(messages[`${status}_title`]) })), _jsx("p", { className: "small text-gray-700", children: formatMessage(messages[`${status}_description`], descriptionValues) }), _jsx(ActionButton, { variant: "outline-brand", size: "sm", style: { maxWidth: '12.5rem' }, onClick: handleButtonClick, children: formatMessage(messages[`${status}_button`]) })] }) }) }));
32
32
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressiveProfilingElements.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingElements/ProgressiveProfilingElements.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,YAAY,MAAM,sEAAsE,CAAC;AAChG,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,6CAA6C,EAAE,MAAM,6CAA6C,CAAC;AAE5G,MAAM,4BAA4B,GAAG,CAAC,EAAE,wBAAwB,EAAE,WAAW,EAAE,EAAE,EAAE;;IACjF,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAC7D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,EACJ,MAAM,EACN,kBAAkB,GACnB,GAAG,wBAAwB,IAAI,EAAE,CAAC;IAEnC,MAAM,YAAY,GAAG,MAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,eAAe,CAAC,0CAAE,cAAc,0CAAG,CAAC,CAAC,0CAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3F,MAAM,SAAS,GAAG,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,oBAAoB,CAAC,0CAAE,cAAc,mCAAI,EAAE,CAAC;IACxE,MAAM,kBAAkB,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC;QAC7C,CAAC,CAAC,GAAG,SAAS,CAA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AC,GAC/B,IACX,GACD,GACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,4BAA4B,CAAC,SAAS,GAAG;IACvC,wBAAwB,EAAE,SAAS,CAAC,KAAK,CAAC;QACxC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;QAClE,iBAAiB,EAAE,SAAS,CAAC,MAAM;QACnC,cAAc,EAAE,SAAS,CAAC,MAAM;QAChC,kBAAkB,EAAE,SAAS,CAAC,MAAM;KACrC,CAAC;IACF,WAAW,EAAE,SAAS,CAAC,MAAM;CAC9B,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport messages from './messages';\nimport { Card } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport ActionButton from '@src/containers/CourseCard/components/CourseCardActions/ActionButton';\nimport { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';\nimport { trackProgressiveProfilingDashboardBannerClick } from '@src/tracking/trackers/progressiveProfiling';\n\nconst ProgressiveProfilingElements = ({ progressiveProfileStatus, orientation }) => {\n const { openModal, answers } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const {\n status,\n remainingQuestions,\n } = progressiveProfileStatus || {};\n\n const learningGoal = answers?.['learning-goal']?.selectedValues?.[0]?.replaceAll('-', ' ');\n const interests = answers?.['interests-declared']?.selectedValues ?? [];\n const formattedInterests = interests.length > 1\n ? `${interests.slice(0, -1).join(', ')} and ${interests.at(-1)}`\n : interests[0];\n\n if (!progressiveProfileStatus) return null;\n\n const descriptionValues = {\n ...(status === 'incomplete' && { remaining_questions: remainingQuestions }),\n ...(status === 'complete' && {\n learningGoal,\n interests: formattedInterests,\n bold: (chunks) => <strong>{chunks}</strong>,\n }),\n };\n\n // Handle button click for the banner and track the click event\n const handleButtonClick = () => {\n openModal();\n trackProgressiveProfilingDashboardBannerClick({ host: window.location.origin, status });\n };\n\n return (\n <div data-testid=\"ProgressiveProfileStatus\">\n <Card orientation={orientation}>\n <div className=\"d-flex flex-column w-100 p-4\">\n {status !== 'complete' && (\n <h6>{formatMessage(messages[`${status}_title`])}</h6>\n )}\n <p className=\"small text-gray-700\">\n {formatMessage(\n messages[`${status}_description`],\n descriptionValues,\n )}\n </p>\n <ActionButton\n variant=\"outline-brand\"\n size=\"sm\"\n style={{ maxWidth: '12.5rem' }}\n onClick={handleButtonClick}\n >\n {formatMessage(messages[`${status}_button`])}\n </ActionButton>\n </div>\n </Card>\n </div>\n );\n};\n\nProgressiveProfilingElements.propTypes = {\n progressiveProfileStatus: PropTypes.shape({\n status: PropTypes.oneOf(['not_started', 'incomplete', 'complete']),\n answeredQuestions: PropTypes.number,\n totalQuestions: PropTypes.number,\n remainingQuestions: PropTypes.number,\n }),\n orientation: PropTypes.string,\n};\n\nexport default ProgressiveProfilingElements;\n"]}
1
+ {"version":3,"file":"ProgressiveProfilingElements.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingElements/ProgressiveProfilingElements.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,YAAY,MAAM,sEAAsE,CAAC;AAChG,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,6CAA6C,EAAE,MAAM,6CAA6C,CAAC;AAE5G,MAAM,4BAA4B,GAAG,CAAC,EAAE,wBAAwB,EAAE,WAAW,EAAE,EAAE,EAAE;;IACjF,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAC7D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC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,MAAM,KAAK,UAAU,IAAI,CACxB,uBAAK,aAAa,CAAC,QAAQ,CAAC,GAAG,MAAM,QAAQ,CAAC,CAAC,GAAM,CACtD,EACD,YAAG,SAAS,EAAC,qBAAqB,YAC/B,aAAa,CACZ,QAAQ,CAAC,GAAG,MAAM,cAAc,CAAC,EACjC,iBAAiB,CAClB,GACC,EACJ,KAAC,YAAY,IACX,OAAO,EAAC,eAAe,EACvB,IAAI,EAAC,IAAI,EACT,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,EAC9B,OAAO,EAAE,iBAAiB,YAEzB,aAAa,CAAC,QAAQ,CAAC,GAAG,MAAM,SAAS,CAAC,CAAC,GAC/B,IACX,GACD,GACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,4BAA4B,CAAC,SAAS,GAAG;IACvC,wBAAwB,EAAE,SAAS,CAAC,KAAK,CAAC;QACxC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;QAClE,iBAAiB,EAAE,SAAS,CAAC,MAAM;QACnC,cAAc,EAAE,SAAS,CAAC,MAAM;QAChC,kBAAkB,EAAE,SAAS,CAAC,MAAM;KACrC,CAAC;IACF,WAAW,EAAE,SAAS,CAAC,MAAM;CAC9B,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport messages from './messages';\nimport { Card } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport ActionButton from '@src/containers/CourseCard/components/CourseCardActions/ActionButton';\nimport { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';\nimport { trackProgressiveProfilingDashboardBannerClick } from '@src/tracking/trackers/progressiveProfiling';\n\nconst ProgressiveProfilingElements = ({ progressiveProfileStatus, orientation }) => {\n const { openModal, answers } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const {\n status,\n remainingQuestions,\n } = progressiveProfileStatus || {};\n\n const learningGoal = answers?.['learning-goal']?.selectedValues?.[0]?.replaceAll('-', ' ');\n const interests = answers?.['interests-declared']?.selectedValues ?? [];\n const formattedInterests = interests.length > 1\n ? `${interests.slice(0, -1).join(', ')} and ${interests.at(-1)}`\n : interests[0];\n\n if (!progressiveProfileStatus) return null;\n\n const descriptionValues = {\n ...(status === 'incomplete' && { remaining_questions: remainingQuestions }),\n ...(status === 'complete' && {\n learningGoal,\n interests: formattedInterests,\n bold: (chunks) => <strong>{chunks}</strong>,\n }),\n };\n\n // Handle button click for the banner and track the click event\n const handleButtonClick = () => {\n openModal();\n trackProgressiveProfilingDashboardBannerClick({ eventStatus: status });\n };\n\n return (\n <div data-testid=\"ProgressiveProfileStatus\">\n <Card orientation={orientation}>\n <div className=\"d-flex flex-column w-100 p-4\">\n {status !== 'complete' && (\n <h6>{formatMessage(messages[`${status}_title`])}</h6>\n )}\n <p className=\"small text-gray-700\">\n {formatMessage(\n messages[`${status}_description`],\n descriptionValues,\n )}\n </p>\n <ActionButton\n variant=\"outline-brand\"\n size=\"sm\"\n style={{ maxWidth: '12.5rem' }}\n onClick={handleButtonClick}\n >\n {formatMessage(messages[`${status}_button`])}\n </ActionButton>\n </div>\n </Card>\n </div>\n );\n};\n\nProgressiveProfilingElements.propTypes = {\n progressiveProfileStatus: PropTypes.shape({\n status: PropTypes.oneOf(['not_started', 'incomplete', 'complete']),\n answeredQuestions: PropTypes.number,\n totalQuestions: PropTypes.number,\n remainingQuestions: PropTypes.number,\n }),\n orientation: PropTypes.string,\n};\n\nexport default ProgressiveProfilingElements;\n"]}
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createContext, useContext, useEffect, useMemo, useState, useCallback, } from 'react';
3
3
  import { useAnswers, useSaveAnswers } from './data/queryHooks';
4
4
  import { trackProgressiveProfilingQuestionaireModalFormOpened, trackProgressiveProfilingQuestionaireModalCloseClick } from '../../tracking/trackers/progressiveProfiling';
5
+ import { getProgressiveProfilingStepName } from './data/constants';
5
6
  const ProgressiveProfilingQuizContext = createContext(null);
6
7
  export const ProgressiveProfilingQuizProvider = ({ children }) => {
7
8
  const [isModalOpen, setIsModalOpen] = useState(false);
@@ -17,11 +18,11 @@ export const ProgressiveProfilingQuizProvider = ({ children }) => {
17
18
  }
18
19
  }, [storedAnswers]);
19
20
  const openModal = useCallback(() => {
20
- trackProgressiveProfilingQuestionaireModalFormOpened({ host: window.location.origin });
21
+ trackProgressiveProfilingQuestionaireModalFormOpened({});
21
22
  setIsModalOpen(true);
22
23
  }, []);
23
24
  const closeModal = useCallback(() => {
24
- trackProgressiveProfilingQuestionaireModalCloseClick({ host: window.location.origin, step: currentStep + 1 });
25
+ trackProgressiveProfilingQuestionaireModalCloseClick({ step: currentStep + 1, stepName: getProgressiveProfilingStepName(currentStep) });
25
26
  setIsModalOpen(false);
26
27
  if (Object.keys(answers).length > 0) {
27
28
  saveAnswers(answers);
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressiveProfilingQuizProvider.js","sourceRoot":"","sources":["../../../src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAa,WAAW,GAChF,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,MAAM,6CAA6C,CAAC;AAiBzK,MAAM,+BAA+B,GAAG,aAAa,CAA6C,IAAI,CAAC,CAAC;AAMxG,MAAM,CAAC,MAAM,gCAAgC,GAAoD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAChH,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAA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I,KAAK,CAAC,oFAAoF,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React, {\n createContext, useContext, useEffect, useMemo, useState, ReactNode, useCallback,\n} from 'react';\n\nimport { StoredAnswerRecord, ProgressiveProfileStatus } from './data/api/fetchAnswers';\nimport { useAnswers, useSaveAnswers } from './data/queryHooks';\nimport { QuizAnswerRecord } from './data/types';\nimport { trackProgressiveProfilingQuestionaireModalFormOpened, trackProgressiveProfilingQuestionaireModalCloseClick } from '@src/tracking/trackers/progressiveProfiling';\n\ninterface ProgressiveProfilingQuizContextType {\n isModalOpen: boolean,\n openModal: () => void,\n closeModal: () => void,\n currentStep: number,\n setCurrentStep: (step: number) => void,\n goToNextStep: () => void,\n goToPreviousStep: () => void,\n answers: Record<string, QuizAnswerRecord | StoredAnswerRecord>,\n recordAnswer: (answer: QuizAnswerRecord) => void,\n isComplete: boolean,\n setIsComplete: (isComplete: boolean) => void,\n progressiveProfileStatus: ProgressiveProfileStatus | undefined,\n}\n\nconst ProgressiveProfilingQuizContext = createContext<ProgressiveProfilingQuizContextType | null>(null);\n\ninterface ProgressiveProfilingQuizProviderProps {\n children: ReactNode,\n}\n\nexport const ProgressiveProfilingQuizProvider: React.FC<ProgressiveProfilingQuizProviderProps> = ({ children }) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [currentStep, setCurrentStep] = useState(0);\n const [answers, setAnswers] = useState<Record<string, QuizAnswerRecord | StoredAnswerRecord>>({});\n const [isComplete, setIsComplete] = useState(false);\n\n const { data: storedAnswers } = useAnswers();\n const { mutate: saveAnswers } = useSaveAnswers();\n const progressiveProfileStatus = storedAnswers?.progressiveProfileStatus;\n\n useEffect(() => {\n if (storedAnswers?.answers) {\n setAnswers(prev => ({ ...storedAnswers.answers, ...prev }));\n }\n }, [storedAnswers]);\n\n const openModal = useCallback(() => {\n trackProgressiveProfilingQuestionaireModalFormOpened({ host: window.location.origin });\n\n setIsModalOpen(true);\n }, []);\n\n const closeModal = useCallback(() => {\n trackProgressiveProfilingQuestionaireModalCloseClick({ host: window.location.origin, step: currentStep + 1 });\n setIsModalOpen(false);\n if (Object.keys(answers).length > 0) {\n saveAnswers(answers);\n }\n }, [answers, saveAnswers, currentStep]);\n\n const goToNextStep = useCallback(() => setCurrentStep(prev => prev + 1), []);\n const goToPreviousStep = useCallback(() => setCurrentStep(prev => Math.max(0, prev - 1)), []);\n\n const recordAnswer = useCallback((answer: QuizAnswerRecord) => {\n setAnswers(prev => ({ ...prev, [answer.questionId]: answer }));\n }, []);\n\n const contextValue = useMemo(() => ({\n isModalOpen,\n openModal,\n closeModal,\n currentStep,\n setCurrentStep,\n goToNextStep,\n goToPreviousStep,\n answers,\n recordAnswer,\n isComplete,\n setIsComplete,\n progressiveProfileStatus,\n }), [\n isModalOpen, openModal, closeModal,\n currentStep, goToNextStep, goToPreviousStep,\n answers, recordAnswer,\n isComplete,\n progressiveProfileStatus,\n ]);\n\n return (\n <ProgressiveProfilingQuizContext.Provider value={contextValue}>\n {children}\n </ProgressiveProfilingQuizContext.Provider>\n );\n};\n\nexport const useProgressiveProfilingQuiz = (): ProgressiveProfilingQuizContextType => {\n const context = useContext(ProgressiveProfilingQuizContext);\n if (!context) {\n throw new Error('useProgressiveProfilingQuiz must be used within a ProgressiveProfilingQuizProvider');\n }\n return context;\n};\n"]}
1
+ {"version":3,"file":"ProgressiveProfilingQuizProvider.js","sourceRoot":"","sources":["../../../src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.tsx"],"names":[],"mappings":";AAAA,OAAc,EACZ,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAa,WAAW,GAChF,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,oDAAoD,EAAE,oDAAoD,EAAE,MAAM,6CAA6C,CAAC;AACzK,OAAO,EAA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+B,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC1D,QAAQ,GACgC,CAC5C,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAwC,EAAE;IACnF,MAAM,OAAO,GAAG,UAAU,CAAC,+BAA+B,CAAC,CAAC;IAC5D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React, {\n createContext, useContext, useEffect, useMemo, useState, ReactNode, useCallback,\n} from 'react';\n\nimport { StoredAnswerRecord, ProgressiveProfileStatus } from './data/api/fetchAnswers';\nimport { useAnswers, useSaveAnswers } from './data/queryHooks';\nimport { QuizAnswerRecord } from './data/types';\nimport { trackProgressiveProfilingQuestionaireModalFormOpened, trackProgressiveProfilingQuestionaireModalCloseClick } from '@src/tracking/trackers/progressiveProfiling';\nimport { getProgressiveProfilingStepName } from './data/constants';\n\ninterface ProgressiveProfilingQuizContextType {\n isModalOpen: boolean,\n openModal: () => void,\n closeModal: () => void,\n currentStep: number,\n setCurrentStep: (step: number) => void,\n goToNextStep: () => void,\n goToPreviousStep: () => void,\n answers: Record<string, QuizAnswerRecord | StoredAnswerRecord>,\n recordAnswer: (answer: QuizAnswerRecord) => void,\n isComplete: boolean,\n setIsComplete: (isComplete: boolean) => void,\n progressiveProfileStatus: ProgressiveProfileStatus | undefined,\n}\n\nconst ProgressiveProfilingQuizContext = createContext<ProgressiveProfilingQuizContextType | null>(null);\n\ninterface ProgressiveProfilingQuizProviderProps {\n children: ReactNode,\n}\n\nexport const ProgressiveProfilingQuizProvider: React.FC<ProgressiveProfilingQuizProviderProps> = ({ children }) => {\n const [isModalOpen, setIsModalOpen] = useState(false);\n const [currentStep, setCurrentStep] = useState(0);\n const [answers, setAnswers] = useState<Record<string, QuizAnswerRecord | StoredAnswerRecord>>({});\n const [isComplete, setIsComplete] = useState(false);\n\n const { data: storedAnswers } = useAnswers();\n const { mutate: saveAnswers } = useSaveAnswers();\n const progressiveProfileStatus = storedAnswers?.progressiveProfileStatus;\n\n useEffect(() => {\n if (storedAnswers?.answers) {\n setAnswers(prev => ({ ...storedAnswers.answers, ...prev }));\n }\n }, [storedAnswers]);\n\n const openModal = useCallback(() => {\n trackProgressiveProfilingQuestionaireModalFormOpened({});\n\n setIsModalOpen(true);\n }, []);\n\n const closeModal = useCallback(() => {\n trackProgressiveProfilingQuestionaireModalCloseClick({ step: currentStep + 1, stepName: getProgressiveProfilingStepName(currentStep) });\n setIsModalOpen(false);\n if (Object.keys(answers).length > 0) {\n saveAnswers(answers);\n }\n }, [answers, saveAnswers, currentStep]);\n\n const goToNextStep = useCallback(() => setCurrentStep(prev => prev + 1), []);\n const goToPreviousStep = useCallback(() => setCurrentStep(prev => Math.max(0, prev - 1)), []);\n\n const recordAnswer = useCallback((answer: QuizAnswerRecord) => {\n setAnswers(prev => ({ ...prev, [answer.questionId]: answer }));\n }, []);\n\n const contextValue = useMemo(() => ({\n isModalOpen,\n openModal,\n closeModal,\n currentStep,\n setCurrentStep,\n goToNextStep,\n goToPreviousStep,\n answers,\n recordAnswer,\n isComplete,\n setIsComplete,\n progressiveProfileStatus,\n }), [\n isModalOpen, openModal, closeModal,\n currentStep, goToNextStep, goToPreviousStep,\n answers, recordAnswer,\n isComplete,\n progressiveProfileStatus,\n ]);\n\n return (\n <ProgressiveProfilingQuizContext.Provider value={contextValue}>\n {children}\n </ProgressiveProfilingQuizContext.Provider>\n );\n};\n\nexport const useProgressiveProfilingQuiz = (): ProgressiveProfilingQuizContextType => {\n const context = useContext(ProgressiveProfilingQuizContext);\n if (!context) {\n throw new Error('useProgressiveProfilingQuiz must be used within a ProgressiveProfilingQuizProvider');\n }\n return context;\n};\n"]}
@@ -24,7 +24,7 @@ export const BannerEntry = () => {
24
24
  // Handle button click for the banner and track the click event
25
25
  const handleButtonClick = () => {
26
26
  openModal();
27
- trackProgressiveProfilingSearchPageBannerClick({ host: window.location.origin, status });
27
+ trackProgressiveProfilingSearchPageBannerClick({ eventStatus: status });
28
28
  };
29
29
  let title = formatMessage(messages.notStartedTitle);
30
30
  let buttonText = formatMessage(messages.notStartedButtonText);
@@ -1 +1 @@
1
- {"version":3,"file":"BannerEntry.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/SearchPageBanners/BannerEntry.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iCAAiC,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,8CAA8C,EAAE,MAAM,6CAA6C,CAAC;AAE7G;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAO,GAAG,EAAE;;IAClC,MAAM,EACJ,SAAS,EACT,OAAO,EACP,wBAAwB,GACzB,GAAG,2BAA2B,EAAE,CAAC;IAClC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,IAAI,CAAC,wBAAwB;QAAE,OAAO,IAAI,CAAC;IAE3C,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,IAAI,EAAE,CAAC;IAEtE,MAAM,YAAY,GAAG,MAAA,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,eAAe,CAAC,0CAAE,cAAc,0CAAG,CAAC,CAAC,0CAAE,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3F,MAAM,SAAS,GAAG,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,oBAAoB,CAAC,0CAAE,cAAc,mCAAI,EAAE,CAAC;IACxE,MAAM,kBAAkB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AC5F,CAAC,CAAC","sourcesContent":["import { FC, ReactNode } from 'react';\nimport { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { Banner } from './Banner';\nimport messages from './messages';\nimport { PROGRESSIVE_PROFILING_USER_STATUS } from '../data/constants';\nimport { trackProgressiveProfilingSearchPageBannerClick } from '@src/tracking/trackers/progressiveProfiling';\n\n/**\n * Single slot entry point.\n * Reads progressive profiling state from context and selects one CTA.\n */\nexport const BannerEntry: FC = () => {\n const {\n openModal,\n answers,\n progressiveProfileStatus,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n if (!progressiveProfileStatus) return null;\n\n const { status, remainingQuestions } = progressiveProfileStatus || {};\n\n const learningGoal = answers?.['learning-goal']?.selectedValues?.[0]?.replaceAll('-', ' ');\n const interests = answers?.['interests-declared']?.selectedValues ?? [];\n const formattedInterests = interests.length > 1\n ? `${interests.slice(0, -1).join(', ')} and ${interests.at(-1)}`\n : interests[0];\n\n // Handle button click for the banner and track the click event\n const handleButtonClick = () => {\n openModal();\n trackProgressiveProfilingSearchPageBannerClick({ host: window.location.origin, status });\n };\n\n let title: ReactNode = formatMessage(messages.notStartedTitle);\n let buttonText = formatMessage(messages.notStartedButtonText);\n\n if (status === PROGRESSIVE_PROFILING_USER_STATUS.COMPLETE) {\n title = formatMessage(messages.completeTitle, { learningGoal, interests: formattedInterests, bold: chunks => <strong>{chunks}</strong> });\n buttonText = formatMessage(messages.completeButtonText);\n }\n\n if (status === PROGRESSIVE_PROFILING_USER_STATUS.INCOMPLETE) {\n title = formatMessage(messages.incompleteTitle, { remainingQuestions });\n buttonText = formatMessage(messages.incompleteButtonText);\n }\n\n return <Banner onButtonClick={handleButtonClick} title={title} buttonText={buttonText} />;\n};\n"]}
1
+ {"version":3,"file":"BannerEntry.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/SearchPageBanners/BannerEntry.tsx"],"names":[],"m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AAG,GAAG,EAAE;QAC7B,SAAS,EAAE,CAAC;QACZ,8CAA8C,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1E,CAAC,CAAC;IAEF,IAAI,KAAK,GAAc,aAAa,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC/D,IAAI,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAE9D,IAAI,MAAM,KAAK,iCAAiC,CAAC,QAAQ,EAAE,CAAC;QAC1D,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,2BAAS,MAAM,GAAU,EAAE,CAAC,CAAC;QAC1I,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,MAAM,KAAK,iCAAiC,CAAC,UAAU,EAAE,CAAC;QAC5D,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,kBAAkB,EAAE,CAAC,CAAC;QACxE,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,KAAC,MAAM,IAAC,aAAa,EAAE,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,GAAI,CAAC;AAC5F,CAAC,CAAC","sourcesContent":["import { FC, ReactNode } from 'react';\nimport { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { Banner } from './Banner';\nimport messages from './messages';\nimport { PROGRESSIVE_PROFILING_USER_STATUS } from '../data/constants';\nimport { trackProgressiveProfilingSearchPageBannerClick } from '@src/tracking/trackers/progressiveProfiling';\n\n/**\n * Single slot entry point.\n * Reads progressive profiling state from context and selects one CTA.\n */\nexport const BannerEntry: FC = () => {\n const {\n openModal,\n answers,\n progressiveProfileStatus,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n if (!progressiveProfileStatus) return null;\n\n const { status, remainingQuestions } = progressiveProfileStatus || {};\n\n const learningGoal = answers?.['learning-goal']?.selectedValues?.[0]?.replaceAll('-', ' ');\n const interests = answers?.['interests-declared']?.selectedValues ?? [];\n const formattedInterests = interests.length > 1\n ? `${interests.slice(0, -1).join(', ')} and ${interests.at(-1)}`\n : interests[0];\n\n // Handle button click for the banner and track the click event\n const handleButtonClick = () => {\n openModal();\n trackProgressiveProfilingSearchPageBannerClick({ eventStatus: status });\n };\n\n let title: ReactNode = formatMessage(messages.notStartedTitle);\n let buttonText = formatMessage(messages.notStartedButtonText);\n\n if (status === PROGRESSIVE_PROFILING_USER_STATUS.COMPLETE) {\n title = formatMessage(messages.completeTitle, { learningGoal, interests: formattedInterests, bold: chunks => <strong>{chunks}</strong> });\n buttonText = formatMessage(messages.completeButtonText);\n }\n\n if (status === PROGRESSIVE_PROFILING_USER_STATUS.INCOMPLETE) {\n title = formatMessage(messages.incompleteTitle, { remainingQuestions });\n buttonText = formatMessage(messages.incompleteButtonText);\n }\n\n return <Banner onButtonClick={handleButtonClick} title={title} buttonText={buttonText} />;\n};\n"]}
@@ -10,3 +10,4 @@ export declare const PROGRESSIVE_PROFILING_USER_STATUS: {
10
10
  readonly COMPLETE: "complete";
11
11
  readonly NOT_STARTED: "not-started";
12
12
  };
13
+ export declare const getProgressiveProfilingStepName: (stepIndex: number) => ProgressiveProfilingQuizStepKey | undefined;
@@ -9,4 +9,5 @@ export const PROGRESSIVE_PROFILING_USER_STATUS = {
9
9
  COMPLETE: 'complete',
10
10
  NOT_STARTED: 'not-started',
11
11
  };
12
+ export const getProgressiveProfilingStepName = (stepIndex) => (Object.values(PROGRESSIVE_PROFILING_QUIZ_STEPS)[stepIndex]);
12
13
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/data/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,aAAa,EAAE,eAAe;IAC9B,mBAAmB,EAAE,qBAAqB;IAC1C,kBAAkB,EAAE,oBAAoB;IACxC,WAAW,EAAE,aAAa;CAClB,CAAC;AAKX,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;CAClB,CAAC","sourcesContent":["export const PROGRESSIVE_PROFILING_QUIZ_STEPS = {\n LEARNING_GOAL: 'learning-goal',\n LEARNING_MOTIVATION: 'learning-motivation',\n INTERESTS_DECLARED: 'interests-declared',\n WORK_STATUS: 'work-status',\n} as const;\n\nexport type ProgressiveProfilingQuizStepKey =\n typeof PROGRESSIVE_PROFILING_QUIZ_STEPS[keyof typeof PROGRESSIVE_PROFILING_QUIZ_STEPS];\n\nexport const PROGRESSIVE_PROFILING_USER_STATUS = {\n INCOMPLETE: 'incomplete',\n COMPLETE: 'complete',\n NOT_STARTED: 'not-started',\n} as const;\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/data/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,aAAa,EAAE,eAAe;IAC9B,mBAAmB,EAAE,qBAAqB;IAC1C,kBAAkB,EAAE,oBAAoB;IACxC,WAAW,EAAE,aAAa;CAClB,CAAC;AAKX,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;CAClB,CAAC;AAEX,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,SAAiB,EAA+C,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,gCAAgC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC","sourcesContent":["export const PROGRESSIVE_PROFILING_QUIZ_STEPS = {\n LEARNING_GOAL: 'learning-goal',\n LEARNING_MOTIVATION: 'learning-motivation',\n INTERESTS_DECLARED: 'interests-declared',\n WORK_STATUS: 'work-status',\n} as const;\n\nexport type ProgressiveProfilingQuizStepKey =\n typeof PROGRESSIVE_PROFILING_QUIZ_STEPS[keyof typeof PROGRESSIVE_PROFILING_QUIZ_STEPS];\n\nexport const PROGRESSIVE_PROFILING_USER_STATUS = {\n INCOMPLETE: 'incomplete',\n COMPLETE: 'complete',\n NOT_STARTED: 'not-started',\n} as const;\n\nexport const getProgressiveProfilingStepName = (stepIndex: number): ProgressiveProfilingQuizStepKey | undefined => (Object.values(PROGRESSIVE_PROFILING_QUIZ_STEPS)[stepIndex]);\n"]}
@@ -27,17 +27,24 @@ const InterestsDeclaredStep = () => {
27
27
  const { data: skills } = useSkills();
28
28
  const schema = buildInterestsDeclaredSchema(skills !== null && skills !== void 0 ? skills : []);
29
29
  const interestInput = (_b = (_a = answers[schema.questionId]) === null || _a === void 0 ? void 0 : _a.selectedValues) !== null && _b !== void 0 ? _b : [];
30
+ const eventSegmentAttributes = (answer) => ({
31
+ stepName: schema.questionId,
32
+ answer,
33
+ step: currentStep + 1,
34
+ question: schema.question.defaultMessage,
35
+ questionVersion: schema.version
36
+ });
30
37
  const addInterest = (value) => {
31
38
  if (interestInput.includes(value)) {
32
39
  return;
33
40
  }
34
41
  recordAnswer(buildAnswerRecord(schema, [...interestInput, value], formatMessage));
35
- trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: [...interestInput, value], step: currentStep + 1 });
42
+ trackProgressiveProfilingAnswerSelected(eventSegmentAttributes([...interestInput, value]));
36
43
  };
37
44
  const removeInterest = (value) => {
38
45
  const newInterestInput = interestInput.filter(item => value !== item);
39
46
  recordAnswer(buildAnswerRecord(schema, newInterestInput, formatMessage));
40
- trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: newInterestInput, step: currentStep + 1 });
47
+ trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(newInterestInput));
41
48
  };
42
49
  const handleAutosuggestChange = (value) => {
43
50
  setInputValue(value);
@@ -51,17 +58,17 @@ const InterestsDeclaredStep = () => {
51
58
  ? [...interestInput, value]
52
59
  : interestInput.filter((interest) => interest !== value);
53
60
  recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));
54
- trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: nextValues, step: currentStep + 1 });
61
+ trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(nextValues));
55
62
  };
56
63
  // Handles the click event for the "Continue" button, advancing to the next step and tracking the event.
57
64
  const handleNextButtonClick = () => {
58
65
  goToNextStep();
59
- trackProgressiveProfilingNextButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });
66
+ trackProgressiveProfilingNextButtonClick(eventSegmentAttributes(interestInput));
60
67
  };
61
68
  // Handles the click event for the "Back" button, going to the previous step and tracking the event.
62
69
  const handleBackButtonClick = () => {
63
70
  goToPreviousStep();
64
- trackProgressiveProfilingBackButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });
71
+ trackProgressiveProfilingBackButtonClick(eventSegmentAttributes(interestInput));
65
72
  };
66
73
  return (_jsxs(_Fragment, { children: [_jsxs(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED, title: formatMessage(messages.title), index: 2, children: [_jsx("h4", { children: formatMessage(messages.question) }), _jsx("p", { children: formatMessage(messages.subtitle) }), _jsxs("div", { className: "d-flex flex-column gap-2", children: [_jsx(InterestsDeclaredAutosuggest, { inputValue: inputValue, onChange: handleAutosuggestChange, skills: skills }), _jsx("div", { children: interestInput.map(interest => (_jsx(Chip, { iconAfter: Close, iconAfterAlt: formatMessage(messages.removeInterestIconAlt), variant: "dark", onIconAfterClick: () => removeInterest(interest), className: "interest-chip-checkbox", children: interest }, interest))) }), _jsx("p", { className: "font-weight-bold", children: formatMessage(messages.popularTopicsLabel) }), _jsx(Form.CheckboxSet, { name: "interests-declared-topics", isInline: true, value: interestInput, onChange: handleCheckboxTopicToggle, className: "interests-declared-checkbox-set", children: skills === null || skills === void 0 ? void 0 : skills.slice(0, 10).map(skill => (_jsx(Form.Checkbox, { value: skill.value, className: "ml-0 mr-3", children: skill.value }, skill.value))) })] })] }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED, children: [_jsx(Button, { variant: "outline-primary", onClick: handleBackButtonClick, children: formatMessage(stepMessages.backButton) }), _jsx(Button, { onClick: handleNextButtonClick, children: formatMessage(stepMessages.nextButton) })] })] }));
67
74
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAoB,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,4BAA4B,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,uCAAuC,EAAE,wCAAwC,EAAE,wCAAwC,EA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AAS,EAAC,wBAAwB,YAEjC,QAAQ,IAPJ,QAAQ,CAQR,CACR,CAAC,GACE,EACN,YAAG,SAAS,EAAC,kBAAkB,YAAE,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAK,EAChF,KAAC,IAAI,CAAC,WAAW,IACf,IAAI,EAAC,2BAA2B,EAChC,QAAQ,QACR,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,yBAAyB,EACnC,SAAS,EAAC,iCAAiC,YAE1C,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACjC,KAAC,IAAI,CAAC,QAAQ,IAAmB,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAC,WAAW,YACvE,KAAK,CAAC,KAAK,IADM,KAAK,CAAC,KAAK,CAEf,CACjB,CAAC,GACe,IACf,IACG,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,kBAAkB,aAC9E,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,qBAAqB,YAC7D,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,qBAAqB,YACnC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { Stepper, Button, Form, Chip } from '@openedx/paragon';\nimport { Close } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport BaseStep from '../BaseStep';\nimport InterestsDeclaredAutosuggest from './InterestsDeclaredAutosuggest';\nimport { useSkills, AutosuggestValue } from '@src/widgets/ProgressiveProfilingQuiz/data';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport buildInterestsDeclaredSchema from './schema';\nimport { trackProgressiveProfilingAnswerSelected, trackProgressiveProfilingNextButtonClick, trackProgressiveProfilingBackButtonClick } from '@src/tracking/trackers/progressiveProfiling';\n\nconst EMPTY_AUTOSUGGEST_VALUE: AutosuggestValue = {\n userProvidedText: '',\n selectionValue: '',\n selectionId: '',\n};\n\nimport stepMessages from '../messages';\nimport messages from './messages';\n\nimport './index.scss';\n\nconst InterestsDeclaredStep: React.FC = () => {\n const {\n goToPreviousStep, goToNextStep, answers, recordAnswer, currentStep,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const [inputValue, setInputValue] = useState<AutosuggestValue>(EMPTY_AUTOSUGGEST_VALUE);\n\n const { data: skills } = useSkills();\n const schema = buildInterestsDeclaredSchema(skills ?? []);\n const interestInput = answers[schema.questionId]?.selectedValues ?? [];\n\n const addInterest = (value: string) => {\n if (interestInput.includes(value)) {\n return;\n }\n recordAnswer(buildAnswerRecord(schema, [...interestInput, value], formatMessage));\n trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: [...interestInput, value], step: currentStep + 1 });\n };\n\n const removeInterest = (value: string) => {\n const newInterestInput = interestInput.filter(item => value !== item);\n recordAnswer(buildAnswerRecord(schema, newInterestInput, formatMessage));\n trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: newInterestInput, step: currentStep + 1 });\n };\n\n const handleAutosuggestChange = (value: AutosuggestValue) => {\n setInputValue(value);\n\n if (value.selectionValue) {\n addInterest(value.selectionValue);\n }\n };\n\n const handleCheckboxTopicToggle = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { value, checked } = event.target;\n\n const nextValues = checked\n ? [...interestInput, value]\n : interestInput.filter((interest) => interest !== value);\n recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));\n trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: nextValues, step: currentStep + 1 });\n };\n\n // Handles the click event for the \"Continue\" button, advancing to the next step and tracking the event.\n const handleNextButtonClick = () => {\n goToNextStep();\n trackProgressiveProfilingNextButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });\n };\n\n // Handles the click event for the \"Back\" button, going to the previous step and tracking the event.\n const handleBackButtonClick = () => {\n goToPreviousStep();\n trackProgressiveProfilingBackButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED}\n title={formatMessage(messages.title)}\n index={2}\n >\n <h4>{formatMessage(messages.question)}</h4>\n <p>{formatMessage(messages.subtitle)}</p>\n <div className=\"d-flex flex-column gap-2\">\n <InterestsDeclaredAutosuggest\n inputValue={inputValue}\n onChange={handleAutosuggestChange}\n skills={skills}\n />\n <div>\n {interestInput.map(interest => (\n <Chip\n key={interest}\n iconAfter={Close}\n iconAfterAlt={formatMessage(messages.removeInterestIconAlt)}\n variant=\"dark\"\n onIconAfterClick={() => removeInterest(interest)}\n className=\"interest-chip-checkbox\"\n >\n {interest}\n </Chip>\n ))}\n </div>\n <p className=\"font-weight-bold\">{formatMessage(messages.popularTopicsLabel)}</p>\n <Form.CheckboxSet\n name=\"interests-declared-topics\"\n isInline\n value={interestInput}\n onChange={handleCheckboxTopicToggle}\n className=\"interests-declared-checkbox-set\"\n >\n {skills?.slice(0, 10).map(skill => (\n <Form.Checkbox key={skill.value} value={skill.value} className=\"ml-0 mr-3\">\n {skill.value}\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </div>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED}>\n <Button variant=\"outline-primary\" onClick={handleBackButtonClick}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <Button onClick={handleNextButtonClick}>\n {formatMessage(stepMessages.nextButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default InterestsDeclaredStep;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,4BAA4B,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAoB,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,4BAA4B,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,uCAAuC,EAAE,wCAAwC,EAAE,wCAAwC,EAAE,MAAM,6CAA6C,CAAC;AAE1L,MAAM,uBAAuB,GAAqB;IAChD,gBAAgB,EAAE,EAAE;IACpB,cAAc,EAAE,EAAE;IAClB,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAa,GAAG,EAAE;;IAC3C,MAAM,EACJ,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE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,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,qBAAqB,YAC7D,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,qBAAqB,YACnC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import React, { useState } from 'react';\nimport { Stepper, Button, Form, Chip } from '@openedx/paragon';\nimport { Close } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport BaseStep from '../BaseStep';\nimport InterestsDeclaredAutosuggest from './InterestsDeclaredAutosuggest';\nimport { useSkills, AutosuggestValue } from '@src/widgets/ProgressiveProfilingQuiz/data';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport buildInterestsDeclaredSchema from './schema';\nimport { trackProgressiveProfilingAnswerSelected, trackProgressiveProfilingNextButtonClick, trackProgressiveProfilingBackButtonClick } from '@src/tracking/trackers/progressiveProfiling';\n\nconst EMPTY_AUTOSUGGEST_VALUE: AutosuggestValue = {\n userProvidedText: '',\n selectionValue: '',\n selectionId: '',\n};\n\nimport stepMessages from '../messages';\nimport messages from './messages';\n\nimport './index.scss';\n\nconst InterestsDeclaredStep: React.FC = () => {\n const {\n goToPreviousStep, goToNextStep, answers, recordAnswer, currentStep,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const [inputValue, setInputValue] = useState<AutosuggestValue>(EMPTY_AUTOSUGGEST_VALUE);\n\n const { data: skills } = useSkills();\n const schema = buildInterestsDeclaredSchema(skills ?? []);\n const interestInput = answers[schema.questionId]?.selectedValues ?? [];\n\n const eventSegmentAttributes = (answer: string[]) => ({\n stepName: schema.questionId,\n answer,\n step: currentStep + 1,\n question: schema.question.defaultMessage,\n questionVersion: schema.version\n });\n\n const addInterest = (value: string) => {\n if (interestInput.includes(value)) {\n return;\n }\n recordAnswer(buildAnswerRecord(schema, [...interestInput, value], formatMessage));\n trackProgressiveProfilingAnswerSelected(eventSegmentAttributes([...interestInput, value]));\n };\n\n const removeInterest = (value: string) => {\n const newInterestInput = interestInput.filter(item => value !== item);\n recordAnswer(buildAnswerRecord(schema, newInterestInput, formatMessage));\n trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(newInterestInput));\n };\n\n const handleAutosuggestChange = (value: AutosuggestValue) => {\n setInputValue(value);\n\n if (value.selectionValue) {\n addInterest(value.selectionValue);\n }\n };\n\n const handleCheckboxTopicToggle = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { value, checked } = event.target;\n\n const nextValues = checked\n ? [...interestInput, value]\n : interestInput.filter((interest) => interest !== value);\n recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));\n trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(nextValues));\n };\n\n // Handles the click event for the \"Continue\" button, advancing to the next step and tracking the event.\n const handleNextButtonClick = () => {\n goToNextStep();\n trackProgressiveProfilingNextButtonClick(eventSegmentAttributes(interestInput));\n };\n\n // Handles the click event for the \"Back\" button, going to the previous step and tracking the event.\n const handleBackButtonClick = () => {\n goToPreviousStep();\n trackProgressiveProfilingBackButtonClick(eventSegmentAttributes(interestInput));\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED}\n title={formatMessage(messages.title)}\n index={2}\n >\n <h4>{formatMessage(messages.question)}</h4>\n <p>{formatMessage(messages.subtitle)}</p>\n <div className=\"d-flex flex-column gap-2\">\n <InterestsDeclaredAutosuggest\n inputValue={inputValue}\n onChange={handleAutosuggestChange}\n skills={skills}\n />\n <div>\n {interestInput.map(interest => (\n <Chip\n key={interest}\n iconAfter={Close}\n iconAfterAlt={formatMessage(messages.removeInterestIconAlt)}\n variant=\"dark\"\n onIconAfterClick={() => removeInterest(interest)}\n className=\"interest-chip-checkbox\"\n >\n {interest}\n </Chip>\n ))}\n </div>\n <p className=\"font-weight-bold\">{formatMessage(messages.popularTopicsLabel)}</p>\n <Form.CheckboxSet\n name=\"interests-declared-topics\"\n isInline\n value={interestInput}\n onChange={handleCheckboxTopicToggle}\n className=\"interests-declared-checkbox-set\"\n >\n {skills?.slice(0, 10).map(skill => (\n <Form.Checkbox key={skill.value} value={skill.value} className=\"ml-0 mr-3\">\n {skill.value}\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </div>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED}>\n <Button variant=\"outline-primary\" onClick={handleBackButtonClick}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <Button onClick={handleNextButtonClick}>\n {formatMessage(stepMessages.nextButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default InterestsDeclaredStep;\n"]}
@@ -14,9 +14,16 @@ const LearningGoalStep = () => {
14
14
  const { goToNextStep, answers, recordAnswer, currentStep } = useProgressiveProfilingQuiz();
15
15
  const { formatMessage } = useIntl();
16
16
  const selectedValue = (_b = (_a = answers[schema.questionId]) === null || _a === void 0 ? void 0 : _a.selectedValues[0]) !== null && _b !== void 0 ? _b : '';
17
+ const eventSegmentAttributes = (answer) => ({
18
+ stepName: schema.questionId,
19
+ answer,
20
+ step: currentStep + 1,
21
+ question: schema.question.defaultMessage,
22
+ questionVersion: schema.version
23
+ });
17
24
  const handleChange = (event) => {
18
25
  recordAnswer(buildAnswerRecord(schema, [event.target.value], formatMessage));
19
- trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: event.target.value, step: currentStep + 1 });
26
+ trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(event.target.value));
20
27
  };
21
28
  const handleOptionClick = (event) => {
22
29
  var _a;
@@ -28,7 +35,7 @@ const LearningGoalStep = () => {
28
35
  // Handles the click event for the "Continue" button, advancing to the next step and tracking the event.
29
36
  const handleButtonClick = () => {
30
37
  goToNextStep();
31
- trackProgressiveProfilingNextButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });
38
+ trackProgressiveProfilingNextButtonClick(eventSegmentAttributes(selectedValue));
32
39
  };
33
40
  return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL, title: formatMessage(messages.title), index: 0, optionalHeaderText: formatMessage(messages.headerText), children: _jsxs(Form.Group, { className: "mb-0", children: [_jsx(Form.Label, { className: "h4", children: formatMessage(messages.question) }), _jsx("p", { children: formatMessage(messages.hint) }), _jsx(Form.RadioSet, { name: schema.questionId, value: selectedValue, onChange: handleChange, className: "gap-4", children: schema.options.map(option => (_jsx("div", { className: "learning-goal-radio d-flex bg-light-100 px-3 py-3.5 mt-0", onClick: handleOptionClick, children: _jsx(Form.Radio, { value: option.value, children: formatMessage(option.message) }) }, option.value))) })] }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL, children: [_jsx(Stepper.ActionRow.Spacer, {}), _jsx(Button, { variant: "outline-primary", onClick: handleButtonClick, disabled: !selectedValue, children: formatMessage(messages.continueButton) })] })] }));
34
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,OAAO,EAAE,MAAM,EAAE,IAAI,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,E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,aACzE,KAAC,OAAO,CAAC,SAAS,CAAC,MAAM,KAAG,EAC5B,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC,aAAa,YACnF,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import React from 'react';\nimport {\n Stepper, Button, Form,\n} from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport BaseStep from '../BaseStep';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport messages from './messages';\nimport schema from './schema';\nimport { trackProgressiveProfilingAnswerSelected, trackProgressiveProfilingNextButtonClick } from '@src/tracking/trackers/progressiveProfiling';\n\nimport './index.scss';\n\nconst LearningGoalStep: React.FC = () => {\n const { goToNextStep, answers, recordAnswer, currentStep } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const selectedValue = answers[schema.questionId]?.selectedValues[0] ?? '';\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n recordAnswer(buildAnswerRecord(schema, [event.target.value], formatMessage));\n trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: event.target.value, step: currentStep + 1 });\n };\n\n const handleOptionClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"radio\"]')?.click();\n };\n\n // Handles the click event for the \"Continue\" button, advancing to the next step and tracking the event.\n const handleButtonClick = () => {\n goToNextStep();\n trackProgressiveProfilingNextButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL}\n title={formatMessage(messages.title)}\n index={0}\n optionalHeaderText={formatMessage(messages.headerText)}\n >\n <Form.Group className=\"mb-0\">\n <Form.Label className=\"h4\">\n {formatMessage(messages.question)}\n </Form.Label>\n <p>{formatMessage(messages.hint)}</p>\n <Form.RadioSet\n name={schema.questionId}\n value={selectedValue}\n onChange={handleChange}\n className=\"gap-4\"\n >\n {schema.options.map(option => (\n <div\n key={option.value}\n className=\"learning-goal-radio d-flex bg-light-100 px-3 py-3.5 mt-0\"\n onClick={handleOptionClick}\n >\n <Form.Radio value={option.value}>\n {formatMessage(option.message)}\n </Form.Radio>\n </div>\n ))}\n </Form.RadioSet>\n </Form.Group>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL}>\n <Stepper.ActionRow.Spacer />\n <Button variant=\"outline-primary\" onClick={handleButtonClick} disabled={!selectedValue}>\n {formatMessage(messages.continueButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default LearningGoalStep;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,OAAO,EAAE,MAAM,EAAE,IAAI,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,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AC,QAAQ,CAAC,cAAc,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import React from 'react';\nimport {\n Stepper, Button, Form,\n} from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport BaseStep from '../BaseStep';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport messages from './messages';\nimport schema from './schema';\nimport { trackProgressiveProfilingAnswerSelected, trackProgressiveProfilingNextButtonClick } from '@src/tracking/trackers/progressiveProfiling';\n\nimport './index.scss';\n\nconst LearningGoalStep: React.FC = () => {\n const { goToNextStep, answers, recordAnswer, currentStep } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const selectedValue = answers[schema.questionId]?.selectedValues[0] ?? '';\n\n const eventSegmentAttributes = (answer: string) => ({\n stepName: schema.questionId,\n answer,\n step: currentStep + 1,\n question: schema.question.defaultMessage,\n questionVersion: schema.version\n });\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n recordAnswer(buildAnswerRecord(schema, [event.target.value], formatMessage));\n trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(event.target.value));\n };\n\n const handleOptionClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"radio\"]')?.click();\n };\n\n // Handles the click event for the \"Continue\" button, advancing to the next step and tracking the event.\n const handleButtonClick = () => {\n goToNextStep();\n trackProgressiveProfilingNextButtonClick(eventSegmentAttributes(selectedValue));\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL}\n title={formatMessage(messages.title)}\n index={0}\n optionalHeaderText={formatMessage(messages.headerText)}\n >\n <Form.Group className=\"mb-0\">\n <Form.Label className=\"h4\">\n {formatMessage(messages.question)}\n </Form.Label>\n <p>{formatMessage(messages.hint)}</p>\n <Form.RadioSet\n name={schema.questionId}\n value={selectedValue}\n onChange={handleChange}\n className=\"gap-4\"\n >\n {schema.options.map(option => (\n <div\n key={option.value}\n className=\"learning-goal-radio d-flex bg-light-100 px-3 py-3.5 mt-0\"\n onClick={handleOptionClick}\n >\n <Form.Radio value={option.value}>\n {formatMessage(option.message)}\n </Form.Radio>\n </div>\n ))}\n </Form.RadioSet>\n </Form.Group>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL}>\n <Stepper.ActionRow.Spacer />\n <Button variant=\"outline-primary\" onClick={handleButtonClick} disabled={!selectedValue}>\n {formatMessage(messages.continueButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default LearningGoalStep;\n"]}
@@ -15,13 +15,20 @@ const LearningMotivationStep = () => {
15
15
  const { goToPreviousStep, goToNextStep, answers, recordAnswer, currentStep } = useProgressiveProfilingQuiz();
16
16
  const { formatMessage } = useIntl();
17
17
  const selectedValues = (_b = (_a = answers[schema.questionId]) === null || _a === void 0 ? void 0 : _a.selectedValues) !== null && _b !== void 0 ? _b : [];
18
+ const eventSegmentAttributes = (answer) => ({
19
+ stepName: schema.questionId,
20
+ answer,
21
+ step: currentStep + 1,
22
+ question: schema.question.defaultMessage,
23
+ questionVersion: schema.version
24
+ });
18
25
  const handleChange = (event) => {
19
26
  const { checked, value } = event.target;
20
27
  const nextValues = checked
21
28
  ? [...selectedValues, value]
22
29
  : selectedValues.filter(selectedValue => selectedValue !== value);
23
30
  recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));
24
- trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: nextValues, step: currentStep + 1 });
31
+ trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(nextValues));
25
32
  };
26
33
  const handleOptionClick = (event) => {
27
34
  var _a;
@@ -33,12 +40,12 @@ const LearningMotivationStep = () => {
33
40
  // Handles the click event for the "Continue" button, advancing to the next step and tracking the event.
34
41
  const handleNextButtonClick = () => {
35
42
  goToNextStep();
36
- trackProgressiveProfilingNextButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });
43
+ trackProgressiveProfilingNextButtonClick(eventSegmentAttributes(selectedValues));
37
44
  };
38
45
  // Handles the click event for the "Back" button, going to the previous step and tracking the event.
39
46
  const handleBackButtonClick = () => {
40
47
  goToPreviousStep();
41
- trackProgressiveProfilingBackButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });
48
+ trackProgressiveProfilingBackButtonClick(eventSegmentAttributes(selectedValues));
42
49
  };
43
50
  return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION, title: formatMessage(messages.title), index: 1, children: _jsxs(Form.Group, { className: "mb-0", children: [_jsx(Form.Label, { className: "h4", children: formatMessage(messages.question) }), _jsx("p", { children: formatMessage(messages.hint) }), _jsx(Form.CheckboxSet, { name: schema.questionId, value: selectedValues, onChange: handleChange, className: "gap-4", children: schema.options.map(option => (_jsx("div", { className: "learning-motivation-checkbox d-flex bg-light-100 px-3 py-3.5 mt-0", onClick: handleOptionClick, children: _jsx(Form.Checkbox, { value: option.value, children: formatMessage(option.message) }) }, option.value))) })] }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION, children: [_jsx(Button, { variant: "outline-primary", onClick: handleBackButtonClick, children: formatMessage(stepMessages.backButton) }), _jsx(Button, { onClick: handleNextButtonClick, disabled: selectedValues.length === 0, className: "ml-3", children: formatMessage(stepMessages.nextButton) })] })] }));
44
51
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,uCAAuC,EAAE,wCAAwC,EAAE,wCAAwC,EAAE,MAAM,6CAA6C,CAAC;AAE1L,OAAO,cAAc,CAAC;AAEtB,MAAM,sBAAsB,GAAa,GAAG,EAAE;;IAC5C,MAAM,EACJ,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EACnE,GAAG,2BAA2B,EAAE,CAAC;IAClC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,cAAc,GAAG,MAAA,MAAA,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,0CAAE,cAAc,mCAAI,EAAE,CAAC;IAExE,MAAM,YAAY,GAAG,CAAC,KAA0C,EAAE,EAAE;QAClE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QACxC,MAAM,UAAU,GAAG,OAAO;YACxB,CAAC,CAAC,CAAC,GAAG,cAAc,EAAE,KAAK,CAAC;YAC5B,CAAC,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,aAAa,KAAK,KA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AAI,CAAC,KAAK,IAAC,SAAS,EAAC,MAAM,aAC1B,KAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,IAAI,YACvB,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GACtB,EACb,sBAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAK,EACrC,KAAC,IAAI,CAAC,WAAW,IACf,IAAI,EAAE,MAAM,CAAC,UAAU,EACvB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAC,OAAO,YAEhB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAC5B,cAEE,SAAS,EAAC,mEAAmE,EAC7E,OAAO,EAAE,iBAAiB,YAE1B,KAAC,IAAI,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,YAC/B,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,GAChB,IANX,MAAM,CAAC,KAAK,CAOb,CACP,CAAC,GACe,IACR,GACJ,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,mBAAmB,aAC/E,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,qBAAqB,YAC7D,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,SAAS,EAAC,MAAM,YAC5F,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import React from 'react';\nimport { Stepper, Button, Form } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport BaseStep from '../BaseStep';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport stepMessages from '../messages';\nimport messages from './messages';\nimport schema from './schema';\nimport { trackProgressiveProfilingAnswerSelected, trackProgressiveProfilingNextButtonClick, trackProgressiveProfilingBackButtonClick } from '@src/tracking/trackers/progressiveProfiling';\n\nimport './index.scss';\n\nconst LearningMotivationStep: React.FC = () => {\n const {\n goToPreviousStep, goToNextStep, answers, recordAnswer, currentStep\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const selectedValues = answers[schema.questionId]?.selectedValues ?? [];\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { checked, value } = event.target;\n const nextValues = checked\n ? [...selectedValues, value]\n : selectedValues.filter(selectedValue => selectedValue !== value);\n recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));\n trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: nextValues, step: currentStep + 1 });\n };\n\n const handleOptionClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"checkbox\"]')?.click();\n };\n\n // Handles the click event for the \"Continue\" button, advancing to the next step and tracking the event.\n const handleNextButtonClick = () => {\n goToNextStep();\n trackProgressiveProfilingNextButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });\n };\n\n // Handles the click event for the \"Back\" button, going to the previous step and tracking the event.\n const handleBackButtonClick = () => {\n goToPreviousStep();\n trackProgressiveProfilingBackButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}\n title={formatMessage(messages.title)}\n index={1}\n >\n <Form.Group className=\"mb-0\">\n <Form.Label className=\"h4\">\n {formatMessage(messages.question)}\n </Form.Label>\n <p>{formatMessage(messages.hint)}</p>\n <Form.CheckboxSet\n name={schema.questionId}\n value={selectedValues}\n onChange={handleChange}\n className=\"gap-4\"\n >\n {schema.options.map(option => (\n <div\n key={option.value}\n className=\"learning-motivation-checkbox d-flex bg-light-100 px-3 py-3.5 mt-0\"\n onClick={handleOptionClick}\n >\n <Form.Checkbox value={option.value}>\n {formatMessage(option.message)}\n </Form.Checkbox>\n </div>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}>\n <Button variant=\"outline-primary\" onClick={handleBackButtonClick}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <Button onClick={handleNextButtonClick} disabled={selectedValues.length === 0} className=\"ml-3\">\n {formatMessage(stepMessages.nextButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default LearningMotivationStep;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,uCAAuC,EAAE,wCAAwC,EAAE,wCAAwC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CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,mBAAmB,aAC/E,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,qBAAqB,YAC7D,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,SAAS,EAAC,MAAM,YAC5F,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import React from 'react';\nimport { Stepper, Button, Form } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport BaseStep from '../BaseStep';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport stepMessages from '../messages';\nimport messages from './messages';\nimport schema from './schema';\nimport { trackProgressiveProfilingAnswerSelected, trackProgressiveProfilingNextButtonClick, trackProgressiveProfilingBackButtonClick } from '@src/tracking/trackers/progressiveProfiling';\n\nimport './index.scss';\n\nconst LearningMotivationStep: React.FC = () => {\n const {\n goToPreviousStep, goToNextStep, answers, recordAnswer, currentStep\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const selectedValues = answers[schema.questionId]?.selectedValues ?? [];\n\n const eventSegmentAttributes = (answer: string[]) => ({\n stepName: schema.questionId,\n answer,\n step: currentStep + 1,\n question: schema.question.defaultMessage,\n questionVersion: schema.version\n });\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { checked, value } = event.target;\n const nextValues = checked\n ? [...selectedValues, value]\n : selectedValues.filter(selectedValue => selectedValue !== value);\n recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));\n trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(nextValues));\n };\n\n const handleOptionClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"checkbox\"]')?.click();\n };\n\n // Handles the click event for the \"Continue\" button, advancing to the next step and tracking the event.\n const handleNextButtonClick = () => {\n goToNextStep();\n trackProgressiveProfilingNextButtonClick(eventSegmentAttributes(selectedValues));\n };\n\n // Handles the click event for the \"Back\" button, going to the previous step and tracking the event.\n const handleBackButtonClick = () => {\n goToPreviousStep();\n trackProgressiveProfilingBackButtonClick(eventSegmentAttributes(selectedValues));\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}\n title={formatMessage(messages.title)}\n index={1}\n >\n <Form.Group className=\"mb-0\">\n <Form.Label className=\"h4\">\n {formatMessage(messages.question)}\n </Form.Label>\n <p>{formatMessage(messages.hint)}</p>\n <Form.CheckboxSet\n name={schema.questionId}\n value={selectedValues}\n onChange={handleChange}\n className=\"gap-4\"\n >\n {schema.options.map(option => (\n <div\n key={option.value}\n className=\"learning-motivation-checkbox d-flex bg-light-100 px-3 py-3.5 mt-0\"\n onClick={handleOptionClick}\n >\n <Form.Checkbox value={option.value}>\n {formatMessage(option.message)}\n </Form.Checkbox>\n </div>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}>\n <Button variant=\"outline-primary\" onClick={handleBackButtonClick}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <Button onClick={handleNextButtonClick} disabled={selectedValues.length === 0} className=\"ml-3\">\n {formatMessage(stepMessages.nextButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default LearningMotivationStep;\n"]}
@@ -14,7 +14,7 @@ const ViewResultsButton = () => {
14
14
  const navigate = useNavigate();
15
15
  const handleClick = () => {
16
16
  var _a, _b;
17
- trackProgressiveProfilingSubmitClick({ host: window.location.origin });
17
+ trackProgressiveProfilingSubmitClick({});
18
18
  saveAnswers(answers, { onSuccess: () => setIsComplete(true) });
19
19
  closeModal();
20
20
  const interest = (_b = (_a = answers[PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED]) === null || _a === void 0 ? void 0 : _a.selectedValues[0]) !== null && _b !== void 0 ? _b : '';
@@ -1 +1 @@
1
- {"version":3,"file":"ViewResultsButton.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/ViewResultsButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,oCAAoC,EAAE,MAAM,6CAA6C,CAAC;AAEnG,MAAM,iBAAiB,GAAa,GAAG,EAAE;IACvC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAC7E,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IAE5D,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,WAAW,GAAG,GAAG,EAAE;;QACvB,oCAAoC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACvE,WAAW,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/D,UAAU,EAAE,CAAC;QAEb,MAAM,QAAQ,GAAG,MAAA,MAAA,OAAO,CAAC,gCAAgC,CAAC,kBAAkB,CAAC,0CAAE,cAAc,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC;QACvG,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC1D,QAAQ,CAAC,wBAAwB,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,YAC9C,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GACnC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import React from 'react';\nimport { Button } from '@openedx/paragon';\nimport { useNavigate } from 'react-router';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { useSaveAnswers } from '@src/widgets/ProgressiveProfilingQuiz/data';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport messages from './messages';\nimport { trackProgressiveProfilingSubmitClick } from '@src/tracking/trackers/progressiveProfiling';\n\nconst ViewResultsButton: React.FC = () => {\n const { formatMessage } = useIntl();\n const { answers, setIsComplete, closeModal } = useProgressiveProfilingQuiz();\n const { mutate: saveAnswers, isPending } = useSaveAnswers();\n\n const navigate = useNavigate();\n\n const handleClick = () => {\n trackProgressiveProfilingSubmitClick({ host: window.location.origin });\n saveAnswers(answers, { onSuccess: () => setIsComplete(true) });\n closeModal();\n\n const interest = answers[PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED]?.selectedValues[0] ?? '';\n const searchParams = new URLSearchParams({ q: interest });\n navigate(`/subscription-search?${searchParams.toString()}`);\n };\n\n return (\n <Button onClick={handleClick} disabled={isPending}>\n {formatMessage(messages.viewResultsButton)}\n </Button>\n );\n};\n\nexport default ViewResultsButton;\n"]}
1
+ {"version":3,"file":"ViewResultsButton.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/ViewResultsButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,oCAAoC,EAAE,MAAM,6CAA6C,CAAC;AAEnG,MAAM,iBAAiB,GAAa,GAAG,EAAE;IACvC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAC7E,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IAE5D,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,WAAW,GAAG,GAAG,EAAE;;QACvB,oCAAoC,CAAC,EAAE,CAAC,CAAC;QACzC,WAAW,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/D,UAAU,EAAE,CAAC;QAEb,MAAM,QAAQ,GAAG,MAAA,MAAA,OAAO,CAAC,gCAAgC,CAAC,kBAAkB,CAAC,0CAAE,cAAc,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC;QACvG,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC1D,QAAQ,CAAC,wBAAwB,YAAY,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC9D,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,YAC9C,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GACnC,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import React from 'react';\nimport { Button } from '@openedx/paragon';\nimport { useNavigate } from 'react-router';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { useSaveAnswers } from '@src/widgets/ProgressiveProfilingQuiz/data';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport messages from './messages';\nimport { trackProgressiveProfilingSubmitClick } from '@src/tracking/trackers/progressiveProfiling';\n\nconst ViewResultsButton: React.FC = () => {\n const { formatMessage } = useIntl();\n const { answers, setIsComplete, closeModal } = useProgressiveProfilingQuiz();\n const { mutate: saveAnswers, isPending } = useSaveAnswers();\n\n const navigate = useNavigate();\n\n const handleClick = () => {\n trackProgressiveProfilingSubmitClick({});\n saveAnswers(answers, { onSuccess: () => setIsComplete(true) });\n closeModal();\n\n const interest = answers[PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED]?.selectedValues[0] ?? '';\n const searchParams = new URLSearchParams({ q: interest });\n navigate(`/subscription-search?${searchParams.toString()}`);\n };\n\n return (\n <Button onClick={handleClick} disabled={isPending}>\n {formatMessage(messages.viewResultsButton)}\n </Button>\n );\n};\n\nexport default ViewResultsButton;\n"]}
@@ -40,11 +40,18 @@ const WorkStatusStep = () => {
40
40
  selectionId: matchingJob ? getJobId(matchingJob.jobTitle) : '',
41
41
  });
42
42
  }, [selectedValue, isNotEmployed]);
43
+ const eventSegmentAttributes = (answer) => ({
44
+ stepName: schema.questionId,
45
+ answer,
46
+ step: currentStep + 1,
47
+ question: schema.question.defaultMessage,
48
+ questionVersion: schema.version
49
+ });
43
50
  const handleJobSelect = (value) => {
44
51
  setInputValue(value);
45
52
  if (value.selectionValue) {
46
53
  recordAnswer(buildAnswerRecord(schema, [value.selectionValue], formatMessage));
47
- trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: [value.selectionValue], step: currentStep + 1 });
54
+ trackProgressiveProfilingAnswerSelected(eventSegmentAttributes([value.selectionValue]));
48
55
  }
49
56
  };
50
57
  const handleNotEmployedToggle = (event) => {
@@ -53,12 +60,13 @@ const WorkStatusStep = () => {
53
60
  setInputValue(EMPTY_AUTOSUGGEST_VALUE);
54
61
  }
55
62
  recordAnswer(buildAnswerRecord(schema, checked ? [NOT_EMPLOYED_VALUE] : [], formatMessage));
56
- trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: checked ? [NOT_EMPLOYED_VALUE] : [], step: currentStep + 1 });
63
+ trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(checked ? [NOT_EMPLOYED_VALUE] : []));
57
64
  };
58
65
  // Handles the click event for the "Back" button, going to the previous step and tracking the event.
59
66
  const handleBackButtonClick = () => {
67
+ var _a, _b;
60
68
  goToPreviousStep();
61
- trackProgressiveProfilingBackButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });
69
+ trackProgressiveProfilingBackButtonClick(eventSegmentAttributes((_b = (_a = answers[schema.questionId]) === null || _a === void 0 ? void 0 : _a.selectedValues) !== null && _b !== void 0 ? _b : []));
62
70
  };
63
71
  return (_jsxs(_Fragment, { children: [_jsxs(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS, title: formatMessage(messages.title), index: 3, children: [_jsx("h4", { children: formatMessage(messages.question) }), _jsx("p", { children: formatMessage(messages.subtitle) }), _jsx(Form.Autosuggest, { name: "work-status-autosuggest", value: inputValue, onChange: handleJobSelect, className: "h-50", placeholder: "Search for a job title", trailingElement: (_jsx(Icon, { src: Search })), children: jobsList === null || jobsList === void 0 ? void 0 : jobsList.map(job => (_jsx(Form.AutosuggestOption, { id: getJobId(job.jobTitle), children: job.jobTitle }, job.jobTitle))) }), _jsx(Form.Checkbox, { className: "mt-6", checked: isNotEmployed, onChange: handleNotEmployedToggle, children: _jsxs("span", { className: !isNotEmployed ? 'text-muted' : '', children: [" ", formatMessage(messages.notEmployedOption), " "] }) })] }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS, children: [_jsx(Button, { variant: "outline-primary", onClick: handleBackButtonClick, children: formatMessage(stepMessages.backButton) }), _jsx(ViewResultsButton, {})] })] }));
64
72
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,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B,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,YAEzB,GAAG,CAAC,QAAQ,IAHR,GAAG,CAAC,QAAQ,CAIM,CAC1B,CAAC,GACe,EACnB,KAAC,IAAI,CAAC,QAAQ,IACZ,SAAS,EAAC,MAAM,EAChB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,uBAAuB,YAEjC,gBAAM,SAAS,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,kBAAI,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,SAAS,GAC3F,IACP,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,WAAW,aACvE,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,qBAAqB,YAC7D,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,iBAAiB,KAAG,IACH,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { Stepper, Button, Form, Icon } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { AutosuggestValue } from '@src/widgets/ProgressiveProfilingQuiz/data';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport jobsList from '@src/widgets/ProgressiveProfilingQuiz/data/jobsList';\nimport BaseStep from '../BaseStep';\nimport stepMessages from '../messages';\nimport messages from './messages';\nimport schema, { NOT_EMPLOYED_VALUE } from './schema';\nimport ViewResultsButton from './ViewResultsButton';\nimport { trackProgressiveProfilingAnswerSelected, trackProgressiveProfilingBackButtonClick } from '@src/tracking/trackers/progressiveProfiling';\nimport { Search } from '@openedx/paragon/icons';\n\nconst EMPTY_AUTOSUGGEST_VALUE: AutosuggestValue = {\n userProvidedText: '',\n selectionValue: '',\n selectionId: '',\n};\n\nconst getJobId = (jobTitle: string) => jobTitle.replaceAll(' ', '-').toLowerCase();\n\nconst WorkStatusStep: React.FC = () => {\n const {\n goToPreviousStep, answers, recordAnswer, currentStep,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const [inputValue, setInputValue] = useState<AutosuggestValue>(EMPTY_AUTOSUGGEST_VALUE);\n\n const selectedValue = answers[schema.questionId]?.selectedValues[0] ?? '';\n const isNotEmployed = selectedValue === NOT_EMPLOYED_VALUE;\n\n // Populate the controlled autosuggest when a previously saved answer is loaded.\n useEffect(() => {\n if (!selectedValue || isNotEmployed) {\n setInputValue(EMPTY_AUTOSUGGEST_VALUE);\n return;\n }\n\n const matchingJob = jobsList.find(job => job.jobTitle === selectedValue);\n\n setInputValue({\n userProvidedText: matchingJob?.jobTitle ?? selectedValue,\n selectionValue: selectedValue,\n selectionId: matchingJob ? getJobId(matchingJob.jobTitle) : '',\n });\n }, [selectedValue, isNotEmployed]);\n\n const handleJobSelect = (value: AutosuggestValue) => {\n setInputValue(value);\n\n if (value.selectionValue) {\n recordAnswer(buildAnswerRecord(schema, [value.selectionValue], formatMessage));\n trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: [value.selectionValue], step: currentStep + 1 });\n }\n };\n\n const handleNotEmployedToggle = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { checked } = event.target;\n\n if (checked) {\n setInputValue(EMPTY_AUTOSUGGEST_VALUE);\n }\n recordAnswer(buildAnswerRecord(schema, checked ? [NOT_EMPLOYED_VALUE] : [], formatMessage));\n trackProgressiveProfilingAnswerSelected({ host: window.location.origin, question: schema.questionId, answer: checked ? [NOT_EMPLOYED_VALUE] : [], step: currentStep + 1 });\n };\n\n // Handles the click event for the \"Back\" button, going to the previous step and tracking the event.\n const handleBackButtonClick = () => {\n goToPreviousStep();\n trackProgressiveProfilingBackButtonClick({ host: window.location.origin, step: currentStep + 1, question: schema.questionId });\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS}\n title={formatMessage(messages.title)}\n index={3}\n >\n <h4>\n {formatMessage(messages.question)}\n </h4>\n <p>\n {formatMessage(messages.subtitle)}\n </p>\n <Form.Autosuggest\n name=\"work-status-autosuggest\"\n value={inputValue}\n onChange={handleJobSelect}\n className=\"h-50\"\n placeholder=\"Search for a job title\"\n trailingElement={(\n <Icon\n src={Search}\n />\n )}\n >\n {jobsList?.map(job => (\n <Form.AutosuggestOption\n key={job.jobTitle}\n id={getJobId(job.jobTitle)}\n >\n {job.jobTitle}\n </Form.AutosuggestOption>\n ))}\n </Form.Autosuggest>\n <Form.Checkbox\n className=\"mt-6\"\n checked={isNotEmployed}\n onChange={handleNotEmployedToggle}\n >\n <span className={!isNotEmployed ? 'text-muted' : ''}> {formatMessage(messages.notEmployedOption)} </span>\n </Form.Checkbox>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS}>\n <Button variant=\"outline-primary\" onClick={handleBackButtonClick}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <ViewResultsButton />\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default WorkStatusStep;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,2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AiB,IAErB,EAAE,EAAE,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,YAEzB,GAAG,CAAC,QAAQ,IAHR,GAAG,CAAC,QAAQ,CAIM,CAC1B,CAAC,GACe,EACnB,KAAC,IAAI,CAAC,QAAQ,IACZ,SAAS,EAAC,MAAM,EAChB,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,uBAAuB,YAEjC,gBAAM,SAAS,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,kBAAI,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,SAAS,GAC3F,IACP,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,WAAW,aACvE,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,qBAAqB,YAC7D,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,iBAAiB,KAAG,IACH,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { Stepper, Button, Form, Icon } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { AutosuggestValue } from '@src/widgets/ProgressiveProfilingQuiz/data';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport jobsList from '@src/widgets/ProgressiveProfilingQuiz/data/jobsList';\nimport BaseStep from '../BaseStep';\nimport stepMessages from '../messages';\nimport messages from './messages';\nimport schema, { NOT_EMPLOYED_VALUE } from './schema';\nimport ViewResultsButton from './ViewResultsButton';\nimport { trackProgressiveProfilingAnswerSelected, trackProgressiveProfilingBackButtonClick } from '@src/tracking/trackers/progressiveProfiling';\nimport { Search } from '@openedx/paragon/icons';\n\nconst EMPTY_AUTOSUGGEST_VALUE: AutosuggestValue = {\n userProvidedText: '',\n selectionValue: '',\n selectionId: '',\n};\n\nconst getJobId = (jobTitle: string) => jobTitle.replaceAll(' ', '-').toLowerCase();\n\nconst WorkStatusStep: React.FC = () => {\n const {\n goToPreviousStep, answers, recordAnswer, currentStep,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const [inputValue, setInputValue] = useState<AutosuggestValue>(EMPTY_AUTOSUGGEST_VALUE);\n\n const selectedValue = answers[schema.questionId]?.selectedValues[0] ?? '';\n const isNotEmployed = selectedValue === NOT_EMPLOYED_VALUE;\n\n // Populate the controlled autosuggest when a previously saved answer is loaded.\n useEffect(() => {\n if (!selectedValue || isNotEmployed) {\n setInputValue(EMPTY_AUTOSUGGEST_VALUE);\n return;\n }\n\n const matchingJob = jobsList.find(job => job.jobTitle === selectedValue);\n\n setInputValue({\n userProvidedText: matchingJob?.jobTitle ?? selectedValue,\n selectionValue: selectedValue,\n selectionId: matchingJob ? getJobId(matchingJob.jobTitle) : '',\n });\n }, [selectedValue, isNotEmployed]);\n\n const eventSegmentAttributes = (answer: string[]) => ({\n stepName: schema.questionId,\n answer,\n step: currentStep + 1,\n question: schema.question.defaultMessage,\n questionVersion: schema.version\n });\n\n const handleJobSelect = (value: AutosuggestValue) => {\n setInputValue(value);\n\n if (value.selectionValue) {\n recordAnswer(buildAnswerRecord(schema, [value.selectionValue], formatMessage));\n trackProgressiveProfilingAnswerSelected(eventSegmentAttributes([value.selectionValue]));\n }\n };\n\n const handleNotEmployedToggle = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { checked } = event.target;\n\n if (checked) {\n setInputValue(EMPTY_AUTOSUGGEST_VALUE);\n }\n recordAnswer(buildAnswerRecord(schema, checked ? [NOT_EMPLOYED_VALUE] : [], formatMessage));\n trackProgressiveProfilingAnswerSelected(eventSegmentAttributes(checked ? [NOT_EMPLOYED_VALUE] : []));\n };\n\n // Handles the click event for the \"Back\" button, going to the previous step and tracking the event.\n const handleBackButtonClick = () => {\n goToPreviousStep();\n trackProgressiveProfilingBackButtonClick(eventSegmentAttributes(answers[schema.questionId]?.selectedValues ?? []));\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS}\n title={formatMessage(messages.title)}\n index={3}\n >\n <h4>\n {formatMessage(messages.question)}\n </h4>\n <p>\n {formatMessage(messages.subtitle)}\n </p>\n <Form.Autosuggest\n name=\"work-status-autosuggest\"\n value={inputValue}\n onChange={handleJobSelect}\n className=\"h-50\"\n placeholder=\"Search for a job title\"\n trailingElement={(\n <Icon\n src={Search}\n />\n )}\n >\n {jobsList?.map(job => (\n <Form.AutosuggestOption\n key={job.jobTitle}\n id={getJobId(job.jobTitle)}\n >\n {job.jobTitle}\n </Form.AutosuggestOption>\n ))}\n </Form.Autosuggest>\n <Form.Checkbox\n className=\"mt-6\"\n checked={isNotEmployed}\n onChange={handleNotEmployedToggle}\n >\n <span className={!isNotEmployed ? 'text-muted' : ''}> {formatMessage(messages.notEmployedOption)} </span>\n </Form.Checkbox>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS}>\n <Button variant=\"outline-primary\" onClick={handleBackButtonClick}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <ViewResultsButton />\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default WorkStatusStep;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-app-subscription-learner-dashboard",
3
- "version": "1.55.4",
3
+ "version": "1.56.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,6 +41,7 @@
41
41
  "url": "https://github.com/edx/frontend-app-subscription-learner-dashboard/issues"
42
42
  },
43
43
  "dependencies": {
44
+ "@edx/frontend-app-notifications": "4.0.0-alpha.1",
44
45
  "@edx/openedx-atlas": "^0.7.0",
45
46
  "@fortawesome/fontawesome-svg-core": "^1.2.36",
46
47
  "@fortawesome/free-brands-svg-icons": "^5.15.4",
@@ -81,5 +82,10 @@
81
82
  "react-router": "^6",
82
83
  "react-router-dom": "^6",
83
84
  "algoliasearch": "^5.52.1"
85
+ },
86
+ "overrides": {
87
+ "@edx/frontend-app-notifications": {
88
+ "@openedx/frontend-base": "$@openedx/frontend-base"
89
+ }
84
90
  }
85
91
  }