@edx/frontend-plugin-learner-dashboard 3.3.5 → 3.5.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/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/package.json +6 -3
- package/dist/progressive-profiling-dashboard/ProgressiveProfilingEntry.js +38 -0
- package/dist/progressive-profiling-dashboard/ProgressiveProfilingEntry.js.map +1 -0
- package/dist/progressive-profiling-dashboard/ProgressiveProfilingModal.js +117 -0
- package/dist/progressive-profiling-dashboard/ProgressiveProfilingModal.js.map +1 -0
- package/dist/progressive-profiling-dashboard/api/service.js +37 -0
- package/dist/progressive-profiling-dashboard/api/service.js.map +1 -0
- package/dist/progressive-profiling-dashboard/data/progressiveProfilingFields.js +25 -0
- package/dist/progressive-profiling-dashboard/data/progressiveProfilingFields.js.map +1 -0
- package/dist/progressive-profiling-dashboard/field-renderer/FieldRenderer.js +86 -0
- package/dist/progressive-profiling-dashboard/field-renderer/FieldRenderer.js.map +1 -0
- package/dist/progressive-profiling-dashboard/field-renderer/index.js +14 -0
- package/dist/progressive-profiling-dashboard/field-renderer/index.js.map +1 -0
- package/dist/progressive-profiling-dashboard/hooks/useClearProgressiveProfilingQueryParams.js +16 -0
- package/dist/progressive-profiling-dashboard/hooks/useClearProgressiveProfilingQueryParams.js.map +1 -0
- package/dist/progressive-profiling-dashboard/hooks/useProgressiveProfilingForm.js +58 -0
- package/dist/progressive-profiling-dashboard/hooks/useProgressiveProfilingForm.js.map +1 -0
- package/dist/progressive-profiling-dashboard/hooks/useProgressiveProfilingTrigger.js +14 -0
- package/dist/progressive-profiling-dashboard/hooks/useProgressiveProfilingTrigger.js.map +1 -0
- package/dist/progressive-profiling-dashboard/index.js +9 -0
- package/dist/progressive-profiling-dashboard/index.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfiling.js +157 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfiling.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfilingPageModal.js +62 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfilingPageModal.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/LargeLayout.js +101 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/LargeLayout.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/MediumLayout.js +125 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/MediumLayout.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/SmallLayout.js +106 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/SmallLayout.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/index.js +28 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/index.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/messages.js +40 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/messages.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/index.js +59 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/index.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/index.js +14 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/index.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/index.scss +269 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/messages.js +68 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/messages.js.map +1 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/service/getThirdPartyAuthContext.js +28 -0
- package/dist/progressive-profiling-dashboard/progressive-profiling-authn-replica/service/getThirdPartyAuthContext.js.map +1 -0
- package/dist/progressive-profiling-dashboard/utils/constants.js +12 -0
- package/dist/progressive-profiling-dashboard/utils/constants.js.map +1 -0
- package/dist/tracking/constants.js +2 -1
- package/dist/tracking/constants.js.map +1 -1
- package/dist/tracking/trackers/progressiveProfiling.js +47 -0
- package/dist/tracking/trackers/progressiveProfiling.js.map +1 -0
- package/dist/tracking/utils.js +15 -2
- package/dist/tracking/utils.js.map +1 -1
- package/package.json +7 -4
- package/src/index.jsx +4 -0
- package/src/progressive-profiling-dashboard/ProgressiveProfilingEntry.jsx +33 -0
- package/src/progressive-profiling-dashboard/ProgressiveProfilingModal.jsx +110 -0
- package/src/progressive-profiling-dashboard/api/service.js +32 -0
- package/src/progressive-profiling-dashboard/data/progressiveProfilingFields.js +32 -0
- package/src/progressive-profiling-dashboard/field-renderer/FieldRenderer.jsx +87 -0
- package/src/progressive-profiling-dashboard/field-renderer/index.jsx +1 -0
- package/src/progressive-profiling-dashboard/hooks/useClearProgressiveProfilingQueryParams.jsx +12 -0
- package/src/progressive-profiling-dashboard/hooks/useProgressiveProfilingForm.jsx +55 -0
- package/src/progressive-profiling-dashboard/hooks/useProgressiveProfilingTrigger.jsx +9 -0
- package/src/progressive-profiling-dashboard/index.jsx +3 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfiling.jsx +156 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/ProgressiveProfilingPageModal.jsx +59 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/LargeLayout.jsx +105 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/MediumLayout.jsx +95 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/SmallLayout.jsx +85 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/index.jsx +3 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/components/welcome-page-layout/messages.js +35 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/index.jsx +46 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/base-container/tests/BaseContainer.test.jsx +76 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/index.jsx +1 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/index.scss +269 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/messages.jsx +62 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/service/getThirdPartyAuthContext.js +24 -0
- package/src/progressive-profiling-dashboard/progressive-profiling-authn-replica/tests/ProgressiveProfiling.test.jsx +165 -0
- package/src/progressive-profiling-dashboard/utils/constants.jsx +5 -0
- package/src/tracking/constants.js +2 -0
- package/src/tracking/trackers/progressiveProfiling.js +45 -0
- package/src/tracking/utils.js +16 -2
package/dist/index.js
CHANGED
|
@@ -45,6 +45,18 @@ Object.defineProperty(exports, "NoticesRedirect", {
|
|
|
45
45
|
return _index4.default;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "ProgressiveProfiling", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _progressiveProfilingAuthnReplica.ProgressiveProfiling;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "ProgressiveProfilingEntry", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _progressiveProfilingDashboard.default;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
48
60
|
Object.defineProperty(exports, "UclWrapper", {
|
|
49
61
|
enumerable: true,
|
|
50
62
|
get: function () {
|
|
@@ -80,5 +92,7 @@ var _index4 = _interopRequireDefault(require("./notices-redirect/index"));
|
|
|
80
92
|
var _upgradeButton = _interopRequireDefault(require("./upgrade-button"));
|
|
81
93
|
var _index5 = _interopRequireDefault(require("./career-menu/index"));
|
|
82
94
|
var _index6 = _interopRequireDefault(require("./dashboard-menu/index"));
|
|
95
|
+
var _progressiveProfilingDashboard = _interopRequireDefault(require("./progressive-profiling-dashboard"));
|
|
96
|
+
var _progressiveProfilingAuthnReplica = require("./progressive-profiling-dashboard/progressive-profiling-authn-replica");
|
|
83
97
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
84
98
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_index","_interopRequireDefault","require","_courseBanner","_dynamicExperienceSlot","_index2","_index3","_uclWrapper","_noCoursesView","_index4","_upgradeButton","_index5","_index6","e","__esModule","default"],"sources":["../src/index.jsx"],"sourcesContent":["import CohesionWrapper from './cohesion-wrapper/index';\nimport CourseBanner from './course-banner';\nimport DynamicExperienceSlot from './dynamic-experience-slot';\nimport EnterpriseDashboardModal from './dashboard-modal/index';\nimport HelpChatbot from './chatbot/index';\nimport UclWrapper from './ucl-wrapper';\nimport NoCoursesView from './no-courses-view';\nimport NoticesRedirect from './notices-redirect/index';\nimport UpgradeButton from './upgrade-button';\nimport UserCareerMenu from './career-menu/index';\nimport UserDashboardMenu from './dashboard-menu/index';\n\nexport {\n CohesionWrapper,\n CourseBanner,\n DynamicExperienceSlot,\n EnterpriseDashboardModal,\n HelpChatbot,\n NoCoursesView,\n NoticesRedirect,\n UclWrapper,\n UpgradeButton,\n UserCareerMenu,\n UserDashboardMenu,\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_index","_interopRequireDefault","require","_courseBanner","_dynamicExperienceSlot","_index2","_index3","_uclWrapper","_noCoursesView","_index4","_upgradeButton","_index5","_index6","_progressiveProfilingDashboard","_progressiveProfilingAuthnReplica","e","__esModule","default"],"sources":["../src/index.jsx"],"sourcesContent":["import CohesionWrapper from './cohesion-wrapper/index';\nimport CourseBanner from './course-banner';\nimport DynamicExperienceSlot from './dynamic-experience-slot';\nimport EnterpriseDashboardModal from './dashboard-modal/index';\nimport HelpChatbot from './chatbot/index';\nimport UclWrapper from './ucl-wrapper';\nimport NoCoursesView from './no-courses-view';\nimport NoticesRedirect from './notices-redirect/index';\nimport UpgradeButton from './upgrade-button';\nimport UserCareerMenu from './career-menu/index';\nimport UserDashboardMenu from './dashboard-menu/index';\nimport ProgressiveProfilingEntry from './progressive-profiling-dashboard';\nimport { ProgressiveProfiling } from './progressive-profiling-dashboard/progressive-profiling-authn-replica';\n\nexport {\n CohesionWrapper,\n CourseBanner,\n DynamicExperienceSlot,\n EnterpriseDashboardModal,\n HelpChatbot,\n NoCoursesView,\n NoticesRedirect,\n UclWrapper,\n UpgradeButton,\n UserCareerMenu,\n UserDashboardMenu,\n ProgressiveProfilingEntry,\n ProgressiveProfiling,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,sBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,OAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,cAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,OAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,OAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,8BAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,iCAAA,GAAAZ,OAAA;AAA6G,SAAAD,uBAAAc,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
package/dist/package.json
CHANGED
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"@edx/browserslist-config": "^1.1.1",
|
|
46
46
|
"@edx/react-unit-test-utils": "^4.0.0",
|
|
47
47
|
"@edx/reactifex": "^2.1.1",
|
|
48
|
-
"@openedx/frontend-build": "14.6.
|
|
48
|
+
"@openedx/frontend-build": "14.6.6",
|
|
49
49
|
"@testing-library/jest-dom": "^6.6.3",
|
|
50
50
|
"@testing-library/react": "^16.2.0",
|
|
51
|
-
"jest": "30.
|
|
51
|
+
"jest": "30.4.2",
|
|
52
52
|
"react-error-boundary": "^6.1.0",
|
|
53
53
|
"rosie": "2.1.1",
|
|
54
54
|
"semantic-release": "^25.0.0",
|
|
@@ -57,9 +57,12 @@
|
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@edx/frontend-platform": "^8.3.1",
|
|
59
59
|
"@openedx/paragon": "^23.0.0",
|
|
60
|
+
"classnames": "^2.5.1",
|
|
60
61
|
"moment": "^2.30.1",
|
|
61
62
|
"prop-types": "15.8.1",
|
|
62
63
|
"react": "^18.3.1",
|
|
63
|
-
"react-dom": "^18.3.1"
|
|
64
|
+
"react-dom": "^18.3.1",
|
|
65
|
+
"react-helmet": "^6.1.0",
|
|
66
|
+
"react-router-dom": "^6.30.2"
|
|
64
67
|
}
|
|
65
68
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ProgressiveProfilingEntry = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _auth = require("@edx/frontend-platform/auth");
|
|
9
|
+
var _ProgressiveProfilingModal = _interopRequireDefault(require("./ProgressiveProfilingModal"));
|
|
10
|
+
var _useProgressiveProfilingTrigger = _interopRequireDefault(require("./hooks/useProgressiveProfilingTrigger"));
|
|
11
|
+
var _useClearProgressiveProfilingQueryParams = _interopRequireDefault(require("./hooks/useClearProgressiveProfilingQueryParams"));
|
|
12
|
+
var _progressiveProfiling = require("../tracking/trackers/progressiveProfiling");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
const ProgressiveProfilingEntry = () => {
|
|
17
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
18
|
+
const username = (0, _auth.getAuthenticatedUser)()?.username;
|
|
19
|
+
const {
|
|
20
|
+
shouldOpen
|
|
21
|
+
} = (0, _useProgressiveProfilingTrigger.default)();
|
|
22
|
+
const clearTrigger = (0, _useClearProgressiveProfilingQueryParams.default)();
|
|
23
|
+
(0, _react.useEffect)(() => {
|
|
24
|
+
if (shouldOpen && username) {
|
|
25
|
+
setIsOpen(true);
|
|
26
|
+
(0, _progressiveProfiling.trackProgressiveProfilingQuestionaireModalFormOpened)({
|
|
27
|
+
host: window.location.origin
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}, [shouldOpen, username]);
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressiveProfilingModal.default, {
|
|
32
|
+
isOpen: isOpen,
|
|
33
|
+
onClose: () => setIsOpen(false),
|
|
34
|
+
clearTrigger: clearTrigger
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
exports.ProgressiveProfilingEntry = ProgressiveProfilingEntry;
|
|
38
|
+
//# sourceMappingURL=ProgressiveProfilingEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressiveProfilingEntry.js","names":["_react","_interopRequireWildcard","require","_auth","_ProgressiveProfilingModal","_interopRequireDefault","_useProgressiveProfilingTrigger","_useClearProgressiveProfilingQueryParams","_progressiveProfiling","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ProgressiveProfilingEntry","isOpen","setIsOpen","useState","username","getAuthenticatedUser","shouldOpen","useProgressiveProfilingTrigger","clearTrigger","useClearProgressiveProfilingQueryParams","useEffect","trackProgressiveProfilingQuestionaireModalFormOpened","host","window","location","origin","jsx","onClose","exports"],"sources":["../../src/progressive-profiling-dashboard/ProgressiveProfilingEntry.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { getAuthenticatedUser } from '@edx/frontend-platform/auth';\n\nimport ProgressiveProfilingModal from './ProgressiveProfilingModal';\nimport useProgressiveProfilingTrigger from './hooks/useProgressiveProfilingTrigger';\nimport useClearProgressiveProfilingQueryParams from './hooks/useClearProgressiveProfilingQueryParams';\nimport { trackProgressiveProfilingQuestionaireModalFormOpened } from '../tracking/trackers/progressiveProfiling';\n\nconst ProgressiveProfilingEntry = () => {\n const [isOpen, setIsOpen] = useState(false);\n\n const username = getAuthenticatedUser()?.username;\n\n const { shouldOpen } = useProgressiveProfilingTrigger();\n const clearTrigger = useClearProgressiveProfilingQueryParams();\n\n useEffect(() => {\n if (shouldOpen && username) {\n setIsOpen(true);\n trackProgressiveProfilingQuestionaireModalFormOpened({ host: window.location.origin });\n }\n }, [shouldOpen, username]);\n\n return (\n <ProgressiveProfilingModal\n isOpen={isOpen}\n onClose={() => setIsOpen(false)}\n clearTrigger={clearTrigger}\n />\n );\n};\n\nexport { ProgressiveProfilingEntry };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,0BAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,+BAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,wCAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AAAiH,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAG,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAS,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAE,CAAA,CAAAI,GAAA,CAAAX,CAAA,UAAAO,CAAA,CAAAK,GAAA,CAAAZ,CAAA,GAAAO,CAAA,CAAAM,GAAA,CAAAb,CAAA,EAAAS,CAAA,gBAAAN,CAAA,IAA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 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _frontendPlatform = require("@edx/frontend-platform");
|
|
10
|
+
var _i18n = require("@edx/frontend-platform/i18n");
|
|
11
|
+
var _paragon = require("@openedx/paragon");
|
|
12
|
+
var _fieldRenderer = require("./field-renderer");
|
|
13
|
+
var _useProgressiveProfilingForm = _interopRequireDefault(require("./hooks/useProgressiveProfilingForm"));
|
|
14
|
+
var _constants = require("./utils/constants");
|
|
15
|
+
var _messages = _interopRequireDefault(require("./progressive-profiling-authn-replica/messages"));
|
|
16
|
+
var _progressiveProfiling = require("../tracking/trackers/progressiveProfiling");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
const ProgressiveProfilingModal = ({
|
|
20
|
+
isOpen,
|
|
21
|
+
onClose,
|
|
22
|
+
clearTrigger
|
|
23
|
+
}) => {
|
|
24
|
+
const {
|
|
25
|
+
formatMessage
|
|
26
|
+
} = (0, _i18n.useIntl)();
|
|
27
|
+
const {
|
|
28
|
+
loadState,
|
|
29
|
+
submitState,
|
|
30
|
+
error,
|
|
31
|
+
values,
|
|
32
|
+
fieldList,
|
|
33
|
+
onChangeHandler,
|
|
34
|
+
submit
|
|
35
|
+
} = (0, _useProgressiveProfilingForm.default)();
|
|
36
|
+
const handleSubmit = async e => {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
const success = await submit();
|
|
39
|
+
if (!success) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
(0, _progressiveProfiling.trackProgressiveProfilingSubmitClick)({
|
|
43
|
+
isGenderSelected: !!values.gender,
|
|
44
|
+
isLevelOfEducationSelected: !!values.level_of_education,
|
|
45
|
+
host: window.location.origin
|
|
46
|
+
});
|
|
47
|
+
clearTrigger();
|
|
48
|
+
onClose();
|
|
49
|
+
};
|
|
50
|
+
const handleSkip = () => {
|
|
51
|
+
(0, _progressiveProfiling.trackProgressiveProfilingSkipLinkClick)({
|
|
52
|
+
host: window.location.origin
|
|
53
|
+
});
|
|
54
|
+
clearTrigger();
|
|
55
|
+
onClose();
|
|
56
|
+
};
|
|
57
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ModalDialog, {
|
|
58
|
+
isOpen: isOpen,
|
|
59
|
+
onClose: () => {},
|
|
60
|
+
hasCloseButton: false,
|
|
61
|
+
size: "md",
|
|
62
|
+
title: formatMessage(_messages.default['progressive.profiling.page.heading']),
|
|
63
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.ModalDialog.Header, {
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.ModalDialog.Title, {
|
|
65
|
+
children: formatMessage(_messages.default['progressive.profiling.page.heading'])
|
|
66
|
+
})
|
|
67
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ModalDialog.Body, {
|
|
68
|
+
children: [error && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.Alert, {
|
|
69
|
+
variant: "danger",
|
|
70
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Alert.Heading, {
|
|
71
|
+
children: formatMessage(_messages.default['welcome.page.error.heading'])
|
|
72
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
73
|
+
children: formatMessage(_messages.default['welcome.page.error.message'])
|
|
74
|
+
})]
|
|
75
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.Form, {
|
|
76
|
+
id: "profileForm",
|
|
77
|
+
onSubmit: handleSubmit,
|
|
78
|
+
children: [fieldList.map(fieldData => /*#__PURE__*/(0, _jsxRuntime.jsx)(_fieldRenderer.FormFieldRenderer, {
|
|
79
|
+
fieldData: fieldData,
|
|
80
|
+
value: values[fieldData.name],
|
|
81
|
+
onChangeHandler: onChangeHandler
|
|
82
|
+
}, fieldData.name)), (0, _frontendPlatform.getConfig)().AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
83
|
+
className: "mt-2",
|
|
84
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Hyperlink, {
|
|
85
|
+
destination: (0, _frontendPlatform.getConfig)().AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK,
|
|
86
|
+
target: "_blank",
|
|
87
|
+
showLaunchIcon: false,
|
|
88
|
+
onClick: () => (0, _progressiveProfiling.trackProgressiveProfilingSupportLinkClick)({
|
|
89
|
+
host: window.location.origin
|
|
90
|
+
}),
|
|
91
|
+
children: formatMessage(_messages.default['optional.fields.information.link'])
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
})]
|
|
95
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.ModalDialog.Footer, {
|
|
96
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Button, {
|
|
97
|
+
variant: "link",
|
|
98
|
+
onClick: handleSkip,
|
|
99
|
+
disabled: submitState === _constants.PENDING_STATE,
|
|
100
|
+
children: formatMessage(_messages.default['optional.fields.skip.button'])
|
|
101
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Button, {
|
|
102
|
+
variant: "brand",
|
|
103
|
+
type: "submit",
|
|
104
|
+
form: "profileForm",
|
|
105
|
+
disabled: loadState !== _constants.COMPLETE_STATE || submitState === _constants.PENDING_STATE,
|
|
106
|
+
children: formatMessage(_messages.default['optional.fields.submit.button'])
|
|
107
|
+
})]
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
ProgressiveProfilingModal.propTypes = {
|
|
112
|
+
isOpen: _propTypes.default.bool.isRequired,
|
|
113
|
+
onClose: _propTypes.default.func.isRequired,
|
|
114
|
+
clearTrigger: _propTypes.default.func.isRequired
|
|
115
|
+
};
|
|
116
|
+
var _default = exports.default = ProgressiveProfilingModal;
|
|
117
|
+
//# sourceMappingURL=ProgressiveProfilingModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressiveProfilingModal.js","names":["_react","_interopRequireDefault","require","_propTypes","_frontendPlatform","_i18n","_paragon","_fieldRenderer","_useProgressiveProfilingForm","_constants","_messages","_progressiveProfiling","_jsxRuntime","e","__esModule","default","ProgressiveProfilingModal","isOpen","onClose","clearTrigger","formatMessage","useIntl","loadState","submitState","error","values","fieldList","onChangeHandler","submit","useProgressiveProfilingForm","handleSubmit","preventDefault","success","trackProgressiveProfilingSubmitClick","isGenderSelected","gender","isLevelOfEducationSelected","level_of_education","host","window","location","origin","handleSkip","trackProgressiveProfilingSkipLinkClick","jsxs","ModalDialog","hasCloseButton","size","title","messages","children","jsx","Header","Title","Body","Alert","variant","Heading","Form","id","onSubmit","map","fieldData","FormFieldRenderer","value","name","getConfig","AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK","className","Hyperlink","destination","target","showLaunchIcon","onClick","trackProgressiveProfilingSupportLinkClick","Footer","Button","disabled","PENDING_STATE","type","form","COMPLETE_STATE","propTypes","PropTypes","bool","isRequired","func","_default","exports"],"sources":["../../src/progressive-profiling-dashboard/ProgressiveProfilingModal.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { getConfig } from '@edx/frontend-platform';\nimport { useIntl } from '@edx/frontend-platform/i18n';\nimport {\n Alert, Button, Form, Hyperlink, ModalDialog,\n} from '@openedx/paragon';\n\nimport { FormFieldRenderer } from './field-renderer';\nimport useProgressiveProfilingForm from './hooks/useProgressiveProfilingForm';\nimport { COMPLETE_STATE, PENDING_STATE } from './utils/constants';\nimport messages from './progressive-profiling-authn-replica/messages';\nimport {\n trackProgressiveProfilingSkipLinkClick, trackProgressiveProfilingSubmitClick,\n trackProgressiveProfilingSupportLinkClick,\n} from '../tracking/trackers/progressiveProfiling';\n\nconst ProgressiveProfilingModal = ({\n isOpen, onClose, clearTrigger,\n}) => {\n const { formatMessage } = useIntl();\n const {\n loadState, submitState, error, values, fieldList, onChangeHandler, submit,\n } = useProgressiveProfilingForm();\n\n const handleSubmit = async (e) => {\n e.preventDefault();\n const success = await submit();\n if (!success) { return; }\n\n trackProgressiveProfilingSubmitClick({\n isGenderSelected: !!values.gender,\n isLevelOfEducationSelected: !!values.level_of_education,\n host: window.location.origin,\n });\n\n clearTrigger();\n onClose();\n };\n\n const handleSkip = () => {\n trackProgressiveProfilingSkipLinkClick({ host: window.location.origin });\n clearTrigger();\n onClose();\n };\n\n return (\n <ModalDialog\n isOpen={isOpen}\n onClose={() => {}}\n hasCloseButton={false}\n size=\"md\"\n title={formatMessage(messages['progressive.profiling.page.heading'])}\n >\n <ModalDialog.Header>\n <ModalDialog.Title>\n {formatMessage(messages['progressive.profiling.page.heading'])}\n </ModalDialog.Title>\n </ModalDialog.Header>\n\n <ModalDialog.Body>\n {error && (\n <Alert variant=\"danger\">\n <Alert.Heading>{formatMessage(messages['welcome.page.error.heading'])}</Alert.Heading>\n <p>{formatMessage(messages['welcome.page.error.message'])}</p>\n </Alert>\n )}\n <Form id=\"profileForm\" onSubmit={handleSubmit}>\n {fieldList.map((fieldData) => (\n <FormFieldRenderer\n key={fieldData.name}\n fieldData={fieldData}\n value={values[fieldData.name]}\n onChangeHandler={onChangeHandler}\n />\n ))}\n\n {(getConfig().AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK) && (\n <div className=\"mt-2\">\n <Hyperlink\n destination={getConfig().AUTHN_PROGRESSIVE_PROFILING_SUPPORT_LINK}\n target=\"_blank\"\n showLaunchIcon={false}\n onClick={() => trackProgressiveProfilingSupportLinkClick({ host: window.location.origin })}\n >\n {formatMessage(messages['optional.fields.information.link'])}\n </Hyperlink>\n </div>\n )}\n </Form>\n </ModalDialog.Body>\n <ModalDialog.Footer>\n <Button variant=\"link\" onClick={handleSkip} disabled={submitState === PENDING_STATE}>\n {formatMessage(messages['optional.fields.skip.button'])}\n </Button>\n <Button variant=\"brand\" type=\"submit\" form=\"profileForm\" disabled={loadState !== COMPLETE_STATE || submitState === PENDING_STATE}>\n {formatMessage(messages['optional.fields.submit.button'])}\n </Button>\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nProgressiveProfilingModal.propTypes = {\n isOpen: PropTypes.bool.isRequired,\n onClose: PropTypes.func.isRequired,\n clearTrigger: PropTypes.func.isRequired,\n};\n\nexport default ProgressiveProfilingModal;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AAIA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,4BAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AAGmD,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAD,uBAAAY,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnD,MAAMG,yBAAyB,GAAGA,CAAC;EACjCC,MAAM;EAAEC,OAAO;EAAEC;AACnB,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,aAAO,EAAC,CAAC;EACnC,MAAM;IACJC,SAAS;IAAEC,WAAW;IAAEC,KAAK;IAAEC,MAAM;IAAEC,SAAS;IAAEC,eAAe;IAAEC;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
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.saveProgressiveProfiling = saveProgressiveProfiling;
|
|
7
|
+
var _frontendPlatform = require("@edx/frontend-platform");
|
|
8
|
+
var _auth = require("@edx/frontend-platform/auth");
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
|
+
async function saveProgressiveProfiling(values, extendedProfileFieldNames = []) {
|
|
15
|
+
const payload = _objectSpread({}, values);
|
|
16
|
+
const extendedProfile = [];
|
|
17
|
+
const authenticatedUser = (0, _auth.getAuthenticatedUser)();
|
|
18
|
+
const client = (0, _auth.getAuthenticatedHttpClient)();
|
|
19
|
+
extendedProfileFieldNames.forEach(fieldName => {
|
|
20
|
+
if (payload[fieldName] !== undefined && payload[fieldName] !== '') {
|
|
21
|
+
extendedProfile.push({
|
|
22
|
+
fieldName,
|
|
23
|
+
fieldValue: payload[fieldName]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
delete payload[fieldName];
|
|
27
|
+
});
|
|
28
|
+
if (extendedProfile.length) {
|
|
29
|
+
payload.extendedProfile = extendedProfile;
|
|
30
|
+
}
|
|
31
|
+
await client.patch(`${(0, _frontendPlatform.getConfig)().LMS_BASE_URL}/api/user/v1/accounts/${authenticatedUser.username}`, (0, _frontendPlatform.snakeCaseObject)(payload), {
|
|
32
|
+
headers: {
|
|
33
|
+
'Content-Type': 'application/merge-patch+json'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","names":["_frontendPlatform","require","_auth","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","saveProgressiveProfiling","values","extendedProfileFieldNames","payload","extendedProfile","authenticatedUser","getAuthenticatedUser","client","getAuthenticatedHttpClient","fieldName","undefined","fieldValue","patch","getConfig","LMS_BASE_URL","username","snakeCaseObject","headers"],"sources":["../../../src/progressive-profiling-dashboard/api/service.js"],"sourcesContent":["import { getConfig, snakeCaseObject } from '@edx/frontend-platform';\nimport { getAuthenticatedUser, getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';\n\nexport async function saveProgressiveProfiling(values, extendedProfileFieldNames = []) {\n const payload = { ...values };\n const extendedProfile = [];\n const authenticatedUser = getAuthenticatedUser();\n const client = getAuthenticatedHttpClient();\n\n extendedProfileFieldNames.forEach((fieldName) => {\n if (payload[fieldName] !== undefined && payload[fieldName] !== '') {\n extendedProfile.push({\n fieldName,\n fieldValue: payload[fieldName],\n });\n }\n\n delete payload[fieldName];\n });\n\n if (extendedProfile.length) {\n payload.extendedProfile = extendedProfile;\n }\n\n await client.patch(\n `${getConfig().LMS_BASE_URL}/api/user/v1/accounts/${authenticatedUser.username}`,\n snakeCaseObject(payload),\n {\n headers: { 'Content-Type': 'application/merge-patch+json' },\n },\n );\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAA+F,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,IAAAe,eAAA,CAAAhB,CAAA,EAAAC,CAAA,EAAAC,CAAA,CAAAD,CAAA,SAAAE,MAAA,CAAAc,yBAAA,GAAAd,MAAA,CAAAe,gBAAA,CAAAlB,CAAA,EAAAG,MAAA,CAAAc,yBAAA,CAAAf,CAAA,KAAAH,OAAA,CAAAI,MAAA,CAAAD,CAAA,GAAAa,OAAA,WAAAd,CAAA,IAAAE,MAAA,CAAAgB,cAAA,CAAAnB,CAAA,E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AAe,CAAC1B,IAAI,CAAC;QACnB+B,SAAS;QACTE,UAAU,EAAER,OAAO,CAACM,SAAS;MAC/B,CAAC,CAAC;IACJ;IAEA,OAAON,OAAO,CAACM,SAAS,CAAC;EAC3B,CAAC,CAAC;EAEF,IAAIL,eAAe,CAACtB,MAAM,EAAE;IAC1BqB,OAAO,CAACC,eAAe,GAAGA,eAAe;EAC3C;EAEA,MAAMG,MAAM,CAACK,KAAK,CAChB,GAAG,IAAAC,2BAAS,EAAC,CAAC,CAACC,YAAY,yBAAyBT,iBAAiB,CAACU,QAAQ,EAAE,EAChF,IAAAC,iCAAe,EAACb,OAAO,CAAC,EACxB;IACEc,OAAO,EAAE;MAAE,cAAc,EAAE;IAA+B;EAC5D,CACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.progressiveProfilingFields = void 0;
|
|
7
|
+
const progressiveProfilingFields = exports.progressiveProfilingFields = {
|
|
8
|
+
fields: {
|
|
9
|
+
gender: {
|
|
10
|
+
name: 'gender',
|
|
11
|
+
type: 'select',
|
|
12
|
+
label: 'Gender',
|
|
13
|
+
options: [['f', 'Female'], ['m', 'Male'], ['o', 'Other']]
|
|
14
|
+
},
|
|
15
|
+
level_of_education: {
|
|
16
|
+
name: 'level_of_education',
|
|
17
|
+
type: 'select',
|
|
18
|
+
label: 'Level of Education',
|
|
19
|
+
options: [['p', 'Doctorate'], ['m', 'Master\'s or professional degree'], ['b', 'Bachelor\'s Degree'], ['a', 'Associate Degree'], ['hs', 'Secondary/High School'], ['jhs', 'Junior secondary/junior high/middle school'], ['el', 'Elementary/primary school'], ['none', 'No formal education'], ['other', 'Other education']]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
extendedProfile: [],
|
|
23
|
+
redirectUrl: ''
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=progressiveProfilingFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progressiveProfilingFields.js","names":["progressiveProfilingFields","exports","fields","gender","name","type","label","options","level_of_education","extendedProfile","redirectUrl"],"sources":["../../../src/progressive-profiling-dashboard/data/progressiveProfilingFields.js"],"sourcesContent":["export const progressiveProfilingFields = {\n fields: {\n gender: {\n name: 'gender',\n type: 'select',\n label: 'Gender',\n options: [\n ['f', 'Female'],\n ['m', 'Male'],\n ['o', 'Other'],\n ],\n },\n level_of_education: {\n name: 'level_of_education',\n type: 'select',\n label: 'Level of Education',\n options: [\n ['p', 'Doctorate'],\n ['m', 'Master\\'s or professional degree'],\n ['b', 'Bachelor\\'s Degree'],\n ['a', 'Associate Degree'],\n ['hs', 'Secondary/High School'],\n ['jhs', 'Junior secondary/junior high/middle school'],\n ['el', 'Elementary/primary school'],\n ['none', 'No formal education'],\n ['other', 'Other education'],\n ],\n },\n },\n extendedProfile: [],\n redirectUrl: '',\n};\n"],"mappings":";;;;;;AAAO,MAAMA,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,GAAG;EACxCE,MAAM,EAAE;IACNC,MAAM,EAAE;MACNC,IAAI,EAAE,QAAQ;MACdC,IAAI,EAAE,QAAQ;MACdC,KAAK,EAAE,QAAQ;MACfC,OAAO,EAAE,CACP,CAAC,GAAG,EAAE,QAAQ,CAAC,EACf,CAAC,GAAG,EAAE,MAAM,CAAC,EACb,CAAC,GAAG,EAAE,OAAO,CAAC;IAElB,CAAC;IACDC,kBAAkB,EAAE;MAClBJ,IAAI,EAAE,oBAAoB;MAC1BC,IAAI,EAAE,QAAQ;MACdC,KAAK,EAAE,oBAAoB;MAC3BC,OAAO,EAAE,CACP,CAAC,GAAG,EAAE,WAAW,CAAC,EAClB,CAAC,GAAG,EAAE,kCAAkC,CAAC,EACzC,CAAC,GAAG,EAAE,oBAAoB,CAAC,EAC3B,CAAC,GAAG,EAAE,kBAAkB,CAAC,EACzB,CAAC,IAAI,EAAE,uBAAuB,CAAC,EAC/B,CAAC,KAAK,EAAE,4CAA4C,CAAC,EACrD,CAAC,IAAI,EAAE,2BAA2B,CAAC,EACnC,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAC/B,CAAC,OAAO,EAAE,iBAAiB,CAAC;IAEhC;EACF,CAAC;EACDE,eAAe,EAAE,EAAE;EACnBC,WAAW,EAAE;AACf,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _paragon = require("@openedx/paragon");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const FormFieldRenderer = ({
|
|
13
|
+
fieldData,
|
|
14
|
+
value,
|
|
15
|
+
onChangeHandler,
|
|
16
|
+
className
|
|
17
|
+
}) => {
|
|
18
|
+
switch (fieldData.type) {
|
|
19
|
+
case 'select':
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Form.Group, {
|
|
21
|
+
controlId: fieldData.name,
|
|
22
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_paragon.Form.Control, {
|
|
23
|
+
as: "select",
|
|
24
|
+
className: className,
|
|
25
|
+
name: fieldData.name,
|
|
26
|
+
value: value ?? '',
|
|
27
|
+
onChange: onChangeHandler,
|
|
28
|
+
floatingLabel: fieldData.label,
|
|
29
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
30
|
+
value: "",
|
|
31
|
+
children: fieldData.label
|
|
32
|
+
}), fieldData.options.map(option => /*#__PURE__*/(0, _jsxRuntime.jsx)("option", {
|
|
33
|
+
value: option[0],
|
|
34
|
+
children: option[1]
|
|
35
|
+
}, option[0]))]
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
case 'textarea':
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Form.Group, {
|
|
40
|
+
controlId: fieldData.name,
|
|
41
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Form.Control, {
|
|
42
|
+
as: "textarea",
|
|
43
|
+
className: className,
|
|
44
|
+
name: fieldData.name,
|
|
45
|
+
value: value ?? '',
|
|
46
|
+
onChange: onChangeHandler,
|
|
47
|
+
floatingLabel: fieldData.label
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
case 'checkbox':
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Form.Group, {
|
|
52
|
+
controlId: fieldData.name,
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Form.Checkbox, {
|
|
54
|
+
id: fieldData.name,
|
|
55
|
+
name: fieldData.name,
|
|
56
|
+
checked: !!value,
|
|
57
|
+
onChange: onChangeHandler,
|
|
58
|
+
children: fieldData.label
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
default:
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Form.Group, {
|
|
63
|
+
controlId: fieldData.name,
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_paragon.Form.Control, {
|
|
65
|
+
className: className,
|
|
66
|
+
name: fieldData.name,
|
|
67
|
+
value: value ?? '',
|
|
68
|
+
onChange: onChangeHandler,
|
|
69
|
+
floatingLabel: fieldData.label
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
FormFieldRenderer.propTypes = {
|
|
75
|
+
fieldData: _propTypes.default.shape({
|
|
76
|
+
name: _propTypes.default.string.isRequired,
|
|
77
|
+
type: _propTypes.default.string.isRequired,
|
|
78
|
+
label: _propTypes.default.string,
|
|
79
|
+
options: _propTypes.default.arrayOf(_propTypes.default.arrayOf(_propTypes.default.string))
|
|
80
|
+
}).isRequired,
|
|
81
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool]),
|
|
82
|
+
onChangeHandler: _propTypes.default.func.isRequired,
|
|
83
|
+
className: _propTypes.default.string
|
|
84
|
+
};
|
|
85
|
+
var _default = exports.default = FormFieldRenderer;
|
|
86
|
+
//# sourceMappingURL=FieldRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldRenderer.js","names":["_react","_interopRequireDefault","require","_propTypes","_paragon","_jsxRuntime","e","__esModule","default","FormFieldRenderer","fieldData","value","onChangeHandler","className","type","jsx","Form","Group","controlId","name","children","jsxs","Control","as","onChange","floatingLabel","label","options","map","option","Checkbox","id","checked","propTypes","PropTypes","shape","string","isRequired","arrayOf","oneOfType","bool","func","_default","exports"],"sources":["../../../src/progressive-profiling-dashboard/field-renderer/FieldRenderer.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Form } from '@openedx/paragon';\n\nconst FormFieldRenderer = ({\n fieldData, value, onChangeHandler, className,\n}) => {\n switch (fieldData.type) {\n case 'select':\n return (\n <Form.Group controlId={fieldData.name}>\n <Form.Control\n as=\"select\"\n className={className}\n name={fieldData.name}\n value={value ?? ''}\n onChange={onChangeHandler}\n floatingLabel={fieldData.label}\n >\n <option value=\"\">{fieldData.label}</option>\n {fieldData.options.map(option => (\n <option key={option[0]} value={option[0]}>\n {option[1]}\n </option>\n ))}\n </Form.Control>\n </Form.Group>\n );\n\n case 'textarea':\n return (\n <Form.Group controlId={fieldData.name}>\n <Form.Control\n as=\"textarea\"\n className={className}\n name={fieldData.name}\n value={value ?? ''}\n onChange={onChangeHandler}\n floatingLabel={fieldData.label}\n />\n </Form.Group>\n );\n\n case 'checkbox':\n return (\n <Form.Group controlId={fieldData.name}>\n <Form.Checkbox\n id={fieldData.name}\n name={fieldData.name}\n checked={!!value}\n onChange={onChangeHandler}\n >\n {fieldData.label}\n </Form.Checkbox>\n </Form.Group>\n );\n\n default:\n return (\n <Form.Group controlId={fieldData.name}>\n <Form.Control\n className={className}\n name={fieldData.name}\n value={value ?? ''}\n onChange={onChangeHandler}\n floatingLabel={fieldData.label}\n />\n </Form.Group>\n );\n }\n};\n\nFormFieldRenderer.propTypes = {\n fieldData: PropTypes.shape({\n name: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n label: PropTypes.string,\n options: PropTypes.arrayOf(\n PropTypes.arrayOf(PropTypes.string),\n ),\n }).isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),\n onChangeHandler: PropTypes.func.isRequired,\n className: PropTypes.string,\n};\n\nexport default FormFieldRenderer;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAwC,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExC,MAAMG,iBAAiB,GAAGA,CAAC;EACzBC,SAAS;EAAEC,KAAK;EAAEC,eAAe;EAAEC;AACrC,CAAC,KAAK;EACJ,QAAQH,SAAS,CAACI,IAAI;IACpB,KAAK,QAAQ;MACX,oBACE,IAAAT,WAAA,CAAAU,GAAA,EAACX,QAAA,CAAAY,IAAI,CAACC,KAAK;QAACC,SAAS,EAAER,SAAS,CAACS,IAAK;QAAAC,QAAA,eACpC,IAAAf,WAAA,CAAAgB,IAAA,EAACjB,QAAA,CAAAY,IAAI,CAACM,OAAO;UACXC,EAAE,EAAC,QAAQ;UACXV,SAAS,EAAEA,SAAU;UACrBM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 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "FormFieldRenderer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _FieldRenderer.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _FieldRenderer = _interopRequireDefault(require("./FieldRenderer"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_FieldRenderer","_interopRequireDefault","require","e","__esModule","default"],"sources":["../../../src/progressive-profiling-dashboard/field-renderer/index.jsx"],"sourcesContent":["export { default as FormFieldRenderer } from './FieldRenderer';\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+D,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useClearProgressiveProfilingQueryParams;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _constants = require("../utils/constants");
|
|
9
|
+
function useClearProgressiveProfilingQueryParams() {
|
|
10
|
+
return (0, _react.useCallback)(() => {
|
|
11
|
+
const currentUrl = new URL(window.location.href);
|
|
12
|
+
currentUrl.searchParams.delete(_constants.PROGRESSIVE_PROFILING_QUERY_PARAM);
|
|
13
|
+
window.history.replaceState({}, '', currentUrl.toString());
|
|
14
|
+
}, []);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=useClearProgressiveProfilingQueryParams.js.map
|
package/dist/progressive-profiling-dashboard/hooks/useClearProgressiveProfilingQueryParams.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useClearProgressiveProfilingQueryParams.js","names":["_react","require","_constants","useClearProgressiveProfilingQueryParams","useCallback","currentUrl","URL","window","location","href","searchParams","delete","PROGRESSIVE_PROFILING_QUERY_PARAM","history","replaceState","toString"],"sources":["../../../src/progressive-profiling-dashboard/hooks/useClearProgressiveProfilingQueryParams.jsx"],"sourcesContent":["import { useCallback } from 'react';\nimport { PROGRESSIVE_PROFILING_QUERY_PARAM } from '../utils/constants';\n\nexport default function useClearProgressiveProfilingQueryParams() {\n return useCallback(() => {\n const currentUrl = new URL(window.location.href);\n\n currentUrl.searchParams.delete(PROGRESSIVE_PROFILING_QUERY_PARAM);\n\n window.history.replaceState({}, '', currentUrl.toString());\n }, []);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEe,SAASE,uCAAuCA,CAAA,EAAG;EAChE,OAAO,IAAAC,kBAAW,EAAC,MAAM;IACvB,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAACC,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;IAEhDJ,UAAU,CAACK,YAAY,CAACC,MAAM,CAACC,4CAAiC,CAAC;IAEjEL,MAAM,CAACM,OAAO,CAACC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,EAAET,UAAU,CAACU,QAAQ,CAAC,CAAC,CAAC;EAC5D,CAAC,EAAE,EAAE,CAAC;AACR","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useProgressiveProfilingForm;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _constants = require("../utils/constants");
|
|
9
|
+
var _service = require("../api/service");
|
|
10
|
+
var _progressiveProfilingFields = require("../data/progressiveProfilingFields");
|
|
11
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
+
function useProgressiveProfilingForm() {
|
|
17
|
+
const [submitState, setSubmitState] = (0, _react.useState)(_constants.DEFAULT_STATE);
|
|
18
|
+
const [error, setError] = (0, _react.useState)(null);
|
|
19
|
+
const [values, setValues] = (0, _react.useState)({});
|
|
20
|
+
const fieldData = _progressiveProfilingFields.progressiveProfilingFields;
|
|
21
|
+
const fieldList = (0, _react.useMemo)(() => Object.keys(fieldData.fields).map(key => fieldData.fields[key]), [fieldData]);
|
|
22
|
+
const onChangeHandler = event => {
|
|
23
|
+
const {
|
|
24
|
+
name,
|
|
25
|
+
type,
|
|
26
|
+
value,
|
|
27
|
+
checked
|
|
28
|
+
} = event.target;
|
|
29
|
+
setValues(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
30
|
+
[name]: type === 'checkbox' ? checked : value
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
const submit = async () => {
|
|
34
|
+
try {
|
|
35
|
+
setSubmitState(_constants.PENDING_STATE);
|
|
36
|
+
setError(null);
|
|
37
|
+
await (0, _service.saveProgressiveProfiling)(values, fieldData.extendedProfile || []);
|
|
38
|
+
setSubmitState(_constants.COMPLETE_STATE);
|
|
39
|
+
return true;
|
|
40
|
+
} catch (err) {
|
|
41
|
+
setSubmitState(_constants.DEFAULT_STATE);
|
|
42
|
+
setError(err);
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return {
|
|
47
|
+
loadState: _constants.COMPLETE_STATE,
|
|
48
|
+
submitState,
|
|
49
|
+
error,
|
|
50
|
+
values,
|
|
51
|
+
fieldList,
|
|
52
|
+
onChangeHandler,
|
|
53
|
+
submit,
|
|
54
|
+
redirectUrl: fieldData.redirectUrl || '',
|
|
55
|
+
extendedProfileFieldNames: fieldData.extendedProfile || []
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=useProgressiveProfilingForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProgressiveProfilingForm.js","names":["_react","require","_constants","_service","_progressiveProfilingFields","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","useProgressiveProfilingForm","submitState","setSubmitState","useState","DEFAULT_STATE","error","setError","values","setValues","fieldData","progressiveProfilingFields","fieldList","useMemo","fields","map","key","onChangeHandler","event","name","type","checked","target","prev","submit","PENDING_STATE","saveProgressiveProfiling","extendedProfile","COMPLETE_STATE","err","loadState","redirectUrl","extendedProfileFieldNames"],"sources":["../../../src/progressive-profiling-dashboard/hooks/useProgressiveProfilingForm.jsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport {\n COMPLETE_STATE, DEFAULT_STATE, PENDING_STATE,\n} from '../utils/constants';\nimport { saveProgressiveProfiling } from '../api/service';\nimport { progressiveProfilingFields } from '../data/progressiveProfilingFields';\n\nexport default function useProgressiveProfilingForm() {\n const [submitState, setSubmitState] = useState(DEFAULT_STATE);\n const [error, setError] = useState(null);\n const [values, setValues] = useState({});\n\n const fieldData = progressiveProfilingFields;\n\n const fieldList = useMemo(\n () => Object.keys(fieldData.fields).map((key) => fieldData.fields[key]),\n [fieldData],\n );\n\n const onChangeHandler = (event) => {\n const {\n name, type, value, checked,\n } = event.target;\n setValues((prev) => ({\n ...prev,\n [name]: type === 'checkbox' ? checked : value,\n }));\n };\n\n const submit = async () => {\n try {\n setSubmitState(PENDING_STATE);\n setError(null);\n await saveProgressiveProfiling(values, fieldData.extendedProfile || []);\n setSubmitState(COMPLETE_STATE);\n return true;\n } catch (err) {\n setSubmitState(DEFAULT_STATE);\n setError(err);\n return false;\n }\n };\n\n return {\n loadState: COMPLETE_STATE,\n submitState,\n error,\n values,\n fieldList,\n onChangeHandler,\n submit,\n redirectUrl: fieldData.redirectUrl || '',\n extendedProfileFieldNames: fieldData.extendedProfile || [],\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAGA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAAgF,SAAAI,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CA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I;MACFrB,cAAc,CAACsB,wBAAa,CAAC;MAC7BlB,QAAQ,CAAC,IAAI,CAAC;MACd,MAAM,IAAAmB,iCAAwB,EAAClB,MAAM,EAAEE,SAAS,CAACiB,eAAe,IAAI,EAAE,CAAC;MACvExB,cAAc,CAACyB,yBAAc,CAAC;MAC9B,OAAO,IAAI;IACb,CAAC,CAAC,OAAOC,GAAG,EAAE;MACZ1B,cAAc,CAACE,wBAAa,CAAC;MAC7BE,QAAQ,CAACsB,GAAG,CAAC;MACb,OAAO,KAAK;IACd;EACF,CAAC;EAED,OAAO;IACLC,SAAS,EAAEF,yBAAc;IACzB1B,WAAW;IACXI,KAAK;IACLE,MAAM;IACNI,SAAS;IACTK,eAAe;IACfO,MAAM;IACNO,WAAW,EAAErB,SAAS,CAACqB,WAAW,IAAI,EAAE;IACxCC,yBAAyB,EAAEtB,SAAS,CAACiB,eAAe,IAAI;EAC1D,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useProgressiveProfilingTrigger;
|
|
7
|
+
var _constants = require("../utils/constants");
|
|
8
|
+
function useProgressiveProfilingTrigger() {
|
|
9
|
+
const params = new URLSearchParams(window.location.search);
|
|
10
|
+
return {
|
|
11
|
+
shouldOpen: params.get(_constants.PROGRESSIVE_PROFILING_QUERY_PARAM) === 'true'
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=useProgressiveProfilingTrigger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProgressiveProfilingTrigger.js","names":["_constants","require","useProgressiveProfilingTrigger","params","URLSearchParams","window","location","search","shouldOpen","get","PROGRESSIVE_PROFILING_QUERY_PARAM"],"sources":["../../../src/progressive-profiling-dashboard/hooks/useProgressiveProfilingTrigger.jsx"],"sourcesContent":["import { PROGRESSIVE_PROFILING_QUERY_PARAM } from '../utils/constants';\n\nexport default function useProgressiveProfilingTrigger() {\n const params = new URLSearchParams(window.location.search);\n\n return {\n shouldOpen: params.get(PROGRESSIVE_PROFILING_QUERY_PARAM) === 'true',\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEe,SAASC,8BAA8BA,CAAA,EAAG;EACvD,MAAMC,MAAM,GAAG,IAAIC,eAAe,CAACC,MAAM,CAACC,QAAQ,CAACC,MAAM,CAAC;EAE1D,OAAO;IACLC,UAAU,EAAEL,MAAM,CAACM,GAAG,CAACC,4CAAiC,CAAC,KAAK;EAChE,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ProgressiveProfilingEntry = require("./ProgressiveProfilingEntry");
|
|
8
|
+
var _default = exports.default = _ProgressiveProfilingEntry.ProgressiveProfilingEntry;
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_ProgressiveProfilingEntry","require","_default","exports","default","ProgressiveProfilingEntry"],"sources":["../../src/progressive-profiling-dashboard/index.jsx"],"sourcesContent":["import { ProgressiveProfilingEntry } from './ProgressiveProfilingEntry';\n\nexport default ProgressiveProfilingEntry;\n"],"mappings":";;;;;;AAAA,IAAAA,0BAAA,GAAAC,OAAA;AAAwE,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzDC,oDAAyB","ignoreList":[]}
|