@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.
Files changed (147) 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/more-actions.js +11 -10
  88. package/base-modules/student-fee/page.d.ts +13 -13
  89. package/base-modules/student-fee/page.js +40 -40
  90. package/base-modules/student-fee/validate.d.ts +11 -3
  91. package/base-modules/student-fee/validate.js +20 -12
  92. package/base-modules/student-fee/view.js +4 -4
  93. package/base-modules/student-profile/context/use-student-profile-module.js +2 -2
  94. package/base-modules/student-profile/filter.js +2 -2
  95. package/base-modules/student-profile/form.js +6 -5
  96. package/base-modules/student-profile/page.d.ts +10 -10
  97. package/base-modules/student-profile/page.js +31 -31
  98. package/base-modules/student-profile/validate.d.ts +8 -2
  99. package/base-modules/student-profile/validate.js +13 -10
  100. package/base-modules/student-profile/view.js +2 -2
  101. package/base-modules/subject/filter.js +1 -1
  102. package/base-modules/subject/form.js +2 -1
  103. package/base-modules/subject/more-actions.js +3 -3
  104. package/base-modules/subject/page.d.ts +9 -9
  105. package/base-modules/subject/page.js +28 -28
  106. package/base-modules/subject/validate.d.ts +12 -1
  107. package/base-modules/subject/validate.js +24 -10
  108. package/base-modules/subject/view.js +3 -3
  109. package/base-modules/teacher/context.js +3 -3
  110. package/base-modules/teacher/filter.js +1 -1
  111. package/base-modules/teacher/form.js +9 -32
  112. package/base-modules/teacher/more-actions.js +2 -2
  113. package/base-modules/teacher/page.d.ts +10 -10
  114. package/base-modules/teacher/page.js +31 -31
  115. package/base-modules/teacher/validate.d.ts +5 -1
  116. package/base-modules/teacher/validate.js +10 -25
  117. package/base-modules/teacher/view.js +3 -3
  118. package/base-modules/user/filter.js +1 -1
  119. package/base-modules/user/form.js +3 -2
  120. package/base-modules/user/page.d.ts +9 -9
  121. package/base-modules/user/page.js +28 -28
  122. package/base-modules/user/validate.d.ts +8 -1
  123. package/base-modules/user/validate.js +16 -6
  124. package/base-modules/user/view.js +1 -1
  125. package/base-modules/workspace/context.js +3 -3
  126. package/base-modules/workspace/drawer.js +1 -1
  127. package/base-modules/workspace/filter.js +1 -1
  128. package/base-modules/workspace/form.js +2 -1
  129. package/base-modules/workspace/more-actions.js +1 -1
  130. package/base-modules/workspace/page.d.ts +1 -1
  131. package/base-modules/workspace/page.js +2 -2
  132. package/base-modules/workspace/validate.d.ts +4 -0
  133. package/base-modules/workspace/validate.js +6 -2
  134. package/base-modules/workspace/view.js +2 -2
  135. package/base-modules/workspace-user/context.js +6 -6
  136. package/base-modules/workspace-user/form.js +2 -1
  137. package/base-modules/workspace-user/page.d.ts +9 -9
  138. package/base-modules/workspace-user/page.js +28 -28
  139. package/base-modules/workspace-user/validate.d.ts +4 -5
  140. package/base-modules/workspace-user/validate.js +6 -10
  141. package/base-modules/workspace-user/view.js +1 -1
  142. package/constants.d.ts +5 -1
  143. package/constants.js +2 -0
  144. package/package.json +1 -1
  145. package/tsconfig.build.tsbuildinfo +1 -1
  146. package/utils/get-translated-error.d.ts +5 -0
  147. package/utils/get-translated-error.js +5 -0
@@ -1,8 +1,12 @@
1
1
  import { z } from "zod";
2
+ export const VALIDATION_KEYS = {
3
+ name: "validationWorkspaceNameRequired",
4
+ subdomain: "validationWorkspaceSubdomainRequired",
5
+ };
2
6
  export const workspaceFormValidation = z.object({
3
7
  id: z.string().optional(),
4
- name: z.string().min(1, "Name is required"),
5
- subdomain: z.string().min(1, "Subdomain is required"),
8
+ name: z.string().min(1, VALIDATION_KEYS.name),
9
+ subdomain: z.string().min(1, VALIDATION_KEYS.subdomain),
6
10
  planId: z.string().optional(),
7
11
  enabled: z.boolean().optional(),
8
12
  });
