@openedx/frontend-app-instructor-dashboard 1.0.0-alpha.2 → 1.0.0-alpha.20

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.
Files changed (261) hide show
  1. package/dist/Main.d.ts +1 -1
  2. package/dist/Main.js +4 -13
  3. package/dist/Main.js.map +1 -1
  4. package/dist/app.js +2 -11
  5. package/dist/app.js.map +1 -1
  6. package/dist/certificates/CertificatesPage.d.ts +1 -0
  7. package/dist/certificates/CertificatesPage.js +162 -2
  8. package/dist/certificates/CertificatesPage.js.map +1 -1
  9. package/dist/certificates/CertificatesPage.scss +81 -0
  10. package/dist/certificates/components/CertificateTable.d.ts +14 -0
  11. package/dist/certificates/components/CertificateTable.js +85 -0
  12. package/dist/certificates/components/CertificateTable.js.map +1 -0
  13. package/dist/certificates/components/CertificatesPageHeader.d.ts +7 -0
  14. package/dist/certificates/components/CertificatesPageHeader.js +11 -0
  15. package/dist/certificates/components/CertificatesPageHeader.js.map +1 -0
  16. package/dist/certificates/components/CertificatesToolbar.d.ts +10 -0
  17. package/dist/certificates/components/CertificatesToolbar.js +12 -0
  18. package/dist/certificates/components/CertificatesToolbar.js.map +1 -0
  19. package/dist/certificates/components/DisableCertificatesModal.d.ts +9 -0
  20. package/dist/certificates/components/DisableCertificatesModal.js +16 -0
  21. package/dist/certificates/components/DisableCertificatesModal.js.map +1 -0
  22. package/dist/certificates/components/FilterDropdown.d.ts +8 -0
  23. package/dist/certificates/components/FilterDropdown.js +50 -0
  24. package/dist/certificates/components/FilterDropdown.js.map +1 -0
  25. package/dist/certificates/components/GenerationHistoryTable.d.ts +11 -0
  26. package/dist/certificates/components/GenerationHistoryTable.js +40 -0
  27. package/dist/certificates/components/GenerationHistoryTable.js.map +1 -0
  28. package/dist/certificates/components/GrantExceptionsModal.d.ts +8 -0
  29. package/dist/certificates/components/GrantExceptionsModal.js +10 -0
  30. package/dist/certificates/components/GrantExceptionsModal.js.map +1 -0
  31. package/dist/certificates/components/InvalidateCertificateModal.d.ts +8 -0
  32. package/dist/certificates/components/InvalidateCertificateModal.js +10 -0
  33. package/dist/certificates/components/InvalidateCertificateModal.js.map +1 -0
  34. package/dist/certificates/components/IssuedCertificatesTab.d.ts +18 -0
  35. package/dist/certificates/components/IssuedCertificatesTab.js +6 -0
  36. package/dist/certificates/components/IssuedCertificatesTab.js.map +1 -0
  37. package/dist/certificates/components/LearnerActionModal.d.ts +16 -0
  38. package/dist/certificates/components/LearnerActionModal.js +22 -0
  39. package/dist/certificates/components/LearnerActionModal.js.map +1 -0
  40. package/dist/certificates/components/RemoveInvalidationModal.d.ts +9 -0
  41. package/dist/certificates/components/RemoveInvalidationModal.js +10 -0
  42. package/dist/certificates/components/RemoveInvalidationModal.js.map +1 -0
  43. package/dist/certificates/constants.d.ts +15 -0
  44. package/dist/certificates/constants.js +16 -0
  45. package/dist/certificates/constants.js.map +1 -0
  46. package/dist/certificates/data/api.d.ts +9 -0
  47. package/dist/certificates/data/api.js +63 -0
  48. package/dist/certificates/data/api.js.map +1 -0
  49. package/dist/certificates/data/apiHook.d.ts +30 -0
  50. package/dist/certificates/data/apiHook.js +90 -0
  51. package/dist/certificates/data/apiHook.js.map +1 -0
  52. package/dist/certificates/data/dummyData.d.ts +2 -0
  53. package/dist/certificates/data/dummyData.js +234 -0
  54. package/dist/certificates/data/dummyData.js.map +1 -0
  55. package/dist/certificates/data/queryKeys.d.ts +8 -0
  56. package/dist/certificates/data/queryKeys.js +8 -0
  57. package/dist/certificates/data/queryKeys.js.map +1 -0
  58. package/dist/certificates/messages.d.ts +313 -0
  59. package/dist/certificates/messages.js +315 -0
  60. package/dist/certificates/messages.js.map +1 -0
  61. package/dist/certificates/types.d.ts +61 -0
  62. package/dist/certificates/types.js +26 -0
  63. package/dist/certificates/types.js.map +1 -0
  64. package/dist/certificates/utils/errorHandling.d.ts +10 -0
  65. package/dist/certificates/utils/errorHandling.js +3 -0
  66. package/dist/certificates/utils/errorHandling.js.map +1 -0
  67. package/dist/certificates/utils/filterUtils.d.ts +4 -0
  68. package/dist/certificates/utils/filterUtils.js +31 -0
  69. package/dist/certificates/utils/filterUtils.js.map +1 -0
  70. package/dist/certificates/utils/index.d.ts +2 -0
  71. package/dist/certificates/utils/index.js +2 -0
  72. package/dist/certificates/utils/index.js.map +1 -0
  73. package/dist/cohorts/data/queryKeys.d.ts +4 -4
  74. package/dist/components/ActionCard.d.ts +2 -2
  75. package/dist/components/ActionCard.js +1 -1
  76. package/dist/components/ActionCard.js.map +1 -1
  77. package/dist/components/PendingTasks.d.ts +3 -1
  78. package/dist/components/PendingTasks.js +3 -2
  79. package/dist/components/PendingTasks.js.map +1 -1
  80. package/dist/components/SpecifyLearnerField.d.ts +4 -1
  81. package/dist/components/SpecifyLearnerField.js +24 -10
  82. package/dist/components/SpecifyLearnerField.js.map +1 -1
  83. package/dist/components/SpecifyProblemField.d.ts +13 -0
  84. package/dist/components/SpecifyProblemField.js +46 -0
  85. package/dist/components/SpecifyProblemField.js.map +1 -0
  86. package/dist/components/UsernameFilter.d.ts +7 -0
  87. package/dist/components/UsernameFilter.js +19 -0
  88. package/dist/components/UsernameFilter.js.map +1 -0
  89. package/dist/components/messages.d.ts +30 -0
  90. package/dist/components/messages.js +30 -0
  91. package/dist/components/messages.js.map +1 -1
  92. package/dist/constants.d.ts +2 -1
  93. package/dist/constants.js +2 -1
  94. package/dist/constants.js.map +1 -1
  95. package/dist/courseInfo/types.d.ts +2 -0
  96. package/dist/courseInfo/types.js.map +1 -1
  97. package/dist/courseTeam/CourseTeamPage.js +20 -2
  98. package/dist/courseTeam/CourseTeamPage.js.map +1 -1
  99. package/dist/courseTeam/components/AddTeamMemberModal.d.ts +6 -0
  100. package/dist/courseTeam/components/AddTeamMemberModal.js +60 -0
  101. package/dist/courseTeam/components/AddTeamMemberModal.js.map +1 -0
  102. package/dist/courseTeam/components/EditTeamMemberModal.d.ts +8 -0
  103. package/dist/courseTeam/components/EditTeamMemberModal.js +90 -0
  104. package/dist/courseTeam/components/EditTeamMemberModal.js.map +1 -0
  105. package/dist/courseTeam/components/MembersContent.d.ts +6 -0
  106. package/dist/courseTeam/components/MembersContent.js +48 -0
  107. package/dist/courseTeam/components/MembersContent.js.map +1 -0
  108. package/dist/courseTeam/components/RoleFilter.d.ts +7 -0
  109. package/dist/courseTeam/components/RoleFilter.js +22 -0
  110. package/dist/courseTeam/components/RoleFilter.js.map +1 -0
  111. package/dist/courseTeam/components/RolesContent.d.ts +3 -0
  112. package/dist/courseTeam/components/RolesContent.js +25 -0
  113. package/dist/courseTeam/components/RolesContent.js.map +1 -0
  114. package/dist/courseTeam/data/api.d.ts +6 -0
  115. package/dist/courseTeam/data/api.js +38 -0
  116. package/dist/courseTeam/data/api.js.map +1 -0
  117. package/dist/courseTeam/data/apiHook.d.ts +11 -0
  118. package/dist/courseTeam/data/apiHook.js +32 -0
  119. package/dist/courseTeam/data/apiHook.js.map +1 -0
  120. package/dist/courseTeam/data/queryKeys.d.ts +7 -0
  121. package/dist/courseTeam/data/queryKeys.js +14 -0
  122. package/dist/courseTeam/data/queryKeys.js.map +1 -0
  123. package/dist/courseTeam/messages.d.ts +243 -0
  124. package/dist/courseTeam/messages.js +245 -0
  125. package/dist/courseTeam/messages.js.map +1 -0
  126. package/dist/courseTeam/types.d.ts +22 -0
  127. package/dist/courseTeam/types.js +3 -0
  128. package/dist/courseTeam/types.js.map +1 -0
  129. package/dist/data/api.d.ts +2 -1
  130. package/dist/data/api.js +9 -3
  131. package/dist/data/api.js.map +1 -1
  132. package/dist/data/apiHook.d.ts +1 -0
  133. package/dist/data/apiHook.js +10 -2
  134. package/dist/data/apiHook.js.map +1 -1
  135. package/dist/data/queryKeys.d.ts +10 -6
  136. package/dist/data/queryKeys.js +4 -0
  137. package/dist/data/queryKeys.js.map +1 -1
  138. package/dist/dataDownloads/data/queryKeys.d.ts +3 -3
  139. package/dist/dateExtensions/components/AddExtensionModal.d.ts +1 -1
  140. package/dist/dateExtensions/components/AddExtensionModal.js +5 -6
  141. package/dist/dateExtensions/components/AddExtensionModal.js.map +1 -1
  142. package/dist/dateExtensions/components/DateExtensionsList.js +2 -13
  143. package/dist/dateExtensions/components/DateExtensionsList.js.map +1 -1
  144. package/dist/dateExtensions/data/apiHook.d.ts +2 -2
  145. package/dist/dateExtensions/data/apiHook.js +4 -4
  146. package/dist/dateExtensions/data/apiHook.js.map +1 -1
  147. package/dist/dateExtensions/data/queryKeys.d.ts +5 -5
  148. package/dist/dateExtensions/messages.d.ts +0 -5
  149. package/dist/dateExtensions/messages.js +1 -6
  150. package/dist/dateExtensions/messages.js.map +1 -1
  151. package/dist/enrollments/EnrollmentsPage.js +32 -5
  152. package/dist/enrollments/EnrollmentsPage.js.map +1 -1
  153. package/dist/enrollments/components/AddBetaTestersModal.d.ts +6 -0
  154. package/dist/enrollments/components/AddBetaTestersModal.js +61 -0
  155. package/dist/enrollments/components/AddBetaTestersModal.js.map +1 -0
  156. package/dist/enrollments/components/EnrollLearnersModal.d.ts +6 -0
  157. package/dist/enrollments/components/EnrollLearnersModal.js +53 -0
  158. package/dist/enrollments/components/EnrollLearnersModal.js.map +1 -0
  159. package/dist/enrollments/components/EnrollmentStatusModal.js +3 -3
  160. package/dist/enrollments/components/EnrollmentStatusModal.js.map +1 -1
  161. package/dist/enrollments/components/EnrollmentsList.d.ts +3 -2
  162. package/dist/enrollments/components/EnrollmentsList.js +13 -14
  163. package/dist/enrollments/components/EnrollmentsList.js.map +1 -1
  164. package/dist/enrollments/components/UnenrollModal.d.ts +1 -1
  165. package/dist/enrollments/components/UnenrollModal.js +29 -3
  166. package/dist/enrollments/components/UnenrollModal.js.map +1 -1
  167. package/dist/enrollments/components/UpdateBetaTesterModal.d.ts +8 -0
  168. package/dist/enrollments/components/UpdateBetaTesterModal.js +52 -0
  169. package/dist/enrollments/components/UpdateBetaTesterModal.js.map +1 -0
  170. package/dist/enrollments/data/api.d.ts +3 -1
  171. package/dist/enrollments/data/api.js +11 -1
  172. package/dist/enrollments/data/api.js.map +1 -1
  173. package/dist/enrollments/data/apiHook.d.ts +5 -3
  174. package/dist/enrollments/data/apiHook.js +21 -3
  175. package/dist/enrollments/data/apiHook.js.map +1 -1
  176. package/dist/enrollments/data/queryKeys.d.ts +5 -5
  177. package/dist/enrollments/data/queryKeys.js.map +1 -1
  178. package/dist/enrollments/messages.d.ts +121 -1
  179. package/dist/enrollments/messages.js +126 -6
  180. package/dist/enrollments/messages.js.map +1 -1
  181. package/dist/enrollments/types.d.ts +24 -0
  182. package/dist/enrollments/types.js.map +1 -1
  183. package/dist/grading/GradingPage.js +15 -2
  184. package/dist/grading/GradingPage.js.map +1 -1
  185. package/dist/grading/components/GradingActionRow.d.ts +2 -0
  186. package/dist/grading/components/GradingActionRow.js +28 -0
  187. package/dist/grading/components/GradingActionRow.js.map +1 -0
  188. package/dist/grading/components/GradingConfigurationModal.d.ts +6 -0
  189. package/dist/grading/components/GradingConfigurationModal.js +14 -0
  190. package/dist/grading/components/GradingConfigurationModal.js.map +1 -0
  191. package/dist/grading/components/GradingLearnerContent.d.ts +7 -0
  192. package/dist/grading/components/GradingLearnerContent.js +114 -0
  193. package/dist/grading/components/GradingLearnerContent.js.map +1 -0
  194. package/dist/grading/data/api.d.ts +6 -0
  195. package/dist/grading/data/api.js +59 -0
  196. package/dist/grading/data/api.js.map +1 -0
  197. package/dist/grading/data/apiHook.d.ts +6 -0
  198. package/dist/grading/data/apiHook.js +29 -0
  199. package/dist/grading/data/apiHook.js.map +1 -0
  200. package/dist/grading/data/queryKeys.d.ts +9 -0
  201. package/dist/grading/data/queryKeys.js +8 -0
  202. package/dist/grading/data/queryKeys.js.map +1 -0
  203. package/dist/grading/messages.d.ts +173 -0
  204. package/dist/grading/messages.js +175 -0
  205. package/dist/grading/messages.js.map +1 -0
  206. package/dist/grading/types.d.ts +11 -0
  207. package/dist/grading/types.js +2 -0
  208. package/dist/grading/types.js.map +1 -0
  209. package/dist/hooks/useDebouncedFilter.d.ts +1 -0
  210. package/dist/hooks/useDebouncedFilter.js +5 -0
  211. package/dist/hooks/useDebouncedFilter.js.map +1 -1
  212. package/dist/index.d.ts +2 -3
  213. package/dist/index.js +2 -3
  214. package/dist/index.js.map +1 -1
  215. package/dist/instructorNav/InstructorNav.js +1 -1
  216. package/dist/instructorNav/InstructorNav.js.map +1 -1
  217. package/dist/provides.d.ts +4 -0
  218. package/dist/provides.js +7 -0
  219. package/dist/provides.js.map +1 -0
  220. package/dist/routes.d.ts +1 -1
  221. package/dist/routes.js +5 -4
  222. package/dist/routes.js.map +1 -1
  223. package/dist/specialExams/SpecialExamsPage.js +10 -2
  224. package/dist/specialExams/SpecialExamsPage.js.map +1 -1
  225. package/dist/specialExams/components/Allowances.d.ts +2 -0
  226. package/dist/specialExams/components/Allowances.js +6 -0
  227. package/dist/specialExams/components/Allowances.js.map +1 -0
  228. package/dist/specialExams/components/AttemptsList.d.ts +3 -0
  229. package/dist/specialExams/components/AttemptsList.js +44 -0
  230. package/dist/specialExams/components/AttemptsList.js.map +1 -0
  231. package/dist/specialExams/data/api.d.ts +3 -0
  232. package/dist/specialExams/data/api.js +23 -0
  233. package/dist/specialExams/data/api.js.map +1 -0
  234. package/dist/specialExams/data/apiHook.d.ts +2 -0
  235. package/dist/specialExams/data/apiHook.js +9 -0
  236. package/dist/specialExams/data/apiHook.js.map +1 -0
  237. package/dist/specialExams/data/queryKeys.d.ts +5 -0
  238. package/dist/specialExams/data/queryKeys.js +6 -0
  239. package/dist/specialExams/data/queryKeys.js.map +1 -0
  240. package/dist/specialExams/messages.d.ts +58 -0
  241. package/dist/specialExams/messages.js +60 -0
  242. package/dist/specialExams/messages.js.map +1 -0
  243. package/dist/specialExams/types.d.ts +13 -0
  244. package/dist/specialExams/types.js +2 -0
  245. package/dist/specialExams/types.js.map +1 -0
  246. package/dist/style.scss +16 -0
  247. package/dist/testUtils.js +1 -1
  248. package/dist/testUtils.js.map +1 -1
  249. package/dist/types/index.d.ts +1 -0
  250. package/dist/types/index.js.map +1 -1
  251. package/dist/utils/formatters.d.ts +5 -0
  252. package/dist/utils/formatters.js +10 -0
  253. package/dist/utils/formatters.js.map +1 -1
  254. package/package.json +2 -5
  255. package/dist/app.scss +0 -10
  256. package/dist/providers/QueryProvider.d.ts +0 -6
  257. package/dist/providers/QueryProvider.js +0 -16
  258. package/dist/providers/QueryProvider.js.map +0 -1
  259. package/dist/providers.d.ts +0 -3
  260. package/dist/providers.js +0 -8
  261. package/dist/providers.js.map +0 -1
