@edx/frontend-app-subscription-learner-dashboard 1.38.3 → 1.38.5
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/ProgramDashboard/ProgramProgress/ProgramProgress.js +1 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgress.js.map +1 -1
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgressInfo.js +6 -2
- package/dist/containers/ProgramDashboard/ProgramProgress/ProgramProgressInfo.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/InterestsDeclaredAutosuggest.d.ts +14 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/InterestsDeclaredAutosuggest.js +8 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/InterestsDeclaredAutosuggest.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.d.ts +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.js +44 -4
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.scss +3 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/messages.d.ts +15 -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 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/schema.d.ts +18 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/schema.js +31 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/schema.js.map +1 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ const ProgramProgress = () => {
|
|
|
38
38
|
const remainingCourseCount = ((_j = courseData === null || courseData === void 0 ? void 0 : courseData.notStarted) === null || _j === void 0 ? void 0 : _j.length) || 0;
|
|
39
39
|
const completedCourseCount = ((_k = courseData === null || courseData === void 0 ? void 0 : courseData.completed) === null || _k === void 0 ? void 0 : _k.length) || 0;
|
|
40
40
|
const discountData = programData === null || programData === void 0 ? void 0 : programData.discountData;
|
|
41
|
-
return (_jsxs(_Fragment, { children: [_jsx(Helmet, { title: `${programData === null || programData === void 0 ? void 0 : programData.title}` }), _jsxs(Container, { fluid: false, size: "xl", className: "p-4.5", children: [_jsx("div", { className: "d-block d-lg-none mb-4", children: _jsxs(Link, { to: subscriptionDashboardUrlPath, className: "text-reset text-decoration-none d-inline-flex align-items-center", children: [_jsx(Icon, { src: ArrowBack, className: "mr-2" }), formatMessage(messages.programProgressReturnToDashboardText)] }) }), _jsx(ProgramProgressHeader, { programTitle: (_l = programData === null || programData === void 0 ? void 0 : programData.title) !== null && _l !== void 0 ? _l : '', programType: (_m = programData === null || programData === void 0 ? void 0 : programData.type) !== null && _m !== void 0 ? _m : '', authoringOrganizations: programData === null || programData === void 0 ? void 0 : programData.authoringOrganizations }), _jsxs(Row, { children: [_jsxs(Col, { sm: 12, md: 8, children: [_jsx(ProgramProgressInfo, { allCoursesCompleted: allCoursesCompleted, totalCoursesInProgram: totalCoursesInProgram, programTitle: (_o = programData === null || programData === void 0 ? void 0 : programData.title) !== null && _o !== void 0 ? _o : '', discountData: discountData }), _jsx(ProgramProgressTabs, { counts: { inProgress: inProgressCourseCount, remaining: remainingCourseCount, completed: completedCourseCount }, type: programType })] }), _jsx(Col, { sm: 12, md: 4, children: _jsx(ProgramProgressSidebar, { inProgress: inProgressCourseCount, remaining: remainingCourseCount, completed: completedCourseCount }) })] })] })] }));
|
|
41
|
+
return (_jsxs(_Fragment, { children: [_jsx(Helmet, { title: `${programData === null || programData === void 0 ? void 0 : programData.title}` }), _jsxs(Container, { fluid: false, size: "xl", className: "p-4.5", children: [_jsx("div", { className: "d-block d-lg-none mb-4", children: _jsxs(Link, { to: subscriptionDashboardUrlPath, className: "text-reset text-decoration-none d-inline-flex align-items-center", children: [_jsx(Icon, { src: ArrowBack, className: "mr-2" }), formatMessage(messages.programProgressReturnToDashboardText)] }) }), _jsx(ProgramProgressHeader, { programTitle: (_l = programData === null || programData === void 0 ? void 0 : programData.title) !== null && _l !== void 0 ? _l : '', programType: (_m = programData === null || programData === void 0 ? void 0 : programData.type) !== null && _m !== void 0 ? _m : '', authoringOrganizations: programData === null || programData === void 0 ? void 0 : programData.authoringOrganizations }), _jsxs(Row, { children: [_jsxs(Col, { sm: 12, md: 8, children: [_jsx(ProgramProgressInfo, { allCoursesCompleted: allCoursesCompleted, totalCoursesInProgram: totalCoursesInProgram, programTitle: (_o = programData === null || programData === void 0 ? void 0 : programData.title) !== null && _o !== void 0 ? _o : '', discountData: discountData, completedCourseCount: completedCourseCount }), _jsx(ProgramProgressTabs, { counts: { inProgress: inProgressCourseCount, remaining: remainingCourseCount, completed: completedCourseCount }, type: programType })] }), _jsx(Col, { sm: 12, md: 4, children: _jsx(ProgramProgressSidebar, { inProgress: inProgressCourseCount, remaining: remainingCourseCount, completed: completedCourseCount }) })] })] })] }));
|
|
42
42
|
};
|
|
43
43
|
export default ProgramProgress;
|
|
44
44
|
//# sourceMappingURL=ProgramProgress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgramProgress.js","sourceRoot":"","sources":["../../../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AAI,IAAC,EAAE,EAAE,4BAA4B,EAAE,SAAS,EAAC,kEAAkE,aAClH,KAAC,IAAI,IAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAC,MAAM,GAAG,EACxC,aAAa,CAAC,QAAQ,CAAC,oCAAoC,CAAC,IACxD,GACH,EACN,KAAC,qBAAqB,IACpB,YAAY,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,mCAAI,EAAE,EACtC,WAAW,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,mCAAI,EAAE,EACpC,sBAAsB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,sBAAsB,GAC3D,EACF,MAAC,GAAG,eACF,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,aAChB,KAAC,mBAAmB,IAClB,mBAAmB,EAAE,mBAAmB,EACxC,qBAAqB,EAAE,qBAAqB,EAC5C,YAAY,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,mCAAI,EAAE,EACtC,YAAY,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"ProgramProgress.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramProgress/ProgramProgress.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAA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AAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,aAChB,KAAC,mBAAmB,IAClB,mBAAmB,EAAE,mBAAmB,EACxC,qBAAqB,EAAE,qBAAqB,EAC5C,YAAY,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,mCAAI,EAAE,EACtC,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,GAC1C,EACF,KAAC,mBAAmB,IAAC,MAAM,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,SAAS,EAAE,oBAAoB,EAAE,SAAS,EAAE,oBAAoB,EAAE,EAAE,IAAI,EAAE,WAAW,GAAI,IACvJ,EAEN,KAAC,GAAG,IAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,YAChB,KAAC,sBAAsB,IACrB,UAAU,EAAE,qBAAqB,EACjC,SAAS,EAAE,oBAAoB,EAC/B,SAAS,EAAE,oBAAoB,GAC/B,GACE,IACF,IACI,IACX,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FC } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { Link } from 'react-router-dom';\nimport { Col, Container, Icon, Row } from '@openedx/paragon';\nimport { ArrowBack } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\n\nimport './index.scss';\nimport { useProgressData } from '@src/hooks';\nimport ProgramProgressHeader from './ProgramProgressHeader';\nimport ProgramProgressInfo from './ProgramProgressInfo';\nimport { ProgramProgressTabs } from './ProgramProgressTabs';\nimport { ProgramProgressSidebar } from './ProgramProgressSidebar';\nimport { subscriptionDashboardUrlPath } from '@src/constants';\nimport messages from './messages';\n\nconst ProgramProgress: FC = () => {\n const { programProgressData, isLoading, error } = useProgressData();\n const { formatMessage } = useIntl();\n\n if (programProgressData === null) {\n return <div>Invalid URL</div>;\n }\n\n if (isLoading) {\n return <div>Loading...</div>;\n }\n\n if (error) {\n return <div>Error occurred</div>;\n }\n\n const programData = programProgressData?.programData;\n const courseData = programProgressData?.courseData;\n\n const totalCoursesInProgram = (courseData.notStarted?.length || 0)\n + (courseData.completed?.length || 0)\n + (courseData.inProgress?.length || 0);\n\n const allCoursesCompleted = !courseData.notStarted?.length\n && !courseData.inProgress?.length\n && courseData.completed?.length;\n\n const programType = programData?.type ?? '';\n const inProgressCourseCount = courseData?.inProgress?.length || 0;\n const remainingCourseCount = courseData?.notStarted?.length || 0;\n const completedCourseCount = courseData?.completed?.length || 0;\n const discountData = programData?.discountData;\n\n return (\n <>\n <Helmet title={`${programData?.title}`} />\n <Container fluid={false} size=\"xl\" className=\"p-4.5\">\n <div className=\"d-block d-lg-none mb-4\">\n <Link to={subscriptionDashboardUrlPath} className=\"text-reset text-decoration-none d-inline-flex align-items-center\">\n <Icon src={ArrowBack} className=\"mr-2\" />\n {formatMessage(messages.programProgressReturnToDashboardText)}\n </Link>\n </div>\n <ProgramProgressHeader\n programTitle={programData?.title ?? ''}\n programType={programData?.type ?? ''}\n authoringOrganizations={programData?.authoringOrganizations}\n />\n <Row>\n <Col sm={12} md={8}>\n <ProgramProgressInfo\n allCoursesCompleted={allCoursesCompleted}\n totalCoursesInProgram={totalCoursesInProgram}\n programTitle={programData?.title ?? ''}\n discountData={discountData}\n completedCourseCount={completedCourseCount}\n />\n <ProgramProgressTabs counts={{ inProgress: inProgressCourseCount, remaining: remainingCourseCount, completed: completedCourseCount }} type={programType} />\n </Col>\n\n <Col sm={12} md={4}>\n <ProgramProgressSidebar\n inProgress={inProgressCourseCount}\n remaining={remainingCourseCount}\n completed={completedCourseCount}\n />\n </Col>\n </Row>\n </Container>\n </>\n );\n};\n\nexport default ProgramProgress;\n"]}
|
|
@@ -2,11 +2,15 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useIntl } from '@openedx/frontend-base';
|
|
3
3
|
import messages from './messages';
|
|
4
4
|
import { UpgradeAllButton } from './UpgradeButton';
|
|
5
|
-
const ProgramProgressInfo = ({ allCoursesCompleted, totalCoursesInProgram, programTitle, discountData }) => {
|
|
5
|
+
const ProgramProgressInfo = ({ allCoursesCompleted, totalCoursesInProgram, programTitle, discountData, completedCourseCount }) => {
|
|
6
6
|
const { formatMessage } = useIntl();
|
|
7
|
+
const showUpgradeButton = completedCourseCount === 0
|
|
8
|
+
&& (discountData === null || discountData === void 0 ? void 0 : discountData.currency)
|
|
9
|
+
&& typeof (discountData === null || discountData === void 0 ? void 0 : discountData.totalInclTax) === 'number'
|
|
10
|
+
&& typeof (discountData === null || discountData === void 0 ? void 0 : discountData.totalInclTaxExclDiscounts) === 'number';
|
|
7
11
|
return (_jsx("div", { className: "pb-4.5", children: allCoursesCompleted
|
|
8
12
|
? (_jsxs(_Fragment, { children: [_jsx("h3", { children: formatMessage(messages.programProgressCompleteHeader) }), _jsx("p", { children: formatMessage(messages.programProgressCompleteText, { programTitle }) })] }))
|
|
9
|
-
: (_jsxs(_Fragment, { children: [_jsx("h3", { className: "program-journey-header font-weight-bold", children: formatMessage(messages.programProgressIncompleteHeader) }), _jsx("p", { className: "program-journey-text", "data-testid": "program-incomplete-info-text", children: formatMessage(messages.programProgressIncompleteText, { totalCoursesInProgram }) }),
|
|
13
|
+
: (_jsxs(_Fragment, { children: [_jsx("h3", { className: "program-journey-header font-weight-bold", children: formatMessage(messages.programProgressIncompleteHeader) }), _jsx("p", { className: "program-journey-text", "data-testid": "program-incomplete-info-text", children: formatMessage(messages.programProgressIncompleteText, { totalCoursesInProgram }) }), showUpgradeButton && (_jsx(UpgradeAllButton, {}))] })) }));
|
|
10
14
|
};
|
|
11
15
|
export default ProgramProgressInfo;
|
|
12
16
|
//# sourceMappingURL=ProgramProgressInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgramProgressInfo.js","sourceRoot":"","sources":["../../../../src/containers/ProgramDashboard/ProgramProgress/ProgramProgressInfo.tsx"],"names":[],"mappings":";A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AAyC,YAAE,aAAa,CAAC,QAAQ,CAAC,+BAA+B,CAAC,GAAM,EACtH,YAAG,SAAS,EAAC,sBAAsB,iBAAa,8BAA8B,YAC3E,aAAa,CAAC,QAAQ,CAAC,6BAA6B,EAAE,EAAE,qBAAqB,EAAE,CAAC,GAC/E,EACH,iBAAiB,IAAI,CACpB,KAAC,gBAAgB,KAAG,CACrB,IACA,CACJ,GACD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import React from 'react';\nimport { useIntl } from '@openedx/frontend-base';\nimport { ProgramProgressInfoProps } from '../data/types';\nimport messages from './messages';\n\nimport { UpgradeAllButton } from './UpgradeButton';\n\nconst ProgramProgressInfo: React.FC<ProgramProgressInfoProps> = ({\n allCoursesCompleted, totalCoursesInProgram, programTitle, discountData, completedCourseCount\n}) => {\n const { formatMessage } = useIntl();\n const showUpgradeButton = completedCourseCount === 0\n && discountData?.currency\n && typeof discountData?.totalInclTax === 'number'\n && typeof discountData?.totalInclTaxExclDiscounts === 'number';\n\n return (\n <div className=\"pb-4.5\">\n {allCoursesCompleted\n ? (\n <>\n <h3>{formatMessage(messages.programProgressCompleteHeader)}</h3>\n <p>{formatMessage(messages.programProgressCompleteText, { programTitle })}</p>\n </>\n )\n : (\n <>\n <h3 className=\"program-journey-header font-weight-bold\">{formatMessage(messages.programProgressIncompleteHeader)}</h3>\n <p className=\"program-journey-text\" data-testid=\"program-incomplete-info-text\">\n {formatMessage(messages.programProgressIncompleteText, { totalCoursesInProgram })}\n </p>\n {showUpgradeButton && (\n <UpgradeAllButton />\n )}\n </>\n )}\n </div>\n );\n};\n\nexport default ProgramProgressInfo;\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SkillWithCount } from '../../../../../../widgets/ProgressiveProfilingQuiz/data';
|
|
3
|
+
export interface AutosuggestValue {
|
|
4
|
+
userProvidedText: string;
|
|
5
|
+
selectionValue: string;
|
|
6
|
+
selectionId: string;
|
|
7
|
+
}
|
|
8
|
+
interface InterestsDeclaredAutosuggestProps {
|
|
9
|
+
inputValue: AutosuggestValue;
|
|
10
|
+
skills?: SkillWithCount[];
|
|
11
|
+
onChange: (value: AutosuggestValue) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const InterestsDeclaredAutosuggest: React.FC<InterestsDeclaredAutosuggestProps>;
|
|
14
|
+
export default InterestsDeclaredAutosuggest;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Form, Icon } from '@openedx/paragon';
|
|
3
|
+
import { Search } from '@openedx/paragon/icons';
|
|
4
|
+
const InterestsDeclaredAutosuggest = ({ inputValue, skills, onChange, }) => {
|
|
5
|
+
return (_jsx(Form.Autosuggest, { value: inputValue, onChange: onChange, name: "interests-declared-autosuggest", trailingElement: (_jsx(Icon, { src: Search })), className: "container-mw-xs", children: skills === null || skills === void 0 ? void 0 : skills.map(skill => (_jsx(Form.AutosuggestOption, { id: skill.value.replaceAll(' ', '-').toLowerCase(), children: skill.value }, skill.value))) }));
|
|
6
|
+
};
|
|
7
|
+
export default InterestsDeclaredAutosuggest;
|
|
8
|
+
//# sourceMappingURL=InterestsDeclaredAutosuggest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InterestsDeclaredAutosuggest.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/InterestsDeclaredAutosuggest.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAgBhD,MAAM,4BAA4B,GAAgD,CAAC,EACjF,UAAU,EACV,MAAM,EACN,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,KAAC,IAAI,CAAC,WAAW,IACf,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,gCAAgC,EACrC,eAAe,EAAE,CACf,KAAC,IAAI,IACH,GAAG,EAAE,MAAM,GACX,CACH,EACD,SAAS,EAAC,iBAAiB,YAE1B,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACpB,KAAC,IAAI,CAAC,iBAAiB,IAAmB,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,YACzF,KAAK,CAAC,KAAK,IADe,KAAK,CAAC,KAAK,CAEf,CAC1B,CAAC,GACe,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,4BAA4B,CAAC","sourcesContent":["import React from 'react';\nimport { Form, Icon } from '@openedx/paragon';\nimport { Search } from '@openedx/paragon/icons';\n\nimport { SkillWithCount } from '@src/widgets/ProgressiveProfilingQuiz/data';\n\nexport interface AutosuggestValue {\n userProvidedText: string,\n selectionValue: string,\n selectionId: string,\n}\n\ninterface InterestsDeclaredAutosuggestProps {\n inputValue: AutosuggestValue,\n skills?: SkillWithCount[],\n onChange: (value: AutosuggestValue) => void,\n}\n\nconst InterestsDeclaredAutosuggest: React.FC<InterestsDeclaredAutosuggestProps> = ({\n inputValue,\n skills,\n onChange,\n}) => {\n return (\n <Form.Autosuggest\n value={inputValue}\n onChange={onChange}\n name=\"interests-declared-autosuggest\"\n trailingElement={(\n <Icon\n src={Search}\n />\n )}\n className=\"container-mw-xs\"\n >\n {skills?.map(skill => (\n <Form.AutosuggestOption key={skill.value} id={skill.value.replaceAll(' ', '-').toLowerCase()}>\n {skill.value}\n </Form.AutosuggestOption>\n ))}\n </Form.Autosuggest>\n );\n};\n\nexport default InterestsDeclaredAutosuggest;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.js
CHANGED
|
@@ -1,15 +1,55 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Stepper, Button, Form, Chip } from '@openedx/paragon';
|
|
4
|
+
import { Close } from '@openedx/paragon/icons';
|
|
3
5
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
-
import BaseStep from '../BaseStep';
|
|
5
6
|
import { useProgressiveProfilingQuiz } from '../../../../../../widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';
|
|
6
7
|
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
8
|
+
import BaseStep from '../BaseStep';
|
|
9
|
+
import InterestsDeclaredAutosuggest from './InterestsDeclaredAutosuggest';
|
|
10
|
+
import { useSkills } from '../../../../../../widgets/ProgressiveProfilingQuiz/data';
|
|
11
|
+
import { buildAnswerRecord } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/schemaUtils';
|
|
12
|
+
import buildInterestsDeclaredSchema from './schema';
|
|
13
|
+
const EMPTY_AUTOSUGGEST_VALUE = {
|
|
14
|
+
userProvidedText: '',
|
|
15
|
+
selectionValue: '',
|
|
16
|
+
selectionId: '',
|
|
17
|
+
};
|
|
7
18
|
import stepMessages from '../messages';
|
|
8
19
|
import messages from './messages';
|
|
20
|
+
import './index.scss';
|
|
9
21
|
const InterestsDeclaredStep = () => {
|
|
10
|
-
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const { goToPreviousStep, goToNextStep, answers, recordAnswer, } = useProgressiveProfilingQuiz();
|
|
11
24
|
const { formatMessage } = useIntl();
|
|
12
|
-
|
|
25
|
+
const [inputValue, setInputValue] = useState(EMPTY_AUTOSUGGEST_VALUE);
|
|
26
|
+
const { data: skills } = useSkills();
|
|
27
|
+
const schema = buildInterestsDeclaredSchema(skills !== null && skills !== void 0 ? skills : []);
|
|
28
|
+
const interestInput = (_b = (_a = answers[schema.questionId]) === null || _a === void 0 ? void 0 : _a.selectedValues) !== null && _b !== void 0 ? _b : [];
|
|
29
|
+
const addInterest = (value) => {
|
|
30
|
+
if (interestInput.includes(value)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
recordAnswer(buildAnswerRecord(schema, [...interestInput, value], formatMessage));
|
|
34
|
+
};
|
|
35
|
+
const removeInterest = (value) => {
|
|
36
|
+
const newInterestInput = interestInput.filter(item => value !== item);
|
|
37
|
+
recordAnswer(buildAnswerRecord(schema, newInterestInput, formatMessage));
|
|
38
|
+
};
|
|
39
|
+
const handleAutosuggestChange = (value) => {
|
|
40
|
+
setInputValue(value);
|
|
41
|
+
if (value.selectionValue) {
|
|
42
|
+
addInterest(value.selectionValue);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const handleCheckboxTopicToggle = (event) => {
|
|
46
|
+
const { value, checked } = event.target;
|
|
47
|
+
const nextValues = checked
|
|
48
|
+
? [...interestInput, value]
|
|
49
|
+
: interestInput.filter((interest) => interest !== value);
|
|
50
|
+
recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));
|
|
51
|
+
};
|
|
52
|
+
return (_jsxs(_Fragment, { children: [_jsxs(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED, title: formatMessage(messages.title), index: 2, children: [_jsx("h4", { children: formatMessage(messages.question) }), _jsx("p", { children: formatMessage(messages.subtitle) }), _jsxs("div", { className: "d-flex flex-column gap-2", children: [_jsx(InterestsDeclaredAutosuggest, { inputValue: inputValue, onChange: handleAutosuggestChange, skills: skills }), _jsx("div", { children: interestInput.map(interest => (_jsx(Chip, { iconAfter: Close, iconAfterAlt: formatMessage(messages.removeInterestIconAlt), variant: "dark", onIconAfterClick: () => removeInterest(interest), children: interest }, interest))) }), _jsx("p", { className: "font-weight-bold", children: formatMessage(messages.popularTopicsLabel) }), _jsx(Form.CheckboxSet, { name: "interests-declared-topics", isInline: true, value: interestInput, onChange: handleCheckboxTopicToggle, className: "interests-declared-checkbox-set", children: skills === null || skills === void 0 ? void 0 : skills.slice(0, 10).map(skill => (_jsx(Form.Checkbox, { value: skill.value, className: "ml-0 mr-3", children: skill.value }, skill.value))) })] })] }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED, children: [_jsx(Button, { variant: "outline-primary", onClick: goToPreviousStep, children: formatMessage(stepMessages.backButton) }), _jsx(Button, { onClick: goToNextStep, children: formatMessage(stepMessages.nextButton) })] })] }));
|
|
13
53
|
};
|
|
14
54
|
export default InterestsDeclaredStep;
|
|
15
55
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/index.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,4BAAkD,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F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AC,QAAQ,CAAC,qBAAqB,CAAC,EAC3D,OAAO,EAAC,MAAM,EACd,gBAAgB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,YAE/C,QAAQ,IANJ,QAAQ,CAOR,CACR,CAAC,GACE,EACN,YAAG,SAAS,EAAC,kBAAkB,YAAE,aAAa,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAK,EAChF,KAAC,IAAI,CAAC,WAAW,IACf,IAAI,EAAC,2BAA2B,EAChC,QAAQ,QACR,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,yBAAyB,EACnC,SAAS,EAAC,iCAAiC,YAE1C,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CACjC,KAAC,IAAI,CAAC,QAAQ,IAAmB,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,EAAC,WAAW,YACvE,KAAK,CAAC,KAAK,IADM,KAAK,CAAC,KAAK,CAEf,CACjB,CAAC,GACe,IACf,IACG,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,kBAAkB,aAC9E,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,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, { useState } from 'react';\nimport { Stepper, Button, Form, Chip } from '@openedx/paragon';\nimport { Close } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport BaseStep from '../BaseStep';\nimport InterestsDeclaredAutosuggest, { AutosuggestValue } from './InterestsDeclaredAutosuggest';\nimport { useSkills } from '@src/widgets/ProgressiveProfilingQuiz/data';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport buildInterestsDeclaredSchema from './schema';\n\nconst EMPTY_AUTOSUGGEST_VALUE: AutosuggestValue = {\n userProvidedText: '',\n selectionValue: '',\n selectionId: '',\n};\n\nimport stepMessages from '../messages';\nimport messages from './messages';\n\nimport './index.scss';\n\nconst InterestsDeclaredStep: React.FC = () => {\n const {\n goToPreviousStep, goToNextStep, answers, recordAnswer,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const [inputValue, setInputValue] = useState<AutosuggestValue>(EMPTY_AUTOSUGGEST_VALUE);\n\n const { data: skills } = useSkills();\n const schema = buildInterestsDeclaredSchema(skills ?? []);\n const interestInput = answers[schema.questionId]?.selectedValues ?? [];\n\n const addInterest = (value: string) => {\n if (interestInput.includes(value)) {\n return;\n }\n recordAnswer(buildAnswerRecord(schema, [...interestInput, value], formatMessage));\n };\n\n const removeInterest = (value: string) => {\n const newInterestInput = interestInput.filter(item => value !== item);\n recordAnswer(buildAnswerRecord(schema, newInterestInput, formatMessage));\n };\n\n const handleAutosuggestChange = (value: AutosuggestValue) => {\n setInputValue(value);\n\n if (value.selectionValue) {\n addInterest(value.selectionValue);\n }\n };\n\n const handleCheckboxTopicToggle = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { value, checked } = event.target;\n\n const nextValues = checked\n ? [...interestInput, value]\n : interestInput.filter((interest) => interest !== value);\n recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED}\n title={formatMessage(messages.title)}\n index={2}\n >\n <h4>{formatMessage(messages.question)}</h4>\n <p>{formatMessage(messages.subtitle)}</p>\n <div className=\"d-flex flex-column gap-2\">\n <InterestsDeclaredAutosuggest\n inputValue={inputValue}\n onChange={handleAutosuggestChange}\n skills={skills}\n />\n <div>\n {interestInput.map(interest => (\n <Chip\n key={interest}\n iconAfter={Close}\n iconAfterAlt={formatMessage(messages.removeInterestIconAlt)}\n variant=\"dark\"\n onIconAfterClick={() => removeInterest(interest)}\n >\n {interest}\n </Chip>\n ))}\n </div>\n <p className=\"font-weight-bold\">{formatMessage(messages.popularTopicsLabel)}</p>\n <Form.CheckboxSet\n name=\"interests-declared-topics\"\n isInline\n value={interestInput}\n onChange={handleCheckboxTopicToggle}\n className=\"interests-declared-checkbox-set\"\n >\n {skills?.slice(0, 10).map(skill => (\n <Form.Checkbox key={skill.value} value={skill.value} className=\"ml-0 mr-3\">\n {skill.value}\n </Form.Checkbox>\n ))}\n </Form.CheckboxSet>\n </div>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED}>\n <Button variant=\"outline-primary\" onClick={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"]}
|
|
@@ -9,5 +9,20 @@ declare const messages: {
|
|
|
9
9
|
defaultMessage: string;
|
|
10
10
|
description: string;
|
|
11
11
|
};
|
|
12
|
+
subtitle: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
popularTopicsLabel: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
removeInterestIconAlt: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
12
27
|
};
|
|
13
28
|
export default messages;
|
|
@@ -10,6 +10,21 @@ const messages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'What do you want to learn?',
|
|
11
11
|
description: 'Question asked in the interests step of the progressive profiling quiz',
|
|
12
12
|
},
|
|
13
|
+
subtitle: {
|
|
14
|
+
id: 'progressiveProfilingQuiz.stepper.interestsDeclared.subtitle',
|
|
15
|
+
defaultMessage: 'Choose from the list below or search for a subject or skill you want to study.',
|
|
16
|
+
description: 'Subtitle text shown below the question in the interests step of the progressive profiling quiz',
|
|
17
|
+
},
|
|
18
|
+
popularTopicsLabel: {
|
|
19
|
+
id: 'progressiveProfilingQuiz.stepper.interestsDeclared.popularTopicsLabel',
|
|
20
|
+
defaultMessage: 'Popular topics',
|
|
21
|
+
description: 'Label for the list of popular topic checkboxes in the interests step of the progressive profiling quiz',
|
|
22
|
+
},
|
|
23
|
+
removeInterestIconAlt: {
|
|
24
|
+
id: 'progressiveProfilingQuiz.stepper.interestsDeclared.removeInterestIconAlt',
|
|
25
|
+
defaultMessage: 'close',
|
|
26
|
+
description: 'Alt text for the icon on a selected interest chip that removes the interest when clicked',
|
|
27
|
+
},
|
|
13
28
|
});
|
|
14
29
|
export default messages;
|
|
15
30
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +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"]}
|
|
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;IACD,QAAQ,EAAE;QACR,EAAE,EAAE,6DAA6D;QACjE,cAAc,EAAE,gFAAgF;QAChG,WAAW,EAAE,gGAAgG;KAC9G;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,uEAAuE;QAC3E,cAAc,EAAE,gBAAgB;QAChC,WAAW,EAAE,wGAAwG;KACtH;IACD,qBAAqB,EAAE;QACrB,EAAE,EAAE,0EAA0E;QAC9E,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,0FAA0F;KACxG;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 subtitle: {\n id: 'progressiveProfilingQuiz.stepper.interestsDeclared.subtitle',\n defaultMessage: 'Choose from the list below or search for a subject or skill you want to study.',\n description: 'Subtitle text shown below the question in the interests step of the progressive profiling quiz',\n },\n popularTopicsLabel: {\n id: 'progressiveProfilingQuiz.stepper.interestsDeclared.popularTopicsLabel',\n defaultMessage: 'Popular topics',\n description: 'Label for the list of popular topic checkboxes in the interests step of the progressive profiling quiz',\n },\n removeInterestIconAlt: {\n id: 'progressiveProfilingQuiz.stepper.interestsDeclared.removeInterestIconAlt',\n defaultMessage: 'close',\n description: 'Alt text for the icon on a selected interest chip that removes the interest when clicked',\n },\n});\n\nexport default messages;\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { QuizQuestionSchema, SkillWithCount } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/types';
|
|
2
|
+
export declare const VERSION = "1.0.0";
|
|
3
|
+
/**
|
|
4
|
+
* IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL
|
|
5
|
+
* For typos and small adjustments, use patch version.
|
|
6
|
+
* For any other changes, use minor versions unless it's been clearly indicated otherwise.
|
|
7
|
+
*
|
|
8
|
+
* Unlike the other steps, this question's options aren't static copy — they're skill values
|
|
9
|
+
* fetched from Algolia, so the schema can't be built until those skills are available. Build it
|
|
10
|
+
* from whatever skills were fetched when the user reached this step, so the persisted answer
|
|
11
|
+
* stays a faithful record of what was actually offered.
|
|
12
|
+
*
|
|
13
|
+
* Each option's `message` is a synthetic descriptor rather than a translatable one from
|
|
14
|
+
* `messages.ts` — skill names are data, not copy, so there's nothing to translate. `formatMessage`
|
|
15
|
+
* simply falls back to `defaultMessage` for an id with no matching translation.
|
|
16
|
+
*/
|
|
17
|
+
declare const buildInterestsDeclaredSchema: (skills: SkillWithCount[]) => QuizQuestionSchema;
|
|
18
|
+
export default buildInterestsDeclaredSchema;
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/schema.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
2
|
+
import messages from './messages';
|
|
3
|
+
export const VERSION = '1.0.0';
|
|
4
|
+
/**
|
|
5
|
+
* IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL
|
|
6
|
+
* For typos and small adjustments, use patch version.
|
|
7
|
+
* For any other changes, use minor versions unless it's been clearly indicated otherwise.
|
|
8
|
+
*
|
|
9
|
+
* Unlike the other steps, this question's options aren't static copy — they're skill values
|
|
10
|
+
* fetched from Algolia, so the schema can't be built until those skills are available. Build it
|
|
11
|
+
* from whatever skills were fetched when the user reached this step, so the persisted answer
|
|
12
|
+
* stays a faithful record of what was actually offered.
|
|
13
|
+
*
|
|
14
|
+
* Each option's `message` is a synthetic descriptor rather than a translatable one from
|
|
15
|
+
* `messages.ts` — skill names are data, not copy, so there's nothing to translate. `formatMessage`
|
|
16
|
+
* simply falls back to `defaultMessage` for an id with no matching translation.
|
|
17
|
+
*/
|
|
18
|
+
const buildInterestsDeclaredSchema = (skills) => ({
|
|
19
|
+
questionId: PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED,
|
|
20
|
+
version: VERSION,
|
|
21
|
+
question: messages.question,
|
|
22
|
+
options: skills.map(skill => ({
|
|
23
|
+
value: skill.value,
|
|
24
|
+
message: {
|
|
25
|
+
id: `progressiveProfilingQuiz.stepper.interestsDeclared.skillOption.${skill.value}`,
|
|
26
|
+
defaultMessage: skill.value,
|
|
27
|
+
},
|
|
28
|
+
})),
|
|
29
|
+
});
|
|
30
|
+
export default buildInterestsDeclaredSchema;
|
|
31
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-interests-declared/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B;;;;;;;;;;;;;GAaG;AACH,MAAM,4BAA4B,GAAG,CAAC,MAAwB,EAAsB,EAAE,CAAC,CAAC;IACtF,UAAU,EAAE,gCAAgC,CAAC,kBAAkB;IAC/D,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;IAC3B,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE;YACP,EAAE,EAAE,kEAAkE,KAAK,CAAC,KAAK,EAAE;YACnF,cAAc,EAAE,KAAK,CAAC,KAAK;SAC5B;KACF,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,eAAe,4BAA4B,CAAC","sourcesContent":["import { QuizQuestionSchema, SkillWithCount } from '@src/widgets/ProgressiveProfilingQuiz/data/types';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport messages from './messages';\n\nexport const VERSION = '1.0.0';\n\n/**\n * IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL\n * For typos and small adjustments, use patch version.\n * For any other changes, use minor versions unless it's been clearly indicated otherwise.\n *\n * Unlike the other steps, this question's options aren't static copy — they're skill values\n * fetched from Algolia, so the schema can't be built until those skills are available. Build it\n * from whatever skills were fetched when the user reached this step, so the persisted answer\n * stays a faithful record of what was actually offered.\n *\n * Each option's `message` is a synthetic descriptor rather than a translatable one from\n * `messages.ts` — skill names are data, not copy, so there's nothing to translate. `formatMessage`\n * simply falls back to `defaultMessage` for an id with no matching translation.\n */\nconst buildInterestsDeclaredSchema = (skills: SkillWithCount[]): QuizQuestionSchema => ({\n questionId: PROGRESSIVE_PROFILING_QUIZ_STEPS.INTERESTS_DECLARED,\n version: VERSION,\n question: messages.question,\n options: skills.map(skill => ({\n value: skill.value,\n message: {\n id: `progressiveProfilingQuiz.stepper.interestsDeclared.skillOption.${skill.value}`,\n defaultMessage: skill.value,\n },\n })),\n});\n\nexport default buildInterestsDeclaredSchema;\n"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js
CHANGED
|
@@ -23,7 +23,7 @@ const LearningGoalStep = () => {
|
|
|
23
23
|
}
|
|
24
24
|
(_a = event.currentTarget.querySelector('input[type="radio"]')) === null || _a === void 0 ? void 0 : _a.click();
|
|
25
25
|
};
|
|
26
|
-
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL, title: formatMessage(messages.title), index: 0, optionalHeaderText: formatMessage(messages.headerText), children: _jsxs(Form.Group, { className: "mb-0", children: [_jsx(Form.Label, { className: "h4", children: formatMessage(messages.question) }), _jsx("p", { children:
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL, title: formatMessage(messages.title), index: 0, optionalHeaderText: formatMessage(messages.headerText), children: _jsxs(Form.Group, { className: "mb-0", children: [_jsx(Form.Label, { className: "h4", children: formatMessage(messages.question) }), _jsx("p", { children: "Select one" }), _jsx(Form.RadioSet, { name: schema.questionId, value: selectedValue, onChange: handleChange, className: "gap-4", children: schema.options.map(option => (_jsx("div", { className: "learning-goal-radio d-flex bg-light-100 px-3 py-3.5 mt-0", onClick: handleOptionClick, children: _jsx(Form.Radio, { value: option.value, children: formatMessage(option.message) }) }, option.value))) })] }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL, children: [_jsx(Stepper.ActionRow.Spacer, {}), _jsx(Button, { variant: "outline-primary", onClick: goToNextStep, disabled: !selectedValue, children: formatMessage(messages.continueButton) })] })] }));
|
|
27
27
|
};
|
|
28
28
|
export default LearningGoalStep;
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,OAAO,EAAE,MAAM,EAAE,IAAI,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,cAAc,CAAC;AAEtB,MAAM,gBAAgB,GAAa,GAAG,EAAE;;IACtC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,2BAA2B,EAAE,CAAC;IAC9E,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,aAAa,GAAG,MAAA,MAAA,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,0CAAE,cAAc,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC;IAE1E,MAAM,YAAY,GAAG,CAAC,KAA0C,EAAE,EAAE;QAClE,YAAY,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,KAAuC,EAAE,EAAE;;QACpE,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,aAAa,EAAE,CAAC;YACzC,OAAO;QACT,CAAC;QACD,MAAA,KAAK,CAAC,aAAa,CAAC,aAAa,CAAmB,qBAAqB,CAAC,0CAAE,KAAK,EAAE,CAAC;IACtF,CAAC,CAAC;IAEF,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,MAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,MAAM,aAC1B,KAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,IAAI,YACvB,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GACtB,EACb,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-goal/index.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,OAAO,EAAE,MAAM,EAAE,IAAI,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAA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C,IAAI,CAAC,QAAQ,IACZ,IAAI,EAAE,MAAM,CAAC,UAAU,EACvB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAC,OAAO,YAEhB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAC5B,cAEE,SAAS,EAAC,0DAA0D,EACpE,OAAO,EAAE,iBAAiB,YAE1B,KAAC,IAAI,CAAC,KAAK,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,YAC5B,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,GACnB,IANR,MAAM,CAAC,KAAK,CAOb,CACP,CAAC,GACY,IACL,GACJ,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,EAAE,QAAQ,EAAE,CAAC,aAAa,YAC9E,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["import React from 'react';\nimport {\n Stepper, Button, Form,\n} from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport BaseStep from '../BaseStep';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport messages from './messages';\nimport schema from './schema';\n\nimport './index.scss';\n\nconst LearningGoalStep: React.FC = () => {\n const { goToNextStep, answers, recordAnswer } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const selectedValue = answers[schema.questionId]?.selectedValues[0] ?? '';\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n recordAnswer(buildAnswerRecord(schema, [event.target.value], formatMessage));\n };\n\n const handleOptionClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"radio\"]')?.click();\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL}\n title={formatMessage(messages.title)}\n index={0}\n optionalHeaderText={formatMessage(messages.headerText)}\n >\n <Form.Group className=\"mb-0\">\n <Form.Label className=\"h4\">\n {formatMessage(messages.question)}\n </Form.Label>\n <p>Select one</p>\n <Form.RadioSet\n name={schema.questionId}\n value={selectedValue}\n onChange={handleChange}\n className=\"gap-4\"\n >\n {schema.options.map(option => (\n <div\n key={option.value}\n className=\"learning-goal-radio d-flex bg-light-100 px-3 py-3.5 mt-0\"\n onClick={handleOptionClick}\n >\n <Form.Radio value={option.value}>\n {formatMessage(option.message)}\n </Form.Radio>\n </div>\n ))}\n </Form.RadioSet>\n </Form.Group>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_GOAL}>\n <Stepper.ActionRow.Spacer />\n <Button variant=\"outline-primary\" onClick={goToNextStep} disabled={!selectedValue}>\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-motivation/index.js
CHANGED
|
@@ -28,7 +28,7 @@ const LearningMotivationStep = () => {
|
|
|
28
28
|
}
|
|
29
29
|
(_a = event.currentTarget.querySelector('input[type="checkbox"]')) === null || _a === void 0 ? void 0 : _a.click();
|
|
30
30
|
};
|
|
31
|
-
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION, title: formatMessage(messages.title), index: 1, children: _jsxs(Form.Group, { className: "mb-0", children: [_jsx(Form.Label, { className: "h4", children: formatMessage(messages.question) }), _jsx("p", { children:
|
|
31
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION, title: formatMessage(messages.title), index: 1, children: _jsxs(Form.Group, { className: "mb-0", children: [_jsx(Form.Label, { className: "h4", children: formatMessage(messages.question) }), _jsx("p", { children: "Select one or more" }), _jsx(Form.CheckboxSet, { name: schema.questionId, value: selectedValues, onChange: handleChange, className: "gap-4", children: schema.options.map(option => (_jsx("div", { className: "learning-motivation-checkbox d-flex bg-light-100 px-3 py-3.5 mt-0", onClick: handleOptionClick, children: _jsx(Form.Checkbox, { value: option.value, children: formatMessage(option.message) }) }, option.value))) })] }) }), _jsxs(Stepper.ActionRow, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION, children: [_jsx(Button, { variant: "outline-primary", onClick: goToPreviousStep, children: formatMessage(stepMessages.backButton) }), _jsx(Button, { onClick: goToNextStep, disabled: selectedValues.length === 0, className: "ml-3", children: formatMessage(stepMessages.nextButton) })] })] }));
|
|
32
32
|
};
|
|
33
33
|
export default LearningMotivationStep;
|
|
34
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,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CAAgC,CAAC,mBAAmB,EAC9D,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EACpC,KAAK,EAAE,CAAC,YAER,MAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,MAAM,aAC1B,KAAC,IAAI,CAAC,KAAK,IAAC,SAAS,EAAC,IAAI,YACvB,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,GACtB,EACb,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-learning-motivation/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,cAAc,CAAC;AAEtB,MAAM,sBAAsB,GAAa,GAAG,EAAE;;IAC5C,MAAM,EACJ,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,GACtD,GAAG,2BAA2B,EAAE,CAAC;IAClC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,CAAC;IAEpC,MAAM,cAAc,GAAG,MAAA,MAAA,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,0CAAE,cAAc,mCAAI,EAAE,CAAC;IAExE,MAAM,YAAY,GAAG,CAAC,KAA0C,EAAE,EAAE;QAClE,MAAM,EAAE,OAAO,EAAE,KAAK,EAA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,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,GAChB,IANX,MAAM,CAAC,KAAK,CAOb,CACP,CAAC,GACe,IACR,GACJ,EACX,MAAC,OAAO,CAAC,SAAS,IAAC,QAAQ,EAAE,gCAAgC,CAAC,mBAAmB,aAC/E,KAAC,MAAM,IAAC,OAAO,EAAC,iBAAiB,EAAC,OAAO,EAAE,gBAAgB,YACxD,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,EACT,KAAC,MAAM,IAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,SAAS,EAAC,MAAM,YACnF,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,GAChC,IACS,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import React from 'react';\nimport { Stepper, Button, Form } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport BaseStep from '../BaseStep';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport stepMessages from '../messages';\nimport messages from './messages';\nimport schema from './schema';\n\nimport './index.scss';\n\nconst LearningMotivationStep: React.FC = () => {\n const {\n goToPreviousStep, goToNextStep, answers, recordAnswer,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const selectedValues = answers[schema.questionId]?.selectedValues ?? [];\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { checked, value } = event.target;\n const nextValues = checked\n ? [...selectedValues, value]\n : selectedValues.filter(selectedValue => selectedValue !== value);\n recordAnswer(buildAnswerRecord(schema, nextValues, formatMessage));\n };\n\n const handleOptionClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n event.currentTarget.querySelector<HTMLInputElement>('input[type=\"checkbox\"]')?.click();\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}\n title={formatMessage(messages.title)}\n index={1}\n >\n <Form.Group className=\"mb-0\">\n <Form.Label className=\"h4\">\n {formatMessage(messages.question)}\n </Form.Label>\n <p>Select one or more</p>\n <Form.CheckboxSet\n name={schema.questionId}\n value={selectedValues}\n onChange={handleChange}\n className=\"gap-4\"\n >\n {schema.options.map(option => (\n <div\n key={option.value}\n className=\"learning-motivation-checkbox d-flex bg-light-100 px-3 py-3.5 mt-0\"\n onClick={handleOptionClick}\n >\n <Form.Checkbox value={option.value}>\n {formatMessage(option.message)}\n </Form.Checkbox>\n </div>\n ))}\n </Form.CheckboxSet>\n </Form.Group>\n </BaseStep>\n <Stepper.ActionRow eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.LEARNING_MOTIVATION}>\n <Button variant=\"outline-primary\" onClick={goToPreviousStep}>\n {formatMessage(stepMessages.backButton)}\n </Button>\n <Button onClick={goToNextStep} disabled={selectedValues.length === 0} className=\"ml-3\">\n {formatMessage(stepMessages.nextButton)}\n </Button>\n </Stepper.ActionRow>\n </>\n );\n};\n\nexport default LearningMotivationStep;\n"]}
|