@appcorp/fusion-storybook 0.2.88 → 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.
Files changed (146) hide show
  1. package/base-modules/admission/filter.js +3 -3
  2. package/base-modules/admission/form.js +1 -1
  3. package/base-modules/admission/more-actions.js +288 -2
  4. package/base-modules/admission/view.js +1 -1
  5. package/base-modules/attendance/form.js +3 -3
  6. package/base-modules/campus/form.js +2 -1
  7. package/base-modules/campus/validate.d.ts +13 -5
  8. package/base-modules/campus/validate.js +24 -19
  9. package/base-modules/class/form.js +2 -1
  10. package/base-modules/class/more-actions.js +2 -2
  11. package/base-modules/class/validate.d.ts +10 -5
  12. package/base-modules/class/validate.js +18 -16
  13. package/base-modules/class/view.js +2 -2
  14. package/base-modules/course/form.js +2 -1
  15. package/base-modules/course/validate.d.ts +7 -5
  16. package/base-modules/course/validate.js +12 -13
  17. package/base-modules/course/view.js +3 -3
  18. package/base-modules/discount-code/constants.d.ts +1 -1
  19. package/base-modules/discount-code/constants.js +1 -1
  20. package/base-modules/discount-code/form.js +2 -1
  21. package/base-modules/discount-code/more-actions.js +1 -1
  22. package/base-modules/discount-code/page.d.ts +10 -10
  23. package/base-modules/discount-code/page.js +31 -31
  24. package/base-modules/discount-code/validate.d.ts +5 -0
  25. package/base-modules/discount-code/validate.js +8 -3
  26. package/base-modules/discount-code/view.js +2 -2
  27. package/base-modules/enrollment/form.js +3 -2
  28. package/base-modules/enrollment/more-actions.js +5 -5
  29. package/base-modules/enrollment/page.d.ts +10 -10
  30. package/base-modules/enrollment/page.js +31 -31
  31. package/base-modules/enrollment/validate.d.ts +6 -0
  32. package/base-modules/enrollment/validate.js +13 -5
  33. package/base-modules/enrollment/view.js +2 -2
  34. package/base-modules/expense/filter.js +1 -1
  35. package/base-modules/expense/form.js +3 -3
  36. package/base-modules/expense/more-actions.js +6 -6
  37. package/base-modules/expense/page.d.ts +11 -11
  38. package/base-modules/expense/page.js +34 -34
  39. package/base-modules/expense/validate.d.ts +8 -0
  40. package/base-modules/expense/validate.js +13 -5
  41. package/base-modules/expense/view.js +2 -2
  42. package/base-modules/family/context.js +1 -1
  43. package/base-modules/family/form.js +1 -1
  44. package/base-modules/family/more-actions.js +2 -2
  45. package/base-modules/family/page.d.ts +10 -10
  46. package/base-modules/family/page.js +31 -31
  47. package/base-modules/family/validate.d.ts +4 -0
  48. package/base-modules/family/validate.js +8 -1
  49. package/base-modules/family/view.js +1 -1
  50. package/base-modules/family-member/context.js +1 -1
  51. package/base-modules/family-member/form.js +2 -1
  52. package/base-modules/family-member/more-actions.js +5 -5
  53. package/base-modules/family-member/page.d.ts +40 -13
  54. package/base-modules/family-member/page.js +34 -34
  55. package/base-modules/family-member/validate.d.ts +8 -0
  56. package/base-modules/family-member/validate.js +20 -5
  57. package/base-modules/family-member/view.js +3 -3
  58. package/base-modules/fee-structure/form.js +5 -4
  59. package/base-modules/fee-structure/more-actions.js +2 -2
  60. package/base-modules/fee-structure/page.d.ts +11 -11
  61. package/base-modules/fee-structure/page.js +34 -34
  62. package/base-modules/fee-structure/validate.d.ts +6 -0
  63. package/base-modules/fee-structure/validate.js +12 -3
  64. package/base-modules/fee-structure/view.js +3 -3
  65. package/base-modules/rbac/assign-permissions.js +9 -5
  66. package/base-modules/rbac/filter.js +5 -3
  67. package/base-modules/rbac/form.js +2 -1
  68. package/base-modules/rbac/more-actions.d.ts +0 -5
  69. package/base-modules/rbac/more-actions.js +3 -1
  70. package/base-modules/rbac/validate.d.ts +3 -0
  71. package/base-modules/rbac/validate.js +7 -1
  72. package/base-modules/rbac/view.js +7 -5
  73. package/base-modules/school/drawer.js +3 -1
  74. package/base-modules/school/form.js +2 -1
  75. package/base-modules/school/validate.d.ts +8 -0
  76. package/base-modules/school/validate.js +17 -6
  77. package/base-modules/school/view.js +2 -2
  78. package/base-modules/section/filter.js +1 -1
  79. package/base-modules/section/form.js +3 -2
  80. package/base-modules/section/page.d.ts +8 -8
  81. package/base-modules/section/page.js +25 -25
  82. package/base-modules/section/validate.d.ts +7 -0
  83. package/base-modules/section/validate.js +15 -5
  84. package/base-modules/section/view.js +3 -3
  85. package/base-modules/student-fee/filter.js +1 -1
  86. package/base-modules/student-fee/form.js +3 -2
  87. package/base-modules/student-fee/page.d.ts +13 -13
  88. package/base-modules/student-fee/page.js +40 -40
  89. package/base-modules/student-fee/validate.d.ts +11 -3
  90. package/base-modules/student-fee/validate.js +20 -12
  91. package/base-modules/student-fee/view.js +4 -4
  92. package/base-modules/student-profile/context/use-student-profile-module.js +2 -2
  93. package/base-modules/student-profile/filter.js +2 -2
  94. package/base-modules/student-profile/form.js +6 -5
  95. package/base-modules/student-profile/page.d.ts +10 -10
  96. package/base-modules/student-profile/page.js +31 -31
  97. package/base-modules/student-profile/validate.d.ts +8 -2
  98. package/base-modules/student-profile/validate.js +13 -10
  99. package/base-modules/student-profile/view.js +2 -2
  100. package/base-modules/subject/filter.js +1 -1
  101. package/base-modules/subject/form.js +2 -1
  102. package/base-modules/subject/more-actions.js +3 -3
  103. package/base-modules/subject/page.d.ts +9 -9
  104. package/base-modules/subject/page.js +28 -28
  105. package/base-modules/subject/validate.d.ts +12 -1
  106. package/base-modules/subject/validate.js +24 -10
  107. package/base-modules/subject/view.js +3 -3
  108. package/base-modules/teacher/context.js +3 -3
  109. package/base-modules/teacher/filter.js +1 -1
  110. package/base-modules/teacher/form.js +9 -32
  111. package/base-modules/teacher/more-actions.js +2 -2
  112. package/base-modules/teacher/page.d.ts +10 -10
  113. package/base-modules/teacher/page.js +31 -31
  114. package/base-modules/teacher/validate.d.ts +5 -1
  115. package/base-modules/teacher/validate.js +10 -25
  116. package/base-modules/teacher/view.js +3 -3
  117. package/base-modules/user/filter.js +1 -1
  118. package/base-modules/user/form.js +3 -2
  119. package/base-modules/user/page.d.ts +9 -9
  120. package/base-modules/user/page.js +28 -28
  121. package/base-modules/user/validate.d.ts +8 -1
  122. package/base-modules/user/validate.js +16 -6
  123. package/base-modules/user/view.js +1 -1
  124. package/base-modules/workspace/context.js +3 -3
  125. package/base-modules/workspace/drawer.js +1 -1
  126. package/base-modules/workspace/filter.js +1 -1
  127. package/base-modules/workspace/form.js +2 -1
  128. package/base-modules/workspace/more-actions.js +1 -1
  129. package/base-modules/workspace/page.d.ts +1 -1
  130. package/base-modules/workspace/page.js +2 -2
  131. package/base-modules/workspace/validate.d.ts +4 -0
  132. package/base-modules/workspace/validate.js +6 -2
  133. package/base-modules/workspace/view.js +2 -2
  134. package/base-modules/workspace-user/context.js +6 -6
  135. package/base-modules/workspace-user/form.js +2 -1
  136. package/base-modules/workspace-user/page.d.ts +9 -9
  137. package/base-modules/workspace-user/page.js +28 -28
  138. package/base-modules/workspace-user/validate.d.ts +4 -5
  139. package/base-modules/workspace-user/validate.js +6 -10
  140. package/base-modules/workspace-user/view.js +1 -1
  141. package/constants.d.ts +5 -1
  142. package/constants.js +2 -0
  143. package/package.json +1 -1
  144. package/tsconfig.build.tsbuildinfo +1 -1
  145. package/utils/get-translated-error.d.ts +5 -0
  146. package/utils/get-translated-error.js +5 -0