@@ -0,0 +1,8 @@
1
+ import { CertificateFilter } from '../types';
2
+ interface FilterDropdownProps {
3
+ value: CertificateFilter;
4
+ onChange: (value: CertificateFilter) => void;
5
+ className?: string;
6
+ }
7
+ declare const FilterDropdown: ({ value, onChange, className }: FilterDropdownProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default FilterDropdown;
@@ -0,0 +1,50 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dropdown } from '@openedx/paragon';
3
+ import { FilterList } from '@openedx/paragon/icons';
4
+ import { useIntl } from '@openedx/frontend-base';
5
+ import { CertificateFilter } from '../types';
6
+ import messages from '../messages';
7
+ const FILTER_OPTIONS = [
8
+ {
9
+ value: CertificateFilter.ALL_LEARNERS,
10
+ messageKey: 'filterAllLearners',
11
+ },
12
+ {
13
+ value: CertificateFilter.RECEIVED,
14
+ messageKey: 'filterReceived',
15
+ },
16
+ {
17
+ value: CertificateFilter.NOT_RECEIVED,
18
+ messageKey: 'filterNotReceived',
19
+ },
20
+ {
21
+ value: CertificateFilter.AUDIT_PASSING,
22
+ messageKey: 'filterAuditPassing',
23
+ },
24
+ {
25
+ value: CertificateFilter.AUDIT_NOT_PASSING,
26
+ messageKey: 'filterAuditNotPassing',
27
+ },
28
+ {
29
+ value: CertificateFilter.ERROR_STATE,
30
+ messageKey: 'filterErrorState',
31
+ },
32
+ {
33
+ value: CertificateFilter.GRANTED_EXCEPTIONS,
34
+ messageKey: 'filterGrantedExceptions',
35
+ },
36
+ {
37
+ value: CertificateFilter.INVALIDATED,
38
+ messageKey: 'filterInvalidated',
39
+ },
40
+ ];
41
+ const FilterDropdown = ({ value, onChange, className }) => {
42
+ const intl = useIntl();
43
+ const selectedOption = FILTER_OPTIONS.find((option) => option.value === value);
44
+ const selectedLabel = selectedOption
45
+ ? intl.formatMessage(messages[selectedOption.messageKey])
46
+ : intl.formatMessage(messages.filterAllLearners);
47
+ return (_jsxs(Dropdown, { className: `certificates-filter-dropdown ${className || ''}`, children: [_jsx(Dropdown.Toggle, { id: "filter-dropdown", variant: "outline-primary", className: "d-flex align-items-center justify-content-between w-100", children: _jsxs("span", { className: "d-flex align-items-center", children: [_jsx(FilterList, { className: "mr-2" }), selectedLabel] }) }), _jsx(Dropdown.Menu, { children: FILTER_OPTIONS.map((option) => (_jsx(Dropdown.Item, { active: option.value === value, onClick: () => onChange(option.value), className: "filter-dropdown-item", children: intl.formatMessage(messages[option.messageKey]) }, option.value))) })] }));
48
+ };
49
+ export default FilterDropdown;
50
+ //# sourceMappingURL=FilterDropdown.js.map
@@ -0,0 +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,UAAU,CAAC;AAC7C,OAAO,QAAQ,MAAM,aAAa,CAAC;AAQnC,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,YAAY;QACrC,UAAU,EAAE,mB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AC,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 '../types';\nimport messages from '../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"]}
@@ -0,0 +1,11 @@
1
+ import type { InstructorTask } from '../types';
2
+ interface GenerationHistoryTableProps {
3
+ data: InstructorTask[];
4
+ isLoading: boolean;
5
+ itemCount: number;
6
+ pageCount: number;
7
+ currentPage: number;
8
+ onPageChange: (pageIndex: number) => void;
9
+ }
10
+ declare const GenerationHistoryTable: ({ data, isLoading, itemCount, pageCount, currentPage, onPageChange, }: GenerationHistoryTableProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default GenerationHistoryTable;
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { DataTable } from '@openedx/paragon';
4
+ import { useIntl } from '@openedx/frontend-base';
5
+ import messages from '../messages';
6
+ const GenerationHistoryTable = ({ data, isLoading, itemCount, pageCount, currentPage, onPageChange, }) => {
7
+ const intl = useIntl();
8
+ const columns = useMemo(() => [
9
+ {
10
+ Header: intl.formatMessage(messages.columnTaskName),
11
+ accessor: 'taskName',
12
+ },
13
+ {
14
+ Header: intl.formatMessage(messages.columnDate),
15
+ accessor: 'created',
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
+ },
27
+ },
28
+ {
29
+ Header: intl.formatMessage(messages.columnDetails),
30
+ accessor: 'taskOutput',
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
+ },
35
+ },
36
+ ], [intl]);
37
+ 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, {})] }))] }));
38
+ };
39
+ export default GenerationHistoryTable;
40
+ //# sourceMappingURL=GenerationHistoryTable.js.map
@@ -0,0 +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,aAAa,CAAC;AAWnC,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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Y,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 { InstructorTask } from '../types';\nimport messages from '../messages';\n\ninterface GenerationHistoryTableProps {\n data: InstructorTask[],\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: 'created',\n Cell: ({ value }: { value: string }) => {\n if (!value) return null;\n return intl.formatDate(new Date(value), {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n });\n },\n },\n {\n Header: intl.formatMessage(messages.columnDetails),\n accessor: 'taskOutput',\n Cell: ({ row }: { row: { original: InstructorTask } }) => {\n const { taskState, taskOutput } = row.original;\n return (\n <div>\n <div>\n <strong>Status:</strong> {taskState}\n </div>\n {taskOutput && (\n <div className=\"mt-1 text-gray-700\">\n <small>{taskOutput}</small>\n </div>\n )}\n </div>\n );\n },\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"]}
@@ -0,0 +1,8 @@
1
+ interface GrantExceptionsModalProps {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ onSubmit: (learners: string, notes: string) => void;
5
+ isSubmitting: boolean;
6
+ }
7
+ declare const GrantExceptionsModal: ({ isOpen, onClose, onSubmit, isSubmitting, }: GrantExceptionsModalProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default GrantExceptionsModal;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useIntl } from '@openedx/frontend-base';
3
+ import LearnerActionModal from './LearnerActionModal';
4
+ import messages from '../messages';
5
+ const GrantExceptionsModal = ({ isOpen, onClose, onSubmit, isSubmitting, }) => {
6
+ const intl = useIntl();
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) }));
8
+ };
9
+ export default GrantExceptionsModal;
10
+ //# sourceMappingURL=GrantExceptionsModal.js.map
@@ -0,0 +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,sBAAsB,CAAC;AACtD,OAAO,QAAQ,MAAM,aAAa,CAAC;AASnC,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 './LearnerActionModal';\nimport messages from '../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"]}
@@ -0,0 +1,8 @@
1
+ interface InvalidateCertificateModalProps {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ onSubmit: (learners: string, notes: string) => void;
5
+ isSubmitting: boolean;
6
+ }
7
+ declare const InvalidateCertificateModal: ({ isOpen, onClose, onSubmit, isSubmitting, }: InvalidateCertificateModalProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default InvalidateCertificateModal;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useIntl } from '@openedx/frontend-base';
3
+ import LearnerActionModal from './LearnerActionModal';
4
+ import messages from '../messages';
5
+ const InvalidateCertificateModal = ({ isOpen, onClose, onSubmit, isSubmitting, }) => {
6
+ const intl = useIntl();
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) }));
8
+ };
9
+ export default InvalidateCertificateModal;
10
+ //# sourceMappingURL=InvalidateCertificateModal.js.map
@@ -0,0 +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,sBAAsB,CAAC;AACtD,OAAO,QAAQ,MAAM,aAAa,CAAC;AASnC,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 './LearnerActionModal';\nimport messages from '../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"]}
@@ -0,0 +1,18 @@
1
+ import { CertificateData, CertificateFilter } from '../types';
2
+ interface IssuedCertificatesTabProps {
3
+ data: CertificateData[];
4
+ isLoading: boolean;
5
+ itemCount: number;
6
+ pageCount: number;
7
+ search: string;
8
+ onSearchChange: (value: string) => void;
9
+ filter: CertificateFilter;
10
+ onFilterChange: (value: CertificateFilter) => void;
11
+ currentPage: number;
12
+ onPageChange: (page: number) => void;
13
+ onRemoveException: (username: string, email: string) => void;
14
+ onRemoveInvalidation: (username: string, email: string) => void;
15
+ onRegenerateCertificates: () => void;
16
+ }
17
+ declare const IssuedCertificatesTab: ({ data, isLoading, itemCount, pageCount, search, onSearchChange, filter, onFilterChange, currentPage, onPageChange, onRemoveException, onRemoveInvalidation, onRegenerateCertificates, }: IssuedCertificatesTabProps) => import("react/jsx-runtime").JSX.Element;
18
+ export default IssuedCertificatesTab;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import CertificateTable from './CertificateTable';
3
+ import CertificatesToolbar from './CertificatesToolbar';
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
+ export default IssuedCertificatesTab;
6
+ //# sourceMappingURL=IssuedCertificatesTab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IssuedCertificatesTab.js","sourceRoot":"","sources":["../../../src/certificates/components/IssuedCertificatesTab.tsx"],"names":[],"mappings":";AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAmBxD,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 './CertificateTable';\nimport CertificatesToolbar from './CertificatesToolbar';\nimport { CertificateData, CertificateFilter } from '../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"]}
@@ -0,0 +1,16 @@
1
+ interface LearnerActionModalProps {
2
+ isOpen: boolean;
3
+ onClose: () => void;
4
+ onSubmit: (learners: string, notes: string) => void;
5
+ isSubmitting: boolean;
6
+ title: string;
7
+ description: string;
8
+ notesLabel: string;
9
+ notesPlaceholder: string;
10
+ submitLabel: string;
11
+ cancelLabel: string;
12
+ learnersLabel: string;
13
+ learnersPlaceholder: string;
14
+ }
15
+ declare const LearnerActionModal: ({ isOpen, onClose, onSubmit, isSubmitting, title, description, notesLabel, notesPlaceholder, submitLabel, cancelLabel, learnersLabel, learnersPlaceholder, }: LearnerActionModalProps) => import("react/jsx-runtime").JSX.Element;
16
+ export default LearnerActionModal;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { ActionRow, Button, Form, ModalDialog } from '@openedx/paragon';
4
+ const LearnerActionModal = ({ isOpen, onClose, onSubmit, isSubmitting, title, description, notesLabel, notesPlaceholder, submitLabel, cancelLabel, learnersLabel, learnersPlaceholder, }) => {
5
+ const [learners, setLearners] = useState('');
6
+ const [notes, setNotes] = useState('');
7
+ const handleSubmit = () => {
8
+ if (learners.trim()) {
9
+ onSubmit(learners, notes);
10
+ setLearners('');
11
+ setNotes('');
12
+ }
13
+ };
14
+ const handleClose = () => {
15
+ setLearners('');
16
+ setNotes('');
17
+ onClose();
18
+ };
19
+ return (_jsxs(ModalDialog, { isOpen: isOpen, onClose: handleClose, hasCloseButton: true, title: title, className: "p-4", isOverflowVisible: false, children: [_jsx(ModalDialog.Header, { children: _jsx(ModalDialog.Title, { children: title }) }), _jsxs(ModalDialog.Body, { children: [_jsx("p", { className: "mb-3", children: description }), _jsxs(Form.Group, { className: "mb-3", children: [_jsx(Form.Label, { children: learnersLabel }), _jsx(Form.Control, { as: "textarea", rows: 4, placeholder: learnersPlaceholder, value: learners, onChange: (e) => setLearners(e.target.value) })] }), _jsxs(Form.Group, { className: "mt-3", children: [_jsx(Form.Label, { children: notesLabel }), _jsx(Form.Control, { as: "textarea", rows: 3, placeholder: notesPlaceholder, value: notes, onChange: (e) => setNotes(e.target.value) })] })] }), _jsx(ModalDialog.Footer, { children: _jsxs(ActionRow, { children: [_jsx(Button, { variant: "tertiary", onClick: handleClose, disabled: isSubmitting, children: cancelLabel }), _jsx(Button, { variant: "primary", onClick: handleSubmit, disabled: isSubmitting || !learners.trim(), children: submitLabel })] }) })] }));
20
+ };
21
+ export default LearnerActionModal;
22
+ //# sourceMappingURL=LearnerActionModal.js.map
@@ -0,0 +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,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;YACpB,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC1B,WAAW,CAAC,EAAE,CAAC,CAAC;YAChB,QAAQ,CAAC,EAAE,CAAC,CAAC;QACf,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,WAAW,CAA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E,YAAY,YACpE,WAAW,GACL,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,YACxF,WAAW,GACL,IACC,GACO,IACT,CACf,CAAC;AACJ,CAAC,CAAC;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 if (learners.trim()) {\n onSubmit(learners, 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 RemoveInvalidationModalProps {
2
+ isOpen: boolean;
3
+ email: string;
4
+ onClose: () => void;
5
+ onConfirm: () => void;
6
+ isSubmitting: boolean;
7
+ }
8
+ declare const RemoveInvalidationModal: ({ isOpen, email, onClose, onConfirm, isSubmitting, }: RemoveInvalidationModalProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default RemoveInvalidationModal;
@@ -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 '../messages';
5
+ const RemoveInvalidationModal = ({ isOpen, email, onClose, onConfirm, isSubmitting, }) => {
6
+ const intl = useIntl();
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) })] }) })] }));
8
+ };
9
+ export default RemoveInvalidationModal;
10
+ //# sourceMappingURL=RemoveInvalidationModal.js.map
@@ -0,0 +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,aAAa,CAAC;AAUnC,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 '../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"]}
@@ -0,0 +1,15 @@
1
+ export declare const CERTIFICATES_PAGE_SIZE = 25;
2
+ export declare const CERTIFICATES_TABLE_PAGE_SIZE = 10;
3
+ export declare const TAB_KEYS: {
4
+ readonly ISSUED: "issued";
5
+ readonly HISTORY: "history";
6
+ };
7
+ export declare const ALERT_VARIANTS: {
8
+ readonly SUCCESS: "success";
9
+ readonly DANGER: "danger";
10
+ readonly WARNING: "warning";
11
+ readonly INFO: "info";
12
+ };
13
+ export declare const MODAL_TITLES: {
14
+ readonly ERROR: "Error";
15
+ };
@@ -0,0 +1,16 @@
1
+ export const CERTIFICATES_PAGE_SIZE = 25;
2
+ export const CERTIFICATES_TABLE_PAGE_SIZE = 10;
3
+ export const TAB_KEYS = {
4
+ ISSUED: 'issued',
5
+ HISTORY: 'history',
6
+ };
7
+ export const ALERT_VARIANTS = {
8
+ SUCCESS: 'success',
9
+ DANGER: 'danger',
10
+ WARNING: 'warning',
11
+ INFO: 'info',
12
+ };
13
+ export const MODAL_TITLES = {
14
+ ERROR: 'Error',
15
+ };
16
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/certificates/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE,OAAO;CACN,CAAC","sourcesContent":["export const CERTIFICATES_PAGE_SIZE = 25;\nexport const CERTIFICATES_TABLE_PAGE_SIZE = 10;\n\nexport const TAB_KEYS = {\n ISSUED: 'issued',\n HISTORY: 'history',\n} as const;\n\nexport const ALERT_VARIANTS = {\n SUCCESS: 'success',\n DANGER: 'danger',\n WARNING: 'warning',\n INFO: 'info',\n} as const;\n\nexport const MODAL_TITLES = {\n ERROR: 'Error',\n} as const;\n"]}
@@ -0,0 +1,9 @@
1
+ import type { DataList, PaginationParams } from '../../types';
2
+ import type { CertificateData, CertificateQueryParams, GrantExceptionRequest, InstructorTask, InvalidateCertificateRequest, RemoveExceptionRequest, RemoveInvalidationRequest } from '../types';
3
+ export declare const getIssuedCertificates: (courseId: string, params: CertificateQueryParams) => Promise<DataList<CertificateData>>;
4
+ export declare const getInstructorTasks: (courseId: string, params: PaginationParams) => Promise<DataList<InstructorTask>>;
5
+ export declare const grantBulkExceptions: (courseId: string, request: GrantExceptionRequest) => Promise<void>;
6
+ export declare const invalidateCertificate: (courseId: string, request: InvalidateCertificateRequest) => Promise<void>;
7
+ export declare const removeException: (courseId: string, request: RemoveExceptionRequest) => Promise<void>;
8
+ export declare const removeInvalidation: (courseId: string, request: RemoveInvalidationRequest) => Promise<void>;
9
+ export declare const toggleCertificateGeneration: (courseId: string, enable: boolean) => Promise<void>;
@@ -0,0 +1,63 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { camelCaseObject, getAuthenticatedHttpClient } from '@openedx/frontend-base';
11
+ import { getApiBaseUrl } from '../../data/api';
12
+ export const getIssuedCertificates = (courseId, params) => __awaiter(void 0, void 0, void 0, function* () {
13
+ const { data } = yield getAuthenticatedHttpClient().get(`${getApiBaseUrl()}/courses/${courseId}/instructor/api/get_issued_certificates/`, {
14
+ params: {
15
+ page: params.page + 1,
16
+ page_size: params.pageSize,
17
+ filter: params.filter,
18
+ search: params.search,
19
+ },
20
+ });
21
+ return camelCaseObject(data);
22
+ });
23
+ export const getInstructorTasks = (courseId, params) => __awaiter(void 0, void 0, void 0, function* () {
24
+ const { data } = yield getAuthenticatedHttpClient().get(`${getApiBaseUrl()}/api/instructor/v2/courses/${courseId}/instructor_tasks`, {
25
+ params: {
26
+ page: params.page + 1,
27
+ page_size: params.pageSize,
28
+ },
29
+ });
30
+ return camelCaseObject(data);
31
+ });
32
+ export const grantBulkExceptions = (courseId, request) => __awaiter(void 0, void 0, void 0, function* () {
33
+ yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/courses/${courseId}/instructor/api/generate_bulk_certificate_exceptions`, {
34
+ learners: request.learners,
35
+ notes: request.notes,
36
+ });
37
+ });
38
+ export const invalidateCertificate = (courseId, request) => __awaiter(void 0, void 0, void 0, function* () {
39
+ yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/courses/${courseId}/instructor/api/certificate_invalidation_view/`, {
40
+ learners: request.learners,
41
+ notes: request.notes,
42
+ });
43
+ });
44
+ export const removeException = (courseId, request) => __awaiter(void 0, void 0, void 0, function* () {
45
+ yield getAuthenticatedHttpClient().delete(`${getApiBaseUrl()}/courses/${courseId}/instructor/api/certificate_exception_view/`, {
46
+ data: {
47
+ username: request.username,
48
+ },
49
+ });
50
+ });
51
+ export const removeInvalidation = (courseId, request) => __awaiter(void 0, void 0, void 0, function* () {
52
+ yield getAuthenticatedHttpClient().delete(`${getApiBaseUrl()}/courses/${courseId}/instructor/api/certificate_invalidation_view/`, {
53
+ data: {
54
+ username: request.username,
55
+ },
56
+ });
57
+ });
58
+ export const toggleCertificateGeneration = (courseId, enable) => __awaiter(void 0, void 0, void 0, function* () {
59
+ yield getAuthenticatedHttpClient().post(`${getApiBaseUrl()}/courses/${courseId}/instructor/api/enable_certificate_generation`, {
60
+ enabled: enable,
61
+ });
62
+ });
63
+ //# sourceMappingURL=api.js.map
@@ -0,0 +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;AAY9C,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,YAAY,QAAQ,0CAA0C,EAChF;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,CAAC;AAC/B,CAAC,CAAA,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,QAAgB,EAChB,MAAwB,EACW,EAAE;IACrC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC,GAAG,CACrD,GAAG,aAAa,EAAE,8BAA8B,QAAQ,mBAAmB,EAC3E;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;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,QAAgB,EAChB,OAA8B,EACf,EAAE;IACjB,MAAM,0BAA0B,EAAE,CAAC,IAAI,CACrC,GAAG,aAAa,EAAE,YAAY,QAAQ,sDA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nimport { getApiBaseUrl } from '@src/data/api';\nimport type { DataList, PaginationParams } from '@src/types';\nimport type {\n CertificateData,\n CertificateQueryParams,\n GrantExceptionRequest,\n InstructorTask,\n InvalidateCertificateRequest,\n RemoveExceptionRequest,\n RemoveInvalidationRequest,\n} from '../types';\n\nexport const getIssuedCertificates = async (\n courseId: string,\n params: CertificateQueryParams,\n): Promise<DataList<CertificateData>> => {\n const { data } = await getAuthenticatedHttpClient().get(\n `${getApiBaseUrl()}/courses/${courseId}/instructor/api/get_issued_certificates/`,\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<void> => {\n await getAuthenticatedHttpClient().post(\n `${getApiBaseUrl()}/courses/${courseId}/instructor/api/generate_bulk_certificate_exceptions`,\n {\n learners: request.learners,\n notes: request.notes,\n },\n );\n};\n\nexport const invalidateCertificate = async (\n courseId: string,\n request: InvalidateCertificateRequest,\n): Promise<void> => {\n await getAuthenticatedHttpClient().post(\n `${getApiBaseUrl()}/courses/${courseId}/instructor/api/certificate_invalidation_view/`,\n {\n learners: request.learners,\n notes: request.notes,\n },\n );\n};\n\nexport const removeException = async (\n courseId: string,\n request: RemoveExceptionRequest,\n): Promise<void> => {\n await getAuthenticatedHttpClient().delete(\n `${getApiBaseUrl()}/courses/${courseId}/instructor/api/certificate_exception_view/`,\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 await getAuthenticatedHttpClient().delete(\n `${getApiBaseUrl()}/courses/${courseId}/instructor/api/certificate_invalidation_view/`,\n {\n data: {\n username: request.username,\n },\n },\n );\n};\n\nexport const toggleCertificateGeneration = async (\n courseId: string,\n enable: boolean,\n): Promise<void> => {\n await getAuthenticatedHttpClient().post(\n `${getApiBaseUrl()}/courses/${courseId}/instructor/api/enable_certificate_generation`,\n {\n enabled: enable,\n },\n );\n};\n"]}
@@ -0,0 +1,30 @@
1
+ import type { PaginationParams } from '../../types';
2
+ import type { CertificateQueryParams, GrantExceptionRequest, InvalidateCertificateRequest, RemoveExceptionRequest, RemoveInvalidationRequest } from '../types';
3
+ /**
4
+ * Hook to fetch issued certificates
5
+ */
6
+ export declare const useIssuedCertificates: (courseId: string, params: CertificateQueryParams) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("../types").CertificateData>, Error>;
7
+ /**
8
+ * Hook to fetch instructor tasks
9
+ */
10
+ export declare const useInstructorTasks: (courseId: string, params: PaginationParams) => import("@tanstack/react-query").UseQueryResult<import("../../types").DataList<import("../types").InstructorTask>, Error>;
11
+ /**
12
+ * Hook to grant bulk certificate exceptions
13
+ */
14
+ export declare const useGrantBulkExceptions: (courseId: string) => import("@tanstack/react-query").UseMutationResult<void, Error, GrantExceptionRequest, unknown>;
15
+ /**
16
+ * Hook to invalidate certificate
17
+ */
18
+ export declare const useInvalidateCertificate: (courseId: string) => import("@tanstack/react-query").UseMutationResult<void, Error, InvalidateCertificateRequest, unknown>;
19
+ /**
20
+ * Hook to remove certificate exception
21
+ */
22
+ export declare const useRemoveException: (courseId: string) => import("@tanstack/react-query").UseMutationResult<void, Error, RemoveExceptionRequest, unknown>;
23
+ /**
24
+ * Hook to remove certificate invalidation
25
+ */
26
+ export declare const useRemoveInvalidation: (courseId: string) => import("@tanstack/react-query").UseMutationResult<void, Error, RemoveInvalidationRequest, unknown>;
27
+ /**
28
+ * Hook to toggle certificate generation
29
+ */
30
+ export declare const useToggleCertificateGeneration: (courseId: string) => import("@tanstack/react-query").UseMutationResult<void, Error, boolean, unknown>;
@@ -0,0 +1,90 @@
1
+ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
2
+ import { getInstructorTasks, getIssuedCertificates, grantBulkExceptions, invalidateCertificate, removeException, removeInvalidation, toggleCertificateGeneration, } from './api';
3
+ import { certificatesQueryKeys } from './queryKeys';
4
+ /**
5
+ * Hook to fetch issued certificates
6
+ */
7
+ export const useIssuedCertificates = (courseId, params) => useQuery({
8
+ queryKey: certificatesQueryKeys.issued(courseId, params),
9
+ queryFn: () => getIssuedCertificates(courseId, params),
10
+ enabled: !!courseId,
11
+ });
12
+ /**
13
+ * Hook to fetch instructor tasks
14
+ */
15
+ export const useInstructorTasks = (courseId, params) => useQuery({
16
+ queryKey: certificatesQueryKeys.tasks(courseId, params),
17
+ queryFn: () => getInstructorTasks(courseId, params),
18
+ enabled: !!courseId,
19
+ });
20
+ /**
21
+ * Hook to grant bulk certificate exceptions
22
+ */
23
+ export const useGrantBulkExceptions = (courseId) => {
24
+ const queryClient = useQueryClient();
25
+ return useMutation({
26
+ mutationFn: (request) => grantBulkExceptions(courseId, request),
27
+ onSuccess: () => {
28
+ queryClient.invalidateQueries({
29
+ queryKey: certificatesQueryKeys.byCourse(courseId),
30
+ });
31
+ },
32
+ });
33
+ };
34
+ /**
35
+ * Hook to invalidate certificate
36
+ */
37
+ export const useInvalidateCertificate = (courseId) => {
38
+ const queryClient = useQueryClient();
39
+ return useMutation({
40
+ mutationFn: (request) => invalidateCertificate(courseId, request),
41
+ onSuccess: () => {
42
+ queryClient.invalidateQueries({
43
+ queryKey: certificatesQueryKeys.byCourse(courseId),
44
+ });
45
+ },
46
+ });
47
+ };
48
+ /**
49
+ * Hook to remove certificate exception
50
+ */
51
+ export const useRemoveException = (courseId) => {
52
+ const queryClient = useQueryClient();
53
+ return useMutation({
54
+ mutationFn: (request) => removeException(courseId, request),
55
+ onSuccess: () => {
56
+ queryClient.invalidateQueries({
57
+ queryKey: certificatesQueryKeys.byCourse(courseId),
58
+ });
59
+ },
60
+ });
61
+ };
62
+ /**
63
+ * Hook to remove certificate invalidation
64
+ */
65
+ export const useRemoveInvalidation = (courseId) => {
66
+ const queryClient = useQueryClient();
67
+ return useMutation({
68
+ mutationFn: (request) => removeInvalidation(courseId, request),
69
+ onSuccess: () => {
70
+ queryClient.invalidateQueries({
71
+ queryKey: certificatesQueryKeys.byCourse(courseId),
72
+ });
73
+ },
74
+ });
75
+ };
76
+ /**
77
+ * Hook to toggle certificate generation
78
+ */
79
+ export const useToggleCertificateGeneration = (courseId) => {
80
+ const queryClient = useQueryClient();
81
+ return useMutation({
82
+ mutationFn: (enable) => toggleCertificateGeneration(courseId, enable),
83
+ onSuccess: () => {
84
+ queryClient.invalidateQueries({
85
+ queryKey: certificatesQueryKeys.byCourse(courseId),
86
+ });
87
+ },
88
+ });
89
+ };
90
+ //# sourceMappingURL=apiHook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiHook.js","sourceRoot":"","sources":["../../../src/certificates/data/apiHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAS9E,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAE,MAA8B,EAAE,EAAE,CACxF,QAAQ,CAAC;IACP,QAAQ,EAAE,qBAAqB,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;IACxD,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC;IACtD,OAAO,EAAE,CAAC,CAAC,QAAQ;CACpB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{ PaginationParams } from '@src/types';\nimport type {\n CertificateQueryParams,\n GrantExceptionRequest,\n InvalidateCertificateRequest,\n RemoveExceptionRequest,\n RemoveInvalidationRequest,\n} from '../types';\nimport {\n getInstructorTasks,\n getIssuedCertificates,\n grantBulkExceptions,\n invalidateCertificate,\n removeException,\n removeInvalidation,\n toggleCertificateGeneration,\n} from './api';\nimport { certificatesQueryKeys } from './queryKeys';\n\n/**\n * Hook to fetch issued certificates\n */\nexport const useIssuedCertificates = (courseId: string, params: CertificateQueryParams) =>\n useQuery({\n queryKey: certificatesQueryKeys.issued(courseId, params),\n queryFn: () => getIssuedCertificates(courseId, params),\n enabled: !!courseId,\n });\n\n/**\n * Hook to fetch instructor tasks\n */\nexport const useInstructorTasks = (courseId: string, params: PaginationParams) =>\n useQuery({\n queryKey: certificatesQueryKeys.tasks(courseId, params),\n queryFn: () => getInstructorTasks(courseId, params),\n enabled: !!courseId,\n });\n\n/**\n * Hook to grant bulk certificate exceptions\n */\nexport const useGrantBulkExceptions = (courseId: string) => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (request: GrantExceptionRequest) => grantBulkExceptions(courseId, request),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: certificatesQueryKeys.byCourse(courseId),\n });\n },\n });\n};\n\n/**\n * Hook to invalidate certificate\n */\nexport const useInvalidateCertificate = (courseId: string) => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (request: InvalidateCertificateRequest) => invalidateCertificate(courseId, request),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: certificatesQueryKeys.byCourse(courseId),\n });\n },\n });\n};\n\n/**\n * Hook to remove certificate exception\n */\nexport const useRemoveException = (courseId: string) => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (request: RemoveExceptionRequest) => removeException(courseId, request),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: certificatesQueryKeys.byCourse(courseId),\n });\n },\n });\n};\n\n/**\n * Hook to remove certificate invalidation\n */\nexport const useRemoveInvalidation = (courseId: string) => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (request: RemoveInvalidationRequest) => removeInvalidation(courseId, request),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: certificatesQueryKeys.byCourse(courseId),\n });\n },\n });\n};\n\n/**\n * Hook to toggle certificate generation\n */\nexport const useToggleCertificateGeneration = (courseId: string) => {\n const queryClient = useQueryClient();\n return useMutation({\n mutationFn: (enable: boolean) => toggleCertificateGeneration(courseId, enable),\n onSuccess: () => {\n queryClient.invalidateQueries({\n queryKey: certificatesQueryKeys.byCourse(courseId),\n });\n },\n });\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import { CertificateData } from '../types';
2
+ export declare const dummyCertificateData: CertificateData[];