@edx/frontend-app-subscription-learner-dashboard 1.39.0 → 1.40.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/widgets/ProgressiveProfilingQuiz/data/types.d.ts +6 -0
- package/dist/widgets/ProgressiveProfilingQuiz/data/types.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.js +30 -4
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.d.ts +10 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.js +10 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.js.map +1 -1
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/schema.d.ts +13 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/schema.js +30 -0
- package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/schema.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,6 +3,12 @@ export interface SkillWithCount {
|
|
|
3
3
|
value: string;
|
|
4
4
|
count: number;
|
|
5
5
|
}
|
|
6
|
+
/** The value shape Paragon's `Form.Autosuggest` reads from and calls `onChange` with. */
|
|
7
|
+
export interface AutosuggestValue {
|
|
8
|
+
userProvidedText: string;
|
|
9
|
+
selectionValue: string;
|
|
10
|
+
selectionId: string;
|
|
11
|
+
}
|
|
6
12
|
/** Structurally compatible with react-intl's MessageDescriptor, without depending on the package directly. */
|
|
7
13
|
export interface QuizMessageDescriptor {
|
|
8
14
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/data/types.ts"],"names":[],"mappings":"","sourcesContent":["/** A single Algolia facet value with its matching record count, e.g. from fetchSkills. */\nexport interface SkillWithCount {\n value: string,\n count: number,\n}\n\n/** Structurally compatible with react-intl's MessageDescriptor, without depending on the package directly. */\nexport interface QuizMessageDescriptor {\n id: string,\n defaultMessage: string,\n description?: string,\n}\n\n/** A selectable option for a quiz question, as defined in source (unresolved) form. */\nexport interface QuizAnswerOption {\n value: string,\n message: QuizMessageDescriptor,\n}\n\n/**\n * The definition of a quiz question: its identity, the question text, and every option offered.\n * This is the single source of truth used both to render a step's UI and to record what was\n * actually shown to the user when they answered it.\n */\nexport interface QuizQuestionSchema {\n questionId: string,\n /** Bump whenever the question or its options change meaningfully, so recorded answers can be grouped by what was actually asked. */\n version: string,\n question: QuizMessageDescriptor,\n options: QuizAnswerOption[],\n}\n\n/** A resolved (formatted) option, as actually presented to the user. */\nexport interface QuizAnswerOptionRecord {\n value: string,\n label: string,\n}\n\n/**\n * A snapshot of a question, its options, and the user's selection(s), as it existed at answer\n * time. Always an array so single-select (radio) and multi-select (checkbox) questions share one\n * shape — a single-select answer is simply a one-element array.\n */\nexport interface QuizAnswerRecord {\n questionId: string,\n version: string,\n question: string,\n options: QuizAnswerOptionRecord[],\n selectedValues: string[],\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/widgets/ProgressiveProfilingQuiz/data/types.ts"],"names":[],"mappings":"","sourcesContent":["/** A single Algolia facet value with its matching record count, e.g. from fetchSkills. */\nexport interface SkillWithCount {\n value: string,\n count: number,\n}\n\n/** The value shape Paragon's `Form.Autosuggest` reads from and calls `onChange` with. */\nexport interface AutosuggestValue {\n userProvidedText: string,\n selectionValue: string,\n selectionId: string,\n}\n\n/** Structurally compatible with react-intl's MessageDescriptor, without depending on the package directly. */\nexport interface QuizMessageDescriptor {\n id: string,\n defaultMessage: string,\n description?: string,\n}\n\n/** A selectable option for a quiz question, as defined in source (unresolved) form. */\nexport interface QuizAnswerOption {\n value: string,\n message: QuizMessageDescriptor,\n}\n\n/**\n * The definition of a quiz question: its identity, the question text, and every option offered.\n * This is the single source of truth used both to render a step's UI and to record what was\n * actually shown to the user when they answered it.\n */\nexport interface QuizQuestionSchema {\n questionId: string,\n /** Bump whenever the question or its options change meaningfully, so recorded answers can be grouped by what was actually asked. */\n version: string,\n question: QuizMessageDescriptor,\n options: QuizAnswerOption[],\n}\n\n/** A resolved (formatted) option, as actually presented to the user. */\nexport interface QuizAnswerOptionRecord {\n value: string,\n label: string,\n}\n\n/**\n * A snapshot of a question, its options, and the user's selection(s), as it existed at answer\n * time. Always an array so single-select (radio) and multi-select (checkbox) questions share one\n * shape — a single-select answer is simply a one-element array.\n */\nexport interface QuizAnswerRecord {\n questionId: string,\n version: string,\n question: string,\n options: QuizAnswerOptionRecord[],\n selectedValues: string[],\n}\n"]}
|
|
@@ -1,15 +1,41 @@
|
|
|
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 } from '@openedx/paragon';
|
|
3
4
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
-
import BaseStep from '../BaseStep';
|
|
5
5
|
import { useProgressiveProfilingQuiz } from '../../../../../../widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';
|
|
6
6
|
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
7
|
+
import { buildAnswerRecord } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/schemaUtils';
|
|
8
|
+
import jobsList from '../../../../../../widgets/ProgressiveProfilingQuiz/data/jobsList';
|
|
9
|
+
import BaseStep from '../BaseStep';
|
|
7
10
|
import stepMessages from '../messages';
|
|
8
11
|
import messages from './messages';
|
|
12
|
+
import schema, { NOT_EMPLOYED_VALUE } from './schema';
|
|
13
|
+
const EMPTY_AUTOSUGGEST_VALUE = {
|
|
14
|
+
userProvidedText: '',
|
|
15
|
+
selectionValue: '',
|
|
16
|
+
selectionId: '',
|
|
17
|
+
};
|
|
9
18
|
const WorkStatusStep = () => {
|
|
10
|
-
|
|
19
|
+
var _a, _b;
|
|
20
|
+
const { goToPreviousStep, answers, recordAnswer, } = useProgressiveProfilingQuiz();
|
|
11
21
|
const { formatMessage } = useIntl();
|
|
12
|
-
|
|
22
|
+
const [inputValue, setInputValue] = useState(EMPTY_AUTOSUGGEST_VALUE);
|
|
23
|
+
const selectedValue = (_b = (_a = answers[schema.questionId]) === null || _a === void 0 ? void 0 : _a.selectedValues[0]) !== null && _b !== void 0 ? _b : '';
|
|
24
|
+
const isNotEmployed = selectedValue === NOT_EMPLOYED_VALUE;
|
|
25
|
+
const handleJobSelect = (value) => {
|
|
26
|
+
setInputValue(value);
|
|
27
|
+
if (value.selectionValue) {
|
|
28
|
+
recordAnswer(buildAnswerRecord(schema, [value.selectionValue], formatMessage));
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const handleNotEmployedToggle = (event) => {
|
|
32
|
+
const { checked } = event.target;
|
|
33
|
+
if (checked) {
|
|
34
|
+
setInputValue(EMPTY_AUTOSUGGEST_VALUE);
|
|
35
|
+
}
|
|
36
|
+
recordAnswer(buildAnswerRecord(schema, checked ? [NOT_EMPLOYED_VALUE] : [], formatMessage));
|
|
37
|
+
};
|
|
38
|
+
return (_jsxs(_Fragment, { children: [_jsxs(BaseStep, { eventKey: PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS, title: formatMessage(messages.title), index: 3, children: [_jsx("h4", { children: formatMessage(messages.question) }), _jsx("p", { children: formatMessage(messages.subtitle) }), _jsx(Form.Autosuggest, { name: "work-status-autosuggest", value: inputValue, onChange: handleJobSelect, className: "h-50", children: jobsList === null || jobsList === void 0 ? void 0 : jobsList.map(job => (_jsx(Form.AutosuggestOption, { id: job.jobTitle.replaceAll(' ', '-').toLowerCase(), children: job.jobTitle }, job.jobTitle))) }), _jsx(Form.Checkbox, { className: "mt-6", checked: isNotEmployed, onChange: handleNotEmployedToggle, children: formatMessage(messages.notEmployedOption) })] }), _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
39
|
};
|
|
14
40
|
export default WorkStatusStep;
|
|
15
41
|
//# sourceMappingURL=index.js.map
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/index.tsx"],"names":[],"mappings":"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","sourcesContent":["import React, { useState } from 'react';\nimport { Stepper, Button, Form } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport { useProgressiveProfilingQuiz } from '@src/widgets/ProgressiveProfilingQuiz/ProgressiveProfilingQuizProvider';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { AutosuggestValue } from '@src/widgets/ProgressiveProfilingQuiz/data';\nimport { buildAnswerRecord } from '@src/widgets/ProgressiveProfilingQuiz/data/schemaUtils';\nimport jobsList from '@src/widgets/ProgressiveProfilingQuiz/data/jobsList';\nimport BaseStep from '../BaseStep';\nimport stepMessages from '../messages';\nimport messages from './messages';\nimport schema, { NOT_EMPLOYED_VALUE } from './schema';\n\nconst EMPTY_AUTOSUGGEST_VALUE: AutosuggestValue = {\n userProvidedText: '',\n selectionValue: '',\n selectionId: '',\n};\n\nconst WorkStatusStep: React.FC = () => {\n const {\n goToPreviousStep, answers, recordAnswer,\n } = useProgressiveProfilingQuiz();\n const { formatMessage } = useIntl();\n\n const [inputValue, setInputValue] = useState<AutosuggestValue>(EMPTY_AUTOSUGGEST_VALUE);\n\n const selectedValue = answers[schema.questionId]?.selectedValues[0] ?? '';\n const isNotEmployed = selectedValue === NOT_EMPLOYED_VALUE;\n\n const handleJobSelect = (value: AutosuggestValue) => {\n setInputValue(value);\n\n if (value.selectionValue) {\n recordAnswer(buildAnswerRecord(schema, [value.selectionValue], formatMessage));\n }\n };\n\n const handleNotEmployedToggle = (event: React.ChangeEvent<HTMLInputElement>) => {\n const { checked } = event.target;\n\n if (checked) {\n setInputValue(EMPTY_AUTOSUGGEST_VALUE);\n }\n recordAnswer(buildAnswerRecord(schema, checked ? [NOT_EMPLOYED_VALUE] : [], formatMessage));\n };\n\n return (\n <>\n <BaseStep\n eventKey={PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS}\n title={formatMessage(messages.title)}\n index={3}\n >\n <h4>\n {formatMessage(messages.question)}\n </h4>\n <p>\n {formatMessage(messages.subtitle)}\n </p>\n <Form.Autosuggest\n name=\"work-status-autosuggest\"\n value={inputValue}\n onChange={handleJobSelect}\n className=\"h-50\"\n >\n {jobsList?.map(job => (\n <Form.AutosuggestOption\n key={job.jobTitle}\n id={job.jobTitle.replaceAll(' ', '-').toLowerCase()}\n >\n {job.jobTitle}\n </Form.AutosuggestOption>\n ))}\n </Form.Autosuggest>\n <Form.Checkbox\n className=\"mt-6\"\n checked={isNotEmployed}\n onChange={handleNotEmployedToggle}\n >\n {formatMessage(messages.notEmployedOption)}\n </Form.Checkbox>\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
CHANGED
|
@@ -9,6 +9,16 @@ 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
|
+
notEmployedOption: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
12
22
|
viewResultsButton: {
|
|
13
23
|
id: string;
|
|
14
24
|
defaultMessage: string;
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.js
CHANGED
|
@@ -10,6 +10,16 @@ const messages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'What is your current role?',
|
|
11
11
|
description: 'Question asked in the work status step of the progressive profiling quiz',
|
|
12
12
|
},
|
|
13
|
+
subtitle: {
|
|
14
|
+
id: 'progressiveProfilingQuiz.stepper.workStatus.subtitle',
|
|
15
|
+
defaultMessage: 'Find the job title that best matches your role.',
|
|
16
|
+
description: 'Subtitle text shown below the question in the work status step of the progressive profiling quiz',
|
|
17
|
+
},
|
|
18
|
+
notEmployedOption: {
|
|
19
|
+
id: 'progressiveProfilingQuiz.stepper.workStatus.notEmployedOption',
|
|
20
|
+
defaultMessage: 'Not employed',
|
|
21
|
+
description: 'Checkbox label for indicating the user is not currently employed, in the work status step of the progressive profiling quiz',
|
|
22
|
+
},
|
|
13
23
|
viewResultsButton: {
|
|
14
24
|
id: 'progressiveProfilingQuiz.stepper.workStatus.viewResultsButton',
|
|
15
25
|
defaultMessage: 'View Results',
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/messages.js.map
CHANGED
|
@@ -1 +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"]}
|
|
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,QAAQ,EAAE;QACR,EAAE,EAAE,sDAAsD;QAC1D,cAAc,EAAE,iDAAiD;QACjE,WAAW,EAAE,kGAAkG;KAChH;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,+DAA+D;QACnE,cAAc,EAAE,cAAc;QAC9B,WAAW,EAAE,6HAA6H;KAC3I;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 subtitle: {\n id: 'progressiveProfilingQuiz.stepper.workStatus.subtitle',\n defaultMessage: 'Find the job title that best matches your role.',\n description: 'Subtitle text shown below the question in the work status step of the progressive profiling quiz',\n },\n notEmployedOption: {\n id: 'progressiveProfilingQuiz.stepper.workStatus.notEmployedOption',\n defaultMessage: 'Not employed',\n description: 'Checkbox label for indicating the user is not currently employed, 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"]}
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/schema.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { QuizQuestionSchema } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/types';
|
|
2
|
+
export declare const NOT_EMPLOYED_VALUE = "not-employed";
|
|
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
|
+
* Like step 3's skills, job titles are data from `jobsList`, not translatable copy, so each gets
|
|
9
|
+
* a synthetic message descriptor whose `defaultMessage` is the job title itself. "Not employed" is
|
|
10
|
+
* genuine UI copy, so it uses a real message from `messages.ts` instead.
|
|
11
|
+
*/
|
|
12
|
+
declare const schema: QuizQuestionSchema;
|
|
13
|
+
export default schema;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/constants';
|
|
2
|
+
import { jobsList } from '../../../../../../widgets/ProgressiveProfilingQuiz/data/jobsList';
|
|
3
|
+
import messages from './messages';
|
|
4
|
+
export const NOT_EMPLOYED_VALUE = 'not-employed';
|
|
5
|
+
/**
|
|
6
|
+
* IF YOU CHANGE THE SCHEMA, MAKE SURE TO UPDATE THE VERSION AS WELL
|
|
7
|
+
* For typos and small adjustments, use patch version.
|
|
8
|
+
* For any other changes, use minor versions unless it's been clearly indicated otherwise.
|
|
9
|
+
*
|
|
10
|
+
* Like step 3's skills, job titles are data from `jobsList`, not translatable copy, so each gets
|
|
11
|
+
* a synthetic message descriptor whose `defaultMessage` is the job title itself. "Not employed" is
|
|
12
|
+
* genuine UI copy, so it uses a real message from `messages.ts` instead.
|
|
13
|
+
*/
|
|
14
|
+
const schema = {
|
|
15
|
+
questionId: PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS,
|
|
16
|
+
version: '1.0.0',
|
|
17
|
+
question: messages.question,
|
|
18
|
+
options: [
|
|
19
|
+
...jobsList.map(job => ({
|
|
20
|
+
value: job.jobTitle,
|
|
21
|
+
message: {
|
|
22
|
+
id: `progressiveProfilingQuiz.stepper.workStatus.jobOption.${job.jobTitle}`,
|
|
23
|
+
defaultMessage: job.jobTitle,
|
|
24
|
+
},
|
|
25
|
+
})),
|
|
26
|
+
{ value: NOT_EMPLOYED_VALUE, message: messages.notEmployedOption },
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
export default schema;
|
|
30
|
+
//# sourceMappingURL=schema.js.map
|
package/dist/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/schema.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../../src/widgets/ProgressiveProfilingQuiz/modal/stepper/steps/step-work-status/schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAC/E,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,MAAM,GAAuB;IACjC,UAAU,EAAE,gCAAgC,CAAC,WAAW;IACxD,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;IAC3B,OAAO,EAAE;QACP,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACtB,KAAK,EAAE,GAAG,CAAC,QAAQ;YACnB,OAAO,EAAE;gBACP,EAAE,EAAE,yDAAyD,GAAG,CAAC,QAAQ,EAAE;gBAC3E,cAAc,EAAE,GAAG,CAAC,QAAQ;aAC7B;SACF,CAAC,CAAC;QACH,EAAE,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,QAAQ,CAAC,iBAAiB,EAAE;KACnE;CACF,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import { QuizQuestionSchema } from '@src/widgets/ProgressiveProfilingQuiz/data/types';\nimport { PROGRESSIVE_PROFILING_QUIZ_STEPS } from '@src/widgets/ProgressiveProfilingQuiz/data/constants';\nimport { jobsList } from '@src/widgets/ProgressiveProfilingQuiz/data/jobsList';\nimport messages from './messages';\n\nexport const NOT_EMPLOYED_VALUE = 'not-employed';\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 * Like step 3's skills, job titles are data from `jobsList`, not translatable copy, so each gets\n * a synthetic message descriptor whose `defaultMessage` is the job title itself. \"Not employed\" is\n * genuine UI copy, so it uses a real message from `messages.ts` instead.\n */\nconst schema: QuizQuestionSchema = {\n questionId: PROGRESSIVE_PROFILING_QUIZ_STEPS.WORK_STATUS,\n version: '1.0.0',\n question: messages.question,\n options: [\n ...jobsList.map(job => ({\n value: job.jobTitle,\n message: {\n id: `progressiveProfilingQuiz.stepper.workStatus.jobOption.${job.jobTitle}`,\n defaultMessage: job.jobTitle,\n },\n })),\n { value: NOT_EMPLOYED_VALUE, message: messages.notEmployedOption },\n ],\n};\n\nexport default schema;\n"]}
|