@@ -121,9 +121,9 @@ export const ClassMoreActions = () => {
121
121
  const msgs = [];
122
122
  if (method === "POST") {
123
123
  if (!((_b = row.code) === null || _b === void 0 ? void 0 : _b.trim()))
124
- msgs.push(t("validationRequiredCode"));
124
+ msgs.push(t("validationClassCodeRequired"));
125
125
  if (!((_c = row.name) === null || _c === void 0 ? void 0 : _c.trim()))
126
- msgs.push(t("validationRequiredName"));
126
+ msgs.push(t("validationClassNameRequired"));
127
127
  }
128
128
  else {
129
129
  if (!((_d = row.id) === null || _d === void 0 ? void 0 : _d.trim()))
@@ -1,9 +1,14 @@
1
- /**
2
- * Class Validation Schema
3
- *
4
- * Zod validation schemas for class form data with business rules.
5
- */
6
1
  import { z } from "zod";
2
+ export declare const VALIDATION_KEYS: {
3
+ readonly nameRequired: "validationClassNameRequired";
4
+ readonly nameMaxLength: "validationClassNameMaxLength";
5
+ readonly nameFormat: "validationClassNameFormat";
6
+ readonly codeRequired: "validationClassCodeRequired";
7
+ readonly codeMaxLength: "validationClassCodeMaxLength";
8
+ readonly codeFormat: "validationClassCodeFormat";
9
+ readonly codeMinLength: "validationClassCodeMinLength";
10
+ readonly descriptionMaxLength: "validationClassDescriptionMaxLength";
11
+ };
7
12
  export declare const classFormValidation: z.ZodObject<{
8
13
  name: z.ZodString;
9
14
  code: z.ZodString;
@@ -1,27 +1,29 @@
1
- /**
2
- * Class Validation Schema
3
- *
4
- * Zod validation schemas for class form data with business rules.
5
- */
6
1
  import { z } from "zod";
7
- // ============================================================================
8
- // VALIDATION SCHEMA
9
- // ============================================================================
2
+ export const VALIDATION_KEYS = {
3
+ nameRequired: "validationClassNameRequired",
4
+ nameMaxLength: "validationClassNameMaxLength",
5
+ nameFormat: "validationClassNameFormat",
6
+ codeRequired: "validationClassCodeRequired",
7
+ codeMaxLength: "validationClassCodeMaxLength",
8
+ codeFormat: "validationClassCodeFormat",
9
+ codeMinLength: "validationClassCodeMinLength",
10
+ descriptionMaxLength: "validationClassDescriptionMaxLength",
11
+ };
10
12
  export const classFormValidation = z.object({
11
13
  name: z
12
14
  .string()
13
- .min(1, "Name is required")
14
- .max(100, "Name must be less than 100 characters")
15
- .regex(/^[a-zA-Z0-9\s\-_]+$/, "Name can only contain letters, numbers, spaces, hyphens, and underscores"),
15
+ .min(1, VALIDATION_KEYS.nameRequired)
16
+ .max(100, VALIDATION_KEYS.nameMaxLength)
17
+ .regex(/^[a-zA-Z0-9\s\-_]+$/, VALIDATION_KEYS.nameFormat),
16
18
  code: z
17
19
  .string()
18
- .min(1, "Code is required")
19
- .max(20, "Code must be less than 20 characters")
20
- .regex(/^[A-Z0-9\-_]+$/, "Code must be uppercase letters, numbers, hyphens, or underscores")
21
- .refine((code) => code.length >= 2, "Code must be at least 2 characters"),
20
+ .min(1, VALIDATION_KEYS.codeRequired)
21
+ .max(20, VALIDATION_KEYS.codeMaxLength)
22
+ .regex(/^[A-Z0-9\-_]+$/, VALIDATION_KEYS.codeFormat)
23
+ .refine((code) => code.length >= 2, VALIDATION_KEYS.codeMinLength),
22
24
  description: z
23
25
  .string()
24
- .max(500, "Description must be less than 500 characters")
26
+ .max(500, VALIDATION_KEYS.descriptionMaxLength)
25
27
  .optional(),
26
28
  enabled: z.boolean().optional(),
27
29
  });
@@ -17,6 +17,6 @@ export const ClassView = () => {
17
17
  const { code, description, enabled, name } = state;
18
18
  const t = useTranslations("class");
19
19
  return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(GraduationCap, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: name }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [t("viewFieldCode"), ": ", code] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(GraduationCap, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionClassDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteClassInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClassName") }), _jsx("p", { className: "text-base", children: formatValue(name) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldClassCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldDescription") }), _jsx("p", { className: "text-base", children: formatValue(description) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
20
- ? t("viewFieldStatusActive")
21
- : t("viewFieldStatusInactive") })] })] }) })] })] }));
20
+ ? t("badgeActive")
21
+ : t("badgeInactive") })] })] }) })] })] }));
22
22
  };