@@ -40,9 +40,9 @@ export const WorkspaceView = () => {
40
40
  return `${mb} MB`;
41
41
  return `${(mb / 1024).toFixed(1)} GB`;
42
42
  };
43
- return (_jsxs("div", { className: "space-y-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionBasicInfo") })] }), _jsx(CardDescription, { children: t("viewBasicInfoDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-2 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldName") })] }), _jsx("p", { className: "text-base", children: formatValue(state.name) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldSubdomain") })] }), _jsx("p", { className: "text-base", children: formatValue(state.subdomain) }), state.subdomain && (_jsxs("p", { className: "text-muted-foreground text-sm", children: [t("viewFieldUrlPrefix"), state.subdomain, ".edupilotpro.com"] }))] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldDescription") })] }), _jsx("p", { className: "text-base", children: formatValue(state.description) === "—"
43
+ return (_jsxs("div", { className: "space-y-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "pb-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionBasicInfo") })] }), _jsx(CardDescription, { children: t("viewBasicInfoDescription") })] }), _jsx(Separator, {}), _jsx(CardContent, { className: "pt-6", children: _jsxs("div", { className: "grid grid-cols-2 gap-6 md:grid-cols-2", children: [_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formNameLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(state.name) })] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Globe, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formSubdomainLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(state.subdomain) }), state.subdomain && (_jsxs("p", { className: "text-muted-foreground text-sm", children: [t("viewFieldUrlPrefix"), state.subdomain, ".edupilotpro.com"] }))] }), _jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(FileText, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formDescriptionLabel") })] }), _jsx("p", { className: "text-base", children: formatValue(state.description) === "—"
44
44
  ? t("viewTextDescriptionNotProvided")
45
- : state.description })] }), state.logo && (_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LucideImage, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldLogo") })] }), _jsx("div", { className: "mt-2", children: _jsx(Image, { src: state.logo, alt: t("viewFieldLogoAlt"), width: 64, height: 64, className: "h-16 w-16 rounded border object-contain", onError: (e) => {
45
+ : state.description })] }), state.logo && (_jsxs("div", { className: "space-y-1 md:col-span-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(LucideImage, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("formLogoLabel") })] }), _jsx("div", { className: "mt-2", children: _jsx(Image, { src: state.logo, alt: t("viewFieldLogoAlt"), width: 64, height: 64, className: "h-16 w-16 rounded border object-contain", onError: (e) => {
46
46
  e.currentTarget.style.display = "none";
47
47
  } }) })] })), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsxs(Badge, { variant: state.enabled ? "default" : "destructive", className: "gap-1", children: [state.enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), state.enabled
48
48
  ? t("viewStatusEnabled")
@@ -166,7 +166,7 @@ export const useWorkspaceUserModule = () => {
166
166
  const listCallback = useCallback(({ data, error }) => {
167
167
  var _a, _b;
168
168
  if (error) {
169
- showToast(t("messagesFetchFailed"), TOAST_VARIANT.ERROR);
169
+ showToast(t("messagesWorkspaceUserFetchFailed"), TOAST_VARIANT.ERROR);
170
170
  return;
171
171
  }
172
172
  if (data) {
@@ -183,18 +183,18 @@ export const useWorkspaceUserModule = () => {
183
183
  var _a;
184
184
  const isCreated = isCreatedOrUpdated(data);
185
185
  if (error) {
186
- showToast(isCreated ? t("messagesCreateFailed") : t("messagesUpdateFailed"), TOAST_VARIANT.ERROR);
186
+ showToast(isCreated ? t("messagesWorkspaceUserCreateFailed") : t("messagesWorkspaceUserUpdateFailed"), TOAST_VARIANT.ERROR);
187
187
  return;
188
188
  }
189
189
  if (data) {
190
- showToast(t("messagesSaveSuccess"), TOAST_VARIANT.SUCCESS);
190
+ showToast(t("messagesWorkspaceUserSaved"), TOAST_VARIANT.SUCCESS);
191
191
  (_a = listFetchNowRef.current) === null || _a === void 0 ? void 0 : _a.call(listFetchNowRef);
192
192
  resetFormAndCloseDrawer();
193
193
  }
194
194
  }, [resetFormAndCloseDrawer, showToast, t]);
195
195
  const byIdCallback = useCallback(({ data, error }) => {
196
196
  if (error) {
197
- showToast(t("messagesDetailsFetchFailed"), TOAST_VARIANT.ERROR);
197
+ showToast(t("messagesWorkspaceUserDetailsFetchFailed"), TOAST_VARIANT.ERROR);
198
198
  return;
199
199
  }
200
200
  if (data) {
@@ -207,11 +207,11 @@ export const useWorkspaceUserModule = () => {
207
207
  const deleteCallback = useCallback(({ data, error }) => {
208
208
  var _a;
209
209
  if (error) {
210
- showToast(t("messagesDeleteFailed"), TOAST_VARIANT.ERROR);
210
+ showToast(t("messagesWorkspaceUserDeleteFailed"), TOAST_VARIANT.ERROR);
211
211
  return;
212
212
  }
213
213
  if (data) {
214
- showToast(t("messagesDeleteSuccess"), TOAST_VARIANT.SUCCESS);
214
+ showToast(t("messagesWorkspaceUserDeleted"), TOAST_VARIANT.SUCCESS);
215
215
  (_a = listFetchNowRef.current) === null || _a === void 0 ? void 0 : _a.call(listFetchNowRef);
216
216
  }
217
217
  }, [showToast, t]);
@@ -4,9 +4,10 @@ import { EnhancedInput } from "@appcorp/shadcn/components/enhanced-input";
4
4
  import { EnhancedCheckbox } from "@appcorp/shadcn/components/enhanced-checkbox";
5
5
  import { useWorkspaceUserModule } from "./context";
6
6
  import { useTranslations } from "next-intl";
7
+ import { getTranslatedError } from "@/utils/get-translated-error";
7
8
  export const WorkspaceUserForm = () => {
8
9
  const { state, handleChange } = useWorkspaceUserModule();
9
10
  const { enabled, errors, roleId, userId, workspaceId } = state;
10
11
  const t = useTranslations("workspaceUser");
11
- return (_jsx("div", { className: "space-y-4", children: _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionWorkspaceUserInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: errors.workspaceId, id: "workspaceId", info: t("formTheWorkspaceIdPlaceholder"), label: t("formWorkspaceIdLabel"), onChange: (e) => handleChange("workspaceId", e.target.value), placeholder: t("formWorkspaceIdPlaceholder"), required: true, value: workspaceId }), _jsx(EnhancedInput, { error: errors.userId, id: "userId", info: t("formTheUserIdPlaceholder"), label: t("formUserIdLabel"), onChange: (e) => handleChange("userId", e.target.value), placeholder: t("formUserIdPlaceholder"), required: true, value: userId }), _jsx(EnhancedInput, { error: errors.roleId, id: "roleId", info: t("formTheRoleIdPlaceholder"), label: t("formRoleIdLabel"), onChange: (e) => handleChange("roleId", e.target.value), placeholder: t("formRoleIdPlaceholder"), value: roleId || "" })] }), _jsx(EnhancedCheckbox, { defaultChecked: enabled, label: t("badgeActive"), onCheckedChange: (checked) => handleChange("enabled", checked) })] }) }));
12
+ return (_jsx("div", { className: "space-y-4", children: _jsxs("div", { className: "space-y-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: t("formSectionWorkspaceUserInformation") }), _jsxs("div", { className: "grid grid-cols-1 gap-4", children: [_jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "workspaceId", t }), id: "workspaceId", info: t("formWorkspaceIdInfo"), label: t("formWorkspaceIdLabel"), onChange: (e) => handleChange("workspaceId", e.target.value), placeholder: t("formWorkspaceIdPlaceholder"), required: true, value: workspaceId }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "userId", t }), id: "userId", info: t("formUserIdInfo"), label: t("formUserIdLabel"), onChange: (e) => handleChange("userId", e.target.value), placeholder: t("formUserIdPlaceholder"), required: true, value: userId }), _jsx(EnhancedInput, { error: getTranslatedError({ errors, key: "roleId", t }), id: "roleId", info: t("formRoleIdInfo"), label: t("formRoleIdLabel"), onChange: (e) => handleChange("roleId", e.target.value), placeholder: t("formRoleIdPlaceholder"), value: roleId || "" })] }), _jsx(EnhancedCheckbox, { defaultChecked: enabled, label: t("badgeActive"), onCheckedChange: (checked) => handleChange("enabled", checked) })] }) }));
12
13
  };
@@ -10,7 +10,8 @@
10
10
  import { FC } from "react";
11
11
  import { USER_ROLE } from "../../type";
12
12
  interface Props {
13
- cancelLabel: string;
13
+ drawerButtonCancel: string;
14
+ drawerButtonSave: string;
14
15
  drawerFilterDescription: string;
15
16
  drawerFilterTitle: string;
16
17
  drawerFormDescription: string;
@@ -19,15 +20,14 @@ interface Props {
19
20
  drawerMoreActionsTitle: string;
20
21
  drawerViewDescription: string;
21
22
  drawerViewTitle: string;
22
- labelActions: string;
23
- labelId: string;
24
- labelRole: string;
25
- labelSystemRole: string;
26
- labelUser: string;
27
- labelWorkspace: string;
28
- saveLabel: string;
29
- searchPlaceholder: string;
23
+ tableColumnHeaderActions: string;
24
+ tableColumnHeaderId: string;
25
+ tableColumnHeaderRole: string;
26
+ tableColumnHeaderSystemRole: string;
27
+ tableColumnHeaderUser: string;
28
+ tableColumnHeaderWorkspace: string;
30
29
  tableDescription: string;
30
+ tableSearchPlaceholder: string;
31
31
  tableTitle: string;
32
32
  userRole: USER_ROLE;
33
33
  }
@@ -39,19 +39,19 @@ const createComponentInstances = () => ({
39
39
  moreActions: _jsx(WorkspaceUserMoreActions, {}),
40
40
  view: _jsx(WorkspaceUserView, {}),
41
41
  });
42
- const createWorkspaceUserConfig = ({ cancelLabel, dispatch, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, labelActions, labelId, labelRole, labelSystemRole, labelUser, labelWorkspace, saveLabel, searchPlaceholder, tableDescription, tableTitle, }) => {
42
+ const createWorkspaceUserConfig = ({ dispatch, drawerButtonCancel, drawerButtonSave, drawerFilterDescription, drawerFilterTitle, drawerFormDescription, drawerFormTitle, drawerMoreActionsDescription, drawerMoreActionsTitle, drawerViewDescription, drawerViewTitle, tableColumnHeaderActions, tableColumnHeaderId, tableColumnHeaderRole, tableColumnHeaderSystemRole, tableColumnHeaderUser, tableColumnHeaderWorkspace, tableDescription, tableSearchPlaceholder, tableTitle, }) => {
43
43
  const components = createComponentInstances();
44
44
  return {
45
45
  moduleName: "workspaceUser",
46
46
  tableColumns: [
47
- { label: labelId, width: "5%" },
48
- { label: labelUser, width: "30%" },
49
- { label: labelWorkspace, width: "25%" },
50
- { label: labelRole, width: "20%" },
51
- { label: labelSystemRole, width: "15%" },
52
- { label: labelActions, width: "5%" },
47
+ { label: tableColumnHeaderId, width: "5%" },
48
+ { label: tableColumnHeaderUser, width: "30%" },
49
+ { label: tableColumnHeaderWorkspace, width: "25%" },
50
+ { label: tableColumnHeaderRole, width: "20%" },
51
+ { label: tableColumnHeaderSystemRole, width: "15%" },
52
+ { label: tableColumnHeaderActions, width: "5%" },
53
53
  ],
54
- cancelLabel,
54
+ cancelLabel: drawerButtonCancel,
55
55
  drawerFilterDescription,
56
56
  drawerFilterTitle,
57
57
  drawerFormDescription,
@@ -63,8 +63,8 @@ const createWorkspaceUserConfig = ({ cancelLabel, dispatch, drawerFilterDescript
63
63
  filterContent: components.filter,
64
64
  formContent: components.form,
65
65
  moreActionsContent: components.moreActions,
66
- saveLabel,
67
- searchPlaceholder,
66
+ saveLabel: drawerButtonSave,
67
+ searchPlaceholder: tableSearchPlaceholder,
68
68
  tableDescription,
69
69
  tableTitle,
70
70
  viewContent: components.view,
@@ -83,8 +83,9 @@ const GenericWorkspaceUserPage = createGenericModulePage();
83
83
  const WorkspaceUserPageInner = (props) => {
84
84
  const context = useWorkspaceUserModule();
85
85
  const workspaceUserConfig = useMemo(() => createWorkspaceUserConfig({
86
- cancelLabel: props.cancelLabel,
87
86
  dispatch: context.dispatch,
87
+ drawerButtonCancel: props.drawerButtonCancel,
88
+ drawerButtonSave: props.drawerButtonSave,
88
89
  drawerFormTitle: props.drawerFormTitle,
89
90
  drawerFormDescription: props.drawerFormDescription,
90
91
  drawerViewTitle: props.drawerViewTitle,
@@ -93,19 +94,19 @@ const WorkspaceUserPageInner = (props) => {
93
94
  drawerFilterDescription: props.drawerFilterDescription,
94
95
  drawerMoreActionsTitle: props.drawerMoreActionsTitle,
95
96
  drawerMoreActionsDescription: props.drawerMoreActionsDescription,
96
- labelActions: props.labelActions,
97
- labelId: props.labelId,
98
- labelRole: props.labelRole,
99
- labelSystemRole: props.labelSystemRole,
100
- labelUser: props.labelUser,
101
- labelWorkspace: props.labelWorkspace,
102
- saveLabel: props.saveLabel,
103
- searchPlaceholder: props.searchPlaceholder,
97
+ tableColumnHeaderActions: props.tableColumnHeaderActions,
98
+ tableColumnHeaderId: props.tableColumnHeaderId,
99
+ tableColumnHeaderRole: props.tableColumnHeaderRole,
100
+ tableColumnHeaderSystemRole: props.tableColumnHeaderSystemRole,
101
+ tableColumnHeaderUser: props.tableColumnHeaderUser,
102
+ tableColumnHeaderWorkspace: props.tableColumnHeaderWorkspace,
104
103
  tableDescription: props.tableDescription,
104
+ tableSearchPlaceholder: props.tableSearchPlaceholder,
105
105
  tableTitle: props.tableTitle,
106
106
  }), [
107
107
  context.dispatch,
108
- props.cancelLabel,
108
+ props.drawerButtonCancel,
109
+ props.drawerButtonSave,
109
110
  props.drawerFormTitle,
110
111
  props.drawerFormDescription,
111
112
  props.drawerViewTitle,
@@ -114,15 +115,14 @@ const WorkspaceUserPageInner = (props) => {
114
115
  props.drawerFilterDescription,
115
116
  props.drawerMoreActionsTitle,
116
117
  props.drawerMoreActionsDescription,
117
- props.labelActions,
118
- props.labelId,
119
- props.labelRole,
120
- props.labelSystemRole,
121
- props.labelUser,
122
- props.labelWorkspace,
123
- props.saveLabel,
124
- props.searchPlaceholder,
118
+ props.tableColumnHeaderActions,
119
+ props.tableColumnHeaderId,
120
+ props.tableColumnHeaderRole,
121
+ props.tableColumnHeaderSystemRole,
122
+ props.tableColumnHeaderUser,
123
+ props.tableColumnHeaderWorkspace,
125
124
  props.tableDescription,
125
+ props.tableSearchPlaceholder,
126
126
  props.tableTitle,
127
127
  ]);
128
128
  const hasPermission = resolveRbacPermissions({
@@ -1,9 +1,8 @@
1
- /**
2
- * WorkspaceUser Validation Schema
3
- *
4
- * Zod validation schemas for workspace-user form data.
5
- */
6
1
  import { z } from "zod";
2
+ export declare const VALIDATION_KEYS: {
3
+ readonly workspaceId: "validationWorkspaceUserWorkspaceIdRequired";
4
+ readonly userId: "validationWorkspaceUserUserIdRequired";
5
+ };
7
6
  export declare const workspaceUserFormValidation: z.ZodObject<{
8
7
  workspaceId: z.ZodString;
9
8
  userId: z.ZodString;
@@ -1,15 +1,11 @@
1
- /**
2
- * WorkspaceUser Validation Schema
3
- *
4
- * Zod validation schemas for workspace-user form data.
5
- */
6
1
  import { z } from "zod";
7
- // ============================================================================
8
- // VALIDATION SCHEMA
9
- // ============================================================================
2
+ export const VALIDATION_KEYS = {
3
+ workspaceId: "validationWorkspaceUserWorkspaceIdRequired",
4
+ userId: "validationWorkspaceUserUserIdRequired",
5
+ };
10
6
  export const workspaceUserFormValidation = z.object({
11
- workspaceId: z.string().min(1, "workspaceIsRequired"),
12
- userId: z.string().min(1, "userIsRequired"),
7
+ workspaceId: z.string().min(1, VALIDATION_KEYS.workspaceId),
8
+ userId: z.string().min(1, VALIDATION_KEYS.userId),
13
9
  roleId: z.string().nullable().optional(),
14
10
  enabled: z.boolean().optional(),
15
11
  });
@@ -16,5 +16,5 @@ export const WorkspaceUserView = () => {
16
16
  const { state } = useWorkspaceUserModule();
17
17
  const { enabled, role, workspace, workspaceId } = state;
18
18
  const t = useTranslations("workspaceUser");
19
- 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(Users, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionWorkspaceUserInformation") })] }), _jsx(CardDescription, { children: t("viewSectionWorkspaceUserAssignmentDetails") })] }), _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: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldWorkspace") })] }), _jsx("p", { className: "text-base", children: formatValue((workspace === null || workspace === void 0 ? void 0 : workspace.name) || workspaceId) }), (workspace === null || workspace === void 0 ? void 0 : workspace.subdomain) && (_jsxs("p", { className: "text-muted-foreground text-sm", children: [t("viewFieldSubdomain"), workspace.subdomain] }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Shield, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRole") })] }), _jsx(Badge, { variant: "secondary", className: "gap-1", children: (role === null || role === void 0 ? void 0 : role.userRole) || t("viewFieldNoRoleAssigned") })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsxs(Badge, { variant: enabled ? "default" : "destructive", className: "gap-1", children: [enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), enabled ? t("badgeActive") : t("badgeInactive")] })] })] }) })] }) }));
19
+ 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(Users, { className: "text-primary h-5 w-5" }), _jsx(CardTitle, { className: "text-lg", children: t("viewSectionWorkspaceUserInformation") })] }), _jsx(CardDescription, { children: t("viewWorkspaceUserAssignmentDescription") })] }), _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: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Building2, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldWorkspace") })] }), _jsx("p", { className: "text-base", children: formatValue((workspace === null || workspace === void 0 ? void 0 : workspace.name) || workspaceId) }), (workspace === null || workspace === void 0 ? void 0 : workspace.subdomain) && (_jsxs("p", { className: "text-muted-foreground text-sm", children: [t("viewFieldSubdomain"), workspace.subdomain] }))] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Shield, { className: "text-muted-foreground h-4 w-4" }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldRole") })] }), _jsx(Badge, { variant: "secondary", className: "gap-1", children: (role === null || role === void 0 ? void 0 : role.userRole) || t("viewFieldNoRoleAssigned") })] }), _jsxs("div", { className: "space-y-1", children: [_jsx("p", { className: "text-muted-foreground text-sm font-medium", children: t("viewFieldStatus") }), _jsxs(Badge, { variant: enabled ? "default" : "destructive", className: "gap-1", children: [enabled ? (_jsx(CheckCircle2, { className: "h-3 w-3" })) : (_jsx(XCircle, { className: "h-3 w-3" })), enabled ? t("badgeActive") : t("badgeInactive")] })] })] }) })] }) }));
20
20
  };
