@openedx/frontend-app-instructor-dashboard 1.0.0-alpha.43 → 1.0.0-alpha.44

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.
@@ -1,15 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { useParams } from 'react-router-dom';
4
+ import { isAxiosError } from 'axios';
2
5
  import { useIntl } from '@openedx/frontend-base';
3
6
  import { IconButton } from '@openedx/paragon';
4
7
  import { Settings } from '@openedx/paragon/icons';
5
- import { useParams } from 'react-router-dom';
6
- import { useState } from 'react';
7
8
  import { CohortProvider, useCohortContext } from '../cohorts/components/CohortContext';
8
9
  import DisableCohortsModal from '../cohorts/components/DisableCohortsModal';
9
10
  import DisabledCohortsView from '../cohorts/components/DisabledCohortsView';
10
11
  import EnabledCohortsView from '../cohorts/components/EnabledCohortsView';
11
12
  import { useCohortStatus, useToggleCohorts } from '../cohorts/data/apiHook';
12
13
  import messages from '../cohorts/messages';
14
+ import { useAlert } from '../providers/AlertProvider';
13
15
  import './CohortsPage.scss';
14
16
  const CohortsPageContent = () => {
15
17
  const intl = useIntl();
@@ -19,15 +21,32 @@ const CohortsPageContent = () => {
19
21
  const [isOpenDisableModal, setIsOpenDisableModal] = useState(false);
20
22
  const { clearSelectedCohort } = useCohortContext();
21
23
  const { isCohorted = false } = cohortStatus !== null && cohortStatus !== void 0 ? cohortStatus : {};
24
+ const { showModal } = useAlert();
22
25
  const handleEnableCohorts = () => {
23
26
  toggleCohortsMutate({ isCohorted: true }, {
24
- onError: (error) => console.log(error)
27
+ onError: (error) => {
28
+ var _a, _b;
29
+ const errorMessage = (isAxiosError(error) && ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.developer_message)) || intl.formatMessage(messages.enableCohortError);
30
+ showModal({
31
+ confirmText: intl.formatMessage(messages.closeButton),
32
+ message: errorMessage,
33
+ variant: 'danger',
34
+ });
35
+ }
25
36
  });
26
37
  };
27
38
  const handleDisableCohorts = () => {
28
39
  toggleCohortsMutate({ isCohorted: false }, {
29
40
  onSuccess: () => clearSelectedCohort(),
30
- onError: (error) => console.log(error)
41
+ onError: (error) => {
42
+ var _a, _b;
43
+ const errorMessage = (isAxiosError(error) && ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.developer_message)) || intl.formatMessage(messages.disableCohortError);
44
+ showModal({
45
+ confirmText: intl.formatMessage(messages.closeButton),
46
+ message: errorMessage,
47
+ variant: 'danger',
48
+ });
49
+ }
31
50
  });
32
51
  setIsOpenDisableModal(false);
33
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CohortsPage.js","sourceRoot":"","sources":["../../src/cohorts/CohortsPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,mBAAmB,MAAM,6CAA6C,CAAC;AAC9E,OAAO,mBAAmB,MAAM,6CAA6C,CAAC;AAC9E,OAAO,kBAAkB,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,oBAAoB,CAAC;AAE5B,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,MAAM,IAAI,GAAG,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E,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,EAChD,MAAM,EAAE,QAAQ,EAChB,cAAc,EAAC,oBAAoB,EACnC,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,GAC1C,GACE,CACP,IACG,EACL,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,kBAAkB,KAAG,CACvB,CAAC,CAAC,CAAC,CACF,KAAC,mBAAmB,IAAC,eAAe,EAAE,mBAAmB,GAAI,CAC9D,EACD,KAAC,mBAAmB,IAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,gBAAgB,EAAE,oBAAoB,GAAI,IACvI,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,oIAAoI;AACpI,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,OAAO,CACL,KAAC,cAAc,cACb,KAAC,kBAAkB,KAAG,GACP,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { useIntl } from '@openedx/frontend-base';\nimport { IconButton } from '@openedx/paragon';\nimport { Settings } from '@openedx/paragon/icons';\nimport { useParams } from 'react-router-dom';\nimport { useState } from 'react';\nimport { CohortProvider, useCohortContext } from '@src/cohorts/components/CohortContext';\nimport DisableCohortsModal from '@src/cohorts/components/DisableCohortsModal';\nimport DisabledCohortsView from '@src/cohorts/components/DisabledCohortsView';\nimport EnabledCohortsView from '@src/cohorts/components/EnabledCohortsView';\nimport { useCohortStatus, useToggleCohorts } from '@src/cohorts/data/apiHook';\nimport messages from '@src/cohorts/messages';\nimport './CohortsPage.scss';\n\nconst CohortsPageContent = () => {\n const intl = useIntl();\n const { courseId = '' } = useParams();\n const { data: cohortStatus } = useCohortStatus(courseId);\n const { mutate: toggleCohortsMutate } = useToggleCohorts(courseId);\n const [isOpenDisableModal, setIsOpenDisableModal] = useState(false);\n const { clearSelectedCohort } = useCohortContext();\n const { isCohorted = false } = cohortStatus ?? {};\n\n const handleEnableCohorts = () => {\n toggleCohortsMutate({ isCohorted: true },\n {\n onError: (error) => console.log(error)\n });\n };\n\n const handleDisableCohorts = () => {\n toggleCohortsMutate({ isCohorted: false },\n {\n onSuccess: () => clearSelectedCohort(),\n onError: (error) => console.log(error)\n });\n setIsOpenDisableModal(false);\n };\n\n return (\n <>\n <div className=\"d-inline-flex align-items-center\">\n <h3 className=\"mb-0 text-primary-700\">{intl.formatMessage(messages.cohortsTitle)}</h3>\n {isCohorted && (\n <div className=\"small\">\n <IconButton\n alt={intl.formatMessage(messages.disableCohorts)}\n iconAs={Settings}\n iconClassNames=\"mb-2 text-gray-500\"\n size=\"sm\"\n variant=\"secondary\"\n onClick={() => setIsOpenDisableModal(true)}\n />\n </div>\n )}\n </div>\n {isCohorted ? (\n <EnabledCohortsView />\n ) : (\n <DisabledCohortsView onEnableCohorts={handleEnableCohorts} />\n )}\n <DisableCohortsModal isOpen={isOpenDisableModal} onClose={() => setIsOpenDisableModal(false)} onConfirmDisable={handleDisableCohorts} />\n </>\n );\n};\n\n// It was necessary to wrap the entire content with CohortProvider here to avoid errors in the use of cohort hooks within a provider\nconst CohortsPage = () => {\n return (\n <CohortProvider>\n <CohortsPageContent />\n </CohortProvider>\n );\n};\n\nexport default CohortsPage;\n"]}
1
+ {"version":3,"file":"CohortsPage.js","sourceRoot":"","sources":["../../src/cohorts/CohortsPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAA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AE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,EAChD,MAAM,EAAE,QAAQ,EAChB,cAAc,EAAC,oBAAoB,EACnC,IAAI,EAAC,IAAI,EACT,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,GAC1C,GACE,CACP,IACG,EACL,UAAU,CAAC,CAAC,CAAC,CACZ,KAAC,kBAAkB,KAAG,CACvB,CAAC,CAAC,CAAC,CACF,KAAC,mBAAmB,IAAC,eAAe,EAAE,mBAAmB,GAAI,CAC9D,EACD,KAAC,mBAAmB,IAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,gBAAgB,EAAE,oBAAoB,GAAI,IACvI,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,oIAAoI;AACpI,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,OAAO,CACL,KAAC,cAAc,cACb,KAAC,kBAAkB,KAAG,GACP,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { isAxiosError } from 'axios';\nimport { useIntl } from '@openedx/frontend-base';\nimport { IconButton } from '@openedx/paragon';\nimport { Settings } from '@openedx/paragon/icons';\nimport { CohortProvider, useCohortContext } from '@src/cohorts/components/CohortContext';\nimport DisableCohortsModal from '@src/cohorts/components/DisableCohortsModal';\nimport DisabledCohortsView from '@src/cohorts/components/DisabledCohortsView';\nimport EnabledCohortsView from '@src/cohorts/components/EnabledCohortsView';\nimport { useCohortStatus, useToggleCohorts } from '@src/cohorts/data/apiHook';\nimport messages from '@src/cohorts/messages';\nimport { useAlert } from '@src/providers/AlertProvider';\nimport './CohortsPage.scss';\n\nconst CohortsPageContent = () => {\n const intl = useIntl();\n const { courseId = '' } = useParams();\n const { data: cohortStatus } = useCohortStatus(courseId);\n const { mutate: toggleCohortsMutate } = useToggleCohorts(courseId);\n const [isOpenDisableModal, setIsOpenDisableModal] = useState(false);\n const { clearSelectedCohort } = useCohortContext();\n const { isCohorted = false } = cohortStatus ?? {};\n const { showModal } = useAlert();\n\n const handleEnableCohorts = () => {\n toggleCohortsMutate({ isCohorted: true },\n {\n onError: (error) => {\n const errorMessage = (isAxiosError(error) && error?.response?.data?.developer_message) || intl.formatMessage(messages.enableCohortError);\n showModal({\n confirmText: intl.formatMessage(messages.closeButton),\n message: errorMessage,\n variant: 'danger',\n });\n }\n });\n };\n\n const handleDisableCohorts = () => {\n toggleCohortsMutate({ isCohorted: false },\n {\n onSuccess: () => clearSelectedCohort(),\n onError: (error) => {\n const errorMessage = (isAxiosError(error) && error?.response?.data?.developer_message) || intl.formatMessage(messages.disableCohortError);\n showModal({\n confirmText: intl.formatMessage(messages.closeButton),\n message: errorMessage,\n variant: 'danger',\n });\n }\n });\n setIsOpenDisableModal(false);\n };\n\n return (\n <>\n <div className=\"d-inline-flex align-items-center\">\n <h3 className=\"mb-0 text-primary-700\">{intl.formatMessage(messages.cohortsTitle)}</h3>\n {isCohorted && (\n <div className=\"small\">\n <IconButton\n alt={intl.formatMessage(messages.disableCohorts)}\n iconAs={Settings}\n iconClassNames=\"mb-2 text-gray-500\"\n size=\"sm\"\n variant=\"secondary\"\n onClick={() => setIsOpenDisableModal(true)}\n />\n </div>\n )}\n </div>\n {isCohorted ? (\n <EnabledCohortsView />\n ) : (\n <DisabledCohortsView onEnableCohorts={handleEnableCohorts} />\n )}\n <DisableCohortsModal isOpen={isOpenDisableModal} onClose={() => setIsOpenDisableModal(false)} onConfirmDisable={handleDisableCohorts} />\n </>\n );\n};\n\n// It was necessary to wrap the entire content with CohortProvider here to avoid errors in the use of cohort hooks within a provider\nconst CohortsPage = () => {\n return (\n <CohortProvider>\n <CohortsPageContent />\n </CohortProvider>\n );\n};\n\nexport default CohortsPage;\n"]}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useParams } from 'react-router-dom';
3
2
  import { useRef, useState } from 'react';