@@ -15,6 +15,7 @@ import { useTranslations } from "next-intl";
15
15
  import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
16
16
  import { API_METHODS } from "@react-pakistan/util-functions";
17
17
  import { getCachedWorkspaceSync } from "../workspace/cache";
18
+ import { getTranslatedError } from "../../utils/get-translated-error";
18
19
  export const CourseForm = () => {
19
20
  const workspace = getCachedWorkspaceSync();
20
21
  const t = useTranslations("course");
@@ -155,5 +156,5 @@ export const CourseForm = () => {
155
156
  },
156
157
  value: teacherId,
157
158
  });
158
- return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: errors.code, id: "code", info: t("formCourseCodeInfo"), label: t("formCourseCodeLabel"), onChange: (e) => handleChange("code", e.target.value), placeholder: t("formCourseCodePlaceholder"), required: true, value: code }), classIdCombo, sectionIdCombo, subjectIdCombo, teacherIdCombo, _jsx(EnhancedCheckbox, { label: t("formActiveCourseLabel"), defaultChecked: enabled, onCheckedChange: (checked) => handleChange("enabled", checked), info: t("actionToggleEnableOrDisableCourse") })] }));
159
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "code", t }), id: "code", info: t("formCourseCodeInfo"), label: t("formCourseCodeLabel"), onChange: (e) => handleChange("code", e.target.value), placeholder: t("formCourseCodePlaceholder"), required: true, value: code }), classIdCombo, sectionIdCombo, subjectIdCombo, teacherIdCombo, _jsx(EnhancedCheckbox, { label: t("formActiveCourseLabel"), defaultChecked: enabled, onCheckedChange: (checked) => handleChange("enabled", checked), info: t("formActiveCourseInfo") })] }));
159
160
  };
@@ -1,9 +1,11 @@
1
- /**
2
- * Course Validation Schema
3
- *
4
- * Zod validation schemas for course form data.
5
- */
6
1
  import { z } from "zod";
