@appcorp/fusion-storybook 0.2.11 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-modules/admission/filter.d.ts +1 -1
- package/base-modules/admission/form.d.ts +1 -1
- package/base-modules/admission/more-actions.d.ts +1 -1
- package/base-modules/admission/page.d.ts +8 -1
- package/base-modules/admission/page.js +25 -4
- package/base-modules/admission/view.d.ts +1 -1
- package/base-modules/attendance/form.d.ts +1 -1
- package/base-modules/attendance/page.d.ts +8 -1
- package/base-modules/attendance/page.js +25 -4
- package/base-modules/attendance/view.d.ts +1 -1
- package/base-modules/campus/filter.d.ts +1 -1
- package/base-modules/campus/form.d.ts +1 -1
- package/base-modules/campus/more-actions.d.ts +1 -1
- package/base-modules/campus/page.d.ts +8 -1
- package/base-modules/campus/page.js +25 -4
- package/base-modules/campus/view.d.ts +1 -1
- package/base-modules/class/filter.d.ts +1 -1
- package/base-modules/class/form.d.ts +1 -1
- package/base-modules/class/more-actions.d.ts +1 -1
- package/base-modules/class/page.d.ts +8 -1
- package/base-modules/class/page.js +25 -4
- package/base-modules/class/view.d.ts +1 -1
- package/base-modules/course/filter.d.ts +1 -1
- package/base-modules/course/form.d.ts +1 -1
- package/base-modules/course/more-actions.d.ts +1 -1
- package/base-modules/course/page.d.ts +8 -1
- package/base-modules/course/page.js +25 -4
- package/base-modules/course/view.d.ts +1 -1
- package/base-modules/discount-code/filter.d.ts +2 -1
- package/base-modules/discount-code/form.d.ts +1 -1
- package/base-modules/discount-code/page.d.ts +8 -1
- package/base-modules/discount-code/page.js +25 -4
- package/base-modules/discount-code/view.d.ts +1 -1
- package/base-modules/enrollment/filter.d.ts +1 -1
- package/base-modules/enrollment/form.d.ts +1 -1
- package/base-modules/enrollment/more-actions.d.ts +1 -1
- package/base-modules/enrollment/page.d.ts +8 -1
- package/base-modules/enrollment/page.js +25 -4
- package/base-modules/enrollment/view.d.ts +1 -1
- package/base-modules/expense/filter.d.ts +1 -1
- package/base-modules/expense/form.d.ts +1 -1
- package/base-modules/expense/more-actions.d.ts +1 -1
- package/base-modules/expense/page.d.ts +8 -1
- package/base-modules/expense/page.js +25 -4
- package/base-modules/expense/view.d.ts +1 -1
- package/base-modules/family/filter.d.ts +1 -1
- package/base-modules/family/form.d.ts +1 -1
- package/base-modules/family/more-actions.d.ts +1 -1
- package/base-modules/family/page.d.ts +8 -1
- package/base-modules/family/page.js +25 -4
- package/base-modules/family/view.d.ts +1 -1
- package/base-modules/family-member/filter.d.ts +1 -1
- package/base-modules/family-member/form.d.ts +1 -1
- package/base-modules/family-member/more-actions.d.ts +1 -1
- package/base-modules/family-member/page.d.ts +8 -1
- package/base-modules/family-member/page.js +25 -4
- package/base-modules/family-member/view.d.ts +1 -1
- package/base-modules/fee-structure/filter.d.ts +1 -1
- package/base-modules/fee-structure/form.d.ts +1 -1
- package/base-modules/fee-structure/more-actions.d.ts +1 -1
- package/base-modules/fee-structure/page.d.ts +8 -1
- package/base-modules/fee-structure/page.js +25 -4
- package/base-modules/fee-structure/view.d.ts +1 -1
- package/base-modules/rbac/assign-permissions.d.ts +1 -1
- package/base-modules/rbac/filter.d.ts +1 -1
- package/base-modules/rbac/form.d.ts +1 -1
- package/base-modules/rbac/more-actions.d.ts +1 -1
- package/base-modules/rbac/page.d.ts +8 -1
- package/base-modules/rbac/page.js +25 -4
- package/base-modules/rbac/view.d.ts +7 -1
- package/base-modules/school/drawer.d.ts +1 -1
- package/base-modules/school/filter.d.ts +1 -1
- package/base-modules/school/form.d.ts +1 -1
- package/base-modules/school/more-actions.d.ts +1 -1
- package/base-modules/school/view.d.ts +1 -1
- package/base-modules/section/filter.d.ts +1 -1
- package/base-modules/section/form.d.ts +1 -1
- package/base-modules/section/more-actions.d.ts +1 -1
- package/base-modules/section/page.d.ts +8 -1
- package/base-modules/section/page.js +25 -4
- package/base-modules/section/view.d.ts +1 -1
- package/base-modules/student-fee/filter.d.ts +1 -1
- package/base-modules/student-fee/form.d.ts +1 -1
- package/base-modules/student-fee/more-actions.d.ts +1 -1
- package/base-modules/student-fee/page.d.ts +8 -1
- package/base-modules/student-fee/page.js +25 -4
- package/base-modules/student-fee/view.d.ts +1 -1
- package/base-modules/student-profile/filter.d.ts +1 -1
- package/base-modules/student-profile/form.d.ts +1 -1
- package/base-modules/student-profile/more-actions.d.ts +1 -1
- package/base-modules/student-profile/page.d.ts +8 -1
- package/base-modules/student-profile/page.js +25 -4
- package/base-modules/student-profile/view.d.ts +1 -1
- package/base-modules/subject/filter.d.ts +1 -1
- package/base-modules/subject/form.d.ts +1 -1
- package/base-modules/subject/more-actions.d.ts +1 -1
- package/base-modules/subject/page.d.ts +8 -1
- package/base-modules/subject/page.js +25 -4
- package/base-modules/subject/view.d.ts +1 -1
- package/base-modules/teacher/context.js +19 -25
- package/base-modules/teacher/filter.d.ts +1 -1
- package/base-modules/teacher/form.d.ts +1 -1
- package/base-modules/teacher/more-actions.d.ts +1 -1
- package/base-modules/teacher/page.d.ts +8 -1
- package/base-modules/teacher/page.js +25 -4
- package/base-modules/teacher/view.d.ts +1 -1
- package/base-modules/user/drawer.d.ts +1 -1
- package/base-modules/user/filter.d.ts +1 -1
- package/base-modules/user/form.d.ts +1 -1
- package/base-modules/user/more-actions.d.ts +1 -1
- package/base-modules/user/page.d.ts +8 -1
- package/base-modules/user/page.js +25 -4
- package/base-modules/user/view.d.ts +1 -1
- package/base-modules/workspace/context.d.ts +1 -1
- package/base-modules/workspace/drawer.d.ts +1 -1
- package/base-modules/workspace/filter.d.ts +1 -1
- package/base-modules/workspace/form.d.ts +1 -1
- package/base-modules/workspace/more-actions.d.ts +1 -1
- package/base-modules/workspace/view.d.ts +1 -1
- package/base-modules/workspace-user/filter.d.ts +1 -1
- package/base-modules/workspace-user/form.d.ts +1 -1
- package/base-modules/workspace-user/more-actions.d.ts +1 -1
- package/base-modules/workspace-user/page.d.ts +8 -1
- package/base-modules/workspace-user/page.js +25 -4
- package/base-modules/workspace-user/view.d.ts +1 -1
- package/components/timeline.d.ts +1 -1
- package/package.json +3 -3
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -74,7 +74,7 @@ const createComponentInstances = () => ({
|
|
|
74
74
|
moreActions: _jsx(StudentFeeMoreActions, {}),
|
|
75
75
|
view: _jsx(StudentFeeView, {}),
|
|
76
76
|
});
|
|
77
|
-
const createStudentFeeConfig = ({ cancelLabel, dispatch,
|
|
77
|
+
const createStudentFeeConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelAmount, labelAmountDue, labelAmountPaid, labelDueDate, labelFeeStructure, labelId, labelRemarks, labelStatus, labelStudent, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
|
|
78
78
|
const components = createComponentInstances();
|
|
79
79
|
return {
|
|
80
80
|
moduleName: "studentFee",
|
|
@@ -91,7 +91,14 @@ const createStudentFeeConfig = ({ cancelLabel, dispatch, drawerTitle, labelActio
|
|
|
91
91
|
{ label: labelActions, width: "5%" },
|
|
92
92
|
],
|
|
93
93
|
cancelLabel,
|
|
94
|
-
|
|
94
|
+
drawerFilterDescription,
|
|
95
|
+
drawerFilterTitle,
|
|
96
|
+
drawerFormDescription,
|
|
97
|
+
drawerFormTitle,
|
|
98
|
+
drawerMoreActionsDescription,
|
|
99
|
+
drawerMoreActionsTitle,
|
|
100
|
+
drawerViewDescription,
|
|
101
|
+
drawerViewTitle,
|
|
95
102
|
filterContent: components.filter,
|
|
96
103
|
formContent: components.form,
|
|
97
104
|
moreActionsContent: components.moreActions,
|
|
@@ -115,7 +122,14 @@ const StudentFeePageInner = (props) => {
|
|
|
115
122
|
const studentFeeConfig = useMemo(() => createStudentFeeConfig({
|
|
116
123
|
dispatch: context.dispatch,
|
|
117
124
|
cancelLabel: props.cancelLabel,
|
|
118
|
-
|
|
125
|
+
drawerFormTitle: props.drawerFormTitle,
|
|
126
|
+
drawerFormDescription: props.drawerFormDescription,
|
|
127
|
+
drawerViewTitle: props.drawerViewTitle,
|
|
128
|
+
drawerViewDescription: props.drawerViewDescription,
|
|
129
|
+
drawerFilterTitle: props.drawerFilterTitle,
|
|
130
|
+
drawerFilterDescription: props.drawerFilterDescription,
|
|
131
|
+
drawerMoreActionsTitle: props.drawerMoreActionsTitle,
|
|
132
|
+
drawerMoreActionsDescription: props.drawerMoreActionsDescription,
|
|
119
133
|
labelActions: props.labelActions,
|
|
120
134
|
labelAmount: props.labelAmount,
|
|
121
135
|
labelAmountDue: props.labelAmountDue,
|
|
@@ -133,7 +147,14 @@ const StudentFeePageInner = (props) => {
|
|
|
133
147
|
}), [
|
|
134
148
|
context.dispatch,
|
|
135
149
|
props.cancelLabel,
|
|
136
|
-
props.
|
|
150
|
+
props.drawerFormTitle,
|
|
151
|
+
props.drawerFormDescription,
|
|
152
|
+
props.drawerViewTitle,
|
|
153
|
+
props.drawerViewDescription,
|
|
154
|
+
props.drawerFilterTitle,
|
|
155
|
+
props.drawerFilterDescription,
|
|
156
|
+
props.drawerMoreActionsTitle,
|
|
157
|
+
props.drawerMoreActionsDescription,
|
|
137
158
|
props.labelActions,
|
|
138
159
|
props.labelAmount,
|
|
139
160
|
props.labelAmountDue,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const StudentFeeView: () => import("react
|
|
1
|
+
export declare const StudentFeeView: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const StudentProfileFilter: () => import("react
|
|
1
|
+
export declare const StudentProfileFilter: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const StudentProfileForm: () => import("react
|
|
1
|
+
export declare const StudentProfileForm: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const StudentProfileMoreActions: () => import("react
|
|
1
|
+
export declare const StudentProfileMoreActions: () => import("react").JSX.Element;
|
|
@@ -19,7 +19,14 @@ import { FC } from "react";
|
|
|
19
19
|
import { USER_ROLE } from "../../type";
|
|
20
20
|
interface Props {
|
|
21
21
|
cancelLabel: string;
|
|
22
|
-
|
|
22
|
+
drawerFilterDescription: string;
|
|
23
|
+
drawerFilterTitle: string;
|
|
24
|
+
drawerFormDescription: string;
|
|
25
|
+
drawerFormTitle: string;
|
|
26
|
+
drawerMoreActionsDescription: string;
|
|
27
|
+
drawerMoreActionsTitle: string;
|
|
28
|
+
drawerViewDescription: string;
|
|
29
|
+
drawerViewTitle: string;
|
|
23
30
|
labelActions: string;
|
|
24
31
|
labelEnabled: string;
|
|
25
32
|
labelFirstName: string;
|
|
@@ -48,7 +48,7 @@ const createComponentInstances = () => ({
|
|
|
48
48
|
moreActions: _jsx(StudentProfileMoreActions, {}),
|
|
49
49
|
view: _jsx(StudentProfileView, {}),
|
|
50
50
|
});
|
|
51
|
-
const createStudentProfileConfig = ({ cancelLabel, dispatch,
|
|
51
|
+
const createStudentProfileConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelEnabled, labelFirstName, labelId, labelLastName, labelStatus, labelStudentCode, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
|
|
52
52
|
const components = createComponentInstances();
|
|
53
53
|
return {
|
|
54
54
|
moduleName: "studentProfile",
|
|
@@ -62,7 +62,14 @@ const createStudentProfileConfig = ({ cancelLabel, dispatch, drawerTitle, labelA
|
|
|
62
62
|
{ label: labelActions, width: "5%" },
|
|
63
63
|
],
|
|
64
64
|
cancelLabel,
|
|
65
|
-
|
|
65
|
+
drawerFilterDescription,
|
|
66
|
+
drawerFilterTitle,
|
|
67
|
+
drawerFormDescription,
|
|
68
|
+
drawerFormTitle,
|
|
69
|
+
drawerMoreActionsDescription,
|
|
70
|
+
drawerMoreActionsTitle,
|
|
71
|
+
drawerViewDescription,
|
|
72
|
+
drawerViewTitle,
|
|
66
73
|
filterContent: components.filter,
|
|
67
74
|
formContent: components.form,
|
|
68
75
|
moreActionsContent: components.moreActions,
|
|
@@ -85,7 +92,14 @@ const StudentProfilePageInner = (props) => {
|
|
|
85
92
|
const studentProfileConfig = useMemo(() => createStudentProfileConfig({
|
|
86
93
|
dispatch: context.dispatch,
|
|
87
94
|
cancelLabel: props.cancelLabel,
|
|
88
|
-
|
|
95
|
+
drawerFormTitle: props.drawerFormTitle,
|
|
96
|
+
drawerFormDescription: props.drawerFormDescription,
|
|
97
|
+
drawerViewTitle: props.drawerViewTitle,
|
|
98
|
+
drawerViewDescription: props.drawerViewDescription,
|
|
99
|
+
drawerFilterTitle: props.drawerFilterTitle,
|
|
100
|
+
drawerFilterDescription: props.drawerFilterDescription,
|
|
101
|
+
drawerMoreActionsTitle: props.drawerMoreActionsTitle,
|
|
102
|
+
drawerMoreActionsDescription: props.drawerMoreActionsDescription,
|
|
89
103
|
labelActions: props.labelActions,
|
|
90
104
|
labelEnabled: props.labelEnabled,
|
|
91
105
|
labelFirstName: props.labelFirstName,
|
|
@@ -100,7 +114,14 @@ const StudentProfilePageInner = (props) => {
|
|
|
100
114
|
}), [
|
|
101
115
|
context.dispatch,
|
|
102
116
|
props.cancelLabel,
|
|
103
|
-
props.
|
|
117
|
+
props.drawerFormTitle,
|
|
118
|
+
props.drawerFormDescription,
|
|
119
|
+
props.drawerViewTitle,
|
|
120
|
+
props.drawerViewDescription,
|
|
121
|
+
props.drawerFilterTitle,
|
|
122
|
+
props.drawerFilterDescription,
|
|
123
|
+
props.drawerMoreActionsTitle,
|
|
124
|
+
props.drawerMoreActionsDescription,
|
|
104
125
|
props.labelActions,
|
|
105
126
|
props.labelEnabled,
|
|
106
127
|
props.labelFirstName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const StudentProfileView: () => import("react
|
|
1
|
+
export declare const StudentProfileView: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SubjectFilter: () => import("react
|
|
1
|
+
export declare const SubjectFilter: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SubjectForm: () => import("react
|
|
1
|
+
export declare const SubjectForm: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SubjectMoreActions: () => import("react
|
|
1
|
+
export declare const SubjectMoreActions: () => import("react").JSX.Element;
|
|
@@ -19,7 +19,14 @@ import { FC } from "react";
|
|
|
19
19
|
import { USER_ROLE } from "../../type";
|
|
20
20
|
interface Props {
|
|
21
21
|
cancelLabel: string;
|
|
22
|
-
|
|
22
|
+
drawerFilterDescription: string;
|
|
23
|
+
drawerFilterTitle: string;
|
|
24
|
+
drawerFormDescription: string;
|
|
25
|
+
drawerFormTitle: string;
|
|
26
|
+
drawerMoreActionsDescription: string;
|
|
27
|
+
drawerMoreActionsTitle: string;
|
|
28
|
+
drawerViewDescription: string;
|
|
29
|
+
drawerViewTitle: string;
|
|
23
30
|
labelActions: string;
|
|
24
31
|
labelCode: string;
|
|
25
32
|
labelDescription: string;
|
|
@@ -47,7 +47,7 @@ const createComponentInstances = () => ({
|
|
|
47
47
|
moreActions: _jsx(SubjectMoreActions, {}),
|
|
48
48
|
view: _jsx(SubjectView, {}),
|
|
49
49
|
});
|
|
50
|
-
const createSubjectConfig = ({ cancelLabel, dispatch,
|
|
50
|
+
const createSubjectConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelCode, labelDescription, labelEnabled, labelId, labelName, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
|
|
51
51
|
const components = createComponentInstances();
|
|
52
52
|
return {
|
|
53
53
|
moduleName: "subject",
|
|
@@ -60,7 +60,14 @@ const createSubjectConfig = ({ cancelLabel, dispatch, drawerTitle, labelActions,
|
|
|
60
60
|
{ label: labelActions, width: "5%" },
|
|
61
61
|
],
|
|
62
62
|
cancelLabel,
|
|
63
|
-
|
|
63
|
+
drawerFilterDescription,
|
|
64
|
+
drawerFilterTitle,
|
|
65
|
+
drawerFormDescription,
|
|
66
|
+
drawerFormTitle,
|
|
67
|
+
drawerMoreActionsDescription,
|
|
68
|
+
drawerMoreActionsTitle,
|
|
69
|
+
drawerViewDescription,
|
|
70
|
+
drawerViewTitle,
|
|
64
71
|
filterContent: components.filter,
|
|
65
72
|
formContent: components.form,
|
|
66
73
|
moreActionsContent: components.moreActions,
|
|
@@ -83,7 +90,14 @@ const SubjectPageInner = (props) => {
|
|
|
83
90
|
const subjectConfig = useMemo(() => createSubjectConfig({
|
|
84
91
|
dispatch: context.dispatch,
|
|
85
92
|
cancelLabel: props.cancelLabel,
|
|
86
|
-
|
|
93
|
+
drawerFormTitle: props.drawerFormTitle,
|
|
94
|
+
drawerFormDescription: props.drawerFormDescription,
|
|
95
|
+
drawerViewTitle: props.drawerViewTitle,
|
|
96
|
+
drawerViewDescription: props.drawerViewDescription,
|
|
97
|
+
drawerFilterTitle: props.drawerFilterTitle,
|
|
98
|
+
drawerFilterDescription: props.drawerFilterDescription,
|
|
99
|
+
drawerMoreActionsTitle: props.drawerMoreActionsTitle,
|
|
100
|
+
drawerMoreActionsDescription: props.drawerMoreActionsDescription,
|
|
87
101
|
labelActions: props.labelActions,
|
|
88
102
|
labelCode: props.labelCode,
|
|
89
103
|
labelDescription: props.labelDescription,
|
|
@@ -97,7 +111,14 @@ const SubjectPageInner = (props) => {
|
|
|
97
111
|
}), [
|
|
98
112
|
context.dispatch,
|
|
99
113
|
props.cancelLabel,
|
|
100
|
-
props.
|
|
114
|
+
props.drawerFormTitle,
|
|
115
|
+
props.drawerFormDescription,
|
|
116
|
+
props.drawerViewTitle,
|
|
117
|
+
props.drawerViewDescription,
|
|
118
|
+
props.drawerFilterTitle,
|
|
119
|
+
props.drawerFilterDescription,
|
|
120
|
+
props.drawerMoreActionsTitle,
|
|
121
|
+
props.drawerMoreActionsDescription,
|
|
101
122
|
props.labelActions,
|
|
102
123
|
props.labelCode,
|
|
103
124
|
props.labelDescription,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SubjectView: () => import("react
|
|
1
|
+
export declare const SubjectView: () => import("react").JSX.Element;
|
|
@@ -32,7 +32,6 @@ import { teacherFormValidation } from "./validate";
|
|
|
32
32
|
import { getCachedTeachers, invalidateTeachersCache } from "./cache";
|
|
33
33
|
import { getCachedWorkspaceSync } from "../workspace/cache";
|
|
34
34
|
import { processAvatarFile } from "./avatar-upload";
|
|
35
|
-
import { v4 as uuidv4 } from "uuid";
|
|
36
35
|
// ============================================================================
|
|
37
36
|
// 1.1 DRAWER TYPES
|
|
38
37
|
// ============================================================================
|
|
@@ -107,6 +106,8 @@ export const useTeacherModule = () => {
|
|
|
107
106
|
const schoolId = ((_a = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _a === void 0 ? void 0 : _a.id) || "";
|
|
108
107
|
const listFetchNowRef = useRef(null);
|
|
109
108
|
const debouncedQuery = useDebounce(state.searchQuery, 800);
|
|
109
|
+
const uploadInProgressRef = useRef(false);
|
|
110
|
+
const lastUploadRef = useRef(null);
|
|
110
111
|
// ============================================================================
|
|
111
112
|
// 1.4.2 API PARAMETERS
|
|
112
113
|
// ============================================================================
|
|
@@ -355,30 +356,30 @@ export const useTeacherModule = () => {
|
|
|
355
356
|
}, [dispatch]);
|
|
356
357
|
const handleAvatarUpload = useCallback(async (file) => {
|
|
357
358
|
try {
|
|
358
|
-
//
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
//
|
|
362
|
-
|
|
359
|
+
// Prevent duplicate concurrent uploads
|
|
360
|
+
const sig = `${file.name}-${file.size}-${file.lastModified}`;
|
|
361
|
+
const now = Date.now();
|
|
362
|
+
// If same file uploaded within last 5s, ignore
|
|
363
|
+
if (lastUploadRef.current &&
|
|
364
|
+
lastUploadRef.current.sig === sig &&
|
|
365
|
+
now - lastUploadRef.current.ts < 5000)
|
|
366
|
+
return;
|
|
367
|
+
if (uploadInProgressRef.current)
|
|
368
|
+
return;
|
|
369
|
+
uploadInProgressRef.current = true;
|
|
370
|
+
lastUploadRef.current = { sig, ts: now };
|
|
363
371
|
// Process avatar file (validate, convert to WebP)
|
|
364
372
|
const result = await processAvatarFile(file);
|
|
365
373
|
if ("type" in result) {
|
|
366
374
|
// Error result
|
|
367
375
|
const error = result;
|
|
368
376
|
showToast(error.message, TOAST_VARIANT.ERROR);
|
|
369
|
-
// dispatch({
|
|
370
|
-
// type: TEACHER_ACTION_TYPES.SET_INPUT_FIELD,
|
|
371
|
-
// payload: { key: "avatarUploading", value: false },
|
|
372
|
-
// });
|
|
373
377
|
return;
|
|
374
378
|
}
|
|
375
|
-
const teacherId =
|
|
379
|
+
const teacherId = state.id;
|
|
376
380
|
if (!teacherId) {
|
|
377
381
|
showToast("Please save the teacher record first before uploading an avatar", TOAST_VARIANT.ERROR);
|
|
378
|
-
|
|
379
|
-
// type: TEACHER_ACTION_TYPES.SET_INPUT_FIELD,
|
|
380
|
-
// payload: { key: "avatarUploading", value: false },
|
|
381
|
-
// });
|
|
382
|
+
uploadInProgressRef.current = false;
|
|
382
383
|
return;
|
|
383
384
|
}
|
|
384
385
|
// Upload to S3 via teacher-avatar endpoint
|
|
@@ -399,15 +400,11 @@ export const useTeacherModule = () => {
|
|
|
399
400
|
const errorData = await response.json().catch(() => ({}));
|
|
400
401
|
const errorMessage = errorData.error || `Upload failed with status ${response.status}`;
|
|
401
402
|
showToast(errorMessage, TOAST_VARIANT.ERROR);
|
|
402
|
-
|
|
403
|
-
// type: TEACHER_ACTION_TYPES.SET_INPUT_FIELD,
|
|
404
|
-
// payload: { key: "avatarUploading", value: false },
|
|
405
|
-
// });
|
|
403
|
+
uploadInProgressRef.current = false;
|
|
406
404
|
return;
|
|
407
405
|
}
|
|
408
406
|
const data = await response.json();
|
|
409
407
|
const avatarUrl = data.url;
|
|
410
|
-
// Update avatar field with presigned URL
|
|
411
408
|
dispatch({
|
|
412
409
|
type: TEACHER_ACTION_TYPES.SET_INPUT_FIELD,
|
|
413
410
|
payload: { key: "avatar", value: avatarUrl },
|
|
@@ -421,12 +418,9 @@ export const useTeacherModule = () => {
|
|
|
421
418
|
showToast(errorMessage, TOAST_VARIANT.ERROR);
|
|
422
419
|
}
|
|
423
420
|
finally {
|
|
424
|
-
|
|
425
|
-
// type: TEACHER_ACTION_TYPES.SET_INPUT_FIELD,
|
|
426
|
-
// payload: { key: "avatarUploading", value: false },
|
|
427
|
-
// });
|
|
421
|
+
uploadInProgressRef.current = false;
|
|
428
422
|
}
|
|
429
|
-
}, [dispatch, showToast, workspace === null || workspace === void 0 ? void 0 : workspace.id]);
|
|
423
|
+
}, [dispatch, showToast, state.id, workspace === null || workspace === void 0 ? void 0 : workspace.id]);
|
|
430
424
|
const applyFilters = useCallback(() => {
|
|
431
425
|
dispatch({
|
|
432
426
|
type: TEACHER_ACTION_TYPES.SET_CURRENT_PAGE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TeacherFilter: () => import("react
|
|
1
|
+
export declare const TeacherFilter: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TeacherForm: () => import("react
|
|
1
|
+
export declare const TeacherForm: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TeacherMoreActions: () => import("react
|
|
1
|
+
export declare const TeacherMoreActions: () => import("react").JSX.Element;
|
|
@@ -19,7 +19,14 @@ import { FC } from "react";
|
|
|
19
19
|
import { USER_ROLE } from "../../type";
|
|
20
20
|
interface Props {
|
|
21
21
|
cancelLabel: string;
|
|
22
|
-
|
|
22
|
+
drawerFilterDescription: string;
|
|
23
|
+
drawerFilterTitle: string;
|
|
24
|
+
drawerFormDescription: string;
|
|
25
|
+
drawerFormTitle: string;
|
|
26
|
+
drawerMoreActionsDescription: string;
|
|
27
|
+
drawerMoreActionsTitle: string;
|
|
28
|
+
drawerViewDescription: string;
|
|
29
|
+
drawerViewTitle: string;
|
|
23
30
|
labelActions: string;
|
|
24
31
|
labelEnabled: string;
|
|
25
32
|
labelId: string;
|
|
@@ -55,7 +55,7 @@ const createComponentInstances = () => ({
|
|
|
55
55
|
moreActions: _jsx(TeacherMoreActions, {}),
|
|
56
56
|
view: _jsx(TeacherView, {}),
|
|
57
57
|
});
|
|
58
|
-
const createTeacherConfig = ({ cancelLabel, dispatch,
|
|
58
|
+
const createTeacherConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelEnabled, labelId, labelName, labelPhone, labelSpecialization, labelTeacherCode, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
|
|
59
59
|
const components = createComponentInstances();
|
|
60
60
|
return {
|
|
61
61
|
moduleName: "teacher",
|
|
@@ -69,7 +69,14 @@ const createTeacherConfig = ({ cancelLabel, dispatch, drawerTitle, labelActions,
|
|
|
69
69
|
{ label: labelActions, width: "5%" },
|
|
70
70
|
],
|
|
71
71
|
cancelLabel,
|
|
72
|
-
|
|
72
|
+
drawerFilterDescription,
|
|
73
|
+
drawerFilterTitle,
|
|
74
|
+
drawerFormDescription,
|
|
75
|
+
drawerFormTitle,
|
|
76
|
+
drawerMoreActionsDescription,
|
|
77
|
+
drawerMoreActionsTitle,
|
|
78
|
+
drawerViewDescription,
|
|
79
|
+
drawerViewTitle,
|
|
73
80
|
filterContent: components.filter,
|
|
74
81
|
formContent: components.form,
|
|
75
82
|
moreActionsContent: components.moreActions,
|
|
@@ -92,7 +99,14 @@ const TeacherPageInner = (props) => {
|
|
|
92
99
|
const teacherConfig = useMemo(() => createTeacherConfig({
|
|
93
100
|
dispatch: context.dispatch,
|
|
94
101
|
cancelLabel: props.cancelLabel,
|
|
95
|
-
|
|
102
|
+
drawerFormTitle: props.drawerFormTitle,
|
|
103
|
+
drawerFormDescription: props.drawerFormDescription,
|
|
104
|
+
drawerViewTitle: props.drawerViewTitle,
|
|
105
|
+
drawerViewDescription: props.drawerViewDescription,
|
|
106
|
+
drawerFilterTitle: props.drawerFilterTitle,
|
|
107
|
+
drawerFilterDescription: props.drawerFilterDescription,
|
|
108
|
+
drawerMoreActionsTitle: props.drawerMoreActionsTitle,
|
|
109
|
+
drawerMoreActionsDescription: props.drawerMoreActionsDescription,
|
|
96
110
|
labelActions: props.labelActions,
|
|
97
111
|
labelEnabled: props.labelEnabled,
|
|
98
112
|
labelId: props.labelId,
|
|
@@ -107,7 +121,14 @@ const TeacherPageInner = (props) => {
|
|
|
107
121
|
}), [
|
|
108
122
|
context.dispatch,
|
|
109
123
|
props.cancelLabel,
|
|
110
|
-
props.
|
|
124
|
+
props.drawerFormTitle,
|
|
125
|
+
props.drawerFormDescription,
|
|
126
|
+
props.drawerViewTitle,
|
|
127
|
+
props.drawerViewDescription,
|
|
128
|
+
props.drawerFilterTitle,
|
|
129
|
+
props.drawerFilterDescription,
|
|
130
|
+
props.drawerMoreActionsTitle,
|
|
131
|
+
props.drawerMoreActionsDescription,
|
|
111
132
|
props.labelActions,
|
|
112
133
|
props.labelEnabled,
|
|
113
134
|
props.labelId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TeacherView: () => import("react
|
|
1
|
+
export declare const TeacherView: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Drawer: () => import("react
|
|
1
|
+
export declare const Drawer: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const UserFilter: () => import("react
|
|
1
|
+
export declare const UserFilter: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const UserForm: () => import("react
|
|
1
|
+
export declare const UserForm: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const UserMoreActions: () => import("react
|
|
1
|
+
export declare const UserMoreActions: () => import("react").JSX.Element;
|
|
@@ -19,7 +19,14 @@ import { FC } from "react";
|
|
|
19
19
|
import { USER_ROLE } from "../../type";
|
|
20
20
|
interface Props {
|
|
21
21
|
cancelLabel: string;
|
|
22
|
-
|
|
22
|
+
drawerFilterDescription: string;
|
|
23
|
+
drawerFilterTitle: string;
|
|
24
|
+
drawerFormDescription: string;
|
|
25
|
+
drawerFormTitle: string;
|
|
26
|
+
drawerMoreActionsDescription: string;
|
|
27
|
+
drawerMoreActionsTitle: string;
|
|
28
|
+
drawerViewDescription: string;
|
|
29
|
+
drawerViewTitle: string;
|
|
23
30
|
labelActions: string;
|
|
24
31
|
labelEmail: string;
|
|
25
32
|
labelEnabled: string;
|
|
@@ -47,7 +47,7 @@ const createComponentInstances = () => ({
|
|
|
47
47
|
moreActions: _jsx(UserMoreActions, {}),
|
|
48
48
|
view: _jsx(UserView, {}),
|
|
49
49
|
});
|
|
50
|
-
const createUserConfig = ({ cancelLabel, dispatch,
|
|
50
|
+
const createUserConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelEmail, labelEnabled, labelId, labelName, labelPhone, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
|
|
51
51
|
const components = createComponentInstances();
|
|
52
52
|
return {
|
|
53
53
|
moduleName: "user",
|
|
@@ -60,7 +60,14 @@ const createUserConfig = ({ cancelLabel, dispatch, drawerTitle, labelActions, la
|
|
|
60
60
|
{ label: labelActions, width: "5%" },
|
|
61
61
|
],
|
|
62
62
|
cancelLabel,
|
|
63
|
-
|
|
63
|
+
drawerFilterDescription,
|
|
64
|
+
drawerFilterTitle,
|
|
65
|
+
drawerFormDescription,
|
|
66
|
+
drawerFormTitle,
|
|
67
|
+
drawerMoreActionsDescription,
|
|
68
|
+
drawerMoreActionsTitle,
|
|
69
|
+
drawerViewDescription,
|
|
70
|
+
drawerViewTitle,
|
|
64
71
|
filterContent: components.filter,
|
|
65
72
|
formContent: components.form,
|
|
66
73
|
moreActionsContent: components.moreActions,
|
|
@@ -83,7 +90,14 @@ const UserPageInner = (props) => {
|
|
|
83
90
|
const userConfig = useMemo(() => createUserConfig({
|
|
84
91
|
dispatch: context.dispatch,
|
|
85
92
|
cancelLabel: props.cancelLabel,
|
|
86
|
-
|
|
93
|
+
drawerFormTitle: props.drawerFormTitle,
|
|
94
|
+
drawerFormDescription: props.drawerFormDescription,
|
|
95
|
+
drawerViewTitle: props.drawerViewTitle,
|
|
96
|
+
drawerViewDescription: props.drawerViewDescription,
|
|
97
|
+
drawerFilterTitle: props.drawerFilterTitle,
|
|
98
|
+
drawerFilterDescription: props.drawerFilterDescription,
|
|
99
|
+
drawerMoreActionsTitle: props.drawerMoreActionsTitle,
|
|
100
|
+
drawerMoreActionsDescription: props.drawerMoreActionsDescription,
|
|
87
101
|
labelActions: props.labelActions,
|
|
88
102
|
labelEmail: props.labelEmail,
|
|
89
103
|
labelEnabled: props.labelEnabled,
|
|
@@ -97,7 +111,14 @@ const UserPageInner = (props) => {
|
|
|
97
111
|
}), [
|
|
98
112
|
context.dispatch,
|
|
99
113
|
props.cancelLabel,
|
|
100
|
-
props.
|
|
114
|
+
props.drawerFormTitle,
|
|
115
|
+
props.drawerFormDescription,
|
|
116
|
+
props.drawerViewTitle,
|
|
117
|
+
props.drawerViewDescription,
|
|
118
|
+
props.drawerFilterTitle,
|
|
119
|
+
props.drawerFilterDescription,
|
|
120
|
+
props.drawerMoreActionsTitle,
|
|
121
|
+
props.drawerMoreActionsDescription,
|
|
101
122
|
props.labelActions,
|
|
102
123
|
props.labelEmail,
|
|
103
124
|
props.labelEnabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const UserView: () => import("react
|
|
1
|
+
export declare const UserView: () => import("react").JSX.Element;
|
|
@@ -155,7 +155,7 @@ type Plan = {
|
|
|
155
155
|
};
|
|
156
156
|
export declare const WorkspaceStateContextProvider: ({ children, }: {
|
|
157
157
|
children: React.ReactNode;
|
|
158
|
-
}) => import("react
|
|
158
|
+
}) => import("react").JSX.Element;
|
|
159
159
|
export declare const useWorkspaceModule: () => {
|
|
160
160
|
handleChange: (field: string, value: string | number | boolean | undefined | Record<string, string>) => void;
|
|
161
161
|
handleCloseDrawer: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WorkspaceDrawer: () => import("react
|
|
1
|
+
export declare const WorkspaceDrawer: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WorkspaceFilter: () => import("react
|
|
1
|
+
export declare const WorkspaceFilter: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WorkspaceForm: () => import("react
|
|
1
|
+
export declare const WorkspaceForm: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WorkspaceMoreActions: () => import("react
|
|
1
|
+
export declare const WorkspaceMoreActions: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WorkspaceView: () => import("react
|
|
1
|
+
export declare const WorkspaceView: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WorkspaceUserFilter: () => import("react
|
|
1
|
+
export declare const WorkspaceUserFilter: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WorkspaceUserForm: () => import("react
|
|
1
|
+
export declare const WorkspaceUserForm: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WorkspaceUserMoreActions: () => import("react
|
|
1
|
+
export declare const WorkspaceUserMoreActions: () => import("react").JSX.Element;
|
|
@@ -11,7 +11,14 @@ import { FC } from "react";
|
|
|
11
11
|
import { USER_ROLE } from "../../type";
|
|
12
12
|
interface Props {
|
|
13
13
|
cancelLabel: string;
|
|
14
|
-
|
|
14
|
+
drawerFilterDescription: string;
|
|
15
|
+
drawerFilterTitle: string;
|
|
16
|
+
drawerFormDescription: string;
|
|
17
|
+
drawerFormTitle: string;
|
|
18
|
+
drawerMoreActionsDescription: string;
|
|
19
|
+
drawerMoreActionsTitle: string;
|
|
20
|
+
drawerViewDescription: string;
|
|
21
|
+
drawerViewTitle: string;
|
|
15
22
|
labelActions: string;
|
|
16
23
|
labelId: string;
|
|
17
24
|
labelRole: string;
|
|
@@ -39,7 +39,7 @@ const createComponentInstances = () => ({
|
|
|
39
39
|
moreActions: _jsx(WorkspaceUserMoreActions, {}),
|
|
40
40
|
view: _jsx(WorkspaceUserView, {}),
|
|
41
41
|
});
|
|
42
|
-
const createWorkspaceUserConfig = ({ cancelLabel, dispatch,
|
|
42
|
+
const createWorkspaceUserConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelId, labelRole, labelSystemRole, labelUser, labelWorkspace, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
|
|
43
43
|
const components = createComponentInstances();
|
|
44
44
|
return {
|
|
45
45
|
moduleName: "workspaceUser",
|
|
@@ -52,7 +52,14 @@ const createWorkspaceUserConfig = ({ cancelLabel, dispatch, drawerTitle, labelAc
|
|
|
52
52
|
{ label: labelActions, width: "5%" },
|
|
53
53
|
],
|
|
54
54
|
cancelLabel,
|
|
55
|
-
|
|
55
|
+
drawerFilterDescription,
|
|
56
|
+
drawerFilterTitle,
|
|
57
|
+
drawerFormDescription,
|
|
58
|
+
drawerFormTitle,
|
|
59
|
+
drawerMoreActionsDescription,
|
|
60
|
+
drawerMoreActionsTitle,
|
|
61
|
+
drawerViewDescription,
|
|
62
|
+
drawerViewTitle,
|
|
56
63
|
filterContent: components.filter,
|
|
57
64
|
formContent: components.form,
|
|
58
65
|
moreActionsContent: components.moreActions,
|
|
@@ -78,7 +85,14 @@ const WorkspaceUserPageInner = (props) => {
|
|
|
78
85
|
const workspaceUserConfig = useMemo(() => createWorkspaceUserConfig({
|
|
79
86
|
cancelLabel: props.cancelLabel,
|
|
80
87
|
dispatch: context.dispatch,
|
|
81
|
-
|
|
88
|
+
drawerFormTitle: props.drawerFormTitle,
|
|
89
|
+
drawerFormDescription: props.drawerFormDescription,
|
|
90
|
+
drawerViewTitle: props.drawerViewTitle,
|
|
91
|
+
drawerViewDescription: props.drawerViewDescription,
|
|
92
|
+
drawerFilterTitle: props.drawerFilterTitle,
|
|
93
|
+
drawerFilterDescription: props.drawerFilterDescription,
|
|
94
|
+
drawerMoreActionsTitle: props.drawerMoreActionsTitle,
|
|
95
|
+
drawerMoreActionsDescription: props.drawerMoreActionsDescription,
|
|
82
96
|
labelActions: props.labelActions,
|
|
83
97
|
labelId: props.labelId,
|
|
84
98
|
labelRole: props.labelRole,
|
|
@@ -92,7 +106,14 @@ const WorkspaceUserPageInner = (props) => {
|
|
|
92
106
|
}), [
|
|
93
107
|
context.dispatch,
|
|
94
108
|
props.cancelLabel,
|
|
95
|
-
props.
|
|
109
|
+
props.drawerFormTitle,
|
|
110
|
+
props.drawerFormDescription,
|
|
111
|
+
props.drawerViewTitle,
|
|
112
|
+
props.drawerViewDescription,
|
|
113
|
+
props.drawerFilterTitle,
|
|
114
|
+
props.drawerFilterDescription,
|
|
115
|
+
props.drawerMoreActionsTitle,
|
|
116
|
+
props.drawerMoreActionsDescription,
|
|
96
117
|
props.labelActions,
|
|
97
118
|
props.labelId,
|
|
98
119
|
props.labelRole,
|