@carlonicora/nextjs-jsonapi 1.29.2 → 1.29.4
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/dist/{BlockNoteEditor-GNFK7ZVR.mjs → BlockNoteEditor-G532N3N7.mjs} +6 -6
- package/dist/BlockNoteEditor-G532N3N7.mjs.map +1 -0
- package/dist/{BlockNoteEditor-BEWKLGW3.js → BlockNoteEditor-XWHUG6VH.js} +10 -10
- package/dist/BlockNoteEditor-XWHUG6VH.js.map +1 -0
- package/dist/billing/index.js +291 -291
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-XU4MY6OG.js → chunk-ALGMJ4JS.js} +666 -688
- package/dist/chunk-ALGMJ4JS.js.map +1 -0
- package/dist/{chunk-IJSB4FH6.mjs → chunk-CWY6AL4V.mjs} +501 -523
- package/dist/chunk-CWY6AL4V.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/details/AllowedUsersDetails.tsx +1 -1
- package/src/components/editors/BlockNoteEditor.tsx +5 -5
- package/src/components/forms/CommonAssociationForm.tsx +9 -9
- package/src/components/forms/CommonDeleter.tsx +14 -8
- package/src/components/forms/CommonEditorButtons.tsx +2 -2
- package/src/components/forms/CommonEditorHeader.tsx +4 -4
- package/src/components/forms/CommonEditorTrigger.tsx +1 -1
- package/src/components/forms/FileUploader.tsx +8 -8
- package/src/components/forms/FormDateTime.tsx +6 -12
- package/src/components/forms/FormInput.tsx +4 -20
- package/src/components/forms/PasswordInput.tsx +1 -1
- package/src/components/navigations/Breadcrumb.tsx +1 -1
- package/src/components/navigations/Header.tsx +2 -2
- package/src/components/navigations/RecentPagesNavigator.tsx +3 -3
- package/src/components/tables/ContentTableSearch.tsx +1 -1
- package/src/contexts/CommonContext.tsx +2 -2
- package/src/features/auth/components/details/LandingComponent.tsx +5 -5
- package/src/features/auth/components/forms/AcceptInvitation.tsx +16 -22
- package/src/features/auth/components/forms/ActivateAccount.tsx +8 -8
- package/src/features/auth/components/forms/ForgotPassword.tsx +9 -9
- package/src/features/auth/components/forms/Login.tsx +12 -12
- package/src/features/auth/components/forms/Register.tsx +19 -21
- package/src/features/auth/components/forms/ResetPassword.tsx +12 -18
- package/src/features/company/components/details/TokenStatusIndicator.tsx +7 -7
- package/src/features/company/components/forms/CompanyConfigurationEditor.tsx +2 -2
- package/src/features/company/components/forms/CompanyDeleter.tsx +13 -11
- package/src/features/company/components/forms/CompanyEditor.tsx +7 -13
- package/src/features/company/components/lists/CompaniesList.tsx +1 -1
- package/src/features/company/contexts/CompanyContext.tsx +1 -1
- package/src/features/company/hooks/useCompanyTableStructure.tsx +2 -2
- package/src/features/content/components/lists/ContentsList.tsx +1 -1
- package/src/features/content/components/lists/ContentsListById.tsx +1 -1
- package/src/features/content/components/lists/RelevantContentsList.tsx +1 -1
- package/src/features/content/hooks/useContentTableStructure.tsx +5 -5
- package/src/features/notification/components/containers/NotificationsListContainer.tsx +2 -2
- package/src/features/notification/components/lists/NotificationsList.tsx +3 -3
- package/src/features/notification/components/modals/NotificationModal.tsx +3 -5
- package/src/features/notification/components/notifications/Notification.tsx +4 -4
- package/src/features/notification/contexts/NotificationContext.tsx +2 -2
- package/src/features/role/components/details/RoleDetails.tsx +1 -1
- package/src/features/role/components/forms/FormRoles.tsx +2 -2
- package/src/features/role/components/forms/RemoveUserFromRole.tsx +9 -11
- package/src/features/role/components/forms/UserRoleAdd.tsx +18 -18
- package/src/features/role/components/lists/RolesList.tsx +1 -1
- package/src/features/role/components/lists/UserRolesList.tsx +1 -1
- package/src/features/role/contexts/RoleContext.tsx +2 -2
- package/src/features/role/hooks/useRoleTableStructure.tsx +3 -3
- package/src/features/user/components/containers/UsersListContainer.tsx +2 -2
- package/src/features/user/components/details/UserDetails.tsx +6 -6
- package/src/features/user/components/forms/RoleUserAdd.tsx +8 -8
- package/src/features/user/components/forms/UserAvatarEditor.tsx +2 -2
- package/src/features/user/components/forms/UserEditor.tsx +21 -25
- package/src/features/user/components/forms/UserReactivator.tsx +7 -7
- package/src/features/user/components/forms/UserResentInvitationEmail.tsx +9 -9
- package/src/features/user/components/forms/UserSelector.tsx +4 -9
- package/src/features/user/components/lists/AdminUsersList.tsx +1 -1
- package/src/features/user/components/lists/CompanyUsersList.tsx +1 -1
- package/src/features/user/components/lists/RelevantUsersList.tsx +1 -1
- package/src/features/user/components/lists/RoleUsersList.tsx +1 -1
- package/src/features/user/components/lists/UsersList.tsx +1 -1
- package/src/features/user/components/lists/UsersListByContentIds.tsx +1 -1
- package/src/features/user/components/widgets/UserSearchPopover.tsx +3 -3
- package/src/features/user/contexts/UserContext.tsx +5 -5
- package/src/features/user/hooks/useUserTableStructure.tsx +6 -6
- package/src/hooks/useDataListRetriever.ts +12 -0
- package/dist/BlockNoteEditor-BEWKLGW3.js.map +0 -1
- package/dist/BlockNoteEditor-GNFK7ZVR.mjs.map +0 -1
- package/dist/chunk-IJSB4FH6.mjs.map +0 -1
- package/dist/chunk-XU4MY6OG.js.map +0 -1
|
@@ -180,6 +180,7 @@ function useDataListRetriever(params) {
|
|
|
180
180
|
const requestIdRef = useRef(0);
|
|
181
181
|
const abortControllerRef = useRef(null);
|
|
182
182
|
const isFetchingRef = useRef(false);
|
|
183
|
+
const isPaginatingRef = useRef(false);
|
|
183
184
|
const resolvedType = params.module;
|
|
184
185
|
const resolvedService = ClientAbstractService;
|
|
185
186
|
const parsePageParams = useCallback2((url) => {
|
|
@@ -235,7 +236,13 @@ function useDataListRetriever(params) {
|
|
|
235
236
|
const fetchData = useCallback2(
|
|
236
237
|
async (fetchParams) => {
|
|
237
238
|
if (ready === false) return;
|
|
239
|
+
if ((fetchParams?.callNext || fetchParams?.callPrevious) && isPaginatingRef.current) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
238
242
|
if (isFetchingRef.current && !fetchParams?.callNext && !fetchParams?.callPrevious) return;
|
|
243
|
+
if (fetchParams?.callNext || fetchParams?.callPrevious) {
|
|
244
|
+
isPaginatingRef.current = true;
|
|
245
|
+
}
|
|
239
246
|
const thisRequestId = ++requestIdRef.current;
|
|
240
247
|
isFetchingRef.current = true;
|
|
241
248
|
if (stableParams.requiresSearch === true && fetchParams?.isRefine !== true && fetchParams?.isRefresh !== true) {
|
|
@@ -299,6 +306,7 @@ function useDataListRetriever(params) {
|
|
|
299
306
|
} finally {
|
|
300
307
|
if (thisRequestId === requestIdRef.current) {
|
|
301
308
|
isFetchingRef.current = false;
|
|
309
|
+
isPaginatingRef.current = false;
|
|
302
310
|
}
|
|
303
311
|
}
|
|
304
312
|
},
|
|
@@ -1074,10 +1082,10 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
1074
1082
|
setUsers(users.filter((u) => u.id !== user.id));
|
|
1075
1083
|
triggerAssociationToast({
|
|
1076
1084
|
t,
|
|
1077
|
-
source: t(`
|
|
1078
|
-
destination: t(`
|
|
1085
|
+
source: t(`entities.users`, { count: 1 }),
|
|
1086
|
+
destination: t(`entities.roles`, { count: 1 }),
|
|
1079
1087
|
source_name: user.name,
|
|
1080
|
-
destination_name: t(`
|
|
1088
|
+
destination_name: t(`role.roles`, { role: role.id.replaceAll(`-`, ``) })
|
|
1081
1089
|
});
|
|
1082
1090
|
refresh();
|
|
1083
1091
|
}, "addUserToRole");
|
|
@@ -1096,8 +1104,8 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
1096
1104
|
/* @__PURE__ */ jsx5(
|
|
1097
1105
|
CommonAssociationTrigger,
|
|
1098
1106
|
{
|
|
1099
|
-
sourceType: t(`
|
|
1100
|
-
destinationType: t(`
|
|
1107
|
+
sourceType: t(`entities.users`, { count: 1 }),
|
|
1108
|
+
destinationType: t(`entities.roles`, { count: 1 }),
|
|
1101
1109
|
onTrigger: () => setShow(true)
|
|
1102
1110
|
}
|
|
1103
1111
|
),
|
|
@@ -1107,9 +1115,9 @@ function AddUserToRoleInternal({ role, refresh }) {
|
|
|
1107
1115
|
show,
|
|
1108
1116
|
setShow,
|
|
1109
1117
|
data,
|
|
1110
|
-
source: t(`
|
|
1111
|
-
destination: t(`
|
|
1112
|
-
destinationName: t(`
|
|
1118
|
+
source: t(`entities.users`, { count: 1 }),
|
|
1119
|
+
destination: t(`entities.roles`, { count: 1 }),
|
|
1120
|
+
destinationName: t(`role.roles`, { role: role.id.replaceAll(`-`, ``) }),
|
|
1113
1121
|
children: /* @__PURE__ */ jsx5(UserListInAdd, { data, existingUsers, setSelectedUser: addUserToRole })
|
|
1114
1122
|
}
|
|
1115
1123
|
)
|
|
@@ -6821,7 +6829,7 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
|
|
|
6821
6829
|
Image,
|
|
6822
6830
|
{
|
|
6823
6831
|
src: file ? URL.createObjectURL(file) : user?.avatar || "",
|
|
6824
|
-
alt: t(`
|
|
6832
|
+
alt: t(`common.avatar`),
|
|
6825
6833
|
width: 200,
|
|
6826
6834
|
height: 200
|
|
6827
6835
|
}
|
|
@@ -6840,7 +6848,7 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
|
|
|
6840
6848
|
setFile(null);
|
|
6841
6849
|
setResetImage(true);
|
|
6842
6850
|
},
|
|
6843
|
-
children: t(`
|
|
6851
|
+
children: t(`ui.buttons.remove`)
|
|
6844
6852
|
}
|
|
6845
6853
|
)
|
|
6846
6854
|
] });
|
|
@@ -6911,8 +6919,8 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6911
6919
|
}, [company]);
|
|
6912
6920
|
const formSchema = z.object({
|
|
6913
6921
|
id: z.uuidv4(),
|
|
6914
|
-
name: z.string().min(1, { message: t(`
|
|
6915
|
-
email: z.string().min(1, { message: t(`
|
|
6922
|
+
name: z.string().min(1, { message: t(`user.fields.name.error`) }),
|
|
6923
|
+
email: z.string().min(1, { message: t(`common.fields.email.error`) }),
|
|
6916
6924
|
password: z.string().optional(),
|
|
6917
6925
|
title: z.string().optional(),
|
|
6918
6926
|
bio: z.string().optional(),
|
|
@@ -6943,9 +6951,9 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6943
6951
|
if (existingUser) {
|
|
6944
6952
|
form.setError("email", {
|
|
6945
6953
|
type: "manual",
|
|
6946
|
-
message: t(`
|
|
6954
|
+
message: t(`user.errors.email_exists`)
|
|
6947
6955
|
});
|
|
6948
|
-
errorToast({ title: t(`
|
|
6956
|
+
errorToast({ title: t(`user.errors.email_exists`), error: "" });
|
|
6949
6957
|
return;
|
|
6950
6958
|
}
|
|
6951
6959
|
} catch (error) {
|
|
@@ -6990,7 +6998,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
6990
6998
|
router.push(generateUrl({ page: Modules.User, id: updatedUser.id }));
|
|
6991
6999
|
}
|
|
6992
7000
|
} catch (error) {
|
|
6993
|
-
errorToast({ title: user ? t(`
|
|
7001
|
+
errorToast({ title: user ? t(`common.errors.update`) : t(`common.errors.create`), error });
|
|
6994
7002
|
}
|
|
6995
7003
|
}, "onSubmit");
|
|
6996
7004
|
useEffect10(() => {
|
|
@@ -7031,7 +7039,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7031
7039
|
{
|
|
7032
7040
|
className: `flex max-h-[70vh] ${canChangeRoles ? `max-w-[90vw]` : `max-w-3xl`} min-h-3xl max-h-[90vh] flex-col overflow-y-auto`,
|
|
7033
7041
|
children: [
|
|
7034
|
-
/* @__PURE__ */ jsx53(CommonEditorHeader, { type: t(`
|
|
7042
|
+
/* @__PURE__ */ jsx53(CommonEditorHeader, { type: t(`entities.users`, { count: 1 }), name: user?.name }),
|
|
7035
7043
|
/* @__PURE__ */ jsx53(Form, { ...form, children: /* @__PURE__ */ jsxs24("form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
|
|
7036
7044
|
/* @__PURE__ */ jsxs24("div", { className: `flex flex-row gap-x-4`, children: [
|
|
7037
7045
|
/* @__PURE__ */ jsx53("div", { className: `flex w-40 flex-col justify-start gap-y-2`, children: /* @__PURE__ */ jsx53(
|
|
@@ -7050,8 +7058,8 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7050
7058
|
{
|
|
7051
7059
|
form,
|
|
7052
7060
|
id: "name",
|
|
7053
|
-
name: t(`
|
|
7054
|
-
placeholder: t(`
|
|
7061
|
+
name: t(`user.fields.name.label`),
|
|
7062
|
+
placeholder: t(`user.fields.name.placeholder`)
|
|
7055
7063
|
}
|
|
7056
7064
|
),
|
|
7057
7065
|
/* @__PURE__ */ jsx53(
|
|
@@ -7059,8 +7067,8 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7059
7067
|
{
|
|
7060
7068
|
form,
|
|
7061
7069
|
id: "email",
|
|
7062
|
-
name: t(`
|
|
7063
|
-
placeholder: t(`
|
|
7070
|
+
name: t(`common.fields.email.label`),
|
|
7071
|
+
placeholder: t(`common.fields.email.placeholder`)
|
|
7064
7072
|
}
|
|
7065
7073
|
),
|
|
7066
7074
|
/* @__PURE__ */ jsx53(
|
|
@@ -7068,8 +7076,8 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7068
7076
|
{
|
|
7069
7077
|
form,
|
|
7070
7078
|
id: "phone",
|
|
7071
|
-
name: t(`
|
|
7072
|
-
placeholder: t(`
|
|
7079
|
+
name: t(`user.fields.phone.label`),
|
|
7080
|
+
placeholder: t(`user.fields.phone.placeholder`)
|
|
7073
7081
|
}
|
|
7074
7082
|
),
|
|
7075
7083
|
/* @__PURE__ */ jsx53(
|
|
@@ -7077,8 +7085,8 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7077
7085
|
{
|
|
7078
7086
|
form,
|
|
7079
7087
|
id: "password",
|
|
7080
|
-
name: t(`
|
|
7081
|
-
placeholder: t(`
|
|
7088
|
+
name: t(`user.fields.password.label`),
|
|
7089
|
+
placeholder: t(`user.fields.password.placeholder`)
|
|
7082
7090
|
}
|
|
7083
7091
|
),
|
|
7084
7092
|
/* @__PURE__ */ jsx53(
|
|
@@ -7086,8 +7094,8 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7086
7094
|
{
|
|
7087
7095
|
form,
|
|
7088
7096
|
id: "title",
|
|
7089
|
-
name: t(`
|
|
7090
|
-
placeholder: t(`
|
|
7097
|
+
name: t(`user.fields.title.label`),
|
|
7098
|
+
placeholder: t(`user.fields.title.placeholder`)
|
|
7091
7099
|
}
|
|
7092
7100
|
),
|
|
7093
7101
|
/* @__PURE__ */ jsx53(
|
|
@@ -7095,24 +7103,17 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
|
|
|
7095
7103
|
{
|
|
7096
7104
|
form,
|
|
7097
7105
|
id: "bio",
|
|
7098
|
-
name: t(`
|
|
7099
|
-
placeholder: t(`
|
|
7106
|
+
name: t(`user.fields.bio.label`),
|
|
7107
|
+
placeholder: t(`user.fields.bio.placeholder`),
|
|
7100
7108
|
className: "min-h-40"
|
|
7101
7109
|
}
|
|
7102
7110
|
)
|
|
7103
7111
|
] }),
|
|
7104
7112
|
canChangeRoles && /* @__PURE__ */ jsxs24("div", { className: "flex w-1/3 flex-col", children: [
|
|
7105
|
-
canChangeRoles && /* @__PURE__ */ jsx53(FormRoles, { form, id: "roleIds", name: t(`
|
|
7113
|
+
canChangeRoles && /* @__PURE__ */ jsx53(FormRoles, { form, id: "roleIds", name: t(`entities.roles`, { count: 2 }), roles }),
|
|
7106
7114
|
!user && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-y-4", children: [
|
|
7107
|
-
/* @__PURE__ */ jsx53("div", { className: "text-sm font-semibold", children: t(`
|
|
7108
|
-
/* @__PURE__ */ jsx53(
|
|
7109
|
-
FormCheckbox,
|
|
7110
|
-
{
|
|
7111
|
-
form,
|
|
7112
|
-
id: "sendInvitationEmail",
|
|
7113
|
-
name: t(`foundations.user.send_activation_email`)
|
|
7114
|
-
}
|
|
7115
|
-
)
|
|
7115
|
+
/* @__PURE__ */ jsx53("div", { className: "text-sm font-semibold", children: t(`user.send_activation_email`) }),
|
|
7116
|
+
/* @__PURE__ */ jsx53(FormCheckbox, { form, id: "sendInvitationEmail", name: t(`user.send_activation_email`) })
|
|
7116
7117
|
] })
|
|
7117
7118
|
] })
|
|
7118
7119
|
] }),
|
|
@@ -7167,7 +7168,7 @@ function CommonAssociationTrigger({
|
|
|
7167
7168
|
const t = useTranslations5();
|
|
7168
7169
|
if (hasDestination)
|
|
7169
7170
|
return /* @__PURE__ */ jsx54("div", { className: "hover:text-accent cursor-pointer", onClick: onTrigger, children: "Join" });
|
|
7170
|
-
return /* @__PURE__ */ jsx54(Button, { variant: `outline`, size: `sm`, onClick: onTrigger, children: t(`
|
|
7171
|
+
return /* @__PURE__ */ jsx54(Button, { variant: `outline`, size: `sm`, onClick: onTrigger, children: t(`common.association.label`, {
|
|
7171
7172
|
source: sourceType,
|
|
7172
7173
|
destination: destinationType
|
|
7173
7174
|
}) });
|
|
@@ -7199,11 +7200,11 @@ function CommonAssociationCommandDialog({
|
|
|
7199
7200
|
}, [show, searchTerm]);
|
|
7200
7201
|
return /* @__PURE__ */ jsxs25(CommandDialog, { open: show, onOpenChange: setShow, children: [
|
|
7201
7202
|
/* @__PURE__ */ jsxs25(DialogHeader, { className: "flex flex-col items-start p-4 pb-0", children: [
|
|
7202
|
-
/* @__PURE__ */ jsx54(DialogTitle, { children: t(`
|
|
7203
|
+
/* @__PURE__ */ jsx54(DialogTitle, { children: t(`common.association.label`, {
|
|
7203
7204
|
source,
|
|
7204
7205
|
destination
|
|
7205
7206
|
}) }),
|
|
7206
|
-
/* @__PURE__ */ jsx54(DialogDescription, { children: t(`
|
|
7207
|
+
/* @__PURE__ */ jsx54(DialogDescription, { children: t(`common.association.description`, {
|
|
7207
7208
|
source,
|
|
7208
7209
|
destination,
|
|
7209
7210
|
destination_name: destinationName
|
|
@@ -7213,13 +7214,13 @@ function CommonAssociationCommandDialog({
|
|
|
7213
7214
|
/* @__PURE__ */ jsx54(
|
|
7214
7215
|
CommandInput,
|
|
7215
7216
|
{
|
|
7216
|
-
placeholder: t(`
|
|
7217
|
+
placeholder: t(`ui.search.placeholder`, { type: source }),
|
|
7217
7218
|
value: searchTerm,
|
|
7218
7219
|
onValueChange: setSearchTerm
|
|
7219
7220
|
}
|
|
7220
7221
|
),
|
|
7221
7222
|
/* @__PURE__ */ jsxs25(CommandList, { className: "mt-3 h-auto max-h-96 min-h-96 max-w-full overflow-y-auto overflow-x-hidden", children: [
|
|
7222
|
-
/* @__PURE__ */ jsx54(CommandEmpty, { children: t(`
|
|
7223
|
+
/* @__PURE__ */ jsx54(CommandEmpty, { children: t(`ui.search.no_results`, { type: source }) }),
|
|
7223
7224
|
children
|
|
7224
7225
|
] })
|
|
7225
7226
|
] })
|
|
@@ -7229,12 +7230,12 @@ __name(CommonAssociationCommandDialog, "CommonAssociationCommandDialog");
|
|
|
7229
7230
|
var triggerAssociationToast = /* @__PURE__ */ __name((params) => {
|
|
7230
7231
|
if (params.level) {
|
|
7231
7232
|
toast.message(
|
|
7232
|
-
params.t(`
|
|
7233
|
+
params.t(`common.association.label`, {
|
|
7233
7234
|
source: params.source,
|
|
7234
7235
|
destination: params.destination
|
|
7235
7236
|
}),
|
|
7236
7237
|
{
|
|
7237
|
-
description: params.t(`
|
|
7238
|
+
description: params.t(`common.association.success_level`, {
|
|
7238
7239
|
source: params.source,
|
|
7239
7240
|
destination: params.destination,
|
|
7240
7241
|
source_name: params.source_name,
|
|
@@ -7245,12 +7246,12 @@ var triggerAssociationToast = /* @__PURE__ */ __name((params) => {
|
|
|
7245
7246
|
);
|
|
7246
7247
|
} else {
|
|
7247
7248
|
toast.message(
|
|
7248
|
-
params.t(`
|
|
7249
|
+
params.t(`common.association.label`, {
|
|
7249
7250
|
source: params.source,
|
|
7250
7251
|
destination: params.destination
|
|
7251
7252
|
}),
|
|
7252
7253
|
{
|
|
7253
|
-
description: params.t(`
|
|
7254
|
+
description: params.t(`common.association.success`, {
|
|
7254
7255
|
source: params.source,
|
|
7255
7256
|
destination: params.destination,
|
|
7256
7257
|
source_name: params.source_name,
|
|
@@ -7317,18 +7318,28 @@ function CommonDeleter({ deleteFunction, redirectTo, type, forceShow }) {
|
|
|
7317
7318
|
setOpen(false);
|
|
7318
7319
|
if (redirectTo) router.push(redirectTo);
|
|
7319
7320
|
} catch (error) {
|
|
7320
|
-
errorToast({ title: t(`
|
|
7321
|
+
errorToast({ title: t(`common.errors.delete`), error });
|
|
7321
7322
|
}
|
|
7322
7323
|
setIsDeleting(false);
|
|
7323
7324
|
}, "handleDelete");
|
|
7324
7325
|
return /* @__PURE__ */ jsxs27(AlertDialog, { open, onOpenChange: setOpen, children: [
|
|
7325
|
-
forceShow ? null : /* @__PURE__ */ jsx56(AlertDialogTrigger, { children: /* @__PURE__ */ jsx56(
|
|
7326
|
+
forceShow ? null : /* @__PURE__ */ jsx56(AlertDialogTrigger, { children: /* @__PURE__ */ jsx56(
|
|
7327
|
+
Button,
|
|
7328
|
+
{
|
|
7329
|
+
render: /* @__PURE__ */ jsx56("div", {}),
|
|
7330
|
+
nativeButton: false,
|
|
7331
|
+
size: "sm",
|
|
7332
|
+
variant: "ghost",
|
|
7333
|
+
className: "text-muted-foreground hover:text-destructive",
|
|
7334
|
+
children: /* @__PURE__ */ jsx56(Trash2Icon, {})
|
|
7335
|
+
}
|
|
7336
|
+
) }),
|
|
7326
7337
|
/* @__PURE__ */ jsxs27(AlertDialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
7327
7338
|
/* @__PURE__ */ jsxs27(AlertDialogHeader, { children: [
|
|
7328
|
-
/* @__PURE__ */ jsx56(AlertDialogTitle, { children: t(`
|
|
7329
|
-
/* @__PURE__ */ jsx56(AlertDialogDescription, { children: t(`
|
|
7339
|
+
/* @__PURE__ */ jsx56(AlertDialogTitle, { children: t(`common.delete.title`, { type: t(`entities.${type}`, { count: 1 }) }) }),
|
|
7340
|
+
/* @__PURE__ */ jsx56(AlertDialogDescription, { children: t(`common.delete.subtitle`, { type: t(`entities.${type}`, { count: 1 }) }) })
|
|
7330
7341
|
] }),
|
|
7331
|
-
/* @__PURE__ */ jsx56("div", { className: "text-destructive p-4 text-sm", children: t(`
|
|
7342
|
+
/* @__PURE__ */ jsx56("div", { className: "text-destructive p-4 text-sm", children: t(`common.delete.description`, { type: t(`entities.${type}`, { count: 1 }) }) }),
|
|
7332
7343
|
/* @__PURE__ */ jsxs27("div", { className: "flex justify-end", children: [
|
|
7333
7344
|
/* @__PURE__ */ jsx56(
|
|
7334
7345
|
Button,
|
|
@@ -7338,7 +7349,7 @@ function CommonDeleter({ deleteFunction, redirectTo, type, forceShow }) {
|
|
|
7338
7349
|
type: `button`,
|
|
7339
7350
|
onClick: () => setOpen(false),
|
|
7340
7351
|
disabled: isDeleting,
|
|
7341
|
-
children: t(`
|
|
7352
|
+
children: t(`ui.buttons.cancel`)
|
|
7342
7353
|
}
|
|
7343
7354
|
),
|
|
7344
7355
|
/* @__PURE__ */ jsx56(
|
|
@@ -7352,9 +7363,9 @@ function CommonDeleter({ deleteFunction, redirectTo, type, forceShow }) {
|
|
|
7352
7363
|
variant: "destructive",
|
|
7353
7364
|
disabled: isDeleting,
|
|
7354
7365
|
children: isDeleting ? /* @__PURE__ */ jsxs27(Fragment4, { children: [
|
|
7355
|
-
t(`
|
|
7366
|
+
t(`ui.buttons.is_deleting`),
|
|
7356
7367
|
/* @__PURE__ */ jsx56(LoaderCircleIcon, { className: "animate-spin-slow h-5 w-5" })
|
|
7357
|
-
] }) : t(`
|
|
7368
|
+
] }) : t(`ui.buttons.delete`)
|
|
7358
7369
|
}
|
|
7359
7370
|
)
|
|
7360
7371
|
] })
|
|
@@ -7377,10 +7388,10 @@ function CommonEditorButtons({ isEdit, form, disabled, setOpen }) {
|
|
|
7377
7388
|
type: `button`,
|
|
7378
7389
|
onClick: () => setOpen(false),
|
|
7379
7390
|
"data-testid": `modal-button-cancel`,
|
|
7380
|
-
children: t(`
|
|
7391
|
+
children: t(`ui.buttons.cancel`)
|
|
7381
7392
|
}
|
|
7382
7393
|
),
|
|
7383
|
-
/* @__PURE__ */ jsx57(Button, { type: "submit", disabled: form.formState.isSubmitting || disabled, "data-testid": `modal-button-create`, children: isEdit ? t(`
|
|
7394
|
+
/* @__PURE__ */ jsx57(Button, { type: "submit", disabled: form.formState.isSubmitting || disabled, "data-testid": `modal-button-create`, children: isEdit ? t(`ui.buttons.confirm_update`) : t(`ui.buttons.confirm_create`) })
|
|
7384
7395
|
] });
|
|
7385
7396
|
}
|
|
7386
7397
|
__name(CommonEditorButtons, "CommonEditorButtons");
|
|
@@ -7391,13 +7402,13 @@ import { jsx as jsx58, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
|
7391
7402
|
function CommonEditorHeader({ type, name }) {
|
|
7392
7403
|
const t = useTranslations7();
|
|
7393
7404
|
return /* @__PURE__ */ jsxs29(DialogHeader, { children: [
|
|
7394
|
-
/* @__PURE__ */ jsx58(DialogTitle, { children: name ? t(`
|
|
7405
|
+
/* @__PURE__ */ jsx58(DialogTitle, { children: name ? t(`common.edit.update.title`, {
|
|
7395
7406
|
type
|
|
7396
|
-
}) : t(`
|
|
7397
|
-
/* @__PURE__ */ jsx58(DialogDescription, { children: name ? t(`
|
|
7407
|
+
}) : t(`common.edit.create.title`, { type }) }),
|
|
7408
|
+
/* @__PURE__ */ jsx58(DialogDescription, { children: name ? t(`common.edit.update.description`, {
|
|
7398
7409
|
type,
|
|
7399
7410
|
name
|
|
7400
|
-
}) : t(`
|
|
7411
|
+
}) : t(`common.edit.create.description`, {
|
|
7401
7412
|
type
|
|
7402
7413
|
}) })
|
|
7403
7414
|
] });
|
|
@@ -7410,7 +7421,7 @@ import { useTranslations as useTranslations8 } from "next-intl";
|
|
|
7410
7421
|
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
7411
7422
|
function CommonEditorTrigger({ isEdit, edit, create }) {
|
|
7412
7423
|
const t = useTranslations8();
|
|
7413
|
-
return /* @__PURE__ */ jsx59(DialogTrigger, { children: isEdit ? /* @__PURE__ */ jsx59(Button, { render: /* @__PURE__ */ jsx59("div", {}), nativeButton: false, size: "sm", variant: `ghost`, className: "text-muted-foreground", children: /* @__PURE__ */ jsx59(PencilIcon, {}) }) : /* @__PURE__ */ jsx59(Button, { render: /* @__PURE__ */ jsx59("div", {}), nativeButton: false, size: "sm", variant: `outline`, children: create ? create : t(`
|
|
7424
|
+
return /* @__PURE__ */ jsx59(DialogTrigger, { children: isEdit ? /* @__PURE__ */ jsx59(Button, { render: /* @__PURE__ */ jsx59("div", {}), nativeButton: false, size: "sm", variant: `ghost`, className: "text-muted-foreground", children: /* @__PURE__ */ jsx59(PencilIcon, {}) }) : /* @__PURE__ */ jsx59(Button, { render: /* @__PURE__ */ jsx59("div", {}), nativeButton: false, size: "sm", variant: `outline`, children: create ? create : t(`ui.buttons.create`) }) });
|
|
7414
7425
|
}
|
|
7415
7426
|
__name(CommonEditorTrigger, "CommonEditorTrigger");
|
|
7416
7427
|
|
|
@@ -7738,8 +7749,8 @@ var FileUploader = forwardRef4(
|
|
|
7738
7749
|
(acceptedFiles, rejectedFiles) => {
|
|
7739
7750
|
const files = acceptedFiles;
|
|
7740
7751
|
if (!files) {
|
|
7741
|
-
toast3.error(t("
|
|
7742
|
-
description: t("
|
|
7752
|
+
toast3.error(t("common.errors.file"), {
|
|
7753
|
+
description: t("common.errors.file_large")
|
|
7743
7754
|
});
|
|
7744
7755
|
return;
|
|
7745
7756
|
}
|
|
@@ -7756,13 +7767,13 @@ var FileUploader = forwardRef4(
|
|
|
7756
7767
|
if (rejectedFiles.length > 0) {
|
|
7757
7768
|
for (let i = 0; i < rejectedFiles.length; i++) {
|
|
7758
7769
|
if (rejectedFiles[i].errors[0]?.code === "file-too-large") {
|
|
7759
|
-
toast3.error(t("
|
|
7760
|
-
description: t(`
|
|
7770
|
+
toast3.error(t("common.errors.file"), {
|
|
7771
|
+
description: t(`common.errors.file_max`, { size: maxSize / 1024 / 1024 })
|
|
7761
7772
|
});
|
|
7762
7773
|
break;
|
|
7763
7774
|
}
|
|
7764
7775
|
if (rejectedFiles[i].errors[0]?.message) {
|
|
7765
|
-
toast3.error(t(`
|
|
7776
|
+
toast3.error(t(`common.errors.file`), {
|
|
7766
7777
|
description: rejectedFiles[i].errors[0].message
|
|
7767
7778
|
});
|
|
7768
7779
|
break;
|
|
@@ -7871,7 +7882,7 @@ var FileUploaderItem = forwardRef4(
|
|
|
7871
7882
|
className: cn("absolute", direction === "rtl" ? "top-1 left-1" : "top-1 right-1"),
|
|
7872
7883
|
onClick: () => removeFileFromSet(index),
|
|
7873
7884
|
children: [
|
|
7874
|
-
/* @__PURE__ */ jsx62("span", { className: "sr-only", children: t(`
|
|
7885
|
+
/* @__PURE__ */ jsx62("span", { className: "sr-only", children: t(`common.remove_item`, { index }) }),
|
|
7875
7886
|
/* @__PURE__ */ jsx62(RemoveIcon, { className: "hover:stroke-destructive h-4 w-4 duration-200 ease-in-out" })
|
|
7876
7887
|
]
|
|
7877
7888
|
}
|
|
@@ -8222,126 +8233,118 @@ function FormDateTime({
|
|
|
8222
8233
|
if (onChange) onChange(updatedDate);
|
|
8223
8234
|
}
|
|
8224
8235
|
}, "handleTimeChange");
|
|
8225
|
-
return /* @__PURE__ */ jsx66("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx66(
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
/* @__PURE__ */ jsxs36("div", { className: "flex w-full flex-row items-center justify-between", children: [
|
|
8233
|
-
/* @__PURE__ */ jsxs36(
|
|
8234
|
-
PopoverTrigger,
|
|
8236
|
+
return /* @__PURE__ */ jsx66("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx66(FormFieldWrapper, { form, name: id, label: name, children: (field) => /* @__PURE__ */ jsx66("div", { className: "relative flex flex-row", children: /* @__PURE__ */ jsxs36(Popover, { open, onOpenChange: setOpen, modal: true, children: [
|
|
8237
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex w-full flex-row items-center justify-between", children: [
|
|
8238
|
+
/* @__PURE__ */ jsxs36(
|
|
8239
|
+
PopoverTrigger,
|
|
8240
|
+
{
|
|
8241
|
+
render: /* @__PURE__ */ jsx66(
|
|
8242
|
+
Button,
|
|
8235
8243
|
{
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
{
|
|
8239
|
-
variant: "outline",
|
|
8240
|
-
className: cn("w-full pl-3 text-left font-normal", !field.value && "text-muted-foreground")
|
|
8241
|
-
}
|
|
8242
|
-
),
|
|
8243
|
-
children: [
|
|
8244
|
-
field.value ? formatDateTime(field.value) : /* @__PURE__ */ jsx66("span", { children: t(`generic.pick_date_time`) }),
|
|
8245
|
-
/* @__PURE__ */ jsx66(CalendarIcon4, { className: "ml-auto h-4 w-4 opacity-50" })
|
|
8246
|
-
]
|
|
8244
|
+
variant: "outline",
|
|
8245
|
+
className: cn("w-full pl-3 text-left font-normal", !field.value && "text-muted-foreground")
|
|
8247
8246
|
}
|
|
8248
8247
|
),
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
{
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8248
|
+
children: [
|
|
8249
|
+
field.value ? formatDateTime(field.value) : /* @__PURE__ */ jsx66("span", { children: t(`common.pick_date_time`) }),
|
|
8250
|
+
/* @__PURE__ */ jsx66(CalendarIcon4, { className: "ml-auto h-4 w-4 opacity-50" })
|
|
8251
|
+
]
|
|
8252
|
+
}
|
|
8253
|
+
),
|
|
8254
|
+
field.value && allowEmpty !== false && /* @__PURE__ */ jsx66(
|
|
8255
|
+
CircleXIcon3,
|
|
8256
|
+
{
|
|
8257
|
+
className: "text-muted hover:text-destructive ml-2 h-6 w-6 cursor-pointer",
|
|
8258
|
+
onClick: () => {
|
|
8259
|
+
if (onChange) onChange(void 0);
|
|
8260
|
+
form.setValue(id, "");
|
|
8261
|
+
}
|
|
8262
|
+
}
|
|
8263
|
+
)
|
|
8264
|
+
] }),
|
|
8265
|
+
/* @__PURE__ */ jsx66(PopoverContent, { className: "w-auto p-4", align: "start", children: /* @__PURE__ */ jsxs36("div", { className: "flex flex-col space-y-4", children: [
|
|
8266
|
+
/* @__PURE__ */ jsx66(
|
|
8267
|
+
Calendar,
|
|
8268
|
+
{
|
|
8269
|
+
mode: "single",
|
|
8270
|
+
selected: field.value,
|
|
8271
|
+
onSelect: (date) => {
|
|
8272
|
+
if (date) {
|
|
8273
|
+
const newDate = new Date(date);
|
|
8274
|
+
if (field.value) {
|
|
8275
|
+
const currentDate = new Date(field.value);
|
|
8276
|
+
newDate.setHours(currentDate.getHours(), currentDate.getMinutes());
|
|
8277
|
+
} else {
|
|
8278
|
+
newDate.setHours(selectedHours, selectedMinutes);
|
|
8256
8279
|
}
|
|
8280
|
+
form.setValue(id, newDate);
|
|
8281
|
+
if (onChange) onChange(newDate);
|
|
8282
|
+
setSelectedHours(newDate.getHours());
|
|
8283
|
+
setSelectedMinutes(roundToNearestFiveMinutes(newDate.getMinutes()));
|
|
8257
8284
|
}
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8285
|
+
},
|
|
8286
|
+
disabled: (date) => minDate && date < minDate ? true : false,
|
|
8287
|
+
locale: dateFnsLocale
|
|
8288
|
+
}
|
|
8289
|
+
),
|
|
8290
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex flex-row items-end justify-center space-x-4", children: [
|
|
8291
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex flex-col space-y-2", children: [
|
|
8292
|
+
/* @__PURE__ */ jsx66(Label, { htmlFor: "hours-select", children: t(`common.hours`) }),
|
|
8293
|
+
/* @__PURE__ */ jsxs36(
|
|
8294
|
+
Select,
|
|
8263
8295
|
{
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
newDate.setHours(selectedHours, selectedMinutes);
|
|
8274
|
-
}
|
|
8275
|
-
form.setValue(id, newDate);
|
|
8276
|
-
if (onChange) onChange(newDate);
|
|
8277
|
-
setSelectedHours(newDate.getHours());
|
|
8278
|
-
setSelectedMinutes(roundToNearestFiveMinutes(newDate.getMinutes()));
|
|
8279
|
-
}
|
|
8296
|
+
value: String(field.value ? new Date(field.value).getHours() : selectedHours),
|
|
8297
|
+
onValueChange: (value) => {
|
|
8298
|
+
if (!value) return;
|
|
8299
|
+
const hours = parseInt(value);
|
|
8300
|
+
setSelectedHours(hours);
|
|
8301
|
+
handleTimeChange(
|
|
8302
|
+
hours,
|
|
8303
|
+
field.value ? roundToNearestFiveMinutes(new Date(field.value).getMinutes()) : selectedMinutes
|
|
8304
|
+
);
|
|
8280
8305
|
},
|
|
8281
|
-
|
|
8282
|
-
|
|
8306
|
+
children: [
|
|
8307
|
+
/* @__PURE__ */ jsx66(SelectTrigger, { id: "hours-select", className: "w-[70px]", children: /* @__PURE__ */ jsx66(SelectValue, {}) }),
|
|
8308
|
+
/* @__PURE__ */ jsx66(SelectContent, { children: hoursOptions.map((option) => /* @__PURE__ */ jsx66(SelectItem, { value: String(option.value), children: option.label }, option.value)) })
|
|
8309
|
+
]
|
|
8283
8310
|
}
|
|
8284
|
-
)
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
value: String(field.value ? new Date(field.value).getHours() : selectedHours),
|
|
8292
|
-
onValueChange: (value) => {
|
|
8293
|
-
if (!value) return;
|
|
8294
|
-
const hours = parseInt(value);
|
|
8295
|
-
setSelectedHours(hours);
|
|
8296
|
-
handleTimeChange(
|
|
8297
|
-
hours,
|
|
8298
|
-
field.value ? roundToNearestFiveMinutes(new Date(field.value).getMinutes()) : selectedMinutes
|
|
8299
|
-
);
|
|
8300
|
-
},
|
|
8301
|
-
children: [
|
|
8302
|
-
/* @__PURE__ */ jsx66(SelectTrigger, { id: "hours-select", className: "w-[70px]", children: /* @__PURE__ */ jsx66(SelectValue, {}) }),
|
|
8303
|
-
/* @__PURE__ */ jsx66(SelectContent, { children: hoursOptions.map((option) => /* @__PURE__ */ jsx66(SelectItem, { value: String(option.value), children: option.label }, option.value)) })
|
|
8304
|
-
]
|
|
8305
|
-
}
|
|
8306
|
-
)
|
|
8307
|
-
] }),
|
|
8308
|
-
/* @__PURE__ */ jsx66("div", { className: "mb-[9px] text-xl", children: ":" }),
|
|
8309
|
-
/* @__PURE__ */ jsxs36("div", { className: "flex flex-col space-y-2", children: [
|
|
8310
|
-
/* @__PURE__ */ jsx66(Label, { htmlFor: "minutes-select", children: t(`generic.minutes`) }),
|
|
8311
|
-
/* @__PURE__ */ jsxs36(
|
|
8312
|
-
Select,
|
|
8313
|
-
{
|
|
8314
|
-
value: String(
|
|
8315
|
-
field.value ? roundToNearestFiveMinutes(new Date(field.value).getMinutes()) : selectedMinutes
|
|
8316
|
-
),
|
|
8317
|
-
onValueChange: (value) => {
|
|
8318
|
-
if (!value) return;
|
|
8319
|
-
const minutes = parseInt(value);
|
|
8320
|
-
setSelectedMinutes(minutes);
|
|
8321
|
-
handleTimeChange(field.value ? new Date(field.value).getHours() : selectedHours, minutes);
|
|
8322
|
-
},
|
|
8323
|
-
children: [
|
|
8324
|
-
/* @__PURE__ */ jsx66(SelectTrigger, { id: "minutes-select", className: "w-[70px]", children: /* @__PURE__ */ jsx66(SelectValue, {}) }),
|
|
8325
|
-
/* @__PURE__ */ jsx66(SelectContent, { children: minutesOptions.map((option) => /* @__PURE__ */ jsx66(SelectItem, { value: String(option.value), children: option.label }, option.value)) })
|
|
8326
|
-
]
|
|
8327
|
-
}
|
|
8328
|
-
)
|
|
8329
|
-
] })
|
|
8330
|
-
] }),
|
|
8331
|
-
/* @__PURE__ */ jsx66(
|
|
8332
|
-
Button,
|
|
8311
|
+
)
|
|
8312
|
+
] }),
|
|
8313
|
+
/* @__PURE__ */ jsx66("div", { className: "mb-[9px] text-xl", children: ":" }),
|
|
8314
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex flex-col space-y-2", children: [
|
|
8315
|
+
/* @__PURE__ */ jsx66(Label, { htmlFor: "minutes-select", children: t(`common.minutes`) }),
|
|
8316
|
+
/* @__PURE__ */ jsxs36(
|
|
8317
|
+
Select,
|
|
8333
8318
|
{
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8319
|
+
value: String(
|
|
8320
|
+
field.value ? roundToNearestFiveMinutes(new Date(field.value).getMinutes()) : selectedMinutes
|
|
8321
|
+
),
|
|
8322
|
+
onValueChange: (value) => {
|
|
8323
|
+
if (!value) return;
|
|
8324
|
+
const minutes = parseInt(value);
|
|
8325
|
+
setSelectedMinutes(minutes);
|
|
8326
|
+
handleTimeChange(field.value ? new Date(field.value).getHours() : selectedHours, minutes);
|
|
8337
8327
|
},
|
|
8338
|
-
children:
|
|
8328
|
+
children: [
|
|
8329
|
+
/* @__PURE__ */ jsx66(SelectTrigger, { id: "minutes-select", className: "w-[70px]", children: /* @__PURE__ */ jsx66(SelectValue, {}) }),
|
|
8330
|
+
/* @__PURE__ */ jsx66(SelectContent, { children: minutesOptions.map((option) => /* @__PURE__ */ jsx66(SelectItem, { value: String(option.value), children: option.label }, option.value)) })
|
|
8331
|
+
]
|
|
8339
8332
|
}
|
|
8340
8333
|
)
|
|
8341
|
-
] })
|
|
8342
|
-
] })
|
|
8343
|
-
|
|
8344
|
-
|
|
8334
|
+
] })
|
|
8335
|
+
] }),
|
|
8336
|
+
/* @__PURE__ */ jsx66(
|
|
8337
|
+
Button,
|
|
8338
|
+
{
|
|
8339
|
+
className: "mt-2",
|
|
8340
|
+
onClick: () => {
|
|
8341
|
+
setOpen(false);
|
|
8342
|
+
},
|
|
8343
|
+
children: t(`ui.buttons.select_date`)
|
|
8344
|
+
}
|
|
8345
|
+
)
|
|
8346
|
+
] }) })
|
|
8347
|
+
] }) }) }) });
|
|
8345
8348
|
}
|
|
8346
8349
|
__name(FormDateTime, "FormDateTime");
|
|
8347
8350
|
|
|
@@ -8363,66 +8366,57 @@ function FormInput({
|
|
|
8363
8366
|
isRequired = false
|
|
8364
8367
|
}) {
|
|
8365
8368
|
const t = useTranslations10();
|
|
8366
|
-
return /* @__PURE__ */ jsx67("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx67(
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8373
|
-
children: (field) => {
|
|
8374
|
-
const handleBlur = /* @__PURE__ */ __name(async (e) => {
|
|
8375
|
-
let value = e.target.value;
|
|
8376
|
-
if (type === "link" && value) {
|
|
8377
|
-
if (!/^https?:\/\//i.test(value)) {
|
|
8378
|
-
value = "https://" + value;
|
|
8379
|
-
field.onChange(value);
|
|
8380
|
-
}
|
|
8381
|
-
try {
|
|
8382
|
-
new URL(value);
|
|
8383
|
-
form.clearErrors(id);
|
|
8384
|
-
} catch (error) {
|
|
8385
|
-
form.setError(id, {
|
|
8386
|
-
type: "validate",
|
|
8387
|
-
message: t(`generic.errors.valid_url`)
|
|
8388
|
-
});
|
|
8389
|
-
}
|
|
8390
|
-
}
|
|
8391
|
-
if (onBlur) await onBlur();
|
|
8392
|
-
field.onBlur();
|
|
8393
|
-
}, "handleBlur");
|
|
8394
|
-
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
8395
|
-
if (type === "number" || type === "currency") {
|
|
8396
|
-
const value = e.target.value.replace(/[^0-9]/g, "");
|
|
8397
|
-
field.onChange(+value);
|
|
8398
|
-
if (onChange) onChange(+value);
|
|
8399
|
-
} else {
|
|
8400
|
-
field.onChange(e.target.value);
|
|
8401
|
-
if (onChange) onChange(e.target.value);
|
|
8402
|
-
}
|
|
8403
|
-
}, "handleChange");
|
|
8404
|
-
const inputProps = {
|
|
8405
|
-
...field,
|
|
8406
|
-
autoFocus: autoFocus === true,
|
|
8407
|
-
type: type === "number" || type === "currency" ? "number" : type === "password" ? "password" : "text",
|
|
8408
|
-
className: `w-full ${type === "number" || type === "currency" ? "text-end" : ""}`,
|
|
8409
|
-
disabled: disabled === true || form.formState.isSubmitting,
|
|
8410
|
-
placeholder: placeholder || "",
|
|
8411
|
-
onBlur: handleBlur,
|
|
8412
|
-
onKeyDown,
|
|
8413
|
-
onChange: handleChange,
|
|
8414
|
-
"data-testid": testId
|
|
8415
|
-
};
|
|
8416
|
-
if (type === "currency") {
|
|
8417
|
-
return /* @__PURE__ */ jsxs37(InputGroup, { children: [
|
|
8418
|
-
/* @__PURE__ */ jsx67(InputGroupAddon, { children: /* @__PURE__ */ jsx67(InputGroupText, { children: "\u20AC" }) }),
|
|
8419
|
-
/* @__PURE__ */ jsx67(InputGroupInput, { ...inputProps })
|
|
8420
|
-
] });
|
|
8369
|
+
return /* @__PURE__ */ jsx67("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx67(FormFieldWrapper, { form, name: id, label: name, isRequired, children: (field) => {
|
|
8370
|
+
const handleBlur = /* @__PURE__ */ __name(async (e) => {
|
|
8371
|
+
let value = e.target.value;
|
|
8372
|
+
if (type === "link" && value) {
|
|
8373
|
+
if (!/^https?:\/\//i.test(value)) {
|
|
8374
|
+
value = "https://" + value;
|
|
8375
|
+
field.onChange(value);
|
|
8421
8376
|
}
|
|
8422
|
-
|
|
8377
|
+
try {
|
|
8378
|
+
new URL(value);
|
|
8379
|
+
form.clearErrors(id);
|
|
8380
|
+
} catch (error) {
|
|
8381
|
+
form.setError(id, {
|
|
8382
|
+
type: "validate",
|
|
8383
|
+
message: t(`common.errors.valid_url`)
|
|
8384
|
+
});
|
|
8385
|
+
}
|
|
8386
|
+
}
|
|
8387
|
+
if (onBlur) await onBlur();
|
|
8388
|
+
field.onBlur();
|
|
8389
|
+
}, "handleBlur");
|
|
8390
|
+
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
8391
|
+
if (type === "number" || type === "currency") {
|
|
8392
|
+
const value = e.target.value.replace(/[^0-9]/g, "");
|
|
8393
|
+
field.onChange(+value);
|
|
8394
|
+
if (onChange) onChange(+value);
|
|
8395
|
+
} else {
|
|
8396
|
+
field.onChange(e.target.value);
|
|
8397
|
+
if (onChange) onChange(e.target.value);
|
|
8423
8398
|
}
|
|
8399
|
+
}, "handleChange");
|
|
8400
|
+
const inputProps = {
|
|
8401
|
+
...field,
|
|
8402
|
+
autoFocus: autoFocus === true,
|
|
8403
|
+
type: type === "number" || type === "currency" ? "number" : type === "password" ? "password" : "text",
|
|
8404
|
+
className: `w-full ${type === "number" || type === "currency" ? "text-end" : ""}`,
|
|
8405
|
+
disabled: disabled === true || form.formState.isSubmitting,
|
|
8406
|
+
placeholder: placeholder || "",
|
|
8407
|
+
onBlur: handleBlur,
|
|
8408
|
+
onKeyDown,
|
|
8409
|
+
onChange: handleChange,
|
|
8410
|
+
"data-testid": testId
|
|
8411
|
+
};
|
|
8412
|
+
if (type === "currency") {
|
|
8413
|
+
return /* @__PURE__ */ jsxs37(InputGroup, { children: [
|
|
8414
|
+
/* @__PURE__ */ jsx67(InputGroupAddon, { children: /* @__PURE__ */ jsx67(InputGroupText, { children: "\u20AC" }) }),
|
|
8415
|
+
/* @__PURE__ */ jsx67(InputGroupInput, { ...inputProps })
|
|
8416
|
+
] });
|
|
8424
8417
|
}
|
|
8425
|
-
|
|
8418
|
+
return /* @__PURE__ */ jsx67(Input, { ...inputProps });
|
|
8419
|
+
} }) });
|
|
8426
8420
|
}
|
|
8427
8421
|
__name(FormInput, "FormInput");
|
|
8428
8422
|
|
|
@@ -8448,7 +8442,7 @@ var PasswordInput = React12.forwardRef(({ className, type, ...props }, ref) => {
|
|
|
8448
8442
|
disabled,
|
|
8449
8443
|
children: [
|
|
8450
8444
|
showPassword && !disabled ? /* @__PURE__ */ jsx68(EyeIcon, { className: "h-4 w-4", "aria-hidden": "true" }) : /* @__PURE__ */ jsx68(EyeOffIcon, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
8451
|
-
/* @__PURE__ */ jsx68("span", { className: "sr-only", children: showPassword ? t(`
|
|
8445
|
+
/* @__PURE__ */ jsx68("span", { className: "sr-only", children: showPassword ? t(`common.hide_password`) : t(`common.show_password`) })
|
|
8452
8446
|
]
|
|
8453
8447
|
}
|
|
8454
8448
|
),
|
|
@@ -8971,22 +8965,22 @@ function UserReactivatorInterface({ user, propagateChanges }) {
|
|
|
8971
8965
|
setOpen(false);
|
|
8972
8966
|
propagateChanges(updatedUser);
|
|
8973
8967
|
} catch (error) {
|
|
8974
|
-
errorToast({ title: t(`
|
|
8968
|
+
errorToast({ title: t(`common.errors.error`), error });
|
|
8975
8969
|
}
|
|
8976
8970
|
}, "reactivateUser");
|
|
8977
8971
|
return /* @__PURE__ */ jsxs46(Dialog, { open, onOpenChange: setOpen, children: [
|
|
8978
8972
|
/* @__PURE__ */ jsx78(DialogTrigger, { children: /* @__PURE__ */ jsxs46(Button, { size: "sm", children: [
|
|
8979
8973
|
/* @__PURE__ */ jsx78(UserCheckIcon, { className: "mr-3 h-3.5 w-3.5" }),
|
|
8980
|
-
t(`
|
|
8974
|
+
t(`user.buttons.reactivate`)
|
|
8981
8975
|
] }) }),
|
|
8982
8976
|
/* @__PURE__ */ jsxs46(DialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
8983
8977
|
/* @__PURE__ */ jsxs46(DialogHeader, { children: [
|
|
8984
|
-
/* @__PURE__ */ jsx78(DialogTitle, { children: t(`
|
|
8985
|
-
/* @__PURE__ */ jsx78(DialogDescription, { children: t(`
|
|
8978
|
+
/* @__PURE__ */ jsx78(DialogTitle, { children: t(`user.reactivate.title`) }),
|
|
8979
|
+
/* @__PURE__ */ jsx78(DialogDescription, { children: t(`user.reactivate.subtitle`) })
|
|
8986
8980
|
] }),
|
|
8987
|
-
t(`
|
|
8981
|
+
t(`user.reactivate.description`, { name: user.name }),
|
|
8988
8982
|
/* @__PURE__ */ jsxs46("div", { className: "flex justify-end", children: [
|
|
8989
|
-
/* @__PURE__ */ jsx78(Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`
|
|
8983
|
+
/* @__PURE__ */ jsx78(Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`ui.buttons.cancel`) }),
|
|
8990
8984
|
/* @__PURE__ */ jsx78(
|
|
8991
8985
|
Button,
|
|
8992
8986
|
{
|
|
@@ -8995,7 +8989,7 @@ function UserReactivatorInterface({ user, propagateChanges }) {
|
|
|
8995
8989
|
e.preventDefault();
|
|
8996
8990
|
reactivateUser();
|
|
8997
8991
|
},
|
|
8998
|
-
children: t(`
|
|
8992
|
+
children: t(`user.buttons.reactivate`)
|
|
8999
8993
|
}
|
|
9000
8994
|
)
|
|
9001
8995
|
] })
|
|
@@ -9023,26 +9017,26 @@ function UserResentInvitationEmailInternal({ user }) {
|
|
|
9023
9017
|
try {
|
|
9024
9018
|
await UserService.sendInvitation({ userId: user.id, companyId: user.company.id });
|
|
9025
9019
|
setOpen(false);
|
|
9026
|
-
toast4.message(t(`
|
|
9027
|
-
description: t(`
|
|
9020
|
+
toast4.message(t(`user.resend_activation.email_sent`), {
|
|
9021
|
+
description: t(`user.resend_activation.email_sent_description`, { email: user.email })
|
|
9028
9022
|
});
|
|
9029
9023
|
} catch (error) {
|
|
9030
|
-
errorToast({ title: t(`
|
|
9024
|
+
errorToast({ title: t(`common.errors.error`), error });
|
|
9031
9025
|
}
|
|
9032
9026
|
}, "sendInvitationEmail");
|
|
9033
9027
|
return /* @__PURE__ */ jsxs47(Dialog, { open, onOpenChange: setOpen, children: [
|
|
9034
9028
|
/* @__PURE__ */ jsxs47(Tooltip2, { children: [
|
|
9035
9029
|
/* @__PURE__ */ jsx79(TooltipTrigger, { children: /* @__PURE__ */ jsx79(DialogTrigger, { children: /* @__PURE__ */ jsx79(Button, { size: "sm", variant: `ghost`, className: "text-muted-foreground", children: /* @__PURE__ */ jsx79(MailIcon, {}) }) }) }),
|
|
9036
|
-
/* @__PURE__ */ jsx79(TooltipContent, { children: t(`
|
|
9030
|
+
/* @__PURE__ */ jsx79(TooltipContent, { children: t(`user.buttons.resend_activation`) })
|
|
9037
9031
|
] }),
|
|
9038
9032
|
/* @__PURE__ */ jsxs47(DialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
9039
9033
|
/* @__PURE__ */ jsxs47(DialogHeader, { children: [
|
|
9040
|
-
/* @__PURE__ */ jsx79(DialogTitle, { children: t(`
|
|
9041
|
-
/* @__PURE__ */ jsx79(DialogDescription, { children: t(`
|
|
9034
|
+
/* @__PURE__ */ jsx79(DialogTitle, { children: t(`user.resend_activation.title`) }),
|
|
9035
|
+
/* @__PURE__ */ jsx79(DialogDescription, { children: t(`user.resend_activation.subtitle`) })
|
|
9042
9036
|
] }),
|
|
9043
|
-
t(`
|
|
9037
|
+
t(`user.resend_activation.description`, { email: user.email }),
|
|
9044
9038
|
/* @__PURE__ */ jsxs47("div", { className: "flex justify-end", children: [
|
|
9045
|
-
/* @__PURE__ */ jsx79(Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`
|
|
9039
|
+
/* @__PURE__ */ jsx79(Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`ui.buttons.cancel`) }),
|
|
9046
9040
|
/* @__PURE__ */ jsx79(
|
|
9047
9041
|
Button,
|
|
9048
9042
|
{
|
|
@@ -9051,7 +9045,7 @@ function UserResentInvitationEmailInternal({ user }) {
|
|
|
9051
9045
|
e.preventDefault();
|
|
9052
9046
|
sendInvitationEmail();
|
|
9053
9047
|
},
|
|
9054
|
-
children: t(`
|
|
9048
|
+
children: t(`user.buttons.resend_activation`)
|
|
9055
9049
|
}
|
|
9056
9050
|
)
|
|
9057
9051
|
] })
|
|
@@ -9164,70 +9158,61 @@ function UserSelector({ id, form, label, placeholder, onChange, isRequired = fal
|
|
|
9164
9158
|
setOpen(false);
|
|
9165
9159
|
}, 0);
|
|
9166
9160
|
}, "setUser");
|
|
9167
|
-
return /* @__PURE__ */ jsx81("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx81(
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9161
|
+
return /* @__PURE__ */ jsx81("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx81(FormFieldWrapper, { form, name: id, label, isRequired, children: (field) => /* @__PURE__ */ jsxs49(Popover, { open, onOpenChange: setOpen, modal: true, children: [
|
|
9162
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex w-full flex-row items-center justify-between", children: [
|
|
9163
|
+
/* @__PURE__ */ jsx81(PopoverTrigger, { className: "w-full", children: /* @__PURE__ */ jsx81("div", { className: "flex w-full flex-row items-center justify-start rounded-md", children: field.value ? /* @__PURE__ */ jsx81(Fragment6, { children: /* @__PURE__ */ jsxs49("div", { className: "flex w-full flex-row items-center justify-start rounded-md border p-2", children: [
|
|
9164
|
+
/* @__PURE__ */ jsx81("div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ jsxs49(Avatar, { className: `mr-2 h-6 w-6`, children: [
|
|
9165
|
+
/* @__PURE__ */ jsx81(AvatarImage, { src: field.value?.avatar }),
|
|
9166
|
+
/* @__PURE__ */ jsx81(AvatarFallback, { children: field.value?.name ? field.value?.name.split(" ").map((name) => name.charAt(0).toUpperCase()) : "X" })
|
|
9167
|
+
] }) }),
|
|
9168
|
+
/* @__PURE__ */ jsx81("span", { className: "", children: field.value?.name ?? "" })
|
|
9169
|
+
] }) }) : /* @__PURE__ */ jsx81("div", { className: "text-muted-foreground mr-7 flex h-10 w-full flex-row items-center justify-start rounded-md border p-2 text-sm", children: placeholder ?? t(`ui.search.placeholder`, { type: t(`entities.users`, { count: 1 }) }) }) }) }),
|
|
9170
|
+
field.value && /* @__PURE__ */ jsx81(
|
|
9171
|
+
CircleX,
|
|
9172
|
+
{
|
|
9173
|
+
className: "text-muted hover:text-destructive ml-2 h-6 w-6 cursor-pointer",
|
|
9174
|
+
onClick: () => setUser()
|
|
9175
|
+
}
|
|
9176
|
+
)
|
|
9177
|
+
] }),
|
|
9178
|
+
/* @__PURE__ */ jsx81(PopoverContent, { children: /* @__PURE__ */ jsxs49(Command, { shouldFilter: false, children: [
|
|
9179
|
+
/* @__PURE__ */ jsxs49("div", { className: "relative mb-2 w-full", children: [
|
|
9180
|
+
/* @__PURE__ */ jsx81(SearchIcon2, { className: "text-muted-foreground absolute top-2.5 left-2.5 h-4 w-4" }),
|
|
9181
|
+
/* @__PURE__ */ jsx81(
|
|
9182
|
+
Input,
|
|
9183
|
+
{
|
|
9184
|
+
placeholder: t(`ui.search.placeholder`, { type: t(`entities.users`, { count: 1 }) }),
|
|
9185
|
+
type: "text",
|
|
9186
|
+
className: "w-full pr-8 pl-8",
|
|
9187
|
+
onChange: (e) => setSearchTerm(e.target.value),
|
|
9188
|
+
value: searchTerm
|
|
9189
|
+
}
|
|
9190
|
+
),
|
|
9191
|
+
isSearching ? /* @__PURE__ */ jsx81(RefreshCwIcon, { className: "text-muted-foreground absolute top-2.5 right-2.5 h-4 w-4 animate-spin" }) : searchTermRef.current ? /* @__PURE__ */ jsx81(
|
|
9192
|
+
XIcon5,
|
|
9193
|
+
{
|
|
9194
|
+
className: `absolute top-2.5 right-2.5 h-4 w-4 ${searchTermRef.current ? "cursor-pointer" : "text-muted-foreground"}`,
|
|
9195
|
+
onClick: () => {
|
|
9196
|
+
setSearchTerm("");
|
|
9197
|
+
search("");
|
|
9188
9198
|
}
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
{
|
|
9207
|
-
className: `absolute top-2.5 right-2.5 h-4 w-4 ${searchTermRef.current ? "cursor-pointer" : "text-muted-foreground"}`,
|
|
9208
|
-
onClick: () => {
|
|
9209
|
-
setSearchTerm("");
|
|
9210
|
-
search("");
|
|
9211
|
-
}
|
|
9212
|
-
}
|
|
9213
|
-
) : /* @__PURE__ */ jsx81(Fragment6, {})
|
|
9214
|
-
] }),
|
|
9215
|
-
/* @__PURE__ */ jsx81(CommandList, { children: data.data && data.data.length > 0 && data.data.map((user) => /* @__PURE__ */ jsxs49(
|
|
9216
|
-
CommandItem,
|
|
9217
|
-
{
|
|
9218
|
-
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
9219
|
-
onSelect: () => setUser(user),
|
|
9220
|
-
children: [
|
|
9221
|
-
/* @__PURE__ */ jsx81(UserAvatar, { user, className: `mr-2 h-4 w-4` }),
|
|
9222
|
-
/* @__PURE__ */ jsx81("span", { className: "", children: user.name })
|
|
9223
|
-
]
|
|
9224
|
-
},
|
|
9225
|
-
user.id
|
|
9226
|
-
)) })
|
|
9227
|
-
] }) })
|
|
9228
|
-
] })
|
|
9229
|
-
}
|
|
9230
|
-
) });
|
|
9199
|
+
}
|
|
9200
|
+
) : /* @__PURE__ */ jsx81(Fragment6, {})
|
|
9201
|
+
] }),
|
|
9202
|
+
/* @__PURE__ */ jsx81(CommandList, { children: data.data && data.data.length > 0 && data.data.map((user) => /* @__PURE__ */ jsxs49(
|
|
9203
|
+
CommandItem,
|
|
9204
|
+
{
|
|
9205
|
+
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
9206
|
+
onSelect: () => setUser(user),
|
|
9207
|
+
children: [
|
|
9208
|
+
/* @__PURE__ */ jsx81(UserAvatar, { user, className: `mr-2 h-4 w-4` }),
|
|
9209
|
+
/* @__PURE__ */ jsx81("span", { className: "", children: user.name })
|
|
9210
|
+
]
|
|
9211
|
+
},
|
|
9212
|
+
user.id
|
|
9213
|
+
)) })
|
|
9214
|
+
] }) })
|
|
9215
|
+
] }) }) });
|
|
9231
9216
|
}
|
|
9232
9217
|
__name(UserSelector, "UserSelector");
|
|
9233
9218
|
|
|
@@ -9245,28 +9230,28 @@ var UserProvider = /* @__PURE__ */ __name(({ children, dehydratedUser }) => {
|
|
|
9245
9230
|
const response = [];
|
|
9246
9231
|
if (hasPermissionToModule({ module: Modules.User, action: "update" /* Update */ })) {
|
|
9247
9232
|
response.push({
|
|
9248
|
-
name: t(`
|
|
9233
|
+
name: t(`common.settings`),
|
|
9249
9234
|
href: generateUrl({ page: `/settings` })
|
|
9250
9235
|
});
|
|
9251
9236
|
response.push({
|
|
9252
|
-
name: t(`
|
|
9237
|
+
name: t(`entities.users`, { count: 2 }),
|
|
9253
9238
|
href: generateUrl({ page: `/settings`, id: Modules.User.pageUrl })
|
|
9254
9239
|
});
|
|
9255
9240
|
}
|
|
9256
9241
|
if (user)
|
|
9257
9242
|
response.push({
|
|
9258
|
-
name: `${user.name}${user.isDeleted ? ` (${t(`
|
|
9243
|
+
name: `${user.name}${user.isDeleted ? ` (${t(`user.deleted`)})` : ""}`,
|
|
9259
9244
|
href: generateUrl({ page: Modules.User, id: user.id })
|
|
9260
9245
|
});
|
|
9261
9246
|
return response;
|
|
9262
9247
|
}, "breadcrumb");
|
|
9263
9248
|
const title = /* @__PURE__ */ __name(() => {
|
|
9264
9249
|
const response = {
|
|
9265
|
-
type: t(`
|
|
9250
|
+
type: t(`entities.users`, { count: user ? 1 : 2 })
|
|
9266
9251
|
};
|
|
9267
9252
|
const functions = [];
|
|
9268
9253
|
if (user) {
|
|
9269
|
-
response.element = `${user.name}${user.isDeleted ? ` (${t(`
|
|
9254
|
+
response.element = `${user.name}${user.isDeleted ? ` (${t(`user.deleted`)})` : ""}`;
|
|
9270
9255
|
if (user.isDeleted) {
|
|
9271
9256
|
functions.push(/* @__PURE__ */ jsx82(UserReactivator, { user, propagateChanges: setUser }, `UserReactivator`));
|
|
9272
9257
|
} else {
|
|
@@ -9311,7 +9296,7 @@ function UserDetails({ user }) {
|
|
|
9311
9296
|
const { title } = useSharedContext();
|
|
9312
9297
|
let roles = /* @__PURE__ */ jsx83(Fragment7, {});
|
|
9313
9298
|
if (user.roles && user.roles.length > 0) {
|
|
9314
|
-
roles = /* @__PURE__ */ jsx83("div", { className: "mb-4 w-full", children: /* @__PURE__ */ jsx83("div", { className: "flex flex-wrap gap-2", children: user.roles.map((role, index) => /* @__PURE__ */ jsx83(Link, { href: generateUrl({ page: Modules.Role, id: role.id }), children: /* @__PURE__ */ jsx83(Badge, { className: "mr-2", variant: `default`, children: t(`
|
|
9299
|
+
roles = /* @__PURE__ */ jsx83("div", { className: "mb-4 w-full", children: /* @__PURE__ */ jsx83("div", { className: "flex flex-wrap gap-2", children: user.roles.map((role, index) => /* @__PURE__ */ jsx83(Link, { href: generateUrl({ page: Modules.Role, id: role.id }), children: /* @__PURE__ */ jsx83(Badge, { className: "mr-2", variant: `default`, children: t(`role.roles`, { role: role.id.replaceAll(`-`, ``) }) }) }, role.id)) }) });
|
|
9315
9300
|
}
|
|
9316
9301
|
return /* @__PURE__ */ jsxs50("div", { className: "flex w-full flex-col gap-y-2", children: [
|
|
9317
9302
|
user.avatar && /* @__PURE__ */ jsx83("div", { className: "relative aspect-auto w-full max-w-md overflow-hidden rounded-lg", children: /* @__PURE__ */ jsx83(
|
|
@@ -9325,11 +9310,11 @@ function UserDetails({ user }) {
|
|
|
9325
9310
|
}
|
|
9326
9311
|
) }),
|
|
9327
9312
|
/* @__PURE__ */ jsx83(ContentTitle, { module: Modules.User, type: title.type, element: title.element, functions: title.functions }),
|
|
9328
|
-
user.isDeleted ? /* @__PURE__ */ jsx83("div", { children: /* @__PURE__ */ jsx83(Badge, { variant: "destructive", children: t(`
|
|
9313
|
+
user.isDeleted ? /* @__PURE__ */ jsx83("div", { children: /* @__PURE__ */ jsx83(Badge, { variant: "destructive", children: t(`user.errors.deleted`) }) }) : /* @__PURE__ */ jsx83(Fragment7, { children: !user.isActivated && /* @__PURE__ */ jsx83("div", { children: /* @__PURE__ */ jsx83(Badge, { variant: "destructive", children: t(`user.errors.inactive`) }) }) }),
|
|
9329
9314
|
roles,
|
|
9330
|
-
/* @__PURE__ */ jsx83(AttributeElement, { inline: true, title: t(`
|
|
9331
|
-
/* @__PURE__ */ jsx83(AttributeElement, { inline: true, title: t(`
|
|
9332
|
-
/* @__PURE__ */ jsx83(AttributeElement, { inline: false, title: t(`
|
|
9315
|
+
/* @__PURE__ */ jsx83(AttributeElement, { inline: true, title: t(`user.fields.title.label`), value: user.title }),
|
|
9316
|
+
/* @__PURE__ */ jsx83(AttributeElement, { inline: true, title: t(`common.fields.email.label`), value: user.email }),
|
|
9317
|
+
/* @__PURE__ */ jsx83(AttributeElement, { inline: false, title: t(`user.fields.bio.label`), value: user.bio })
|
|
9333
9318
|
] });
|
|
9334
9319
|
}
|
|
9335
9320
|
__name(UserDetails, "UserDetails");
|
|
@@ -9381,13 +9366,13 @@ function UsersListContainerInternal() {
|
|
|
9381
9366
|
if (!hasPermissionToModule({ module: Modules.User, action: "delete" /* Delete */ })) return /* @__PURE__ */ jsx87(CompanyUsersList, {});
|
|
9382
9367
|
const tabs = [
|
|
9383
9368
|
{
|
|
9384
|
-
label: t(`
|
|
9369
|
+
label: t(`entities.users`, { count: 2 }),
|
|
9385
9370
|
content: /* @__PURE__ */ jsx87(CompanyUsersList, {}),
|
|
9386
9371
|
modules: [Modules.Company],
|
|
9387
9372
|
action: "read" /* Read */
|
|
9388
9373
|
},
|
|
9389
9374
|
{
|
|
9390
|
-
label: t(`
|
|
9375
|
+
label: t(`user.deleted`),
|
|
9391
9376
|
content: /* @__PURE__ */ jsx87(CompanyUsersList, { isDeleted: true }),
|
|
9392
9377
|
modules: [Modules.Company],
|
|
9393
9378
|
action: "update" /* Update */
|
|
@@ -9414,7 +9399,7 @@ function AdminUsersListInternal({ company }) {
|
|
|
9414
9399
|
return /* @__PURE__ */ jsx88(
|
|
9415
9400
|
ContentListTable,
|
|
9416
9401
|
{
|
|
9417
|
-
title: t(`
|
|
9402
|
+
title: t(`entities.users`, { count: 2 }),
|
|
9418
9403
|
data,
|
|
9419
9404
|
fields: ["name" /* name */, "email" /* email */, "createdAt" /* createdAt */],
|
|
9420
9405
|
tableGeneratorType: Modules.User,
|
|
@@ -9456,7 +9441,7 @@ function CompanyUsersList({ isDeleted }) {
|
|
|
9456
9441
|
fields: ["name" /* name */, "email" /* email */],
|
|
9457
9442
|
tableGeneratorType: Modules.User,
|
|
9458
9443
|
functions,
|
|
9459
|
-
title: t(`
|
|
9444
|
+
title: t(`entities.users`, { count: 2 })
|
|
9460
9445
|
}
|
|
9461
9446
|
);
|
|
9462
9447
|
}
|
|
@@ -9505,7 +9490,7 @@ function RelevantUsersList({ id }) {
|
|
|
9505
9490
|
data,
|
|
9506
9491
|
fields: ["name" /* name */, "email" /* email */, "relevance" /* relevance */],
|
|
9507
9492
|
tableGeneratorType: Modules.User,
|
|
9508
|
-
title: t(`
|
|
9493
|
+
title: t(`common.relevant_users`)
|
|
9509
9494
|
}
|
|
9510
9495
|
);
|
|
9511
9496
|
}
|
|
@@ -9527,7 +9512,7 @@ function RoleUsersList({ role }) {
|
|
|
9527
9512
|
data,
|
|
9528
9513
|
fields: ["name" /* name */, "email" /* email */],
|
|
9529
9514
|
tableGeneratorType: Modules.User,
|
|
9530
|
-
title: t(`
|
|
9515
|
+
title: t(`entities.users`, { count: 2 })
|
|
9531
9516
|
}
|
|
9532
9517
|
);
|
|
9533
9518
|
}
|
|
@@ -9577,7 +9562,7 @@ function UsersList({ data, optionComponents, removeFunction, hideOptions, showRe
|
|
|
9577
9562
|
data,
|
|
9578
9563
|
fields: ["name" /* name */, "email" /* email */],
|
|
9579
9564
|
tableGeneratorType: Modules.User,
|
|
9580
|
-
title: t(`
|
|
9565
|
+
title: t(`entities.users`, { count: 2 })
|
|
9581
9566
|
}
|
|
9582
9567
|
);
|
|
9583
9568
|
}
|
|
@@ -9599,7 +9584,7 @@ function UsersListByContentIds({ contentIds }) {
|
|
|
9599
9584
|
data,
|
|
9600
9585
|
fields: ["name" /* name */, "email" /* email */],
|
|
9601
9586
|
tableGeneratorType: Modules.User,
|
|
9602
|
-
title: t(`
|
|
9587
|
+
title: t(`common.relevant_users`)
|
|
9603
9588
|
}
|
|
9604
9589
|
);
|
|
9605
9590
|
}
|
|
@@ -9702,11 +9687,11 @@ function TokenStatusIndicator({ className, size = "md", showExtraPages = true })
|
|
|
9702
9687
|
}
|
|
9703
9688
|
}, "getStatusColor");
|
|
9704
9689
|
const tooltipContent = /* @__PURE__ */ jsxs57("div", { className: "flex flex-col gap-2 p-1", children: [
|
|
9705
|
-
/* @__PURE__ */ jsx99("div", { className: "font-semibold text-sm", children: t("
|
|
9690
|
+
/* @__PURE__ */ jsx99("div", { className: "font-semibold text-sm", children: t("billing.tokens.status", { defaultValue: "Page Status" }) }),
|
|
9706
9691
|
/* @__PURE__ */ jsxs57("div", { className: "flex flex-col gap-1 text-xs", children: [
|
|
9707
9692
|
/* @__PURE__ */ jsxs57("div", { className: "flex items-center justify-between gap-4", children: [
|
|
9708
9693
|
/* @__PURE__ */ jsxs57("span", { className: "text-muted-foreground", children: [
|
|
9709
|
-
t("
|
|
9694
|
+
t("billing.tokens.monthly", { defaultValue: "Monthly Pages" }),
|
|
9710
9695
|
":"
|
|
9711
9696
|
] }),
|
|
9712
9697
|
/* @__PURE__ */ jsxs57("span", { className: cn("font-medium", getStatusColor()), children: [
|
|
@@ -9717,7 +9702,7 @@ function TokenStatusIndicator({ className, size = "md", showExtraPages = true })
|
|
|
9717
9702
|
] }),
|
|
9718
9703
|
/* @__PURE__ */ jsxs57("div", { className: "flex items-center justify-between gap-4", children: [
|
|
9719
9704
|
/* @__PURE__ */ jsxs57("span", { className: "text-muted-foreground", children: [
|
|
9720
|
-
t("
|
|
9705
|
+
t("billing.tokens.available", { defaultValue: "Available" }),
|
|
9721
9706
|
":"
|
|
9722
9707
|
] }),
|
|
9723
9708
|
/* @__PURE__ */ jsxs57("span", { className: cn("font-medium", getStatusColor()), children: [
|
|
@@ -9725,16 +9710,16 @@ function TokenStatusIndicator({ className, size = "md", showExtraPages = true })
|
|
|
9725
9710
|
"%"
|
|
9726
9711
|
] })
|
|
9727
9712
|
] }),
|
|
9728
|
-
/* @__PURE__ */ jsx99(Link2, { href: "/settings/billing?action=subscribe", className: "w-full flex justify-end my-4", children: /* @__PURE__ */ jsx99(Button, { variant: "outline", size: "sm", children: t("
|
|
9713
|
+
/* @__PURE__ */ jsx99(Link2, { href: "/settings/billing?action=subscribe", className: "w-full flex justify-end my-4", children: /* @__PURE__ */ jsx99(Button, { variant: "outline", size: "sm", children: t("billing.tokens.upgrade_plan", { defaultValue: "Upgrade plan" }) }) }),
|
|
9729
9714
|
/* @__PURE__ */ jsx99(Separator, {}),
|
|
9730
9715
|
/* @__PURE__ */ jsxs57("div", { className: "flex items-center justify-between gap-4 pt-1 mt-1", children: [
|
|
9731
9716
|
/* @__PURE__ */ jsxs57("span", { className: "text-muted-foreground", children: [
|
|
9732
|
-
t("
|
|
9717
|
+
t("billing.tokens.available_extra", { defaultValue: "Extra Pages" }),
|
|
9733
9718
|
":"
|
|
9734
9719
|
] }),
|
|
9735
9720
|
/* @__PURE__ */ jsx99("span", { className: "font-medium text-blue-500", children: availableExtraTokens })
|
|
9736
9721
|
] }),
|
|
9737
|
-
/* @__PURE__ */ jsx99(Link2, { href: "/settings/billing?action=subscribe", className: "w-full flex justify-end my-4", children: /* @__PURE__ */ jsx99(Button, { variant: "outline", size: "sm", children: t("
|
|
9722
|
+
/* @__PURE__ */ jsx99(Link2, { href: "/settings/billing?action=subscribe", className: "w-full flex justify-end my-4", children: /* @__PURE__ */ jsx99(Button, { variant: "outline", size: "sm", children: t("billing.tokens.purchase_extra", { defaultValue: "Purchase additional analysis" }) }) })
|
|
9738
9723
|
] })
|
|
9739
9724
|
] });
|
|
9740
9725
|
return /* @__PURE__ */ jsxs57(Tooltip2, { children: [
|
|
@@ -9742,7 +9727,7 @@ function TokenStatusIndicator({ className, size = "md", showExtraPages = true })
|
|
|
9742
9727
|
"div",
|
|
9743
9728
|
{
|
|
9744
9729
|
className: cn("inline-flex items-center gap-1.5 cursor-default", className),
|
|
9745
|
-
"aria-label": t("
|
|
9730
|
+
"aria-label": t("billing.tokens.status", { defaultValue: "Page Status" }),
|
|
9746
9731
|
children: [
|
|
9747
9732
|
getBatteryIcon(),
|
|
9748
9733
|
/* @__PURE__ */ jsx99("span", { className: cn(textSize, "text-muted-foreground font-medium"), children: availableMonthlyTokens }),
|
|
@@ -9877,7 +9862,7 @@ function CompanyConfigurationEditorInternal({ company }) {
|
|
|
9877
9862
|
close();
|
|
9878
9863
|
} catch (error) {
|
|
9879
9864
|
errorToast({
|
|
9880
|
-
title: t(`
|
|
9865
|
+
title: t(`common.errors.update`),
|
|
9881
9866
|
error
|
|
9882
9867
|
});
|
|
9883
9868
|
}
|
|
@@ -9886,7 +9871,7 @@ function CompanyConfigurationEditorInternal({ company }) {
|
|
|
9886
9871
|
/* @__PURE__ */ jsx101(DialogTrigger, { children: /* @__PURE__ */ jsx101(Button, { size: "sm", variant: `ghost`, className: "cursor-pointer", children: /* @__PURE__ */ jsx101(Settings2Icon, { className: "h-3.5 w-3.5" }) }) }),
|
|
9887
9872
|
/* @__PURE__ */ jsxs58(DialogContent, { className: `flex max-h-[70vh] max-w-4xl flex-col overflow-y-auto`, children: [
|
|
9888
9873
|
/* @__PURE__ */ jsxs58(DialogHeader, { children: [
|
|
9889
|
-
/* @__PURE__ */ jsx101(DialogTitle, { children: t(`
|
|
9874
|
+
/* @__PURE__ */ jsx101(DialogTitle, { children: t(`entities.configuration`, { count: 2 }) }),
|
|
9890
9875
|
/* @__PURE__ */ jsx101(DialogDescription, { className: "text-destructive", children: t(`features.configuration.warning_description`) })
|
|
9891
9876
|
] }),
|
|
9892
9877
|
/* @__PURE__ */ jsx101(Form, { ...form, children: /* @__PURE__ */ jsxs58("form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
|
|
@@ -9925,33 +9910,33 @@ function CompanyDeleterInternal({ company }) {
|
|
|
9925
9910
|
await CompanyService.delete({ companyId: company.id });
|
|
9926
9911
|
router.push("/");
|
|
9927
9912
|
} catch (error) {
|
|
9928
|
-
errorToast({ title: t(`
|
|
9913
|
+
errorToast({ title: t(`common.errors.delete`), error });
|
|
9929
9914
|
}
|
|
9930
9915
|
setIsDeleting(false);
|
|
9931
9916
|
}, "handleDelete");
|
|
9932
9917
|
return /* @__PURE__ */ jsxs59(AlertDialog, { open, onOpenChange: setOpen, children: [
|
|
9933
9918
|
/* @__PURE__ */ jsx102(AlertDialogTrigger, { children: /* @__PURE__ */ jsxs59(Button, { size: "sm", variant: "destructive", children: [
|
|
9934
9919
|
/* @__PURE__ */ jsx102(Trash2Icon2, { className: "mr-3 h-3.5 w-3.5" }),
|
|
9935
|
-
t(`
|
|
9920
|
+
t(`ui.buttons.delete`)
|
|
9936
9921
|
] }) }),
|
|
9937
9922
|
/* @__PURE__ */ jsxs59(AlertDialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
9938
9923
|
/* @__PURE__ */ jsxs59(AlertDialogHeader, { children: [
|
|
9939
|
-
/* @__PURE__ */ jsx102(AlertDialogTitle, { children: t(`
|
|
9940
|
-
/* @__PURE__ */ jsx102(AlertDialogDescription, { children: t(`
|
|
9924
|
+
/* @__PURE__ */ jsx102(AlertDialogTitle, { children: t(`common.delete.title`, { type: t(`entities.companies`, { count: 1 }) }) }),
|
|
9925
|
+
/* @__PURE__ */ jsx102(AlertDialogDescription, { children: t(`common.delete.subtitle`, { type: t(`entities.companies`, { count: 1 }) }) })
|
|
9941
9926
|
] }),
|
|
9942
|
-
/* @__PURE__ */ jsx102("div", { className: "text-destructive p-4 text-sm", children: t(`
|
|
9927
|
+
/* @__PURE__ */ jsx102("div", { className: "text-destructive p-4 text-sm", children: t(`common.delete.description`, { type: t(`entities.companies`, { count: 1 }) }) }),
|
|
9943
9928
|
/* @__PURE__ */ jsxs59("div", { className: "flex w-full flex-col gap-y-2", children: [
|
|
9944
|
-
/* @__PURE__ */ jsx102("div", { children: t(`
|
|
9929
|
+
/* @__PURE__ */ jsx102("div", { children: t(`common.delete.confirmation`, { type: t(`entities.companies`, { count: 1 }) }) }),
|
|
9945
9930
|
/* @__PURE__ */ jsxs59("div", { className: "flex w-full flex-col", children: [
|
|
9946
9931
|
/* @__PURE__ */ jsxs59(Label, { className: "flex items-center", children: [
|
|
9947
|
-
t(`
|
|
9932
|
+
t(`company.fields.name.label`),
|
|
9948
9933
|
/* @__PURE__ */ jsx102("span", { className: "text-destructive ml-2 font-semibold", children: "*" })
|
|
9949
9934
|
] }),
|
|
9950
9935
|
/* @__PURE__ */ jsx102(
|
|
9951
9936
|
Input,
|
|
9952
9937
|
{
|
|
9953
9938
|
className: `w-full`,
|
|
9954
|
-
placeholder: t(`
|
|
9939
|
+
placeholder: t(`company.fields.name.placeholder`),
|
|
9955
9940
|
onChange: (e) => setCompanyName(e.target.value)
|
|
9956
9941
|
}
|
|
9957
9942
|
)
|
|
@@ -9966,7 +9951,7 @@ function CompanyDeleterInternal({ company }) {
|
|
|
9966
9951
|
type: `button`,
|
|
9967
9952
|
onClick: () => setOpen(false),
|
|
9968
9953
|
disabled: isDeleting,
|
|
9969
|
-
children: t(`
|
|
9954
|
+
children: t(`ui.buttons.cancel`)
|
|
9970
9955
|
}
|
|
9971
9956
|
),
|
|
9972
9957
|
/* @__PURE__ */ jsx102(
|
|
@@ -9980,9 +9965,9 @@ function CompanyDeleterInternal({ company }) {
|
|
|
9980
9965
|
variant: "destructive",
|
|
9981
9966
|
disabled: company.name !== companyName || isDeleting,
|
|
9982
9967
|
children: isDeleting ? /* @__PURE__ */ jsxs59(Fragment10, { children: [
|
|
9983
|
-
t(`
|
|
9968
|
+
t(`ui.buttons.is_deleting`),
|
|
9984
9969
|
/* @__PURE__ */ jsx102(LoaderCircleIcon2, { className: "animate-spin-slow h-5 w-5" })
|
|
9985
|
-
] }) : t(`
|
|
9970
|
+
] }) : t(`ui.buttons.delete`)
|
|
9986
9971
|
}
|
|
9987
9972
|
)
|
|
9988
9973
|
] })
|
|
@@ -10022,7 +10007,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
10022
10007
|
const formSchema = z3.object({
|
|
10023
10008
|
id: z3.uuidv4(),
|
|
10024
10009
|
name: z3.string().min(1, {
|
|
10025
|
-
message: t(`
|
|
10010
|
+
message: t(`company.fields.name.error`)
|
|
10026
10011
|
}),
|
|
10027
10012
|
featureIds: z3.array(z3.string()).optional(),
|
|
10028
10013
|
moduleIds: z3.array(z3.string()).optional(),
|
|
@@ -10072,7 +10057,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
10072
10057
|
}
|
|
10073
10058
|
} catch (error) {
|
|
10074
10059
|
errorToast({
|
|
10075
|
-
title: company ? t(`
|
|
10060
|
+
title: company ? t(`common.errors.update`) : t(`common.errors.create`),
|
|
10076
10061
|
error
|
|
10077
10062
|
});
|
|
10078
10063
|
}
|
|
@@ -10130,7 +10115,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
10130
10115
|
{
|
|
10131
10116
|
className: `flex max-h-[70vh] w-full ${isAdministrator || canAccessFeatures ? `max-w-5xl` : `max-w-4xl`} flex-col overflow-y-auto`,
|
|
10132
10117
|
children: [
|
|
10133
|
-
/* @__PURE__ */ jsx103(CommonEditorHeader, { type: t(`
|
|
10118
|
+
/* @__PURE__ */ jsx103(CommonEditorHeader, { type: t(`entities.companies`, { count: 1 }), name: company?.name }),
|
|
10134
10119
|
/* @__PURE__ */ jsx103(Form, { ...form, children: /* @__PURE__ */ jsxs60("form", { onSubmit: form.handleSubmit(onSubmit), className: `flex w-full flex-col gap-y-4`, children: [
|
|
10135
10120
|
/* @__PURE__ */ jsxs60("div", { className: "flex w-full items-start justify-between gap-x-4", children: [
|
|
10136
10121
|
/* @__PURE__ */ jsx103("div", { className: `flex w-96 flex-col justify-start gap-y-4`, children: /* @__PURE__ */ jsx103(FileUploader, { value: files, onValueChange: setFiles, dropzoneOptions: dropzone2, className: "w-full p-4", children: /* @__PURE__ */ jsx103(FileInput, { className: "text-neutral-300 outline-dashed", children: /* @__PURE__ */ jsx103("div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: /* @__PURE__ */ jsx103("div", { className: "flex w-full flex-col items-center justify-center pt-3 pb-4", children: file || company?.logo ? /* @__PURE__ */ jsx103(
|
|
@@ -10143,25 +10128,18 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }) {
|
|
|
10143
10128
|
}
|
|
10144
10129
|
) : /* @__PURE__ */ jsxs60(Fragment11, { children: [
|
|
10145
10130
|
/* @__PURE__ */ jsx103(UploadIcon3, { className: "my-4 h-8 w-8" }),
|
|
10146
|
-
/* @__PURE__ */ jsx103("p", { className: "mb-1 flex w-full text-center text-sm", children: t(`
|
|
10131
|
+
/* @__PURE__ */ jsx103("p", { className: "mb-1 flex w-full text-center text-sm", children: t(`company.click_drag_logo`) })
|
|
10147
10132
|
] }) }) }) }) }) }),
|
|
10148
10133
|
/* @__PURE__ */ jsx103("div", { className: `flex w-full flex-col justify-start gap-y-4`, children: /* @__PURE__ */ jsx103(
|
|
10149
10134
|
FormInput,
|
|
10150
10135
|
{
|
|
10151
10136
|
form,
|
|
10152
10137
|
id: "name",
|
|
10153
|
-
name: t(`
|
|
10154
|
-
placeholder: t(`
|
|
10138
|
+
name: t(`company.fields.name.label`),
|
|
10139
|
+
placeholder: t(`company.fields.name.placeholder`)
|
|
10155
10140
|
}
|
|
10156
10141
|
) }),
|
|
10157
|
-
canAccessFeatures && /* @__PURE__ */ jsx103("div", { className: `flex w-96 flex-col justify-start gap-y-4`, children: /* @__PURE__ */ jsx103(ScrollArea, { className: "h-max", children: /* @__PURE__ */ jsx103(
|
|
10158
|
-
FormFeatures,
|
|
10159
|
-
{
|
|
10160
|
-
form,
|
|
10161
|
-
name: t(`foundations.company.features_and_modules`),
|
|
10162
|
-
features
|
|
10163
|
-
}
|
|
10164
|
-
) }) })
|
|
10142
|
+
canAccessFeatures && /* @__PURE__ */ jsx103("div", { className: `flex w-96 flex-col justify-start gap-y-4`, children: /* @__PURE__ */ jsx103(ScrollArea, { className: "h-max", children: /* @__PURE__ */ jsx103(FormFeatures, { form, name: t(`company.features_and_modules`), features }) }) })
|
|
10165
10143
|
] }),
|
|
10166
10144
|
/* @__PURE__ */ jsx103(CommonEditorButtons, { form, setOpen, isEdit: !!company })
|
|
10167
10145
|
] }) })
|
|
@@ -10194,7 +10172,7 @@ function CompaniesList() {
|
|
|
10194
10172
|
fields: ["name" /* name */, "createdAt" /* createdAt */],
|
|
10195
10173
|
tableGeneratorType: Modules.Company,
|
|
10196
10174
|
functions,
|
|
10197
|
-
title: t(`
|
|
10175
|
+
title: t(`entities.companies`, { count: 2 })
|
|
10198
10176
|
}
|
|
10199
10177
|
);
|
|
10200
10178
|
}
|
|
@@ -10226,7 +10204,7 @@ var CompanyProvider = /* @__PURE__ */ __name(({ children, dehydratedCompany }) =
|
|
|
10226
10204
|
}, "breadcrumb");
|
|
10227
10205
|
const title = /* @__PURE__ */ __name(() => {
|
|
10228
10206
|
const response = {
|
|
10229
|
-
type: t(`
|
|
10207
|
+
type: t(`entities.companies`, { count: company ? 1 : 2 })
|
|
10230
10208
|
};
|
|
10231
10209
|
if (company) response.element = company.name;
|
|
10232
10210
|
const functions = [];
|
|
@@ -10272,11 +10250,11 @@ var generateNotificationData = /* @__PURE__ */ __name((params) => {
|
|
|
10272
10250
|
function NotificationToast(notification, t, generateUrl, reouter) {
|
|
10273
10251
|
const data = generateNotificationData({ notification, generateUrl });
|
|
10274
10252
|
return {
|
|
10275
|
-
title: t(`
|
|
10253
|
+
title: t(`notification.${notification.notificationType}.title`),
|
|
10276
10254
|
description: /* @__PURE__ */ jsxs61("div", { className: `flex w-full flex-row items-center p-2`, children: [
|
|
10277
10255
|
data.actor ? /* @__PURE__ */ jsx106("div", { className: "flex w-12 max-w-12 px-2", children: /* @__PURE__ */ jsx106(UserAvatar, { user: data.actor, className: "h-8 w-8" }) }) : /* @__PURE__ */ jsx106("div", { className: "flex w-14 max-w-14 px-2" }),
|
|
10278
10256
|
/* @__PURE__ */ jsxs61("div", { className: "flex w-full flex-col", children: [
|
|
10279
|
-
/* @__PURE__ */ jsx106("p", { className: "text-sm", children: t.rich(`
|
|
10257
|
+
/* @__PURE__ */ jsx106("p", { className: "text-sm", children: t.rich(`notification.${notification.notificationType}.description`, {
|
|
10280
10258
|
strong: /* @__PURE__ */ __name((chunks) => /* @__PURE__ */ jsx106("strong", { children: chunks }), "strong"),
|
|
10281
10259
|
actor: data.actor?.name ?? "",
|
|
10282
10260
|
title: data.title,
|
|
@@ -10286,7 +10264,7 @@ function NotificationToast(notification, t, generateUrl, reouter) {
|
|
|
10286
10264
|
] })
|
|
10287
10265
|
] }),
|
|
10288
10266
|
action: data.url ? {
|
|
10289
|
-
label: t(`
|
|
10267
|
+
label: t(`notification.${notification.notificationType}.buttons.action`),
|
|
10290
10268
|
onClick: /* @__PURE__ */ __name(() => {
|
|
10291
10269
|
reouter.push(data.url);
|
|
10292
10270
|
}, "onClick")
|
|
@@ -10305,7 +10283,7 @@ function NotificationMenuItem({ notification, closePopover }) {
|
|
|
10305
10283
|
const response = /* @__PURE__ */ jsxs61("div", { className: `flex w-full flex-row p-2 ${isRead ? "" : "bg-muted"} items-center`, children: [
|
|
10306
10284
|
data.actor ? /* @__PURE__ */ jsx106("div", { className: "flex w-12 max-w-12 px-2", children: /* @__PURE__ */ jsx106(UserAvatar, { user: data.actor, className: "h-8 w-8" }) }) : /* @__PURE__ */ jsx106("div", { className: "flex w-14 max-w-14 px-2" }),
|
|
10307
10285
|
/* @__PURE__ */ jsxs61("div", { className: "flex w-full flex-col", children: [
|
|
10308
|
-
/* @__PURE__ */ jsx106("p", { className: "text-sm", children: t.rich(`
|
|
10286
|
+
/* @__PURE__ */ jsx106("p", { className: "text-sm", children: t.rich(`notification.${notification.notificationType}.description`, {
|
|
10309
10287
|
strong: /* @__PURE__ */ __name((chunks) => /* @__PURE__ */ jsx106("strong", { children: chunks }), "strong"),
|
|
10310
10288
|
actor: data.actor?.name ?? "",
|
|
10311
10289
|
title: data.title,
|
|
@@ -10395,13 +10373,13 @@ var NotificationContextProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
10395
10373
|
const breadcrumb = /* @__PURE__ */ __name(() => {
|
|
10396
10374
|
const response = [];
|
|
10397
10375
|
response.push({
|
|
10398
|
-
name: t(`
|
|
10376
|
+
name: t(`entities.notifications`, { count: 2 })
|
|
10399
10377
|
});
|
|
10400
10378
|
return response;
|
|
10401
10379
|
}, "breadcrumb");
|
|
10402
10380
|
const title = /* @__PURE__ */ __name(() => {
|
|
10403
10381
|
const response = {
|
|
10404
|
-
type: t(`
|
|
10382
|
+
type: t(`entities.notifications`, { count: 2 })
|
|
10405
10383
|
};
|
|
10406
10384
|
return response;
|
|
10407
10385
|
}, "title");
|
|
@@ -10448,7 +10426,7 @@ var RoleProvider = /* @__PURE__ */ __name(({ children, dehydratedRole }) => {
|
|
|
10448
10426
|
const breadcrumb = /* @__PURE__ */ __name(() => {
|
|
10449
10427
|
const response = [];
|
|
10450
10428
|
response.push({
|
|
10451
|
-
name: t(`
|
|
10429
|
+
name: t(`entities.roles`, { count: 2 }),
|
|
10452
10430
|
href: generateUrl({ page: Modules.Role })
|
|
10453
10431
|
});
|
|
10454
10432
|
if (role)
|
|
@@ -10460,7 +10438,7 @@ var RoleProvider = /* @__PURE__ */ __name(({ children, dehydratedRole }) => {
|
|
|
10460
10438
|
}, "breadcrumb");
|
|
10461
10439
|
const title = /* @__PURE__ */ __name(() => {
|
|
10462
10440
|
const response = {
|
|
10463
|
-
type: t(`
|
|
10441
|
+
type: t(`entities.roles`, { count: role ? 1 : 2 })
|
|
10464
10442
|
};
|
|
10465
10443
|
const functions = [];
|
|
10466
10444
|
if (role) {
|
|
@@ -10519,7 +10497,7 @@ var CommonProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
10519
10497
|
}, "breadcrumb");
|
|
10520
10498
|
const title = /* @__PURE__ */ __name(() => {
|
|
10521
10499
|
const response = {
|
|
10522
|
-
type: t(`
|
|
10500
|
+
type: t(`common.title`)
|
|
10523
10501
|
};
|
|
10524
10502
|
if (company) response.element = company.name;
|
|
10525
10503
|
return response;
|
|
@@ -10810,7 +10788,7 @@ function BreadcrumbNavigation({ items }) {
|
|
|
10810
10788
|
const t = useTranslations37();
|
|
10811
10789
|
const [open, setOpen] = useState33(false);
|
|
10812
10790
|
return /* @__PURE__ */ jsx111(Breadcrumb, { children: /* @__PURE__ */ jsxs62(BreadcrumbList, { children: [
|
|
10813
|
-
/* @__PURE__ */ jsx111(BreadcrumbItem, { children: /* @__PURE__ */ jsx111(Link, { href: generateUrl({ page: `/` }), children: t(`
|
|
10791
|
+
/* @__PURE__ */ jsx111(BreadcrumbItem, { children: /* @__PURE__ */ jsx111(Link, { href: generateUrl({ page: `/` }), children: t(`common.home`) }) }),
|
|
10814
10792
|
items.length > 0 && /* @__PURE__ */ jsx111(BreadcrumbSeparator, {}),
|
|
10815
10793
|
items.length > ITEMS_TO_DISPLAY ? /* @__PURE__ */ jsxs62(Fragment13, { children: [
|
|
10816
10794
|
/* @__PURE__ */ jsx111(BreadcrumbItem, { children: items[0].href ? /* @__PURE__ */ jsx111(Link, { href: items[0].href, children: items[0].name }) : /* @__PURE__ */ jsx111(Fragment13, { children: items[0].name }) }),
|
|
@@ -10883,13 +10861,13 @@ function Header({ children }) {
|
|
|
10883
10861
|
className: "h-6 w-6",
|
|
10884
10862
|
onClick: () => refreshUser(),
|
|
10885
10863
|
disabled: isRefreshing,
|
|
10886
|
-
"aria-label": t("
|
|
10864
|
+
"aria-label": t("common.refresh", { defaultValue: "Refresh" })
|
|
10887
10865
|
}
|
|
10888
10866
|
),
|
|
10889
10867
|
children: /* @__PURE__ */ jsx113(RefreshCwIcon2, { className: `h-3.5 w-3.5 ${isRefreshing ? "animate-spin" : ""}` })
|
|
10890
10868
|
}
|
|
10891
10869
|
),
|
|
10892
|
-
/* @__PURE__ */ jsx113(TooltipContent, { side: "bottom", children: t("
|
|
10870
|
+
/* @__PURE__ */ jsx113(TooltipContent, { side: "bottom", children: t("common.refresh", { defaultValue: "Refresh" }) })
|
|
10893
10871
|
] })
|
|
10894
10872
|
] }),
|
|
10895
10873
|
children ? children : null
|
|
@@ -10972,13 +10950,13 @@ function RecentPagesNavigator() {
|
|
|
10972
10950
|
return null;
|
|
10973
10951
|
}
|
|
10974
10952
|
return /* @__PURE__ */ jsxs66(DropdownMenu, { children: [
|
|
10975
|
-
/* @__PURE__ */ jsx116(DropdownMenuTrigger, { children: /* @__PURE__ */ jsx116("div", { className: "flex w-full cursor-pointer items-center gap-2", children: state === "collapsed" ? /* @__PURE__ */ jsx116(HistoryIcon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx116("span", { children: t(`
|
|
10953
|
+
/* @__PURE__ */ jsx116(DropdownMenuTrigger, { children: /* @__PURE__ */ jsx116("div", { className: "flex w-full cursor-pointer items-center gap-2", children: state === "collapsed" ? /* @__PURE__ */ jsx116(HistoryIcon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx116("span", { children: t(`common.recent_pages`) }) }) }),
|
|
10976
10954
|
/* @__PURE__ */ jsxs66(DropdownMenuContent, { align: "start", className: "w-96", children: [
|
|
10977
|
-
/* @__PURE__ */ jsx116(DropdownMenuLabel, { children: t(`
|
|
10955
|
+
/* @__PURE__ */ jsx116(DropdownMenuLabel, { children: t(`common.recent_pages`) }),
|
|
10978
10956
|
/* @__PURE__ */ jsx116(DropdownMenuSeparator, {}),
|
|
10979
10957
|
recentPages.map((page, index) => /* @__PURE__ */ jsx116(DropdownMenuItem, { children: /* @__PURE__ */ jsx116(Link, { href: page.url, className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs66("div", { className: "flex flex-col", children: [
|
|
10980
10958
|
/* @__PURE__ */ jsx116("div", { className: "truncate text-sm", children: page.title }),
|
|
10981
|
-
/* @__PURE__ */ jsx116("div", { className: "text-muted-foreground text-xs font-normal", children: t(`
|
|
10959
|
+
/* @__PURE__ */ jsx116("div", { className: "text-muted-foreground text-xs font-normal", children: t(`entities.${page.moduleType}`, { count: 1 }) })
|
|
10982
10960
|
] }) }) }, `${page.url}-${index}`))
|
|
10983
10961
|
] })
|
|
10984
10962
|
] });
|
|
@@ -11141,7 +11119,7 @@ import { jsx as jsx121, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
|
11141
11119
|
function AllowedUsersDetails({ showTitle, content }) {
|
|
11142
11120
|
const t = useTranslations41();
|
|
11143
11121
|
return /* @__PURE__ */ jsxs71("div", { className: "mb-2 flex w-full flex-col gap-y-2", children: [
|
|
11144
|
-
showTitle && /* @__PURE__ */ jsx121("h3", { className: "text-xs font-semibold", children: t("
|
|
11122
|
+
showTitle && /* @__PURE__ */ jsx121("h3", { className: "text-xs font-semibold", children: t("common.permissions") }),
|
|
11145
11123
|
/* @__PURE__ */ jsx121("div", { className: "flex w-full items-center justify-start gap-x-4", children: /* @__PURE__ */ jsx121(ContributorsList, { content }) })
|
|
11146
11124
|
] });
|
|
11147
11125
|
}
|
|
@@ -11151,7 +11129,7 @@ __name(AllowedUsersDetails, "AllowedUsersDetails");
|
|
|
11151
11129
|
import dynamic from "next/dynamic";
|
|
11152
11130
|
import React15 from "react";
|
|
11153
11131
|
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
11154
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
11132
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-G532N3N7.mjs"), {
|
|
11155
11133
|
ssr: false
|
|
11156
11134
|
});
|
|
11157
11135
|
var BlockNoteEditorContainer = React15.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -11575,7 +11553,7 @@ var useCompanyTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11575
11553
|
["name" /* name */]: () => ({
|
|
11576
11554
|
id: "name",
|
|
11577
11555
|
accessorKey: "name",
|
|
11578
|
-
header: t(`
|
|
11556
|
+
header: t(`user.fields.name.label`),
|
|
11579
11557
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
11580
11558
|
const company = row.original.jsonApiData;
|
|
11581
11559
|
return /* @__PURE__ */ jsx130(
|
|
@@ -11595,7 +11573,7 @@ var useCompanyTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11595
11573
|
}),
|
|
11596
11574
|
["createdAt" /* createdAt */]: () => cellDate({
|
|
11597
11575
|
name: "createdAt",
|
|
11598
|
-
title: t(`
|
|
11576
|
+
title: t(`common.date.create`)
|
|
11599
11577
|
})
|
|
11600
11578
|
};
|
|
11601
11579
|
const columns = useMemo14(() => {
|
|
@@ -11683,7 +11661,7 @@ var useRoleTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11683
11661
|
["name" /* name */]: () => ({
|
|
11684
11662
|
id: "name",
|
|
11685
11663
|
accessorKey: "name",
|
|
11686
|
-
header: t(`
|
|
11664
|
+
header: t(`role.fields.name.label`),
|
|
11687
11665
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
11688
11666
|
const role = row.original.jsonApiData;
|
|
11689
11667
|
return /* @__PURE__ */ jsx131(Link, { href: generateUrl({ page: Modules.Role, id: role.id }), children: row.getValue("name") });
|
|
@@ -11694,14 +11672,14 @@ var useRoleTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11694
11672
|
["description" /* description */]: () => ({
|
|
11695
11673
|
id: "description",
|
|
11696
11674
|
accessorKey: "description",
|
|
11697
|
-
header: t(`
|
|
11675
|
+
header: t(`role.fields.description.label`),
|
|
11698
11676
|
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx131(Fragment15, { children: row.getValue("description") }), "cell"),
|
|
11699
11677
|
enableSorting: false,
|
|
11700
11678
|
enableHiding: false
|
|
11701
11679
|
}),
|
|
11702
11680
|
["createdAt" /* createdAt */]: () => cellDate({
|
|
11703
11681
|
name: "createdAt",
|
|
11704
|
-
title: t(`
|
|
11682
|
+
title: t(`common.date.create`)
|
|
11705
11683
|
})
|
|
11706
11684
|
};
|
|
11707
11685
|
const columns = useMemo16(() => {
|
|
@@ -11783,7 +11761,7 @@ var useUserTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11783
11761
|
["name" /* name */]: () => ({
|
|
11784
11762
|
id: "name",
|
|
11785
11763
|
accessorKey: "name",
|
|
11786
|
-
header: t(`
|
|
11764
|
+
header: t(`user.fields.name.label`),
|
|
11787
11765
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
11788
11766
|
const user = row.original.jsonApiData;
|
|
11789
11767
|
return /* @__PURE__ */ jsxs74(
|
|
@@ -11797,8 +11775,8 @@ var useUserTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11797
11775
|
children: [
|
|
11798
11776
|
/* @__PURE__ */ jsx132(UserAvatar, { user }),
|
|
11799
11777
|
user.name,
|
|
11800
|
-
user.isDeleted ? ` - ${t("
|
|
11801
|
-
!user.isActivated ? ` - ${t("
|
|
11778
|
+
user.isDeleted ? ` - ${t("user.errors.deleted")}` : "",
|
|
11779
|
+
!user.isActivated ? ` - ${t("user.errors.inactive")}` : ""
|
|
11802
11780
|
]
|
|
11803
11781
|
}
|
|
11804
11782
|
);
|
|
@@ -11809,7 +11787,7 @@ var useUserTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11809
11787
|
["email" /* email */]: () => ({
|
|
11810
11788
|
id: "email",
|
|
11811
11789
|
accessorKey: "email",
|
|
11812
|
-
header: t(`
|
|
11790
|
+
header: t(`common.fields.email.label`),
|
|
11813
11791
|
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx132(Fragment16, { children: row.getValue("email") }), "cell"),
|
|
11814
11792
|
enableSorting: false,
|
|
11815
11793
|
enableHiding: false
|
|
@@ -11817,7 +11795,7 @@ var useUserTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11817
11795
|
["relevance" /* relevance */]: () => ({
|
|
11818
11796
|
id: "relevance",
|
|
11819
11797
|
accessorKey: "relevance",
|
|
11820
|
-
header: t(`
|
|
11798
|
+
header: t(`common.relevance`),
|
|
11821
11799
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
11822
11800
|
const user = row.original.jsonApiData;
|
|
11823
11801
|
if (!user.relevance) return /* @__PURE__ */ jsx132(Fragment16, {});
|
|
@@ -11844,7 +11822,7 @@ var useUserTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11844
11822
|
}),
|
|
11845
11823
|
["createdAt" /* createdAt */]: () => cellDate({
|
|
11846
11824
|
name: "createdAt",
|
|
11847
|
-
title: t(`
|
|
11825
|
+
title: t(`common.date.create`)
|
|
11848
11826
|
})
|
|
11849
11827
|
};
|
|
11850
11828
|
const columns = useMemo17(() => {
|
|
@@ -11881,7 +11859,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11881
11859
|
["name" /* name */]: () => ({
|
|
11882
11860
|
id: "name",
|
|
11883
11861
|
accessorKey: "name",
|
|
11884
|
-
header: t(`
|
|
11862
|
+
header: t(`content.fields.name.label`),
|
|
11885
11863
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
11886
11864
|
const content = row.original.jsonApiData;
|
|
11887
11865
|
const contentModule = content.contentType ? Modules.findByModelName(content.contentType) : void 0;
|
|
@@ -11900,7 +11878,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11900
11878
|
["relevance" /* relevance */]: () => ({
|
|
11901
11879
|
id: "relevance",
|
|
11902
11880
|
accessorKey: "relevance",
|
|
11903
|
-
header: t(`
|
|
11881
|
+
header: t(`common.relevance`),
|
|
11904
11882
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
11905
11883
|
const content = row.original.jsonApiData;
|
|
11906
11884
|
if (!content.relevance) return /* @__PURE__ */ jsx133(Fragment17, {});
|
|
@@ -11928,7 +11906,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11928
11906
|
["authors" /* authors */]: () => ({
|
|
11929
11907
|
id: "authors",
|
|
11930
11908
|
accessorKey: "authors",
|
|
11931
|
-
header: t(`
|
|
11909
|
+
header: t(`common.relationships.author.label`),
|
|
11932
11910
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
11933
11911
|
const content = row.original.jsonApiData;
|
|
11934
11912
|
return /* @__PURE__ */ jsx133(ContributorsList, { content });
|
|
@@ -11938,11 +11916,11 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11938
11916
|
}),
|
|
11939
11917
|
["createdAt" /* createdAt */]: () => cellDate({
|
|
11940
11918
|
name: "createdAt",
|
|
11941
|
-
title: t(`
|
|
11919
|
+
title: t(`common.date.create`)
|
|
11942
11920
|
}),
|
|
11943
11921
|
["updatedAt" /* updatedAt */]: () => cellDate({
|
|
11944
11922
|
name: "updatedAt",
|
|
11945
|
-
title: t(`
|
|
11923
|
+
title: t(`common.date.update`)
|
|
11946
11924
|
})
|
|
11947
11925
|
};
|
|
11948
11926
|
const columns = useMemo18(() => {
|
|
@@ -12324,7 +12302,7 @@ function ContentTableSearch({ data }) {
|
|
|
12324
12302
|
},
|
|
12325
12303
|
onFocus: () => setIsFocused(true),
|
|
12326
12304
|
onBlur: handleBlur,
|
|
12327
|
-
placeholder: t(`
|
|
12305
|
+
placeholder: t(`ui.search.placeholder_global`),
|
|
12328
12306
|
type: "text",
|
|
12329
12307
|
className: "border-border/50 focus-visible:border-border h-10 w-full pr-8 pl-8 text-xs shadow-none focus-visible:ring-0",
|
|
12330
12308
|
onChange: (e) => setSearchTerm(e.target.value),
|
|
@@ -12450,16 +12428,16 @@ function Register() {
|
|
|
12450
12428
|
const [showConfirmation, setShowConfirmation] = useState45(false);
|
|
12451
12429
|
const formSchema = z4.object({
|
|
12452
12430
|
company: z4.string().min(1, {
|
|
12453
|
-
message: t(`
|
|
12431
|
+
message: t(`common.errors.missing_company_name`)
|
|
12454
12432
|
}),
|
|
12455
12433
|
name: z4.string().min(1, {
|
|
12456
|
-
message: t("
|
|
12434
|
+
message: t("common.errors.missing_name")
|
|
12457
12435
|
}),
|
|
12458
12436
|
email: z4.string().email({
|
|
12459
|
-
message: t(`
|
|
12437
|
+
message: t(`common.errors.invalid_email`)
|
|
12460
12438
|
}),
|
|
12461
|
-
password: z4.string().min(8, t(`
|
|
12462
|
-
message: t(`
|
|
12439
|
+
password: z4.string().min(8, t(`auth.errors.password_too_short`)).regex(/^(?=.*[0-9])(?=.*[^a-zA-Z0-9]).*$/, {
|
|
12440
|
+
message: t(`auth.errors.password_invalid_format`)
|
|
12463
12441
|
})
|
|
12464
12442
|
});
|
|
12465
12443
|
const form = useForm4({
|
|
@@ -12490,11 +12468,11 @@ function Register() {
|
|
|
12490
12468
|
/* @__PURE__ */ jsxs78(CardHeader, { children: [
|
|
12491
12469
|
/* @__PURE__ */ jsxs78(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
12492
12470
|
/* @__PURE__ */ jsx136(Image7, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
12493
|
-
t(`
|
|
12471
|
+
t(`auth.register`)
|
|
12494
12472
|
] }),
|
|
12495
|
-
/* @__PURE__ */ jsx136(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx136(Fragment19, { children: " " }) : /* @__PURE__ */ jsx136(Fragment19, { children: t(`
|
|
12473
|
+
/* @__PURE__ */ jsx136(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx136(Fragment19, { children: " " }) : /* @__PURE__ */ jsx136(Fragment19, { children: t(`auth.register_description`) }) })
|
|
12496
12474
|
] }),
|
|
12497
|
-
showConfirmation ? /* @__PURE__ */ jsx136(CardContent, { children: /* @__PURE__ */ jsx136(CardDescription, { className: "text-center text-xl", children: t("
|
|
12475
|
+
showConfirmation ? /* @__PURE__ */ jsx136(CardContent, { children: /* @__PURE__ */ jsx136(CardDescription, { className: "text-center text-xl", children: t("auth.register_confirmation") }) }) : /* @__PURE__ */ jsx136(Form, { ...form, children: /* @__PURE__ */ jsxs78("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
12498
12476
|
/* @__PURE__ */ jsxs78(CardContent, { children: [
|
|
12499
12477
|
/* @__PURE__ */ jsx136(
|
|
12500
12478
|
FormInput,
|
|
@@ -12502,8 +12480,8 @@ function Register() {
|
|
|
12502
12480
|
isRequired: true,
|
|
12503
12481
|
form,
|
|
12504
12482
|
id: "company",
|
|
12505
|
-
name: t(`
|
|
12506
|
-
placeholder: t(`
|
|
12483
|
+
name: t(`company.fields.name.label`),
|
|
12484
|
+
placeholder: t(`company.fields.name.placeholder`)
|
|
12507
12485
|
}
|
|
12508
12486
|
),
|
|
12509
12487
|
/* @__PURE__ */ jsx136(
|
|
@@ -12512,8 +12490,8 @@ function Register() {
|
|
|
12512
12490
|
isRequired: true,
|
|
12513
12491
|
form,
|
|
12514
12492
|
id: "name",
|
|
12515
|
-
name: t(`
|
|
12516
|
-
placeholder: t(`
|
|
12493
|
+
name: t(`user.fields.name.label`),
|
|
12494
|
+
placeholder: t(`user.fields.name.placeholder`)
|
|
12517
12495
|
}
|
|
12518
12496
|
),
|
|
12519
12497
|
/* @__PURE__ */ jsx136(
|
|
@@ -12522,8 +12500,8 @@ function Register() {
|
|
|
12522
12500
|
isRequired: true,
|
|
12523
12501
|
form,
|
|
12524
12502
|
id: "email",
|
|
12525
|
-
name: t(`
|
|
12526
|
-
placeholder: t(`
|
|
12503
|
+
name: t(`common.fields.email.label`),
|
|
12504
|
+
placeholder: t(`common.fields.email.placeholder`)
|
|
12527
12505
|
}
|
|
12528
12506
|
),
|
|
12529
12507
|
/* @__PURE__ */ jsx136(
|
|
@@ -12532,11 +12510,11 @@ function Register() {
|
|
|
12532
12510
|
isRequired: true,
|
|
12533
12511
|
form,
|
|
12534
12512
|
id: "password",
|
|
12535
|
-
name: t(`
|
|
12536
|
-
placeholder: t(`
|
|
12513
|
+
name: t(`user.fields.password.label`),
|
|
12514
|
+
placeholder: t(`user.fields.password.placeholder`)
|
|
12537
12515
|
}
|
|
12538
12516
|
),
|
|
12539
|
-
/* @__PURE__ */ jsx136(Button, { className: "mt-4 w-full", type: "submit", children: t(`
|
|
12517
|
+
/* @__PURE__ */ jsx136(Button, { className: "mt-4 w-full", type: "submit", children: t(`auth.buttons.register`) })
|
|
12540
12518
|
] }),
|
|
12541
12519
|
/* @__PURE__ */ jsxs78(CardFooter, { className: "flex w-full flex-row justify-between", children: [
|
|
12542
12520
|
/* @__PURE__ */ jsx136(
|
|
@@ -12545,7 +12523,7 @@ function Register() {
|
|
|
12545
12523
|
href: "#",
|
|
12546
12524
|
className: "flex w-full justify-start",
|
|
12547
12525
|
onClick: () => setComponentType(0 /* Login */),
|
|
12548
|
-
children: t(`
|
|
12526
|
+
children: t(`auth.buttons.login`)
|
|
12549
12527
|
}
|
|
12550
12528
|
),
|
|
12551
12529
|
/* @__PURE__ */ jsx136(
|
|
@@ -12554,7 +12532,7 @@ function Register() {
|
|
|
12554
12532
|
href: "#",
|
|
12555
12533
|
className: "flex w-full justify-end",
|
|
12556
12534
|
onClick: () => setComponentType(1 /* ForgotPassword */),
|
|
12557
|
-
children: t(`
|
|
12535
|
+
children: t(`auth.buttons.forgot_password`)
|
|
12558
12536
|
}
|
|
12559
12537
|
)
|
|
12560
12538
|
] })
|
|
@@ -12638,9 +12616,9 @@ function LandingComponent() {
|
|
|
12638
12616
|
/* @__PURE__ */ jsxs79(CardHeader, { className: "mb-4", "data-testid": "page-pre-login-container", children: [
|
|
12639
12617
|
/* @__PURE__ */ jsxs79(CardTitle, { className: "text-primary flex flex-col items-center gap-y-8 pb-8 text-4xl", children: [
|
|
12640
12618
|
/* @__PURE__ */ jsx139(Image9, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
12641
|
-
t(`
|
|
12619
|
+
t(`common.title`)
|
|
12642
12620
|
] }),
|
|
12643
|
-
/* @__PURE__ */ jsx139(CardDescription, { className: "flex w-full justify-center text-center text-sm", children: t(`
|
|
12621
|
+
/* @__PURE__ */ jsx139(CardDescription, { className: "flex w-full justify-center text-center text-sm", children: t(`common.description`) })
|
|
12644
12622
|
] }),
|
|
12645
12623
|
/* @__PURE__ */ jsxs79(CardFooter, { className: "mt-4 flex w-full flex-col justify-between gap-y-4", children: [
|
|
12646
12624
|
isInternalAuthEnabled() && /* @__PURE__ */ jsxs79(Fragment20, { children: [
|
|
@@ -12650,10 +12628,10 @@ function LandingComponent() {
|
|
|
12650
12628
|
href: "#",
|
|
12651
12629
|
className: "flex w-full justify-start",
|
|
12652
12630
|
onClick: () => setComponentType(5 /* Register */),
|
|
12653
|
-
children: /* @__PURE__ */ jsx139(Button, { className: "w-full", variant: `default`, children: t(`
|
|
12631
|
+
children: /* @__PURE__ */ jsx139(Button, { className: "w-full", variant: `default`, children: t(`auth.buttons.register`) })
|
|
12654
12632
|
}
|
|
12655
12633
|
),
|
|
12656
|
-
/* @__PURE__ */ jsx139(Link, { href: "#", className: "flex w-full justify-end", onClick: () => setComponentType(0 /* Login */), children: /* @__PURE__ */ jsx139(Button, { className: "w-full", variant: `outline`, "data-testid": "page-login-button-initial-login", children: t(`
|
|
12634
|
+
/* @__PURE__ */ jsx139(Link, { href: "#", className: "flex w-full justify-end", onClick: () => setComponentType(0 /* Login */), children: /* @__PURE__ */ jsx139(Button, { className: "w-full", variant: `outline`, "data-testid": "page-login-button-initial-login", children: t(`auth.buttons.login`) }) })
|
|
12657
12635
|
] }),
|
|
12658
12636
|
isDiscordAuthEnabled() && /* @__PURE__ */ jsx139(Link, { href: `${getApiUrl()}auth/discord`, className: "flex w-full justify-end", children: /* @__PURE__ */ jsx139(Button, { className: "w-full", variant: `outline`, "data-testid": "page-login-button-initial-login", children: "Login with Discord" }) })
|
|
12659
12637
|
] })
|
|
@@ -12684,25 +12662,25 @@ function AcceptInvitation() {
|
|
|
12684
12662
|
await AuthService.validateCode(payload);
|
|
12685
12663
|
} catch (e) {
|
|
12686
12664
|
setError(e instanceof Error ? e.message : String(e));
|
|
12687
|
-
errorToast({ title: t(`
|
|
12665
|
+
errorToast({ title: t(`common.errors.error`), error: e });
|
|
12688
12666
|
}
|
|
12689
12667
|
}
|
|
12690
12668
|
__name(validateCode, "validateCode");
|
|
12691
12669
|
if (params && params.code) {
|
|
12692
12670
|
validateCode(params.code);
|
|
12693
12671
|
} else {
|
|
12694
|
-
setError(t(`
|
|
12672
|
+
setError(t(`auth.errors.invalid_invitation_code`));
|
|
12695
12673
|
}
|
|
12696
12674
|
}, []);
|
|
12697
12675
|
const formSchema = z5.object({
|
|
12698
12676
|
password: z5.string().min(1, {
|
|
12699
|
-
message: t(`
|
|
12677
|
+
message: t(`user.fields.password.error`)
|
|
12700
12678
|
}),
|
|
12701
12679
|
passwordRetype: z5.string().min(1, {
|
|
12702
|
-
message: t("
|
|
12680
|
+
message: t("auth.errors.password_retype_required")
|
|
12703
12681
|
})
|
|
12704
12682
|
}).refine((data) => data.password === data.passwordRetype, {
|
|
12705
|
-
message: t("
|
|
12683
|
+
message: t("auth.fields.retype_password.error_not_match"),
|
|
12706
12684
|
path: ["passwordRetype"]
|
|
12707
12685
|
});
|
|
12708
12686
|
const form = useForm5({
|
|
@@ -12721,33 +12699,33 @@ function AcceptInvitation() {
|
|
|
12721
12699
|
};
|
|
12722
12700
|
await AuthService.acceptInvitation(payload);
|
|
12723
12701
|
setShowConfirmation(true);
|
|
12724
|
-
toast6.success(t("
|
|
12725
|
-
description: t("
|
|
12702
|
+
toast6.success(t("auth.account_activated"), {
|
|
12703
|
+
description: t("auth.account_activated_description")
|
|
12726
12704
|
});
|
|
12727
12705
|
setTimeout(() => {
|
|
12728
12706
|
setComponentType(0 /* Login */);
|
|
12729
12707
|
setParams(void 0);
|
|
12730
12708
|
}, 2e3);
|
|
12731
12709
|
} catch (e) {
|
|
12732
|
-
errorToast({ title: t(`
|
|
12710
|
+
errorToast({ title: t(`common.errors.error`), error });
|
|
12733
12711
|
}
|
|
12734
12712
|
}, "onSubmit");
|
|
12735
12713
|
return /* @__PURE__ */ jsxs80(Fragment21, { children: [
|
|
12736
12714
|
/* @__PURE__ */ jsxs80(CardHeader, { children: [
|
|
12737
12715
|
/* @__PURE__ */ jsxs80(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
12738
12716
|
/* @__PURE__ */ jsx140(Image10, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
12739
|
-
t("
|
|
12717
|
+
t("auth.accept_invitation")
|
|
12740
12718
|
] }),
|
|
12741
|
-
/* @__PURE__ */ jsx140(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx140(Fragment21, { children: t("
|
|
12719
|
+
/* @__PURE__ */ jsx140(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx140(Fragment21, { children: t("auth.errors.activating_account") }) : /* @__PURE__ */ jsx140(Fragment21, { children: t("auth.select_password") }) })
|
|
12742
12720
|
] }),
|
|
12743
|
-
/* @__PURE__ */ jsx140(CardContent, { children: showConfirmation ? /* @__PURE__ */ jsx140(CardDescription, { className: "text-center text-xl", children: t("
|
|
12721
|
+
/* @__PURE__ */ jsx140(CardContent, { children: showConfirmation ? /* @__PURE__ */ jsx140(CardDescription, { className: "text-center text-xl", children: t("auth.activation_description") }) : error ? /* @__PURE__ */ jsx140(CardDescription, { className: "text-center text-xl", children: error }) : /* @__PURE__ */ jsx140(Form, { ...form, children: /* @__PURE__ */ jsxs80("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
12744
12722
|
/* @__PURE__ */ jsx140(
|
|
12745
12723
|
FormPassword,
|
|
12746
12724
|
{
|
|
12747
12725
|
form,
|
|
12748
12726
|
id: "password",
|
|
12749
|
-
name: t(`
|
|
12750
|
-
placeholder: t(`
|
|
12727
|
+
name: t(`user.fields.password.label`),
|
|
12728
|
+
placeholder: t(`user.fields.password.placeholder`)
|
|
12751
12729
|
}
|
|
12752
12730
|
),
|
|
12753
12731
|
/* @__PURE__ */ jsx140(
|
|
@@ -12755,11 +12733,11 @@ function AcceptInvitation() {
|
|
|
12755
12733
|
{
|
|
12756
12734
|
form,
|
|
12757
12735
|
id: "passwordRetype",
|
|
12758
|
-
name: t("
|
|
12759
|
-
placeholder: t(`
|
|
12736
|
+
name: t("auth.fields.retype_password.label"),
|
|
12737
|
+
placeholder: t(`auth.fields.retype_password.placeholder`)
|
|
12760
12738
|
}
|
|
12761
12739
|
),
|
|
12762
|
-
/* @__PURE__ */ jsx140(Button, { className: "mt-4 w-full", type: "submit", children: t("
|
|
12740
|
+
/* @__PURE__ */ jsx140(Button, { className: "mt-4 w-full", type: "submit", children: t("auth.accept_invitation") })
|
|
12763
12741
|
] }) }) })
|
|
12764
12742
|
] });
|
|
12765
12743
|
}
|
|
@@ -12785,33 +12763,33 @@ function ActivateAccount() {
|
|
|
12785
12763
|
await AuthService.activate(payload);
|
|
12786
12764
|
setShowConfirmation(true);
|
|
12787
12765
|
setParams(void 0);
|
|
12788
|
-
toast7.success(t("
|
|
12789
|
-
description: t("
|
|
12766
|
+
toast7.success(t("auth.account_activated"), {
|
|
12767
|
+
description: t("auth.account_activated_description")
|
|
12790
12768
|
});
|
|
12791
12769
|
setTimeout(() => {
|
|
12792
12770
|
setComponentType(0 /* Login */);
|
|
12793
12771
|
}, 2e3);
|
|
12794
12772
|
} catch (e) {
|
|
12795
12773
|
setError(e instanceof Error ? e.message : String(e));
|
|
12796
|
-
errorToast({ title: t(`
|
|
12774
|
+
errorToast({ title: t(`common.errors.error`), error: e });
|
|
12797
12775
|
}
|
|
12798
12776
|
}
|
|
12799
12777
|
__name(ActivateAccount2, "ActivateAccount");
|
|
12800
12778
|
if (params && params.code) {
|
|
12801
12779
|
ActivateAccount2(params.code);
|
|
12802
12780
|
} else {
|
|
12803
|
-
setError(t(`
|
|
12781
|
+
setError(t(`auth.errors.invalid_invitation_code`));
|
|
12804
12782
|
}
|
|
12805
12783
|
}, []);
|
|
12806
12784
|
return /* @__PURE__ */ jsxs81(Fragment22, { children: [
|
|
12807
12785
|
/* @__PURE__ */ jsxs81(CardHeader, { children: [
|
|
12808
12786
|
/* @__PURE__ */ jsxs81(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
12809
12787
|
/* @__PURE__ */ jsx141(Image11, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
12810
|
-
t("
|
|
12788
|
+
t("auth.accept_invitation")
|
|
12811
12789
|
] }),
|
|
12812
|
-
/* @__PURE__ */ jsx141(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx141(Fragment22, { children: t("
|
|
12790
|
+
/* @__PURE__ */ jsx141(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx141(Fragment22, { children: t("auth.errors.activating_account") }) : /* @__PURE__ */ jsx141(Fragment22, { children: " " }) })
|
|
12813
12791
|
] }),
|
|
12814
|
-
/* @__PURE__ */ jsx141(CardContent, { children: /* @__PURE__ */ jsx141(CardDescription, { className: "text-center text-xl", children: showConfirmation ? /* @__PURE__ */ jsx141(Fragment22, { children: t("
|
|
12792
|
+
/* @__PURE__ */ jsx141(CardContent, { children: /* @__PURE__ */ jsx141(CardDescription, { className: "text-center text-xl", children: showConfirmation ? /* @__PURE__ */ jsx141(Fragment22, { children: t("auth.activation_description") }) : error ? /* @__PURE__ */ jsx141(Fragment22, { children: error }) : /* @__PURE__ */ jsx141(Fragment22, { children: t("auth.activation_wait") }) }) })
|
|
12815
12793
|
] });
|
|
12816
12794
|
}
|
|
12817
12795
|
__name(ActivateAccount, "ActivateAccount");
|
|
@@ -12855,7 +12833,7 @@ function ForgotPassword() {
|
|
|
12855
12833
|
const [showConfirmation, setShowConfirmation] = useState50(false);
|
|
12856
12834
|
const formSchema = z6.object({
|
|
12857
12835
|
email: z6.string().email({
|
|
12858
|
-
message: t(`
|
|
12836
|
+
message: t(`common.errors.invalid_email`)
|
|
12859
12837
|
})
|
|
12860
12838
|
});
|
|
12861
12839
|
const form = useForm6({
|
|
@@ -12879,23 +12857,23 @@ function ForgotPassword() {
|
|
|
12879
12857
|
/* @__PURE__ */ jsxs82(CardHeader, { "data-testid": "page-forgot-password-container", children: [
|
|
12880
12858
|
/* @__PURE__ */ jsxs82(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
12881
12859
|
/* @__PURE__ */ jsx142(Image12, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
12882
|
-
t("
|
|
12860
|
+
t("auth.forgot_password")
|
|
12883
12861
|
] }),
|
|
12884
|
-
/* @__PURE__ */ jsx142(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx142(Fragment23, { children: " " }) : /* @__PURE__ */ jsx142(Fragment23, { children: t(`
|
|
12862
|
+
/* @__PURE__ */ jsx142(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx142(Fragment23, { children: " " }) : /* @__PURE__ */ jsx142(Fragment23, { children: t(`auth.add_email_to_reset`) }) })
|
|
12885
12863
|
] }),
|
|
12886
|
-
showConfirmation ? /* @__PURE__ */ jsx142(CardContent, { children: /* @__PURE__ */ jsx142(CardDescription, { className: "text-center text-xl", children: t(`
|
|
12864
|
+
showConfirmation ? /* @__PURE__ */ jsx142(CardContent, { children: /* @__PURE__ */ jsx142(CardDescription, { className: "text-center text-xl", children: t(`auth.reset_confirmation`) }) }) : /* @__PURE__ */ jsx142(Form, { ...form, children: /* @__PURE__ */ jsxs82("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
12887
12865
|
/* @__PURE__ */ jsxs82(CardContent, { children: [
|
|
12888
12866
|
/* @__PURE__ */ jsx142(
|
|
12889
12867
|
FormInput,
|
|
12890
12868
|
{
|
|
12891
12869
|
form,
|
|
12892
12870
|
id: "email",
|
|
12893
|
-
name: t(`
|
|
12894
|
-
placeholder: t(`
|
|
12871
|
+
name: t(`common.fields.email.label`),
|
|
12872
|
+
placeholder: t(`common.fields.email.placeholder`),
|
|
12895
12873
|
testId: "form-forgot-password-input-email"
|
|
12896
12874
|
}
|
|
12897
12875
|
),
|
|
12898
|
-
/* @__PURE__ */ jsx142(Button, { className: "mt-4 w-full", type: "submit", "data-testid": "form-forgot-password-button-reset", children: t(`
|
|
12876
|
+
/* @__PURE__ */ jsx142(Button, { className: "mt-4 w-full", type: "submit", "data-testid": "form-forgot-password-button-reset", children: t(`auth.buttons.reset_password`) })
|
|
12899
12877
|
] }),
|
|
12900
12878
|
/* @__PURE__ */ jsx142(CardFooter, { className: "flex w-full flex-row justify-between", children: /* @__PURE__ */ jsx142(
|
|
12901
12879
|
Link,
|
|
@@ -12904,7 +12882,7 @@ function ForgotPassword() {
|
|
|
12904
12882
|
className: "flex w-full justify-end",
|
|
12905
12883
|
onClick: () => setComponentType(0 /* Login */),
|
|
12906
12884
|
"data-testid": "form-forgot-password-link-login",
|
|
12907
|
-
children: t(`
|
|
12885
|
+
children: t(`auth.buttons.login`)
|
|
12908
12886
|
}
|
|
12909
12887
|
) })
|
|
12910
12888
|
] }) })
|
|
@@ -12927,9 +12905,9 @@ function Login() {
|
|
|
12927
12905
|
const router = useI18nRouter();
|
|
12928
12906
|
const formSchema = z7.object({
|
|
12929
12907
|
email: z7.string().email({
|
|
12930
|
-
message: t(`
|
|
12908
|
+
message: t(`common.errors.invalid_email`)
|
|
12931
12909
|
}),
|
|
12932
|
-
password: z7.string().min(3, { message: t(`
|
|
12910
|
+
password: z7.string().min(3, { message: t(`auth.errors.password_too_short`) })
|
|
12933
12911
|
});
|
|
12934
12912
|
const form = useForm7({
|
|
12935
12913
|
resolver: zodResolver7(formSchema),
|
|
@@ -12948,7 +12926,7 @@ function Login() {
|
|
|
12948
12926
|
router.replace(generateUrl({ page: `/` }));
|
|
12949
12927
|
} catch (e) {
|
|
12950
12928
|
errorToast({
|
|
12951
|
-
title: t(`
|
|
12929
|
+
title: t(`common.errors.error`),
|
|
12952
12930
|
error: e
|
|
12953
12931
|
});
|
|
12954
12932
|
}
|
|
@@ -12957,9 +12935,9 @@ function Login() {
|
|
|
12957
12935
|
/* @__PURE__ */ jsxs83(CardHeader, { "data-testid": "page-login-container", children: [
|
|
12958
12936
|
/* @__PURE__ */ jsxs83(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
12959
12937
|
/* @__PURE__ */ jsx143(Image13, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
12960
|
-
t("
|
|
12938
|
+
t("auth.login")
|
|
12961
12939
|
] }),
|
|
12962
|
-
/* @__PURE__ */ jsx143(CardDescription, { className: "text-sm", children: t(`
|
|
12940
|
+
/* @__PURE__ */ jsx143(CardDescription, { className: "text-sm", children: t(`auth.login_description`) })
|
|
12963
12941
|
] }),
|
|
12964
12942
|
/* @__PURE__ */ jsx143(Form, { ...form, children: /* @__PURE__ */ jsxs83("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
12965
12943
|
/* @__PURE__ */ jsx143(CardContent, { children: isInternalAuthEnabled() && /* @__PURE__ */ jsxs83(Fragment24, { children: [
|
|
@@ -12969,8 +12947,8 @@ function Login() {
|
|
|
12969
12947
|
autoFocus: true,
|
|
12970
12948
|
form,
|
|
12971
12949
|
id: "email",
|
|
12972
|
-
name: t(`
|
|
12973
|
-
placeholder: t(`
|
|
12950
|
+
name: t(`common.fields.email.label`),
|
|
12951
|
+
placeholder: t(`common.fields.email.placeholder`),
|
|
12974
12952
|
testId: "form-login-input-email"
|
|
12975
12953
|
}
|
|
12976
12954
|
),
|
|
@@ -12979,12 +12957,12 @@ function Login() {
|
|
|
12979
12957
|
{
|
|
12980
12958
|
form,
|
|
12981
12959
|
id: "password",
|
|
12982
|
-
name: t(`
|
|
12983
|
-
placeholder: t(`
|
|
12960
|
+
name: t(`user.fields.password.label`),
|
|
12961
|
+
placeholder: t(`user.fields.password.placeholder`),
|
|
12984
12962
|
testId: "form-login-input-password"
|
|
12985
12963
|
}
|
|
12986
12964
|
),
|
|
12987
|
-
/* @__PURE__ */ jsx143(Button, { className: "mt-4 w-full", type: "submit", "data-testid": "form-login-button-submit", children: t(`
|
|
12965
|
+
/* @__PURE__ */ jsx143(Button, { className: "mt-4 w-full", type: "submit", "data-testid": "form-login-button-submit", children: t(`auth.login`) })
|
|
12988
12966
|
] }) }),
|
|
12989
12967
|
/* @__PURE__ */ jsxs83(CardFooter, { className: "flex w-full flex-col gap-y-4 mt-4", children: [
|
|
12990
12968
|
isDiscordAuthEnabled() && /* @__PURE__ */ jsx143(Link, { href: `${getApiUrl()}auth/discord`, className: "flex w-full justify-end", children: /* @__PURE__ */ jsx143(Button, { className: "w-full", variant: `outline`, "data-testid": "page-login-button-initial-login", children: "Login with Discord" }) }),
|
|
@@ -12995,7 +12973,7 @@ function Login() {
|
|
|
12995
12973
|
href: "#",
|
|
12996
12974
|
className: "flex w-full justify-start",
|
|
12997
12975
|
onClick: () => setComponentType(5 /* Register */),
|
|
12998
|
-
children: t(`
|
|
12976
|
+
children: t(`auth.register`)
|
|
12999
12977
|
}
|
|
13000
12978
|
),
|
|
13001
12979
|
/* @__PURE__ */ jsx143(
|
|
@@ -13005,7 +12983,7 @@ function Login() {
|
|
|
13005
12983
|
className: "flex w-full justify-end",
|
|
13006
12984
|
onClick: () => setComponentType(1 /* ForgotPassword */),
|
|
13007
12985
|
"data-testid": "form-login-link-forgot-password",
|
|
13008
|
-
children: t(`
|
|
12986
|
+
children: t(`auth.forgot_password`)
|
|
13009
12987
|
}
|
|
13010
12988
|
)
|
|
13011
12989
|
] })
|
|
@@ -13084,25 +13062,25 @@ function ResetPassword() {
|
|
|
13084
13062
|
await AuthService.validateCode(payload);
|
|
13085
13063
|
} catch (e) {
|
|
13086
13064
|
setError(e instanceof Error ? e.message : String(e));
|
|
13087
|
-
errorToast({ title: t(`
|
|
13065
|
+
errorToast({ title: t(`common.errors.error`), error: e });
|
|
13088
13066
|
}
|
|
13089
13067
|
}
|
|
13090
13068
|
__name(validateResetPasswordCode, "validateResetPasswordCode");
|
|
13091
13069
|
if (params && params.code) {
|
|
13092
13070
|
validateResetPasswordCode(params.code);
|
|
13093
13071
|
} else {
|
|
13094
|
-
setError(t(`
|
|
13072
|
+
setError(t(`auth.errors.invalid_password_reset_code`));
|
|
13095
13073
|
}
|
|
13096
13074
|
}, []);
|
|
13097
13075
|
const formSchema = z8.object({
|
|
13098
13076
|
password: z8.string().min(1, {
|
|
13099
|
-
message: t(`
|
|
13077
|
+
message: t(`user.fields.password.error`)
|
|
13100
13078
|
}),
|
|
13101
13079
|
passwordRetype: z8.string().min(1, {
|
|
13102
|
-
message: t(`
|
|
13080
|
+
message: t(`auth.fields.retype_password.error`)
|
|
13103
13081
|
})
|
|
13104
13082
|
}).refine((data) => data.password === data.passwordRetype, {
|
|
13105
|
-
message: t(`
|
|
13083
|
+
message: t(`auth.fields.retype_password.error_not_match`),
|
|
13106
13084
|
path: ["passwordRetype"]
|
|
13107
13085
|
});
|
|
13108
13086
|
const form = useForm8({
|
|
@@ -13121,29 +13099,29 @@ function ResetPassword() {
|
|
|
13121
13099
|
};
|
|
13122
13100
|
await AuthService.resetPassword(payload);
|
|
13123
13101
|
setShowConfirmation(true);
|
|
13124
|
-
toast8.success(t(`
|
|
13125
|
-
description: t(`
|
|
13102
|
+
toast8.success(t(`auth.reset_success`), {
|
|
13103
|
+
description: t(`auth.reset_success_description`)
|
|
13126
13104
|
});
|
|
13127
13105
|
setTimeout(() => {
|
|
13128
13106
|
setComponentType(0 /* Login */);
|
|
13129
13107
|
setParams(void 0);
|
|
13130
13108
|
}, 2e3);
|
|
13131
13109
|
} catch (e) {
|
|
13132
|
-
errorToast({ title: t(`
|
|
13110
|
+
errorToast({ title: t(`common.errors.error`), error });
|
|
13133
13111
|
}
|
|
13134
13112
|
}, "onSubmit");
|
|
13135
13113
|
return /* @__PURE__ */ jsxs84(Fragment26, { children: [
|
|
13136
13114
|
/* @__PURE__ */ jsxs84(CardHeader, { children: [
|
|
13137
13115
|
/* @__PURE__ */ jsxs84(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
13138
13116
|
/* @__PURE__ */ jsx145(Image14, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
13139
|
-
t(`
|
|
13117
|
+
t(`auth.password_reset`)
|
|
13140
13118
|
] }),
|
|
13141
|
-
/* @__PURE__ */ jsx145(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx145(Fragment26, { children: t(`
|
|
13119
|
+
/* @__PURE__ */ jsx145(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx145(Fragment26, { children: t(`auth.errors.password_reset_error`) }) : /* @__PURE__ */ jsx145(Fragment26, { children: t(`auth.reset_password`) }) })
|
|
13142
13120
|
] }),
|
|
13143
|
-
/* @__PURE__ */ jsx145(CardContent, { children: showConfirmation ? /* @__PURE__ */ jsx145(CardDescription, { className: "text-center text-xl", children: t(`
|
|
13121
|
+
/* @__PURE__ */ jsx145(CardContent, { children: showConfirmation ? /* @__PURE__ */ jsx145(CardDescription, { className: "text-center text-xl", children: t(`auth.reset_success_description`) }) : error ? /* @__PURE__ */ jsx145(CardDescription, { className: "text-center text-xl", children: error }) : /* @__PURE__ */ jsx145(Form, { ...form, children: /* @__PURE__ */ jsxs84("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
13144
13122
|
/* @__PURE__ */ jsx145(FormPassword, { form, id: "password", name: "Password" }),
|
|
13145
13123
|
/* @__PURE__ */ jsx145(FormPassword, { form, id: "passwordRetype", name: "Retype Password" }),
|
|
13146
|
-
/* @__PURE__ */ jsx145(Button, { className: "mt-4 w-full", type: "submit", children: t(`
|
|
13124
|
+
/* @__PURE__ */ jsx145(Button, { className: "mt-4 w-full", type: "submit", children: t(`auth.buttons.reset_password`) })
|
|
13147
13125
|
] }) }) })
|
|
13148
13126
|
] });
|
|
13149
13127
|
}
|
|
@@ -13155,7 +13133,7 @@ import { jsx as jsx146, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
|
13155
13133
|
function ContentsList({ contentList }) {
|
|
13156
13134
|
const t = useTranslations54();
|
|
13157
13135
|
return /* @__PURE__ */ jsxs85("div", { className: "flex min-h-0 w-full flex-col overflow-y-auto", children: [
|
|
13158
|
-
/* @__PURE__ */ jsx146("h2", { className: "text-xl font-semibold", children: t(`
|
|
13136
|
+
/* @__PURE__ */ jsx146("h2", { className: "text-xl font-semibold", children: t(`content.news`) }),
|
|
13159
13137
|
/* @__PURE__ */ jsx146("div", { className: "flex flex-col", children: contentList.map((content) => /* @__PURE__ */ jsx146(ContentsListElement, { content }, content.id)) })
|
|
13160
13138
|
] });
|
|
13161
13139
|
}
|
|
@@ -13196,7 +13174,7 @@ function ContentsListById({ contentIds }) {
|
|
|
13196
13174
|
data,
|
|
13197
13175
|
fields: ["name" /* name */, "authors" /* authors */, "updatedAt" /* updatedAt */],
|
|
13198
13176
|
tableGeneratorType: Modules.Content,
|
|
13199
|
-
title: t(`
|
|
13177
|
+
title: t(`common.relevant`)
|
|
13200
13178
|
}
|
|
13201
13179
|
);
|
|
13202
13180
|
}
|
|
@@ -13218,7 +13196,7 @@ function RelevantContentsList({ id }) {
|
|
|
13218
13196
|
data,
|
|
13219
13197
|
fields: ["name" /* name */, "authors" /* authors */, "relevance" /* relevance */, "updatedAt" /* updatedAt */],
|
|
13220
13198
|
tableGeneratorType: Modules.Content,
|
|
13221
|
-
title: t(`
|
|
13199
|
+
title: t(`common.relevant`)
|
|
13222
13200
|
}
|
|
13223
13201
|
);
|
|
13224
13202
|
}
|
|
@@ -13291,7 +13269,7 @@ function NotificationsList({ archived }) {
|
|
|
13291
13269
|
return /* @__PURE__ */ jsx150(Card, { children: /* @__PURE__ */ jsx150(CardContent, { className: "p-0", children: /* @__PURE__ */ jsxs87("div", { className: `flex w-full flex-row items-center p-2`, children: [
|
|
13292
13270
|
notificationData.actor ? /* @__PURE__ */ jsx150("div", { className: "flex w-12 max-w-12 px-2", children: /* @__PURE__ */ jsx150(Link, { href: generateUrl({ page: Modules.User, id: notificationData.actor.id }), children: /* @__PURE__ */ jsx150(UserAvatar, { user: notificationData.actor, className: "h-8 w-8" }) }) }) : /* @__PURE__ */ jsx150("div", { className: "flex w-14 max-w-14 px-2" }),
|
|
13293
13271
|
/* @__PURE__ */ jsxs87("div", { className: "flex w-full flex-col", children: [
|
|
13294
|
-
/* @__PURE__ */ jsx150("p", { className: "text-sm", children: t.rich(`
|
|
13272
|
+
/* @__PURE__ */ jsx150("p", { className: "text-sm", children: t.rich(`notification.${notification.notificationType}.description`, {
|
|
13295
13273
|
strong: /* @__PURE__ */ __name((chunks) => /* @__PURE__ */ jsx150("strong", { children: chunks }), "strong"),
|
|
13296
13274
|
actor: notificationData.actor?.name ?? "",
|
|
13297
13275
|
title: notificationData.title
|
|
@@ -13299,7 +13277,7 @@ function NotificationsList({ archived }) {
|
|
|
13299
13277
|
/* @__PURE__ */ jsx150("div", { className: "text-muted-foreground mt-1 w-full text-xs", children: new Date(notification.createdAt).toLocaleString() })
|
|
13300
13278
|
] }),
|
|
13301
13279
|
/* @__PURE__ */ jsxs87("div", { className: "flex flex-row items-center", children: [
|
|
13302
|
-
notificationData.url ? /* @__PURE__ */ jsx150(Link, { href: notificationData.url, children: /* @__PURE__ */ jsx150(Button, { variant: `outline`, size: `sm`, onClick: (e) => e.stopPropagation(), children: t(`
|
|
13280
|
+
notificationData.url ? /* @__PURE__ */ jsx150(Link, { href: notificationData.url, children: /* @__PURE__ */ jsx150(Button, { variant: `outline`, size: `sm`, onClick: (e) => e.stopPropagation(), children: t(`notification.${notification.notificationType}.buttons.action`) }) }) : /* @__PURE__ */ jsx150(Fragment27, {}),
|
|
13303
13281
|
!archived && /* @__PURE__ */ jsxs87(Tooltip2, { children: [
|
|
13304
13282
|
/* @__PURE__ */ jsx150(TooltipTrigger, { children: /* @__PURE__ */ jsx150(
|
|
13305
13283
|
Button,
|
|
@@ -13314,7 +13292,7 @@ function NotificationsList({ archived }) {
|
|
|
13314
13292
|
children: /* @__PURE__ */ jsx150(ArchiveIcon, { className: "h-4 w-4 cursor-pointer" })
|
|
13315
13293
|
}
|
|
13316
13294
|
) }),
|
|
13317
|
-
/* @__PURE__ */ jsx150(TooltipContent, { children: t(`
|
|
13295
|
+
/* @__PURE__ */ jsx150(TooltipContent, { children: t(`notification.buttons.archive`) })
|
|
13318
13296
|
] })
|
|
13319
13297
|
] })
|
|
13320
13298
|
] }) }) }, notification.id);
|
|
@@ -13338,11 +13316,11 @@ function NotificationsListContainerContent() {
|
|
|
13338
13316
|
}
|
|
13339
13317
|
const tabs = [
|
|
13340
13318
|
{
|
|
13341
|
-
label: t(`
|
|
13319
|
+
label: t(`notification.inbox`),
|
|
13342
13320
|
content: /* @__PURE__ */ jsx151(NotificationsList, { archived: false })
|
|
13343
13321
|
},
|
|
13344
13322
|
{
|
|
13345
|
-
label: t(`
|
|
13323
|
+
label: t(`notification.archived`),
|
|
13346
13324
|
content: /* @__PURE__ */ jsx151(NotificationsList, { archived: true })
|
|
13347
13325
|
}
|
|
13348
13326
|
];
|
|
@@ -13497,11 +13475,11 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
13497
13475
|
className: `h-5 w-5 cursor-pointer ${unreadNotifications ? "text-destructive" : ""} ${isLoading ? "animate-pulse" : ""}`
|
|
13498
13476
|
}
|
|
13499
13477
|
),
|
|
13500
|
-
t(`
|
|
13478
|
+
t(`entities.notifications`, { count: 2 })
|
|
13501
13479
|
] }) }),
|
|
13502
13480
|
/* @__PURE__ */ jsx152(PopoverContent, { className: "relative left-10 w-80 border-0 p-0 shadow-none", children: /* @__PURE__ */ jsxs89(Card, { children: [
|
|
13503
13481
|
/* @__PURE__ */ jsxs89(CardHeader, { className: "p-4", children: [
|
|
13504
|
-
/* @__PURE__ */ jsx152(CardTitle, { children: t(`
|
|
13482
|
+
/* @__PURE__ */ jsx152(CardTitle, { children: t(`entities.notifications`, { count: 2 }) }),
|
|
13505
13483
|
isLoading && /* @__PURE__ */ jsx152("div", { className: "text-muted-foreground text-xs", children: "Loading..." }),
|
|
13506
13484
|
error && /* @__PURE__ */ jsxs89("div", { className: "text-destructive text-xs", children: [
|
|
13507
13485
|
"Error: ",
|
|
@@ -13509,7 +13487,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
13509
13487
|
] })
|
|
13510
13488
|
] }),
|
|
13511
13489
|
/* @__PURE__ */ jsx152(Separator, {}),
|
|
13512
|
-
/* @__PURE__ */ jsx152(ScrollArea, { className: "h-96", children: notifications.length > 0 ? notifications.map((notification) => /* @__PURE__ */ jsx152(Fragment28, { children: generateNotification(notification, () => setIsOpen(false)) }, notification.id)) : /* @__PURE__ */ jsx152("div", { className: "p-4 text-center text-sm text-gray-500", children: t(`
|
|
13490
|
+
/* @__PURE__ */ jsx152(ScrollArea, { className: "h-96", children: notifications.length > 0 ? notifications.map((notification) => /* @__PURE__ */ jsx152(Fragment28, { children: generateNotification(notification, () => setIsOpen(false)) }, notification.id)) : /* @__PURE__ */ jsx152("div", { className: "p-4 text-center text-sm text-gray-500", children: t(`notification.empty`) }) })
|
|
13513
13491
|
] }) })
|
|
13514
13492
|
] });
|
|
13515
13493
|
}
|
|
@@ -13534,7 +13512,7 @@ function RoleDetails() {
|
|
|
13534
13512
|
const { role } = useRoleContext();
|
|
13535
13513
|
const t = useTranslations60();
|
|
13536
13514
|
if (!role) return null;
|
|
13537
|
-
return /* @__PURE__ */ jsx154(Card, { className: "w-full", children: /* @__PURE__ */ jsx154(CardContent, { className: "p-4", children: /* @__PURE__ */ jsx154(AttributeElement, { title: t(`
|
|
13515
|
+
return /* @__PURE__ */ jsx154(Card, { className: "w-full", children: /* @__PURE__ */ jsx154(CardContent, { className: "p-4", children: /* @__PURE__ */ jsx154(AttributeElement, { title: t(`role.fields.description.label`), value: role.description }) }) });
|
|
13538
13516
|
}
|
|
13539
13517
|
__name(RoleDetails, "RoleDetails");
|
|
13540
13518
|
|
|
@@ -13576,8 +13554,8 @@ function FormRoles({ form, id, name, roles }) {
|
|
|
13576
13554
|
}
|
|
13577
13555
|
),
|
|
13578
13556
|
/* @__PURE__ */ jsxs91(Tooltip2, { children: [
|
|
13579
|
-
/* @__PURE__ */ jsx156(TooltipTrigger, { children: /* @__PURE__ */ jsx156(FieldLabel, { className: "ml-3 font-normal", children: t(`
|
|
13580
|
-
/* @__PURE__ */ jsx156(TooltipContent, { children: t(`
|
|
13557
|
+
/* @__PURE__ */ jsx156(TooltipTrigger, { children: /* @__PURE__ */ jsx156(FieldLabel, { className: "ml-3 font-normal", children: t(`role.roles`, { role: role.id.replaceAll(`-`, ``) }) }) }),
|
|
13558
|
+
/* @__PURE__ */ jsx156(TooltipContent, { children: t(`role.roles_descriptions`, { role: role.id.replaceAll(`-`, ``) }) })
|
|
13581
13559
|
] })
|
|
13582
13560
|
] }, role.id);
|
|
13583
13561
|
}) }) }) });
|
|
@@ -13615,10 +13593,10 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
13615
13593
|
setOpen(false);
|
|
13616
13594
|
refresh();
|
|
13617
13595
|
} catch (error) {
|
|
13618
|
-
errorToast({ title: t(`
|
|
13596
|
+
errorToast({ title: t(`common.errors.error`), error });
|
|
13619
13597
|
}
|
|
13620
13598
|
}, "remove");
|
|
13621
|
-
const roleName = t(`
|
|
13599
|
+
const roleName = t(`role.roles`, { role: role.id.replaceAll(`-`, ``) });
|
|
13622
13600
|
return /* @__PURE__ */ jsxs92(Dialog, { open, onOpenChange: setOpen, children: [
|
|
13623
13601
|
/* @__PURE__ */ jsx157(
|
|
13624
13602
|
DialogTrigger,
|
|
@@ -13628,18 +13606,18 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
13628
13606
|
e.preventDefault();
|
|
13629
13607
|
setOpen(true);
|
|
13630
13608
|
},
|
|
13631
|
-
children: /* @__PURE__ */ jsx157("span", { className: "hover:text-destructive cursor-pointer", children: t(`
|
|
13609
|
+
children: /* @__PURE__ */ jsx157("span", { className: "hover:text-destructive cursor-pointer", children: t(`role.remove_user.title`) })
|
|
13632
13610
|
}
|
|
13633
13611
|
),
|
|
13634
13612
|
/* @__PURE__ */ jsxs92(DialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
13635
13613
|
/* @__PURE__ */ jsxs92(DialogHeader, { children: [
|
|
13636
|
-
/* @__PURE__ */ jsx157(DialogTitle, { children: t(`
|
|
13637
|
-
/* @__PURE__ */ jsx157(DialogDescription, { children: canRemove ? t(`
|
|
13614
|
+
/* @__PURE__ */ jsx157(DialogTitle, { children: t(`role.remove_user.title`) }),
|
|
13615
|
+
/* @__PURE__ */ jsx157(DialogDescription, { children: canRemove ? t(`role.remove_user.subtitle_allowed`) : t(`role.remove_user.subtitle_not_allowed`) })
|
|
13638
13616
|
] }),
|
|
13639
13617
|
canRemove ? /* @__PURE__ */ jsxs92(Fragment31, { children: [
|
|
13640
|
-
t(`
|
|
13618
|
+
t(`role.remove_user.description_allowed`, { role: roleName, user: user.name }),
|
|
13641
13619
|
/* @__PURE__ */ jsxs92("div", { className: "flex justify-end", children: [
|
|
13642
|
-
/* @__PURE__ */ jsx157(Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`
|
|
13620
|
+
/* @__PURE__ */ jsx157(Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`ui.buttons.cancel`) }),
|
|
13643
13621
|
/* @__PURE__ */ jsx157(
|
|
13644
13622
|
Button,
|
|
13645
13623
|
{
|
|
@@ -13649,11 +13627,11 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
13649
13627
|
remove();
|
|
13650
13628
|
},
|
|
13651
13629
|
variant: "destructive",
|
|
13652
|
-
children: t(`
|
|
13630
|
+
children: t(`ui.buttons.confirm_delete`)
|
|
13653
13631
|
}
|
|
13654
13632
|
)
|
|
13655
13633
|
] })
|
|
13656
|
-
] }) : /* @__PURE__ */ jsx157(Fragment31, { children: t(`
|
|
13634
|
+
] }) : /* @__PURE__ */ jsx157(Fragment31, { children: t(`role.remove_user.description_not_allowed`, { role: roleName, user: user.name }) })
|
|
13657
13635
|
] })
|
|
13658
13636
|
] });
|
|
13659
13637
|
}
|
|
@@ -13678,14 +13656,14 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
13678
13656
|
});
|
|
13679
13657
|
setRoles(roles.filter((u) => u.id !== role.id));
|
|
13680
13658
|
toast10.message(
|
|
13681
|
-
t(`
|
|
13682
|
-
source: t(`
|
|
13683
|
-
destination: t(`
|
|
13659
|
+
t(`common.association.label`, {
|
|
13660
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
13661
|
+
destination: t(`entities.users`, { count: 1 })
|
|
13684
13662
|
}),
|
|
13685
13663
|
{
|
|
13686
|
-
description: t(`
|
|
13687
|
-
source: t(`
|
|
13688
|
-
destination: t(`
|
|
13664
|
+
description: t(`common.association.success`, {
|
|
13665
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
13666
|
+
destination: t(`entities.users`, { count: 1 }),
|
|
13689
13667
|
source_name: role.name,
|
|
13690
13668
|
destination_name: user.name
|
|
13691
13669
|
})
|
|
@@ -13714,40 +13692,40 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
13714
13692
|
return /* @__PURE__ */ jsxs93(Fragment32, { children: [
|
|
13715
13693
|
/* @__PURE__ */ jsxs93(Button, { size: "sm", onClick: () => setOpen(true), children: [
|
|
13716
13694
|
/* @__PURE__ */ jsx158(PlusCircle2, { className: "mr-3 h-3.5 w-3.5" }),
|
|
13717
|
-
t(`
|
|
13718
|
-
source: t(`
|
|
13719
|
-
destination: t(`
|
|
13695
|
+
t(`common.association.label`, {
|
|
13696
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
13697
|
+
destination: t(`entities.users`, { count: 1 })
|
|
13720
13698
|
})
|
|
13721
13699
|
] }),
|
|
13722
13700
|
/* @__PURE__ */ jsxs93(CommandDialog, { open, onOpenChange: setOpen, children: [
|
|
13723
|
-
/* @__PURE__ */ jsx158(DialogTitle, { children: t(`
|
|
13724
|
-
source: t(`
|
|
13725
|
-
destination: t(`
|
|
13701
|
+
/* @__PURE__ */ jsx158(DialogTitle, { children: t(`common.association.label`, {
|
|
13702
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
13703
|
+
destination: t(`entities.users`, { count: 1 })
|
|
13726
13704
|
}) }),
|
|
13727
|
-
/* @__PURE__ */ jsx158(DialogDescription, { children: t(`
|
|
13728
|
-
source: t(`
|
|
13729
|
-
destination: t(`
|
|
13705
|
+
/* @__PURE__ */ jsx158(DialogDescription, { children: t(`common.association.description`, {
|
|
13706
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
13707
|
+
destination: t(`entities.users`, { count: 1 }),
|
|
13730
13708
|
destination_name: user.name
|
|
13731
13709
|
}) }),
|
|
13732
13710
|
/* @__PURE__ */ jsxs93(Command, { shouldFilter: false, children: [
|
|
13733
13711
|
/* @__PURE__ */ jsx158(
|
|
13734
13712
|
CommandInput,
|
|
13735
13713
|
{
|
|
13736
|
-
placeholder: t(`
|
|
13714
|
+
placeholder: t(`ui.search.placeholder`, { type: t(`entities.roles`, { count: 1 }) }),
|
|
13737
13715
|
value: searchTerm,
|
|
13738
13716
|
onValueChange: setSearchTerm,
|
|
13739
13717
|
ref: inputRef
|
|
13740
13718
|
}
|
|
13741
13719
|
),
|
|
13742
13720
|
/* @__PURE__ */ jsxs93(CommandList, { className: "mt-3 h-auto max-h-96 min-h-96 max-w-full overflow-x-hidden overflow-y-auto", children: [
|
|
13743
|
-
/* @__PURE__ */ jsx158(CommandEmpty, { children: t(`
|
|
13721
|
+
/* @__PURE__ */ jsx158(CommandEmpty, { children: t(`ui.search.no_results`, { type: t(`entities.roles`, { count: 1 }) }) }),
|
|
13744
13722
|
roles.map((role) => /* @__PURE__ */ jsx158(
|
|
13745
13723
|
CommandItem,
|
|
13746
13724
|
{
|
|
13747
13725
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
13748
13726
|
onSelect: () => addUserToRole(role),
|
|
13749
13727
|
onClick: () => addUserToRole(role),
|
|
13750
|
-
children: t(`
|
|
13728
|
+
children: t(`role.roles`, { role: role.id.replaceAll(`-`, ``) })
|
|
13751
13729
|
},
|
|
13752
13730
|
role.id
|
|
13753
13731
|
))
|
|
@@ -13774,7 +13752,7 @@ function RolesList() {
|
|
|
13774
13752
|
data,
|
|
13775
13753
|
fields: ["name" /* name */, "description" /* description */],
|
|
13776
13754
|
tableGeneratorType: Modules.Role,
|
|
13777
|
-
title: t(`
|
|
13755
|
+
title: t(`entities.roles`, { count: 2 })
|
|
13778
13756
|
}
|
|
13779
13757
|
);
|
|
13780
13758
|
}
|
|
@@ -13796,7 +13774,7 @@ function UserRolesList({ user }) {
|
|
|
13796
13774
|
data,
|
|
13797
13775
|
fields: ["name" /* name */, "description" /* description */],
|
|
13798
13776
|
tableGeneratorType: Modules.Role,
|
|
13799
|
-
title: t(`
|
|
13777
|
+
title: t(`entities.roles`, { count: 2 })
|
|
13800
13778
|
}
|
|
13801
13779
|
);
|
|
13802
13780
|
}
|
|
@@ -15106,4 +15084,4 @@ export {
|
|
|
15106
15084
|
useOAuthClients,
|
|
15107
15085
|
useOAuthClient
|
|
15108
15086
|
};
|
|
15109
|
-
//# sourceMappingURL=chunk-
|
|
15087
|
+
//# sourceMappingURL=chunk-CWY6AL4V.mjs.map
|