2
+ export declare const VALIDATION_KEYS: {
3
+ readonly classRequired: "validationCourseClassRequired";
4
+ readonly codeRequired: "validationCourseCodeRequired";
5
+ readonly sectionRequired: "validationCourseSectionRequired";
6
+ readonly subjectRequired: "validationCourseSubjectRequired";
7
+ readonly teacherRequired: "validationCourseTeacherRequired";
8
+ };
7
9
  export declare const courseFormValidation: z.ZodObject<{
8
10
  classId: z.ZodString;
9
11
  code: z.ZodString;
@@ -1,17 +1,16 @@
1
- /**
2
- * Course Validation Schema
3
- *
4
- * Zod validation schemas for course form data.
5
- */
6
1
  import { z } from "zod";
7
- // ============================================================================
8
- // VALIDATION SCHEMA
9
- // ============================================================================
2
+ export const VALIDATION_KEYS = {
3
+ classRequired: "validationCourseClassRequired",
4
+ codeRequired: "validationCourseCodeRequired",
5
+ sectionRequired: "validationCourseSectionRequired",
6
+ subjectRequired: "validationCourseSubjectRequired",
7
+ teacherRequired: "validationCourseTeacherRequired",
8
+ };
10
9
  export const courseFormValidation = z.object({
11
- classId: z.string().min(1, "Class is required"),
12
- code: z.string().min(1, "Course code is required"),
13
- sectionId: z.string().min(1, "Section is required"),
14
- subjectId: z.string().min(1, "Subject is required"),
15
- teacherId: z.string().min(1, "Teacher is required"),
10
+ classId: z.string().min(1, VALIDATION_KEYS.classRequired),
11
+ code: z.string().min(1, VALIDATION_KEYS.codeRequired),
12
+ sectionId: z.string().min(1, VALIDATION_KEYS.sectionRequired),
13
+ subjectId: z.string().min(1, VALIDATION_KEYS.subjectRequired),
14
+ teacherId: z.string().min(1, VALIDATION_KEYS.teacherRequired),
16
15
  enabled: z.boolean().optional(),
17
16
  });
@@ -40,7 +40,7 @@ export const CourseView = () => {
40
40
  teacher.teacherCode ||
41
41
  "—"
42
42
  : "—";
43
- return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(BookMarked, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: formatValue(code) }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [className, " \u2014 ", sectionName] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookMarked, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionCourseDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteCourseInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCourseCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("labelClass") }), _jsx("p", { className: "text-base", children: className })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formSectionLabel") }), _jsx("p", { className: "text-base", children: sectionName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubject") }), _jsx("p", { className: "text-base", children: subjectName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTeacher") }), _jsx("p", { className: "text-base", children: teacherName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
44
- ? t("viewFieldStatusActive")
45
- : t("viewFieldStatusInactive") })] })] }) })] })] }));
43
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(Card, { children: _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "flex items-center gap-6", children: [_jsx("div", { className: "bg-primary/10 flex h-24 w-24 items-center justify-center rounded-full", children: _jsx(BookMarked, { className: "text-primary h-12 w-12" }) }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("h2", { className: "text-2xl font-bold", children: formatValue(code) }), enabled ? (_jsx(CheckCircle2, { className: "h-5 w-5 text-green-500" })) : (_jsx(XCircle, { className: "h-5 w-5 text-red-500" }))] }), _jsxs("p", { className: "text-muted-foreground mt-1", children: [className, " \u2014 ", sectionName] })] })] }) }) }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BookMarked, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionCourseDetails") })] }), _jsx(CardDescription, { children: t("viewSectionCompleteCourseInformation") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldCourseCode") }), _jsx("p", { className: "text-base", children: formatValue(code) })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("tableColumnHeaderClass") }), _jsx("p", { className: "text-base", children: className })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formSectionLabel") }), _jsx("p", { className: "text-base", children: sectionName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubject") }), _jsx("p", { className: "text-base", children: subjectName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldTeacher") }), _jsx("p", { className: "text-base", children: teacherName })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled
44
+ ? t("badgeActive")
45
+ : t("badgeInactive") })] })] }) })] })] }));
46
46
  };
@@ -5,7 +5,7 @@
5
5
  * environment-driven (via `NEXT_PUBLIC_*`) where appropriate so CI/infra
6
6
  * can override them without code changes.
7
7
  */
8
- import { DISCOUNT_TYPE } from "../../types";
8
+ import { DISCOUNT_TYPE } from "../../type";
9
9
  /**
10
10
  * Default page limit for the discount codes list. Controlled by
11
11
  * `NEXT_PUBLIC_PAGE_LIMIT` with a safe fallback to `10`.
@@ -6,7 +6,7 @@
6
6
  * can override them without code changes.
7
7
  */
8
8
  "use client";
9
- import { DISCOUNT_TYPE } from "../../types";
9
+ import { DISCOUNT_TYPE } from "../../type";
10
10
  // ============================================================================
11
11
  // PAGE CONFIGURATION
12
12
  // ============================================================================
@@ -21,6 +21,7 @@ import { EnhancedCheckbox } from "@appcorp/shadcn/components/enhanced-checkbox";
21
21
  import { DISCOUNT_TYPE } from "../../type";
22
22
  import { DISCOUNT_TYPE_OPTIONS } from "./constants";
23
23
  import { DISCOUNT_CODE_API_ROUTES } from "../../constants";
24
+ import { getTranslatedError } from "../../utils/get-translated-error";
24
25
  export const DiscountCodeForm = () => {
25
26
  const { state, handleChange } = useDiscountCodeModule();
26
27
  const t = useTranslations("discountCode");
@@ -50,7 +51,7 @@ export const DiscountCodeForm = () => {
50
51
  },
51
52
  value: discountType,
52
53
  });
