@edx/frontend-app-subscription-learner-dashboard 1.23.0 → 1.24.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.
- package/dist/containers/Dashboard/index.js +2 -1
- package/dist/containers/Dashboard/index.js.map +1 -1
- package/dist/containers/PopularCoursePanel/index.js +3 -2
- package/dist/containers/PopularCoursePanel/index.js.map +1 -1
- package/dist/containers/PopularProgramsPanel/NoPopularProgramItems/index.d.ts +3 -0
- package/dist/containers/PopularProgramsPanel/NoPopularProgramItems/index.js +9 -0
- package/dist/containers/PopularProgramsPanel/NoPopularProgramItems/index.js.map +1 -0
- package/dist/containers/PopularProgramsPanel/NoPopularProgramItems/messages.d.ts +8 -0
- package/dist/containers/PopularProgramsPanel/NoPopularProgramItems/messages.js +10 -0
- package/dist/containers/PopularProgramsPanel/NoPopularProgramItems/messages.js.map +1 -0
- package/dist/containers/PopularProgramsPanel/PopularPrograms/index.d.ts +4 -0
- package/dist/containers/PopularProgramsPanel/PopularPrograms/index.js +7 -0
- package/dist/containers/PopularProgramsPanel/PopularPrograms/index.js.map +1 -0
- package/dist/containers/PopularProgramsPanel/index.d.ts +3 -0
- package/dist/containers/PopularProgramsPanel/index.js +22 -0
- package/dist/containers/PopularProgramsPanel/index.js.map +1 -0
- package/dist/containers/PopularProgramsPanel/messages.d.ts +13 -0
- package/dist/containers/PopularProgramsPanel/messages.js +15 -0
- package/dist/containers/PopularProgramsPanel/messages.js.map +1 -0
- package/dist/containers/ProductCard/index.js +1 -1
- package/dist/containers/ProductCard/index.js.map +1 -1
- package/dist/hooks/{usePopularCourses.d.ts → usePopularCoursesAndPrograms.d.ts} +1 -1
- package/dist/hooks/{usePopularCourses.js → usePopularCoursesAndPrograms.js} +6 -6
- package/dist/hooks/usePopularCoursesAndPrograms.js.map +1 -0
- package/dist/slots.js +2 -0
- package/dist/slots.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/app.js +10 -0
- package/dist/widgets/ProgressiveProfilingQuiz/app.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/data/constants.d.ts +7 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/constants.js +7 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/constants.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/index.d.ts +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/index.js +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/index.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/index.d.ts +4 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/index.js +14 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/index.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/index.scss +3 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/messages.d.ts +8 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/messages.js +10 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/messages.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/index.d.ts +3 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/index.js +22 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/index.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/BaseStep.d.ts +10 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/BaseStep.js +24 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/BaseStep.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/messages.d.ts +18 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/messages.js +20 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/messages.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.d.ts +3 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.js +15 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/messages.d.ts +13 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/messages.js +15 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/messages.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.d.ts +3 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js +14 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.d.ts +23 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.js +25 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.d.ts +3 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js +15 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/messages.d.ts +13 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/messages.js +15 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/messages.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.d.ts +3 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.js +15 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.d.ts +18 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.js +20 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/test.utils.d.ts +2 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/test.utils.js +7 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/test.utils.js.map +1 -0
- package/package.json +1 -1
- package/dist/hooks/usePopularCourses.js.map +0 -1
|
@@ -7,6 +7,7 @@ import SelectSessionModal from '../../containers/SelectSessionModal';
|
|
|
7
7
|
import { DashboardContent } from './DashboardContent';
|
|
8
8
|
import DashboardModalSlot from '../../slots/DashboardModalSlot';
|
|
9
9
|
import PopularCoursePanel from '../PopularCoursePanel';
|
|
10
|
+
import PopularProgramsPanel from '../PopularProgramsPanel';
|
|
10
11
|
import LoadingView from './LoadingView';
|
|
11
12
|
import DashboardLayout from './DashboardLayout';
|
|
12
13
|
import hooks from './hooks';
|
|
@@ -27,7 +28,7 @@ export const Dashboard = () => {
|
|
|
27
28
|
const hasCourseHistory = ((_c = (_b = data === null || data === void 0 ? void 0 : data.nonUpgradeableCourses) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0) > 0;
|
|
28
29
|
return (_jsx("div", { id: "learnerdashboardroot", children: _jsx("main", { children: _jsxs("div", { id: "dashboard-container", className: "d-flex flex-column p-2 pt-0", children: [_jsx("h1", { className: "sr-only", children: pageTitle }), !isPending && (_jsxs(_Fragment, { children: [_jsx(DashboardModalSlot, {}), (hasCourses && showSelectSessionModal) && _jsx(SelectSessionModal, {})] })), _jsx("div", { id: "dashboard-content", "data-testid": "dashboard-content", children: isPending
|
|
29
30
|
? (_jsx(LoadingView, {}))
|
|
30
|
-
: (_jsxs(DashboardLayout, { children: [_jsx(DashboardHeader, { startDate: userSubscriptionStartDate }), _jsx(SubscriptionBanner, {}), _jsx(DashboardTitle, {}), _jsx(DashboardHeroSlot, {}), _jsx(DashboardContent, { hasCourseHistory: hasCourseHistory }), _jsx(PopularCoursePanel, {})] })) })] }) }) }));
|
|
31
|
+
: (_jsxs(DashboardLayout, { children: [_jsx(DashboardHeader, { startDate: userSubscriptionStartDate }), _jsx(SubscriptionBanner, {}), _jsx(DashboardTitle, {}), _jsx(DashboardHeroSlot, {}), _jsx(DashboardContent, { hasCourseHistory: hasCourseHistory }), _jsx(PopularCoursePanel, {}), _jsx(PopularProgramsPanel, {})] })) })] }) }) }));
|
|
31
32
|
};
|
|
32
33
|
export default Dashboard;
|
|
33
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/Dashboard/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,kBAAkB,MAAM,gCAAgC,CAAC;AAChE,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/Dashboard/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,kBAAkB,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,kBAAkB,MAAM,gCAAgC,CAAC;AAChE,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAG7D,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;;IAC5B,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,gCAAgC,EAAE,CAAC;IAC/D,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,0BAA0B,EAAE,CAAC;IAC3D,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,oBAAoB,EAAE,CAAC;IACnD,MAAM,EAAE,kBAAkB,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACvD,MAAM,sBAAsB,GAAG,kBAAkB,CAAC,MAAM,KAAK,IAAI,CAAC;IAClE,MAAM,yBAAyB,GAAG,CAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,0CAAE,qBAAqB,KAAI,EAAE,CAAC;IAE7F,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,WAAC,OAAA,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,mBAAmB,0CAAE,MAAM,IAAG,CAAC,CAAA,EAAA,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAChF,MAAM,gBAAgB,GAAG,CAAC,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,qBAAqB,0CAAE,MAAM,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAExE,OAAO,CACL,cAAK,EAAE,EAAC,sBAAsB,YAC5B,yBACE,eAAK,EAAE,EAAC,qBAAqB,EAAC,SAAS,EAAC,6BAA6B,aACnE,aAAI,SAAS,EAAC,SAAS,YAAE,SAAS,GAAM,EACvC,CAAC,SAAS,IAAI,CACb,8BACE,KAAC,kBAAkB,KAAG,EACrB,CAAC,UAAU,IAAI,sBAAsB,CAAC,IAAI,KAAC,kBAAkB,KAAG,IAChE,CACJ,EACD,cAAK,EAAE,EAAC,mBAAmB,iBAAa,mBAAmB,YACxD,SAAS;4BACR,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,CAAC;4BACnB,CAAC,CAAC,CACA,MAAC,eAAe,eACd,KAAC,eAAe,IAAC,SAAS,EAAE,yBAAyB,GAAI,EACzD,KAAC,kBAAkB,KAAG,EACtB,KAAC,cAAc,KAAG,EAClB,KAAC,iBAAiB,KAAG,EACrB,KAAC,gBAAgB,IAAC,gBAAgB,EAAE,gBAAgB,GAAI,EACxD,KAAC,kBAAkB,KAAG,EACtB,KAAC,oBAAoB,KAAG,IACR,CACnB,GACC,IACF,GACD,GACH,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport { DashboardHeader } from './DashboardHeader';\n\nimport { useSelectSessionModal } from '@src/data/context';\nimport { useInitializeSubsCourseDashboard } from '@src/data/hooks';\nimport SelectSessionModal from '../../containers/SelectSessionModal';\nimport { DashboardContent } from './DashboardContent';\nimport DashboardModalSlot from '../../slots/DashboardModalSlot';\nimport PopularCoursePanel from '../PopularCoursePanel';\nimport PopularProgramsPanel from '../PopularProgramsPanel';\n\nimport LoadingView from './LoadingView';\nimport DashboardLayout from './DashboardLayout';\n\nimport hooks from './hooks';\nimport './index.scss';\nimport { SubscriptionBanner } from '../SubscriptionBanner';\nimport { DashboardTitle } from './DashboardTitle';\nimport { useInitializeSubsDashboard } from '@src/data/hooks';\nimport DashboardHeroSlot from '@src/slots/DashboardHeroSlot';\n\n\nexport const Dashboard = () => {\n const { data, isPending } = useInitializeSubsCourseDashboard();\n const { data: learnerData } = useInitializeSubsDashboard();\n const { pageTitle } = hooks.useDashboardMessages();\n const { selectSessionModal } = useSelectSessionModal();\n const showSelectSessionModal = selectSessionModal.cardId !== null;\n const userSubscriptionStartDate = learnerData?.userSubscription?.subscriptionStartDate || '';\n\n const hasCourses = useMemo(() => data?.subscriptionCourses?.length > 0, [data]);\n const hasCourseHistory = (data?.nonUpgradeableCourses?.length ?? 0) > 0;\n\n return (\n <div id=\"learnerdashboardroot\">\n <main>\n <div id=\"dashboard-container\" className=\"d-flex flex-column p-2 pt-0\">\n <h1 className=\"sr-only\">{pageTitle}</h1>\n {!isPending && (\n <>\n <DashboardModalSlot />\n {(hasCourses && showSelectSessionModal) && <SelectSessionModal />}\n </>\n )}\n <div id=\"dashboard-content\" data-testid=\"dashboard-content\">\n {isPending\n ? (<LoadingView />)\n : (\n <DashboardLayout>\n <DashboardHeader startDate={userSubscriptionStartDate} />\n <SubscriptionBanner />\n <DashboardTitle />\n <DashboardHeroSlot />\n <DashboardContent hasCourseHistory={hasCourseHistory} />\n <PopularCoursePanel />\n <PopularProgramsPanel />\n </DashboardLayout>\n )}\n </div>\n </div>\n </main>\n </div>\n );\n};\n\nexport default Dashboard;\n"]}
|
|
@@ -2,15 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { Alert } from '@openedx/paragon';
|
|
4
4
|
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
-
import {
|
|
5
|
+
import { usePopularCoursesAndProgramsData } from '../../hooks/usePopularCoursesAndPrograms';
|
|
6
6
|
import { useAlgoliaSearch } from '../../utils/algoliaUtils';
|
|
7
7
|
import messages from './messages';
|
|
8
8
|
import NoPopularCourseItems from './NoPopularCourseItems';
|
|
9
9
|
import PopularCourses from './PopularCourses';
|
|
10
|
+
import { PRODUCT_TYPE_COURSE } from '../../constants';
|
|
10
11
|
export const PopularCoursePanel = () => {
|
|
11
12
|
const { formatMessage } = useIntl();
|
|
12
13
|
const [searchClient] = useAlgoliaSearch();
|
|
13
|
-
const { data: popularCoursesData = [], isError, isLoading, } =
|
|
14
|
+
const { data: popularCoursesData = [], isError, isLoading, } = usePopularCoursesAndProgramsData(searchClient, true, PRODUCT_TYPE_COURSE);
|
|
14
15
|
const hasPopularCoursesData = useMemo(() => popularCoursesData.length > 0, [popularCoursesData]);
|
|
15
16
|
if (isError) {
|
|
16
17
|
return (_jsx("div", { className: "popular-courses-container mt-5 mb-3", "data-testid": "popular-courses-panel", children: _jsx(Alert, { variant: "danger", "data-testid": "popular-courses-error", children: formatMessage(messages.popularCoursesErrorText) }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/PopularCoursePanel/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/PopularCoursePanel/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAO,GAAG,EAAE;IACzC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,CAAC,YAAY,CAAC,GAAG,gBAAgB,EAAE,CAAC;IAC1C,MAAM,EACJ,IAAI,EAAE,kBAAkB,GAAG,EAAE,EAC7B,OAAO,EACP,SAAS,GACV,GAAG,gCAAgC,CAAC,YAAY,EAAE,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC9E,MAAM,qBAAqB,GAAG,OAAO,CACnC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC,EACnC,CAAC,kBAAkB,CAAC,CACrB,CAAC;IAEF,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,cAAK,SAAS,EAAC,qCAAqC,iBAAa,uBAAuB,YACtF,KAAC,KAAK,IAAC,OAAO,EAAC,QAAQ,iBAAa,uBAAuB,YACxD,aAAa,CAAC,QAAQ,CAAC,uBAAuB,CAAC,GAC1C,GACJ,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eAAK,SAAS,EAAC,qCAAqC,iBAAa,uBAAuB,aACtF,cAAK,SAAS,EAAC,wCAAwC,YACrD,uBAAK,aAAa,CAAC,QAAQ,CAAC,oBAAoB,CAAC,GAAM,GACnD,EACL,CAAC,SAAS,IAAI,qBAAqB,CAAC,CAAC,CAAC,CAAC,CACtC,KAAC,cAAc,IACb,KAAK,EAAE,kBAAkB,EACzB,SAAS,EAAE,SAAS,GACpB,CACH,CAAC,CAAC,CAAC,CACF,KAAC,oBAAoB,KAAG,CACzB,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { FC, useMemo } from 'react';\nimport { Alert } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { usePopularCoursesAndProgramsData } from '@src/hooks/usePopularCoursesAndPrograms';\nimport { useAlgoliaSearch } from '@src/utils/algoliaUtils';\nimport messages from './messages';\nimport NoPopularCourseItems from './NoPopularCourseItems';\nimport PopularCourses from './PopularCourses';\nimport { PRODUCT_TYPE_COURSE } from '@src/constants';\n\nexport const PopularCoursePanel: FC = () => {\n const { formatMessage } = useIntl();\n const [searchClient] = useAlgoliaSearch();\n const {\n data: popularCoursesData = [],\n isError,\n isLoading,\n } = usePopularCoursesAndProgramsData(searchClient, true, PRODUCT_TYPE_COURSE);\n const hasPopularCoursesData = useMemo(\n () => popularCoursesData.length > 0,\n [popularCoursesData]\n );\n\n if (isError) {\n return (\n <div className=\"popular-courses-container mt-5 mb-3\" data-testid=\"popular-courses-panel\">\n <Alert variant=\"danger\" data-testid=\"popular-courses-error\">\n {formatMessage(messages.popularCoursesErrorText)}\n </Alert>\n </div>\n );\n }\n\n return (\n <div className=\"popular-courses-container mt-5 mb-3\" data-testid=\"popular-courses-panel\">\n <div className=\"popular-courses-heading-container mb-4\">\n <h2>{formatMessage(messages.popularCoursesHeader)}</h2>\n </div>\n {(isLoading || hasPopularCoursesData) ? (\n <PopularCourses\n items={popularCoursesData}\n isLoading={isLoading}\n />\n ) : (\n <NoPopularCourseItems />\n )}\n </div>\n );\n};\n\nexport default PopularCoursePanel;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
3
|
+
import messages from './messages';
|
|
4
|
+
const NoPopularProgramItems = () => {
|
|
5
|
+
const { formatMessage } = useIntl();
|
|
6
|
+
return (_jsx("div", { "data-testid": "no-popular-program-items", children: _jsx("p", { className: "mb-0", children: formatMessage(messages.popularProgramEmptyState) }) }));
|
|
7
|
+
};
|
|
8
|
+
export default NoPopularProgramItems;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/PopularProgramsPanel/NoPopularProgramItems/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,qBAAqB,GAAO,GAAG,EAAE;IACrC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,6BAAiB,0BAA0B,YACzC,YAAG,SAAS,EAAC,MAAM,YAAE,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,GAAK,GACtE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport messages from './messages';\n\nconst NoPopularProgramItems: FC = () => {\n const { formatMessage } = useIntl();\n\n return (\n <div data-testid=\"no-popular-program-items\">\n <p className=\"mb-0\">{formatMessage(messages.popularProgramEmptyState)}</p>\n </div>\n );\n};\n\nexport default NoPopularProgramItems;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
popularProgramEmptyState: {
|
|
4
|
+
id: 'subs-dash.popularProgramPanel.emptyState',
|
|
5
|
+
defaultMessage: 'When you browse the edX Unlimited catalog, we\'ll show popular programs here.',
|
|
6
|
+
description: 'Placeholder text for popular programs section',
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export default messages;
|
|
10
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/containers/PopularProgramsPanel/NoPopularProgramItems/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,wBAAwB,EAAE;QACxB,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,+EAA+E;QAC/F,WAAW,EAAE,+CAA+C;KAC7D;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n popularProgramEmptyState: {\n id: 'subs-dash.popularProgramPanel.emptyState',\n defaultMessage: 'When you browse the edX Unlimited catalog, we\\'ll show popular programs here.',\n description: 'Placeholder text for popular programs section',\n }\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ProductCard } from '../../ProductCard';
|
|
3
|
+
export const PopularPrograms = ({ items, isLoading }) => {
|
|
4
|
+
return (_jsx("div", { "data-testid": "popular-programs-items", children: _jsx("div", { className: "row g-3 flex-nowrap flex-md-wrap overflow-auto", children: items.map((item) => (_jsx("div", { className: "col-12 col-md-6 col-xl-3 d-flex mb-2", children: _jsx(ProductCard, { item: item, isLoading: isLoading }) }, item.objectID))) }) }));
|
|
5
|
+
};
|
|
6
|
+
export default PopularPrograms;
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/PopularProgramsPanel/PopularPrograms/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,MAAM,CAAC,MAAM,eAAe,GAA6B,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;IAChF,OAAO,CACL,6BAAiB,wBAAwB,YACvC,cAAK,SAAS,EAAC,gDAAgD,YAC5D,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,cAAyB,SAAS,EAAC,sCAAsC,YACvE,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,GAAI,IADzC,IAAI,CAAC,QAAQ,CAEjB,CACP,CAAC,GACE,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FC } from 'react';\n\nimport { ProductCard } from '../../ProductCard';\nimport { PopularProgramsProps } from './data/types';\n\nexport const PopularPrograms: FC<PopularProgramsProps> = ({ items, isLoading }) => {\n return (\n <div data-testid=\"popular-programs-items\">\n <div className=\"row g-3 flex-nowrap flex-md-wrap overflow-auto\">\n {items.map((item) => (\n <div key={item.objectID} className=\"col-12 col-md-6 col-xl-3 d-flex mb-2\">\n <ProductCard item={item} isLoading={isLoading} />\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nexport default PopularPrograms;\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Alert } from '@openedx/paragon';
|
|
4
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
+
import { usePopularCoursesAndProgramsData } from '../../hooks/usePopularCoursesAndPrograms';
|
|
6
|
+
import { useAlgoliaSearch } from '../../utils/algoliaUtils';
|
|
7
|
+
import messages from './messages';
|
|
8
|
+
import NoPopularProgramItems from './NoPopularProgramItems';
|
|
9
|
+
import PopularPrograms from './PopularPrograms';
|
|
10
|
+
import { PRODUCT_TYPE_PROGRAM } from '../../constants';
|
|
11
|
+
export const PopularProgramsPanel = () => {
|
|
12
|
+
const { formatMessage } = useIntl();
|
|
13
|
+
const [searchClient] = useAlgoliaSearch();
|
|
14
|
+
const { data: popularProgramsData = [], isError, isLoading, } = usePopularCoursesAndProgramsData(searchClient, true, PRODUCT_TYPE_PROGRAM);
|
|
15
|
+
const hasPopularProgramsData = useMemo(() => popularProgramsData.length > 0, [popularProgramsData]);
|
|
16
|
+
if (isError) {
|
|
17
|
+
return (_jsx("div", { className: "popular-programs-container mt-5 mb-3", "data-testid": "popular-programs-panel", children: _jsx(Alert, { variant: "danger", "data-testid": "popular-programs-error", children: formatMessage(messages.popularProgramsErrorText) }) }));
|
|
18
|
+
}
|
|
19
|
+
return (_jsxs("div", { className: "popular-programs-container mt-5 mb-3", "data-testid": "popular-programs-panel", children: [_jsx("div", { className: "popular-programs-heading-container mb-4", children: _jsx("h2", { children: formatMessage(messages.popularProgramsHeader) }) }), (isLoading || hasPopularProgramsData) ? (_jsx(PopularPrograms, { items: popularProgramsData, isLoading: isLoading })) : (_jsx(NoPopularProgramItems, {}))] }));
|
|
20
|
+
};
|
|
21
|
+
export default PopularProgramsPanel;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/PopularProgramsPanel/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,oBAAoB,GAAO,GAAG,EAAE;IAC3C,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,MAAM,CAAC,YAAY,CAAC,GAAG,gBAAgB,EAAE,CAAC;IAC1C,MAAM,EACJ,IAAI,EAAE,mBAAmB,GAAG,EAAE,EAC9B,OAAO,EACP,SAAS,GACV,GAAG,gCAAgC,CAAC,YAAY,EAAE,IAAI,EAAE,oBAAoB,CAAC,CAAC;IAC/E,MAAM,sBAAsB,GAAG,OAAO,CACpC,GAAG,EAAE,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,EACpC,CAAC,mBAAmB,CAAC,CACtB,CAAC;IAEF,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,cAAK,SAAS,EAAC,sCAAsC,iBAAa,wBAAwB,YACxF,KAAC,KAAK,IAAC,OAAO,EAAC,QAAQ,iBAAa,wBAAwB,YACzD,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,GAC3C,GACJ,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eAAK,SAAS,EAAC,sCAAsC,iBAAa,wBAAwB,aACxF,cAAK,SAAS,EAAC,yCAAyC,YACtD,uBAAK,aAAa,CAAC,QAAQ,CAAC,qBAAqB,CAAC,GAAM,GACpD,EACL,CAAC,SAAS,IAAI,sBAAsB,CAAC,CAAC,CAAC,CAAC,CACvC,KAAC,eAAe,IACd,KAAK,EAAE,mBAAmB,EAC1B,SAAS,EAAE,SAAS,GACpB,CACH,CAAC,CAAC,CAAC,CACF,KAAC,qBAAqB,KAAG,CAC1B,IACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import { FC, useMemo } from 'react';\nimport { Alert } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport { usePopularCoursesAndProgramsData } from '@src/hooks/usePopularCoursesAndPrograms';\nimport { useAlgoliaSearch } from '@src/utils/algoliaUtils';\nimport messages from './messages';\nimport NoPopularProgramItems from './NoPopularProgramItems';\nimport PopularPrograms from './PopularPrograms';\nimport { PRODUCT_TYPE_PROGRAM } from '@src/constants';\n\nexport const PopularProgramsPanel: FC = () => {\n const { formatMessage } = useIntl();\n const [searchClient] = useAlgoliaSearch();\n const {\n data: popularProgramsData = [],\n isError,\n isLoading,\n } = usePopularCoursesAndProgramsData(searchClient, true, PRODUCT_TYPE_PROGRAM);\n const hasPopularProgramsData = useMemo(\n () => popularProgramsData.length > 0,\n [popularProgramsData]\n );\n\n if (isError) {\n return (\n <div className=\"popular-programs-container mt-5 mb-3\" data-testid=\"popular-programs-panel\">\n <Alert variant=\"danger\" data-testid=\"popular-programs-error\">\n {formatMessage(messages.popularProgramsErrorText)}\n </Alert>\n </div>\n );\n }\n\n return (\n <div className=\"popular-programs-container mt-5 mb-3\" data-testid=\"popular-programs-panel\">\n <div className=\"popular-programs-heading-container mb-4\">\n <h2>{formatMessage(messages.popularProgramsHeader)}</h2>\n </div>\n {(isLoading || hasPopularProgramsData) ? (\n <PopularPrograms\n items={popularProgramsData}\n isLoading={isLoading}\n />\n ) : (\n <NoPopularProgramItems />\n )}\n </div>\n );\n};\n\nexport default PopularProgramsPanel;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
popularProgramsHeader: {
|
|
4
|
+
id: 'subs-dash.popularProgramsPanel.header',
|
|
5
|
+
defaultMessage: 'Popular programs',
|
|
6
|
+
description: 'Label for the popular programs section',
|
|
7
|
+
},
|
|
8
|
+
popularProgramsErrorText: {
|
|
9
|
+
id: 'subs-dash.popularProgramsPanel.errorText',
|
|
10
|
+
defaultMessage: 'Failed to load popular programs. Please try again later.',
|
|
11
|
+
description: 'Error text for failing to load popular programs',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export default messages;
|
|
15
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/containers/PopularProgramsPanel/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,qBAAqB,EAAE;QACrB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,kBAAkB;QAClC,WAAW,EAAE,wCAAwC;KACtD;IACD,wBAAwB,EAAE;QACxB,EAAE,EAAE,0CAA0C;QAC9C,cAAc,EAAE,0DAA0D;QAC1E,WAAW,EAAE,iDAAiD;KAC/D;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n popularProgramsHeader: {\n id: 'subs-dash.popularProgramsPanel.header',\n defaultMessage: 'Popular programs',\n description: 'Label for the popular programs section',\n },\n popularProgramsErrorText: {\n id: 'subs-dash.popularProgramsPanel.errorText',\n defaultMessage: 'Failed to load popular programs. Please try again later.',\n description: 'Error text for failing to load popular programs',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -7,6 +7,6 @@ import cardFallbackImg from '@openedx/brand-openedx/paragon/images/card-imagecap
|
|
|
7
7
|
import messages from './messages';
|
|
8
8
|
export const ProductCard = ({ item, isLoading }) => {
|
|
9
9
|
const { formatMessage } = useIntl();
|
|
10
|
-
return (_jsxs(Card, { className: "shadow-sm d-flex flex-column rounded w-100 overflow-hidden card-container", variant:
|
|
10
|
+
return (_jsxs(Card, { className: "shadow-sm d-flex flex-column rounded w-100 overflow-hidden card-container", variant: "light", "data-testid": "product-card", isLoading: isLoading, children: [_jsx(Card.Header, { title: item.content_type, className: "pb-2 pt-2 bg-light-500 text-primary-500 content-type", size: "xs" }), _jsx("div", { className: "position-relative image-container", children: _jsx(Card.ImageCap, { src: item.url || cardFallbackImg, srcAlt: `${item.title} main-image`, "data-testid": "product-card-image", logoSrc: item.thumbnail || '', logoAlt: `${item.title} thumbnail-image` }) }), _jsx(Card.Header, { title: item.title, size: "sm", className: "product-card-title" }), item.partner ? (_jsx(Card.Header, { title: item.partner, className: "d-flex justify-content-between align-items-center", size: "xs" })) : null, _jsxs(Card.Section, { className: "d-flex flex-column flex-grow-1 overflow-hidden mt-5", children: [typeof item.weeks_to_complete === 'number' && (_jsxs("span", { className: "d-flex align-items-center", children: [_jsx(Icon, { src: Timelapse, className: "mr-2" }), _jsx("span", { children: formatMessage(messages.weeksToComplete, { count: item.weeks_to_complete }) })] })), item.level ? (_jsxs("span", { className: `d-flex align-items-center${typeof item.weeks_to_complete === 'number' ? ' mt-3' : ''}`, children: [_jsx(Icon, { src: Speed, className: "mr-2" }), _jsx("span", { children: formatMessage(messages.level, { level: item.level }) })] })) : null] })] }));
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/ProductCard/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,MAAM,kEAAkE,CAAC;AAE/F,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;IACvE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAC,2EAA2E,EACrF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/containers/ProductCard/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,cAAc,CAAC;AACtB,OAAO,eAAe,MAAM,kEAAkE,CAAC;AAE/F,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;IACvE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IACpC,OAAO,CACL,MAAC,IAAI,IACH,SAAS,EAAC,2EAA2E,EACrF,OAAO,EAAC,OAAO,iBACH,cAAc,EAC1B,SAAS,EAAE,SAAS,aAEpB,KAAC,IAAI,CAAC,MAAM,IAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,EAAC,sDAAsD,EAAC,IAAI,EAAC,IAAI,GAAG,EAEpH,cAAK,SAAS,EAAC,mCAAmC,YAChD,KAAC,IAAI,CAAC,QAAQ,IACZ,GAAG,EAAE,IAAI,CAAC,GAAG,IAAI,eAAe,EAChC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,aAAa,iBACtB,oBAAoB,EAChC,OAAO,EAAE,IAAI,CAAC,SAAS,IAAI,EAAE,EAC7B,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,kBAAkB,GACxC,GACE,EAEN,KAAC,IAAI,CAAC,MAAM,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,oBAAoB,GAAG,EAE1E,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CACd,KAAC,IAAI,CAAC,MAAM,IAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,EAAC,mDAAmD,EAAC,IAAI,EAAC,IAAI,GAAG,CAC7G,CAAC,CAAC,CAAC,IAAI,EAER,MAAC,IAAI,CAAC,OAAO,IAAC,SAAS,EAAC,qDAAqD,aAC1E,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ,IAAI,CAC7C,gBAAM,SAAS,EAAC,2BAA2B,aACzC,KAAC,IAAI,IAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,GAAG,EACzC,yBAAO,aAAa,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,CAAC,GAAQ,IACpF,CACR,EACA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACZ,gBAAM,SAAS,EAAE,4BAA4B,OAAO,IAAI,CAAC,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,aACtG,KAAC,IAAI,IAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAC,MAAM,GAAG,EACrC,yBAAO,aAAa,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,GAAQ,IAC9D,CACR,CAAC,CAAC,CAAC,IAAI,IACK,IAEV,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { FC } from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { Card, Icon } from '@openedx/paragon';\nimport { Timelapse, Speed } from '@openedx/paragon/icons';\nimport './index.scss';\nimport cardFallbackImg from '@openedx/brand-openedx/paragon/images/card-imagecap-fallback.png';\nimport { ProductCardProps } from './data/types';\nimport messages from './messages';\n\nexport const ProductCard: FC<ProductCardProps> = ({ item, isLoading }) => {\n const { formatMessage } = useIntl();\n return (\n <Card\n className=\"shadow-sm d-flex flex-column rounded w-100 overflow-hidden card-container\"\n variant=\"light\"\n data-testid=\"product-card\"\n isLoading={isLoading}\n >\n <Card.Header title={item.content_type} className=\"pb-2 pt-2 bg-light-500 text-primary-500 content-type\" size=\"xs\" />\n\n <div className=\"position-relative image-container\">\n <Card.ImageCap\n src={item.url || cardFallbackImg}\n srcAlt={`${item.title} main-image`}\n data-testid=\"product-card-image\"\n logoSrc={item.thumbnail || ''}\n logoAlt={`${item.title} thumbnail-image`}\n />\n </div>\n\n <Card.Header title={item.title} size=\"sm\" className=\"product-card-title\" />\n\n {item.partner ? (\n <Card.Header title={item.partner} className=\"d-flex justify-content-between align-items-center\" size=\"xs\" />\n ) : null}\n\n <Card.Section className=\"d-flex flex-column flex-grow-1 overflow-hidden mt-5\">\n {typeof item.weeks_to_complete === 'number' && (\n <span className=\"d-flex align-items-center\">\n <Icon src={Timelapse} className=\"mr-2\" />\n <span>{formatMessage(messages.weeksToComplete, { count: item.weeks_to_complete })}</span>\n </span>\n )}\n {item.level ? (\n <span className={`d-flex align-items-center${typeof item.weeks_to_complete === 'number' ? ' mt-3' : ''}`}>\n <Icon src={Speed} className=\"mr-2\" />\n <span>{formatMessage(messages.level, { level: item.level })}</span>\n </span>\n ) : null}\n </Card.Section>\n\n </Card>\n );\n};\n"]}
|
|
@@ -8,4 +8,4 @@ export declare const searchKeys: {
|
|
|
8
8
|
courses: (query: string, tags: string[], page: number) => readonly ["search", "courses", string, string[], number];
|
|
9
9
|
popular: (productType: ProductType, limit: number) => readonly ["search", "popular", ProductType, number];
|
|
10
10
|
};
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const usePopularCoursesAndProgramsData: (searchClient: SearchClient | null, enabled: boolean, productType?: ProductType) => UseQueryResult<ProductCardItem[]>;
|
|
@@ -18,10 +18,10 @@ export const searchKeys = {
|
|
|
18
18
|
courses: (query, tags, page) => [...searchKeys.all, 'courses', query, tags, page],
|
|
19
19
|
popular: (productType, limit) => [...searchKeys.all, 'popular', productType, limit],
|
|
20
20
|
};
|
|
21
|
-
export const
|
|
22
|
-
queryKey: searchKeys.popular(
|
|
21
|
+
export const usePopularCoursesAndProgramsData = (searchClient, enabled, productType = PRODUCT_TYPE_COURSE) => useQuery({
|
|
22
|
+
queryKey: searchKeys.popular(productType, 4),
|
|
23
23
|
queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
-
const hits = yield fetchPopularProducts(searchClient,
|
|
24
|
+
const hits = yield fetchPopularProducts(searchClient, productType, 4);
|
|
25
25
|
return hits.map((hit) => {
|
|
26
26
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
27
27
|
const hitDetails = hit;
|
|
@@ -31,8 +31,8 @@ export const usePopularCoursesData = (searchClient, enabled) => useQuery({
|
|
|
31
31
|
primary_description: (_e = (_d = (_c = hitDetails.primary_description) !== null && _c !== void 0 ? _c : hitDetails.short_description) !== null && _d !== void 0 ? _d : hitDetails.description) !== null && _e !== void 0 ? _e : '',
|
|
32
32
|
url: (_h = (_g = (_f = hitDetails.card_image_url) !== null && _f !== void 0 ? _f : hitDetails.image_url) !== null && _g !== void 0 ? _g : hitDetails.marketing_url) !== null && _h !== void 0 ? _h : '',
|
|
33
33
|
thumbnail: (_j = hitDetails.organization_logo_override) !== null && _j !== void 0 ? _j : '',
|
|
34
|
-
content_type: (_l = (_k = hitDetails.content_type) !== null && _k !== void 0 ? _k : hitDetails.
|
|
35
|
-
product:
|
|
34
|
+
content_type: (_l = (_k = hitDetails.content_type) !== null && _k !== void 0 ? _k : hitDetails.product) !== null && _l !== void 0 ? _l : 'Course',
|
|
35
|
+
product: productType,
|
|
36
36
|
partner: (_m = hitDetails.partner) !== null && _m !== void 0 ? _m : '',
|
|
37
37
|
weeks_to_complete: (_o = hitDetails.weeks_to_complete) !== null && _o !== void 0 ? _o : undefined,
|
|
38
38
|
level: (_p = hitDetails.level) !== null && _p !== void 0 ? _p : undefined,
|
|
@@ -42,4 +42,4 @@ export const usePopularCoursesData = (searchClient, enabled) => useQuery({
|
|
|
42
42
|
enabled: !!searchClient && enabled,
|
|
43
43
|
staleTime: 1000 * 60 * 10,
|
|
44
44
|
});
|
|
45
|
-
//# sourceMappingURL=
|
|
45
|
+
//# sourceMappingURL=usePopularCoursesAndPrograms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePopularCoursesAndPrograms.js","sourceRoot":"","sources":["../../src/hooks/usePopularCoursesAndPrograms.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,iFAAiF;AACjF,oDAAoD;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,GAAG,EAAE,CAAC,QAAQ,CAAU;IACxB,QAAQ,EAAE,CAAC,KAAa,EAAE,IAAc,EAAE,EAAE,CAC1C,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAU;IACvD,OAAO,EAAE,CAAC,KAAa,EAAE,IAAc,EAAE,IAAY,EAAE,EAAE,CACvD,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAU;IAC5D,OAAO,EAAE,CAAC,WAAwB,EAAE,KAAa,EAAE,EAAE,CACnD,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAU;CAC9D,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,YAAiC,EACjC,OAAgB,EAChB,cAA2B,mBAAmB,EACX,EAAE,CACrC,QAAQ,CAAC;IACP,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5C,OAAO,EAAE,GAAS,EAAE;QAClB,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,YAAa,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAmB,EAAE;;YACvC,MAAM,UAAU,GAAG,GAalB,CAAC;YAEF,OAAO;gBACL,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,KAAK,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,mCAAI,GAAG,CAAC,IAAI,mCAAI,UAAU;gBAC1C,mBAAmB,EAAE,MAAA,MAAA,MAAA,UAAU,CAAC,mBAAmB,mCAAI,UAAU,CAAC,iBAAiB,mCAAI,UAAU,CAAC,WAAW,mCAAI,EAAE;gBACnH,GAAG,EAAE,MAAA,MAAA,MAAA,UAAU,CAAC,cAAc,mCAAI,UAAU,CAAC,SAAS,mCAAI,UAAU,CAAC,aAAa,mCAAI,EAAE;gBACxF,SAAS,EAAE,MAAA,UAAU,CAAC,0BAA0B,mCAAI,EAAE;gBACtD,YAAY,EAAE,MAAA,MAAA,UAAU,CAAC,YAAY,mCAAI,UAAU,CAAC,OAAO,mCAAI,QAAQ;gBACvE,OAAO,EAAE,WAAW;gBACpB,OAAO,EAAE,MAAA,UAAU,CAAC,OAAO,mCAAI,EAAE;gBACjC,iBAAiB,EAAE,MAAA,UAAU,CAAC,iBAAiB,mCAAI,SAAS;gBAC5D,KAAK,EAAE,MAAA,UAAU,CAAC,KAAK,mCAAI,SAAS;aACrC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAA;IACD,OAAO,EAAE,CAAC,CAAC,YAAY,IAAI,OAAO;IAClC,SAAS,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["import { useQuery, UseQueryResult } from '@tanstack/react-query';\nimport { SearchClient } from 'algoliasearch';\nimport { ProductType } from '@src/types/types';\nimport { PRODUCT_TYPE_COURSE } from '@src/constants';\nimport { fetchPopularProducts } from '@src/utils/algoliaUtils';\nimport { ProductCardItem } from '@src/containers/ProductCard/data/types';\n\n// ─── Query key factories ──────────────────────────────────────────────────────\n// Centralised so cache invalidation is never a typo\n\nexport const searchKeys = {\n all: ['search'] as const,\n programs: (query: string, tags: string[]) =>\n [...searchKeys.all, 'programs', query, tags] as const,\n courses: (query: string, tags: string[], page: number) =>\n [...searchKeys.all, 'courses', query, tags, page] as const,\n popular: (productType: ProductType, limit: number) =>\n [...searchKeys.all, 'popular', productType, limit] as const,\n};\n\nexport const usePopularCoursesAndProgramsData = (\n searchClient: SearchClient | null,\n enabled: boolean,\n productType: ProductType = PRODUCT_TYPE_COURSE\n): UseQueryResult<ProductCardItem[]> =>\n useQuery({\n queryKey: searchKeys.popular(productType, 4),\n queryFn: async () => {\n const hits = await fetchPopularProducts(searchClient!, productType, 4);\n return hits.map((hit): ProductCardItem => {\n const hitDetails = hit as {\n short_description?: string,\n primary_description?: string,\n description?: string,\n marketing_url?: string,\n image_url?: string,\n card_image_url?: string,\n organization_logo_override?: string,\n content_type?: string,\n product?: string,\n partner?: string,\n weeks_to_complete?: number,\n level?: string,\n };\n\n return {\n objectID: hit.objectID,\n title: hit.title ?? hit.name ?? 'Untitled',\n primary_description: hitDetails.primary_description ?? hitDetails.short_description ?? hitDetails.description ?? '',\n url: hitDetails.card_image_url ?? hitDetails.image_url ?? hitDetails.marketing_url ?? '',\n thumbnail: hitDetails.organization_logo_override ?? '',\n content_type: hitDetails.content_type ?? hitDetails.product ?? 'Course',\n product: productType,\n partner: hitDetails.partner ?? '',\n weeks_to_complete: hitDetails.weeks_to_complete ?? undefined,\n level: hitDetails.level ?? undefined,\n };\n });\n },\n enabled: !!searchClient && enabled,\n staleTime: 1000 * 60 * 10,\n });\n"]}
|
package/dist/slots.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { learnerDashboardHeaderApp } from './widgets/LearnerDashboardHeader';
|
|
2
|
+
import { progressiveProfilingApp } from './widgets/ProgressiveProfilingQuiz';
|
|
2
3
|
const slots = [
|
|
3
4
|
...learnerDashboardHeaderApp.slots,
|
|
5
|
+
...progressiveProfilingApp.slots,
|
|
4
6
|
];
|
|
5
7
|
export default slots;
|
|
6
8
|
//# sourceMappingURL=slots.js.map
|
package/dist/slots.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slots.js","sourceRoot":"","sources":["../src/slots.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,MAAM,KAAK,GAAoB;IAC7B,GAAI,yBAAyB,CAAC,KAAY;
|
|
1
|
+
{"version":3,"file":"slots.js","sourceRoot":"","sources":["../src/slots.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,MAAM,KAAK,GAAoB;IAC7B,GAAI,yBAAyB,CAAC,KAAY;IAC1C,GAAI,uBAAuB,CAAC,KAAY;CACzC,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { SlotOperation } from '@openedx/frontend-base';\n\nimport { learnerDashboardHeaderApp } from './widgets/LearnerDashboardHeader';\nimport { progressiveProfilingApp } from './widgets/ProgressiveProfilingQuiz';\n\nconst slots: SlotOperation[] = [\n ...(learnerDashboardHeaderApp.slots as []),\n ...(progressiveProfilingApp.slots as []),\n];\n\nexport default slots;\n"]}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
+
import { WidgetOperationTypes } from '@openedx/frontend-base';
|
|
1
2
|
import { ProgressiveProfilingQuizProvider } from './ProgressiveProfilingQuizProvider';
|
|
3
|
+
import ProgressiveProfilingQuizModal from './modal';
|
|
2
4
|
const app = {
|
|
3
5
|
appId: 'org.2u-edx.frontend.app.progressiveProfiling',
|
|
4
6
|
providers: [
|
|
5
7
|
ProgressiveProfilingQuizProvider,
|
|
6
8
|
],
|
|
9
|
+
slots: [
|
|
10
|
+
{
|
|
11
|
+
slotId: 'org.openedx.frontend.slot.header.main.v1',
|
|
12
|
+
id: 'org.edx.frontend.widget.progressiveProfiling.modal.v1',
|
|
13
|
+
op: WidgetOperationTypes.PREPEND,
|
|
14
|
+
component: ProgressiveProfilingQuizModal,
|
|
15
|
+
},
|
|
16
|
+
]
|
|
7
17
|
};
|
|
8
18
|
export default app;
|
|
9
19
|
//# sourceMappingURL=app.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/widgets/ProgressiveProfilingQuiz/app.ts"],"names":[],"mappings":"
|
|
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"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const PROGRESSIVE_PROFILING_QUIZ_STEPS: {
|
|
2
|
+
readonly LEARNING_GOAL: "learning-goal";
|
|
3
|
+
readonly LEARNING_MOTIVATION: "learning-motivation";
|
|
4
|
+
readonly INTERESTS_DECLARED: "interests-declared";
|
|
5
|
+
readonly WORK_STATUS: "work-status";
|
|
6
|
+
};
|
|
7
|
+
export type ProgressiveProfilingQuizStepKey = typeof PROGRESSIVE_PROFILING_QUIZ_STEPS[keyof typeof PROGRESSIVE_PROFILING_QUIZ_STEPS];
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export * from './types';\nexport { useSkills } from './queryHooks';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export * from './types';\nexport * from './constants';\nexport { useSkills } from './queryHooks';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ModalDialog } from '@openedx/paragon';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import { useProgressiveProfilingQuiz } from '../ProgressiveProfilingQuizProvider';
|
|
5
|
+
import ProgressiveProfilingQuizStepper from './stepper';
|
|
6
|
+
import messages from './messages';
|
|
7
|
+
import './index.scss';
|
|
8
|
+
const ProgressiveProfilingQuizModal = () => {
|
|
9
|
+
const { isModalOpen, closeModal } = useProgressiveProfilingQuiz();
|
|
10
|
+
const { formatMessage } = useIntl();
|
|
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, {}) }) }));
|
|
12
|
+
};
|
|
13
|
+
export default ProgressiveProfilingQuizModal;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
modalTitle: {
|
|
4
|
+
id: 'progressiveProfilingQuiz.modal.title',
|
|
5
|
+
defaultMessage: 'Tell us about yourself',
|
|
6
|
+
description: 'Title for the progressive profiling quiz modal',
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
export default messages;
|
|
10
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/modal/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,UAAU,EAAE;QACV,EAAE,EAAE,sCAAsC;QAC1C,cAAc,EAAE,wBAAwB;QACxC,WAAW,EAAE,gDAAgD;KAC9D;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n modalTitle: {\n id: 'progressiveProfilingQuiz.modal.title',\n defaultMessage: 'Tell us about yourself',\n description: 'Title for the progressive profiling quiz modal',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stepper } from '@openedx/paragon';
|
|
3
|
+
import { useProgressiveProfilingQuiz } from '../../ProgressiveProfilingQuizProvider';
|
|
4
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../data/constants';
|
|
5
|
+
import LearningGoalStep from './steps/step-learning-goal';
|
|
6
|
+
import LearningMotivationStep from './steps/step-learning-motivation';
|
|
7
|
+
import InterestsDeclaredStep from './steps/step-interests-declared';
|
|
8
|
+
import WorkStatusStep from './steps/step-work-status';
|
|
9
|
+
const STEPS = [
|
|
10
|
+
PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL,
|
|
11
|
+
PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION,
|
|
12
|
+
PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED,
|
|
13
|
+
PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS,
|
|
14
|
+
];
|
|
15
|
+
const ProgressiveProfilingQuizStepper = () => {
|
|
16
|
+
var _a;
|
|
17
|
+
const { currentStep } = useProgressiveProfilingQuiz();
|
|
18
|
+
const activeKey = (_a = STEPS[currentStep]) !== null && _a !== void 0 ? _a : STEPS[0];
|
|
19
|
+
return (_jsxs(Stepper, { activeKey: activeKey, children: [_jsx(LearningGoalStep, {}), _jsx(LearningMotivationStep, {}), _jsx(InterestsDeclaredStep, {}), _jsx(WorkStatusStep, {})] }));
|
|
20
|
+
};
|
|
21
|
+
export default ProgressiveProfilingQuizStepper;
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAC1D,OAAO,sBAAsB,MAAM,kCAAkC,CAAC;AACtE,OAAO,qBAAqB,MAAM,iCAAiC,CAAC;AACpE,OAAO,cAAc,MAAM,0BAA0B,CAAC;AAEtD,MAAM,KAAK,GAAG;IACZ,gCAAgC,CAAC,aAAa;IAC9C,gCAAgC,CAAC,mBAAmB;IACpD,gCAAgC,CAAC,kBAAkB;IACnD,gCAAgC,CAAC,WAAW;CACpC,CAAC;AAEX,MAAM,+BAA+B,GAAa,GAAG,EAAE;;IACrD,MAAM,EAAE,WAAW,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAEtD,MAAM,SAAS,GAAG,MAAA,KAAK,CAAC,WAAW,CAAC,mCAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IAEjD,OAAO,CACL,MAAC,OAAO,IAAC,SAAS,EAAE,SAAS,aAC3B,KAAC,gBAAgB,KAAG,EACpB,KAAC,sBAAsB,KAAG,EAC1B,KAAC,qBAAqB,KAAG,EACzB,KAAC,cAAc,KAAG,IACV,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,+BAA+B,CAAC","sourcesContent":["import React from 'react';\nimport { Stepper } from '@openedx/paragon';\n\nimport { useProgressiveProfilingQuiz } from '../../ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../data/constants';\nimport LearningGoalStep from './steps/step-learning-goal';\nimport LearningMotivationStep from './steps/step-learning-motivation';\nimport InterestsDeclaredStep from './steps/step-interests-declared';\nimport WorkStatusStep from './steps/step-work-status';\n\nconst STEPS = [\n PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL,\n PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION,\n PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED,\n PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS,\n] as const;\n\nconst ProgressiveProfilingQuizStepper: React.FC = () => {\n const { currentStep } = useProgressiveProfilingQuiz();\n\n const activeKey = STEPS[currentStep] ?? STEPS[0];\n\n return (\n <Stepper activeKey={activeKey}>\n <LearningGoalStep />\n <LearningMotivationStep />\n <InterestsDeclaredStep />\n <WorkStatusStep />\n </Stepper>\n );\n};\n\nexport default ProgressiveProfilingQuizStepper;\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Stepper } from '@openedx/paragon';
|
|
14
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
15
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
16
|
+
import messages from './messages';
|
|
17
|
+
const TOTAL_STEPS = Object.keys(PROGRESSIVE_PROFILING_QUIZ_STEPS).length;
|
|
18
|
+
const BaseStep = (_a) => {
|
|
19
|
+
var { children, optionalHeaderText } = _a, props = __rest(_a, ["children", "optionalHeaderText"]);
|
|
20
|
+
const { formatMessage } = useIntl();
|
|
21
|
+
return (_jsxs(Stepper.Step, Object.assign({}, props, { children: [_jsxs("h3", { className: "h6", children: [_jsxs("span", { children: [optionalHeaderText, "\u00A0"] }), formatMessage(messages.stepCount, { step: props.index + 1, total: TOTAL_STEPS })] }), _jsx("div", { className: "bg-light-100 rounded p-4.5 mb-4", children: children })] })));
|
|
22
|
+
};
|
|
23
|
+
export default BaseStep;
|
|
24
|
+
//# sourceMappingURL=BaseStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseStep.js","sourceRoot":"","sources":["../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/BaseStep.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,YAAY,CAAC;AAUlC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,MAAM,CAAC;AACzE,MAAM,QAAQ,GAA4B,CAAC,EAI1C,EAAE,EAAE;QAJsC,EACzC,QAAQ,EACR,kBAAkB,OAEnB,EADI,KAAK,cAHiC,kCAI1C,CADS;IAER,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,MAAC,OAAO,CAAC,IAAI,oBAAK,KAAK,eACrB,cAAI,SAAS,EAAC,IAAI,aAChB,2BAAO,kBAAkB,cAAc,EACtC,aAAa,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,IAC9E,EACL,cAAK,SAAS,EAAC,iCAAiC,YAC7C,QAAQ,GACL,KACO,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { Stepper } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport React, { ReactNode } from 'react';\n\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport messages from './messages';\n\ninterface BaseStepProps {\n children: ReactNode,\n eventKey: string,\n title: string,\n index: number,\n optionalHeaderText?: string,\n}\n\nconst TOTAL_STEPS = Object.keys(PROGRESSIVE_PROFILING_QUIZ_STEPS).length;\nconst BaseStep: React.FC<BaseStepProps> = ({\n children,\n optionalHeaderText,\n ...props\n}) => {\n const { formatMessage } = useIntl();\n\n return (\n <Stepper.Step {...props}>\n <h3 className=\"h6\">\n <span>{optionalHeaderText} </span>\n {formatMessage(messages.stepCount, { step: props.index + 1, total: TOTAL_STEPS })}\n </h3>\n <div className=\"bg-light-100 rounded p-4.5 mb-4\">\n {children}\n </div>\n </Stepper.Step>\n );\n};\n\nexport default BaseStep;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
stepCount: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
backButton: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
nextButton: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default messages;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
stepCount: {
|
|
4
|
+
id: 'progressiveProfilingQuiz.stepper.baseStep.stepCount',
|
|
5
|
+
defaultMessage: 'Step {step} of {total}',
|
|
6
|
+
description: 'Indicates the current step number out of the total number of steps in the progressive profiling quiz',
|
|
7
|
+
},
|
|
8
|
+
backButton: {
|
|
9
|
+
id: 'progressiveProfilingQuiz.stepper.backButton',
|
|
10
|
+
defaultMessage: 'Back',
|
|
11
|
+
description: 'Label for the button to go back to the previous step of the progressive profiling quiz',
|
|
12
|
+
},
|
|
13
|
+
nextButton: {
|
|
14
|
+
id: 'progressiveProfilingQuiz.stepper.nextButton',
|
|
15
|
+
defaultMessage: 'Next',
|
|
16
|
+
description: 'Label for the button to continue to the next step of the progressive profiling quiz',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export default messages;
|
|
20
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,SAAS,EAAE;QACT,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,wBAAwB;QACxC,WAAW,EAAE,sGAAsG;KACpH;IACD,UAAU,EAAE;QACV,EAAE,EAAE,6CAA6C;QACjD,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,wFAAwF;KACtG;IACD,UAAU,EAAE;QACV,EAAE,EAAE,6CAA6C;QACjD,cAAc,EAAE,MAAM;QACtB,WAAW,EAAE,qFAAqF;KACnG;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n stepCount: {\n id: 'progressiveProfilingQuiz.stepper.baseStep.stepCount',\n defaultMessage: 'Step {step} of {total}',\n description: 'Indicates the current step number out of the total number of steps in the progressive profiling quiz',\n },\n backButton: {\n id: 'progressiveProfilingQuiz.stepper.backButton',\n defaultMessage: 'Back',\n description: 'Label for the button to go back to the previous step of the progressive profiling quiz',\n },\n nextButton: {\n id: 'progressiveProfilingQuiz.stepper.nextButton',\n defaultMessage: 'Next',\n description: 'Label for the button to continue to the next step of the progressive profiling quiz',\n },\n});\n\nexport default messages;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Stepper, Button } from '@openedx/paragon';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import BaseStep from '../BaseStep';
|
|
5
|
+
import { useProgressiveProfilingQuiz } from '../../../../../../widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';
|
|
6
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
7
|
+
import stepMessages from '../messages';
|
|
8
|
+
import messages from './messages';
|
|
9
|
+
const InterestsDeclaredStep = () => {
|
|
10
|
+
const { goToPreviousStep, goToNextStep } = useProgressiveProfilingQuiz();
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED, title: formatMessage(messages.title), index: 2, children: _jsx("h4", { children: formatMessage(messages.question) }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED, children: [_jsx(Button, { variant: "outline-primary", onClick: goToPreviousStep, children: formatMessage(stepMessages.backButton) }), _jsx(Button, { onClick: goToNextStep, children: formatMessage(stepMessages.nextButton) })] })] }));
|
|
13
|
+
};
|
|
14
|
+
export default InterestsDeclaredStep;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnD,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,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,qBAAqB,GAAa,GAAG,EAAE;IAC3C,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,2BAA2B,EAAE,CAAC;IACzE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,8BACE,KAAC,QAAQ,IACP,QAAQ,EAAE,gCAAgC,CAAC,kBAAkB,EAC7D,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpC,KAAK,EAAE,CAAC,YAER,uBACG,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAC9B,GACI,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,kBAAkB,aAC9E,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,gBAAgB,YACxD,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,YAAY,YAC1B,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import React from 'react';\nimport { Stepper, Button } 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 stepMessages from '../messages';\nimport messages from './messages';\n\nconst InterestsDeclaredStep: React.FC = () => {\n const { goToPreviousStep, goToNextStep } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\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>\n {formatMessage(messages.question)}\n </h4>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED}>\n <Button variant=\"outline-primary\" onClick={goToPreviousStep}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <Button onClick={goToNextStep}>\n {formatMessage(stepMessages.nextButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default InterestsDeclaredStep;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
title: {
|
|
4
|
+
id: 'progressiveProfilingQuiz.stepper.interestsDeclared.title',
|
|
5
|
+
defaultMessage: 'Interests',
|
|
6
|
+
description: 'Title for the interests step of the progressive profiling quiz',
|
|
7
|
+
},
|
|
8
|
+
question: {
|
|
9
|
+
id: 'progressiveProfilingQuiz.stepper.interestsDeclared.question',
|
|
10
|
+
defaultMessage: 'What do you want to learn?',
|
|
11
|
+
description: 'Question asked in the interests step of the progressive profiling quiz',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export default messages;
|
|
15
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,KAAK,EAAE;QACL,EAAE,EAAE,0DAA0D;QAC9D,cAAc,EAAE,WAAW;QAC3B,WAAW,EAAE,gEAAgE;KAC9E;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,6DAA6D;QACjE,cAAc,EAAE,4BAA4B;QAC5C,WAAW,EAAE,wEAAwE;KACtF;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n title: {\n id: 'progressiveProfilingQuiz.stepper.interestsDeclared.title',\n defaultMessage: 'Interests',\n description: 'Title for the interests step of the progressive profiling quiz',\n },\n question: {\n id: 'progressiveProfilingQuiz.stepper.interestsDeclared.question',\n defaultMessage: 'What do you want to learn?',\n description: 'Question asked in the interests step of the progressive profiling quiz',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Stepper, Button } from '@openedx/paragon';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import BaseStep from '../BaseStep';
|
|
5
|
+
import { useProgressiveProfilingQuiz } from '../../../../../../widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';
|
|
6
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
7
|
+
import messages from './messages';
|
|
8
|
+
const LearningGoalStep = () => {
|
|
9
|
+
const { goToNextStep } = useProgressiveProfilingQuiz();
|
|
10
|
+
const { formatMessage } = useIntl();
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL, title: formatMessage(messages.title), index: 0, optionalHeaderText: formatMessage(messages.headerText), children: _jsx("h4", { children: formatMessage(messages.question) }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL, children: [_jsx(Stepper.ActionRow.Spacer, {}), _jsx(Button, { variant: "outline-primary", onClick: goToNextStep, children: formatMessage(messages.continueButton) })] })] }));
|
|
12
|
+
};
|
|
13
|
+
export default LearningGoalStep;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnD,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,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,gBAAgB,GAAa,GAAG,EAAE;IACtC,MAAM,EAAE,YAAY,EAAE,GAAG,2BAA2B,EAAE,CAAC;IACvD,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,8BACE,KAAC,QAAQ,IACP,QAAQ,EAAE,gCAAgC,CAAC,aAAa,EACxD,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpC,KAAK,EAAE,CAAC,EACR,kBAAkB,EAAE,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,YAEtD,uBACG,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAC9B,GACI,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,aAAa,aACzE,KAAC,OAAO,CAAC,SAAS,CAAC,MAAM,KAAG,EAC5B,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,YAAY,YACpD,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import React from 'react';\nimport { Stepper, Button } 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 messages from './messages';\n\nconst LearningGoalStep: React.FC = () => {\n const { goToNextStep } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\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 <h4>\n {formatMessage(messages.question)}\n </h4>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL}>\n <Stepper.ActionRow.Spacer />\n <Button variant=\"outline-primary\" onClick={goToNextStep}>\n {formatMessage(messages.continueButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default LearningGoalStep;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
title: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
headerText: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
question: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
continueButton: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default messages;
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
title: {
|
|
4
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.title',
|
|
5
|
+
defaultMessage: 'Learning Goal',
|
|
6
|
+
description: 'Title for the learning goal step of the progressive profiling quiz',
|
|
7
|
+
},
|
|
8
|
+
headerText: {
|
|
9
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.headerText',
|
|
10
|
+
defaultMessage: 'Tell us more about you so we can make course recommendations.',
|
|
11
|
+
description: 'Header text shown above the learning goal question',
|
|
12
|
+
},
|
|
13
|
+
question: {
|
|
14
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.question',
|
|
15
|
+
defaultMessage: 'What’s your learning goal?',
|
|
16
|
+
description: 'Question asked in the learning goal step of the progressive profiling quiz',
|
|
17
|
+
},
|
|
18
|
+
continueButton: {
|
|
19
|
+
id: 'progressiveProfilingQuiz.stepper.learningGoal.continueButton',
|
|
20
|
+
defaultMessage: 'Continue',
|
|
21
|
+
description: 'Label for the button to continue to the next step from the learning goal step',
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export default messages;
|
|
25
|
+
//# sourceMappingURL=messages.js.map
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,KAAK,EAAE;QACL,EAAE,EAAE,qDAAqD;QACzD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,oEAAoE;KAClF;IACD,UAAU,EAAE;QACV,EAAE,EAAE,0DAA0D;QAC9D,cAAc,EAAE,+DAA+D;QAC/E,WAAW,EAAE,oDAAoD;KAClE;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,wDAAwD;QAC5D,cAAc,EAAE,4BAA4B;QAC5C,WAAW,EAAE,4EAA4E;KAC1F;IACD,cAAc,EAAE;QACd,EAAE,EAAE,8DAA8D;QAClE,cAAc,EAAE,UAAU;QAC1B,WAAW,EAAE,+EAA+E;KAC7F;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n title: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.title',\n defaultMessage: 'Learning Goal',\n description: 'Title for the learning goal step of the progressive profiling quiz',\n },\n headerText: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.headerText',\n defaultMessage: 'Tell us more about you so we can make course recommendations.',\n description: 'Header text shown above the learning goal question',\n },\n question: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.question',\n defaultMessage: 'What’s your learning goal?',\n description: 'Question asked in the learning goal step of the progressive profiling quiz',\n },\n continueButton: {\n id: 'progressiveProfilingQuiz.stepper.learningGoal.continueButton',\n defaultMessage: 'Continue',\n description: 'Label for the button to continue to the next step from the learning goal step',\n },\n});\n\nexport default messages;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Stepper, Button } from '@openedx/paragon';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import BaseStep from '../BaseStep';
|
|
5
|
+
import { useProgressiveProfilingQuiz } from '../../../../../../widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';
|
|
6
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
7
|
+
import stepMessages from '../messages';
|
|
8
|
+
import messages from './messages';
|
|
9
|
+
const LearningMotivationStep = () => {
|
|
10
|
+
const { goToPreviousStep, goToNextStep } = useProgressiveProfilingQuiz();
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION, title: formatMessage(messages.title), index: 1, children: _jsx("h4", { children: formatMessage(messages.question) }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION, children: [_jsx(Button, { variant: "outline-primary", onClick: goToPreviousStep, children: formatMessage(stepMessages.backButton) }), _jsx(Button, { onClick: goToNextStep, children: formatMessage(stepMessages.nextButton) })] })] }));
|
|
13
|
+
};
|
|
14
|
+
export default LearningMotivationStep;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,MAAM,kBAAkB,CAAC;AACnD,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,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,sBAAsB,GAAa,GAAG,EAAE;IAC5C,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,2BAA2B,EAAE,CAAC;IACzE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,8BACE,KAAC,QAAQ,IACP,QAAQ,EAAE,gCAAgC,CAAC,mBAAmB,EAC9D,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpC,KAAK,EAAE,CAAC,YAER,uBACG,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAC9B,GACI,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,mBAAmB,aAC/E,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,gBAAgB,YACxD,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,YAAY,YAC1B,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 } 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 stepMessages from '../messages';\nimport messages from './messages';\n\nconst LearningMotivationStep: React.FC = () => {\n const { goToPreviousStep, goToNextStep } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}\n title={formatMessage(messages.title)}\n index={1}\n >\n <h4>\n {formatMessage(messages.question)}\n </h4>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}>\n <Button variant=\"outline-primary\" onClick={goToPreviousStep}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <Button onClick={goToNextStep}>\n {formatMessage(stepMessages.nextButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default LearningMotivationStep;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
title: {
|
|
4
|
+
id: 'progressiveProfilingQuiz.stepper.learningMotivation.title',
|
|
5
|
+
defaultMessage: 'Learning Motivation',
|
|
6
|
+
description: 'Title for the learning motivation step of the progressive profiling quiz',
|
|
7
|
+
},
|
|
8
|
+
question: {
|
|
9
|
+
id: 'progressiveProfilingQuiz.stepper.learningMotivation.question',
|
|
10
|
+
defaultMessage: 'What do you want to gain from your learning experience?',
|
|
11
|
+
description: 'Question asked in the learning motivation step of the progressive profiling quiz',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export default messages;
|
|
15
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,KAAK,EAAE;QACL,EAAE,EAAE,2DAA2D;QAC/D,cAAc,EAAE,qBAAqB;QACrC,WAAW,EAAE,0EAA0E;KACxF;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,8DAA8D;QAClE,cAAc,EAAE,yDAAyD;QACzE,WAAW,EAAE,kFAAkF;KAChG;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n title: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.title',\n defaultMessage: 'Learning Motivation',\n description: 'Title for the learning motivation step of the progressive profiling quiz',\n },\n question: {\n id: 'progressiveProfilingQuiz.stepper.learningMotivation.question',\n defaultMessage: 'What do you want to gain from your learning experience?',\n description: 'Question asked in the learning motivation step of the progressive profiling quiz',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Stepper, Button } from '@openedx/paragon';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import BaseStep from '../BaseStep';
|
|
5
|
+
import { useProgressiveProfilingQuiz } from '../../../../../../widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';
|
|
6
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
7
|
+
import stepMessages from '../messages';
|
|
8
|
+
import messages from './messages';
|
|
9
|
+
const WorkStatusStep = () => {
|
|
10
|
+
const { goToPreviousStep } = useProgressiveProfilingQuiz();
|
|
11
|
+
const { formatMessage } = useIntl();
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS, title: formatMessage(messages.title), index: 3, children: _jsx("h4", { children: formatMessage(messages.question) }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS, children: [_jsx(Button, { variant: "outline-primary", onClick: goToPreviousStep, children: formatMessage(stepMessages.backButton) }), _jsx(Button, { children: formatMessage(messages.viewResultsButton) })] })] }));
|
|
13
|
+
};
|
|
14
|
+
export default WorkStatusStep;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnD,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,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,cAAc,GAAa,GAAG,EAAE;IACpC,MAAM,EAAE,gBAAgB,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAC3D,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,OAAO,CACL,8BACE,KAAC,QAAQ,IACP,QAAQ,EAAE,gCAAgC,CAAC,WAAW,EACtD,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpC,KAAK,EAAE,CAAC,YAER,uBACG,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAC9B,GACI,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,WAAW,aACvE,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,gBAAgB,YACxD,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,MAAM,cACJ,aAAa,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GACnC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React from 'react';\nimport { Stepper, Button } 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 stepMessages from '../messages';\nimport messages from './messages';\n\nconst WorkStatusStep: React.FC = () => {\n const { goToPreviousStep } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\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 </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS}>\n <Button variant=\"outline-primary\" onClick={goToPreviousStep}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <Button>\n {formatMessage(messages.viewResultsButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default WorkStatusStep;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
title: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
question: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
viewResultsButton: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default messages;
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineMessages } from '@openedx/frontend-base';
|
|
2
|
+
const messages = defineMessages({
|
|
3
|
+
title: {
|
|
4
|
+
id: 'progressiveProfilingQuiz.stepper.workStatus.title',
|
|
5
|
+
defaultMessage: 'Work Status',
|
|
6
|
+
description: 'Title for the work status step of the progressive profiling quiz',
|
|
7
|
+
},
|
|
8
|
+
question: {
|
|
9
|
+
id: 'progressiveProfilingQuiz.stepper.workStatus.question',
|
|
10
|
+
defaultMessage: 'What is your current role?',
|
|
11
|
+
description: 'Question asked in the work status step of the progressive profiling quiz',
|
|
12
|
+
},
|
|
13
|
+
viewResultsButton: {
|
|
14
|
+
id: 'progressiveProfilingQuiz.stepper.workStatus.viewResultsButton',
|
|
15
|
+
defaultMessage: 'View Results',
|
|
16
|
+
description: 'Label for the button to complete the quiz and view results from the work status step',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export default messages;
|
|
20
|
+
//# sourceMappingURL=messages.js.map
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,KAAK,EAAE;QACL,EAAE,EAAE,mDAAmD;QACvD,cAAc,EAAE,aAAa;QAC7B,WAAW,EAAE,kEAAkE;KAChF;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,sDAAsD;QAC1D,cAAc,EAAE,4BAA4B;QAC5C,WAAW,EAAE,0EAA0E;KACxF;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,+DAA+D;QACnE,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,sFAAsF;KACpG;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n title: {\n id: 'progressiveProfilingQuiz.stepper.workStatus.title',\n defaultMessage: 'Work Status',\n description: 'Title for the work status step of the progressive profiling quiz',\n },\n question: {\n id: 'progressiveProfilingQuiz.stepper.workStatus.question',\n defaultMessage: 'What is your current role?',\n description: 'Question asked in the work status step of the progressive profiling quiz',\n },\n viewResultsButton: {\n id: 'progressiveProfilingQuiz.stepper.workStatus.viewResultsButton',\n defaultMessage: 'View Results',\n description: 'Label for the button to complete the quiz and view results from the work status step',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export declare const renderStep: (step: ReactElement, activeKey: string, intlMessages?: Record<string, string>) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { IntlProvider } from '@openedx/frontend-base';
|
|
4
|
+
import { Stepper } from '@openedx/paragon';
|
|
5
|
+
import { ProgressiveProfilingQuizProvider } from '../../../../../widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';
|
|
6
|
+
export const renderStep = (step, activeKey, intlMessages = {}) => render(_jsx(IntlProvider, { locale: "en", messages: intlMessages, children: _jsx(ProgressiveProfilingQuizProvider, { children: _jsx(Stepper, { activeKey: activeKey, children: step }) }) }));
|
|
7
|
+
//# sourceMappingURL=test.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.utils.js","sourceRoot":"","sources":["../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/test.utils.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,gCAAgC,EAAE,MAAM,wEAAwE,CAAC;AAE1H,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,IAAkB,EAClB,SAAiB,EACjB,eAAuC,EAAE,EACzC,EAAE,CAAC,MAAM,CACT,KAAC,YAAY,IAAC,MAAM,EAAC,IAAI,EAAC,QAAQ,EAAE,YAAY,YAC9C,KAAC,gCAAgC,cAC/B,KAAC,OAAO,IAAC,SAAS,EAAE,SAAS,YAC1B,IAAI,GACG,GACuB,GACtB,CAChB,CAAC","sourcesContent":["import { ReactElement } from 'react';\nimport { render } from '@testing-library/react';\nimport { IntlProvider } from '@openedx/frontend-base';\nimport { Stepper } from '@openedx/paragon';\n\nimport { ProgressiveProfilingQuizProvider } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\n\nexport const renderStep = (\n step: ReactElement,\n activeKey: string,\n intlMessages: Record<string, string> = {},\n) => render(\n <IntlProvider locale=\"en\" messages={intlMessages}>\n <ProgressiveProfilingQuizProvider>\n <Stepper activeKey={activeKey}>\n {step}\n </Stepper>\n </ProgressiveProfilingQuizProvider>\n </IntlProvider>,\n);\n"]}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePopularCourses.js","sourceRoot":"","sources":["../../src/hooks/usePopularCourses.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,iFAAiF;AACjF,oDAAoD;AAEpD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,GAAG,EAAE,CAAC,QAAQ,CAAU;IACxB,QAAQ,EAAE,CAAC,KAAa,EAAE,IAAc,EAAE,EAAE,CAC1C,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAU;IACvD,OAAO,EAAE,CAAC,KAAa,EAAE,IAAc,EAAE,IAAY,EAAE,EAAE,CACvD,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAU;IAC5D,OAAO,EAAE,CAAC,WAAwB,EAAE,KAAa,EAAE,EAAE,CACnD,CAAC,GAAG,UAAU,CAAC,GAAG,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAU;CAC9D,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,YAAiC,EACjC,OAAgB,EACmB,EAAE,CACrC,QAAQ,CAAC;IACP,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IACpD,OAAO,EAAE,GAAS,EAAE;QAClB,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,YAAa,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAmB,EAAE;;YACvC,MAAM,UAAU,GAAG,GAalB,CAAC;YAEF,OAAO;gBACL,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,KAAK,EAAE,MAAA,MAAA,GAAG,CAAC,KAAK,mCAAI,GAAG,CAAC,IAAI,mCAAI,UAAU;gBAC1C,mBAAmB,EAAE,MAAA,MAAA,MAAA,UAAU,CAAC,mBAAmB,mCAAI,UAAU,CAAC,iBAAiB,mCAAI,UAAU,CAAC,WAAW,mCAAI,EAAE;gBACnH,GAAG,EAAE,MAAA,MAAA,MAAA,UAAU,CAAC,cAAc,mCAAI,UAAU,CAAC,SAAS,mCAAI,UAAU,CAAC,aAAa,mCAAI,EAAE;gBACxF,SAAS,EAAE,MAAA,UAAU,CAAC,0BAA0B,mCAAI,EAAE;gBACtD,YAAY,EAAE,MAAA,MAAA,UAAU,CAAC,YAAY,mCAAI,UAAU,CAAC,IAAI,mCAAI,QAAQ;gBACpE,OAAO,EAAE,QAAQ;gBACjB,OAAO,EAAE,MAAA,UAAU,CAAC,OAAO,mCAAI,EAAE;gBACjC,iBAAiB,EAAE,MAAA,UAAU,CAAC,iBAAiB,mCAAI,SAAS;gBAC5D,KAAK,EAAE,MAAA,UAAU,CAAC,KAAK,mCAAI,SAAS;aACrC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAA;IACD,OAAO,EAAE,CAAC,CAAC,YAAY,IAAI,OAAO;IAClC,SAAS,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE;CAC1B,CAAC,CAAC","sourcesContent":["import { useQuery, UseQueryResult } from '@tanstack/react-query';\nimport { SearchClient } from 'algoliasearch';\nimport { ProductType } from '@src/types/types';\nimport { PRODUCT_TYPE_COURSE } from '@src/constants';\nimport { fetchPopularProducts } from '@src/utils/algoliaUtils';\nimport { ProductCardItem } from '@src/containers/ProductCard/data/types';\n\n// ─── Query key factories ──────────────────────────────────────────────────────\n// Centralised so cache invalidation is never a typo\n\nexport const searchKeys = {\n all: ['search'] as const,\n programs: (query: string, tags: string[]) =>\n [...searchKeys.all, 'programs', query, tags] as const,\n courses: (query: string, tags: string[], page: number) =>\n [...searchKeys.all, 'courses', query, tags, page] as const,\n popular: (productType: ProductType, limit: number) =>\n [...searchKeys.all, 'popular', productType, limit] as const,\n};\n\nexport const usePopularCoursesData = (\n searchClient: SearchClient | null,\n enabled: boolean,\n): UseQueryResult<ProductCardItem[]> =>\n useQuery({\n queryKey: searchKeys.popular(PRODUCT_TYPE_COURSE, 4),\n queryFn: async () => {\n const hits = await fetchPopularProducts(searchClient!, PRODUCT_TYPE_COURSE, 4);\n return hits.map((hit): ProductCardItem => {\n const hitDetails = hit as {\n short_description?: string,\n primary_description?: string,\n description?: string,\n marketing_url?: string,\n image_url?: string,\n card_image_url?: string,\n organization_logo_override?: string,\n content_type?: string,\n type?: string,\n partner?: string,\n weeks_to_complete?: number,\n level?: string,\n };\n\n return {\n objectID: hit.objectID,\n title: hit.title ?? hit.name ?? 'Untitled',\n primary_description: hitDetails.primary_description ?? hitDetails.short_description ?? hitDetails.description ?? '',\n url: hitDetails.card_image_url ?? hitDetails.image_url ?? hitDetails.marketing_url ?? '',\n thumbnail: hitDetails.organization_logo_override ?? '',\n content_type: hitDetails.content_type ?? hitDetails.type ?? 'Course',\n product: 'Course',\n partner: hitDetails.partner ?? '',\n weeks_to_complete: hitDetails.weeks_to_complete ?? undefined,\n level: hitDetails.level ?? undefined,\n };\n });\n },\n enabled: !!searchClient && enabled,\n staleTime: 1000 * 60 * 10,\n });\n"]}
|