package/constants.d.ts CHANGED
@@ -13,7 +13,11 @@ export declare const ATTENDANCE_API_ROUTES: {
13
13
  readonly BULK: "/api/v1/attendance/bulk";
14
14
  readonly BULK_STATUS: (jobId: string) => string;
15
15
  };
16
- export declare const ADMISSION_API_ROUTES: Record<string, string>;
16
+ export declare const ADMISSION_API_ROUTES: {
17
+ readonly UNIT: "/api/v1/admission";
18
+ readonly BULK: "/api/v1/admission/bulk";
19
+ readonly BULK_STATUS: (jobId: string) => string;
20
+ };
17
21
  export declare const CAMPUS_API_ROUTES: Record<string, string>;
18
22
  export declare const CLASS_API_ROUTES: {
19
23
  readonly UNIT: "/api/v1/class";
package/constants.js CHANGED
@@ -18,6 +18,8 @@ export const ATTENDANCE_API_ROUTES = {
18
18
  };
19
19
  export const ADMISSION_API_ROUTES = {
20
20
  UNIT: "/api/v1/admission",
21
+ BULK: "/api/v1/admission/bulk",
22
+ BULK_STATUS: (jobId) => `/api/v1/admission/bulk/${jobId}`,
21
23
  };
22
24
  export const CAMPUS_API_ROUTES = {
23
25
  UNIT: "/api/v1/campus",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/fusion-storybook",
3
- "version": "0.2.86",
3
+ "version": "0.2.89",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",