3
+ import { useParams } from 'react-router-dom';
4
+ import { isAxiosError } from 'axios';
4
5
  import { FormattedMessage, getExternalLinkUrl, useIntl } from '@openedx/frontend-base';
5
6
  import { Card, Hyperlink, Tab, Tabs, Toast } from '@openedx/paragon';
6
7
  import messages from '../../cohorts/messages';
@@ -37,8 +38,12 @@ const CohortCard = () => {
37
38
  setSelectedCohort(Object.assign(Object.assign({}, selectedCohort), updatedCohort));
38
39
  },
39
40
  onError: (error) => {
41
+ var _a, _b;
42
+ const errorMessage = (isAxiosError(error) && ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.developer_message)) || intl.formatMessage(messages.editCohortError);
40
43
  showModal({
41
- message: error.message,
44
+ confirmText: intl.formatMessage(messages.closeButton),
45
+ message: errorMessage,
46
+ variant: 'danger',
42
47
  });
43
48
  }
44
49
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CohortCard.js","sourceRoot":"","sources":["../../../src/cohorts/components/CohortCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO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EACN,KAAC,GAAG,IAAgB,QAAQ,EAAC,UAAU,EAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAClF,KAAC,WAAW,IACV,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,gBAAgB,GAC1B,IALK,UAAU,CAMb,IACD,IACF,EACP,KAAC,KAAK,IAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,SAAS,EAAC,YAAY,YACjG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,0BAA0B,CAAC,GAClD,IACP,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useParams } from 'react-router-dom';\nimport { useRef, useState } from 'react';\nimport { FormattedMessage, getExternalLinkUrl, useIntl } from '@openedx/frontend-base';\nimport { Card, Hyperlink, Tab, Tabs, Toast } from '@openedx/paragon';\nimport messages from '@src/cohorts/messages';\nimport { CohortData } from '@src/cohorts/types';\nimport { usePatchCohort } from '@src/cohorts/data/apiHook';\nimport CohortsForm from '@src/cohorts/components/CohortsForm';\nimport ManageLearners from '@src/cohorts/components/ManageLearners';\nimport { useCohortContext } from '@src/cohorts/components/CohortContext';\nimport { useAlert } from '@src/providers/AlertProvider';\n\nexport const assignmentLink = {\n random: 'https://docs.openedx.org/en/latest/educators/references/advanced_features/managing_cohort_assignment.html#about-auto-cohorts',\n manual: 'https://docs.openedx.org/en/latest/educators/how-tos/advanced_features/manage_cohorts.html#assign-learners-to-cohorts-manually',\n};\n\nconst warningMessage = {\n random: messages.automaticCohortWarning,\n manual: messages.manualCohortWarning,\n};\n\nconst CohortCard = () => {\n const intl = useIntl();\n const { courseId = '' } = useParams<{ courseId: string }>();\n const { selectedCohort, setSelectedCohort } = useCohortContext();\n const { mutate: editCohort } = usePatchCohort(courseId);\n const formRef = useRef<{ resetForm: () => void }>(null);\n const [showSuccessMessage, setShowSuccessMessage] = useState<boolean>(false);\n const { clearAlerts, showModal } = useAlert();\n\n if (!selectedCohort) {\n return null;\n }\n\n const handleEditCohort = (updatedCohort: CohortData) => {\n clearAlerts();\n editCohort({ cohortId: selectedCohort.id, cohortInfo: updatedCohort },\n {\n onSuccess: () => {\n setShowSuccessMessage(true);\n setSelectedCohort({ ...selectedCohort, ...updatedCohort });\n },\n onError: (error: Error) => {\n showModal({\n message: error.message,\n });\n }\n }\n );\n };\n\n const handleCancelForm = () => {\n formRef.current?.resetForm();\n };\n\n return (\n <>\n <Card className=\"bg-light-200 mt-3\">\n <div className=\"mx-4 my-3.5\">\n <div className=\"d-flex align-items-center\">\n <h3 className=\"text-primary-700 mb-0\">{selectedCohort?.name}</h3>\n <p className=\"ml-3 text-primary-700 mb-0\">{intl.formatMessage(messages.studentsOnCohort, { users: selectedCohort?.userCount ?? 0 })}</p>\n </div>\n <p className=\"x-small mb-0 mt-2\">\n <FormattedMessage {...warningMessage[selectedCohort.assignmentType]} /> <Hyperlink showLaunchIcon={false} target=\"_blank\" destination={getExternalLinkUrl(assignmentLink[selectedCohort.assignmentType])}>{intl.formatMessage(messages.warningCohortLink)}</Hyperlink>\n </p>\n </div>\n <Tabs id=\"cohort-management-tabs\" className=\"mx-0\" onSelect={() => {}}>\n <Tab key=\"manage-learners\" eventKey=\"manage-learners\" title={intl.formatMessage(messages.manageLearners)}>\n <ManageLearners />\n </Tab>\n <Tab key=\"settings\" eventKey=\"settings\" title={intl.formatMessage(messages.settings)}>\n <CohortsForm\n ref={formRef}\n onCancel={handleCancelForm}\n onSubmit={handleEditCohort}\n />\n </Tab>\n </Tabs>\n </Card>\n <Toast show={showSuccessMessage} onClose={() => setShowSuccessMessage(false)} className=\"text-break\">\n {intl.formatMessage(messages.cohortUpdateSuccessMessage)}\n </Toast>\n </>\n );\n};\n\nexport default CohortCard;\n"]}
1
+ {"version":3,"file":"CohortCard.js","sourceRoot":"","sources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AC,YAAY,YACjG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,0BAA0B,CAAC,GAClD,IACP,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useRef, useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { isAxiosError } from 'axios';\nimport { FormattedMessage, getExternalLinkUrl, useIntl } from '@openedx/frontend-base';\nimport { Card, Hyperlink, Tab, Tabs, Toast } from '@openedx/paragon';\nimport messages from '@src/cohorts/messages';\nimport { CohortData } from '@src/cohorts/types';\nimport { usePatchCohort } from '@src/cohorts/data/apiHook';\nimport CohortsForm from '@src/cohorts/components/CohortsForm';\nimport ManageLearners from '@src/cohorts/components/ManageLearners';\nimport { useCohortContext } from '@src/cohorts/components/CohortContext';\nimport { useAlert } from '@src/providers/AlertProvider';\n\nexport const assignmentLink = {\n random: 'https://docs.openedx.org/en/latest/educators/references/advanced_features/managing_cohort_assignment.html#about-auto-cohorts',\n manual: 'https://docs.openedx.org/en/latest/educators/how-tos/advanced_features/manage_cohorts.html#assign-learners-to-cohorts-manually',\n};\n\nconst warningMessage = {\n random: messages.automaticCohortWarning,\n manual: messages.manualCohortWarning,\n};\n\nconst CohortCard = () => {\n const intl = useIntl();\n const { courseId = '' } = useParams<{ courseId: string }>();\n const { selectedCohort, setSelectedCohort } = useCohortContext();\n const { mutate: editCohort } = usePatchCohort(courseId);\n const formRef = useRef<{ resetForm: () => void }>(null);\n const [showSuccessMessage, setShowSuccessMessage] = useState<boolean>(false);\n const { clearAlerts, showModal } = useAlert();\n\n if (!selectedCohort) {\n return null;\n }\n\n const handleEditCohort = (updatedCohort: CohortData) => {\n clearAlerts();\n editCohort({ cohortId: selectedCohort.id, cohortInfo: updatedCohort },\n {\n onSuccess: () => {\n setShowSuccessMessage(true);\n setSelectedCohort({ ...selectedCohort, ...updatedCohort });\n },\n onError: (error) => {\n const errorMessage = (isAxiosError(error) && error?.response?.data?.developer_message) || intl.formatMessage(messages.editCohortError);\n showModal({\n confirmText: intl.formatMessage(messages.closeButton),\n message: errorMessage,\n variant: 'danger',\n });\n }\n }\n );\n };\n\n const handleCancelForm = () => {\n formRef.current?.resetForm();\n };\n\n return (\n <>\n <Card className=\"bg-light-200 mt-3\">\n <div className=\"mx-4 my-3.5\">\n <div className=\"d-flex align-items-center\">\n <h3 className=\"text-primary-700 mb-0\">{selectedCohort?.name}</h3>\n <p className=\"ml-3 text-primary-700 mb-0\">{intl.formatMessage(messages.studentsOnCohort, { users: selectedCohort?.userCount ?? 0 })}</p>\n </div>\n <p className=\"x-small mb-0 mt-2\">\n <FormattedMessage {...warningMessage[selectedCohort.assignmentType]} /> <Hyperlink showLaunchIcon={false} target=\"_blank\" destination={getExternalLinkUrl(assignmentLink[selectedCohort.assignmentType])}>{intl.formatMessage(messages.warningCohortLink)}</Hyperlink>\n </p>\n </div>\n <Tabs id=\"cohort-management-tabs\" className=\"mx-0\" onSelect={() => {}}>\n <Tab key=\"manage-learners\" eventKey=\"manage-learners\" title={intl.formatMessage(messages.manageLearners)}>\n <ManageLearners />\n </Tab>\n <Tab key=\"settings\" eventKey=\"settings\" title={intl.formatMessage(messages.settings)}>\n <CohortsForm\n ref={formRef}\n onCancel={handleCancelForm}\n onSubmit={handleEditCohort}\n />\n </Tab>\n </Tabs>\n </Card>\n <Toast show={showSuccessMessage} onClose={() => setShowSuccessMessage(false)} className=\"text-break\">\n {intl.formatMessage(messages.cohortUpdateSuccessMessage)}\n </Toast>\n </>\n );\n};\n\nexport default CohortCard;\n"]}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from 'react';
3
3
  import { useParams } from 'react-router-dom';
