@carlonicora/nextjs-jsonapi 1.29.2 → 1.29.3
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-BEWKLGW3.js → BlockNoteEditor-CJWHJRG3.js} +10 -10
- package/dist/BlockNoteEditor-CJWHJRG3.js.map +1 -0
- package/dist/{BlockNoteEditor-GNFK7ZVR.mjs → BlockNoteEditor-ZET7ANBC.mjs} +6 -6
- package/dist/BlockNoteEditor-ZET7ANBC.mjs.map +1 -0
- package/dist/billing/index.js +291 -291
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-IJSB4FH6.mjs → chunk-3HGZMKT4.mjs} +493 -523
- package/dist/chunk-3HGZMKT4.mjs.map +1 -0
- package/dist/{chunk-XU4MY6OG.js → chunk-6HQ6CPVL.js} +493 -523
- package/dist/chunk-6HQ6CPVL.js.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/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
|
@@ -41,7 +41,7 @@ function CompanyDeleterInternal({ company }: CompanyDeleterProps) {
|
|
|
41
41
|
await CompanyService.delete({ companyId: company.id });
|
|
42
42
|
router.push("/");
|
|
43
43
|
} catch (error) {
|
|
44
|
-
errorToast({ title: t(`
|
|
44
|
+
errorToast({ title: t(`common.errors.delete`), error: error });
|
|
45
45
|
}
|
|
46
46
|
setIsDeleting(false);
|
|
47
47
|
};
|
|
@@ -51,29 +51,31 @@ function CompanyDeleterInternal({ company }: CompanyDeleterProps) {
|
|
|
51
51
|
<AlertDialogTrigger>
|
|
52
52
|
<Button size="sm" variant={"destructive"}>
|
|
53
53
|
<Trash2Icon className="mr-3 h-3.5 w-3.5" />
|
|
54
|
-
{t(`
|
|
54
|
+
{t(`ui.buttons.delete`)}
|
|
55
55
|
</Button>
|
|
56
56
|
</AlertDialogTrigger>
|
|
57
57
|
<AlertDialogContent className={`flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`}>
|
|
58
58
|
<AlertDialogHeader>
|
|
59
|
-
<AlertDialogTitle>
|
|
59
|
+
<AlertDialogTitle>
|
|
60
|
+
{t(`common.delete.title`, { type: t(`entities.companies`, { count: 1 }) })}
|
|
61
|
+
</AlertDialogTitle>
|
|
60
62
|
<AlertDialogDescription>
|
|
61
|
-
{t(`
|
|
63
|
+
{t(`common.delete.subtitle`, { type: t(`entities.companies`, { count: 1 }) })}
|
|
62
64
|
</AlertDialogDescription>
|
|
63
65
|
</AlertDialogHeader>
|
|
64
66
|
<div className="text-destructive p-4 text-sm">
|
|
65
|
-
{t(`
|
|
67
|
+
{t(`common.delete.description`, { type: t(`entities.companies`, { count: 1 }) })}
|
|
66
68
|
</div>
|
|
67
69
|
<div className="flex w-full flex-col gap-y-2">
|
|
68
|
-
<div>{t(`
|
|
70
|
+
<div>{t(`common.delete.confirmation`, { type: t(`entities.companies`, { count: 1 }) })}</div>
|
|
69
71
|
<div className="flex w-full flex-col">
|
|
70
72
|
<Label className="flex items-center">
|
|
71
|
-
{t(`
|
|
73
|
+
{t(`company.fields.name.label`)}
|
|
72
74
|
<span className="text-destructive ml-2 font-semibold">*</span>
|
|
73
75
|
</Label>
|
|
74
76
|
<Input
|
|
75
77
|
className={`w-full`}
|
|
76
|
-
placeholder={t(`
|
|
78
|
+
placeholder={t(`company.fields.name.placeholder`)}
|
|
77
79
|
onChange={(e) => setCompanyName(e.target.value)}
|
|
78
80
|
/>
|
|
79
81
|
</div>
|
|
@@ -86,7 +88,7 @@ function CompanyDeleterInternal({ company }: CompanyDeleterProps) {
|
|
|
86
88
|
onClick={() => setOpen(false)}
|
|
87
89
|
disabled={isDeleting}
|
|
88
90
|
>
|
|
89
|
-
{t(`
|
|
91
|
+
{t(`ui.buttons.cancel`)}
|
|
90
92
|
</Button>
|
|
91
93
|
<Button
|
|
92
94
|
type="submit"
|
|
@@ -99,11 +101,11 @@ function CompanyDeleterInternal({ company }: CompanyDeleterProps) {
|
|
|
99
101
|
>
|
|
100
102
|
{isDeleting ? (
|
|
101
103
|
<>
|
|
102
|
-
{t(`
|
|
104
|
+
{t(`ui.buttons.is_deleting`)}
|
|
103
105
|
<LoaderCircleIcon className="animate-spin-slow h-5 w-5" />
|
|
104
106
|
</>
|
|
105
107
|
) : (
|
|
106
|
-
t(`
|
|
108
|
+
t(`ui.buttons.delete`)
|
|
107
109
|
)}
|
|
108
110
|
</Button>
|
|
109
111
|
</div>
|
|
@@ -54,7 +54,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }: Comp
|
|
|
54
54
|
const formSchema = z.object({
|
|
55
55
|
id: z.uuidv4(),
|
|
56
56
|
name: z.string().min(1, {
|
|
57
|
-
message: t(`
|
|
57
|
+
message: t(`company.fields.name.error`),
|
|
58
58
|
}),
|
|
59
59
|
featureIds: z.array(z.string()).optional(),
|
|
60
60
|
moduleIds: z.array(z.string()).optional(),
|
|
@@ -110,7 +110,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }: Comp
|
|
|
110
110
|
}
|
|
111
111
|
} catch (error) {
|
|
112
112
|
errorToast({
|
|
113
|
-
title: company ? t(`
|
|
113
|
+
title: company ? t(`common.errors.update`) : t(`common.errors.create`),
|
|
114
114
|
error,
|
|
115
115
|
});
|
|
116
116
|
}
|
|
@@ -186,7 +186,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }: Comp
|
|
|
186
186
|
<DialogContent
|
|
187
187
|
className={`flex max-h-[70vh] w-full ${isAdministrator || canAccessFeatures ? `max-w-5xl` : `max-w-4xl`} flex-col overflow-y-auto`}
|
|
188
188
|
>
|
|
189
|
-
<CommonEditorHeader type={t(`
|
|
189
|
+
<CommonEditorHeader type={t(`entities.companies`, { count: 1 })} name={company?.name} />
|
|
190
190
|
<Form {...form}>
|
|
191
191
|
<form onSubmit={form.handleSubmit(onSubmit)} className={`flex w-full flex-col gap-y-4`}>
|
|
192
192
|
<div className="flex w-full items-start justify-between gap-x-4">
|
|
@@ -205,9 +205,7 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }: Comp
|
|
|
205
205
|
) : (
|
|
206
206
|
<>
|
|
207
207
|
<UploadIcon className="my-4 h-8 w-8" />
|
|
208
|
-
<p className="mb-1 flex w-full text-center text-sm">
|
|
209
|
-
{t(`foundations.company.click_drag_logo`)}
|
|
210
|
-
</p>
|
|
208
|
+
<p className="mb-1 flex w-full text-center text-sm">{t(`company.click_drag_logo`)}</p>
|
|
211
209
|
</>
|
|
212
210
|
)}
|
|
213
211
|
</div>
|
|
@@ -219,18 +217,14 @@ function CompanyEditorInternal({ company, propagateChanges, onRevalidate }: Comp
|
|
|
219
217
|
<FormInput
|
|
220
218
|
form={form}
|
|
221
219
|
id="name"
|
|
222
|
-
name={t(`
|
|
223
|
-
placeholder={t(`
|
|
220
|
+
name={t(`company.fields.name.label`)}
|
|
221
|
+
placeholder={t(`company.fields.name.placeholder`)}
|
|
224
222
|
/>
|
|
225
223
|
</div>
|
|
226
224
|
{canAccessFeatures && (
|
|
227
225
|
<div className={`flex w-96 flex-col justify-start gap-y-4`}>
|
|
228
226
|
<ScrollArea className="h-max">
|
|
229
|
-
<FormFeatures
|
|
230
|
-
form={form}
|
|
231
|
-
name={t(`foundations.company.features_and_modules`)}
|
|
232
|
-
features={features}
|
|
233
|
-
/>
|
|
227
|
+
<FormFeatures form={form} name={t(`company.features_and_modules`)} features={features} />
|
|
234
228
|
</ScrollArea>
|
|
235
229
|
</div>
|
|
236
230
|
)}
|
|
@@ -26,7 +26,7 @@ export function CompaniesList() {
|
|
|
26
26
|
fields={[CompanyFields.name, CompanyFields.createdAt]}
|
|
27
27
|
tableGeneratorType={Modules.Company}
|
|
28
28
|
functions={functions}
|
|
29
|
-
title={t(`
|
|
29
|
+
title={t(`entities.companies`, { count: 2 })}
|
|
30
30
|
/>
|
|
31
31
|
);
|
|
32
32
|
}
|
|
@@ -53,7 +53,7 @@ export const CompanyProvider = ({ children, dehydratedCompany }: CompanyProvider
|
|
|
53
53
|
|
|
54
54
|
const title = () => {
|
|
55
55
|
const response: any = {
|
|
56
|
-
type: t(`
|
|
56
|
+
type: t(`entities.companies`, { count: company ? 1 : 2 }),
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
if (company) response.element = company.name;
|
|
@@ -41,7 +41,7 @@ export const useCompanyTableStructure: UseTableStructureHook<CompanyInterface, C
|
|
|
41
41
|
[CompanyFields.name]: () => ({
|
|
42
42
|
id: "name",
|
|
43
43
|
accessorKey: "name",
|
|
44
|
-
header: t(`
|
|
44
|
+
header: t(`user.fields.name.label`),
|
|
45
45
|
cell: ({ row }: { row: Row<TableContent<CompanyInterface>> }) => {
|
|
46
46
|
const company = row.original.jsonApiData as CompanyInterface;
|
|
47
47
|
return (
|
|
@@ -66,7 +66,7 @@ export const useCompanyTableStructure: UseTableStructureHook<CompanyInterface, C
|
|
|
66
66
|
[CompanyFields.createdAt]: () =>
|
|
67
67
|
cellDate({
|
|
68
68
|
name: "createdAt",
|
|
69
|
-
title: t(`
|
|
69
|
+
title: t(`common.date.create`),
|
|
70
70
|
}),
|
|
71
71
|
};
|
|
72
72
|
|
|
@@ -17,7 +17,7 @@ export function ContentsList({ contentList }: ContentsListProps) {
|
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<div className="flex min-h-0 w-full flex-col overflow-y-auto">
|
|
20
|
-
<h2 className="text-xl font-semibold">{t(`
|
|
20
|
+
<h2 className="text-xl font-semibold">{t(`content.news`)}</h2>
|
|
21
21
|
<div className="flex flex-col">
|
|
22
22
|
{contentList.map((content) => (
|
|
23
23
|
<ContentsListElement content={content} key={content.id} />
|
|
@@ -25,7 +25,7 @@ export function ContentsListById({ contentIds }: ContentsListByIdProps) {
|
|
|
25
25
|
data={data}
|
|
26
26
|
fields={[ContentFields.name, ContentFields.authors, ContentFields.updatedAt]}
|
|
27
27
|
tableGeneratorType={Modules.Content}
|
|
28
|
-
title={t(`
|
|
28
|
+
title={t(`common.relevant`)}
|
|
29
29
|
/>
|
|
30
30
|
);
|
|
31
31
|
}
|
|
@@ -25,7 +25,7 @@ export function RelevantContentsList({ id }: RelevantContentsListProps) {
|
|
|
25
25
|
data={data}
|
|
26
26
|
fields={[ContentFields.name, ContentFields.authors, ContentFields.relevance, ContentFields.updatedAt]}
|
|
27
27
|
tableGeneratorType={Modules.Content}
|
|
28
|
-
title={t(`
|
|
28
|
+
title={t(`common.relevant`)}
|
|
29
29
|
/>
|
|
30
30
|
);
|
|
31
31
|
}
|
|
@@ -39,7 +39,7 @@ export const useContentTableStructure = <U extends string = ContentFields>(
|
|
|
39
39
|
[ContentFields.name]: () => ({
|
|
40
40
|
id: "name",
|
|
41
41
|
accessorKey: "name",
|
|
42
|
-
header: t(`
|
|
42
|
+
header: t(`content.fields.name.label`),
|
|
43
43
|
cell: ({ row }: { row: TableContent<ContentInterface> }) => {
|
|
44
44
|
const content: ContentInterface = row.original.jsonApiData;
|
|
45
45
|
|
|
@@ -64,7 +64,7 @@ export const useContentTableStructure = <U extends string = ContentFields>(
|
|
|
64
64
|
[ContentFields.relevance]: () => ({
|
|
65
65
|
id: "relevance",
|
|
66
66
|
accessorKey: "relevance",
|
|
67
|
-
header: t(`
|
|
67
|
+
header: t(`common.relevance`),
|
|
68
68
|
cell: ({ row }: { row: TableContent<ContentInterface> }) => {
|
|
69
69
|
const content: ContentInterface = row.original.jsonApiData;
|
|
70
70
|
|
|
@@ -92,7 +92,7 @@ export const useContentTableStructure = <U extends string = ContentFields>(
|
|
|
92
92
|
[ContentFields.authors]: () => ({
|
|
93
93
|
id: "authors",
|
|
94
94
|
accessorKey: "authors",
|
|
95
|
-
header: t(`
|
|
95
|
+
header: t(`common.relationships.author.label`),
|
|
96
96
|
cell: ({ row }: { row: TableContent<ContentInterface> }) => {
|
|
97
97
|
const content: ContentInterface = row.original.jsonApiData;
|
|
98
98
|
return <ContributorsList content={content} />;
|
|
@@ -103,12 +103,12 @@ export const useContentTableStructure = <U extends string = ContentFields>(
|
|
|
103
103
|
[ContentFields.createdAt]: () =>
|
|
104
104
|
cellDate({
|
|
105
105
|
name: "createdAt",
|
|
106
|
-
title: t(`
|
|
106
|
+
title: t(`common.date.create`),
|
|
107
107
|
}),
|
|
108
108
|
[ContentFields.updatedAt]: () =>
|
|
109
109
|
cellDate({
|
|
110
110
|
name: "updatedAt",
|
|
111
|
-
title: t(`
|
|
111
|
+
title: t(`common.date.update`),
|
|
112
112
|
}),
|
|
113
113
|
};
|
|
114
114
|
|
|
@@ -23,11 +23,11 @@ function NotificationsListContainerContent() {
|
|
|
23
23
|
|
|
24
24
|
const tabs: Tab[] = [
|
|
25
25
|
{
|
|
26
|
-
label: t(`
|
|
26
|
+
label: t(`notification.inbox`),
|
|
27
27
|
content: <NotificationsList archived={false} />,
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
label: t(`
|
|
30
|
+
label: t(`notification.archived`),
|
|
31
31
|
content: <NotificationsList archived={true} />,
|
|
32
32
|
},
|
|
33
33
|
];
|
|
@@ -78,7 +78,7 @@ export function NotificationsList({ archived }: NotificationsListProps) {
|
|
|
78
78
|
)}
|
|
79
79
|
<div className="flex w-full flex-col">
|
|
80
80
|
<p className="text-sm">
|
|
81
|
-
{t.rich(`
|
|
81
|
+
{t.rich(`notification.${notification.notificationType}.description` as any, {
|
|
82
82
|
strong: (chunks: any) => <strong>{chunks}</strong>,
|
|
83
83
|
actor: notificationData.actor?.name ?? "",
|
|
84
84
|
title: notificationData.title,
|
|
@@ -92,7 +92,7 @@ export function NotificationsList({ archived }: NotificationsListProps) {
|
|
|
92
92
|
{notificationData.url ? (
|
|
93
93
|
<Link href={notificationData.url}>
|
|
94
94
|
<Button variant={`outline`} size={`sm`} onClick={(e) => e.stopPropagation()}>
|
|
95
|
-
{t(`
|
|
95
|
+
{t(`notification.${notification.notificationType}.buttons.action` as any)}
|
|
96
96
|
</Button>
|
|
97
97
|
</Link>
|
|
98
98
|
) : (
|
|
@@ -113,7 +113,7 @@ export function NotificationsList({ archived }: NotificationsListProps) {
|
|
|
113
113
|
<ArchiveIcon className="h-4 w-4 cursor-pointer" />
|
|
114
114
|
</Button>
|
|
115
115
|
</TooltipTrigger>
|
|
116
|
-
<TooltipContent>{t(`
|
|
116
|
+
<TooltipContent>{t(`notification.buttons.archive`)}</TooltipContent>
|
|
117
117
|
</Tooltip>
|
|
118
118
|
)}
|
|
119
119
|
</div>
|
|
@@ -196,13 +196,13 @@ function NotificationModalContent({ isOpen, setIsOpen }: NotificationModalProps)
|
|
|
196
196
|
<BellIcon
|
|
197
197
|
className={`h-5 w-5 cursor-pointer ${unreadNotifications ? "text-destructive" : ""} ${isLoading ? "animate-pulse" : ""}`}
|
|
198
198
|
/>
|
|
199
|
-
{t(`
|
|
199
|
+
{t(`entities.notifications`, { count: 2 })}
|
|
200
200
|
</SidebarMenuButton>
|
|
201
201
|
</PopoverTrigger>
|
|
202
202
|
<PopoverContent className="relative left-10 w-80 border-0 p-0 shadow-none">
|
|
203
203
|
<Card>
|
|
204
204
|
<CardHeader className="p-4">
|
|
205
|
-
<CardTitle>{t(`
|
|
205
|
+
<CardTitle>{t(`entities.notifications`, { count: 2 })}</CardTitle>
|
|
206
206
|
{isLoading && <div className="text-muted-foreground text-xs">Loading...</div>}
|
|
207
207
|
{error && <div className="text-destructive text-xs">Error: {error}</div>}
|
|
208
208
|
</CardHeader>
|
|
@@ -213,9 +213,7 @@ function NotificationModalContent({ isOpen, setIsOpen }: NotificationModalProps)
|
|
|
213
213
|
<Fragment key={notification.id}>{generateNotification(notification, () => setIsOpen(false))}</Fragment>
|
|
214
214
|
))
|
|
215
215
|
) : (
|
|
216
|
-
<div className="p-4 text-center text-sm text-gray-500">
|
|
217
|
-
{t(`foundations.notification.empty`, { count: 2 })}
|
|
218
|
-
</div>
|
|
216
|
+
<div className="p-4 text-center text-sm text-gray-500">{t(`notification.empty`)}</div>
|
|
219
217
|
)}
|
|
220
218
|
</ScrollArea>
|
|
221
219
|
</Card>
|
|
@@ -45,7 +45,7 @@ export function NotificationToast(
|
|
|
45
45
|
const data = generateNotificationData({ notification: notification, generateUrl: generateUrl });
|
|
46
46
|
|
|
47
47
|
return {
|
|
48
|
-
title: t(`
|
|
48
|
+
title: t(`notification.${notification.notificationType}.title`),
|
|
49
49
|
description: (
|
|
50
50
|
<div className={`flex w-full flex-row items-center p-2`}>
|
|
51
51
|
{data.actor ? (
|
|
@@ -57,7 +57,7 @@ export function NotificationToast(
|
|
|
57
57
|
)}
|
|
58
58
|
<div className="flex w-full flex-col">
|
|
59
59
|
<p className="text-sm">
|
|
60
|
-
{t.rich(`
|
|
60
|
+
{t.rich(`notification.${notification.notificationType}.description`, {
|
|
61
61
|
strong: (chunks: any) => <strong>{chunks}</strong>,
|
|
62
62
|
actor: data.actor?.name ?? "",
|
|
63
63
|
title: data.title,
|
|
@@ -72,7 +72,7 @@ export function NotificationToast(
|
|
|
72
72
|
),
|
|
73
73
|
action: data.url
|
|
74
74
|
? {
|
|
75
|
-
label: t(`
|
|
75
|
+
label: t(`notification.${notification.notificationType}.buttons.action`),
|
|
76
76
|
onClick: () => {
|
|
77
77
|
reouter.push(data.url!);
|
|
78
78
|
},
|
|
@@ -103,7 +103,7 @@ export function NotificationMenuItem({ notification, closePopover }: TaskComment
|
|
|
103
103
|
)}
|
|
104
104
|
<div className="flex w-full flex-col">
|
|
105
105
|
<p className="text-sm">
|
|
106
|
-
{t.rich(`
|
|
106
|
+
{t.rich(`notification.${notification.notificationType}.description` as any, {
|
|
107
107
|
strong: (chunks: any) => <strong>{chunks}</strong>,
|
|
108
108
|
actor: data.actor?.name ?? "",
|
|
109
109
|
title: data.title,
|
|
@@ -141,7 +141,7 @@ export const NotificationContextProvider = ({ children }: NotificationContextPro
|
|
|
141
141
|
const response: BreadcrumbItemData[] = [];
|
|
142
142
|
|
|
143
143
|
response.push({
|
|
144
|
-
name: t(`
|
|
144
|
+
name: t(`entities.notifications`, { count: 2 }),
|
|
145
145
|
});
|
|
146
146
|
|
|
147
147
|
return response;
|
|
@@ -149,7 +149,7 @@ export const NotificationContextProvider = ({ children }: NotificationContextPro
|
|
|
149
149
|
|
|
150
150
|
const title = () => {
|
|
151
151
|
const response: any = {
|
|
152
|
-
type: t(`
|
|
152
|
+
type: t(`entities.notifications`, { count: 2 }),
|
|
153
153
|
};
|
|
154
154
|
|
|
155
155
|
return response;
|
|
@@ -14,7 +14,7 @@ export function RoleDetails() {
|
|
|
14
14
|
return (
|
|
15
15
|
<Card className="w-full">
|
|
16
16
|
<CardContent className="p-4">
|
|
17
|
-
<AttributeElement title={t(`
|
|
17
|
+
<AttributeElement title={t(`role.fields.description.label`)} value={role.description} />
|
|
18
18
|
</CardContent>
|
|
19
19
|
</Card>
|
|
20
20
|
);
|
|
@@ -53,11 +53,11 @@ export function FormRoles({ form, id, name, roles }: FormRolesProps) {
|
|
|
53
53
|
<Tooltip>
|
|
54
54
|
<TooltipTrigger>
|
|
55
55
|
<FieldLabel className="ml-3 font-normal">
|
|
56
|
-
{t(`
|
|
56
|
+
{t(`role.roles`, { role: role.id.replaceAll(`-`, ``) })}
|
|
57
57
|
</FieldLabel>
|
|
58
58
|
</TooltipTrigger>
|
|
59
59
|
<TooltipContent>
|
|
60
|
-
{t(`
|
|
60
|
+
{t(`role.roles_descriptions`, { role: role.id.replaceAll(`-`, ``) })}
|
|
61
61
|
</TooltipContent>
|
|
62
62
|
</Tooltip>
|
|
63
63
|
</div>
|
|
@@ -56,11 +56,11 @@ export function RemoveUserFromRole({ role, user, refresh }: RemoveUserFromRolePr
|
|
|
56
56
|
setOpen(false);
|
|
57
57
|
refresh();
|
|
58
58
|
} catch (error) {
|
|
59
|
-
errorToast({ title: t(`
|
|
59
|
+
errorToast({ title: t(`common.errors.error`), error: error });
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
const roleName = t(`
|
|
63
|
+
const roleName = t(`role.roles`, { role: role.id.replaceAll(`-`, ``) });
|
|
64
64
|
|
|
65
65
|
return (
|
|
66
66
|
<Dialog open={open} onOpenChange={setOpen}>
|
|
@@ -71,23 +71,21 @@ export function RemoveUserFromRole({ role, user, refresh }: RemoveUserFromRolePr
|
|
|
71
71
|
setOpen(true);
|
|
72
72
|
}}
|
|
73
73
|
>
|
|
74
|
-
<span className="hover:text-destructive cursor-pointer">{t(`
|
|
74
|
+
<span className="hover:text-destructive cursor-pointer">{t(`role.remove_user.title`)}</span>
|
|
75
75
|
</DialogTrigger>
|
|
76
76
|
<DialogContent className={`flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`}>
|
|
77
77
|
<DialogHeader>
|
|
78
|
-
<DialogTitle>{t(`
|
|
78
|
+
<DialogTitle>{t(`role.remove_user.title`)}</DialogTitle>
|
|
79
79
|
<DialogDescription>
|
|
80
|
-
{canRemove
|
|
81
|
-
? t(`foundations.role.remove_user.subtitle_allowed`)
|
|
82
|
-
: t(`foundations.role.remove_user.subtitle_not_allowed`)}
|
|
80
|
+
{canRemove ? t(`role.remove_user.subtitle_allowed`) : t(`role.remove_user.subtitle_not_allowed`)}
|
|
83
81
|
</DialogDescription>
|
|
84
82
|
</DialogHeader>
|
|
85
83
|
{canRemove ? (
|
|
86
84
|
<>
|
|
87
|
-
{t(`
|
|
85
|
+
{t(`role.remove_user.description_allowed`, { role: roleName, user: user.name })}
|
|
88
86
|
<div className="flex justify-end">
|
|
89
87
|
<Button className="mr-2" variant={"outline"} type={`button`} onClick={() => setOpen(false)}>
|
|
90
|
-
{t(`
|
|
88
|
+
{t(`ui.buttons.cancel`)}
|
|
91
89
|
</Button>
|
|
92
90
|
<Button
|
|
93
91
|
type="submit"
|
|
@@ -97,12 +95,12 @@ export function RemoveUserFromRole({ role, user, refresh }: RemoveUserFromRolePr
|
|
|
97
95
|
}}
|
|
98
96
|
variant={"destructive"}
|
|
99
97
|
>
|
|
100
|
-
{t(`
|
|
98
|
+
{t(`ui.buttons.confirm_delete`)}
|
|
101
99
|
</Button>
|
|
102
100
|
</div>
|
|
103
101
|
</>
|
|
104
102
|
) : (
|
|
105
|
-
<>{t(`
|
|
103
|
+
<>{t(`role.remove_user.description_not_allowed`, { role: roleName, user: user.name })}</>
|
|
106
104
|
)}
|
|
107
105
|
</DialogContent>
|
|
108
106
|
</Dialog>
|
|
@@ -40,14 +40,14 @@ export function UserRoleAdd({ user, refresh }: UserRoleAddProps) {
|
|
|
40
40
|
setRoles(roles.filter((u) => u.id !== role.id));
|
|
41
41
|
|
|
42
42
|
toast.message(
|
|
43
|
-
t(`
|
|
44
|
-
source: t(`
|
|
45
|
-
destination: t(`
|
|
43
|
+
t(`common.association.label`, {
|
|
44
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
45
|
+
destination: t(`entities.users`, { count: 1 }),
|
|
46
46
|
}),
|
|
47
47
|
{
|
|
48
|
-
description: t(`
|
|
49
|
-
source: t(`
|
|
50
|
-
destination: t(`
|
|
48
|
+
description: t(`common.association.success`, {
|
|
49
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
50
|
+
destination: t(`entities.users`, { count: 1 }),
|
|
51
51
|
source_name: role.name,
|
|
52
52
|
destination_name: user.name,
|
|
53
53
|
}),
|
|
@@ -83,34 +83,34 @@ export function UserRoleAdd({ user, refresh }: UserRoleAddProps) {
|
|
|
83
83
|
<>
|
|
84
84
|
<Button size="sm" onClick={() => setOpen(true)}>
|
|
85
85
|
<PlusCircle className="mr-3 h-3.5 w-3.5" />
|
|
86
|
-
{t(`
|
|
87
|
-
source: t(`
|
|
88
|
-
destination: t(`
|
|
86
|
+
{t(`common.association.label`, {
|
|
87
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
88
|
+
destination: t(`entities.users`, { count: 1 }),
|
|
89
89
|
})}
|
|
90
90
|
</Button>
|
|
91
91
|
<CommandDialog open={open} onOpenChange={setOpen}>
|
|
92
92
|
<DialogTitle>
|
|
93
|
-
{t(`
|
|
94
|
-
source: t(`
|
|
95
|
-
destination: t(`
|
|
93
|
+
{t(`common.association.label`, {
|
|
94
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
95
|
+
destination: t(`entities.users`, { count: 1 }),
|
|
96
96
|
})}
|
|
97
97
|
</DialogTitle>
|
|
98
98
|
<DialogDescription>
|
|
99
|
-
{t(`
|
|
100
|
-
source: t(`
|
|
101
|
-
destination: t(`
|
|
99
|
+
{t(`common.association.description`, {
|
|
100
|
+
source: t(`entities.roles`, { count: 1 }),
|
|
101
|
+
destination: t(`entities.users`, { count: 1 }),
|
|
102
102
|
destination_name: user.name,
|
|
103
103
|
})}
|
|
104
104
|
</DialogDescription>
|
|
105
105
|
<Command shouldFilter={false}>
|
|
106
106
|
<CommandInput
|
|
107
|
-
placeholder={t(`
|
|
107
|
+
placeholder={t(`ui.search.placeholder`, { type: t(`entities.roles`, { count: 1 }) })}
|
|
108
108
|
value={searchTerm}
|
|
109
109
|
onValueChange={setSearchTerm}
|
|
110
110
|
ref={inputRef}
|
|
111
111
|
/>
|
|
112
112
|
<CommandList className="mt-3 h-auto max-h-96 min-h-96 max-w-full overflow-x-hidden overflow-y-auto">
|
|
113
|
-
<CommandEmpty>{t(`
|
|
113
|
+
<CommandEmpty>{t(`ui.search.no_results`, { type: t(`entities.roles`, { count: 1 }) })}</CommandEmpty>
|
|
114
114
|
{roles.map((role: RoleInterface) => (
|
|
115
115
|
<CommandItem
|
|
116
116
|
className="cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent"
|
|
@@ -118,7 +118,7 @@ export function UserRoleAdd({ user, refresh }: UserRoleAddProps) {
|
|
|
118
118
|
onSelect={() => addUserToRole(role)}
|
|
119
119
|
onClick={() => addUserToRole(role)}
|
|
120
120
|
>
|
|
121
|
-
{t(`
|
|
121
|
+
{t(`role.roles`, { role: role.id.replaceAll(`-`, ``) })}
|
|
122
122
|
</CommandItem>
|
|
123
123
|
))}
|
|
124
124
|
</CommandList>
|
|
@@ -26,7 +26,7 @@ export function UserRolesList({ user }: UserRolesListProps) {
|
|
|
26
26
|
data={data}
|
|
27
27
|
fields={[RoleFields.name, RoleFields.description]}
|
|
28
28
|
tableGeneratorType={Modules.Role}
|
|
29
|
-
title={t(`
|
|
29
|
+
title={t(`entities.roles`, { count: 2 })}
|
|
30
30
|
/>
|
|
31
31
|
);
|
|
32
32
|
}
|
|
@@ -32,7 +32,7 @@ export const RoleProvider = ({ children, dehydratedRole }: RoleProviderProps) =>
|
|
|
32
32
|
const response: BreadcrumbItemData[] = [];
|
|
33
33
|
|
|
34
34
|
response.push({
|
|
35
|
-
name: t(`
|
|
35
|
+
name: t(`entities.roles`, { count: 2 }),
|
|
36
36
|
href: generateUrl({ page: Modules.Role }),
|
|
37
37
|
});
|
|
38
38
|
|
|
@@ -47,7 +47,7 @@ export const RoleProvider = ({ children, dehydratedRole }: RoleProviderProps) =>
|
|
|
47
47
|
|
|
48
48
|
const title = () => {
|
|
49
49
|
const response: any = {
|
|
50
|
-
type: t(`
|
|
50
|
+
type: t(`entities.roles`, { count: role ? 1 : 2 }),
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
const functions: ReactNode[] = [];
|
|
@@ -37,7 +37,7 @@ export const useRoleTableStructure: UseTableStructureHook<RoleInterface, RoleFie
|
|
|
37
37
|
[RoleFields.name]: () => ({
|
|
38
38
|
id: "name",
|
|
39
39
|
accessorKey: "name",
|
|
40
|
-
header: t(`
|
|
40
|
+
header: t(`role.fields.name.label`),
|
|
41
41
|
cell: ({ row }: { row: Row<TableContent<RoleInterface>> }) => {
|
|
42
42
|
const role = row.original.jsonApiData as RoleInterface;
|
|
43
43
|
return <Link href={generateUrl({ page: Modules.Role, id: role.id })}>{row.getValue("name")}</Link>;
|
|
@@ -48,7 +48,7 @@ export const useRoleTableStructure: UseTableStructureHook<RoleInterface, RoleFie
|
|
|
48
48
|
[RoleFields.description]: () => ({
|
|
49
49
|
id: "description",
|
|
50
50
|
accessorKey: "description",
|
|
51
|
-
header: t(`
|
|
51
|
+
header: t(`role.fields.description.label`),
|
|
52
52
|
cell: ({ row }: { row: Row<TableContent<RoleInterface>> }) => <>{row.getValue("description")}</>,
|
|
53
53
|
enableSorting: false,
|
|
54
54
|
enableHiding: false,
|
|
@@ -56,7 +56,7 @@ export const useRoleTableStructure: UseTableStructureHook<RoleInterface, RoleFie
|
|
|
56
56
|
[RoleFields.createdAt]: () =>
|
|
57
57
|
cellDate({
|
|
58
58
|
name: "createdAt",
|
|
59
|
-
title: t(`
|
|
59
|
+
title: t(`common.date.create`),
|
|
60
60
|
}),
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -15,13 +15,13 @@ function UsersListContainerInternal() {
|
|
|
15
15
|
|
|
16
16
|
const tabs: Tab[] = [
|
|
17
17
|
{
|
|
18
|
-
label: t(`
|
|
18
|
+
label: t(`entities.users`, { count: 2 }),
|
|
19
19
|
content: <CompanyUsersList />,
|
|
20
20
|
modules: [Modules.Company],
|
|
21
21
|
action: Action.Read,
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
label: t(`
|
|
24
|
+
label: t(`user.deleted`),
|
|
25
25
|
content: <CompanyUsersList isDeleted={true} />,
|
|
26
26
|
modules: [Modules.Company],
|
|
27
27
|
action: Action.Update,
|
|
@@ -29,7 +29,7 @@ export function UserDetails({ user }: UserDetailsProps) {
|
|
|
29
29
|
{user.roles.map((role: RoleInterface, index: number) => (
|
|
30
30
|
<Link key={role.id} href={generateUrl({ page: Modules.Role, id: role.id })}>
|
|
31
31
|
<Badge className="mr-2" variant={`default`}>
|
|
32
|
-
{t(`
|
|
32
|
+
{t(`role.roles`, { role: role.id.replaceAll(`-`, ``) })}
|
|
33
33
|
</Badge>
|
|
34
34
|
</Link>
|
|
35
35
|
))}
|
|
@@ -54,21 +54,21 @@ export function UserDetails({ user }: UserDetailsProps) {
|
|
|
54
54
|
<ContentTitle module={Modules.User} type={title.type} element={title.element} functions={title.functions} />
|
|
55
55
|
{user.isDeleted ? (
|
|
56
56
|
<div>
|
|
57
|
-
<Badge variant="destructive">{t(`
|
|
57
|
+
<Badge variant="destructive">{t(`user.errors.deleted`)}</Badge>
|
|
58
58
|
</div>
|
|
59
59
|
) : (
|
|
60
60
|
<>
|
|
61
61
|
{!user.isActivated && (
|
|
62
62
|
<div>
|
|
63
|
-
<Badge variant="destructive">{t(`
|
|
63
|
+
<Badge variant="destructive">{t(`user.errors.inactive`)}</Badge>
|
|
64
64
|
</div>
|
|
65
65
|
)}
|
|
66
66
|
</>
|
|
67
67
|
)}
|
|
68
68
|
{roles}
|
|
69
|
-
<AttributeElement inline={true} title={t(`
|
|
70
|
-
<AttributeElement inline={true} title={t(`
|
|
71
|
-
<AttributeElement inline={false} title={t(`
|
|
69
|
+
<AttributeElement inline={true} title={t(`user.fields.title.label`)} value={user.title} />
|
|
70
|
+
<AttributeElement inline={true} title={t(`common.fields.email.label`)} value={user.email} />
|
|
71
|
+
<AttributeElement inline={false} title={t(`user.fields.bio.label`)} value={user.bio} />
|
|
72
72
|
</div>
|
|
73
73
|
);
|
|
74
74
|
}
|