53
- return (_jsx("div", { className: "space-y-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.code, id: "code", info: t("formDiscountCodeInfo"), label: t("formDiscountCodeLabel"), onChange: (e) => handleChange("code", e.target.value.toUpperCase()), placeholder: t("formDiscountCodePlaceholder"), required: true, value: code }), _jsx(EnhancedTextarea, { error: errors.description, id: "description", info: t("formDescriptionInfo"), label: t("formDescriptionLabel"), onChange: (e) => handleChange("description", e.target.value), placeholder: t("formDescriptionPlaceholder"), rows: 3, value: description || "" }), discountTypeCombo, _jsx(EnhancedInput, { id: "discountValue", label: t("formDiscountValueLabel"), type: "number", value: (discountValue === null || discountValue === void 0 ? void 0 : discountValue.toString()) || "", onChange: (e) => handleChange("discountValue", parseFloat(e.target.value) || 0), error: errors.discountValue, placeholder: discountType === DISCOUNT_TYPE.PERCENTAGE
54
+ return (_jsx("div", { className: "space-y-6", children: _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "code", t }), id: "code", info: t("formDiscountCodeInfo"), label: t("formDiscountCodeLabel"), onChange: (e) => handleChange("code", e.target.value.toUpperCase()), placeholder: t("formDiscountCodePlaceholder"), required: true, value: code }), _jsx(EnhancedTextarea, { error: errors.description, id: "description", info: t("formDescriptionInfo"), label: t("formDescriptionLabel"), onChange: (e) => handleChange("description", e.target.value), placeholder: t("formDescriptionPlaceholder"), rows: 3, value: description || "" }), discountTypeCombo, _jsx(EnhancedInput, { id: "discountValue", label: t("formDiscountValueLabel"), type: "number", value: (discountValue === null || discountValue === void 0 ? void 0 : discountValue.toString()) || "", onChange: (e) => handleChange("discountValue", parseFloat(e.target.value) || 0), error: getTranslatedError({ errors, key: "discountValue", t }), placeholder: discountType === DISCOUNT_TYPE.PERCENTAGE
54
55
  ? t("formDiscountValuePlaceholderPercentage")
55
56
  : t("formDiscountValuePlaceholderFixed"), required: true, min: 0, max: discountType === DISCOUNT_TYPE.PERCENTAGE ? 100 : undefined, step: discountType === DISCOUNT_TYPE.PERCENTAGE ? 0.1 : 0.01, info: discountType === DISCOUNT_TYPE.PERCENTAGE
56
57
  ? t("formDiscountValueInfoPercentage")
@@ -9,5 +9,5 @@ import { useTranslations } from "next-intl";
9
9
  */
10
10
  export const DiscountCodeMoreActions = () => {
11
11
  const t = useTranslations("discountCode");
12
- return (_jsx("div", { className: "space-y-4", children: _jsx("div", { className: "text-sm text-muted-foreground", children: t("moreActionsTitle") }) }));
12
+ return (_jsx("div", { className: "space-y-4", children: _jsx("div", { className: "text-sm text-muted-foreground", children: t("moreActionsInfo") }) }));
13
13
  };
@@ -18,7 +18,8 @@
18
18
  import { FC } from "react";
19
19
  import { USER_ROLE } from "../../type";
20
20
  interface Props {
21
- cancelLabel: string;
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
- labelActions: string;
31
- labelCode: string;
32
- labelDescription: string;
33
- labelDiscountType: string;
34
- labelDiscountValue: string;
35
- labelEnabled: string;
36
- labelId: string;
37
- saveLabel: string;
38
- searchPlaceholder: string;
31
+ tableColumnHeaderActions: string;
32
+ tableColumnHeaderCode: string;
33
+ tableColumnHeaderDescription: string;
34
+ tableColumnHeaderDiscountType: string;
35
+ tableColumnHeaderDiscountValue: string;
36
+ tableColumnHeaderEnabled: string;
37
+ tableColumnHeaderId: string;
39
38
  tableDescription: string;
39
+ tableSearchPlaceholder: string;
40
40
  tableTitle: string;
41
41
  userRole: USER_ROLE;
42
42
  }
@@ -48,20 +48,20 @@ const createComponentInstances = () => ({
48
48
  moreActions: _jsx(DiscountCodeMoreActions, {}),
49
49
  view: _jsx(DiscountCodeView, {}),
50
50
  });
51
- const createDiscountCodeConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelCode, labelDescription, labelDiscountType, labelDiscountValue, labelEnabled, labelId, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
51
+ const createDiscountCodeConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderCode, tableColumnHeaderDescription, tableColumnHeaderDiscountType, tableColumnHeaderDiscountValue, tableColumnHeaderEnabled, tableColumnHeaderId, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
52
52
  const components = createComponentInstances();
53
53
  return {
54
54
  moduleName: "discountCode",
55
55
  tableColumns: [
56
- { label: labelId, width: "5%" },
57
- { label: labelCode, width: "15%" },
58
- { label: labelDescription, width: "25%" },
59
- { label: labelDiscountType, width: "15%" },
60
- { label: labelDiscountValue, width: "15%" },
61
- { label: labelEnabled, width: "15%" },
62
- { label: labelActions, width: "10%" },
56
+ { label: tableColumnHeaderId, width: "5%" },
57
+ { label: tableColumnHeaderCode, width: "15%" },
58
+ { label: tableColumnHeaderDescription, width: "25%" },
59
+ { label: tableColumnHeaderDiscountType, width: "15%" },
60
+ { label: tableColumnHeaderDiscountValue, width: "15%" },
61
+ { label: tableColumnHeaderEnabled, width: "15%" },
62
+ { label: tableColumnHeaderActions, width: "10%" },
63
63
  ],
64
- cancelLabel,
64
+ cancelLabel: drawerButtonCancel,
65
65
  drawerFilterDescription,
66
66
  drawerFilterTitle,
67
67
  drawerFormDescription,
@@ -73,8 +73,8 @@ const createDiscountCodeConfig = ({ cancelLabel, dispatch, drawerFilterDescripti
73
73
  filterContent: components.filter,
74
74
  formContent: components.form,
75
75
  moreActionsContent: components.moreActions,
76
- saveLabel,
77
- searchPlaceholder,
76
+ saveLabel: drawerButtonSave,
77
+ searchPlaceholder: tableSearchPlaceholder,
78
78
  tableDescription,
79
79
  tableTitle,
80
80
  viewContent: components.view,
@@ -95,7 +95,8 @@ const DiscountCodePageInner = (props) => {
95
95
  // Memoize config creation - destructure props to avoid object reference changes
96
96
  const discountCodeConfig = useMemo(() => createDiscountCodeConfig({
97
97
  dispatch: context.dispatch,
98
- cancelLabel: props.cancelLabel,
98
+ drawerButtonCancel: props.drawerButtonCancel,
99
+ drawerButtonSave: props.drawerButtonSave,
99
100
  drawerFormTitle: props.drawerFormTitle,
100
101
  drawerFormDescription: props.drawerFormDescription,
101
102
  drawerViewTitle: props.drawerViewTitle,
@@ -104,20 +105,20 @@ const DiscountCodePageInner = (props) => {
104
105
  drawerFilterDescription: props.drawerFilterDescription,
105
106
  drawerMoreActionsTitle: props.drawerMoreActionsTitle,
106
107
  drawerMoreActionsDescription: props.drawerMoreActionsDescription,
107
- labelActions: props.labelActions,
108
- labelCode: props.labelCode,
109
- labelDescription: props.labelDescription,
110
- labelDiscountType: props.labelDiscountType,
111
- labelDiscountValue: props.labelDiscountValue,
112
- labelEnabled: props.labelEnabled,
113
- labelId: props.labelId,
114
- saveLabel: props.saveLabel,
115
- searchPlaceholder: props.searchPlaceholder,
108
+ tableColumnHeaderActions: props.tableColumnHeaderActions,
109
+ tableColumnHeaderCode: props.tableColumnHeaderCode,
110
+ tableColumnHeaderDescription: props.tableColumnHeaderDescription,
111
+ tableColumnHeaderDiscountType: props.tableColumnHeaderDiscountType,
112
+ tableColumnHeaderDiscountValue: props.tableColumnHeaderDiscountValue,
113
+ tableColumnHeaderEnabled: props.tableColumnHeaderEnabled,
114
+ tableColumnHeaderId: props.tableColumnHeaderId,
116
115
  tableDescription: props.tableDescription,
116
+ tableSearchPlaceholder: props.tableSearchPlaceholder,
117
117
  tableTitle: props.tableTitle,
118
118
  }), [
119
119
  context.dispatch,
120
- props.cancelLabel,
120
+ props.drawerButtonCancel,
121
+ props.drawerButtonSave,
121
122
  props.drawerFormTitle,
122
123
  props.drawerFormDescription,
123
124
  props.drawerViewTitle,
@@ -126,16 +127,15 @@ const DiscountCodePageInner = (props) => {
126
127
  props.drawerFilterDescription,
127
128
  props.drawerMoreActionsTitle,
128
129
  props.drawerMoreActionsDescription,
129
- props.labelActions,
130
- props.labelCode,
131
- props.labelDescription,
132
- props.labelDiscountType,
133
- props.labelDiscountValue,
134
- props.labelEnabled,
135
- props.labelId,
136
- props.saveLabel,
137
- props.searchPlaceholder,
130
+ props.tableColumnHeaderActions,
131
+ props.tableColumnHeaderCode,
132
+ props.tableColumnHeaderDescription,
133
+ props.tableColumnHeaderDiscountType,
134
+ props.tableColumnHeaderDiscountValue,
135
+ props.tableColumnHeaderEnabled,
136
+ props.tableColumnHeaderId,
138
137
  props.tableDescription,
138
+ props.tableSearchPlaceholder,
139
139
  props.tableTitle,
140
140
  ]);
141
141
  const hasPermission = resolveRbacPermissions({
@@ -10,6 +10,11 @@
10
10
  */
11
11
  import { z } from "zod";
12
12
  import { DISCOUNT_TYPE } from "../../type";
13
+ export declare const VALIDATION_KEYS: {
14
+ readonly codeRequired: "validationDiscountCodeCodeRequired";
15
+ readonly codeMaxLength: "validationDiscountCodeCodeMaxLength";
16
+ readonly discountValueInvalid: "validationDiscountCodeValueInvalid";
17
+ };
13
18
  export declare const accountDiscountCodeFormValidation: z.ZodObject<{
14
19
  code: z.ZodString;
15
20
  description: z.ZodOptional<z.ZodString>;
@@ -13,12 +13,17 @@ import { DISCOUNT_TYPE } from "../../type";
13
13
  // ============================================================================
14
14
  // VALIDATION SCHEMA
15
15
  // ============================================================================
16
+ export const VALIDATION_KEYS = {
17
+ codeRequired: "validationDiscountCodeCodeRequired",
18
+ codeMaxLength: "validationDiscountCodeCodeMaxLength",
19
+ discountValueInvalid: "validationDiscountCodeValueInvalid",
20
+ };
16
21
  export const accountDiscountCodeFormValidation = z
17
22
  .object({
18
23
  code: z
19
24
  .string()
20
- .min(1, "Discount code is required")
21
- .max(50, "Code must be less than 50 characters"),
25
+ .min(1, VALIDATION_KEYS.codeRequired)
26
+ .max(50, VALIDATION_KEYS.codeMaxLength),
22
27
  description: z.string().optional(),
23
28
  discountType: z.nativeEnum(DISCOUNT_TYPE),
24
29
  discountValue: z.number(),
@@ -33,6 +38,6 @@ export const accountDiscountCodeFormValidation = z
33
38
  }
34
39
  return true;
35
40
  }, {
36
- message: "Invalid discount value for the selected discount type",
41
+ message: VALIDATION_KEYS.discountValueInvalid,
37
42
  path: ["discountValue"],
38
43
  });
@@ -21,6 +21,6 @@ export const DiscountCodeView = () => {
21
21
  const t = useTranslations("discountCode");
22
22
  const { code, description, discountType, enabled } = state;
23
23
  return (_jsx("div", { className: "space-y-6", children: _jsxs(Card, { children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "flex items-center gap-2", children: t("viewSectionDiscountCode") }), _jsx(CardDescription, { children: t("viewSectionDiscountCodeDescription") })] }), _jsxs(CardContent, { className: "space-y-4", children: [_jsxs("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [_jsxs("div", { children: [_jsx("label", { className: "text-sm font-medium text-gray-700", children: t("viewFieldDiscountCode") }), _jsx("p", { className: "mt-1 font-mono text-lg font-semibold", children: formatValue(code) })] }), _jsxs("div", { children: [_jsx("label", { className: "text-sm font-medium text-gray-700", children: t("viewFieldStatus") }), _jsx("div", { className: "mt-1", children: _jsx(Badge, { variant: enabled ? "default" : "secondary", children: enabled ? (_jsxs(_Fragment, { children: [_jsx(CheckCircle2, { className: "mr-1 h-3 w-3" }), t("badgeEnabled")] })) : (_jsxs(_Fragment, { children: [_jsx(XCircle, { className: "mr-1 h-3 w-3" }), t("badgeDisabled")] })) }) })] }), _jsxs("div", { children: [_jsx("label", { className: "text-sm font-medium text-gray-700", children: t("viewFieldDiscountType") }), _jsx("p", { className: "mt-1 font-medium text-gray-900", children: discountType === DISCOUNT_TYPE.PERCENTAGE
24
- ? t("formDiscountTypeOptionsPercentage")
25
- : t("formDiscountTypeOptionsFixed") })] }), _jsxs("div", { children: [_jsx("label", { className: "text-sm font-medium text-gray-700", children: t("viewFieldDiscountValue") }), _jsx("p", { className: "text-primary mt-1 text-xl font-semibold" })] })] }), _jsx(Separator, {}), _jsxs("div", { children: [_jsx("label", { className: "text-sm font-medium text-gray-700", children: t("viewFieldDescription") }), _jsx("p", { className: "mt-1 text-gray-900", children: formatValue(description) })] })] })] }) }));
24
+ ? t("formOptionPercentage")
25
+ : t("viewOptionDiscountTypeFixed") })] }), _jsxs("div", { children: [_jsx("label", { className: "text-sm font-medium text-gray-700", children: t("viewFieldDiscountValue") }), _jsx("p", { className: "text-primary mt-1 text-xl font-semibold" })] })] }), _jsx(Separator, {}), _jsxs("div", { children: [_jsx("label", { className: "text-sm font-medium text-gray-700", children: t("viewFieldDescription") }), _jsx("p", { className: "mt-1 text-gray-900", children: formatValue(description) })] })] })] }) }));
26
26
  };
