@appcorp/fusion-storybook 0.2.86 → 0.2.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base-modules/admission/filter.js +3 -3
- package/base-modules/admission/form.js +1 -1
- package/base-modules/admission/more-actions.js +288 -2
- package/base-modules/admission/view.js +1 -1
- package/base-modules/attendance/form.js +3 -3
- package/base-modules/campus/form.js +2 -1
- package/base-modules/campus/validate.d.ts +13 -5
- package/base-modules/campus/validate.js +24 -19
- package/base-modules/class/form.js +2 -1
- package/base-modules/class/more-actions.js +2 -2
- package/base-modules/class/validate.d.ts +10 -5
- package/base-modules/class/validate.js +18 -16
- package/base-modules/class/view.js +2 -2
- package/base-modules/course/form.js +2 -1
- package/base-modules/course/validate.d.ts +7 -5
- package/base-modules/course/validate.js +12 -13
- package/base-modules/course/view.js +3 -3
- package/base-modules/discount-code/constants.d.ts +1 -1
- package/base-modules/discount-code/constants.js +1 -1
- package/base-modules/discount-code/form.js +2 -1
- package/base-modules/discount-code/more-actions.js +1 -1
- package/base-modules/discount-code/page.d.ts +10 -10
- package/base-modules/discount-code/page.js +31 -31
- package/base-modules/discount-code/validate.d.ts +5 -0
- package/base-modules/discount-code/validate.js +8 -3
- package/base-modules/discount-code/view.js +2 -2
- package/base-modules/enrollment/form.js +3 -2
- package/base-modules/enrollment/more-actions.js +5 -5
- package/base-modules/enrollment/page.d.ts +10 -10
- package/base-modules/enrollment/page.js +31 -31
- package/base-modules/enrollment/validate.d.ts +6 -0
- package/base-modules/enrollment/validate.js +13 -5
- package/base-modules/enrollment/view.js +2 -2
- package/base-modules/expense/filter.js +1 -1
- package/base-modules/expense/form.js +3 -3
- package/base-modules/expense/more-actions.js +6 -6
- package/base-modules/expense/page.d.ts +11 -11
- package/base-modules/expense/page.js +34 -34
- package/base-modules/expense/validate.d.ts +8 -0
- package/base-modules/expense/validate.js +13 -5
- package/base-modules/expense/view.js +2 -2
- package/base-modules/family/context.js +1 -1
- package/base-modules/family/form.js +1 -1
- package/base-modules/family/more-actions.js +2 -2
- package/base-modules/family/page.d.ts +10 -10
- package/base-modules/family/page.js +31 -31
- package/base-modules/family/validate.d.ts +4 -0
- package/base-modules/family/validate.js +8 -1
- package/base-modules/family/view.js +1 -1
- package/base-modules/family-member/context.js +1 -1
- package/base-modules/family-member/form.js +2 -1
- package/base-modules/family-member/more-actions.js +5 -5
- package/base-modules/family-member/page.d.ts +40 -13
- package/base-modules/family-member/page.js +34 -34
- package/base-modules/family-member/validate.d.ts +8 -0
- package/base-modules/family-member/validate.js +20 -5
- package/base-modules/family-member/view.js +3 -3
- package/base-modules/fee-structure/form.js +5 -4
- package/base-modules/fee-structure/more-actions.js +2 -2
- package/base-modules/fee-structure/page.d.ts +11 -11
- package/base-modules/fee-structure/page.js +34 -34
- package/base-modules/fee-structure/validate.d.ts +6 -0
- package/base-modules/fee-structure/validate.js +12 -3
- package/base-modules/fee-structure/view.js +3 -3
- package/base-modules/rbac/assign-permissions.js +9 -5
- package/base-modules/rbac/filter.js +5 -3
- package/base-modules/rbac/form.js +2 -1
- package/base-modules/rbac/more-actions.d.ts +0 -5
- package/base-modules/rbac/more-actions.js +3 -1
- package/base-modules/rbac/validate.d.ts +3 -0
- package/base-modules/rbac/validate.js +7 -1
- package/base-modules/rbac/view.js +7 -5
- package/base-modules/school/drawer.js +3 -1
- package/base-modules/school/form.js +2 -1
- package/base-modules/school/validate.d.ts +8 -0
- package/base-modules/school/validate.js +17 -6
- package/base-modules/school/view.js +2 -2
- package/base-modules/section/filter.js +1 -1
- package/base-modules/section/form.js +3 -2
- package/base-modules/section/page.d.ts +8 -8
- package/base-modules/section/page.js +25 -25
- package/base-modules/section/validate.d.ts +7 -0
- package/base-modules/section/validate.js +15 -5
- package/base-modules/section/view.js +3 -3
- package/base-modules/student-fee/filter.js +1 -1
- package/base-modules/student-fee/form.js +3 -2
- package/base-modules/student-fee/more-actions.js +11 -10
- package/base-modules/student-fee/page.d.ts +13 -13
- package/base-modules/student-fee/page.js +40 -40
- package/base-modules/student-fee/validate.d.ts +11 -3
- package/base-modules/student-fee/validate.js +20 -12
- package/base-modules/student-fee/view.js +4 -4
- package/base-modules/student-profile/context/use-student-profile-module.js +2 -2
- package/base-modules/student-profile/filter.js +2 -2
- package/base-modules/student-profile/form.js +6 -5
- package/base-modules/student-profile/page.d.ts +10 -10
- package/base-modules/student-profile/page.js +31 -31
- package/base-modules/student-profile/validate.d.ts +8 -2
- package/base-modules/student-profile/validate.js +13 -10
- package/base-modules/student-profile/view.js +2 -2
- package/base-modules/subject/filter.js +1 -1
- package/base-modules/subject/form.js +2 -1
- package/base-modules/subject/more-actions.js +3 -3
- package/base-modules/subject/page.d.ts +9 -9
- package/base-modules/subject/page.js +28 -28
- package/base-modules/subject/validate.d.ts +12 -1
- package/base-modules/subject/validate.js +24 -10
- package/base-modules/subject/view.js +3 -3
- package/base-modules/teacher/context.js +3 -3
- package/base-modules/teacher/filter.js +1 -1
- package/base-modules/teacher/form.js +9 -32
- package/base-modules/teacher/more-actions.js +2 -2
- package/base-modules/teacher/page.d.ts +10 -10
- package/base-modules/teacher/page.js +31 -31
- package/base-modules/teacher/validate.d.ts +5 -1
- package/base-modules/teacher/validate.js +10 -25
- package/base-modules/teacher/view.js +3 -3
- package/base-modules/user/filter.js +1 -1
- package/base-modules/user/form.js +3 -2
- package/base-modules/user/page.d.ts +9 -9
- package/base-modules/user/page.js +28 -28
- package/base-modules/user/validate.d.ts +8 -1
- package/base-modules/user/validate.js +16 -6
- package/base-modules/user/view.js +1 -1
- package/base-modules/workspace/context.js +3 -3
- package/base-modules/workspace/drawer.js +1 -1
- package/base-modules/workspace/filter.js +1 -1
- package/base-modules/workspace/form.js +2 -1
- package/base-modules/workspace/more-actions.js +1 -1
- package/base-modules/workspace/page.d.ts +1 -1
- package/base-modules/workspace/page.js +2 -2
- package/base-modules/workspace/validate.d.ts +4 -0
- package/base-modules/workspace/validate.js +6 -2
- package/base-modules/workspace/view.js +2 -2
- package/base-modules/workspace-user/context.js +6 -6
- package/base-modules/workspace-user/form.js +2 -1
- package/base-modules/workspace-user/page.d.ts +9 -9
- package/base-modules/workspace-user/page.js +28 -28
- package/base-modules/workspace-user/validate.d.ts +4 -5
- package/base-modules/workspace-user/validate.js +6 -10
- package/base-modules/workspace-user/view.js +1 -1
- package/constants.d.ts +5 -1
- package/constants.js +2 -0
- package/package.json +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/get-translated-error.d.ts +5 -0
- package/utils/get-translated-error.js +5 -0
|
@@ -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,
|
|
5
|
-
subdomain: z.string().min(1,
|
|
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("
|
|
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("
|
|
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("
|
|
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("
|
|
186
|
+
showToast(isCreated ? t("messagesWorkspaceUserCreateFailed") : t("messagesWorkspaceUserUpdateFailed"), TOAST_VARIANT.ERROR);
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
189
|
if (data) {
|
|
190
|
-
showToast(t("
|
|
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("
|
|
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("
|
|
210
|
+
showToast(t("messagesWorkspaceUserDeleteFailed"), TOAST_VARIANT.ERROR);
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
213
|
if (data) {
|
|
214
|
-
showToast(t("
|
|
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
|
|
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
|
-
|
|
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",
|