@appcorp/fusion-storybook 0.2.86 → 0.2.89
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.js +3 -3
- package/base-modules/admission/form.js +1 -1
- package/base-modules/admission/more-actions.js +288 -2
- package/base-modules/admission/view.js +1 -1
- package/base-modules/attendance/form.js +3 -3
- package/base-modules/campus/form.js +2 -1
- package/base-modules/campus/validate.d.ts +13 -5
- package/base-modules/campus/validate.js +24 -19
- package/base-modules/class/form.js +2 -1
- package/base-modules/class/more-actions.js +2 -2
- package/base-modules/class/validate.d.ts +10 -5
- package/base-modules/class/validate.js +18 -16
- package/base-modules/class/view.js +2 -2
- package/base-modules/course/form.js +2 -1
- package/base-modules/course/validate.d.ts +7 -5
- package/base-modules/course/validate.js +12 -13
- package/base-modules/course/view.js +3 -3
- package/base-modules/discount-code/constants.d.ts +1 -1
- package/base-modules/discount-code/constants.js +1 -1
- package/base-modules/discount-code/form.js +2 -1
- package/base-modules/discount-code/more-actions.js +1 -1
- package/base-modules/discount-code/page.d.ts +10 -10
- package/base-modules/discount-code/page.js +31 -31
- package/base-modules/discount-code/validate.d.ts +5 -0
- package/base-modules/discount-code/validate.js +8 -3
- package/base-modules/discount-code/view.js +2 -2
- package/base-modules/enrollment/form.js +3 -2
- package/base-modules/enrollment/more-actions.js +5 -5
- package/base-modules/enrollment/page.d.ts +10 -10
- package/base-modules/enrollment/page.js +31 -31
- package/base-modules/enrollment/validate.d.ts +6 -0
- package/base-modules/enrollment/validate.js +13 -5
- package/base-modules/enrollment/view.js +2 -2
- package/base-modules/expense/filter.js +1 -1
- package/base-modules/expense/form.js +3 -3
- package/base-modules/expense/more-actions.js +6 -6
- package/base-modules/expense/page.d.ts +11 -11
- package/base-modules/expense/page.js +34 -34
- package/base-modules/expense/validate.d.ts +8 -0
- package/base-modules/expense/validate.js +13 -5
- package/base-modules/expense/view.js +2 -2
- package/base-modules/family/context.js +1 -1
- package/base-modules/family/form.js +1 -1
- package/base-modules/family/more-actions.js +2 -2
- package/base-modules/family/page.d.ts +10 -10
- package/base-modules/family/page.js +31 -31
- package/base-modules/family/validate.d.ts +4 -0
- package/base-modules/family/validate.js +8 -1
- package/base-modules/family/view.js +1 -1
- package/base-modules/family-member/context.js +1 -1
- package/base-modules/family-member/form.js +2 -1
- package/base-modules/family-member/more-actions.js +5 -5
- package/base-modules/family-member/page.d.ts +40 -13
- package/base-modules/family-member/page.js +34 -34
- package/base-modules/family-member/validate.d.ts +8 -0
- package/base-modules/family-member/validate.js +20 -5
- package/base-modules/family-member/view.js +3 -3
- package/base-modules/fee-structure/form.js +5 -4
- package/base-modules/fee-structure/more-actions.js +2 -2
- package/base-modules/fee-structure/page.d.ts +11 -11
- package/base-modules/fee-structure/page.js +34 -34
- package/base-modules/fee-structure/validate.d.ts +6 -0
- package/base-modules/fee-structure/validate.js +12 -3
- package/base-modules/fee-structure/view.js +3 -3
- package/base-modules/rbac/assign-permissions.js +9 -5
- package/base-modules/rbac/filter.js +5 -3
- package/base-modules/rbac/form.js +2 -1
- package/base-modules/rbac/more-actions.d.ts +0 -5
- package/base-modules/rbac/more-actions.js +3 -1
- package/base-modules/rbac/validate.d.ts +3 -0
- package/base-modules/rbac/validate.js +7 -1
- package/base-modules/rbac/view.js +7 -5
- package/base-modules/school/drawer.js +3 -1
- package/base-modules/school/form.js +2 -1
- package/base-modules/school/validate.d.ts +8 -0
- package/base-modules/school/validate.js +17 -6
- package/base-modules/school/view.js +2 -2
- package/base-modules/section/filter.js +1 -1
- package/base-modules/section/form.js +3 -2
- package/base-modules/section/page.d.ts +8 -8
- package/base-modules/section/page.js +25 -25
- package/base-modules/section/validate.d.ts +7 -0
- package/base-modules/section/validate.js +15 -5
- package/base-modules/section/view.js +3 -3
- package/base-modules/student-fee/filter.js +1 -1
- package/base-modules/student-fee/form.js +3 -2
- package/base-modules/student-fee/more-actions.js +11 -10
- package/base-modules/student-fee/page.d.ts +13 -13
- package/base-modules/student-fee/page.js +40 -40
- package/base-modules/student-fee/validate.d.ts +11 -3
- package/base-modules/student-fee/validate.js +20 -12
- package/base-modules/student-fee/view.js +4 -4
- package/base-modules/student-profile/context/use-student-profile-module.js +2 -2
- package/base-modules/student-profile/filter.js +2 -2
- package/base-modules/student-profile/form.js +6 -5
- package/base-modules/student-profile/page.d.ts +10 -10
- package/base-modules/student-profile/page.js +31 -31
- package/base-modules/student-profile/validate.d.ts +8 -2
- package/base-modules/student-profile/validate.js +13 -10
- package/base-modules/student-profile/view.js +2 -2
- package/base-modules/subject/filter.js +1 -1
- package/base-modules/subject/form.js +2 -1
- package/base-modules/subject/more-actions.js +3 -3
- package/base-modules/subject/page.d.ts +9 -9
- package/base-modules/subject/page.js +28 -28
- package/base-modules/subject/validate.d.ts +12 -1
- package/base-modules/subject/validate.js +24 -10
- package/base-modules/subject/view.js +3 -3
- package/base-modules/teacher/context.js +3 -3
- package/base-modules/teacher/filter.js +1 -1
- package/base-modules/teacher/form.js +9 -32
- package/base-modules/teacher/more-actions.js +2 -2
- package/base-modules/teacher/page.d.ts +10 -10
- package/base-modules/teacher/page.js +31 -31
- package/base-modules/teacher/validate.d.ts +5 -1
- package/base-modules/teacher/validate.js +10 -25
- package/base-modules/teacher/view.js +3 -3
- package/base-modules/user/filter.js +1 -1
- package/base-modules/user/form.js +3 -2
- package/base-modules/user/page.d.ts +9 -9
- package/base-modules/user/page.js +28 -28
- package/base-modules/user/validate.d.ts +8 -1
- package/base-modules/user/validate.js +16 -6
- package/base-modules/user/view.js +1 -1
- package/base-modules/workspace/context.js +3 -3
- package/base-modules/workspace/drawer.js +1 -1
- package/base-modules/workspace/filter.js +1 -1
- package/base-modules/workspace/form.js +2 -1
- package/base-modules/workspace/more-actions.js +1 -1
- package/base-modules/workspace/page.d.ts +1 -1
- package/base-modules/workspace/page.js +2 -2
- package/base-modules/workspace/validate.d.ts +4 -0
- package/base-modules/workspace/validate.js +6 -2
- package/base-modules/workspace/view.js +2 -2
- package/base-modules/workspace-user/context.js +6 -6
- package/base-modules/workspace-user/form.js +2 -1
- package/base-modules/workspace-user/page.d.ts +9 -9
- package/base-modules/workspace-user/page.js +28 -28
- package/base-modules/workspace-user/validate.d.ts +4 -5
- package/base-modules/workspace-user/validate.js +6 -10
- package/base-modules/workspace-user/view.js +1 -1
- package/constants.d.ts +5 -1
- package/constants.js +2 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/get-translated-error.d.ts +5 -0
- package/utils/get-translated-error.js +5 -0
|
@@ -19,6 +19,7 @@ import { API_METHODS, DATE_FORMATS, formatDate, } from "@react-pakistan/util-fun
|
|
|
19
19
|
import { DISCOUNT_TYPE, } from "../../type";
|
|
20
20
|
import { useTranslations } from "next-intl";
|
|
21
21
|
import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
|
|
22
|
+
import { getTranslatedError } from "../../utils/get-translated-error";
|
|
22
23
|
export const StudentFeeForm = () => {
|
|
23
24
|
var _a, _b, _c, _d, _e;
|
|
24
25
|
const { state, handleChange } = useStudentFeeModule();
|
|
@@ -128,7 +129,7 @@ export const StudentFeeForm = () => {
|
|
|
128
129
|
emptyText: t("formNoStatusEmpty"),
|
|
129
130
|
id: "status",
|
|
130
131
|
info: t("formStatusInfo"),
|
|
131
|
-
label: t("
|
|
132
|
+
label: t("formStatusLabel"),
|
|
132
133
|
onValueChange: (value) => handleChange("status", value),
|
|
133
134
|
options: PAYMENT_STATUS_OPTIONS.map((opt) => ({
|
|
134
135
|
value: opt.value,
|
|
@@ -147,5 +148,5 @@ export const StudentFeeForm = () => {
|
|
|
147
148
|
},
|
|
148
149
|
value: status,
|
|
149
150
|
});
|
|
150
|
-
return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [studentProfileIdCombo, feeStructureIdCombo, discountCodeIdCombo, _jsx(EnhancedInput, { error: errors.discountAmount, id: "discountAmount", info: t("formDiscountAmountInfo"), label: t("formDiscountAmountLabel"), min: "0", onChange: (e) => handleChange("discountAmount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: discountAmount || 0 }), _jsx(EnhancedInput, { error: errors
|
|
151
|
+
return (_jsxs("div", { className: "grid grid-cols-1 gap-4", children: [studentProfileIdCombo, feeStructureIdCombo, discountCodeIdCombo, _jsx(EnhancedInput, { error: errors.discountAmount, id: "discountAmount", info: t("formDiscountAmountInfo"), label: t("formDiscountAmountLabel"), min: "0", onChange: (e) => handleChange("discountAmount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: discountAmount || 0 }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amount", t }), id: "amount", info: t("formTotalAmountInfo"), label: t("formTotalAmountLabel"), min: "0", onChange: (e) => handleChange("amount", Number(e.target.value)), placeholder: "0.00", required: true, step: "0.01", type: "number", value: amount }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "amountPaid", t }), id: "amountPaid", info: t("formAmountPaidInfo"), label: t("formAmountPaidLabel"), min: "0", onChange: (e) => handleChange("amountPaid", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountPaid }), _jsx(EnhancedInput, { disabled: true, error: getTranslatedError({ errors, key: "amountDue", t }), id: "amountDue", info: t("formAmountDueInfo"), label: t("formAmountDueLabel"), min: "0", onChange: (e) => handleChange("amountDue", Number(e.target.value)), placeholder: "0.00", step: "0.01", type: "number", value: amountDue }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dueDate", t }), id: "dueDate", info: t("formDueDateInfo"), label: t("formDueDateLabel"), onChange: (e) => handleChange("dueDate", e.target.value), required: true, type: "date", value: formatDate(dueDate, DATE_FORMATS.YYYY_MM_DD) }), statusCombo, _jsx(EnhancedTextarea, { error: getTranslatedError({ errors, key: "remarks", t }), id: "remarks", label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), value: remarks || "" }), _jsx(EnhancedCheckbox, { checked: enabled, error: getTranslatedError({ errors, key: "enabled", t }), id: "enabled", info: t("formEnabledInfo"), label: t("formEnabledLabel"), onCheckedChange: (checked) => handleChange("enabled", !!checked) })] }));
|
|
151
152
|
};
|
|
@@ -91,7 +91,7 @@ export const StudentFeeMoreActions = () => {
|
|
|
91
91
|
};
|
|
92
92
|
}, []);
|
|
93
93
|
const handleBulkFlow = useCallback(async (files, method) => {
|
|
94
|
-
var _a, _b, _c, _d
|
|
94
|
+
var _a, _b, _c, _d;
|
|
95
95
|
const closeDrawer = () => {
|
|
96
96
|
dispatch({
|
|
97
97
|
type: STUDENT_FEE_ACTION_TYPES.SET_DRAWER,
|
|
@@ -110,24 +110,25 @@ export const StudentFeeMoreActions = () => {
|
|
|
110
110
|
showErrorToast(t("messagesBulkCsvEmpty"));
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
|
+
const isEmpty = (v) => v === null || v === undefined || String(v).trim() === "";
|
|
113
114
|
const validationErrors = [];
|
|
114
115
|
for (let i = 0; i < records.length; i++) {
|
|
115
116
|
const row = records[i];
|
|
116
117
|
const msgs = [];
|
|
117
118
|
if (method === "POST") {
|
|
118
|
-
if (
|
|
119
|
+
if (isEmpty(row.familyId))
|
|
119
120
|
msgs.push(t("validationRequiredFamilyId"));
|
|
120
|
-
if (
|
|
121
|
+
if (isEmpty(row.studentProfileId))
|
|
121
122
|
msgs.push(t("validationRequiredStudentProfileId"));
|
|
122
|
-
if (
|
|
123
|
+
if (isEmpty(row.feeStructureId))
|
|
123
124
|
msgs.push(t("validationRequiredFeeStructureId"));
|
|
124
|
-
if (
|
|
125
|
+
if (isEmpty(row.amount))
|
|
125
126
|
msgs.push(t("validationRequiredAmount"));
|
|
126
|
-
if (
|
|
127
|
+
if (isEmpty(row.dueDate))
|
|
127
128
|
msgs.push(t("validationRequiredDueDate"));
|
|
128
129
|
}
|
|
129
130
|
else {
|
|
130
|
-
if (
|
|
131
|
+
if (isEmpty(row.id))
|
|
131
132
|
msgs.push(t("validationRequiredIdForUpdate"));
|
|
132
133
|
}
|
|
133
134
|
if (msgs.length > 0) {
|
|
@@ -174,7 +175,7 @@ export const StudentFeeMoreActions = () => {
|
|
|
174
175
|
return;
|
|
175
176
|
if (status.status === "completed") {
|
|
176
177
|
const r = status.results;
|
|
177
|
-
if (r && ((
|
|
178
|
+
if (r && ((_b = r.errors) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
178
179
|
const summary = formatErrorSummary(t, r.errors);
|
|
179
180
|
showSuccessToast(`${t("messagesBulkResults", { created: r.created, updated: r.updated, skipped: r.skipped })}\n${summary}`);
|
|
180
181
|
}
|
|
@@ -188,7 +189,7 @@ export const StudentFeeMoreActions = () => {
|
|
|
188
189
|
else {
|
|
189
190
|
showSuccessToast(t("messagesBulkSuccess"));
|
|
190
191
|
}
|
|
191
|
-
const schoolId = ((
|
|
192
|
+
const schoolId = ((_c = workspace === null || workspace === void 0 ? void 0 : workspace.school) === null || _c === void 0 ? void 0 : _c.id) || "";
|
|
192
193
|
fetch(`${STUDENT_FEE_API_ROUTES.UNIT}?currentPage=1&pageLimit=${PAGE_LIMIT}&schoolId=${schoolId}`, {
|
|
193
194
|
headers: {
|
|
194
195
|
"Content-Type": "application/json",
|
|
@@ -212,7 +213,7 @@ export const StudentFeeMoreActions = () => {
|
|
|
212
213
|
}
|
|
213
214
|
else {
|
|
214
215
|
const r = status.results;
|
|
215
|
-
const detail = ((
|
|
216
|
+
const detail = ((_d = r === null || r === void 0 ? void 0 : r.errors) === null || _d === void 0 ? void 0 : _d.length)
|
|
216
217
|
? formatErrorSummary(t, r.errors)
|
|
217
218
|
: t("unknownError");
|
|
218
219
|
showErrorToast(`${t("messagesBulkFailed", { action: label })}\n${detail}`);
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
import { FC } from "react";
|
|
16
16
|
import { USER_ROLE } from "../../type";
|
|
17
17
|
interface Props {
|
|
18
|
-
|
|
18
|
+
drawerButtonCancel: string;
|
|
19
|
+
drawerButtonSave: string;
|
|
19
20
|
drawerFilterDescription: string;
|
|
20
21
|
drawerFilterTitle: string;
|
|
21
22
|
drawerFormDescription: string;
|
|
@@ -24,19 +25,18 @@ interface Props {
|
|
|
24
25
|
drawerMoreActionsTitle: string;
|
|
25
26
|
drawerViewDescription: string;
|
|
26
27
|
drawerViewTitle: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
saveLabel: string;
|
|
38
|
-
searchPlaceholder: string;
|
|
28
|
+
tableColumnHeaderActions: string;
|
|
29
|
+
tableColumnHeaderAmount: string;
|
|
30
|
+
tableColumnHeaderAmountDue: string;
|
|
31
|
+
tableColumnHeaderAmountPaid: string;
|
|
32
|
+
tableColumnHeaderDueDate: string;
|
|
33
|
+
tableColumnHeaderFeeStructure: string;
|
|
34
|
+
tableColumnHeaderId: string;
|
|
35
|
+
tableColumnHeaderRemarks: string;
|
|
36
|
+
tableColumnHeaderStatus: string;
|
|
37
|
+
tableColumnHeaderStudent: string;
|
|
39
38
|
tableDescription: string;
|
|
39
|
+
tableSearchPlaceholder: string;
|
|
40
40
|
tableTitle: string;
|
|
41
41
|
userRole: USER_ROLE;
|
|
42
42
|
}
|
|
@@ -74,23 +74,23 @@ const createComponentInstances = () => ({
|
|
|
74
74
|
moreActions: _jsx(StudentFeeMoreActions, {}),
|
|
75
75
|
view: _jsx(StudentFeeView, {}),
|
|
76
76
|
});
|
|
77
|
-
const createStudentFeeConfig = ({
|
|
77
|
+
const createStudentFeeConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderAmount, tableColumnHeaderAmountDue, tableColumnHeaderAmountPaid, tableColumnHeaderDueDate, tableColumnHeaderFeeStructure, tableColumnHeaderId, tableColumnHeaderRemarks, tableColumnHeaderStatus, tableColumnHeaderStudent, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
|
|
78
78
|
const components = createComponentInstances();
|
|
79
79
|
return {
|
|
80
80
|
moduleName: "studentFee",
|
|
81
81
|
tableColumns: [
|
|
82
|
-
{ label:
|
|
83
|
-
{ label:
|
|
84
|
-
{ label:
|
|
85
|
-
{ label:
|
|
86
|
-
{ label:
|
|
87
|
-
{ label:
|
|
88
|
-
{ label:
|
|
89
|
-
{ label:
|
|
90
|
-
{ label:
|
|
91
|
-
{ label:
|
|
82
|
+
{ label: tableColumnHeaderId, width: "5%" },
|
|
83
|
+
{ label: tableColumnHeaderStudent, width: "12%" },
|
|
84
|
+
{ label: tableColumnHeaderFeeStructure, width: "12%" },
|
|
85
|
+
{ label: tableColumnHeaderAmount, width: "10%" },
|
|
86
|
+
{ label: tableColumnHeaderAmountPaid, width: "10%" },
|
|
87
|
+
{ label: tableColumnHeaderAmountDue, width: "10%" },
|
|
88
|
+
{ label: tableColumnHeaderDueDate, width: "10%" },
|
|
89
|
+
{ label: tableColumnHeaderStatus, width: "10%" },
|
|
90
|
+
{ label: tableColumnHeaderRemarks, width: "11%" },
|
|
91
|
+
{ label: tableColumnHeaderActions, width: "5%" },
|
|
92
92
|
],
|
|
93
|
-
cancelLabel,
|
|
93
|
+
cancelLabel: drawerButtonCancel,
|
|
94
94
|
drawerFilterDescription,
|
|
95
95
|
drawerFilterTitle,
|
|
96
96
|
drawerFormDescription,
|
|
@@ -102,8 +102,8 @@ const createStudentFeeConfig = ({ cancelLabel, dispatch, drawerFilterDescription
|
|
|
102
102
|
filterContent: components.filter,
|
|
103
103
|
formContent: components.form,
|
|
104
104
|
moreActionsContent: components.moreActions,
|
|
105
|
-
saveLabel,
|
|
106
|
-
searchPlaceholder,
|
|
105
|
+
saveLabel: drawerButtonSave,
|
|
106
|
+
searchPlaceholder: tableSearchPlaceholder,
|
|
107
107
|
tableDescription,
|
|
108
108
|
tableTitle,
|
|
109
109
|
viewContent: components.view,
|
|
@@ -121,7 +121,8 @@ const StudentFeePageInner = (props) => {
|
|
|
121
121
|
// Memoize config creation - destructure props to avoid object reference changes
|
|
122
122
|
const studentFeeConfig = useMemo(() => createStudentFeeConfig({
|
|
123
123
|
dispatch: context.dispatch,
|
|
124
|
-
|
|
124
|
+
drawerButtonCancel: props.drawerButtonCancel,
|
|
125
|
+
drawerButtonSave: props.drawerButtonSave,
|
|
125
126
|
drawerFormTitle: props.drawerFormTitle,
|
|
126
127
|
drawerFormDescription: props.drawerFormDescription,
|
|
127
128
|
drawerViewTitle: props.drawerViewTitle,
|
|
@@ -130,23 +131,23 @@ const StudentFeePageInner = (props) => {
|
|
|
130
131
|
drawerFilterDescription: props.drawerFilterDescription,
|
|
131
132
|
drawerMoreActionsTitle: props.drawerMoreActionsTitle,
|
|
132
133
|
drawerMoreActionsDescription: props.drawerMoreActionsDescription,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
saveLabel: props.saveLabel,
|
|
144
|
-
searchPlaceholder: props.searchPlaceholder,
|
|
134
|
+
tableColumnHeaderActions: props.tableColumnHeaderActions,
|
|
135
|
+
tableColumnHeaderAmount: props.tableColumnHeaderAmount,
|
|
136
|
+
tableColumnHeaderAmountDue: props.tableColumnHeaderAmountDue,
|
|
137
|
+
tableColumnHeaderAmountPaid: props.tableColumnHeaderAmountPaid,
|
|
138
|
+
tableColumnHeaderDueDate: props.tableColumnHeaderDueDate,
|
|
139
|
+
tableColumnHeaderFeeStructure: props.tableColumnHeaderFeeStructure,
|
|
140
|
+
tableColumnHeaderId: props.tableColumnHeaderId,
|
|
141
|
+
tableColumnHeaderRemarks: props.tableColumnHeaderRemarks,
|
|
142
|
+
tableColumnHeaderStatus: props.tableColumnHeaderStatus,
|
|
143
|
+
tableColumnHeaderStudent: props.tableColumnHeaderStudent,
|
|
145
144
|
tableDescription: props.tableDescription,
|
|
145
|
+
tableSearchPlaceholder: props.tableSearchPlaceholder,
|
|
146
146
|
tableTitle: props.tableTitle,
|
|
147
147
|
}), [
|
|
148
148
|
context.dispatch,
|
|
149
|
-
props.
|
|
149
|
+
props.drawerButtonCancel,
|
|
150
|
+
props.drawerButtonSave,
|
|
150
151
|
props.drawerFormTitle,
|
|
151
152
|
props.drawerFormDescription,
|
|
152
153
|
props.drawerViewTitle,
|
|
@@ -155,19 +156,18 @@ const StudentFeePageInner = (props) => {
|
|
|
155
156
|
props.drawerFilterDescription,
|
|
156
157
|
props.drawerMoreActionsTitle,
|
|
157
158
|
props.drawerMoreActionsDescription,
|
|
158
|
-
props.
|
|
159
|
-
props.
|
|
160
|
-
props.
|
|
161
|
-
props.
|
|
162
|
-
props.
|
|
163
|
-
props.
|
|
164
|
-
props.
|
|
165
|
-
props.
|
|
166
|
-
props.
|
|
167
|
-
props.
|
|
168
|
-
props.saveLabel,
|
|
169
|
-
props.searchPlaceholder,
|
|
159
|
+
props.tableColumnHeaderActions,
|
|
160
|
+
props.tableColumnHeaderAmount,
|
|
161
|
+
props.tableColumnHeaderAmountDue,
|
|
162
|
+
props.tableColumnHeaderAmountPaid,
|
|
163
|
+
props.tableColumnHeaderDueDate,
|
|
164
|
+
props.tableColumnHeaderFeeStructure,
|
|
165
|
+
props.tableColumnHeaderId,
|
|
166
|
+
props.tableColumnHeaderRemarks,
|
|
167
|
+
props.tableColumnHeaderStatus,
|
|
168
|
+
props.tableColumnHeaderStudent,
|
|
170
169
|
props.tableDescription,
|
|
170
|
+
props.tableSearchPlaceholder,
|
|
171
171
|
props.tableTitle,
|
|
172
172
|
]);
|
|
173
173
|
const hasPermission = resolveRbacPermissions({
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* StudentFee Validation
|
|
2
|
+
* StudentFee Validation Schema
|
|
3
3
|
*
|
|
4
|
-
* Zod
|
|
5
|
-
* the `user` module validation file.
|
|
4
|
+
* Zod validation schemas for student-fee form data.
|
|
6
5
|
*/
|
|
7
6
|
import { z } from "zod";
|
|
8
7
|
import { PAYMENT_STATUS } from "../../type";
|
|
8
|
+
export declare const VALIDATION_KEYS: {
|
|
9
|
+
readonly familyId: "validationStudentFeeFamilyIdRequired";
|
|
10
|
+
readonly studentProfileId: "validationStudentFeeStudentProfileIdRequired";
|
|
11
|
+
readonly feeStructureId: "validationStudentFeeFeeStructureIdRequired";
|
|
12
|
+
readonly amountPositive: "validationStudentFeeAmountPositive";
|
|
13
|
+
readonly dueDateRequired: "validationStudentFeeDueDateRequired";
|
|
14
|
+
readonly dueDateInvalid: "validationStudentFeeDueDateInvalid";
|
|
15
|
+
readonly statusInvalid: "validationStudentFeeStatusInvalid";
|
|
16
|
+
};
|
|
9
17
|
export declare const studentFeeFormValidation: z.ZodObject<{
|
|
10
18
|
familyId: z.ZodString;
|
|
11
19
|
studentProfileId: z.ZodString;
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* StudentFee Validation
|
|
2
|
+
* StudentFee Validation Schema
|
|
3
3
|
*
|
|
4
|
-
* Zod
|
|
5
|
-
* the `user` module validation file.
|
|
4
|
+
* Zod validation schemas for student-fee form data.
|
|
6
5
|
*/
|
|
7
6
|
import { z } from "zod";
|
|
8
7
|
import { PAYMENT_STATUS } from "../../type";
|
|
8
|
+
export const VALIDATION_KEYS = {
|
|
9
|
+
familyId: "validationStudentFeeFamilyIdRequired",
|
|
10
|
+
studentProfileId: "validationStudentFeeStudentProfileIdRequired",
|
|
11
|
+
feeStructureId: "validationStudentFeeFeeStructureIdRequired",
|
|
12
|
+
amountPositive: "validationStudentFeeAmountPositive",
|
|
13
|
+
dueDateRequired: "validationStudentFeeDueDateRequired",
|
|
14
|
+
dueDateInvalid: "validationStudentFeeDueDateInvalid",
|
|
15
|
+
statusInvalid: "validationStudentFeeStatusInvalid",
|
|
16
|
+
};
|
|
9
17
|
export const studentFeeFormValidation = z.object({
|
|
10
|
-
familyId: z.string().min(1,
|
|
11
|
-
studentProfileId: z.string().min(1,
|
|
12
|
-
feeStructureId: z.string().min(1,
|
|
18
|
+
familyId: z.string().min(1, VALIDATION_KEYS.familyId),
|
|
19
|
+
studentProfileId: z.string().min(1, VALIDATION_KEYS.studentProfileId),
|
|
20
|
+
feeStructureId: z.string().min(1, VALIDATION_KEYS.feeStructureId),
|
|
13
21
|
discountCodeId: z.string().optional().nullable(),
|
|
14
|
-
amount: z.number().positive(
|
|
15
|
-
amountPaid: z.number().min(0,
|
|
16
|
-
amountDue: z.number().min(0,
|
|
22
|
+
amount: z.number().positive(VALIDATION_KEYS.amountPositive),
|
|
23
|
+
amountPaid: z.number().min(0, VALIDATION_KEYS.amountPositive).optional(),
|
|
24
|
+
amountDue: z.number().min(0, VALIDATION_KEYS.amountPositive).optional(),
|
|
17
25
|
dueDate: z
|
|
18
26
|
.string()
|
|
19
|
-
.min(1,
|
|
20
|
-
.refine((v) => !isNaN(Date.parse(v)),
|
|
27
|
+
.min(1, VALIDATION_KEYS.dueDateRequired)
|
|
28
|
+
.refine((v) => !isNaN(Date.parse(v)), VALIDATION_KEYS.dueDateInvalid),
|
|
21
29
|
status: z.nativeEnum(PAYMENT_STATUS, {
|
|
22
|
-
error:
|
|
30
|
+
error: VALIDATION_KEYS.statusInvalid,
|
|
23
31
|
}),
|
|
24
32
|
remarks: z.string().optional().nullable(),
|
|
25
33
|
enabled: z.boolean().optional(),
|
|
@@ -24,9 +24,9 @@ export const StudentFeeView = () => {
|
|
|
24
24
|
method: API_METHODS.GET,
|
|
25
25
|
params: { id: feeStructureId, workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id },
|
|
26
26
|
});
|
|
27
|
-
return (_jsx("div", { className: "space-y-4", children: _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionStudentFeeDetails") })] }), _jsx(CardDescription, { children: t("viewSectionReadOnlyStudentFeeInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("
|
|
27
|
+
return (_jsx("div", { className: "space-y-4", children: _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionStudentFeeDetails") })] }), _jsx(CardDescription, { children: t("viewSectionReadOnlyStudentFeeInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formStudentLabel") }), _jsx("p", { className: "text-base", children: studentProfile
|
|
28
28
|
? `${studentProfile.firstName} ${studentProfile.lastName}`
|
|
29
|
-
: "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldComputerNumber") }), _jsx("p", { className: "text-base", children: (studentProfile === null || studentProfile === void 0 ? void 0 : studentProfile.computerNumber) || "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("
|
|
30
|
-
? t("
|
|
31
|
-
: t("
|
|
29
|
+
: "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldComputerNumber") }), _jsx("p", { className: "text-base", children: (studentProfile === null || studentProfile === void 0 ? void 0 : studentProfile.computerNumber) || "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formFeeStructureLabel") }), _jsx("p", { className: "text-base", children: (feeStructure === null || feeStructure === void 0 ? void 0 : feeStructure.name) || "—" })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formTotalAmountLabel") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amount !== null && amount !== void 0 ? amount : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formAmountPaidLabel") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amountPaid !== null && amountPaid !== void 0 ? amountPaid : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formAmountDueLabel") }), _jsxs("p", { className: "text-base", children: [currency, " ", (amountDue !== null && amountDue !== void 0 ? amountDue : 0).toFixed(2)] })] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Calendar, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formDueDateLabel") })] }), _jsx("p", { className: "text-base", children: formatDate(dueDate, DATE_FORMATS.LOCALE_DATE) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formStatusLabel") }), _jsx(Badge, { variant: "secondary", children: status || "—" })] }), remarks && (_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formRemarksLabel") }), _jsx("p", { className: "text-base", children: remarks })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRecordState") }), _jsxs(Badge, { className: "gap-1", variant: enabled ? "default" : "destructive", children: [enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), enabled
|
|
30
|
+
? t("badgeActive")
|
|
31
|
+
: t("badgeInactive")] })] })] }) })] }) }));
|
|
32
32
|
};
|
|
@@ -353,7 +353,7 @@ export const useStudentProfileModule = () => {
|
|
|
353
353
|
});
|
|
354
354
|
}, [updateFetchNow]);
|
|
355
355
|
const handleWithdrawStudent = useCallback(async () => {
|
|
356
|
-
if (!confirm(t("
|
|
356
|
+
if (!confirm(t("messagesWithdrawConfirmation")))
|
|
357
357
|
return;
|
|
358
358
|
dispatch({
|
|
359
359
|
type: STUDENT_PROFILE_ACTION_TYPES.SET_INPUT_FIELD,
|
|
@@ -366,7 +366,7 @@ export const useStudentProfileModule = () => {
|
|
|
366
366
|
}, [dispatch, t]);
|
|
367
367
|
const handleReAdmitStudent = useCallback(async (row) => {
|
|
368
368
|
var _a;
|
|
369
|
-
if (!confirm(t("
|
|
369
|
+
if (!confirm(t("messagesReAdmitConfirmation")))
|
|
370
370
|
return;
|
|
371
371
|
const { data, error } = await fetchData({
|
|
372
372
|
url: "/api/v1/readmit-student",
|
|
@@ -25,8 +25,8 @@ export const StudentProfileFilter = () => {
|
|
|
25
25
|
};
|
|
26
26
|
const { enhancedComboboxElement: filterStatusCombo } = useEnhancedCombobox({
|
|
27
27
|
id: "filterStatus",
|
|
28
|
-
label: t("
|
|
29
|
-
info: t("
|
|
28
|
+
label: t("filterStatusLabel"),
|
|
29
|
+
info: t("filterStatusInfo"),
|
|
30
30
|
options: [...STATUS_OPTIONS].map((opt) => ({
|
|
31
31
|
value: opt.value,
|
|
32
32
|
label: statusLabelMap[opt.value] || opt.label,
|
|
@@ -8,6 +8,7 @@ import { useTranslations } from "next-intl";
|
|
|
8
8
|
import { useStudentProfileModule } from "./context";
|
|
9
9
|
import { STATUS_OPTIONS, GENDER_OPTIONS } from "./constants";
|
|
10
10
|
import { STUDENT_PROFILE_API_ROUTES } from "../../constants";
|
|
11
|
+
import { getTranslatedError } from "../../utils/get-translated-error";
|
|
11
12
|
export const StudentProfileForm = () => {
|
|
12
13
|
const t = useTranslations("studentProfile");
|
|
13
14
|
const genderLabelMap = {
|
|
@@ -21,7 +22,7 @@ export const StudentProfileForm = () => {
|
|
|
21
22
|
const { handleChange } = context;
|
|
22
23
|
const { enhancedComboboxElement: genderCombo } = useEnhancedCombobox({
|
|
23
24
|
id: "gender",
|
|
24
|
-
info: t("
|
|
25
|
+
info: t("formGenderInfo"),
|
|
25
26
|
label: t("formGenderLabel"),
|
|
26
27
|
onValueChange: (value) => handleChange("gender", value),
|
|
27
28
|
options: GENDER_OPTIONS.map((opt) => ({
|
|
@@ -41,8 +42,8 @@ export const StudentProfileForm = () => {
|
|
|
41
42
|
});
|
|
42
43
|
const { enhancedComboboxElement: statusCombo } = useEnhancedCombobox({
|
|
43
44
|
id: "status",
|
|
44
|
-
info: t("
|
|
45
|
-
label: t("
|
|
45
|
+
info: t("formStatusInfo"),
|
|
46
|
+
label: t("formStatusLabel"),
|
|
46
47
|
onValueChange: (value) => handleChange("status", value),
|
|
47
48
|
options: STATUS_OPTIONS.map((opt) => ({
|
|
48
49
|
value: opt.value,
|
|
@@ -60,7 +61,7 @@ export const StudentProfileForm = () => {
|
|
|
60
61
|
},
|
|
61
62
|
value: status,
|
|
62
63
|
});
|
|
63
|
-
return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionPersonalInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors
|
|
64
|
+
return (_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionPersonalInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "firstName", t }), id: "firstName", info: t("formFirstNameInfo"), label: t("formFirstNameLabel"), onChange: (e) => handleChange("firstName", e.target.value), placeholder: t("formFirstNamePlaceholder"), required: true, value: firstName }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "lastName", t }), id: "lastName", info: t("formLastNameInfo"), label: t("formLastNameLabel"), onChange: (e) => handleChange("lastName", e.target.value), placeholder: t("formLastNamePlaceholder"), required: true, value: lastName }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "dateOfBirth", t }), id: "dateOfBirth", info: t("formDateOfBirthInfo"), label: t("formDateOfBirthLabel"), onChange: (e) => handleChange("dateOfBirth", e.target.value), onClick: (e) => { var _a, _b; return (_b = (_a = e.currentTarget).showPicker) === null || _b === void 0 ? void 0 : _b.call(_a); }, type: "date", value: dateOfBirth
|
|
64
65
|
? new Date(dateOfBirth).toISOString().split("formTLabel")[0]
|
|
65
|
-
: "" }), genderCombo] })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionContactInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors
|
|
66
|
+
: "" }), genderCombo] })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionContactInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "phone", t }), id: "phone", info: t("formPhoneInfo"), label: t("formPhoneLabel"), onChange: (e) => handleChange("phone", e.target.value), placeholder: t("formPhonePlaceholder"), type: "tel", value: phone || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "emergencyPhone", t }), id: "emergencyPhone", info: t("formEmergencyPhoneInfo"), label: t("formEmergencyPhoneLabel"), onChange: (e) => handleChange("emergencyPhone", e.target.value), placeholder: t("formEmergencyPhonePlaceholder"), type: "tel", value: emergencyPhone || "" })] }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "address", t }), id: "address", info: t("formAddressInfo"), label: t("formAddressLabel"), onChange: (e) => handleChange("address", e.target.value), placeholder: t("formAddressPlaceholder"), value: address || "" }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "city", t }), id: "city", info: t("formCityInfo"), label: t("formCityLabel"), onChange: (e) => handleChange("city", e.target.value), placeholder: t("formCityPlaceholder"), value: city || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "state", t }), id: "state", info: t("formStateInfo"), label: t("formStateProvinceLabel"), onChange: (e) => handleChange("state", e.target.value), placeholder: t("formStatePlaceholder"), value: stateValue || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "country", t }), id: "country", info: t("formCountryInfo"), label: t("formCountryLabel"), onChange: (e) => handleChange("country", e.target.value), placeholder: t("formCountryPlaceholder"), value: country || "" }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "postalCode", t }), id: "postalCode", info: t("formPostalCodeInfo"), label: t("formPostalCodeLabel"), onChange: (e) => handleChange("postalCode", e.target.value), placeholder: t("formPostalCodePlaceholder"), value: postalCode || "" })] })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionAcademicInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [statusCombo, _jsx(EnhancedTextarea, { error: getTranslatedError({ errors, key: "remarks", t }), id: "remarks", info: t("formRemarksInfo"), label: t("formRemarksLabel"), onChange: (e) => handleChange("remarks", e.target.value), placeholder: t("formRemarksPlaceholder"), rows: 4, value: remarks || "" })] }), _jsx(EnhancedCheckbox, { checked: enabled, info: t("formEnabledInfo"), label: t("formEnabledLabel"), onCheckedChange: (checked) => handleChange("enabled", checked) })] })] }));
|
|
66
67
|
};
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
import { FC } from "react";
|
|
19
19
|
import { USER_ROLE } from "../../type";
|
|
20
20
|
interface Props {
|
|
21
|
-
|
|
21
|
+
drawerButtonCancel: string;
|
|
22
|
+
drawerButtonSave: string;
|
|
22
23
|
drawerFilterDescription: string;
|
|
23
24
|
drawerFilterTitle: string;
|
|
24
25
|
drawerFormDescription: string;
|
|
@@ -27,16 +28,15 @@ interface Props {
|
|
|
27
28
|
drawerMoreActionsTitle: string;
|
|
28
29
|
drawerViewDescription: string;
|
|
29
30
|
drawerViewTitle: string;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
saveLabel: string;
|
|
38
|
-
searchPlaceholder: string;
|
|
31
|
+
tableColumnHeaderActions: string;
|
|
32
|
+
tableColumnHeaderEnabled: string;
|
|
33
|
+
tableColumnHeaderName: string;
|
|
34
|
+
tableColumnHeaderId: string;
|
|
35
|
+
tableColumnHeaderComputerCode: string;
|
|
36
|
+
tableColumnHeaderClassSection: string;
|
|
37
|
+
tableColumnHeaderStudentCode: string;
|
|
39
38
|
tableDescription: string;
|
|
39
|
+
tableSearchPlaceholder: string;
|
|
40
40
|
tableTitle: string;
|
|
41
41
|
userRole: USER_ROLE;
|
|
42
42
|
}
|
|
@@ -71,20 +71,20 @@ const createComponentInstances = () => ({
|
|
|
71
71
|
moreActions: _jsx(StudentProfileMoreActions, {}),
|
|
72
72
|
view: _jsx(StudentProfileView, {}),
|
|
73
73
|
});
|
|
74
|
-
const createStudentProfileConfig = ({
|
|
74
|
+
const createStudentProfileConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderEnabled, tableColumnHeaderName, tableColumnHeaderId, tableColumnHeaderComputerCode, tableColumnHeaderClassSection, tableColumnHeaderStudentCode, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
|
|
75
75
|
const components = createComponentInstances();
|
|
76
76
|
return {
|
|
77
77
|
moduleName: "studentProfile",
|
|
78
78
|
tableColumns: [
|
|
79
|
-
{ label:
|
|
80
|
-
{ label:
|
|
81
|
-
{ label:
|
|
82
|
-
{ label:
|
|
83
|
-
{ label:
|
|
84
|
-
{ label:
|
|
85
|
-
{ label:
|
|
79
|
+
{ label: tableColumnHeaderId, width: "5%" },
|
|
80
|
+
{ label: tableColumnHeaderName, width: "15%" },
|
|
81
|
+
{ label: tableColumnHeaderComputerCode, width: "15%" },
|
|
82
|
+
{ label: tableColumnHeaderStudentCode, width: "15%" },
|
|
83
|
+
{ label: tableColumnHeaderClassSection, width: "20%" },
|
|
84
|
+
{ label: tableColumnHeaderEnabled, width: "10%" },
|
|
85
|
+
{ label: tableColumnHeaderActions, width: "5%" },
|
|
86
86
|
],
|
|
87
|
-
cancelLabel,
|
|
87
|
+
cancelLabel: drawerButtonCancel,
|
|
88
88
|
drawerFilterDescription,
|
|
89
89
|
drawerFilterTitle,
|
|
90
90
|
drawerFormDescription,
|
|
@@ -96,8 +96,8 @@ const createStudentProfileConfig = ({ cancelLabel, dispatch, drawerFilterDescrip
|
|
|
96
96
|
filterContent: components.filter,
|
|
97
97
|
formContent: components.form,
|
|
98
98
|
moreActionsContent: components.moreActions,
|
|
99
|
-
saveLabel,
|
|
100
|
-
searchPlaceholder,
|
|
99
|
+
saveLabel: drawerButtonSave,
|
|
100
|
+
searchPlaceholder: tableSearchPlaceholder,
|
|
101
101
|
tableDescription,
|
|
102
102
|
tableTitle,
|
|
103
103
|
viewContent: components.view,
|
|
@@ -114,7 +114,8 @@ const StudentProfilePageInner = (props) => {
|
|
|
114
114
|
const context = useStudentProfileModule();
|
|
115
115
|
const studentProfileConfig = useMemo(() => createStudentProfileConfig({
|
|
116
116
|
dispatch: context.dispatch,
|
|
117
|
-
|
|
117
|
+
drawerButtonCancel: props.drawerButtonCancel,
|
|
118
|
+
drawerButtonSave: props.drawerButtonSave,
|
|
118
119
|
drawerFormTitle: props.drawerFormTitle,
|
|
119
120
|
drawerFormDescription: props.drawerFormDescription,
|
|
120
121
|
drawerViewTitle: props.drawerViewTitle,
|
|
@@ -123,20 +124,20 @@ const StudentProfilePageInner = (props) => {
|
|
|
123
124
|
drawerFilterDescription: props.drawerFilterDescription,
|
|
124
125
|
drawerMoreActionsTitle: props.drawerMoreActionsTitle,
|
|
125
126
|
drawerMoreActionsDescription: props.drawerMoreActionsDescription,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
saveLabel: props.saveLabel,
|
|
134
|
-
searchPlaceholder: props.searchPlaceholder,
|
|
127
|
+
tableColumnHeaderActions: props.tableColumnHeaderActions,
|
|
128
|
+
tableColumnHeaderEnabled: props.tableColumnHeaderEnabled,
|
|
129
|
+
tableColumnHeaderName: props.tableColumnHeaderName,
|
|
130
|
+
tableColumnHeaderId: props.tableColumnHeaderId,
|
|
131
|
+
tableColumnHeaderComputerCode: props.tableColumnHeaderComputerCode,
|
|
132
|
+
tableColumnHeaderClassSection: props.tableColumnHeaderClassSection,
|
|
133
|
+
tableColumnHeaderStudentCode: props.tableColumnHeaderStudentCode,
|
|
135
134
|
tableDescription: props.tableDescription,
|
|
135
|
+
tableSearchPlaceholder: props.tableSearchPlaceholder,
|
|
136
136
|
tableTitle: props.tableTitle,
|
|
137
137
|
}), [
|
|
138
138
|
context.dispatch,
|
|
139
|
-
props.
|
|
139
|
+
props.drawerButtonCancel,
|
|
140
|
+
props.drawerButtonSave,
|
|
140
141
|
props.drawerFormTitle,
|
|
141
142
|
props.drawerFormDescription,
|
|
142
143
|
props.drawerViewTitle,
|
|
@@ -145,16 +146,15 @@ const StudentProfilePageInner = (props) => {
|
|
|
145
146
|
props.drawerFilterDescription,
|
|
146
147
|
props.drawerMoreActionsTitle,
|
|
147
148
|
props.drawerMoreActionsDescription,
|
|
148
|
-
props.
|
|
149
|
-
props.
|
|
150
|
-
props.
|
|
151
|
-
props.
|
|
152
|
-
props.
|
|
153
|
-
props.
|
|
154
|
-
props.
|
|
155
|
-
props.saveLabel,
|
|
156
|
-
props.searchPlaceholder,
|
|
149
|
+
props.tableColumnHeaderActions,
|
|
150
|
+
props.tableColumnHeaderEnabled,
|
|
151
|
+
props.tableColumnHeaderName,
|
|
152
|
+
props.tableColumnHeaderId,
|
|
153
|
+
props.tableColumnHeaderComputerCode,
|
|
154
|
+
props.tableColumnHeaderClassSection,
|
|
155
|
+
props.tableColumnHeaderStudentCode,
|
|
157
156
|
props.tableDescription,
|
|
157
|
+
props.tableSearchPlaceholder,
|
|
158
158
|
props.tableTitle,
|
|
159
159
|
]);
|
|
160
160
|
const hasPermission = resolveRbacPermissions({
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Student Validation Schema
|
|
2
|
+
* Student Profile Validation Schema
|
|
3
3
|
*
|
|
4
|
-
* Zod validation schemas for student form data.
|
|
4
|
+
* Zod validation schemas for student profile form data.
|
|
5
5
|
*/
|
|
6
6
|
import { z } from "zod";
|
|
7
|
+
export declare const VALIDATION_KEYS: {
|
|
8
|
+
readonly firstNameRequired: "validationStudentProfileFirstNameRequired";
|
|
9
|
+
readonly lastNameRequired: "validationStudentProfileLastNameRequired";
|
|
10
|
+
readonly phoneInvalid: "validationStudentProfilePhoneInvalid";
|
|
11
|
+
readonly statusRequired: "validationStudentProfileStatusRequired";
|
|
12
|
+
};
|
|
7
13
|
export declare const studentProfileFormValidation: z.ZodObject<{
|
|
8
14
|
firstName: z.ZodString;
|
|
9
15
|
lastName: z.ZodString;
|