@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.
- package/base-modules/admission/filter.js +3 -3
- package/base-modules/admission/form.js +1 -1
- package/base-modules/admission/more-actions.js +288 -2
- package/base-modules/admission/view.js +1 -1
- package/base-modules/attendance/form.js +3 -3
- package/base-modules/campus/form.js +2 -1
- package/base-modules/campus/validate.d.ts +13 -5
- package/base-modules/campus/validate.js +24 -19
- package/base-modules/class/form.js +2 -1
- package/base-modules/class/more-actions.js +2 -2
- package/base-modules/class/validate.d.ts +10 -5
- package/base-modules/class/validate.js +18 -16
- package/base-modules/class/view.js +2 -2
- package/base-modules/course/form.js +2 -1
- package/base-modules/course/validate.d.ts +7 -5
- package/base-modules/course/validate.js +12 -13
- package/base-modules/course/view.js +3 -3
- package/base-modules/discount-code/constants.d.ts +1 -1
- package/base-modules/discount-code/constants.js +1 -1
- package/base-modules/discount-code/form.js +2 -1
- package/base-modules/discount-code/more-actions.js +1 -1
- package/base-modules/discount-code/page.d.ts +10 -10
- package/base-modules/discount-code/page.js +31 -31
- package/base-modules/discount-code/validate.d.ts +5 -0
- package/base-modules/discount-code/validate.js +8 -3
- package/base-modules/discount-code/view.js +2 -2
- package/base-modules/enrollment/form.js +3 -2
- package/base-modules/enrollment/more-actions.js +5 -5
- package/base-modules/enrollment/page.d.ts +10 -10
- package/base-modules/enrollment/page.js +31 -31
- package/base-modules/enrollment/validate.d.ts +6 -0
- package/base-modules/enrollment/validate.js +13 -5
- package/base-modules/enrollment/view.js +2 -2
- package/base-modules/expense/filter.js +1 -1
- package/base-modules/expense/form.js +3 -3
- package/base-modules/expense/more-actions.js +6 -6
- package/base-modules/expense/page.d.ts +11 -11
- package/base-modules/expense/page.js +34 -34
- package/base-modules/expense/validate.d.ts +8 -0
- package/base-modules/expense/validate.js +13 -5
- package/base-modules/expense/view.js +2 -2
- package/base-modules/family/context.js +1 -1
- package/base-modules/family/form.js +1 -1
- package/base-modules/family/more-actions.js +2 -2
- package/base-modules/family/page.d.ts +10 -10
- package/base-modules/family/page.js +31 -31
- package/base-modules/family/validate.d.ts +4 -0
- package/base-modules/family/validate.js +8 -1
- package/base-modules/family/view.js +1 -1
- package/base-modules/family-member/context.js +1 -1
- package/base-modules/family-member/form.js +2 -1
- package/base-modules/family-member/more-actions.js +5 -5
- package/base-modules/family-member/page.d.ts +40 -13
- package/base-modules/family-member/page.js +34 -34
- package/base-modules/family-member/validate.d.ts +8 -0
- package/base-modules/family-member/validate.js +20 -5
- package/base-modules/family-member/view.js +3 -3
- package/base-modules/fee-structure/form.js +5 -4
- package/base-modules/fee-structure/more-actions.js +2 -2
- package/base-modules/fee-structure/page.d.ts +11 -11
- package/base-modules/fee-structure/page.js +34 -34
- package/base-modules/fee-structure/validate.d.ts +6 -0
- package/base-modules/fee-structure/validate.js +12 -3
- package/base-modules/fee-structure/view.js +3 -3
- package/base-modules/rbac/assign-permissions.js +9 -5
- package/base-modules/rbac/filter.js +5 -3
- package/base-modules/rbac/form.js +2 -1
- package/base-modules/rbac/more-actions.d.ts +0 -5
- package/base-modules/rbac/more-actions.js +3 -1
- package/base-modules/rbac/validate.d.ts +3 -0
- package/base-modules/rbac/validate.js +7 -1
- package/base-modules/rbac/view.js +7 -5
- package/base-modules/school/drawer.js +3 -1
- package/base-modules/school/form.js +2 -1
- package/base-modules/school/validate.d.ts +8 -0
- package/base-modules/school/validate.js +17 -6
- package/base-modules/school/view.js +2 -2
- package/base-modules/section/filter.js +1 -1
- package/base-modules/section/form.js +3 -2
- package/base-modules/section/page.d.ts +8 -8
- package/base-modules/section/page.js +25 -25
- package/base-modules/section/validate.d.ts +7 -0
- package/base-modules/section/validate.js +15 -5
- package/base-modules/section/view.js +3 -3
- package/base-modules/student-fee/filter.js +1 -1
- package/base-modules/student-fee/form.js +3 -2
- package/base-modules/student-fee/page.d.ts +13 -13
- package/base-modules/student-fee/page.js +40 -40
- package/base-modules/student-fee/validate.d.ts +11 -3
- package/base-modules/student-fee/validate.js +20 -12
- package/base-modules/student-fee/view.js +4 -4
- package/base-modules/student-profile/context/use-student-profile-module.js +2 -2
- package/base-modules/student-profile/filter.js +2 -2
- package/base-modules/student-profile/form.js +6 -5
- package/base-modules/student-profile/page.d.ts +10 -10
- package/base-modules/student-profile/page.js +31 -31
- package/base-modules/student-profile/validate.d.ts +8 -2
- package/base-modules/student-profile/validate.js +13 -10
- package/base-modules/student-profile/view.js +2 -2
- package/base-modules/subject/filter.js +1 -1
- package/base-modules/subject/form.js +2 -1
- package/base-modules/subject/more-actions.js +3 -3
- package/base-modules/subject/page.d.ts +9 -9
- package/base-modules/subject/page.js +28 -28
- package/base-modules/subject/validate.d.ts +12 -1
- package/base-modules/subject/validate.js +24 -10
- package/base-modules/subject/view.js +3 -3
- package/base-modules/teacher/context.js +3 -3
- package/base-modules/teacher/filter.js +1 -1
- package/base-modules/teacher/form.js +9 -32
- package/base-modules/teacher/more-actions.js +2 -2
- package/base-modules/teacher/page.d.ts +10 -10
- package/base-modules/teacher/page.js +31 -31
- package/base-modules/teacher/validate.d.ts +5 -1
- package/base-modules/teacher/validate.js +10 -25
- package/base-modules/teacher/view.js +3 -3
- package/base-modules/user/filter.js +1 -1
- package/base-modules/user/form.js +3 -2
- package/base-modules/user/page.d.ts +9 -9
- package/base-modules/user/page.js +28 -28
- package/base-modules/user/validate.d.ts +8 -1
- package/base-modules/user/validate.js +16 -6
- package/base-modules/user/view.js +1 -1
- package/base-modules/workspace/context.js +3 -3
- package/base-modules/workspace/drawer.js +1 -1
- package/base-modules/workspace/filter.js +1 -1
- package/base-modules/workspace/form.js +2 -1
- package/base-modules/workspace/more-actions.js +1 -1
- package/base-modules/workspace/page.d.ts +1 -1
- package/base-modules/workspace/page.js +2 -2
- package/base-modules/workspace/validate.d.ts +4 -0
- package/base-modules/workspace/validate.js +6 -2
- package/base-modules/workspace/view.js +2 -2
- package/base-modules/workspace-user/context.js +6 -6
- package/base-modules/workspace-user/form.js +2 -1
- package/base-modules/workspace-user/page.d.ts +9 -9
- package/base-modules/workspace-user/page.js +28 -28
- package/base-modules/workspace-user/validate.d.ts +4 -5
- package/base-modules/workspace-user/validate.js +6 -10
- package/base-modules/workspace-user/view.js +1 -1
- package/constants.d.ts +5 -1
- package/constants.js +2 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/get-translated-error.d.ts +5 -0
- package/utils/get-translated-error.js +5 -0
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
import { FC } from "react";
|
|
11
11
|
import { USER_ROLE } from "../../type";
|
|
12
12
|
interface Props {
|
|
13
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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 = ({
|
|
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:
|
|
48
|
-
{ label:
|
|
49
|
-
{ label:
|
|
50
|
-
{ label:
|
|
51
|
-
{ label:
|
|
52
|
-
{ label:
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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.
|
|
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.
|
|
118
|
-
props.
|
|
119
|
-
props.
|
|
120
|
-
props.
|
|
121
|
-
props.
|
|
122
|
-
props.
|
|
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
|
-
|
|
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,
|
|
12
|
-
userId: z.string().min(1,
|
|
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("
|
|
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:
|
|
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",
|