@tumaet/prompt-ui-components 0.0.4 → 0.0.5

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 (123) hide show
  1. package/dist/components/DatePicker.js +4 -4
  2. package/dist/components/DateRangePicker.js +4 -4
  3. package/dist/components/DeleteConfirmationDialog.js +1 -1
  4. package/dist/components/ErrorPage.js +2 -2
  5. package/dist/components/MultiSelect.js +6 -6
  6. package/dist/components/UnauthorizedPage.js +3 -3
  7. package/dist/components/minimal-tiptap/components/image/image-edit-block.js +3 -3
  8. package/dist/components/minimal-tiptap/components/image/image-edit-dialog.js +1 -1
  9. package/dist/components/minimal-tiptap/components/link/link-edit-block.js +5 -5
  10. package/dist/components/minimal-tiptap/components/link/link-edit-popover.js +1 -1
  11. package/dist/components/minimal-tiptap/components/link/link-popover-block.js +1 -1
  12. package/dist/components/minimal-tiptap/components/section/one.js +2 -2
  13. package/dist/components/minimal-tiptap/components/section/three.js +3 -3
  14. package/dist/components/minimal-tiptap/components/shortcut-key.js +1 -1
  15. package/dist/components/minimal-tiptap/components/spinner.js +1 -1
  16. package/dist/components/minimal-tiptap/components/toolbar-button.js +3 -3
  17. package/dist/components/minimal-tiptap/components/toolbar-section.js +2 -2
  18. package/dist/components/minimal-tiptap/extensions/image/components/image-actions.js +4 -4
  19. package/dist/components/minimal-tiptap/extensions/image/components/image-overlay.js +1 -1
  20. package/dist/components/minimal-tiptap/extensions/image/components/image-view-block.js +1 -1
  21. package/dist/components/minimal-tiptap/extensions/image/components/resize-handle.js +1 -1
  22. package/dist/components/minimal-tiptap/form-description-tiptap.js +2 -2
  23. package/dist/components/minimal-tiptap/hooks/use-minimal-tiptap.js +1 -1
  24. package/dist/components/minimal-tiptap/mailing-tiptap.js +2 -2
  25. package/dist/components/minimal-tiptap/minimal-tiptap.js +2 -2
  26. package/dist/components/table/GroupActionDialog.js +2 -2
  27. package/dist/components/table/SortableHeader.js +1 -1
  28. package/dist/components/ui/accordion.js +1 -1
  29. package/dist/components/ui/alert-dialog.js +2 -2
  30. package/dist/components/ui/alert.js +1 -1
  31. package/dist/components/ui/avatar.js +1 -1
  32. package/dist/components/ui/badge.js +1 -1
  33. package/dist/components/ui/breadcrumb.js +1 -1
  34. package/dist/components/ui/button.js +1 -1
  35. package/dist/components/ui/calendar.js +2 -2
  36. package/dist/components/ui/card.js +1 -1
  37. package/dist/components/ui/chart.js +1 -1
  38. package/dist/components/ui/checkbox.js +1 -1
  39. package/dist/components/ui/command.js +2 -2
  40. package/dist/components/ui/dialog.js +1 -1
  41. package/dist/components/ui/dropdown-menu.js +1 -1
  42. package/dist/components/ui/form.js +2 -2
  43. package/dist/components/ui/input.js +1 -1
  44. package/dist/components/ui/label.js +1 -1
  45. package/dist/components/ui/popover.js +1 -1
  46. package/dist/components/ui/progress.js +1 -1
  47. package/dist/components/ui/radio-group.js +1 -1
  48. package/dist/components/ui/scroll-area.js +1 -1
  49. package/dist/components/ui/select.js +1 -1
  50. package/dist/components/ui/separator.js +1 -1
  51. package/dist/components/ui/sheet.js +1 -1
  52. package/dist/components/ui/sidebar.js +8 -8
  53. package/dist/components/ui/skeleton.js +1 -1
  54. package/dist/components/ui/switch.js +1 -1
  55. package/dist/components/ui/table.js +1 -1
  56. package/dist/components/ui/tabs.js +1 -1
  57. package/dist/components/ui/textarea.js +1 -1
  58. package/dist/components/ui/toast.js +1 -1
  59. package/dist/components/ui/toaster.js +2 -2
  60. package/dist/components/ui/toggle-group.js +2 -2
  61. package/dist/components/ui/toggle.js +1 -1
  62. package/dist/components/ui/tooltip.js +1 -1
  63. package/dist/types/components/minimal-tiptap/components/image/image-edit-dialog.d.ts +1 -1
  64. package/dist/types/components/minimal-tiptap/components/link/link-edit-popover.d.ts +1 -1
  65. package/dist/types/components/minimal-tiptap/components/section/five.d.ts +1 -1
  66. package/dist/types/components/minimal-tiptap/components/section/four.d.ts +1 -1
  67. package/dist/types/components/minimal-tiptap/components/section/mailingPlaceholders.d.ts +1 -1
  68. package/dist/types/components/minimal-tiptap/components/section/one.d.ts +1 -1
  69. package/dist/types/components/minimal-tiptap/components/section/three.d.ts +1 -1
  70. package/dist/types/components/minimal-tiptap/components/section/two.d.ts +1 -1
  71. package/dist/types/components/minimal-tiptap/components/toolbar-button.d.ts +1 -1
  72. package/dist/types/components/minimal-tiptap/components/toolbar-section.d.ts +1 -1
  73. package/dist/types/components/ui/sidebar.d.ts +2 -2
  74. package/dist/types/hooks/use-toast.d.ts +1 -1
  75. package/package.json +3 -2
  76. package/dist/components/ExportedApplicationAnswerTable.js +0 -16
  77. package/dist/components/ExportedApplicationAnswerTable.js.map +0 -1
  78. package/dist/components/MissingConfig.js +0 -12
  79. package/dist/components/MissingConfig.js.map +0 -1
  80. package/dist/components/StudentProfile.js +0 -14
  81. package/dist/components/StudentProfile.js.map +0 -1
  82. package/dist/components/ThemeToggle.js +0 -10
  83. package/dist/components/ThemeToggle.js.map +0 -1
  84. package/dist/components/pages/CoursePhaseParticpationsTable/CoursePhaseParticipationsTablePage.js +0 -71
  85. package/dist/components/pages/CoursePhaseParticpationsTable/CoursePhaseParticipationsTablePage.js.map +0 -1
  86. package/dist/components/pages/CoursePhaseParticpationsTable/components/FilterMenu.js +0 -43
  87. package/dist/components/pages/CoursePhaseParticpationsTable/components/FilterMenu.js.map +0 -1
  88. package/dist/components/pages/CoursePhaseParticpationsTable/components/GroupActionsMenu.js +0 -50
  89. package/dist/components/pages/CoursePhaseParticpationsTable/components/GroupActionsMenu.js.map +0 -1
  90. package/dist/components/pages/CoursePhaseParticpationsTable/components/columns.js +0 -84
  91. package/dist/components/pages/CoursePhaseParticpationsTable/components/columns.js.map +0 -1
  92. package/dist/components/pages/CoursePhaseParticpationsTable/interfaces/ExtraParticipationTableData.js +0 -2
  93. package/dist/components/pages/CoursePhaseParticpationsTable/interfaces/ExtraParticipationTableData.js.map +0 -1
  94. package/dist/components/pages/CoursePhaseParticpationsTable/utils/downloadParticipations.js +0 -70
  95. package/dist/components/pages/CoursePhaseParticpationsTable/utils/downloadParticipations.js.map +0 -1
  96. package/dist/components/pages/Mailing/CoursePhaseMailing.js +0 -88
  97. package/dist/components/pages/Mailing/CoursePhaseMailing.js.map +0 -1
  98. package/dist/components/pages/Mailing/components/AvailableMailPlaceholders.js +0 -61
  99. package/dist/components/pages/Mailing/components/AvailableMailPlaceholders.js.map +0 -1
  100. package/dist/components/pages/Mailing/components/ConfirmSendEmailDialog.js +0 -35
  101. package/dist/components/pages/Mailing/components/ConfirmSendEmailDialog.js.map +0 -1
  102. package/dist/components/pages/Mailing/components/MailingEditor.js +0 -29
  103. package/dist/components/pages/Mailing/components/MailingEditor.js.map +0 -1
  104. package/dist/components/pages/Mailing/components/ManualMailSending.js +0 -35
  105. package/dist/components/pages/Mailing/components/ManualMailSending.js.map +0 -1
  106. package/dist/components/pages/Mailing/components/SettingsCard.js +0 -14
  107. package/dist/components/pages/Mailing/components/SettingsCard.js.map +0 -1
  108. package/dist/types/components/ExportedApplicationAnswerTable.d.ts +0 -6
  109. package/dist/types/components/MissingConfig.d.ts +0 -13
  110. package/dist/types/components/StudentProfile.d.ts +0 -7
  111. package/dist/types/components/ThemeToggle.d.ts +0 -1
  112. package/dist/types/components/pages/CoursePhaseParticpationsTable/CoursePhaseParticipationsTablePage.d.ts +0 -13
  113. package/dist/types/components/pages/CoursePhaseParticpationsTable/components/FilterMenu.d.ts +0 -7
  114. package/dist/types/components/pages/CoursePhaseParticpationsTable/components/GroupActionsMenu.d.ts +0 -10
  115. package/dist/types/components/pages/CoursePhaseParticpationsTable/components/columns.d.ts +0 -9
  116. package/dist/types/components/pages/CoursePhaseParticpationsTable/interfaces/ExtraParticipationTableData.d.ts +0 -5
  117. package/dist/types/components/pages/CoursePhaseParticpationsTable/utils/downloadParticipations.d.ts +0 -3
  118. package/dist/types/components/pages/Mailing/CoursePhaseMailing.d.ts +0 -6
  119. package/dist/types/components/pages/Mailing/components/AvailableMailPlaceholders.d.ts +0 -12
  120. package/dist/types/components/pages/Mailing/components/ConfirmSendEmailDialog.d.ts +0 -8
  121. package/dist/types/components/pages/Mailing/components/MailingEditor.d.ts +0 -12
  122. package/dist/types/components/pages/Mailing/components/ManualMailSending.d.ts +0 -7
  123. package/dist/types/components/pages/Mailing/components/SettingsCard.d.ts +0 -7