4
+ import { isAxiosError } from 'axios';
4
5
  import { useIntl } from '@openedx/frontend-base';
5
6
  import { FormControl, Button, Card, Alert } from '@openedx/paragon';
6
7
  import { CheckCircle, Error, WarningFilled } from '@openedx/paragon/icons';
@@ -24,7 +25,7 @@ const EnabledCohortsView = () => {
24
25
  const { mutate: createCohort } = useCreateCohort(courseId);
25
26
  const { clearSelectedCohort, selectedCohort, setSelectedCohort } = useCohortContext();
26
27
  const [displayAddForm, setDisplayAddForm] = useState(false);
27
- const { alerts, addAlert, removeAlert, clearAlerts } = useAlert();
28
+ const { alerts, addAlert, removeAlert, clearAlerts, showModal } = useAlert();
28
29
  const cohortsList = [{ id: 'null', name: intl.formatMessage(messages.selectCohortPlaceholder) }, ...data];
29
30
  // Sync selectedCohort with updated data when useCohorts refetches
30
31
  useEffect(() => {
@@ -83,7 +84,13 @@ const EnabledCohortsView = () => {
83
84
  hideAddForm();
84
85
  },
85
86
  onError: (error) => {
86
- console.error(error);
87
+ var _a, _b;
88
+ const errorMessage = (isAxiosError(error) && ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.developer_message)) || intl.formatMessage(messages.enableCohortError);
89
+ showModal({
90
+ confirmText: intl.formatMessage(messages.closeButton),
91
+ message: errorMessage,
92
+ variant: 'danger',
93
+ });
87
94
  }
88
95
  });