@@ -19,6 +19,7 @@ import { CLASS_API_ROUTES, SECTION_API_ROUTES, STUDENT_PROFILE_API_ROUTES, } fro
19
19
  import { useTranslations } from "next-intl";
20
20
  import { useFetch } from "@react-pakistan/util-functions/hooks/use-fetch";
21
21
  import { useEffect } from "react";
22
+ import { getTranslatedError } from "../../utils/get-translated-error";
22
23
  import { getCachedWorkspaceSync } from "../workspace/cache";
23
24
  // ============================================================================
24
25
  // COMPONENT
@@ -120,7 +121,7 @@ export const EnrollmentForm = () => {
120
121
  },
121
122
  value: sectionId || "",
122
123
  });
123
- return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: errors.enrollmentDate, id: "enrollmentDate", info: t("formEnrollmentDateInfo"), label: t("formEnrollmentDateLabel"), onChange: (e) => handleChange("enrollmentDate", e.target.value), placeholder: t("formEnrollmentDatePlaceholder"), required: true, type: "date", value: enrollmentDate
124
+ return (_jsxs("div", { className: "space-y-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "enrollmentDate", t }), id: "enrollmentDate", info: t("formEnrollmentDateInfo"), label: t("formEnrollmentDateLabel"), onChange: (e) => handleChange("enrollmentDate", e.target.value), placeholder: t("formEnrollmentDatePlaceholder"), required: true, type: "date", value: enrollmentDate
124
125
  ? formatDate(enrollmentDate, DATE_FORMATS.YYYY_MM_DD)
125
- : "" }), _jsx(Separator, {}), studentProfileIdCombo, classIdCombo, sectionIdCombo, _jsx(EnhancedCheckbox, { checked: enabled, error: errors.enabled, id: "enabled", info: t("actionToggleEnableOrDisableEnrollment"), label: t("formActiveEnrollmentLabel"), onCheckedChange: (checked) => handleChange("enabled", checked) })] }));
126
+ : "" }), _jsx(Separator, {}), studentProfileIdCombo, classIdCombo, sectionIdCombo, _jsx(EnhancedCheckbox, { checked: enabled, id: "enabled", info: t("formActiveEnrollmentInfo"), label: t("formActiveEnrollmentLabel"), onCheckedChange: (checked) => handleChange("enabled", checked) })] }));
126
127
  };
