@openedx/frontend-app-instructor-dashboard 1.0.0-alpha.25 → 1.0.0-alpha.27
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/certificates/CertificatesPage.d.ts +1 -1
- package/dist/certificates/CertificatesPage.js +107 -55
- package/dist/certificates/CertificatesPage.js.map +1 -1
- package/dist/certificates/CertificatesPage.scss +9 -0
- package/dist/certificates/components/CertificateTable.d.ts +1 -1
- package/dist/certificates/components/CertificateTable.js +9 -6
- package/dist/certificates/components/CertificateTable.js.map +1 -1
- package/dist/certificates/components/CertificatesPageHeader.js +3 -3
- package/dist/certificates/components/CertificatesPageHeader.js.map +1 -1
- package/dist/certificates/components/CertificatesToolbar.d.ts +2 -1
- package/dist/certificates/components/CertificatesToolbar.js +23 -3
- package/dist/certificates/components/CertificatesToolbar.js.map +1 -1
- package/dist/certificates/components/DisableCertificatesModal.js +1 -1
- package/dist/certificates/components/DisableCertificatesModal.js.map +1 -1
- package/dist/certificates/components/FilterDropdown.d.ts +1 -1
- package/dist/certificates/components/FilterDropdown.js +2 -2
- package/dist/certificates/components/FilterDropdown.js.map +1 -1
- package/dist/certificates/components/GenerationHistoryTable.d.ts +2 -2
- package/dist/certificates/components/GenerationHistoryTable.js +3 -18
- package/dist/certificates/components/GenerationHistoryTable.js.map +1 -1
- package/dist/certificates/components/GrantExceptionsModal.d.ts +1 -1
- package/dist/certificates/components/GrantExceptionsModal.js +2 -2
- package/dist/certificates/components/GrantExceptionsModal.js.map +1 -1
- package/dist/certificates/components/InvalidateCertificateModal.d.ts +1 -1
- package/dist/certificates/components/InvalidateCertificateModal.js +2 -2
- package/dist/certificates/components/InvalidateCertificateModal.js.map +1 -1
- package/dist/certificates/components/IssuedCertificatesTab.d.ts +1 -1
- package/dist/certificates/components/IssuedCertificatesTab.js +2 -2
- package/dist/certificates/components/IssuedCertificatesTab.js.map +1 -1
- package/dist/certificates/components/LearnerActionModal.d.ts +1 -1
- package/dist/certificates/components/LearnerActionModal.js +7 -2
- package/dist/certificates/components/LearnerActionModal.js.map +1 -1
- package/dist/certificates/components/RemoveExceptionModal.d.ts +9 -0
- package/dist/certificates/components/RemoveExceptionModal.js +10 -0
- package/dist/certificates/components/RemoveExceptionModal.js.map +1 -0
- package/dist/certificates/components/RemoveInvalidationModal.js +1 -1
- package/dist/certificates/components/RemoveInvalidationModal.js.map +1 -1
- package/dist/certificates/data/api.d.ts +17 -3
- package/dist/certificates/data/api.js +60 -8
- package/dist/certificates/data/api.js.map +1 -1
- package/dist/certificates/data/apiHook.d.ts +25 -5
- package/dist/certificates/data/apiHook.js +30 -2
- package/dist/certificates/data/apiHook.js.map +1 -1
- package/dist/certificates/data/queryKeys.d.ts +2 -1
- package/dist/certificates/data/queryKeys.js +1 -0
- package/dist/certificates/data/queryKeys.js.map +1 -1
- package/dist/certificates/messages.d.ts +30 -0
- package/dist/certificates/messages.js +30 -0
- package/dist/certificates/messages.js.map +1 -1
- package/dist/certificates/types.d.ts +7 -2
- package/dist/certificates/types.js.map +1 -1
- package/dist/certificates/utils/filterUtils.d.ts +1 -1
- package/dist/certificates/utils/filterUtils.js +1 -1
- package/dist/certificates/utils/filterUtils.js.map +1 -1
- package/dist/certificates/utils/index.d.ts +2 -2
- package/dist/certificates/utils/index.js +1 -1
- package/dist/certificates/utils/index.js.map +1 -1
- package/dist/components/SpecifyLearnerField.js +10 -4
- package/dist/components/SpecifyLearnerField.js.map +1 -1
- package/dist/components/messages.d.ts +5 -0
- package/dist/components/messages.js +6 -1
- package/dist/components/messages.js.map +1 -1
- package/dist/courseInfo/types.d.ts +2 -0
- package/dist/courseInfo/types.js.map +1 -1
- package/dist/courseTeam/CourseTeamPage.js +7 -2
- package/dist/courseTeam/CourseTeamPage.js.map +1 -1
- package/dist/courseTeam/messages.d.ts +5 -0
- package/dist/courseTeam/messages.js +5 -0
- package/dist/courseTeam/messages.js.map +1 -1
- package/dist/specialExams/SpecialExamsPage.js +6 -2
- package/dist/specialExams/SpecialExamsPage.js.map +1 -1
- package/dist/specialExams/components/AddAllowanceModal.d.ts +6 -0
- package/dist/specialExams/components/AddAllowanceModal.js +84 -0
- package/dist/specialExams/components/AddAllowanceModal.js.map +1 -0
- package/dist/specialExams/components/Allowances.js +28 -2
- package/dist/specialExams/components/Allowances.js.map +1 -1
- package/dist/specialExams/components/AllowancesList.d.ts +8 -0
- package/dist/specialExams/components/AllowancesList.js +58 -0
- package/dist/specialExams/components/AllowancesList.js.map +1 -0
- package/dist/specialExams/components/AttemptsList.js +8 -7
- package/dist/specialExams/components/AttemptsList.js.map +1 -1
- package/dist/specialExams/components/DeleteAllowanceModal.d.ts +8 -0
- package/dist/specialExams/components/DeleteAllowanceModal.js +29 -0
- package/dist/specialExams/components/DeleteAllowanceModal.js.map +1 -0
- package/dist/specialExams/components/EditAllowanceModal.d.ts +8 -0
- package/dist/specialExams/components/EditAllowanceModal.js +62 -0
- package/dist/specialExams/components/EditAllowanceModal.js.map +1 -0
- package/dist/specialExams/constants.d.ts +43 -0
- package/dist/specialExams/constants.js +19 -0
- package/dist/specialExams/constants.js.map +1 -0
- package/dist/specialExams/data/api.d.ts +5 -1
- package/dist/specialExams/data/api.js +28 -2
- package/dist/specialExams/data/api.js.map +1 -1
- package/dist/specialExams/data/apiHook.d.ts +5 -1
- package/dist/specialExams/data/apiHook.js +30 -2
- package/dist/specialExams/data/apiHook.js.map +1 -1
- package/dist/specialExams/data/queryKeys.d.ts +4 -1
- package/dist/specialExams/data/queryKeys.js +4 -1
- package/dist/specialExams/data/queryKeys.js.map +1 -1
- package/dist/specialExams/messages.d.ts +165 -0
- package/dist/specialExams/messages.js +165 -0
- package/dist/specialExams/messages.js.map +1 -1
- package/dist/specialExams/types.d.ts +55 -4
- package/dist/specialExams/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/certificates/data/dummyData.d.ts +0 -2
- package/dist/certificates/data/dummyData.js +0 -234
- package/dist/certificates/data/dummyData.js.map +0 -1
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Dropdown } from '@openedx/paragon';
|
|
3
3
|
import { FilterList } from '@openedx/paragon/icons';
|
|
4
4
|
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
-
import { CertificateFilter } from '
|
|
6
|
-
import messages from '
|
|
5
|
+
import { CertificateFilter } from '../../certificates/types';
|
|
6
|
+
import messages from '../../certificates/messages';
|
|
7
7
|
const FILTER_OPTIONS = [
|
|
8
8
|
{
|
|
9
9
|
value: CertificateFilter.ALL_LEARNERS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterDropdown.js","sourceRoot":"","sources":["../../../src/certificates/components/FilterDropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"FilterDropdown.js","sourceRoot":"","sources":["../../../src/certificates/components/FilterDropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAQlD,MAAM,cAAc,GAAG;IACrB;QACE,KAAK,EAAE,iBAAiB,CAAC,YAAY;QACrC,UAAU,EAAE,mBAAmB;KAChC;IACD;QACE,KAAK,EAAE,iBAAiB,CAAC,QAAQ;QACjC,UAAU,EAAE,gBAAgB;KAC7B;IACD;QACE,KAAK,EAAE,iBAAiB,CAAC,YA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AC,MAAM,EAAE,EAAE,CAAC,CAC9B,KAAC,QAAQ,CAAC,IAAI,IAEZ,MAAM,EAAE,MAAM,CAAC,KAAK,KAAK,KAAK,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EACrC,SAAS,EAAC,sBAAsB,YAE/B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAL3C,MAAM,CAAC,KAAK,CAMH,CACjB,CAAC,GACY,IACP,CACZ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { Dropdown } from '@openedx/paragon';\nimport { FilterList } from '@openedx/paragon/icons';\nimport { useIntl } from '@openedx/frontend-base';\nimport { CertificateFilter } from '@src/certificates/types';\nimport messages from '@src/certificates/messages';\n\ninterface FilterDropdownProps {\n value: CertificateFilter,\n onChange: (value: CertificateFilter) => void,\n className?: string,\n}\n\nconst FILTER_OPTIONS = [\n {\n value: CertificateFilter.ALL_LEARNERS,\n messageKey: 'filterAllLearners',\n },\n {\n value: CertificateFilter.RECEIVED,\n messageKey: 'filterReceived',\n },\n {\n value: CertificateFilter.NOT_RECEIVED,\n messageKey: 'filterNotReceived',\n },\n {\n value: CertificateFilter.AUDIT_PASSING,\n messageKey: 'filterAuditPassing',\n },\n {\n value: CertificateFilter.AUDIT_NOT_PASSING,\n messageKey: 'filterAuditNotPassing',\n },\n {\n value: CertificateFilter.ERROR_STATE,\n messageKey: 'filterErrorState',\n },\n {\n value: CertificateFilter.GRANTED_EXCEPTIONS,\n messageKey: 'filterGrantedExceptions',\n },\n {\n value: CertificateFilter.INVALIDATED,\n messageKey: 'filterInvalidated',\n },\n] as const;\n\nconst FilterDropdown = ({ value, onChange, className }: FilterDropdownProps) => {\n const intl = useIntl();\n\n const selectedOption = FILTER_OPTIONS.find((option) => option.value === value);\n const selectedLabel = selectedOption\n ? intl.formatMessage(messages[selectedOption.messageKey])\n : intl.formatMessage(messages.filterAllLearners);\n\n return (\n <Dropdown className={`certificates-filter-dropdown ${className || ''}`}>\n <Dropdown.Toggle\n id=\"filter-dropdown\"\n variant=\"outline-primary\"\n className=\"d-flex align-items-center justify-content-between w-100\"\n >\n <span className=\"d-flex align-items-center\">\n <FilterList className=\"mr-2\" />\n {selectedLabel}\n </span>\n </Dropdown.Toggle>\n <Dropdown.Menu>\n {FILTER_OPTIONS.map((option) => (\n <Dropdown.Item\n key={option.value}\n active={option.value === value}\n onClick={() => onChange(option.value)}\n className=\"filter-dropdown-item\"\n >\n {intl.formatMessage(messages[option.messageKey])}\n </Dropdown.Item>\n ))}\n </Dropdown.Menu>\n </Dropdown>\n );\n};\n\nexport default FilterDropdown;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CertificateGenerationHistory } from '../../certificates/types';
|
|
2
2
|
interface GenerationHistoryTableProps {
|
|
3
|
-
data:
|
|
3
|
+
data: CertificateGenerationHistory[];
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
itemCount: number;
|
|
6
6
|
pageCount: number;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { DataTable } from '@openedx/paragon';
|
|
4
4
|
import { useIntl } from '@openedx/frontend-base';
|
|
5
|
-
import messages from '
|
|
5
|
+
import messages from '../../certificates/messages';
|
|
6
6
|
const GenerationHistoryTable = ({ data, isLoading, itemCount, pageCount, currentPage, onPageChange, }) => {
|
|
7
7
|
const intl = useIntl();
|
|
8
8
|
const columns = useMemo(() => [
|
|
@@ -12,26 +12,11 @@ const GenerationHistoryTable = ({ data, isLoading, itemCount, pageCount, current
|
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
Header: intl.formatMessage(messages.columnDate),
|
|
15
|
-
accessor: '
|
|
16
|
-
Cell: ({ value }) => {
|
|
17
|
-
if (!value)
|
|
18
|
-
return null;
|
|
19
|
-
return intl.formatDate(new Date(value), {
|
|
20
|
-
year: 'numeric',
|
|
21
|
-
month: '2-digit',
|
|
22
|
-
day: '2-digit',
|
|
23
|
-
hour: '2-digit',
|
|
24
|
-
minute: '2-digit',
|
|
25
|
-
});
|
|
26
|
-
},
|
|
15
|
+
accessor: 'date',
|
|
27
16
|
},
|
|
28
17
|
{
|
|
29
18
|
Header: intl.formatMessage(messages.columnDetails),
|
|
30
|
-
accessor: '
|
|
31
|
-
Cell: ({ row }) => {
|
|
32
|
-
const { taskState, taskOutput } = row.original;
|
|
33
|
-
return (_jsxs("div", { children: [_jsxs("div", { children: [_jsx("strong", { children: "Status:" }), " ", taskState] }), taskOutput && (_jsx("div", { className: "mt-1 text-gray-700", children: _jsx("small", { children: taskOutput }) }))] }));
|
|
34
|
-
},
|
|
19
|
+
accessor: 'details',
|
|
35
20
|
},
|
|
36
21
|
], [intl]);
|
|
37
22
|
return (_jsxs(DataTable, { columns: columns, data: data, isLoading: isLoading, isPaginated: true, itemCount: itemCount, pageCount: pageCount, manualPagination: true, fetchData: ({ pageIndex }) => onPageChange(pageIndex), initialState: { pageIndex: currentPage, pageSize: 25 }, children: [_jsx(DataTable.Table, {}), _jsx(DataTable.EmptyTable, { content: intl.formatMessage(messages.noTasksMessage) }), itemCount > 0 && (_jsxs(DataTable.TableFooter, { children: [_jsx(DataTable.RowStatus, {}), _jsx(DataTable.TablePagination, {})] }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerationHistoryTable.js","sourceRoot":"","sources":["../../../src/certificates/components/GenerationHistoryTable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"GenerationHistoryTable.js","sourceRoot":"","sources":["../../../src/certificates/components/GenerationHistoryTable.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAWlD,MAAM,sBAAsB,GAAG,CAAC,EAC9B,IAAI,EACJ,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,YAAY,GACgB,EAAE,EAAE;IAChC,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,MAAM,OAAO,GAAG,OAAO,CACrB,GAAG,EAAE,CAAC;QACJ;YACE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC;YACnD,QAAQ,EAAE,UAAU;SACrB;QACD;YACE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC;YAC/C,QAAQ,EAAE,MAAM;SACjB;QACD;YACE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC;YAClD,QAAQ,EAAE,SAAS;SACpB;KACF,EACD,CAAC,IAAI,CAAC,CACP,CAAC;IAEF,OAAO,CACL,MAAC,SAAS,IACR,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,WAAW,QACX,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,gBAAgB,QAChB,SAAS,EAAE,CAAC,EAAE,SAAS,EAAyB,EAAE,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,EAC5E,YAAY,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE,aAEtD,KAAC,SAAS,CAAC,KAAK,KAAG,EACnB,KAAC,SAAS,CAAC,UAAU,IAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAI,EAC7E,SAAS,GAAG,CAAC,IAAI,CAChB,MAAC,SAAS,CAAC,WAAW,eACpB,KAAC,SAAS,CAAC,SAAS,KAAG,EACvB,KAAC,SAAS,CAAC,eAAe,KAAG,IACP,CACzB,IACS,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport { DataTable } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport type { CertificateGenerationHistory } from '@src/certificates/types';\nimport messages from '@src/certificates/messages';\n\ninterface GenerationHistoryTableProps {\n data: CertificateGenerationHistory[],\n isLoading: boolean,\n itemCount: number,\n pageCount: number,\n currentPage: number,\n onPageChange: (pageIndex: number) => void,\n}\n\nconst GenerationHistoryTable = ({\n data,\n isLoading,\n itemCount,\n pageCount,\n currentPage,\n onPageChange,\n}: GenerationHistoryTableProps) => {\n const intl = useIntl();\n\n const columns = useMemo(\n () => [\n {\n Header: intl.formatMessage(messages.columnTaskName),\n accessor: 'taskName',\n },\n {\n Header: intl.formatMessage(messages.columnDate),\n accessor: 'date',\n },\n {\n Header: intl.formatMessage(messages.columnDetails),\n accessor: 'details',\n },\n ],\n [intl],\n );\n\n return (\n <DataTable\n columns={columns}\n data={data}\n isLoading={isLoading}\n isPaginated\n itemCount={itemCount}\n pageCount={pageCount}\n manualPagination\n fetchData={({ pageIndex }: { pageIndex: number }) => onPageChange(pageIndex)}\n initialState={{ pageIndex: currentPage, pageSize: 25 }}\n >\n <DataTable.Table />\n <DataTable.EmptyTable content={intl.formatMessage(messages.noTasksMessage)} />\n {itemCount > 0 && (\n <DataTable.TableFooter>\n <DataTable.RowStatus />\n <DataTable.TablePagination />\n </DataTable.TableFooter>\n )}\n </DataTable>\n );\n};\n\nexport default GenerationHistoryTable;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface GrantExceptionsModalProps {
|
|
2
2
|
isOpen: boolean;
|
|
3
3
|
onClose: () => void;
|
|
4
|
-
onSubmit: (learners: string, notes: string) => void;
|
|
4
|
+
onSubmit: (learners: string[], notes: string) => void;
|
|
5
5
|
isSubmitting: boolean;
|
|
6
6
|
}
|
|
7
7
|
declare const GrantExceptionsModal: ({ isOpen, onClose, onSubmit, isSubmitting, }: GrantExceptionsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useIntl } from '@openedx/frontend-base';
|
|
3
|
-
import LearnerActionModal from '
|
|
4
|
-
import messages from '
|
|
3
|
+
import LearnerActionModal from '../../certificates/components/LearnerActionModal';
|
|
4
|
+
import messages from '../../certificates/messages';
|
|
5
5
|
const GrantExceptionsModal = ({ isOpen, onClose, onSubmit, isSubmitting, }) => {
|
|
6
6
|
const intl = useIntl();
|
|
7
7
|
return (_jsx(LearnerActionModal, { isOpen: isOpen, onClose: onClose, onSubmit: onSubmit, isSubmitting: isSubmitting, title: intl.formatMessage(messages.grantExceptionsModalTitle), description: intl.formatMessage(messages.grantExceptionsModalDescription), learnersLabel: intl.formatMessage(messages.learnersLabel), learnersPlaceholder: intl.formatMessage(messages.learnersPlaceholder), notesLabel: intl.formatMessage(messages.notesLabel), notesPlaceholder: intl.formatMessage(messages.notesPlaceholder), submitLabel: intl.formatMessage(messages.submit), cancelLabel: intl.formatMessage(messages.cancel) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrantExceptionsModal.js","sourceRoot":"","sources":["../../../src/certificates/components/GrantExceptionsModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,kBAAkB,MAAM,
|
|
1
|
+
{"version":3,"file":"GrantExceptionsModal.js","sourceRoot":"","sources":["../../../src/certificates/components/GrantExceptionsModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,kBAAkB,MAAM,iDAAiD,CAAC;AACjF,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AASlD,MAAM,oBAAoB,GAAG,CAAC,EAC5B,MAAM,EACN,OAAO,EACP,QAAQ,EACR,YAAY,GACc,EAAE,EAAE;IAC9B,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,OAAO,CACL,KAAC,kBAAkB,IACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAC7D,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EACzE,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,EACzD,mBAAmB,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EACrE,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,EACnD,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAC/D,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,EAChD,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,GAChD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import { useIntl } from '@openedx/frontend-base';\nimport LearnerActionModal from '@src/certificates/components/LearnerActionModal';\nimport messages from '@src/certificates/messages';\n\ninterface GrantExceptionsModalProps {\n isOpen: boolean,\n onClose: () => void,\n onSubmit: (learners: string[], notes: string) => void,\n isSubmitting: boolean,\n}\n\nconst GrantExceptionsModal = ({\n isOpen,\n onClose,\n onSubmit,\n isSubmitting,\n}: GrantExceptionsModalProps) => {\n const intl = useIntl();\n\n return (\n <LearnerActionModal\n isOpen={isOpen}\n onClose={onClose}\n onSubmit={onSubmit}\n isSubmitting={isSubmitting}\n title={intl.formatMessage(messages.grantExceptionsModalTitle)}\n description={intl.formatMessage(messages.grantExceptionsModalDescription)}\n learnersLabel={intl.formatMessage(messages.learnersLabel)}\n learnersPlaceholder={intl.formatMessage(messages.learnersPlaceholder)}\n notesLabel={intl.formatMessage(messages.notesLabel)}\n notesPlaceholder={intl.formatMessage(messages.notesPlaceholder)}\n submitLabel={intl.formatMessage(messages.submit)}\n cancelLabel={intl.formatMessage(messages.cancel)}\n />\n );\n};\n\nexport default GrantExceptionsModal;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface InvalidateCertificateModalProps {
|
|
2
2
|
isOpen: boolean;
|
|
3
3
|
onClose: () => void;
|
|
4
|
-
onSubmit: (learners: string, notes: string) => void;
|
|
4
|
+
onSubmit: (learners: string[], notes: string) => void;
|
|
5
5
|
isSubmitting: boolean;
|
|
6
6
|
}
|
|
7
7
|
declare const InvalidateCertificateModal: ({ isOpen, onClose, onSubmit, isSubmitting, }: InvalidateCertificateModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useIntl } from '@openedx/frontend-base';
|
|
3
|
-
import LearnerActionModal from '
|
|
4
|
-
import messages from '
|
|
3
|
+
import LearnerActionModal from '../../certificates/components/LearnerActionModal';
|
|
4
|
+
import messages from '../../certificates/messages';
|
|
5
5
|
const InvalidateCertificateModal = ({ isOpen, onClose, onSubmit, isSubmitting, }) => {
|
|
6
6
|
const intl = useIntl();
|
|
7
7
|
return (_jsx(LearnerActionModal, { isOpen: isOpen, onClose: onClose, onSubmit: onSubmit, isSubmitting: isSubmitting, title: intl.formatMessage(messages.invalidateCertificateModalTitle), description: intl.formatMessage(messages.invalidateCertificateModalDescription), learnersLabel: intl.formatMessage(messages.learnersLabel), learnersPlaceholder: intl.formatMessage(messages.learnersPlaceholder), notesLabel: intl.formatMessage(messages.notesLabel), notesPlaceholder: intl.formatMessage(messages.notesPlaceholder), submitLabel: intl.formatMessage(messages.submit), cancelLabel: intl.formatMessage(messages.cancel) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvalidateCertificateModal.js","sourceRoot":"","sources":["../../../src/certificates/components/InvalidateCertificateModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,kBAAkB,MAAM,
|
|
1
|
+
{"version":3,"file":"InvalidateCertificateModal.js","sourceRoot":"","sources":["../../../src/certificates/components/InvalidateCertificateModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,kBAAkB,MAAM,iDAAiD,CAAC;AACjF,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AASlD,MAAM,0BAA0B,GAAG,CAAC,EAClC,MAAM,EACN,OAAO,EACP,QAAQ,EACR,YAAY,GACoB,EAAE,EAAE;IACpC,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,OAAO,CACL,KAAC,kBAAkB,IACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,+BAA+B,CAAC,EACnE,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,qCAAqC,CAAC,EAC/E,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,EACzD,mBAAmB,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EACrE,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,EACnD,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAC/D,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,EAChD,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,GAChD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC","sourcesContent":["import { useIntl } from '@openedx/frontend-base';\nimport LearnerActionModal from '@src/certificates/components/LearnerActionModal';\nimport messages from '@src/certificates/messages';\n\ninterface InvalidateCertificateModalProps {\n isOpen: boolean,\n onClose: () => void,\n onSubmit: (learners: string[], notes: string) => void,\n isSubmitting: boolean,\n}\n\nconst InvalidateCertificateModal = ({\n isOpen,\n onClose,\n onSubmit,\n isSubmitting,\n}: InvalidateCertificateModalProps) => {\n const intl = useIntl();\n\n return (\n <LearnerActionModal\n isOpen={isOpen}\n onClose={onClose}\n onSubmit={onSubmit}\n isSubmitting={isSubmitting}\n title={intl.formatMessage(messages.invalidateCertificateModalTitle)}\n description={intl.formatMessage(messages.invalidateCertificateModalDescription)}\n learnersLabel={intl.formatMessage(messages.learnersLabel)}\n learnersPlaceholder={intl.formatMessage(messages.learnersPlaceholder)}\n notesLabel={intl.formatMessage(messages.notesLabel)}\n notesPlaceholder={intl.formatMessage(messages.notesPlaceholder)}\n submitLabel={intl.formatMessage(messages.submit)}\n cancelLabel={intl.formatMessage(messages.cancel)}\n />\n );\n};\n\nexport default InvalidateCertificateModal;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import CertificateTable from '
|
|
3
|
-
import CertificatesToolbar from '
|
|
2
|
+
import CertificateTable from '../../certificates/components/CertificateTable';
|
|
3
|
+
import CertificatesToolbar from '../../certificates/components/CertificatesToolbar';
|
|
4
4
|
const IssuedCertificatesTab = ({ data, isLoading, itemCount, pageCount, search, onSearchChange, filter, onFilterChange, currentPage, onPageChange, onRemoveException, onRemoveInvalidation, onRegenerateCertificates, }) => (_jsxs("div", { className: "d-flex flex-column certificates-tab-container", children: [_jsx(CertificatesToolbar, { search: search, onSearchChange: onSearchChange, filter: filter, onFilterChange: onFilterChange, onRegenerateCertificates: onRegenerateCertificates }), _jsx("div", { className: "certificates-table-wrapper", children: _jsx(CertificateTable, { data: data, isLoading: isLoading, itemCount: itemCount, pageCount: pageCount, currentPage: currentPage, filter: filter, onPageChange: onPageChange, onRemoveException: onRemoveException, onRemoveInvalidation: onRemoveInvalidation }) })] }));
|
|
5
5
|
export default IssuedCertificatesTab;
|
|
6
6
|
//# sourceMappingURL=IssuedCertificatesTab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IssuedCertificatesTab.js","sourceRoot":"","sources":["../../../src/certificates/components/IssuedCertificatesTab.tsx"],"names":[],"mappings":";AAAA,OAAO,gBAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"IssuedCertificatesTab.js","sourceRoot":"","sources":["../../../src/certificates/components/IssuedCertificatesTab.tsx"],"names":[],"mappings":";AAAA,OAAO,gBAAgB,MAAM,+CAA+C,CAAC;AAC7E,OAAO,mBAAmB,MAAM,kDAAkD,CAAC;AAmBnF,MAAM,qBAAqB,GAAG,CAAC,EAC7B,IAAI,EACJ,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,cAAc,EACd,MAAM,EACN,cAAc,EACd,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,GACG,EAAE,EAAE,CAAC,CAChC,eAAK,SAAS,EAAC,+CAA+C,aAC5D,KAAC,mBAAmB,IAClB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,wBAAwB,EAAE,wBAAwB,GAClD,EACF,cAAK,SAAS,EAAC,4BAA4B,YACzC,KAAC,gBAAgB,IACf,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,oBAAoB,EAAE,oBAAoB,GAC1C,GACE,IACF,CACP,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import CertificateTable from '@src/certificates/components/CertificateTable';\nimport CertificatesToolbar from '@src/certificates/components/CertificatesToolbar';\nimport { CertificateData, CertificateFilter } from '@src/certificates/types';\n\ninterface IssuedCertificatesTabProps {\n data: CertificateData[],\n isLoading: boolean,\n itemCount: number,\n pageCount: number,\n search: string,\n onSearchChange: (value: string) => void,\n filter: CertificateFilter,\n onFilterChange: (value: CertificateFilter) => void,\n currentPage: number,\n onPageChange: (page: number) => void,\n onRemoveException: (username: string, email: string) => void,\n onRemoveInvalidation: (username: string, email: string) => void,\n onRegenerateCertificates: () => void,\n}\n\nconst IssuedCertificatesTab = ({\n data,\n isLoading,\n itemCount,\n pageCount,\n search,\n onSearchChange,\n filter,\n onFilterChange,\n currentPage,\n onPageChange,\n onRemoveException,\n onRemoveInvalidation,\n onRegenerateCertificates,\n}: IssuedCertificatesTabProps) => (\n <div className=\"d-flex flex-column certificates-tab-container\">\n <CertificatesToolbar\n search={search}\n onSearchChange={onSearchChange}\n filter={filter}\n onFilterChange={onFilterChange}\n onRegenerateCertificates={onRegenerateCertificates}\n />\n <div className=\"certificates-table-wrapper\">\n <CertificateTable\n data={data}\n isLoading={isLoading}\n itemCount={itemCount}\n pageCount={pageCount}\n currentPage={currentPage}\n filter={filter}\n onPageChange={onPageChange}\n onRemoveException={onRemoveException}\n onRemoveInvalidation={onRemoveInvalidation}\n />\n </div>\n </div>\n);\n\nexport default IssuedCertificatesTab;\n"]}
|
|
@@ -5,8 +5,13 @@ const LearnerActionModal = ({ isOpen, onClose, onSubmit, isSubmitting, title, de
|
|
|
5
5
|
const [learners, setLearners] = useState('');
|
|
6
6
|
const [notes, setNotes] = useState('');
|
|
7
7
|
const handleSubmit = () => {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
// Parse comma-separated learners and filter out empty strings
|
|
9
|
+
const learnersArray = learners
|
|
10
|
+
.split(',')
|
|
11
|
+
.map((learner) => learner.trim())
|
|
12
|
+
.filter((learner) => learner.length > 0);
|
|
13
|
+
if (learnersArray.length > 0) {
|
|
14
|
+
onSubmit(learnersArray, notes);
|
|
10
15
|
setLearners('');
|
|
11
16
|
setNotes('');
|
|
12
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LearnerActionModal.js","sourceRoot":"","sources":["../../../src/certificates/components/LearnerActionModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAiBxE,MAAM,kBAAkB,GAAG,CAAC,EAC1B,MAAM,EACN,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,mBAAmB,GACK,EAAE,EAAE;IAC5B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEvC,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,
|
|
1
|
+
{"version":3,"file":"LearnerActionModal.js","sourceRoot":"","sources":["../../../src/certificates/components/LearnerActionModal.tsx"],"names":[],"mappings":";AAAA,OAAO,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AC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { useState } from 'react';\nimport { ActionRow, Button, Form, ModalDialog } from '@openedx/paragon';\n\ninterface LearnerActionModalProps {\n isOpen: boolean,\n onClose: () => void,\n onSubmit: (learners: string[], notes: string) => void,\n isSubmitting: boolean,\n title: string,\n description: string,\n notesLabel: string,\n notesPlaceholder: string,\n submitLabel: string,\n cancelLabel: string,\n learnersLabel: string,\n learnersPlaceholder: string,\n}\n\nconst LearnerActionModal = ({\n isOpen,\n onClose,\n onSubmit,\n isSubmitting,\n title,\n description,\n notesLabel,\n notesPlaceholder,\n submitLabel,\n cancelLabel,\n learnersLabel,\n learnersPlaceholder,\n}: LearnerActionModalProps) => {\n const [learners, setLearners] = useState('');\n const [notes, setNotes] = useState('');\n\n const handleSubmit = () => {\n // Parse comma-separated learners and filter out empty strings\n const learnersArray = learners\n .split(',')\n .map((learner) => learner.trim())\n .filter((learner) => learner.length > 0);\n\n if (learnersArray.length > 0) {\n onSubmit(learnersArray, notes);\n setLearners('');\n setNotes('');\n }\n };\n\n const handleClose = () => {\n setLearners('');\n setNotes('');\n onClose();\n };\n\n return (\n <ModalDialog\n isOpen={isOpen}\n onClose={handleClose}\n hasCloseButton\n title={title}\n className=\"p-4\"\n isOverflowVisible={false}\n >\n <ModalDialog.Header>\n <ModalDialog.Title>{title}</ModalDialog.Title>\n </ModalDialog.Header>\n <ModalDialog.Body>\n <p className=\"mb-3\">{description}</p>\n <Form.Group className=\"mb-3\">\n <Form.Label>{learnersLabel}</Form.Label>\n <Form.Control\n as=\"textarea\"\n rows={4}\n placeholder={learnersPlaceholder}\n value={learners}\n onChange={(e) => setLearners(e.target.value)}\n />\n </Form.Group>\n <Form.Group className=\"mt-3\">\n <Form.Label>{notesLabel}</Form.Label>\n <Form.Control\n as=\"textarea\"\n rows={3}\n placeholder={notesPlaceholder}\n value={notes}\n onChange={(e) => setNotes(e.target.value)}\n />\n </Form.Group>\n </ModalDialog.Body>\n <ModalDialog.Footer>\n <ActionRow>\n <Button variant=\"tertiary\" onClick={handleClose} disabled={isSubmitting}>\n {cancelLabel}\n </Button>\n <Button variant=\"primary\" onClick={handleSubmit} disabled={isSubmitting || !learners.trim()}>\n {submitLabel}\n </Button>\n </ActionRow>\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nexport default LearnerActionModal;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface RemoveExceptionModalProps {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
email: string;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
isSubmitting: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const RemoveExceptionModal: ({ isOpen, email, onClose, onConfirm, isSubmitting, }: RemoveExceptionModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default RemoveExceptionModal;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ActionRow, Button, ModalDialog } from '@openedx/paragon';
|
|
3
|
+
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
+
import messages from '../../certificates/messages';
|
|
5
|
+
const RemoveExceptionModal = ({ isOpen, email, onClose, onConfirm, isSubmitting, }) => {
|
|
6
|
+
const intl = useIntl();
|
|
7
|
+
return (_jsxs(ModalDialog, { isOpen: isOpen, onClose: onClose, hasCloseButton: false, title: intl.formatMessage(messages.removeExceptionModalTitle), className: "p-4", isOverflowVisible: false, children: [_jsx(ModalDialog.Header, { children: _jsx(ModalDialog.Title, { children: intl.formatMessage(messages.removeExceptionModalTitle) }) }), _jsx(ModalDialog.Body, { children: _jsx("p", { className: "mb-2.5", children: intl.formatMessage(messages.removeExceptionModalMessage, { email }) }) }), _jsx(ModalDialog.Footer, { children: _jsxs(ActionRow, { children: [_jsx(Button, { variant: "tertiary", onClick: onClose, disabled: isSubmitting, children: intl.formatMessage(messages.cancel) }), _jsx(Button, { variant: "primary", onClick: onConfirm, disabled: isSubmitting, children: intl.formatMessage(messages.removeExceptionAction) })] }) })] }));
|
|
8
|
+
};
|
|
9
|
+
export default RemoveExceptionModal;
|
|
10
|
+
//# sourceMappingURL=RemoveExceptionModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoveExceptionModal.js","sourceRoot":"","sources":["../../../src/certificates/components/RemoveExceptionModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAUlD,MAAM,oBAAoB,GAAG,CAAC,EAC5B,MAAM,EACN,KAAK,EACL,OAAO,EACP,SAAS,EACT,YAAY,GACc,EAAE,EAAE;IAC9B,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,OAAO,CACL,MAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,KAAK,EACrB,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,EAC7D,SAAS,EAAC,KAAK,EACf,iBAAiB,EAAE,KAAK,aAExB,KAAC,WAAW,CAAC,MAAM,cACjB,KAAC,WAAW,CAAC,KAAK,cACf,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,yBAAyB,CAAC,GACrC,GACD,EACrB,KAAC,WAAW,CAAC,IAAI,cACf,YAAG,SAAS,EAAC,QAAQ,YAClB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,2BAA2B,EAAE,EAAE,KAAK,EAAE,CAAC,GAClE,GACa,EACnB,KAAC,WAAW,CAAC,MAAM,cACjB,MAAC,SAAS,eACR,KAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,YAChE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,GAC7B,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,YACjE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,qBAAqB,CAAC,GAC5C,IACC,GACO,IACT,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import { ActionRow, Button, ModalDialog } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport messages from '@src/certificates/messages';\n\ninterface RemoveExceptionModalProps {\n isOpen: boolean,\n email: string,\n onClose: () => void,\n onConfirm: () => void,\n isSubmitting: boolean,\n}\n\nconst RemoveExceptionModal = ({\n isOpen,\n email,\n onClose,\n onConfirm,\n isSubmitting,\n}: RemoveExceptionModalProps) => {\n const intl = useIntl();\n\n return (\n <ModalDialog\n isOpen={isOpen}\n onClose={onClose}\n hasCloseButton={false}\n title={intl.formatMessage(messages.removeExceptionModalTitle)}\n className=\"p-4\"\n isOverflowVisible={false}\n >\n <ModalDialog.Header>\n <ModalDialog.Title>\n {intl.formatMessage(messages.removeExceptionModalTitle)}\n </ModalDialog.Title>\n </ModalDialog.Header>\n <ModalDialog.Body>\n <p className=\"mb-2.5\">\n {intl.formatMessage(messages.removeExceptionModalMessage, { email })}\n </p>\n </ModalDialog.Body>\n <ModalDialog.Footer>\n <ActionRow>\n <Button variant=\"tertiary\" onClick={onClose} disabled={isSubmitting}>\n {intl.formatMessage(messages.cancel)}\n </Button>\n <Button variant=\"primary\" onClick={onConfirm} disabled={isSubmitting}>\n {intl.formatMessage(messages.removeExceptionAction)}\n </Button>\n </ActionRow>\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nexport default RemoveExceptionModal;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ActionRow, Button, ModalDialog } from '@openedx/paragon';
|
|
3
3
|
import { useIntl } from '@openedx/frontend-base';
|
|
4
|
-
import messages from '
|
|
4
|
+
import messages from '../../certificates/messages';
|
|
5
5
|
const RemoveInvalidationModal = ({ isOpen, email, onClose, onConfirm, isSubmitting, }) => {
|
|
6
6
|
const intl = useIntl();
|
|
7
7
|
return (_jsxs(ModalDialog, { isOpen: isOpen, onClose: onClose, hasCloseButton: false, title: intl.formatMessage(messages.removeInvalidationModalTitle), className: "p-4", isOverflowVisible: false, children: [_jsx(ModalDialog.Header, { children: _jsx(ModalDialog.Title, { children: intl.formatMessage(messages.removeInvalidationModalTitle) }) }), _jsx(ModalDialog.Body, { children: _jsx("p", { className: "mb-2.5", children: intl.formatMessage(messages.removeInvalidationModalMessage, { email }) }) }), _jsx(ModalDialog.Footer, { children: _jsxs(ActionRow, { children: [_jsx(Button, { variant: "tertiary", onClick: onClose, disabled: isSubmitting, children: intl.formatMessage(messages.cancel) }), _jsx(Button, { variant: "primary", onClick: onConfirm, disabled: isSubmitting, children: intl.formatMessage(messages.removeInvalidationAction) })] }) })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoveInvalidationModal.js","sourceRoot":"","sources":["../../../src/certificates/components/RemoveInvalidationModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,
|
|
1
|
+
{"version":3,"file":"RemoveInvalidationModal.js","sourceRoot":"","sources":["../../../src/certificates/components/RemoveInvalidationModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAUlD,MAAM,uBAAuB,GAAG,CAAC,EAC/B,MAAM,EACN,KAAK,EACL,OAAO,EACP,SAAS,EACT,YAAY,GACiB,EAAE,EAAE;IACjC,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,OAAO,CACL,MAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,KAAK,EACrB,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,4BAA4B,CAAC,EAChE,SAAS,EAAC,KAAK,EACf,iBAAiB,EAAE,KAAK,aAExB,KAAC,WAAW,CAAC,MAAM,cACjB,KAAC,WAAW,CAAC,KAAK,cACf,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,4BAA4B,CAAC,GACxC,GACD,EACrB,KAAC,WAAW,CAAC,IAAI,cACf,YAAG,SAAS,EAAC,QAAQ,YAClB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,CAAC,GACrE,GACa,EACnB,KAAC,WAAW,CAAC,MAAM,cACjB,MAAC,SAAS,eACR,KAAC,MAAM,IAAC,OAAO,EAAC,UAAU,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,YAChE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,GAC7B,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,YACjE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,wBAAwB,CAAC,GAC/C,IACC,GACO,IACT,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC","sourcesContent":["import { ActionRow, Button, ModalDialog } from '@openedx/paragon';\nimport { useIntl } from '@openedx/frontend-base';\nimport messages from '@src/certificates/messages';\n\ninterface RemoveInvalidationModalProps {\n isOpen: boolean,\n email: string,\n onClose: () => void,\n onConfirm: () => void,\n isSubmitting: boolean,\n}\n\nconst RemoveInvalidationModal = ({\n isOpen,\n email,\n onClose,\n onConfirm,\n isSubmitting,\n}: RemoveInvalidationModalProps) => {\n const intl = useIntl();\n\n return (\n <ModalDialog\n isOpen={isOpen}\n onClose={onClose}\n hasCloseButton={false}\n title={intl.formatMessage(messages.removeInvalidationModalTitle)}\n className=\"p-4\"\n isOverflowVisible={false}\n >\n <ModalDialog.Header>\n <ModalDialog.Title>\n {intl.formatMessage(messages.removeInvalidationModalTitle)}\n </ModalDialog.Title>\n </ModalDialog.Header>\n <ModalDialog.Body>\n <p className=\"mb-2.5\">\n {intl.formatMessage(messages.removeInvalidationModalMessage, { email })}\n </p>\n </ModalDialog.Body>\n <ModalDialog.Footer>\n <ActionRow>\n <Button variant=\"tertiary\" onClick={onClose} disabled={isSubmitting}>\n {intl.formatMessage(messages.cancel)}\n </Button>\n <Button variant=\"primary\" onClick={onConfirm} disabled={isSubmitting}>\n {intl.formatMessage(messages.removeInvalidationAction)}\n </Button>\n </ActionRow>\n </ModalDialog.Footer>\n </ModalDialog>\n );\n};\n\nexport default RemoveInvalidationModal;\n"]}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import type { DataList, PaginationParams } from '../../types';
|
|
2
|
-
import type { CertificateData, CertificateQueryParams, GrantExceptionRequest, InstructorTask, InvalidateCertificateRequest, RemoveExceptionRequest, RemoveInvalidationRequest } from '
|
|
2
|
+
import type { CertificateData, CertificateGenerationHistory, CertificateQueryParams, GrantExceptionRequest, InstructorTask, InvalidateCertificateRequest, RemoveExceptionRequest, RemoveInvalidationRequest } from '../../certificates/types';
|
|
3
3
|
export declare const getIssuedCertificates: (courseId: string, params: CertificateQueryParams) => Promise<DataList<CertificateData>>;
|
|
4
4
|
export declare const getInstructorTasks: (courseId: string, params: PaginationParams) => Promise<DataList<InstructorTask>>;
|
|
5
|
-
export declare const grantBulkExceptions: (courseId: string, request: GrantExceptionRequest) => Promise<
|
|
6
|
-
|
|
5
|
+
export declare const grantBulkExceptions: (courseId: string, request: GrantExceptionRequest) => Promise<{
|
|
6
|
+
success: string[];
|
|
7
|
+
errors: {
|
|
8
|
+
learner: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}[];
|
|
11
|
+
}>;
|
|
12
|
+
export declare const invalidateCertificate: (courseId: string, request: InvalidateCertificateRequest) => Promise<{
|
|
13
|
+
success: string[];
|
|
14
|
+
errors: {
|
|
15
|
+
learner: string;
|
|
16
|
+
message: string;
|
|
17
|
+
}[];
|
|
18
|
+
}>;
|
|
7
19
|
export declare const removeException: (courseId: string, request: RemoveExceptionRequest) => Promise<void>;
|
|
8
20
|
export declare const removeInvalidation: (courseId: string, request: RemoveInvalidationRequest) => Promise<void>;
|
|
9
21
|
export declare const toggleCertificateGeneration: (courseId: string, enable: boolean) => Promise<void>;
|
|
22
|
+
export declare const regenerateCertificates: (courseId: string, filter: string) => Promise<void>;
|
|
23
|
+
export declare const getCertificateGenerationHistory: (courseId: string, params: PaginationParams) => Promise<DataList<CertificateGenerationHistory>>;
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { camelCaseObject, getAuthenticatedHttpClient } from '@openedx/frontend-base';
|
|
11
11
|
import { getApiBaseUrl } from '../../data/api';
|
|
12
12
|
export const getIssuedCertificates = (courseId, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
13
|
-
const { data } = yield getAuthenticatedHttpClient().get(`${getApiBaseUrl()}/courses/${courseId}/
|
|
13
|
+
const { data } = yield getAuthenticatedHttpClient().get(`${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/issued`, {
|
|
14
14
|
params: {
|
|
15
15
|
page: params.page + 1,
|
|
16
16
|
page_size: params.pageSize,
|
|
@@ -30,34 +30,86 @@ export const getInstructorTasks = (courseId, params) => __awaiter(void 0, void 0
|
|
|
30
30
|
return camelCaseObject(data);
|
|
31
31
|
});
|
|
32
32
|
export const grantBulkExceptions = (courseId, request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/courses/${courseId}/
|
|
33
|
+
const { data } = yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/exceptions`, {
|
|
34
34
|
learners: request.learners,
|
|
35
35
|
notes: request.notes,
|
|
36
36
|
});
|
|
37
|
+
return camelCaseObject(data);
|
|
37
38
|
});
|
|
38
39
|
export const invalidateCertificate = (courseId, request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
-
yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/courses/${courseId}/
|
|
40
|
+
const { data } = yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/invalidations`, {
|
|
40
41
|
learners: request.learners,
|
|
41
42
|
notes: request.notes,
|
|
42
43
|
});
|
|
44
|
+
return camelCaseObject(data);
|
|
43
45
|
});
|
|
44
46
|
export const removeException = (courseId, request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
-
yield getAuthenticatedHttpClient().delete(`${getApiBaseUrl()}/courses/${courseId}/
|
|
47
|
+
yield getAuthenticatedHttpClient().delete(`${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/exceptions`, {
|
|
46
48
|
data: {
|
|
47
49
|
username: request.username,
|
|
48
50
|
},
|
|
49
51
|
});
|
|
50
52
|
});
|
|
51
53
|
export const removeInvalidation = (courseId, request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
const httpClient = getAuthenticatedHttpClient();
|
|
55
|
+
const url = `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/invalidations`;
|
|
56
|
+
const payload = {
|
|
57
|
+
username: request.username,
|
|
58
|
+
};
|
|
59
|
+
yield httpClient.delete(url, {
|
|
60
|
+
data: payload,
|
|
61
|
+
headers: {
|
|
62
|
+
'Content-Type': 'application/json',
|
|
55
63
|
},
|
|
56
64
|
});
|
|
57
65
|
});
|
|
58
66
|
export const toggleCertificateGeneration = (courseId, enable) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/courses/${courseId}/
|
|
67
|
+
yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/toggle_generation`, {
|
|
60
68
|
enabled: enable,
|
|
61
69
|
});
|
|
62
70
|
});
|
|
71
|
+
export const regenerateCertificates = (courseId, filter) => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
+
const body = {};
|
|
73
|
+
// Map filter to backend parameters (must match backend filter logic)
|
|
74
|
+
switch (filter) {
|
|
75
|
+
case 'all':
|
|
76
|
+
body.student_set = 'all';
|
|
77
|
+
break;
|
|
78
|
+
case 'received':
|
|
79
|
+
body.statuses = ['downloadable'];
|
|
80
|
+
break;
|
|
81
|
+
case 'not_received':
|
|
82
|
+
// Match backend filter: notpassing or unavailable
|
|
83
|
+
body.statuses = ['notpassing', 'unavailable'];
|
|
84
|
+
break;
|
|
85
|
+
case 'audit_passing':
|
|
86
|
+
body.statuses = ['audit_passing'];
|
|
87
|
+
break;
|
|
88
|
+
case 'audit_not_passing':
|
|
89
|
+
body.statuses = ['audit_notpassing'];
|
|
90
|
+
break;
|
|
91
|
+
case 'error':
|
|
92
|
+
body.statuses = ['error'];
|
|
93
|
+
break;
|
|
94
|
+
case 'granted_exceptions':
|
|
95
|
+
body.student_set = 'allowlisted';
|
|
96
|
+
break;
|
|
97
|
+
case 'invalidated':
|
|
98
|
+
// Invalidated certificates have unavailable status
|
|
99
|
+
body.statuses = ['unavailable'];
|
|
100
|
+
break;
|
|
101
|
+
default:
|
|
102
|
+
body.student_set = 'all';
|
|
103
|
+
}
|
|
104
|
+
yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/regenerate`, body);
|
|
105
|
+
});
|
|
106
|
+
export const getCertificateGenerationHistory = (courseId, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
107
|
+
const { data } = yield getAuthenticatedHttpClient().get(`${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/generation_history`, {
|
|
108
|
+
params: {
|
|
109
|
+
page: params.page + 1,
|
|
110
|
+
page_size: params.pageSize,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
return camelCaseObject(data);
|
|
114
|
+
});
|
|
63
115
|
//# sourceMappingURL=api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/certificates/data/api.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/certificates/data/api.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAa9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAAgB,EAChB,MAA8B,EACM,EAAE;IACtC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CACrD,GAAG,aAAa,EAAE,8BAA8B,QAAQ,sBAAsB,EAC9E;QACE,MAAM,EAAE;YACN,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,CAAC;YACrB,SAAS,EAAE,MAAM,CAAC,QAAQ;YAC1B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB;KACF,CACF,CAAC;IACF,OAAO,eAAe,CAAC,IAAI,CAAC,C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,CAAC,CAAC;YAC9C,MAAM;QACR,KAAK,eAAe;YAClB,IAAI,CAAC,QAAQ,GAAG,CAAC,eAAe,CAAC,CAAC;YAClC,MAAM;QACR,KAAK,mBAAmB;YACtB,IAAI,CAAC,QAAQ,GAAG,CAAC,kBAAkB,CAAC,CAAC;YACrC,MAAM;QACR,KAAK,OAAO;YACV,IAAI,CAAC,QAAQ,GAAG,CAAC,OAAO,CAAC,CAAC;YAC1B,MAAM;QACR,KAAK,oBAAoB;YACvB,IAAI,CAAC,WAAW,GAAG,aAAa,CAAC;YACjC,MAAM;QACR,KAAK,aAAa;YAChB,mDAAmD;YACnD,IAAI,CAAC,QAAQ,GAAG,CAAC,aAAa,CAAC,CAAC;YAChC,MAAM;QACR;YACE,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,MAAM,0BAA0B,EAAE,CAAC,IAAI,CACrC,GAAG,aAAa,EAAE,8BAA8B,QAAQ,0BAA0B,EAClF,IAAI,CACL,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,QAAgB,EAChB,MAAwB,EACyB,EAAE;IACnD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CACrD,GAAG,aAAa,EAAE,8BAA8B,QAAQ,kCAAkC,EAC1F;QACE,MAAM,EAAE;YACN,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,CAAC;YACrB,SAAS,EAAE,MAAM,CAAC,QAAQ;SAC3B;KACF,CACF,CAAC;IACF,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAA,CAAC","sourcesContent":["import { camelCaseObject, getAuthenticatedHttpClient } from '@openedx/frontend-base';\nimport { getApiBaseUrl } from '@src/data/api';\nimport type { DataList, PaginationParams } from '@src/types';\nimport type {\n CertificateData,\n CertificateGenerationHistory,\n CertificateQueryParams,\n GrantExceptionRequest,\n InstructorTask,\n InvalidateCertificateRequest,\n RemoveExceptionRequest,\n RemoveInvalidationRequest,\n} from '@src/certificates/types';\n\nexport const getIssuedCertificates = async (\n courseId: string,\n params: CertificateQueryParams,\n): Promise<DataList<CertificateData>> => {\n const { data } = await getAuthenticatedHttpClient().get(\n `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/issued`,\n {\n params: {\n page: params.page + 1,\n page_size: params.pageSize,\n filter: params.filter,\n search: params.search,\n },\n },\n );\n return camelCaseObject(data);\n};\n\nexport const getInstructorTasks = async (\n courseId: string,\n params: PaginationParams,\n): Promise<DataList<InstructorTask>> => {\n const { data } = await getAuthenticatedHttpClient().get(\n `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/instructor_tasks`,\n {\n params: {\n page: params.page + 1,\n page_size: params.pageSize,\n },\n },\n );\n return camelCaseObject(data);\n};\n\nexport const grantBulkExceptions = async (\n courseId: string,\n request: GrantExceptionRequest,\n): Promise<{ success: string[], errors: { learner: string, message: string }[] }> => {\n const { data } = await getAuthenticatedHttpClient().post(\n `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/exceptions`,\n {\n learners: request.learners,\n notes: request.notes,\n },\n );\n return camelCaseObject(data);\n};\n\nexport const invalidateCertificate = async (\n courseId: string,\n request: InvalidateCertificateRequest,\n): Promise<{ success: string[], errors: { learner: string, message: string }[] }> => {\n const { data } = await getAuthenticatedHttpClient().post(\n `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/invalidations`,\n {\n learners: request.learners,\n notes: request.notes,\n },\n );\n return camelCaseObject(data);\n};\n\nexport const removeException = async (\n courseId: string,\n request: RemoveExceptionRequest,\n): Promise<void> => {\n await getAuthenticatedHttpClient().delete(\n `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/exceptions`,\n {\n data: {\n username: request.username,\n },\n },\n );\n};\n\nexport const removeInvalidation = async (\n courseId: string,\n request: RemoveInvalidationRequest,\n): Promise<void> => {\n const httpClient = getAuthenticatedHttpClient();\n const url = `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/invalidations`;\n const payload = {\n username: request.username,\n };\n\n await httpClient.delete(url, {\n data: payload,\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n};\n\nexport const toggleCertificateGeneration = async (\n courseId: string,\n enable: boolean,\n): Promise<void> => {\n await getAuthenticatedHttpClient().post(\n `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/toggle_generation`,\n {\n enabled: enable,\n },\n );\n};\n\nexport const regenerateCertificates = async (\n courseId: string,\n filter: string,\n): Promise<void> => {\n const body: { statuses?: string[], student_set?: string } = {};\n\n // Map filter to backend parameters (must match backend filter logic)\n switch (filter) {\n case 'all':\n body.student_set = 'all';\n break;\n case 'received':\n body.statuses = ['downloadable'];\n break;\n case 'not_received':\n // Match backend filter: notpassing or unavailable\n body.statuses = ['notpassing', 'unavailable'];\n break;\n case 'audit_passing':\n body.statuses = ['audit_passing'];\n break;\n case 'audit_not_passing':\n body.statuses = ['audit_notpassing'];\n break;\n case 'error':\n body.statuses = ['error'];\n break;\n case 'granted_exceptions':\n body.student_set = 'allowlisted';\n break;\n case 'invalidated':\n // Invalidated certificates have unavailable status\n body.statuses = ['unavailable'];\n break;\n default:\n body.student_set = 'all';\n }\n\n await getAuthenticatedHttpClient().post(\n `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/regenerate`,\n body,\n );\n};\n\nexport const getCertificateGenerationHistory = async (\n courseId: string,\n params: PaginationParams,\n): Promise<DataList<CertificateGenerationHistory>> => {\n const { data } = await getAuthenticatedHttpClient().get(\n `${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/certificates/generation_history`,\n {\n params: {\n page: params.page + 1,\n page_size: params.pageSize,\n },\n },\n );\n return camelCaseObject(data);\n};\n"]}
|
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
import type { PaginationParams } from '../../types';
|
|
2
|
-
import type { CertificateQueryParams, GrantExceptionRequest, InvalidateCertificateRequest, RemoveExceptionRequest, RemoveInvalidationRequest } from '
|
|
2
|
+
import type { CertificateQueryParams, GrantExceptionRequest, InvalidateCertificateRequest, RemoveExceptionRequest, RemoveInvalidationRequest } from '../../certificates/types';
|
|
3
3
|
/**
|
|
4
4
|
* Hook to fetch issued certificates
|
|
5
5
|
*/
|
|
6
|
-
export declare const useIssuedCertificates: (courseId: string, params: CertificateQueryParams) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("
|
|
6
|
+
export declare const useIssuedCertificates: (courseId: string, params: CertificateQueryParams) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("../../certificates/types").CertificateData>, Error>;
|
|
7
7
|
/**
|
|
8
8
|
* Hook to fetch instructor tasks
|
|
9
9
|
*/
|
|
10
|
-
export declare const useInstructorTasks: (courseId: string, params: PaginationParams) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("
|
|
10
|
+
export declare const useInstructorTasks: (courseId: string, params: PaginationParams) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("../../certificates/types").InstructorTask>, Error>;
|
|
11
|
+
/**
|
|
12
|
+
* Hook to fetch certificate generation history
|
|
13
|
+
*/
|
|
14
|
+
export declare const useCertificateGenerationHistory: (courseId: string, params: PaginationParams) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("../../certificates/types").CertificateGenerationHistory>, Error>;
|
|
11
15
|
/**
|
|
12
16
|
* Hook to grant bulk certificate exceptions
|
|
13
17
|
*/
|
|
14
|
-
export declare const useGrantBulkExceptions: (courseId: string) => import("@tanstack/react-query").UseMutationResult<
|
|
18
|
+
export declare const useGrantBulkExceptions: (courseId: string) => import("@tanstack/react-query").UseMutationResult<{
|
|
19
|
+
success: string[];
|
|
20
|
+
errors: {
|
|
21
|
+
learner: string;
|
|
22
|
+
message: string;
|
|
23
|
+
}[];
|
|
24
|
+
}, Error, GrantExceptionRequest, unknown>;
|
|
15
25
|
/**
|
|
16
26
|
* Hook to invalidate certificate
|
|
17
27
|
*/
|
|
18
|
-
export declare const useInvalidateCertificate: (courseId: string) => import("@tanstack/react-query").UseMutationResult<
|
|
28
|
+
export declare const useInvalidateCertificate: (courseId: string) => import("@tanstack/react-query").UseMutationResult<{
|
|
29
|
+
success: string[];
|
|
30
|
+
errors: {
|
|
31
|
+
learner: string;
|
|
32
|
+
message: string;
|
|
33
|
+
}[];
|
|
34
|
+
}, Error, InvalidateCertificateRequest, unknown>;
|
|
19
35
|
/**
|
|
20
36
|
* Hook to remove certificate exception
|
|
21
37
|
*/
|
|
@@ -28,3 +44,7 @@ export declare const useRemoveInvalidation: (courseId: string) => import("@tanst
|
|
|
28
44
|
* Hook to toggle certificate generation
|
|
29
45
|
*/
|
|
30
46
|
export declare const useToggleCertificateGeneration: (courseId: string) => import("@tanstack/react-query").UseMutationResult<void, Error, boolean, unknown>;
|
|
47
|
+
/**
|
|
48
|
+
* Hook to regenerate certificates
|
|
49
|
+
*/
|
|
50
|
+
export declare const useRegenerateCertificates: (courseId: string) => import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
|