89
96
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EnabledCohortsView.js","sourceRoot":"","sources":["../../../src/cohorts/components/EnabledCohortsView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,WAAW,MAAM,q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AC,uBAAuB,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,GAAI,GACxG,CACR,EACA,cAAc,IAAI,KAAC,kBAAkB,KAAG,IACxC,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { useState, useEffect } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { useIntl } from '@openedx/frontend-base';\nimport { FormControl, Button, Card, Alert } from '@openedx/paragon';\nimport { CheckCircle, Error, WarningFilled } from '@openedx/paragon/icons';\nimport { useCohortContext } from '@src/cohorts/components/CohortContext';\nimport CohortsForm from '@src/cohorts/components/CohortsForm';\nimport SelectedCohortInfo from '@src/cohorts/components/SelectedCohortInfo';\nimport { useCohorts, useCreateCohort } from '@src/cohorts/data/apiHook';\nimport { assignmentTypes } from '@src/cohorts/constants';\nimport messages from '@src/cohorts/messages';\nimport { CohortData, BasicCohortData } from '@src/cohorts/types';\nimport { useAlert } from '@src/providers/AlertProvider';\n\nconst alertIcons = {\n success: CheckCircle,\n error: Error,\n warning: WarningFilled,\n};\n\nconst EnabledCohortsView = () => {\n const intl = useIntl();\n const { courseId = '' } = useParams<{ courseId: string }>();\n const { data = [] } = useCohorts(courseId);\n const { mutate: createCohort } = useCreateCohort(courseId);\n const { clearSelectedCohort, selectedCohort, setSelectedCohort } = useCohortContext();\n const [displayAddForm, setDisplayAddForm] = useState(false);\n const { alerts, addAlert, removeAlert, clearAlerts } = useAlert();\n\n const cohortsList = [{ id: 'null', name: intl.formatMessage(messages.selectCohortPlaceholder) }, ...data];\n\n // Sync selectedCohort with updated data when useCohorts refetches\n useEffect(() => {\n if (selectedCohort && data.length > 0) {\n const updatedCohort = data.find(cohort => cohort.id?.toString() === selectedCohort.id?.toString());\n if (updatedCohort && (\n updatedCohort.userCount !== selectedCohort.userCount\n || updatedCohort.name !== selectedCohort.name\n || updatedCohort.assignmentType !== selectedCohort.assignmentType\n )) {\n const updatedCohortData: CohortData = {\n id: updatedCohort.id,\n name: updatedCohort.name,\n assignmentType: updatedCohort.assignmentType ?? assignmentTypes.automatic,\n groupId: updatedCohort.groupId,\n userPartitionId: updatedCohort.userPartitionId,\n userCount: updatedCohort.userCount ?? 0,\n };\n setSelectedCohort(updatedCohortData);\n }\n }\n }, [data, selectedCohort, setSelectedCohort]);\n\n const handleAddCohort = () => {\n clearSelectedCohort();\n clearAlerts();\n setDisplayAddForm(true);\n };\n\n const handleSelectCohort = (event: React.ChangeEvent<HTMLSelectElement>) => {\n clearAlerts();\n const selectedValue = event.target.value;\n const selectedCohortFromApi = cohortsList.find(cohort => cohort.id?.toString() === selectedValue);\n setDisplayAddForm(false);\n\n if (selectedCohortFromApi && selectedCohortFromApi.id !== 'null') {\n const cohortFormData: CohortData = {\n id: selectedCohortFromApi.id,\n name: selectedCohortFromApi.name,\n assignmentType: selectedCohortFromApi.assignmentType ?? assignmentTypes.automatic,\n groupId: selectedCohortFromApi.groupId,\n userPartitionId: selectedCohortFromApi.userPartitionId,\n userCount: selectedCohortFromApi.userCount ?? 0,\n };\n setSelectedCohort(cohortFormData);\n } else {\n clearSelectedCohort();\n }\n };\n\n const handleNewCohort = (newCohort: BasicCohortData) => {\n createCohort(newCohort, {\n onSuccess: (newCohort: CohortData) => {\n addAlert({\n type: 'success',\n message: intl.formatMessage(messages.addCohortSuccessMessage, { cohortName: newCohort.name })\n });\n setSelectedCohort(newCohort);\n hideAddForm();\n },\n onError: (error) => {\n console.error(error);\n }\n });\n };\n\n const hideAddForm = () => {\n setDisplayAddForm(false);\n };\n\n return (\n <>\n <div className=\"d-flex mt-4.5\">\n <FormControl\n as=\"select\"\n disabled={displayAddForm || cohortsList.length === 1}\n name=\"cohort\"\n placeholder={intl.formatMessage(messages.selectCohortPlaceholder)}\n value={selectedCohort?.id?.toString() ?? 'null'}\n onChange={handleSelectCohort}\n >\n {\n cohortsList.map((cohort) => (\n <option key={cohort.id} value={cohort.id}>\n {cohort.name}\n </option>\n ))\n }\n </FormControl>\n <Button onClick={handleAddCohort} disabled={displayAddForm}>+ {intl.formatMessage(messages.addCohort)}</Button>\n </div>\n {alerts.map(alert => (\n <Alert\n key={alert.id}\n className=\"mt-3\"\n icon={alertIcons[alert.type]}\n variant={alert.type === 'error' ? 'danger' : alert.type}\n dismissible\n onClose={() => removeAlert(alert.id)}\n >\n <p className=\"mb-0\">{alert.message}</p>\n {alert.extraContent}\n </Alert>\n ))}\n {displayAddForm && (\n <Card className=\"mt-3 bg-light-200\">\n <CohortsForm disableManualAssignment={data.length === 0} onCancel={hideAddForm} onSubmit={handleNewCohort} />\n </Card>\n )}\n {selectedCohort && <SelectedCohortInfo />}\n </>\n );\n};\n\nexport default EnabledCohortsView;\n"]}
1
+ {"version":3,"file":"EnabledCohortsView.js","sourceRoot":"","sources":["../../../src/cohorts/components/EnabledCohortsView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,kBAAkB,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,QAAQ,MAAM,uBAAuB,CAAC;A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,CAAC,YAAY,KARd,KAAK,CAAC,EAAE,CASP,CACT,CAAC,EACD,cAAc,IAAI,CACjB,KAAC,IAAI,IAAC,SAAS,EAAC,mBAAmB,YACjC,KAAC,WAAW,IAAC,uBAAuB,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,GAAI,GACxG,CACR,EACA,cAAc,IAAI,KAAC,kBAAkB,KAAG,IACxC,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { useState, useEffect } from 'react';\nimport { useParams } from 'react-router-dom';\nimport { isAxiosError } from 'axios';\nimport { useIntl } from '@openedx/frontend-base';\nimport { FormControl, Button, Card, Alert } from '@openedx/paragon';\nimport { CheckCircle, Error, WarningFilled } from '@openedx/paragon/icons';\nimport { useCohortContext } from '@src/cohorts/components/CohortContext';\nimport CohortsForm from '@src/cohorts/components/CohortsForm';\nimport SelectedCohortInfo from '@src/cohorts/components/SelectedCohortInfo';\nimport { useCohorts, useCreateCohort } from '@src/cohorts/data/apiHook';\nimport { assignmentTypes } from '@src/cohorts/constants';\nimport messages from '@src/cohorts/messages';\nimport { CohortData, BasicCohortData } from '@src/cohorts/types';\nimport { useAlert } from '@src/providers/AlertProvider';\n\nconst alertIcons = {\n success: CheckCircle,\n error: Error,\n warning: WarningFilled,\n};\n\nconst EnabledCohortsView = () => {\n const intl = useIntl();\n const { courseId = '' } = useParams<{ courseId: string }>();\n const { data = [] } = useCohorts(courseId);\n const { mutate: createCohort } = useCreateCohort(courseId);\n const { clearSelectedCohort, selectedCohort, setSelectedCohort } = useCohortContext();\n const [displayAddForm, setDisplayAddForm] = useState(false);\n const { alerts, addAlert, removeAlert, clearAlerts, showModal } = useAlert();\n\n const cohortsList = [{ id: 'null', name: intl.formatMessage(messages.selectCohortPlaceholder) }, ...data];\n\n // Sync selectedCohort with updated data when useCohorts refetches\n useEffect(() => {\n if (selectedCohort && data.length > 0) {\n const updatedCohort = data.find(cohort => cohort.id?.toString() === selectedCohort.id?.toString());\n if (updatedCohort && (\n updatedCohort.userCount !== selectedCohort.userCount\n || updatedCohort.name !== selectedCohort.name\n || updatedCohort.assignmentType !== selectedCohort.assignmentType\n )) {\n const updatedCohortData: CohortData = {\n id: updatedCohort.id,\n name: updatedCohort.name,\n assignmentType: updatedCohort.assignmentType ?? assignmentTypes.automatic,\n groupId: updatedCohort.groupId,\n userPartitionId: updatedCohort.userPartitionId,\n userCount: updatedCohort.userCount ?? 0,\n };\n setSelectedCohort(updatedCohortData);\n }\n }\n }, [data, selectedCohort, setSelectedCohort]);\n\n const handleAddCohort = () => {\n clearSelectedCohort();\n clearAlerts();\n setDisplayAddForm(true);\n };\n\n const handleSelectCohort = (event: React.ChangeEvent<HTMLSelectElement>) => {\n clearAlerts();\n const selectedValue = event.target.value;\n const selectedCohortFromApi = cohortsList.find(cohort => cohort.id?.toString() === selectedValue);\n setDisplayAddForm(false);\n\n if (selectedCohortFromApi && selectedCohortFromApi.id !== 'null') {\n const cohortFormData: CohortData = {\n id: selectedCohortFromApi.id,\n name: selectedCohortFromApi.name,\n assignmentType: selectedCohortFromApi.assignmentType ?? assignmentTypes.automatic,\n groupId: selectedCohortFromApi.groupId,\n userPartitionId: selectedCohortFromApi.userPartitionId,\n userCount: selectedCohortFromApi.userCount ?? 0,\n };\n setSelectedCohort(cohortFormData);\n } else {\n clearSelectedCohort();\n }\n };\n\n const handleNewCohort = (newCohort: BasicCohortData) => {\n createCohort(newCohort, {\n onSuccess: (newCohort: CohortData) => {\n addAlert({\n type: 'success',\n message: intl.formatMessage(messages.addCohortSuccessMessage, { cohortName: newCohort.name })\n });\n setSelectedCohort(newCohort);\n hideAddForm();\n },\n onError: (error) => {\n const errorMessage = (isAxiosError(error) && error?.response?.data?.developer_message) || intl.formatMessage(messages.enableCohortError);\n showModal({\n confirmText: intl.formatMessage(messages.closeButton),\n message: errorMessage,\n variant: 'danger',\n });\n }\n });\n };\n\n const hideAddForm = () => {\n setDisplayAddForm(false);\n };\n\n return (\n <>\n <div className=\"d-flex mt-4.5\">\n <FormControl\n as=\"select\"\n disabled={displayAddForm || cohortsList.length === 1}\n name=\"cohort\"\n placeholder={intl.formatMessage(messages.selectCohortPlaceholder)}\n value={selectedCohort?.id?.toString() ?? 'null'}\n onChange={handleSelectCohort}\n >\n {\n cohortsList.map((cohort) => (\n <option key={cohort.id} value={cohort.id}>\n {cohort.name}\n </option>\n ))\n }\n </FormControl>\n <Button onClick={handleAddCohort} disabled={displayAddForm}>+ {intl.formatMessage(messages.addCohort)}</Button>\n </div>\n {alerts.map(alert => (\n <Alert\n key={alert.id}\n className=\"mt-3\"\n icon={alertIcons[alert.type]}\n variant={alert.type === 'error' ? 'danger' : alert.type}\n dismissible\n onClose={() => removeAlert(alert.id)}\n >\n <p className=\"mb-0\">{alert.message}</p>\n {alert.extraContent}\n </Alert>\n ))}\n {displayAddForm && (\n <Card className=\"mt-3 bg-light-200\">\n <CohortsForm disableManualAssignment={data.length === 0} onCancel={hideAddForm} onSubmit={handleNewCohort} />\n </Card>\n )}\n {selectedCohort && <SelectedCohortInfo />}\n </>\n );\n};\n\nexport default EnabledCohortsView;\n"]}
@@ -229,5 +229,25 @@ declare const messages: {
229
229
  defaultMessage: string;
230
230
  description: string;
231
231
  };
232
+ closeButton: {
233
+ id: string;
234
+ defaultMessage: string;
235
+ description: string;
236
+ };
237
+ enableCohortError: {
238
+ id: string;
239
+ defaultMessage: string;
240
+ description: string;
241
+ };
242
+ disableCohortError: {
243
+ id: string;
244
+ defaultMessage: string;
245
+ description: string;
246
+ };
247
+ editCohortError: {
248
+ id: string;
249
+ defaultMessage: string;
250
+ description: string;
251
+ };
232
252
  };