@@ -119,17 +119,17 @@ export const EnrollmentMoreActions = () => {
119
119
  const msgs = [];
120
120
  if (method === "POST") {
121
121
  if (!((_b = row.studentProfileId) === null || _b === void 0 ? void 0 : _b.trim()))
122
- msgs.push(t("validationRequiredStudentProfileId"));
122
+ msgs.push(t("validationEnrollmentStudentProfileIdRequired"));
123
123
  if (!((_c = row.classId) === null || _c === void 0 ? void 0 : _c.trim()))
124
- msgs.push(t("validationRequiredClassId"));
124
+ msgs.push(t("validationEnrollmentClassIdRequired"));
125
125
  if (!((_d = row.sectionId) === null || _d === void 0 ? void 0 : _d.trim()))
126
- msgs.push(t("validationRequiredSectionId"));
126
+ msgs.push(t("validationEnrollmentSectionIdRequired"));
127
127
  if (!((_e = row.enrollmentDate) === null || _e === void 0 ? void 0 : _e.trim()))
128
- msgs.push(t("validationRequiredEnrollmentDate"));
128
+ msgs.push(t("validationEnrollmentEnrollmentDateRequired"));
129
129
  }
130
130
  else {
131
131
  if (!((_f = row.id) === null || _f === void 0 ? void 0 : _f.trim()))
132
- msgs.push(t("validationRequiredIdForUpdate"));
132
+ msgs.push(t("validationEnrollmentIdForUpdateRequired"));
133
133
  }
134
134
  if (msgs.length > 0) {
135
135
  validationErrors.push({ row: i + 1, messages: msgs });
@@ -14,7 +14,8 @@
14
14
  import { FC } from "react";
15
15
  import { USER_ROLE } from "../../type";
16
16
  interface Props {
17
- cancelLabel: string;
17
+ drawerButtonCancel: string;
18
+ drawerButtonSave: string;
18
19
  drawerFilterDescription: string;
19
20
  drawerFilterTitle: string;
20
21
  drawerFormDescription: string;
@@ -23,16 +24,15 @@ interface Props {
23
24
  drawerMoreActionsTitle: string;
24
25
  drawerViewDescription: string;
25
26
  drawerViewTitle: string;
26
- labelActions: string;
27
- labelClass: string;
28
- labelEnabled: string;
29
- labelEnrollmentDate: string;
30
- labelId: string;
31
- labelSection: string;
32
- labelStudent: string;
33
- saveLabel: string;
34
- searchPlaceholder: string;
27
+ tableColumnHeaderActions: string;
28
+ tableColumnHeaderClass: string;
29
+ tableColumnHeaderEnabled: string;
30
+ tableColumnHeaderEnrollmentDate: string;
31
+ tableColumnHeaderId: string;
32
+ tableColumnHeaderSection: string;
33
+ tableColumnHeaderStudent: string;
35
34
  tableDescription: string;
35
+ tableSearchPlaceholder: string;
36
36
  tableTitle: string;
37
37
  userRole: USER_ROLE;
38
38
  }
@@ -71,20 +71,20 @@ const createComponentInstances = () => ({
71
71
  moreActions: _jsx(EnrollmentMoreActions, {}),
72
72
  view: _jsx(EnrollmentView, {}),
73
73
  });
74
- const createEnrollmentConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelClass, labelEnabled, labelEnrollmentDate, labelId, labelSection, labelStudent, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
74
+ const createEnrollmentConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderClass, tableColumnHeaderEnabled, tableColumnHeaderEnrollmentDate, tableColumnHeaderId, tableColumnHeaderSection, tableColumnHeaderStudent, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
75
75
  const components = createComponentInstances();
76
76
  return {
77
77
  moduleName: "enrollment",
78
78
  tableColumns: [
79
- { label: labelId, width: "5%" },
80
- { label: labelStudent, width: "20%" },
81
- { label: labelClass, width: "15%" },
82
- { label: labelSection, width: "20%" },
83
- { label: labelEnrollmentDate, width: "20%" },
84
- { label: labelEnabled, width: "10%" },
85
- { label: labelActions, width: "5%" },
79
+ { label: tableColumnHeaderId, width: "5%" },
80
+ { label: tableColumnHeaderStudent, width: "20%" },
81
+ { label: tableColumnHeaderClass, width: "15%" },
82
+ { label: tableColumnHeaderSection, width: "20%" },
83
+ { label: tableColumnHeaderEnrollmentDate, 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 createEnrollmentConfig = ({ cancelLabel, dispatch, drawerFilterDescription
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 EnrollmentPageInner = (props) => {
114
114
  const context = useEnrollmentModule();
115
115
  const enrollmentConfig = useMemo(() => createEnrollmentConfig({
116
116
  dispatch: context.dispatch,
117
- cancelLabel: props.cancelLabel,
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 EnrollmentPageInner = (props) => {
123
124
  drawerFilterDescription: props.drawerFilterDescription,
124
125
  drawerMoreActionsTitle: props.drawerMoreActionsTitle,
125
126
  drawerMoreActionsDescription: props.drawerMoreActionsDescription,
126
- labelActions: props.labelActions,
127
- labelClass: props.labelClass,
128
- labelEnabled: props.labelEnabled,
129
- labelEnrollmentDate: props.labelEnrollmentDate,
130
- labelId: props.labelId,
131
- labelSection: props.labelSection,
132
- labelStudent: props.labelStudent,
133
- saveLabel: props.saveLabel,
134
- searchPlaceholder: props.searchPlaceholder,
127
+ tableColumnHeaderActions: props.tableColumnHeaderActions,
128
+ tableColumnHeaderClass: props.tableColumnHeaderClass,
129
+ tableColumnHeaderEnabled: props.tableColumnHeaderEnabled,
130
+ tableColumnHeaderEnrollmentDate: props.tableColumnHeaderEnrollmentDate,
131
+ tableColumnHeaderId: props.tableColumnHeaderId,
132
+ tableColumnHeaderSection: props.tableColumnHeaderSection,
133
+ tableColumnHeaderStudent: props.tableColumnHeaderStudent,
135
134
  tableDescription: props.tableDescription,
135
+ tableSearchPlaceholder: props.tableSearchPlaceholder,
136
136
  tableTitle: props.tableTitle,
137
137
  }), [
138
138
  context.dispatch,
139
- props.cancelLabel,
139
+ props.drawerButtonCancel,
140
+ props.drawerButtonSave,
140
141
  props.drawerFormTitle,
141
142
  props.drawerFormDescription,
142
143
  props.drawerViewTitle,
@@ -145,16 +146,15 @@ const EnrollmentPageInner = (props) => {
145
146
  props.drawerFilterDescription,
146
147
  props.drawerMoreActionsTitle,
147
148
  props.drawerMoreActionsDescription,
148
- props.labelActions,
149
- props.labelClass,
150
- props.labelEnabled,
151
- props.labelEnrollmentDate,
152
- props.labelId,
153
- props.labelSection,
154
- props.labelStudent,
155
- props.saveLabel,
156
- props.searchPlaceholder,
149
+ props.tableColumnHeaderActions,
150
+ props.tableColumnHeaderClass,
151
+ props.tableColumnHeaderEnabled,
152
+ props.tableColumnHeaderEnrollmentDate,
153
+ props.tableColumnHeaderId,
154
+ props.tableColumnHeaderSection,
155
+ props.tableColumnHeaderStudent,
157
156
  props.tableDescription,
157
+ props.tableSearchPlaceholder,
158
158
  props.tableTitle,
159
159
  ]);
160
160
  const hasPermission = resolveRbacPermissions({