@edx/frontend-app-subscription-learner-dashboard 1.50.0 → 1.51.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 (23) hide show
  1. package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.d.ts +2 -1
  2. package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.js +3 -0
  3. package/dist/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider.js.map +1 -1
  4. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/Banner.d.ts +8 -0
  5. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/Banner.js +6 -0
  6. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/Banner.js.map +1 -0
  7. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/BannerEntry.d.ts +6 -0
  8. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/BannerEntry.js +35 -0
  9. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/BannerEntry.js.map +1 -0
  10. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/index.d.ts +1 -0
  11. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/index.js +2 -0
  12. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/index.js.map +1 -0
  13. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/messages.d.ts +33 -0
  14. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/messages.js +35 -0
  15. package/dist/widgets/ProgressiveProfilingQuiz/SearchPageBanners/messages.js.map +1 -0
  16. package/dist/widgets/ProgressiveProfilingQuiz/app.js +8 -0
  17. package/dist/widgets/ProgressiveProfilingQuiz/app.js.map +1 -1
  18. package/dist/widgets/ProgressiveProfilingQuiz/data/constants.d.ts +5 -0
  19. package/dist/widgets/ProgressiveProfilingQuiz/data/constants.js +5 -0
  20. package/dist/widgets/ProgressiveProfilingQuiz/data/constants.js.map +1 -1
  21. package/dist/widgets/ProgressiveProfilingQuiz/modal/index.js +1 -9
  22. package/dist/widgets/ProgressiveProfilingQuiz/modal/index.js.map +1 -1
  23. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
- import { StoredAnswerRecord } from './data/api/fetchAnswers';
2
+ import { StoredAnswerRecord, ProgressiveProfileStatus } from './data/api/fetchAnswers';
3
3
  import { QuizAnswerRecord } from './data/types';