@@ -1,84 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import translations from '@/lib/translations.json';
3
- import { SortableHeader } from '@/components/table/SortableHeader';
4
- import { getStatusBadge } from '@/utils/getStatusBadge';
5
- import { Checkbox } from '@/components/ui/checkbox';
6
- export const columns = ({ prevDataKeys, restrictedDataKeys, studentReadableDataKeys, }) => {
7
- return [
8
- {
9
- id: 'select',
10
- header: ({ table }) => (_jsx(Checkbox, { checked: table.getIsAllPageRowsSelected() ||
11
- (table.getIsSomePageRowsSelected() && 'indeterminate'), onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value), "aria-label": 'Select all' })),
12
- cell: ({ row }) => (_jsx(Checkbox, { checked: row.getIsSelected(), onClick: (event) => {
13
- event.stopPropagation();
14
- row.toggleSelected();
15
- }, "aria-label": 'Select row' })),
16
- enableSorting: false,
17
- enableHiding: false,
18
- },
19
- {
20
- id: 'firstName', // required for filter bar
21
- accessorKey: 'student.firstName',
22
- header: ({ column }) => _jsx(SortableHeader, { column: column, title: 'First Name' }),
23
- sortingFn: (rowA, rowB) => {
24
- const valueA = rowA.original.student.firstName.toLowerCase() || '';
25
- const valueB = rowB.original.student.firstName.toLowerCase() || '';
26
- return valueA.localeCompare(valueB);
27
- },
28
- },
29
- {
30
- id: 'lastName',
31
- accessorKey: 'student.lastName',
32
- header: ({ column }) => _jsx(SortableHeader, { column: column, title: 'Last Name' }),
33
- sortingFn: (rowA, rowB) => {
34
- const valueA = rowA.original.student.lastName.toLowerCase() || '';
35
- const valueB = rowB.original.student.lastName.toLowerCase() || '';
36
- return valueA.localeCompare(valueB);
37
- },
38
- },
39
- {
40
- id: 'passStatus',
41
- accessorKey: 'passStatus',
42
- header: ({ column }) => _jsx(SortableHeader, { column: column, title: 'Status' }),
43
- cell: ({ row }) => {
44
- const passStatus = row.original.passStatus;
45
- return getStatusBadge(passStatus);
46
- },
47
- sortingFn: (rowA, rowB) => {
48
- const statusOrder = ['passed', 'not_assessed', 'failed'];
49
- const statusA = rowA.original.passStatus;
50
- const statusB = rowB.original.passStatus;
51
- return statusOrder.indexOf(statusA) - statusOrder.indexOf(statusB);
52
- },
53
- filterFn: (row, columnId, filterValue) => {
54
- return filterValue.includes(row.original.passStatus);
55
- },
56
- },
57
- {
58
- id: 'matriculationNumber',
59
- accessorKey: 'student.matriculationNumber',
60
- header: ({ column }) => _jsx(SortableHeader, { column: column, title: 'Mat Number' }),
61
- },
62
- {
63
- id: `universityLogin`,
64
- accessorKey: 'student.universityLogin',
65
- header: ({ column }) => (_jsx(SortableHeader, { column: column, title: translations.university['login-name'] })),
66
- },
67
- ...prevDataKeys.map((key) => ({
68
- id: key,
69
- accessorKey: `prevData.${key}`,
70
- header: ({ column }) => _jsx(SortableHeader, { column: column, title: key }),
71
- })),
72
- ...restrictedDataKeys.map((key) => ({
73
- id: key,
74
- accessorKey: `restrictedData.${key}`,
75
- header: ({ column }) => _jsx(SortableHeader, { column: column, title: key }),
76
- })),
77
- ...studentReadableDataKeys.map((key) => ({
78
- id: key,
79
- accessorKey: `studentReadableData.${key}`,
80
- header: ({ column }) => _jsx(SortableHeader, { column: column, title: key }),
81
- })),
82
- ];
83
- };
84
- //# sourceMappingURL=columns.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"columns.js","sourceRoot":"","sources":["../../../../../src/components/pages/CoursePhaseParticpationsTable/components/columns.tsx"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CA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,uBAAuB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACvC,EAAE,EAAE,GAAG;YACP,WAAW,EAAE,uBAAuB,GAAG,EAAE;YACzC,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAI;SACvE,CAAC,CAAC;KACJ,CAAA;AACH,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ExtraParticipationTableData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExtraParticipationTableData.js","sourceRoot":"","sources":["../../../../../src/components/pages/CoursePhaseParticpationsTable/interfaces/ExtraParticipationTableData.tsx"],"names":[],"mappings":""}
@@ -1,70 +0,0 @@
1
- import { saveAs } from 'file-saver';
2
- export const downloadParticipations = (data, prevDataKeys, restrictedDataKeys, studentReadableDataKeys, extraData = [], extraColumnHeader, filename = 'participation-export.csv') => {
3
- if (!data || data.length === 0) {
4
- console.error('No data available to download.');
5
- return;
6
- }
7
- const csvHeaders = [
8
- 'firstName',
9
- 'lastName',
10
- 'email',
11
- 'matriculationNumber',
12
- 'universityLogin',
13
- 'hasUniversityAccount',
14
- 'courseParticipationID',
15
- 'gender',
16
- 'passStatus',
17
- ...prevDataKeys,
18
- ...restrictedDataKeys,
19
- ...studentReadableDataKeys,
20
- ];
21
- if (extraColumnHeader !== undefined) {
22
- csvHeaders.push(extraColumnHeader ?? '');
23
- }
24
- const csvRows = data.map((row) => {
25
- // Extract student data
26
- const student = row.student || {};
27
- // Create a row with the required headers
28
- return csvHeaders
29
- .map((header) => {
30
- if (header in student) {
31
- // Fetch data from the `student` object
32
- return JSON.stringify(student[header] ?? '');
33
- }
34
- else if (header === 'passStatus') {
35
- // Fetch data from the main `ApplicationParticipation` object
36
- return JSON.stringify(row.passStatus ?? '');
37
- }
38
- else if (prevDataKeys.includes(header)) {
39
- // Fetch additional scores from the `meta_data` object
40
- return JSON.stringify(row.prevData[header] ?? '');
41
- }
42
- else if (restrictedDataKeys.includes(header)) {
43
- // Fetch additional scores from the `meta_data` object
44
- return JSON.stringify(row.restrictedData[header] ?? '');
45
- }
46
- else if (studentReadableDataKeys.includes(header)) {
47
- // Fetch additional scores from the `meta_data` object
48
- return JSON.stringify(row.studentReadableData[header] ?? '');
49
- }
50
- else if (header === extraColumnHeader) {
51
- // Fetch additional scores from the `meta_data` object
52
- const extraDataItem = extraData.find((item) => item.courseParticipationID === row.courseParticipationID);
53
- return JSON.stringify(extraDataItem?.stringValue ?? '');
54
- }
55
- else if (header === 'courseParticipationID') {
56
- // Fetch data from the main `ApplicationParticipation` object
57
- return JSON.stringify(row.courseParticipationID ?? '');
58
- }
59
- else {
60
- return JSON.stringify('');
61
- }
62
- })
63
- .join(';');
64
- });
65
- const stringifiedHeaders = csvHeaders.map((header) => JSON.stringify(header));
66
- const csvContent = [stringifiedHeaders.join(';'), ...csvRows].join('\n');
67
- const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
68
- saveAs(blob, filename);
69
- };
70
- //# sourceMappingURL=downloadParticipations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"downloadParticipations.js","sourceRoot":"","sources":["../../../../../src/components/pages/CoursePhaseParticpationsTable/utils/downloadParticipations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAGnC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,IAA2C,EAC3C,YAAsB,EACtB,kBAA4B,EAC5B,uBAAiC,EACjC,YAA2C,EAAE,EAC7C,iBAAqC,EACrC,QAAQ,GAAG,0BAA0B,EACrC,EAAE;IACF,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAA;QAC/C,OAAM;IACR,CAAC;IAED,MAAM,UAA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88 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { Button } from '@/components/ui/button';
4
- import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
5
- import { useModifyCoursePhase } from '@/hooks/useModifyCoursePhase';
6
- import { useToast } from '@/hooks/use-toast';
7
- import { AvailableMailPlaceholders, availablePlaceholders, } from './components/AvailableMailPlaceholders';
8
- import { EmailTemplateEditor } from './components/MailingEditor';
9
- import { SettingsCard } from './components/SettingsCard';
10
- import { useGetMailingIsConfigured } from '@/hooks/useGetMailingIsConfigured';
11
- import { MissingConfig } from '@/components/MissingConfig';
12
- import { MailWarningIcon } from 'lucide-react';
13
- import { useParams } from 'react-router-dom';
14
- export const CoursePhaseMailing = ({ coursePhase }) => {
15
- const { courseId } = useParams();
16
- const { toast } = useToast();
17
- const [initialMetaData, setInitialMetaData] = useState(null);
18
- const [mailingMetaData, setMailingMetaData] = useState({
19
- failedMailSubject: '',
20
- failedMailContent: '',
21
- passedMailSubject: '',
22
- passedMailContent: '',
23
- });
24
- const isModified = JSON.stringify(initialMetaData) !== JSON.stringify(mailingMetaData);
25
- const courseMailingIsConfigured = useGetMailingIsConfigured();
26
- const [missingConfigs, setMissingConfigs] = useState([]);
27
- // Updating state
28
- const { mutate: mutateCoursePhase } = useModifyCoursePhase(() => {
29
- toast({
30
- title: 'Application mailing settings updated',
31
- });
32
- }, () => {
33
- toast({
34
- title: 'Error updating application mailing settings',
35
- description: 'Please try again later',
36
- variant: 'destructive',
37
- });
38
- });
39
- useEffect(() => {
40
- if (coursePhase?.restrictedData) {
41
- const parsedMetaData = coursePhase.restrictedData
42
- .mailingSettings;
43
- console.log(parsedMetaData);
44
- if (!parsedMetaData) {
45
- const emptyMailData = {
46
- failedMailSubject: '',
47
- failedMailContent: '',
48
- passedMailSubject: '',
49
- passedMailContent: '',
50
- };
51
- setMailingMetaData(emptyMailData);
52
- setInitialMetaData(emptyMailData);
53
- }
54
- else {
55
- setMailingMetaData(parsedMetaData);
56
- setInitialMetaData(parsedMetaData);
57
- }
58
- }
59
- }, [coursePhase]);
60
- const handleInputChange = (e) => {
61
- const { name, value } = e.target;
62
- setMailingMetaData((prev) => ({ ...prev, [name]: value }));
63
- };
64
- const handleSubmit = (e) => {
65
- e.preventDefault();
66
- const updatedCoursePhase = {
67
- id: coursePhase?.id ?? '',
68
- restrictedData: {
69
- mailingSettings: mailingMetaData,
70
- },
71
- };
72
- mutateCoursePhase(updatedCoursePhase);
73
- };
74
- useEffect(() => {
75
- if (!courseMailingIsConfigured) {
76
- setMissingConfigs([
77
- {
78
- title: 'Application Mailing',
79
- description: 'Please configure course mailing settings',
80
- link: `/management/course/${courseId}/mailing`,
81
- icon: MailWarningIcon,
82
- },
83
- ]);
84
- }
85
- }, [courseId, courseMailingIsConfigured]);
86
- return (_jsxs("div", { className: 'space-y-6', children: [_jsx(MissingConfig, { elements: missingConfigs }), _jsx(SettingsCard, { mailingMetaData: mailingMetaData, isModified: isModified }), _jsx("h2", { className: 'text-2xl font-bold', children: "Mailing Templates " }), _jsx(AvailableMailPlaceholders, {}), initialMetaData && (_jsxs(Tabs, { defaultValue: 'pass', className: 'w-full', children: [_jsxs(TabsList, { className: 'grid w-full grid-cols-2', children: [_jsx(TabsTrigger, { value: 'pass', children: "1. Passed Students" }), _jsx(TabsTrigger, { value: 'failed', children: "2. Failed students" })] }), _jsx(TabsContent, { value: 'pass', children: _jsx(EmailTemplateEditor, { subject: mailingMetaData.passedMailSubject || '', content: mailingMetaData.passedMailContent || '', onInputChange: handleInputChange, label: 'Passed', subjectHTMLLabel: 'passedMailSubject', contentHTMLLabel: 'passedMailContent', placeholders: availablePlaceholders.map((placeholder) => placeholder.placeholder) }) }), _jsx(TabsContent, { value: 'failed', children: _jsx(EmailTemplateEditor, { subject: mailingMetaData.failedMailSubject || '', content: mailingMetaData.failedMailContent || '', onInputChange: handleInputChange, label: 'Failed', subjectHTMLLabel: 'failedMailSubject', contentHTMLLabel: 'failedMailContent', placeholders: availablePlaceholders.map((placeholder) => placeholder.placeholder) }) })] })), _jsx("div", { className: 'justify-end flex', children: _jsx(Button, { onClick: handleSubmit, type: 'submit', className: 'ml-auto', disabled: !isModified, children: "Save Changes" }) })] }));
87
- };
88
- //# sourceMappingURL=CoursePhaseMailing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CoursePhaseMailing.js","sourceRoot":"","sources":["../../../../src/components/pages/Mailing/CoursePhaseMailing.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAM5C,OAAO,EACL,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAqB,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAM5C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,WAAW,EAA2B,EAAE,EAAE;IAC7E,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAwB,CAAA;IACtD,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC5B,MAAM,CAAC,eAA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,CAAC,UAAU,6BAE7E,GACL,IACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1,61 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { ChevronDown, ChevronUp } from 'lucide-react';
4
- import { Collapsible, CollapsibleContent } from '@/components/ui/collapsible';
5
- import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table';
6
- import translations from '@/lib/translations.json';
7
- export const availablePlaceholders = [
8
- {
9
- placeholder: '{{firstName}}',
10
- description: 'The first name of the student',
11
- },
12
- {
13
- placeholder: '{{lastName}}',
14
- description: 'The last name of the student',
15
- },
16
- {
17
- placeholder: '{{email}}',
18
- description: 'The email of the student',
19
- },
20
- {
21
- placeholder: '{{matriculationNumber}}',
22
- description: 'The matriculation number of the student. Might be empty',
23
- },
24
- {
25
- placeholder: '{{universityLogin}}',
26
- description: `The ${translations.university['login-name']} of the student. Might be empty`,
27
- },
28
- {
29
- placeholder: '{{studyDegree}}',
30
- description: 'The study degree of the student',
31
- },
32
- {
33
- placeholder: '{{currentSemester}}',
34
- description: 'The current semester of the student',
35
- },
36
- {
37
- placeholder: '{{studyProgram}}',
38
- description: 'The study program of the student',
39
- },
40
- {
41
- placeholder: '{{courseName}}',
42
- description: 'The name of the course',
43
- },
44
- {
45
- placeholder: '{{courseStartDate}}',
46
- description: 'The start date of the course',
47
- },
48
- {
49
- placeholder: '{{courseEndDate}}',
50
- description: 'The end date of the course',
51
- },
52
- ];
53
- export const AvailableMailPlaceholders = ({ customAdditionalPlaceholders, }) => {
54
- const [isOpen, setIsOpen] = useState(false);
55
- const placeholders = [...availablePlaceholders];
56
- if (customAdditionalPlaceholders) {
57
- placeholders.push(...customAdditionalPlaceholders);
58
- }
59
- return (_jsxs(Collapsible, { open: isOpen, onOpenChange: setIsOpen, className: 'space-y-2 border rounded-md', children: [_jsxs("div", { className: 'flex items-center justify-between p-4 cursor-pointer', onClick: () => setIsOpen((prev) => !prev), children: [_jsxs("div", { children: [_jsx("h3", { className: 'text-sm font-medium', children: "Available Placeholders" }), _jsx("p", { className: 'text-xs text-muted-foreground mt-1', children: "Use these placeholders in your email templates. They will be replaced with actual values when the email is sent." })] }), isOpen ? _jsx(ChevronUp, { className: 'h-4 w-4' }) : _jsx(ChevronDown, { className: 'h-4 w-4' })] }), _jsx(CollapsibleContent, { children: _jsx("div", { className: 'border-t', children: _jsx("div", { className: 'max-h-[300px] overflow-auto', children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: 'w-[200px]', children: "Placeholder" }), _jsx(TableHead, { children: "Description" })] }) }), _jsx(TableBody, { children: placeholders.map((placeholder) => (_jsxs(TableRow, { children: [_jsx(TableCell, { className: 'font-mono text-sm', children: placeholder.placeholder }), _jsx(TableCell, { className: 'text-sm', children: placeholder.description })] }, placeholder.placeholder))) })] }) }) }) })] }));
60
- };
61
- //# sourceMappingURL=AvailableMailPlaceholders.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AvailableMailPlaceholders.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/AvailableMailPlaceholders.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,EACL,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAC9B,OAAO,YAAY,MAAM,yBAAyB,CAAA;AAMlD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC;QACE,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE,+BAA+B;KAC7C;IACD;QACE,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,8BAA8B;KAC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AAS,EAAC,oCAAoC,iIAG7C,IACA,EACL,MAAM,CAAC,CAAC,CAAC,KAAC,SAAS,IAAC,SAAS,EAAC,SAAS,GAAG,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,SAAS,EAAC,SAAS,GAAG,IAC7E,EACN,KAAC,kBAAkB,cACjB,cAAK,SAAS,EAAC,UAAU,YACvB,cAAK,SAAS,EAAC,6BAA6B,YAC1C,MAAC,KAAK,eACJ,KAAC,WAAW,cACV,MAAC,QAAQ,eACP,KAAC,SAAS,IAAC,SAAS,EAAC,WAAW,4BAAwB,EACxD,KAAC,SAAS,8BAAwB,IACzB,GACC,EACd,KAAC,SAAS,cACP,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CACjC,MAAC,QAAQ,eACP,KAAC,SAAS,IAAC,SAAS,EAAC,mBAAmB,YAAE,WAAW,CAAC,WAAW,GAAa,EAC9E,KAAC,SAAS,IAAC,SAAS,EAAC,SAAS,YAAE,WAAW,CAAC,WAAW,GAAa,KAFvD,WAAW,CAAC,WAAW,CAG3B,CACZ,CAAC,GACQ,IACN,GACJ,GACF,GACa,IACT,CACf,CAAA;AACH,CAAC,CAAA"}
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Send, Loader2, AlertCircle, CheckCircle, X } from 'lucide-react';
3
- import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog';
4
- import { Button } from '@/components/ui/button';
5
- import { useMutation } from '@tanstack/react-query';
6
- import { useParams } from 'react-router-dom';
7
- import { PassStatus } from '@tumaet/prompt-shared-state';
8
- import { sendStatusMail } from '@/network/mutations/sendStatusMail';
9
- import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
10
- export const ConfirmSendEmailDialog = ({ isOpen, onClose, emailType, }) => {
11
- const { phaseId } = useParams();
12
- const { mutate: sendEmails, isPending, isError, error, data, reset, } = useMutation({
13
- mutationFn: (statusToSend) => {
14
- return sendStatusMail(phaseId ?? 'undefined', statusToSend);
15
- },
16
- });
17
- const onConfirm = () => {
18
- sendEmails({ statusMailToBeSend: emailType });
19
- };
20
- const handleClose = () => {
21
- reset();
22
- onClose();
23
- };
24
- return (_jsx(Dialog, { open: isOpen, onOpenChange: handleClose, children: _jsxs(DialogContent, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: isPending
25
- ? 'Sending Emails'
26
- : isError
27
- ? 'Error'
28
- : data
29
- ? 'Email Send Results'
30
- : 'Confirm Email Send' }), _jsx(DialogDescription, { children: !isPending &&
31
- !isError &&
32
- !data &&
33
- `Are you sure you want to send an Email to ALL students that ${emailType === PassStatus.PASSED ? 'have been accepted' : 'have been rejected'}?` })] }), isPending && (_jsxs(Alert, { children: [_jsx(Loader2, { className: 'h-4 w-4 animate-spin text-blue-500' }), _jsx(AlertTitle, { children: "Sending Mails" }), _jsx(AlertDescription, { children: "Please wait while we process your request." })] })), isError && (_jsxs(Alert, { variant: 'destructive', children: [_jsx(AlertCircle, { className: 'h-4 w-4' }), _jsx(AlertTitle, { children: "Error" }), _jsx(AlertDescription, { children: error?.message || 'An unexpected error occurred.' })] })), data && (_jsxs(Alert, { children: [_jsx(CheckCircle, { className: 'h-4 w-4 text-green-500' }), _jsx(AlertTitle, { children: "Email Send Results" }), _jsxs(AlertDescription, { children: ["Successfully sent: ", data.successfulEmails ? data.successfulEmails.length : 0, " emails", _jsx("br", {}), "Failed to send: ", data.failedEmails ? data.failedEmails.length : 0, " emails"] })] })), _jsxs(DialogFooter, { children: [!isPending && !isError && !data && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'outline', onClick: handleClose, children: "Cancel" }), _jsxs(Button, { onClick: onConfirm, children: [_jsx(Send, { className: 'mr-2 h-4 w-4' }), "Confirm Send"] })] })), (isError || data) && (_jsxs(Button, { onClick: handleClose, children: [_jsx(X, { className: 'mr-2 h-4 w-4' }), "Close"] }))] })] }) }));
34
- };
35
- //# sourceMappingURL=ConfirmSendEmailDialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfirmSendEmailDialog.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/ConfirmSendEmailDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAkB,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AACnE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAQ3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EACrC,MAAM,EACN,OAAO,EACP,SAAS,GACmB,EAAe,EAAE;IAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAuB,CAAA;IAEpD,MAAM,EACJ,MAAM,EAAE,UAAU,EAClB,SAAS,EACT,OAAO,EACP,KAAK,EACL,IAAI,EACJ,KAAK,GACN,GAAG,WAAW,CAAC;QACd,UAAU,EAAE,CAAC,YAA4B,EAAE,EAAE;YAC3C,OAAO,cAAc,CAAC,OAAO,IAAI,WAAW,EAAE,YAAY,CAAC,CAAA;QAC7D,CAAC;KACF,CAAC,CAAA;IAEF,MAAM,SAAS,GAAG,GAAG,EAAE;QACrB,UAAU,CAAC,EAAE,kBAAkB,EAAE,SAAS,EAAE,CAAC,CAAA;IA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CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,eAChD,IACb,CACT,EAED,MAAC,YAAY,eACV,CAAC,SAAS,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,IAAI,CAClC,8BACE,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,WAAW,uBAErC,EACT,MAAC,MAAM,IAAC,OAAO,EAAE,SAAS,aACxB,KAAC,IAAI,IAAC,SAAS,EAAC,cAAc,GAAG,oBAE1B,IACR,CACJ,EACA,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,CACpB,MAAC,MAAM,IAAC,OAAO,EAAE,WAAW,aAC1B,KAAC,CAAC,IAAC,SAAS,EAAC,cAAc,GAAG,aAEvB,CACV,IACY,IACD,GACT,CACV,CAAA;AACH,CAAC,CAAA"}
@@ -1,29 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { Label } from '@/components/ui/label';
4
- import { TooltipProvider } from '@/components/ui/tooltip';
5
- import { Input } from '@/components/ui/input';
6
- import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
7
- import MailingTiptapEditor from '@/components/minimal-tiptap/mailing-tiptap';
8
- export const EmailTemplateEditor = ({ subject, content, onInputChange, label, subjectHTMLLabel, contentHTMLLabel, placeholders, }) => {
9
- // Local state to hold warning message
10
- const [subjectWarning, setSubjectWarning] = useState('');
11
- // Regular expression to allow only ASCII characters
12
- const asciiOnlyRegex = /^[\x20-\x7F]*$/;
13
- // Custom onChange handler for subject input
14
- const handleSubjectChange = (e) => {
15
- const value = e.target.value;
16
- if (!asciiOnlyRegex.test(value)) {
17
- // Set a warning message and do not propagate the change
18
- setSubjectWarning('Warning: Only ASCII characters are allowed.');
19
- return;
20
- }
21
- // Clear any warning and propagate the valid change
22
- setSubjectWarning('');
23
- onInputChange(e);
24
- };
25
- return (_jsxs(Card, { children: [_jsx(CardHeader, { children: _jsxs(CardTitle, { children: [label, " Mail Template"] }) }), _jsxs(CardContent, { className: 'space-y-4', children: [_jsxs("div", { children: [_jsxs(Label, { htmlFor: subjectHTMLLabel, children: [label, " Subject"] }), _jsx(Input, { type: 'text', name: subjectHTMLLabel, value: subject, onChange: handleSubjectChange, className: 'w-full mt-1' }), subjectWarning && _jsx("p", { className: 'text-red-500 text-sm mt-1', children: subjectWarning })] }), _jsxs("div", { children: [_jsxs(Label, { htmlFor: contentHTMLLabel, children: [label, " E-Mail Template"] }), _jsx(TooltipProvider, { children: _jsx(MailingTiptapEditor, { value: content, onChange: (newContent) => onInputChange({
26
- target: { name: contentHTMLLabel, value: newContent },
27
- }), className: 'w-full mt-1', editorContentClassName: 'p-4', output: 'html', placeholder: 'Type your email here...', autofocus: false, editable: true, editorClassName: 'focus:outline-none', placeholders: placeholders }) })] })] })] }));
28
- };
29
- //# sourceMappingURL=MailingEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MailingEditor.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/MailingEditor.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAC/E,OAAO,mBAAmB,MAAM,4CAA4C,CAAA;AAY5E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,OAAO,EACP,OAAO,EACP,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GACa,EAAe,EAAE;IAC1C,sCAAsC;IACtC,MAAM,CAAC,cAAc,EAAE,iB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EAC5B,MAAM,EAAC,MAAM,EACb,WAAW,EAAC,yBAAyB,EACrC,SAAS,EAAE,KAAK,EAChB,QAAQ,EAAE,IAAI,EACd,eAAe,EAAC,oBAAoB,EACpC,YAAY,EAAE,YAAY,GAC1B,GACc,IACd,IACM,IACT,CACR,CAAA;AACH,CAAC,CAAA"}
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Button } from '@/components/ui/button';
3
- import { Send } from 'lucide-react';
4
- import { PassStatus } from '@tumaet/prompt-shared-state';
5
- import { useState } from 'react';
6
- import { ConfirmSendEmailDialog } from './ConfirmSendEmailDialog';
7
- import { Label } from '@/components/ui/label';
8
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
9
- import { useGetMailingIsConfigured } from '@/hooks/useGetMailingIsConfigured';
10
- export const ManualMailSending = ({ mailingMetaData, isModified, }) => {
11
- const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
12
- const [sendEmailType, setSendEmailType] = useState(null);
13
- const courseMailingIsConfigured = useGetMailingIsConfigured();
14
- const isDisabled = (type) => {
15
- if (isModified)
16
- return true;
17
- const contentCheck = type === PassStatus.PASSED
18
- ? mailingMetaData?.passedMailContent && mailingMetaData?.passedMailSubject
19
- : mailingMetaData?.failedMailContent && mailingMetaData?.failedMailSubject;
20
- return !(contentCheck && courseMailingIsConfigured);
21
- };
22
- const tooltipMessage = courseMailingIsConfigured
23
- ? 'Configure the mail subject and content and save changes before sending.'
24
- : 'Configure the mailing in the course mail settings before sending.';
25
- return (_jsx(_Fragment, { children: _jsxs(TooltipProvider, { children: [_jsxs("div", { className: 'flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2', children: [_jsxs("div", { className: 'space-y-0.5', children: [_jsx(Label, { children: "Manual Acceptance Emails" }), _jsx("p", { className: 'text-sm text-muted-foreground', children: "Send an acceptance mail to ALL accepted students." })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { children: _jsxs(Button, { className: 'w-full sm:w-auto', variant: 'outline', onClick: (e) => {
26
- e.preventDefault();
27
- setSendEmailType(PassStatus.PASSED);
28
- setConfirmationDialogOpen(true);
29
- }, disabled: isDisabled(PassStatus.PASSED), children: [_jsx(Send, { className: 'mr-2 h-4 w-4' }), "Send Acceptance Mails"] }) }), isDisabled(PassStatus.PASSED) && _jsxs(TooltipContent, { children: [tooltipMessage, " "] })] })] }), _jsxs("div", { className: 'flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2', children: [_jsxs("div", { className: 'space-y-0.5', children: [_jsx(Label, { children: "Manual Rejection Emails" }), _jsx("p", { className: 'text-sm text-muted-foreground', children: "Send a rejection mail to ALL rejected students." })] }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { children: _jsxs(Button, { className: 'w-full sm:w-auto', variant: 'outline', onClick: (e) => {
30
- e.preventDefault();
31
- setSendEmailType(PassStatus.FAILED);
32
- setConfirmationDialogOpen(true);
33
- }, disabled: isDisabled(PassStatus.FAILED), children: [_jsx(Send, { className: 'mr-2 h-4 w-4' }), "Send Rejection Mails"] }) }), isDisabled(PassStatus.FAILED) && _jsxs(TooltipContent, { children: [tooltipMessage, " "] })] })] }), confirmationDialogOpen && sendEmailType && (_jsx(ConfirmSendEmailDialog, { isOpen: confirmationDialogOpen, onClose: () => setConfirmationDialogOpen(false), emailType: sendEmailType }))] }) }));
34
- };
35
- //# sourceMappingURL=ManualMailSending.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ManualMailSending.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/ManualMailSending.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,UAAU,EAAgC,MAAM,6BAA6B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,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xB,CACH,IACe,GACjB,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Badge } from '@/components/ui/badge';
3
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
4
- import { ManualMailSending } from './ManualMailSending';
5
- import { Info } from 'lucide-react';
6
- export const SettingsCard = ({ mailingMetaData, isModified }) => {
7
- const someMailFunctionDisabled = isModified ||
8
- !mailingMetaData?.passedMailContent ||
9
- !mailingMetaData?.passedMailSubject ||
10
- !mailingMetaData?.failedMailContent ||
11
- !mailingMetaData?.failedMailSubject;
12
- return (_jsx(_Fragment, { children: _jsxs(Card, { className: 'w-full', children: [_jsxs(CardHeader, { children: [_jsxs("div", { className: 'flex items-center justify-between', children: [_jsx(CardTitle, { children: "E-Mail Settings" }), isModified && (_jsx(Badge, { variant: 'outline', className: 'bg-yellow-100 text-yellow-800 border-yellow-300', children: "Unsaved Changes" }))] }), _jsx(CardDescription, { children: "Configure email settings for the application phase" })] }), _jsxs(CardContent, { className: 'space-y-6', children: [someMailFunctionDisabled && (_jsxs("div", { className: 'flex items-start space-x-2 text-sm text-muted-foreground bg-muted p-3 rounded-md', children: [_jsx(Info, { className: 'h-4 w-4 mt-0.5 flex-shrink-0' }), _jsx("p", { children: "Some of the following mailing options are disabled. Please make sure to configure and save the corresponding mail subject and content." })] })), _jsx("div", { className: 'space-y-4', children: _jsx(ManualMailSending, { mailingMetaData: mailingMetaData, isModified: isModified }) })] })] }) }));
13
- };
14
- //# sourceMappingURL=SettingsCard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SettingsCard.js","sourceRoot":"","sources":["../../../../../src/components/pages/Mailing/components/SettingsCard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAOnC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,eAAe,EAAE,UAAU,EAAqB,EAAe,EAAE;IAC9F,MAAM,wBAAwB,GAC5B,UAAU;QACV,CAAC,eAAe,EAAE,iBAAiB;QACnC,CAAC,eAAe,EAAE,iBAAiB;QACnC,CAAC,eAAe,EAAE,iBAAiB;QACnC,CAAC,eAAe,EAAE,iBAAiB,CAAA;IAErC,OAAO,CACL,4BACE,MAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,aACtB,MAAC,UAAU,eACT,eAAK,SAAS,EAAC,mCAAmC,aAChD,KAAC,SAAS,kCAA4B,EACrC,UAAU,IAAI,CACb,KAAC,KAAK,IAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAC,iDAAiD,gCAE5E,CACT,IACG,EACN,KAAC,eAAe,qEAAqE,IAC1E,EACb,MAAC,WAAW,IAAC,SAAS,EAAC,WAAW,aAC/B,wBAAwB,IAAI,CAC3B,eAAK,SAAS,EAAC,kFAAkF,aAC/F,KAAC,IAAI,IAAC,SAAS,EAAC,8BAA8B,GAAG,EACjD,iKAGI,IACA,CACP,EACD,cAAK,SAAS,EAAC,WAAW,YACxB,KAAC,iBAAiB,IAAC,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAI,GAC3E,IACM,IACT,GACN,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -1,6 +0,0 @@
1
- import { ExportedApplicationAnswer } from '@tumaet/prompt-shared-state';
2
- interface ExportedApplicationAnswerTableProps {
3
- applicationAnswers: ExportedApplicationAnswer[];
4
- }
5
- export declare const ExportedApplicationAnswerTable: ({ applicationAnswers, }: ExportedApplicationAnswerTableProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,13 +0,0 @@
1
- import { ElementType } from 'react';
2
- export interface MissingConfigItem {
3
- title: string;
4
- icon: ElementType;
5
- description?: string;
6
- link: string;
7
- hide?: () => void;
8
- }
9
- interface MissingConfigProps {
10
- elements: MissingConfigItem[];
11
- }
12
- export declare const MissingConfig: ({ elements }: MissingConfigProps) => JSX.Element;
13
- export {};
@@ -1,7 +0,0 @@
1
- import { Student, PassStatus } from '@tumaet/prompt-shared-state';
2
- interface StudentProfileProps {
3
- student: Student;
4
- status: PassStatus;
5
- }
6
- export declare const StudentProfile: ({ student, status }: StudentProfileProps) => JSX.Element;
7
- export {};
@@ -1 +0,0 @@
1
- export declare function ThemeToggle(): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +0,0 @@
1
- import { CoursePhaseParticipationWithStudent } from '@tumaet/prompt-shared-state';
2
- import { ExtraParticipationTableData } from './interfaces/ExtraParticipationTableData';
3
- interface CoursePhaseParticipationsTablePageProps {
4
- participants: CoursePhaseParticipationWithStudent[];
5
- prevDataKeys: string[];
6
- restrictedDataKeys: string[];
7
- studentReadableDataKeys: string[];
8
- extraData?: ExtraParticipationTableData[];
9
- extraColumnHeader?: string;
10
- onClickRowAction: (student: CoursePhaseParticipationWithStudent) => void;
11
- }
12
- export declare const CoursePhaseParticipationsTablePage: ({ participants, prevDataKeys, restrictedDataKeys, studentReadableDataKeys, extraData, extraColumnHeader, onClickRowAction, }: Partial<CoursePhaseParticipationsTablePageProps>) => JSX.Element;
13
- export {};
@@ -1,7 +0,0 @@
1
- import { ColumnFiltersState } from '@tanstack/react-table';
2
- interface ColumnFiltersProps {
3
- columnFilters: ColumnFiltersState;
4
- setColumnFilters: React.Dispatch<React.SetStateAction<ColumnFiltersState>>;
5
- }
6
- export declare const FilterMenu: ({ columnFilters, setColumnFilters, }: ColumnFiltersProps) => JSX.Element;
7
- export {};
@@ -1,10 +0,0 @@
1
- import { RowModel } from '@tanstack/react-table';
2
- import { CoursePhaseParticipationWithStudent } from '@tumaet/prompt-shared-state';
3
- interface GroupActionsMenuProps {
4
- selectedRows: RowModel<CoursePhaseParticipationWithStudent>;
5
- onClose: () => void;
6
- onExport: () => void;
7
- disabled?: boolean;
8
- }
9
- export declare const GroupActionsMenu: ({ selectedRows, onClose, onExport, disabled, }: GroupActionsMenuProps) => JSX.Element;
10
- export {};
@@ -1,9 +0,0 @@
1
- import { ColumnDef } from '@tanstack/react-table';
2
- import { CoursePhaseParticipationWithStudent } from '@tumaet/prompt-shared-state';
3
- interface ColumnDefProps {
4
- prevDataKeys: string[];
5
- restrictedDataKeys: string[];
6
- studentReadableDataKeys: string[];
7
- }
8
- export declare const columns: ({ prevDataKeys, restrictedDataKeys, studentReadableDataKeys, }: ColumnDefProps) => ColumnDef<CoursePhaseParticipationWithStudent>[];
9
- export {};
@@ -1,5 +0,0 @@
1
- export interface ExtraParticipationTableData {
2
- courseParticipationID: string;
3
- value: React.ReactNode;
4
- stringValue?: string;
5
- }
@@ -1,3 +0,0 @@
1
- import { CoursePhaseParticipationWithStudent } from '@tumaet/prompt-shared-state';
2
- import { ExtraParticipationTableData } from '../interfaces/ExtraParticipationTableData';
3
- export declare const downloadParticipations: (data: CoursePhaseParticipationWithStudent[], prevDataKeys: string[], restrictedDataKeys: string[], studentReadableDataKeys: string[], extraData: ExtraParticipationTableData[] | undefined, extraColumnHeader: string | undefined, filename?: string) => void;
@@ -1,6 +0,0 @@
1
- import { CoursePhaseWithMetaData } from '@tumaet/prompt-shared-state';
2
- interface CoursePhaseMailingProps {
3
- coursePhase: CoursePhaseWithMetaData | undefined;
4
- }
5
- export declare const CoursePhaseMailing: ({ coursePhase }: CoursePhaseMailingProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};