233
253
  export default messages;
@@ -230,6 +230,26 @@ const messages = defineMessages({
230
230
  defaultMessage: 'No file found in upload data. Please try again.',
231
231
  description: 'Error message displayed when no file is found in the uploaded data'
232
232
  },
233
+ closeButton: {
234
+ id: 'instruct.cohorts.closeButton',
235
+ defaultMessage: 'Close',
236
+ description: 'Label for the close button'
237
+ },
238
+ enableCohortError: {
239
+ id: 'instruct.cohorts.enableCohortError',
240
+ defaultMessage: 'An error occurred while enabling cohorts. Please try again later.',
241
+ description: 'Error message displayed when enabling cohorts fails'
242
+ },
243
+ disableCohortError: {
244
+ id: 'instruct.cohorts.disableCohortError',
245
+ defaultMessage: 'An error occurred while disabling cohorts. Please try again later.',
246
+ description: 'Error message displayed when disabling cohorts fails'
247
+ },
248
+ editCohortError: {
249
+ id: 'instruct.cohorts.editCohortError',
250
+ defaultMessage: 'An error occurred while saving your changes. Please try again later.',
251
+ description: 'Error message displayed when editing a cohort fails'
252
+ }
233
253
  });
234
254
  export default messages;
235
255
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cohorts/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,YAAY,EAAE;QACZ,EAAE,EAAE,wBAAwB;QAC5B,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,4BAA4B;KAC1C;IACD,SAAS,EAAE;QACT,EAAE,EAAE,4BAA4B;QAChC,cAAc,EAAE,YAAY;QAC5B,WAAW,EAAE,sCAAsC;KACpD;IACD,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,qHAAqH;QACrI,WAAW,EAAE,6DAA6D;KAC3E;IACD,WAAW,EAAE;QACX,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,0DAA0D;KACxE;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,2DAA2D;KACzE;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,mCAAmC;QACvC,cAAc,EAAE,+IAA+I;QAC/J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E;QACf,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,8CAA8C;QAC9D,WAAW,EAAE,mEAAmE;KACjF;IACD,cAAc,EAAE;QACd,EAAE,EAAE,iCAAiC;QACrC,cAAc,EAAE,sCAAsC;QACtD,WAAW,EAAE,mEAAmE;KACjF;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,oDAAoD;QACpE,WAAW,EAAE,yDAAyD;KACvE;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,6EAA6E;QAC7F,WAAW,EAAE,kFAAkF;KAChG;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,iDAAiD;QACjE,WAAW,EAAE,oEAAoE;KAClF;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n cohortsTitle: {\n id: 'instruct.cohorts.title',\n defaultMessage: 'Cohorts',\n description: 'Title for the cohorts page'\n },\n addCohort: {\n id: 'instruct.cohorts.addCohort',\n defaultMessage: 'Add Cohort',\n description: 'Button label for adding a new cohort'\n },\n disableMessage: {\n id: 'instruct.cohorts.disableModal.disableMessage',\n defaultMessage: 'Disable Cohorts? Disabling cohorts while a course is in progress will cause an unexpected change for your learners.',\n description: 'Message displayed in the disable cohorts confirmation modal'\n },\n cancelLabel: {\n id: 'instruct.cohorts.disableModal.cancelLabel',\n defaultMessage: 'Cancel',\n description: 'Label for the cancel button in the disable cohorts modal'\n },\n disableLabel: {\n id: 'instruct.cohorts.disableModal.disableLabel',\n defaultMessage: 'Disable',\n description: 'Label for the disable button in the disable cohorts modal'\n },\n noCohortsMessage: {\n id: 'instruct.cohorts.noCohortsMessage',\n defaultMessage: 'You can use Cohorts to create smaller communities in your course, or to design different course experiences for different groups of learners.',\n description: 'Message displayed when there are no cohorts'\n },\n learnMore: {\n id: 'instruct.cohorts.learnMore',\n defaultMessage: 'Learn more',\n description: 'Label for the learn more link'\n },\n enableCohorts: {\n id: 'instruct.cohorts.enableCohorts',\n defaultMessage: 'Enable Cohorts',\n description: 'Label for the enable cohorts button'\n },\n disableCohorts: {\n id: 'instruct.cohorts.disableCohorts',\n defaultMessage: 'Disable Cohorts',\n description: 'Label for the disable cohorts button'\n },\n selectCohortPlaceholder: {\n id: 'instruct.cohorts.selectCohortPlaceholder',\n defaultMessage: 'Select a cohort',\n description: 'Placeholder text for the select cohort dropdown'\n },\n cohortName: {\n id: 'instruct.cohorts.cohortName',\n defaultMessage: 'Cohort Name',\n description: 'Label for the cohort name input field'\n },\n saveLabel: {\n id: 'instruct.cohorts.saveLabel',\n defaultMessage: 'Save',\n description: 'Label for the save button'\n },\n cohortAssignmentMethod: {\n id: 'instruct.cohorts.addForm.cohortAssignmentMethod',\n defaultMessage: 'Cohort Assignment Method',\n description: 'Label for the cohort assignment method section'\n },\n automatic: {\n id: 'instruct.cohorts.addForm.automatic',\n defaultMessage: 'Automatic',\n description: 'Label for the automatic cohort assignment method option'\n },\n manual: {\n id: 'instruct.cohorts.addForm.manual',\n defaultMessage: 'Manual',\n description: 'Label for the manual cohort assignment method option'\n },\n associatedContentGroup: {\n id: 'instruct.cohorts.addForm.associatedContentGroup',\n defaultMessage: 'Associated Content Group',\n description: 'Label for the associated content group section'\n },\n noContentGroup: {\n id: 'instruct.cohorts.addForm.noContentGroup',\n defaultMessage: 'No Content Group',\n description: 'Label for the no content group option'\n },\n selectAContentGroup: {\n id: 'instruct.cohorts.addForm.selectAContentGroup',\n defaultMessage: 'Select a Content Group',\n description: 'Label for the select a content group option'\n },\n notSelected: {\n id: 'instruct.cohorts.addForm.notSelected',\n defaultMessage: 'Not Selected',\n description: 'Label for the not selected content group option'\n },\n noContentGroups: {\n id: 'instruct.cohorts.addForm.noContentGroups',\n defaultMessage: 'No content groups exist.',\n description: 'Message displayed when there are no content groups'\n },\n createContentGroup: {\n id: 'instruct.cohorts.addForm.createContentGroup',\n defaultMessage: 'Create a content group',\n description: 'Label for the create a content group link'\n },\n addCohortSuccessMessage: {\n id: 'instruct.cohorts.addForm.successMessage',\n defaultMessage: 'The {cohortName} cohort has been created. You can manually add students to this cohort below.',\n description: 'Success message displayed when a new cohort is added'\n },\n cohortDisclaimer: {\n id: 'instruct.cohorts.cohortDisclaimer',\n defaultMessage: 'To review learner cohort assignments or see the results of uploading a CSV file, download course profile information or cohort results on the',\n description: 'Disclaimer message for cohorts'\n },\n page: {\n id: 'instruct.cohorts.page',\n defaultMessage: 'page',\n description: 'Label for the page link'\n },\n settings: {\n id: 'instruct.cohorts.settings',\n defaultMessage: 'Settings',\n description: 'Label for the settings tab'\n },\n manageLearners: {\n id: 'instruct.cohorts.manageLearners',\n defaultMessage: 'Manage Learners',\n description: 'Label for the manage learners tab'\n },\n studentsOnCohort: {\n id: 'instruct.cohorts.studentsOnCohort',\n defaultMessage: '(contains {users} students)',\n description: 'Label showing the number of students on this cohort'\n },\n automaticCohortWarning: {\n id: 'instruct.cohorts.automaticCohortWarning',\n defaultMessage: 'Learners are added to this cohort automatically.',\n description: 'Warning about automatic cohort assignment'\n },\n manualCohortWarning: {\n id: 'instruct.cohorts.manualCohortWarning',\n defaultMessage: 'Learners are added to this cohort only when you provide their email addresses or usernames on this page.',\n description: 'Warning about manual cohort assignment'\n },\n warningCohortLink: {\n id: 'instruct.cohorts.warningCohortLink',\n defaultMessage: 'What does this mean?',\n description: 'Link text for more information about cohort assignment'\n },\n cohortUpdateSuccessMessage: {\n id: 'instruct.cohorts.cohortUpdateSuccessMessage',\n defaultMessage: 'Settings have been saved.',\n description: 'Success message displayed when a cohort is updated'\n },\n addLearnersTitle: {\n id: 'instruct.cohorts.addLearnersTitle',\n defaultMessage: 'Add Learners to this cohort',\n description: 'Title for the add learners section'\n },\n addLearnersSubtitle: {\n id: 'instruct.cohorts.addLearnersSubtitle',\n defaultMessage: 'Note: Learners can be in only one cohort. Adding learners to this group overrides any previous group assignment.',\n description: 'Subtitle for the add learners section'\n },\n addLearnersInstructions: {\n id: 'instruct.cohorts.addLearnersInstructions',\n defaultMessage: 'Enter email addresses and/or usernames, separated by new lines or commas, for the learners you want to add.*',\n description: 'Instructions for adding learners to a cohort'\n },\n addLearnersFootnote: {\n id: 'instruct.cohorts.addLearnersFootnote',\n defaultMessage: 'You will not receive notification for emails that bounce, so double-check your spelling.',\n description: 'Footnote for adding learners to a cohort'\n },\n learnersExample: {\n id: 'instruct.cohorts.learnersExample',\n defaultMessage: 'e.g. johndoe@example.com, JaneDoe, Joeydoe@example.com',\n description: 'Placeholder for the learners example'\n },\n addLearnersLabel: {\n id: 'instruct.cohorts.addLearnersLabel',\n defaultMessage: 'Add Learners',\n description: 'Label for the add learners button'\n },\n manualAssignmentDisabledTooltip: {\n id: 'instruct.cohorts.manualAssignmentDisabledTooltip',\n defaultMessage: 'There must be one cohort to which students can automatically be assigned.',\n description: 'Tooltip message when manual assignment is disabled'\n },\n addLearnersSuccessMessage: {\n id: 'instruct.cohorts.addLearnersSuccessMessage',\n defaultMessage: '{countLearners} learners have been added to this cohort.',\n description: 'Success message displayed when learners are added to a cohort'\n },\n addLearnersErrorMessage: {\n id: 'instruct.cohorts.addLearnersErrorMessage',\n defaultMessage: '{countLearners} learners could not be added to this cohort.',\n description: 'Error message displayed when there is an issue adding learners to a cohort'\n },\n addLearnersWarningMessage: {\n id: 'instruct.cohorts.addLearnersWarningMessage',\n defaultMessage: '{countLearners} were pre-assigned for this cohort. This learner will automatically be added to the cohort when they enroll in the course.',\n description: 'Warning message displayed when some learners could not be added to a cohort'\n },\n existingLearner: {\n id: 'instruct.cohorts.existingLearner',\n defaultMessage: '{learner} learner was already in the cohort.',\n description: 'Message indicating that a learner is already assigned to a cohort'\n },\n unknownLearner: {\n id: 'instruct.cohorts.unknownLearner',\n defaultMessage: 'Unknown username or email: {learner}',\n description: 'Message indicating that a learner is not recognized in the course'\n },\n downloadCSVCaption: {\n id: 'instruct.cohorts.downloadCSVCaption',\n defaultMessage: 'Assign learners to cohorts by uploading a CSV file',\n description: 'Caption for the learners CSV upload collapsible section'\n },\n uploadSuccessMessage: {\n id: 'instruct.cohorts.uploadSuccessMessage',\n defaultMessage: 'Your file {fileName} has been uploaded. Allow a few minutes for processing.',\n description: 'Message displayed when learners are successfully added to cohorts via CSV upload'\n },\n noFileFoundMessage: {\n id: 'instruct.cohorts.noFileFoundMessage',\n defaultMessage: 'No file found in upload data. Please try again.',\n description: 'Error message displayed when no file is found in the uploaded data'\n },\n});\n\nexport default messages;\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cohorts/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,QAAQ,GAAG,cAAc,CAAC;IAC9B,YAAY,EAAE;QACZ,EAAE,EAAE,wBAAwB;QAC5B,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,4BAA4B;KAC1C;IACD,SAAS,EAAE;QACT,EAAE,EAAE,4BAA4B;QAChC,cAAc,EAAE,YAAY;QAC5B,WAAW,EAAE,sCAAsC;KACpD;IACD,cAAc,EAAE;QACd,EAAE,EAAE,8CAA8C;QAClD,cAAc,EAAE,qHAAqH;QACrI,WAAW,EAAE,6DAA6D;KAC3E;IACD,WAAW,EAAE;QACX,EAAE,EAAE,2CAA2C;QAC/C,cAAc,EAAE,QAAQ;QACxB,WAAW,EAAE,0DAA0D;KACxE;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,4CAA4C;QAChD,cAAc,EAAE,SAAS;QACzB,WAAW,EAAE,2DAA2D;KACzE;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,mCAAmC;QACvC,cAAc,EAAE,+IAA+I;QAC/J,WAAW,EAAE,6CAA6C;KAC3D;IACD,SAAS,EAAE;QACT,EAAE,EAAE,4BAA4B;QAChC,cAAc,EAAE,YAAY;QAC5B,WAAW,EAAE,+BAA+B;KAC7C;IACD,aA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AAc,EAAE,sCAAsC;QACtD,WAAW,EAAE,mEAAmE;KACjF;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,oDAAoD;QACpE,WAAW,EAAE,yDAAyD;KACvE;IACD,oBAAoB,EAAE;QACpB,EAAE,EAAE,uCAAuC;QAC3C,cAAc,EAAE,6EAA6E;QAC7F,WAAW,EAAE,kFAAkF;KAChG;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,iDAAiD;QACjE,WAAW,EAAE,oEAAoE;KAClF;IACD,WAAW,EAAE;QACX,EAAE,EAAE,8BAA8B;QAClC,cAAc,EAAE,OAAO;QACvB,WAAW,EAAE,4BAA4B;KAC1C;IACD,iBAAiB,EAAE;QACjB,EAAE,EAAE,oCAAoC;QACxC,cAAc,EAAE,mEAAmE;QACnF,WAAW,EAAE,qDAAqD;KACnE;IACD,kBAAkB,EAAE;QAClB,EAAE,EAAE,qCAAqC;QACzC,cAAc,EAAE,oEAAoE;QACpF,WAAW,EAAE,sDAAsD;KACpE;IACD,eAAe,EAAE;QACf,EAAE,EAAE,kCAAkC;QACtC,cAAc,EAAE,sEAAsE;QACtF,WAAW,EAAE,qDAAqD;KACnE;CACF,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { defineMessages } from '@openedx/frontend-base';\n\nconst messages = defineMessages({\n cohortsTitle: {\n id: 'instruct.cohorts.title',\n defaultMessage: 'Cohorts',\n description: 'Title for the cohorts page'\n },\n addCohort: {\n id: 'instruct.cohorts.addCohort',\n defaultMessage: 'Add Cohort',\n description: 'Button label for adding a new cohort'\n },\n disableMessage: {\n id: 'instruct.cohorts.disableModal.disableMessage',\n defaultMessage: 'Disable Cohorts? Disabling cohorts while a course is in progress will cause an unexpected change for your learners.',\n description: 'Message displayed in the disable cohorts confirmation modal'\n },\n cancelLabel: {\n id: 'instruct.cohorts.disableModal.cancelLabel',\n defaultMessage: 'Cancel',\n description: 'Label for the cancel button in the disable cohorts modal'\n },\n disableLabel: {\n id: 'instruct.cohorts.disableModal.disableLabel',\n defaultMessage: 'Disable',\n description: 'Label for the disable button in the disable cohorts modal'\n },\n noCohortsMessage: {\n id: 'instruct.cohorts.noCohortsMessage',\n defaultMessage: 'You can use Cohorts to create smaller communities in your course, or to design different course experiences for different groups of learners.',\n description: 'Message displayed when there are no cohorts'\n },\n learnMore: {\n id: 'instruct.cohorts.learnMore',\n defaultMessage: 'Learn more',\n description: 'Label for the learn more link'\n },\n enableCohorts: {\n id: 'instruct.cohorts.enableCohorts',\n defaultMessage: 'Enable Cohorts',\n description: 'Label for the enable cohorts button'\n },\n disableCohorts: {\n id: 'instruct.cohorts.disableCohorts',\n defaultMessage: 'Disable Cohorts',\n description: 'Label for the disable cohorts button'\n },\n selectCohortPlaceholder: {\n id: 'instruct.cohorts.selectCohortPlaceholder',\n defaultMessage: 'Select a cohort',\n description: 'Placeholder text for the select cohort dropdown'\n },\n cohortName: {\n id: 'instruct.cohorts.cohortName',\n defaultMessage: 'Cohort Name',\n description: 'Label for the cohort name input field'\n },\n saveLabel: {\n id: 'instruct.cohorts.saveLabel',\n defaultMessage: 'Save',\n description: 'Label for the save button'\n },\n cohortAssignmentMethod: {\n id: 'instruct.cohorts.addForm.cohortAssignmentMethod',\n defaultMessage: 'Cohort Assignment Method',\n description: 'Label for the cohort assignment method section'\n },\n automatic: {\n id: 'instruct.cohorts.addForm.automatic',\n defaultMessage: 'Automatic',\n description: 'Label for the automatic cohort assignment method option'\n },\n manual: {\n id: 'instruct.cohorts.addForm.manual',\n defaultMessage: 'Manual',\n description: 'Label for the manual cohort assignment method option'\n },\n associatedContentGroup: {\n id: 'instruct.cohorts.addForm.associatedContentGroup',\n defaultMessage: 'Associated Content Group',\n description: 'Label for the associated content group section'\n },\n noContentGroup: {\n id: 'instruct.cohorts.addForm.noContentGroup',\n defaultMessage: 'No Content Group',\n description: 'Label for the no content group option'\n },\n selectAContentGroup: {\n id: 'instruct.cohorts.addForm.selectAContentGroup',\n defaultMessage: 'Select a Content Group',\n description: 'Label for the select a content group option'\n },\n notSelected: {\n id: 'instruct.cohorts.addForm.notSelected',\n defaultMessage: 'Not Selected',\n description: 'Label for the not selected content group option'\n },\n noContentGroups: {\n id: 'instruct.cohorts.addForm.noContentGroups',\n defaultMessage: 'No content groups exist.',\n description: 'Message displayed when there are no content groups'\n },\n createContentGroup: {\n id: 'instruct.cohorts.addForm.createContentGroup',\n defaultMessage: 'Create a content group',\n description: 'Label for the create a content group link'\n },\n addCohortSuccessMessage: {\n id: 'instruct.cohorts.addForm.successMessage',\n defaultMessage: 'The {cohortName} cohort has been created. You can manually add students to this cohort below.',\n description: 'Success message displayed when a new cohort is added'\n },\n cohortDisclaimer: {\n id: 'instruct.cohorts.cohortDisclaimer',\n defaultMessage: 'To review learner cohort assignments or see the results of uploading a CSV file, download course profile information or cohort results on the',\n description: 'Disclaimer message for cohorts'\n },\n page: {\n id: 'instruct.cohorts.page',\n defaultMessage: 'page',\n description: 'Label for the page link'\n },\n settings: {\n id: 'instruct.cohorts.settings',\n defaultMessage: 'Settings',\n description: 'Label for the settings tab'\n },\n manageLearners: {\n id: 'instruct.cohorts.manageLearners',\n defaultMessage: 'Manage Learners',\n description: 'Label for the manage learners tab'\n },\n studentsOnCohort: {\n id: 'instruct.cohorts.studentsOnCohort',\n defaultMessage: '(contains {users} students)',\n description: 'Label showing the number of students on this cohort'\n },\n automaticCohortWarning: {\n id: 'instruct.cohorts.automaticCohortWarning',\n defaultMessage: 'Learners are added to this cohort automatically.',\n description: 'Warning about automatic cohort assignment'\n },\n manualCohortWarning: {\n id: 'instruct.cohorts.manualCohortWarning',\n defaultMessage: 'Learners are added to this cohort only when you provide their email addresses or usernames on this page.',\n description: 'Warning about manual cohort assignment'\n },\n warningCohortLink: {\n id: 'instruct.cohorts.warningCohortLink',\n defaultMessage: 'What does this mean?',\n description: 'Link text for more information about cohort assignment'\n },\n cohortUpdateSuccessMessage: {\n id: 'instruct.cohorts.cohortUpdateSuccessMessage',\n defaultMessage: 'Settings have been saved.',\n description: 'Success message displayed when a cohort is updated'\n },\n addLearnersTitle: {\n id: 'instruct.cohorts.addLearnersTitle',\n defaultMessage: 'Add Learners to this cohort',\n description: 'Title for the add learners section'\n },\n addLearnersSubtitle: {\n id: 'instruct.cohorts.addLearnersSubtitle',\n defaultMessage: 'Note: Learners can be in only one cohort. Adding learners to this group overrides any previous group assignment.',\n description: 'Subtitle for the add learners section'\n },\n addLearnersInstructions: {\n id: 'instruct.cohorts.addLearnersInstructions',\n defaultMessage: 'Enter email addresses and/or usernames, separated by new lines or commas, for the learners you want to add.*',\n description: 'Instructions for adding learners to a cohort'\n },\n addLearnersFootnote: {\n id: 'instruct.cohorts.addLearnersFootnote',\n defaultMessage: 'You will not receive notification for emails that bounce, so double-check your spelling.',\n description: 'Footnote for adding learners to a cohort'\n },\n learnersExample: {\n id: 'instruct.cohorts.learnersExample',\n defaultMessage: 'e.g. johndoe@example.com, JaneDoe, Joeydoe@example.com',\n description: 'Placeholder for the learners example'\n },\n addLearnersLabel: {\n id: 'instruct.cohorts.addLearnersLabel',\n defaultMessage: 'Add Learners',\n description: 'Label for the add learners button'\n },\n manualAssignmentDisabledTooltip: {\n id: 'instruct.cohorts.manualAssignmentDisabledTooltip',\n defaultMessage: 'There must be one cohort to which students can automatically be assigned.',\n description: 'Tooltip message when manual assignment is disabled'\n },\n addLearnersSuccessMessage: {\n id: 'instruct.cohorts.addLearnersSuccessMessage',\n defaultMessage: '{countLearners} learners have been added to this cohort.',\n description: 'Success message displayed when learners are added to a cohort'\n },\n addLearnersErrorMessage: {\n id: 'instruct.cohorts.addLearnersErrorMessage',\n defaultMessage: '{countLearners} learners could not be added to this cohort.',\n description: 'Error message displayed when there is an issue adding learners to a cohort'\n },\n addLearnersWarningMessage: {\n id: 'instruct.cohorts.addLearnersWarningMessage',\n defaultMessage: '{countLearners} were pre-assigned for this cohort. This learner will automatically be added to the cohort when they enroll in the course.',\n description: 'Warning message displayed when some learners could not be added to a cohort'\n },\n existingLearner: {\n id: 'instruct.cohorts.existingLearner',\n defaultMessage: '{learner} learner was already in the cohort.',\n description: 'Message indicating that a learner is already assigned to a cohort'\n },\n unknownLearner: {\n id: 'instruct.cohorts.unknownLearner',\n defaultMessage: 'Unknown username or email: {learner}',\n description: 'Message indicating that a learner is not recognized in the course'\n },\n downloadCSVCaption: {\n id: 'instruct.cohorts.downloadCSVCaption',\n defaultMessage: 'Assign learners to cohorts by uploading a CSV file',\n description: 'Caption for the learners CSV upload collapsible section'\n },\n uploadSuccessMessage: {\n id: 'instruct.cohorts.uploadSuccessMessage',\n defaultMessage: 'Your file {fileName} has been uploaded. Allow a few minutes for processing.',\n description: 'Message displayed when learners are successfully added to cohorts via CSV upload'\n },\n noFileFoundMessage: {\n id: 'instruct.cohorts.noFileFoundMessage',\n defaultMessage: 'No file found in upload data. Please try again.',\n description: 'Error message displayed when no file is found in the uploaded data'\n },\n closeButton: {\n id: 'instruct.cohorts.closeButton',\n defaultMessage: 'Close',\n description: 'Label for the close button'\n },\n enableCohortError: {\n id: 'instruct.cohorts.enableCohortError',\n defaultMessage: 'An error occurred while enabling cohorts. Please try again later.',\n description: 'Error message displayed when enabling cohorts fails'\n },\n disableCohortError: {\n id: 'instruct.cohorts.disableCohortError',\n defaultMessage: 'An error occurred while disabling cohorts. Please try again later.',\n description: 'Error message displayed when disabling cohorts fails'\n },\n editCohortError: {\n id: 'instruct.cohorts.editCohortError',\n defaultMessage: 'An error occurred while saving your changes. Please try again later.',\n description: 'Error message displayed when editing a cohort fails'\n }\n});\n\nexport default messages;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openedx/frontend-app-instructor-dashboard",
3
- "version": "1.0.0-alpha.43",
3
+ "version": "1.0.0-alpha.44",
4
4
  "description": "The Open edX Instructor Dashboard",
5
5
  "repository": {
6
6
  "type": "git",