4
4
  interface ProgressiveProfilingQuizContextType {
5
5
  isModalOpen: boolean;
@@ -13,6 +13,7 @@ interface ProgressiveProfilingQuizContextType {
13
13
  recordAnswer: (answer: QuizAnswerRecord) => void;
14
14
  isComplete: boolean;
15
15
  setIsComplete: (isComplete: boolean) => void;
16
+ progressiveProfileStatus: ProgressiveProfileStatus | undefined;
16
17
  }
17
18
  interface ProgressiveProfilingQuizProviderProps {
18
19
  children: ReactNode;
@@ -9,6 +9,7 @@ export const ProgressiveProfilingQuizProvider = ({ children }) => {
9
9
  const [isComplete, setIsComplete] = useState(false);
10
10
  const { data: storedAnswers } = useAnswers();
11
11
  const { mutate: saveAnswers } = useSaveAnswers();
12
+ const progressiveProfileStatus = storedAnswers === null || storedAnswers === void 0 ? void 0 : storedAnswers.progressiveProfileStatus;
12
13
  useEffect(() => {
13
14
  if (storedAnswers === null || storedAnswers === void 0 ? void 0 : storedAnswers.answers) {
14
15
  setAnswers(prev => (Object.assign(Object.assign({}, storedAnswers.answers), prev)));
@@ -38,11 +39,13 @@ export const ProgressiveProfilingQuizProvider = ({ children }) => {
38
39
  recordAnswer,
39
40
  isComplete,
40
41
  setIsComplete,
42
+ progressiveProfileStatus,
41
43
  }), [
42
44
  isModalOpen, openModal, closeModal,
43
45
  currentStep, goToNextStep, goToPreviousStep,
44
46
  answers, recordAnswer,
45
47
  isComplete,
48
+ progressiveProfileStatus,
46
49
  ]);
47
50
  return (_jsx(ProgressiveProfilingQuizContext.Provider, { value: contextValue, children: children }));
48
51
  };
@@ -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;AAiB/D,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,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAwD,EAAE,CAAC,CAAC;IAClG,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,UAAU,EAAE,CAAC;IAC7C,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE,CAAC;IAEjD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,EAAE,CAAC;YAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,iCAAM,aAAa,CAAC,OAAO,GAAK,IAAI,EAAG,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAA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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 } from './data/api/fetchAnswers';\nimport { useAnswers, useSaveAnswers } from './data/queryHooks';\nimport { QuizAnswerRecord } from './data/types';\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}\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\n useEffect(() => {\n if (storedAnswers?.answers) {\n setAnswers(prev => ({ ...storedAnswers.answers, ...prev }));\n }\n }, [storedAnswers]);\n\n const openModal = useCallback(() => setIsModalOpen(true), []);\n const closeModal = useCallback(() => {\n setIsModalOpen(false);\n if (Object.keys(answers).length > 0) {\n saveAnswers(answers);\n }\n }, [answers, saveAnswers]);\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 }), [\n isModalOpen, openModal, closeModal,\n currentStep, goToNextStep, goToPreviousStep,\n answers, recordAnswer,\n isComplete,\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;AAkB/D,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,c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,\n} from 'react';\n\nimport { StoredAnswerRecord, ProgressiveProfileStatus } from './data/api/fetchAnswers';\nimport { useAnswers, useSaveAnswers } from './data/queryHooks';\nimport { QuizAnswerRecord } from './data/types';\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(() => setIsModalOpen(true), []);\n const closeModal = useCallback(() => {\n setIsModalOpen(false);\n if (Object.keys(answers).length > 0) {\n saveAnswers(answers);\n }\n }, [answers, saveAnswers]);\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"]}
@@ -0,0 +1,8 @@
1
+ import { FC, ReactNode } from 'react';
2
+ interface BannerProps {
3
+ title: ReactNode;
4
+ buttonText: string;
5
+ isOpen: () => void;
6
+ }
7
+ export declare const Banner: FC<BannerProps>;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '@openedx/paragon';
3
+ export const Banner = ({ title, buttonText, isOpen }) => {
4
+ return (_jsx("div", { className: "rounded shadow-sm bg-light-200 px-4 py-3 mb-3", children: _jsxs("div", { className: "d-flex justify-content-center align-items-center gap-3 flex-wrap", children: [_jsx("p", { className: "mb-0 text-center text-md-left", "data-testid": "banner-title", children: title }), _jsx(Button, { variant: "outline-brand", onClick: isOpen, "data-testid": "banner-button", children: buttonText })] }) }));
5
+ };
6
+ //# sourceMappingURL=Banner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/SearchPageBanners/Banner.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAQ1C,MAAM,CAAC,MAAM,MAAM,GAAoB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;IACvE,OAAO,CACL,cAAK,SAAS,EAAC,+CAA+C,YAC5D,eAAK,SAAS,EAAC,kEAAkE,aAC/E,YAAG,SAAS,EAAC,+BAA+B,iBAAa,cAAc,YAAE,KAAK,GAAK,EACnF,KAAC,MAAM,IAAC,OAAO,EAAC,eAAe,EAAC,OAAO,EAAE,MAAM,iBAAc,eAAe,YACzE,UAAU,GACJ,IACL,GACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC, ReactNode } from 'react';\nimport { Button } from '@openedx/paragon';\n\ninterface BannerProps {\n title: ReactNode,\n buttonText: string,\n isOpen: () => void,\n}\n\nexport const Banner: FC<BannerProps> = ({ title, buttonText, isOpen }) => {\n return (\n <div className=\"rounded shadow-sm bg-light-200 px-4 py-3 mb-3\">\n <div className=\"d-flex justify-content-center align-items-center gap-3 flex-wrap\">\n <p className=\"mb-0 text-center text-md-left\" data-testid=\"banner-title\">{title}</p>\n <Button variant=\"outline-brand\" onClick={isOpen} data-testid=\"banner-button\">\n {buttonText}\n </Button>\n </div>\n </div>\n );\n};\n"]}
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ /**
3
+ * Single slot entry point.
4
+ * Reads progressive profiling state from context and selects one CTA.
5
+ */
6
+ export declare const BannerEntry: FC;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';
3
+ import { useIntl } from '@openedx/frontend-base';
4
+ import { Banner } from './Banner';
5
+ import messages from './messages';
6
+ import { PROGRESSIVE_PROFILING_USER_STATUS } from '../data/constants';
7
+ /**
8
+ * Single slot entry point.
9
+ * Reads progressive profiling state from context and selects one CTA.
10
+ */
11
+ export const BannerEntry = () => {
12
+ var _a, _b, _c, _d, _e;
13
+ const { openModal, answers, progressiveProfileStatus, } = useProgressiveProfilingQuiz();
14
+ const { formatMessage } = useIntl();
15
+ if (!progressiveProfileStatus)
16
+ return null;
17
+ const { status, remainingQuestions } = progressiveProfileStatus || {};
18
+ const learningGoal = (_c = (_b = (_a = answers === null || answers === void 0 ? void 0 : answers['learning-goal']) === null || _a === void 0 ? void 0 : _a.selectedValues) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.replaceAll('-', ' ');
19
+ const interests = (_e = (_d = answers === null || answers === void 0 ? void 0 : answers['interests-declared']) === null || _d === void 0 ? void 0 : _d.selectedValues) !== null && _e !== void 0 ? _e : [];
20
+ const formattedInterests = interests.length > 1
21
+ ? `${interests.slice(0, -1).join(', ')} and ${interests.at(-1)}`
22
+ : interests[0];
23
+ let title = formatMessage(messages.notStartedTitle);
24
+ let buttonText = formatMessage(messages.notStartedButtonText);
25
+ if (status === PROGRESSIVE_PROFILING_USER_STATUS.COMPLETE) {
26
+ title = formatMessage(messages.completeTitle, { learningGoal, interests: formattedInterests, bold: chunks => _jsx("strong", { children: chunks }) });
27
+ buttonText = formatMessage(messages.completeButtonText);
28
+ }
29
+ if (status === PROGRESSIVE_PROFILING_USER_STATUS.INCOMPLETE) {
30
+ title = formatMessage(messages.incompleteTitle, { remainingQuestions });
31
+ buttonText = formatMessage(messages.incompleteButtonText);
32
+ }
33
+ return _jsx(Banner, { isOpen: openModal, title: title, buttonText: buttonText });
34
+ };
35
+ //# sourceMappingURL=BannerEntry.js.map
@@ -0,0 +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,EAA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AAI,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,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,GAAI,CAAC;AAC7E,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';\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 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 isOpen={openModal} title={title} buttonText={buttonText} />;\n};\n"]}
@@ -0,0 +1 @@
1
+ export { BannerEntry } from './BannerEntry';
@@ -0,0 +1,2 @@
1
+ export { BannerEntry } from './BannerEntry';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/SearchPageBanners/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { BannerEntry } from './BannerEntry';\n"]}
@@ -0,0 +1,33 @@
1
+ declare const messages: {
2
+ notStartedTitle: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ notStartedButtonText: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ incompleteTitle: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ incompleteButtonText: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ completeTitle: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ completeButtonText: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ };
33
+ export default messages;
@@ -0,0 +1,35 @@
1
+ import { defineMessages } from '@openedx/frontend-base';
2
+ const messages = defineMessages({
3
+ notStartedTitle: {
4
+ id: 'progressiveProfiling.searchPage.banner.notStarted.title',
5
+ defaultMessage: 'What do you want to learn?',
6
+ description: 'Title to be shown on banner when the progressive profiling quiz has not been started',
7
+ },
8
+ notStartedButtonText: {
9
+ id: 'progressiveProfiling.searchPage.banner.notStarted.buttonText',
10
+ defaultMessage: 'Share my goals',
11
+ description: 'Button text to be shown on banner when the progressive profiling quiz has not been started',
12
+ },
13
+ incompleteTitle: {
14
+ id: 'progressiveProfiling.searchPage.banner.incomplete.title',
15
+ defaultMessage: 'Answer {remainingQuestions} more question(s) and get better course recommendations.',
16
+ description: 'Title to be shown on banner when the progressive profiling quiz is incomplete',
17
+ },
18
+ incompleteButtonText: {
19
+ id: 'progressiveProfiling.searchPage.banner.incomplete.buttonText',
20
+ defaultMessage: 'Finish sharing my goals',
21
+ description: 'Button text to be shown on banner when the progressive profiling quiz is incomplete',
22
+ },
23
+ completeTitle: {
24
+ id: 'progressiveProfiling.searchPage.banner.complete.title',
25
+ defaultMessage: 'Your learning on edX to <bold>{learningGoal}</bold> and you\'re interested in {interests}.',
26
+ description: 'Title to be shown on banner when the progressive profiling quiz is complete',
27
+ },
28
+ completeButtonText: {
29
+ id: 'progressiveProfiling.searchPage.banner.complete.buttonText',
30
+ defaultMessage: 'Share my goals',
31
+ description: 'Button text to be shown on banner when the progressive profiling quiz is complete',
32
+ },
33
+ });
34
+ export default messages;
35
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/SearchPageBanners/messages.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,eAAe,EAAE;QACf,EAAE,EAAE,yDAAyD;QAC7D,cAAc,EAAE,4BAA4B;QAC5C,WAAW,EAAE,sFAAsF;KACpG;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,8DAA8D;QAClE,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,4FAA4F;KAC1G;IACD,eAAe,EAAE;QACf,EAAE,EAAE,yDAAyD;QAC7D,cAAc,EAAE,qFAAqF;QACrG,WAAW,EAAE,+EAA+E;KAC7F;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,8DAA8D;QAClE,cAAc,EAAE,yBAAyB;QACzC,WAAW,EAAE,qFAAqF;KACnG;IACD,aAAa,EAAE;QACb,EAAE,EAAE,uDAAuD;QAC3D,cAAc,EAAE,4FAA4F;QAC5G,WAAW,EAAE,6EAA6E;KAC3F;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,4DAA4D;QAChE,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,mFAAmF;KACjG;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n notStartedTitle: {\n id: 'progressiveProfiling.searchPage.banner.notStarted.title',\n defaultMessage: 'What do you want to learn?',\n description: 'Title to be shown on banner when the progressive profiling quiz has not been started',\n },\n notStartedButtonText: {\n id: 'progressiveProfiling.searchPage.banner.notStarted.buttonText',\n defaultMessage: 'Share my goals',\n description: 'Button text to be shown on banner when the progressive profiling quiz has not been started',\n },\n incompleteTitle: {\n id: 'progressiveProfiling.searchPage.banner.incomplete.title',\n defaultMessage: 'Answer {remainingQuestions} more question(s) and get better course recommendations.',\n description: 'Title to be shown on banner when the progressive profiling quiz is incomplete',\n },\n incompleteButtonText: {\n id: 'progressiveProfiling.searchPage.banner.incomplete.buttonText',\n defaultMessage: 'Finish sharing my goals',\n description: 'Button text to be shown on banner when the progressive profiling quiz is incomplete',\n },\n completeTitle: {\n id: 'progressiveProfiling.searchPage.banner.complete.title',\n defaultMessage: 'Your learning on edX to <bold>{learningGoal}</bold> and you\\'re interested in {interests}.',\n description: 'Title to be shown on banner when the progressive profiling quiz is complete',\n },\n completeButtonText: {\n id: 'progressiveProfiling.searchPage.banner.complete.buttonText',\n defaultMessage: 'Share my goals',\n description: 'Button text to be shown on banner when the progressive profiling quiz is complete',\n },\n});\n\nexport default messages;\n"]}
@@ -1,6 +1,7 @@
1
1
  import { WidgetOperationTypes } from '@openedx/frontend-base';
2
2
  import { ProgressiveProfilingQuizProvider } from './ProgressiveProfilingQuizProvider';
3
3
  import ProgressiveProfilingQuizModal from './modal';
4
+ import { BannerEntry } from './SearchPageBanners';
4
5
  const app = {
5
6
  appId: 'org.2u-edx.frontend.app.progressiveProfiling',
6
7
  providers: [
@@ -13,6 +14,13 @@ const app = {
13
14
  op: WidgetOperationTypes.PREPEND,
14
15
  component: ProgressiveProfilingQuizModal,
15
16
  },
17
+ {
18
+ // This is the entry-point CTA injected into search page slot
19
+ slotId: 'org.edx.frontend.widget.progressiveProfiling.search.cta.v1',
20
+ id: 'org.edx.frontend.widget.progressiveProfiling.search.cta.entry.v1',
21
+ op: WidgetOperationTypes.APPEND,
22
+ component: BannerEntry,
23
+ },
16
24
  ]
17
25
  };
18
26
  export default app;
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/widgets/ProgressiveProfilingQuiz/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,6BAA6B,MAAM,SAAS,CAAC;AAEpD,MAAM,GAAG,GAAQ;IACf,KAAK,EAAE,8CAA8C;IACrD,SAAS,EAAE;QACT,gCAAgC;KACjC;IACD,KAAK,EAAE;QACL;YACE,MAAM,EAAE,0CAA0C;YAClD,EAAE,EAAE,uDAAuD;YAC3D,EAAE,EAAE,oBAAoB,CAAC,OAAO;YAChC,SAAS,EAAE,6BAA6B;SACzC;KACF;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App, WidgetOperationTypes } from '@openedx/frontend-base';\nimport { ProgressiveProfilingQuizProvider } from './ProgressiveProfilingQuizProvider';\nimport ProgressiveProfilingQuizModal from './modal';\n\nconst app: App = {\n appId: 'org.2u-edx.frontend.app.progressiveProfiling',\n providers: [\n ProgressiveProfilingQuizProvider,\n ],\n slots: [\n {\n slotId: 'org.openedx.frontend.slot.header.main.v1',\n id: 'org.edx.frontend.widget.progressiveProfiling.modal.v1',\n op: WidgetOperationTypes.PREPEND,\n component: ProgressiveProfilingQuizModal,\n },\n ]\n};\n\nexport default app;\n"]}
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/widgets/ProgressiveProfilingQuiz/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,6BAA6B,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,GAAG,GAAQ;IACf,KAAK,EAAE,8CAA8C;IACrD,SAAS,EAAE;QACT,gCAAgC;KACjC;IACD,KAAK,EAAE;QACL;YACE,MAAM,EAAE,0CAA0C;YAClD,EAAE,EAAE,uDAAuD;YAC3D,EAAE,EAAE,oBAAoB,CAAC,OAAO;YAChC,SAAS,EAAE,6BAA6B;SACzC;QACD;YACE,6DAA6D;YAC7D,MAAM,EAAE,4DAA4D;YACpE,EAAE,EAAE,kEAAkE;YACtE,EAAE,EAAE,oBAAoB,CAAC,MAAM;YAC/B,SAAS,EAAE,WAAW;SACvB;KACF;CACF,CAAC;AAEF,eAAe,GAAG,CAAC","sourcesContent":["import { App, WidgetOperationTypes } from '@openedx/frontend-base';\nimport { ProgressiveProfilingQuizProvider } from './ProgressiveProfilingQuizProvider';\nimport ProgressiveProfilingQuizModal from './modal';\nimport { BannerEntry } from './SearchPageBanners';\n\nconst app: App = {\n appId: 'org.2u-edx.frontend.app.progressiveProfiling',\n providers: [\n ProgressiveProfilingQuizProvider,\n ],\n slots: [\n {\n slotId: 'org.openedx.frontend.slot.header.main.v1',\n id: 'org.edx.frontend.widget.progressiveProfiling.modal.v1',\n op: WidgetOperationTypes.PREPEND,\n component: ProgressiveProfilingQuizModal,\n },\n {\n // This is the entry-point CTA injected into search page slot\n slotId: 'org.edx.frontend.widget.progressiveProfiling.search.cta.v1',\n id: 'org.edx.frontend.widget.progressiveProfiling.search.cta.entry.v1',\n op: WidgetOperationTypes.APPEND,\n component: BannerEntry,\n },\n ]\n};\n\nexport default app;\n"]}
@@ -5,3 +5,8 @@ export declare const PROGRESSIVE_PROFILING_QUIZ_STEPS: {
5
5
  readonly WORK_STATUS: "work-status";
6
6
  };
7
7
  export type ProgressiveProfilingQuizStepKey = typeof PROGRESSIVE_PROFILING_QUIZ_STEPS[keyof typeof PROGRESSIVE_PROFILING_QUIZ_STEPS];
8
+ export declare const PROGRESSIVE_PROFILING_USER_STATUS: {
9
+ readonly INCOMPLETE: "incomplete";
10
+ readonly COMPLETE: "complete";
11
+ readonly NOT_STARTED: "not-started";
12
+ };
@@ -4,4 +4,9 @@ export const PROGRESSIVE_PROFILING_QUIZ_STEPS = {
4
4
  INTERESTS_DECLARED: 'interests-declared',
5
5
  WORK_STATUS: 'work-status',
6
6
  };
7
+ export const PROGRESSIVE_PROFILING_USER_STATUS = {
8
+ INCOMPLETE: 'incomplete',
9
+ COMPLETE: 'complete',
10
+ NOT_STARTED: 'not-started',
11
+ };
7
12
  //# 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","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"]}
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,21 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useEffect } from 'react';
3
2
  import { ModalDialog } from '@openedx/paragon';
4
3
  import { useIntl } from '@openedx/frontend-base';
5
- import { useSearchParams } from 'react-router-dom';
6
4
  import { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';
7
5
  import ProgressiveProfilingQuizStepper from './stepper';
8
6
  import messages from './messages';
9
7
  import './index.scss';
10
8
  const ProgressiveProfilingQuizModal = () => {
11
- const { isModalOpen, openModal, closeModal } = useProgressiveProfilingQuiz();
9
+ const { isModalOpen, closeModal } = useProgressiveProfilingQuiz();
12
10
  const { formatMessage } = useIntl();
13
- const [searchParams] = useSearchParams();
14
- useEffect(() => {
15
- if (searchParams.get('progressive_profiling') === 'active') {
16
- openModal();
17
- }
18
- }, [searchParams, openModal]);
19
11
  return (_jsx(ModalDialog, { title: formatMessage(messages.modalTitle), isOpen: isModalOpen, onClose: closeModal, hasCloseButton: true, isFullscreenOnMobile: true, isOverflowVisible: false, className: "progressive-profiling-modal p-5 bg-light-400", children: _jsx(ModalDialog.Body, { children: _jsx(ProgressiveProfilingQuizStepper, {}) }) }));
20
12
  };
21
13
  export default ProgressiveProfilingQuizModal;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/modal/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,+BAA+B,MAAM,WAAW,CAAC;AACxD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,cAAc,CAAC;AAEtB,MAAM,6BAA6B,GAAa,GAAG,EAAE;IACnD,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAC7E,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,CAAC,YAAY,CAAC,GAAG,eAAe,EAAE,CAAC;IAEzC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,YAAY,CAAC,GAAG,CAAC,uBAAuB,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC3D,SAAS,EAAE,CAAC;QACd,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;IAE9B,OAAO,CACL,KAAC,WAAW,IACV,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,UAAU,EACnB,cAAc,QACd,oBAAoB,QACpB,iBAAiB,EAAE,KAAK,EACxB,SAAS,EAAC,8CAA8C,YAExD,KAAC,WAAW,CAAC,IAAI,cACf,KAAC,+BAA+B,KAAG,GAClB,GACP,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["import React, { useEffect } from 'react';\nimport { ModalDialog } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useSearchParams } from 'react-router-dom';\n\nimport { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';\nimport ProgressiveProfilingQuizStepper from './stepper';\nimport messages from './messages';\n\nimport './index.scss';\n\nconst ProgressiveProfilingQuizModal: React.FC = () => {\n const { isModalOpen, openModal, closeModal } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n const [searchParams] = useSearchParams();\n\n useEffect(() => {\n if (searchParams.get('progressive_profiling') === 'active') {\n openModal();\n }\n }, [searchParams, openModal]);\n\n return (\n <ModalDialog\n title={formatMessage(messages.modalTitle)}\n isOpen={isModalOpen}\n onClose={closeModal}\n hasCloseButton\n isFullscreenOnMobile\n isOverflowVisible={false}\n className=\"progressive-profiling-modal p-5 bg-light-400\"\n >\n <ModalDialog.Body>\n <ProgressiveProfilingQuizStepper />\n </ModalDialog.Body>\n </ModalDialog>\n );\n};\n\nexport default ProgressiveProfilingQuizModal;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/modal/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,+BAA+B,MAAM,WAAW,CAAC;AACxD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,OAAO,cAAc,CAAC;AAEtB,MAAM,6BAA6B,GAAa,GAAG,EAAE;IACnD,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAClE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,KAAC,WAAW,IACV,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,UAAU,EACnB,cAAc,QACd,oBAAoB,QACpB,iBAAiB,EAAE,KAAK,EACxB,SAAS,EAAC,8CAA8C,YAExD,KAAC,WAAW,CAAC,IAAI,cACf,KAAC,+BAA+B,KAAG,GAClB,GACP,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["import React from 'react';\nimport { ModalDialog } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';\nimport ProgressiveProfilingQuizStepper from './stepper';\nimport messages from './messages';\n\nimport './index.scss';\n\nconst ProgressiveProfilingQuizModal: React.FC = () => {\n const { isModalOpen, closeModal } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n return (\n <ModalDialog\n title={formatMessage(messages.modalTitle)}\n isOpen={isModalOpen}\n onClose={closeModal}\n hasCloseButton\n isFullscreenOnMobile\n isOverflowVisible={false}\n className=\"progressive-profiling-modal p-5 bg-light-400\"\n >\n <ModalDialog.Body>\n <ProgressiveProfilingQuizStepper />\n </ModalDialog.Body>\n </ModalDialog>\n );\n};\n\nexport default ProgressiveProfilingQuizModal;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-app-subscription-learner-dashboard",
3
- "version": "1.50.0",
3
+ "version": "1.51.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",