@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
@@ -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.88",
3
+ "version": "0.2.89",
4
4
  "scripts": {
5
5
  "build-storybook": "storybook build",
6
6
  "build:next": "next build",