@carlonicora/nextjs-jsonapi 1.29.1 → 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.
Files changed (102) hide show
  1. package/dist/{BlockNoteEditor-7BDLLHRA.js → BlockNoteEditor-CJWHJRG3.js} +17 -17
  2. package/dist/BlockNoteEditor-CJWHJRG3.js.map +1 -0
  3. package/dist/{BlockNoteEditor-F5KCNLVF.mjs → BlockNoteEditor-ZET7ANBC.mjs} +7 -7
  4. package/dist/BlockNoteEditor-ZET7ANBC.mjs.map +1 -0
  5. package/dist/billing/index.js +334 -333
  6. package/dist/billing/index.js.map +1 -1
  7. package/dist/billing/index.mjs +8 -7
  8. package/dist/billing/index.mjs.map +1 -1
  9. package/dist/{chunk-YLSLXQ3O.mjs → chunk-3HGZMKT4.mjs} +494 -524
  10. package/dist/chunk-3HGZMKT4.mjs.map +1 -0
  11. package/dist/{chunk-7M7NPKOF.js → chunk-6HQ6CPVL.js} +916 -946
  12. package/dist/chunk-6HQ6CPVL.js.map +1 -0
  13. package/dist/{chunk-DU64WMZD.mjs → chunk-NYNLJEPF.mjs} +4 -4
  14. package/dist/chunk-NYNLJEPF.mjs.map +1 -0
  15. package/dist/{chunk-J22NEVSK.js → chunk-UYBCHXXL.js} +4 -4
  16. package/dist/chunk-UYBCHXXL.js.map +1 -0
  17. package/dist/client/index.js +3 -3
  18. package/dist/client/index.mjs +2 -2
  19. package/dist/components/index.js +3 -3
  20. package/dist/components/index.mjs +2 -2
  21. package/dist/contexts/index.js +3 -3
  22. package/dist/contexts/index.mjs +2 -2
  23. package/dist/core/index.js +2 -2
  24. package/dist/core/index.mjs +1 -1
  25. package/dist/index.js +2 -2
  26. package/dist/index.mjs +1 -1
  27. package/dist/server/index.js +3 -3
  28. package/dist/server/index.mjs +1 -1
  29. package/package.json +1 -1
  30. package/src/components/details/AllowedUsersDetails.tsx +1 -1
  31. package/src/components/editors/BlockNoteEditor.tsx +5 -5
  32. package/src/components/forms/CommonAssociationForm.tsx +9 -9
  33. package/src/components/forms/CommonDeleter.tsx +14 -8
  34. package/src/components/forms/CommonEditorButtons.tsx +2 -2
  35. package/src/components/forms/CommonEditorHeader.tsx +4 -4
  36. package/src/components/forms/CommonEditorTrigger.tsx +1 -1
  37. package/src/components/forms/FileUploader.tsx +8 -8
  38. package/src/components/forms/FormDateTime.tsx +6 -12
  39. package/src/components/forms/FormInput.tsx +4 -20
  40. package/src/components/forms/PasswordInput.tsx +1 -1
  41. package/src/components/navigations/Breadcrumb.tsx +1 -1
  42. package/src/components/navigations/Header.tsx +2 -2
  43. package/src/components/navigations/RecentPagesNavigator.tsx +3 -3
  44. package/src/components/tables/ContentTableSearch.tsx +1 -1
  45. package/src/contexts/CommonContext.tsx +2 -2
  46. package/src/core/abstracts/AbstractService.ts +2 -2
  47. package/src/features/auth/components/details/LandingComponent.tsx +5 -5
  48. package/src/features/auth/components/forms/AcceptInvitation.tsx +16 -22
  49. package/src/features/auth/components/forms/ActivateAccount.tsx +8 -8
  50. package/src/features/auth/components/forms/ForgotPassword.tsx +9 -9
  51. package/src/features/auth/components/forms/Login.tsx +12 -12
  52. package/src/features/auth/components/forms/Register.tsx +19 -21
  53. package/src/features/auth/components/forms/ResetPassword.tsx +12 -18
  54. package/src/features/billing/stripe-subscription/hooks/useSubscriptionWizard.ts +5 -4
  55. package/src/features/company/components/details/TokenStatusIndicator.tsx +7 -7
  56. package/src/features/company/components/forms/CompanyConfigurationEditor.tsx +2 -2
  57. package/src/features/company/components/forms/CompanyDeleter.tsx +13 -11
  58. package/src/features/company/components/forms/CompanyEditor.tsx +7 -13
  59. package/src/features/company/components/lists/CompaniesList.tsx +1 -1
  60. package/src/features/company/contexts/CompanyContext.tsx +1 -1
  61. package/src/features/company/hooks/useCompanyTableStructure.tsx +2 -2
  62. package/src/features/content/components/lists/ContentsList.tsx +1 -1
  63. package/src/features/content/components/lists/ContentsListById.tsx +1 -1
  64. package/src/features/content/components/lists/RelevantContentsList.tsx +1 -1
  65. package/src/features/content/hooks/useContentTableStructure.tsx +5 -5
  66. package/src/features/notification/components/containers/NotificationsListContainer.tsx +2 -2
  67. package/src/features/notification/components/lists/NotificationsList.tsx +3 -3
  68. package/src/features/notification/components/modals/NotificationModal.tsx +3 -5
  69. package/src/features/notification/components/notifications/Notification.tsx +4 -4
  70. package/src/features/notification/contexts/NotificationContext.tsx +2 -2
  71. package/src/features/role/components/details/RoleDetails.tsx +1 -1
  72. package/src/features/role/components/forms/FormRoles.tsx +2 -2
  73. package/src/features/role/components/forms/RemoveUserFromRole.tsx +9 -11
  74. package/src/features/role/components/forms/UserRoleAdd.tsx +18 -18
  75. package/src/features/role/components/lists/RolesList.tsx +1 -1
  76. package/src/features/role/components/lists/UserRolesList.tsx +1 -1
  77. package/src/features/role/contexts/RoleContext.tsx +2 -2
  78. package/src/features/role/hooks/useRoleTableStructure.tsx +3 -3
  79. package/src/features/user/components/containers/UsersListContainer.tsx +2 -2
  80. package/src/features/user/components/details/UserDetails.tsx +6 -6
  81. package/src/features/user/components/forms/RoleUserAdd.tsx +8 -8
  82. package/src/features/user/components/forms/UserAvatarEditor.tsx +2 -2
  83. package/src/features/user/components/forms/UserEditor.tsx +21 -25
  84. package/src/features/user/components/forms/UserReactivator.tsx +7 -7
  85. package/src/features/user/components/forms/UserResentInvitationEmail.tsx +9 -9
  86. package/src/features/user/components/forms/UserSelector.tsx +4 -9
  87. package/src/features/user/components/lists/AdminUsersList.tsx +1 -1
  88. package/src/features/user/components/lists/CompanyUsersList.tsx +1 -1
  89. package/src/features/user/components/lists/RelevantUsersList.tsx +1 -1
  90. package/src/features/user/components/lists/RoleUsersList.tsx +1 -1
  91. package/src/features/user/components/lists/UsersList.tsx +1 -1
  92. package/src/features/user/components/lists/UsersListByContentIds.tsx +1 -1
  93. package/src/features/user/components/widgets/UserSearchPopover.tsx +3 -3
  94. package/src/features/user/contexts/UserContext.tsx +5 -5
  95. package/src/features/user/hooks/useUserTableStructure.tsx +6 -6
  96. package/src/utils/blocknote-diff.util.ts +1 -1
  97. package/dist/BlockNoteEditor-7BDLLHRA.js.map +0 -1
  98. package/dist/BlockNoteEditor-F5KCNLVF.mjs.map +0 -1
  99. package/dist/chunk-7M7NPKOF.js.map +0 -1
  100. package/dist/chunk-DU64WMZD.mjs.map +0 -1
  101. package/dist/chunk-J22NEVSK.js.map +0 -1
  102. package/dist/chunk-YLSLXQ3O.mjs.map +0 -1
@@ -141,7 +141,7 @@ export const NotificationContextProvider = ({ children }: NotificationContextPro
141
141
  const response: BreadcrumbItemData[] = [];
142
142
 
143
143
  response.push({
144
- name: t(`types.notifications`, { count: 2 }),
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(`types.notifications`, { count: 2 }),
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(`foundations.role.fields.description.label`)} value={role.description} />
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(`foundations.role.roles`, { role: role.id.replaceAll(`-`, ``) })}
56
+ {t(`role.roles`, { role: role.id.replaceAll(`-`, ``) })}
57
57
  </FieldLabel>
58
58
  </TooltipTrigger>
59
59
  <TooltipContent>
60
- {t(`foundations.role.roles_descriptions`, { role: role.id.replaceAll(`-`, ``) })}
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(`generic.errors.error`), error: error });
59
+ errorToast({ title: t(`common.errors.error`), error: error });
60
60
  }
61
61
  };
62
62
 
63
- const roleName = t(`foundations.role.roles`, { role: role.id.replaceAll(`-`, ``) });
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(`foundations.role.remove_user.title`)}</span>
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(`foundations.role.remove_user.title`)}</DialogTitle>
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(`foundations.role.remove_user.description_allowed`, { role: roleName, user: user.name })}
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(`generic.buttons.cancel`)}
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(`generic.buttons.confirm_delete`)}
98
+ {t(`ui.buttons.confirm_delete`)}
101
99
  </Button>
102
100
  </div>
103
101
  </>
104
102
  ) : (
105
- <>{t(`foundations.role.remove_user.description_not_allowed`, { role: roleName, user: user.name })}</>
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(`generic.association.label`, {
44
- source: t(`types.roles`, { count: 1 }),
45
- destination: t(`types.users`, { count: 1 }),
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(`generic.association.success`, {
49
- source: t(`types.roles`, { count: 1 }),
50
- destination: t(`types.users`, { count: 1 }),
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(`generic.association.label`, {
87
- source: t(`types.roles`, { count: 1 }),
88
- destination: t(`types.users`, { count: 1 }),
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(`generic.association.label`, {
94
- source: t(`types.roles`, { count: 1 }),
95
- destination: t(`types.users`, { count: 1 }),
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(`generic.association.description`, {
100
- source: t(`types.roles`, { count: 1 }),
101
- destination: t(`types.users`, { count: 1 }),
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(`generic.search.placeholder`, { type: t(`types.roles`, { count: 1 }) })}
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(`generic.search.no_results`, { type: t(`types.roles`, { count: 1 }) })}</CommandEmpty>
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(`foundations.role.roles`, { role: role.id.replaceAll(`-`, ``) })}
121
+ {t(`role.roles`, { role: role.id.replaceAll(`-`, ``) })}
122
122
  </CommandItem>
123
123
  ))}
124
124
  </CommandList>
@@ -22,7 +22,7 @@ export function RolesList() {
22
22
  data={data}
23
23
  fields={[RoleFields.name, RoleFields.description]}
24
24
  tableGeneratorType={Modules.Role}
25
- title={t(`types.roles`, { count: 2 })}
25
+ title={t(`entities.roles`, { count: 2 })}
26
26
  />
27
27
  );
28
28
  }
@@ -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(`types.roles`, { count: 2 })}
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(`types.roles`, { count: 2 }),
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(`types.roles`, { count: role ? 1 : 2 }),
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(`foundations.role.fields.name.label`),
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(`foundations.role.fields.description.label`),
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(`generic.date.create`),
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(`types.users`, { count: 2 }),
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(`foundations.user.deleted`),
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(`foundations.role.roles`, { role: role.id.replaceAll(`-`, ``) })}
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(`foundations.user.errors.deleted`)}</Badge>
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(`foundations.user.errors.inactive`)}</Badge>
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(`foundations.user.fields.title.label`)} value={user.title} />
70
- <AttributeElement inline={true} title={t(`generic.fields.email.label`)} value={user.email} />
71
- <AttributeElement inline={false} title={t(`foundations.user.fields.bio.label`)} value={user.bio} />
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
  }
@@ -47,10 +47,10 @@ function AddUserToRoleInternal({ role, refresh }: AddUserToRoleProps) {
47
47
 
48
48
  triggerAssociationToast({
49
49
  t: t,
50
- source: t(`types.users`, { count: 1 }),
51
- destination: t(`types.roles`, { count: 1 }),
50
+ source: t(`entities.users`, { count: 1 }),
51
+ destination: t(`entities.roles`, { count: 1 }),
52
52
  source_name: user.name,
53
- destination_name: t(`foundations.role.roles`, { role: role.id.replaceAll(`-`, ``) }),
53
+ destination_name: t(`role.roles`, { role: role.id.replaceAll(`-`, ``) }),
54
54
  });
55
55
 
56
56
  refresh();
@@ -72,17 +72,17 @@ function AddUserToRoleInternal({ role, refresh }: AddUserToRoleProps) {
72
72
  return (
73
73
  <>
74
74
  <CommonAssociationTrigger
75
- sourceType={t(`types.users`, { count: 1 })}
76
- destinationType={t(`types.roles`, { count: 1 })}
75
+ sourceType={t(`entities.users`, { count: 1 })}
76
+ destinationType={t(`entities.roles`, { count: 1 })}
77
77
  onTrigger={() => setShow(true)}
78
78
  />
79
79
  <CommonAssociationCommandDialog
80
80
  show={show}
81
81
  setShow={setShow}
82
82
  data={data}
83
- source={t(`types.users`, { count: 1 })}
84
- destination={t(`types.roles`, { count: 1 })}
85
- destinationName={t(`foundations.role.roles`, { role: role.id.replaceAll(`-`, ``) })}
83
+ source={t(`entities.users`, { count: 1 })}
84
+ destination={t(`entities.roles`, { count: 1 })}
85
+ destinationName={t(`role.roles`, { role: role.id.replaceAll(`-`, ``) })}
86
86
  >
87
87
  <UserListInAdd data={data} existingUsers={existingUsers} setSelectedUser={addUserToRole} />
88
88
  </CommonAssociationCommandDialog>
@@ -49,7 +49,7 @@ export function UserAvatarEditor({ user, file, setFile, resetImage, setResetImag
49
49
  {!resetImage && (file || user?.avatar) ? (
50
50
  <Image
51
51
  src={file ? URL.createObjectURL(file) : user?.avatar || ""}
52
- alt={t(`generic.avatar`)}
52
+ alt={t(`common.avatar`)}
53
53
  width={200}
54
54
  height={200}
55
55
  />
@@ -70,7 +70,7 @@ export function UserAvatarEditor({ user, file, setFile, resetImage, setResetImag
70
70
  setResetImage(true);
71
71
  }}
72
72
  >
73
- {t(`generic.buttons.remove`)}
73
+ {t(`ui.buttons.remove`)}
74
74
  </Button>
75
75
  )}
76
76
  </div>
@@ -67,8 +67,8 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
67
67
 
68
68
  const formSchema = z.object({
69
69
  id: z.uuidv4(),
70
- name: z.string().min(1, { message: t(`foundations.user.fields.name.error`) }),
71
- email: z.string().min(1, { message: t(`generic.fields.email.error`) }),
70
+ name: z.string().min(1, { message: t(`user.fields.name.error`) }),
71
+ email: z.string().min(1, { message: t(`common.fields.email.error`) }),
72
72
  password: z.string().optional(),
73
73
  title: z.string().optional(),
74
74
  bio: z.string().optional(),
@@ -101,9 +101,9 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
101
101
  if (existingUser) {
102
102
  form.setError("email", {
103
103
  type: "manual",
104
- message: t(`foundations.user.errors.email_exists`),
104
+ message: t(`user.errors.email_exists`),
105
105
  });
106
- errorToast({ title: t(`foundations.user.errors.email_exists`), error: "" });
106
+ errorToast({ title: t(`user.errors.email_exists`), error: "" });
107
107
  return;
108
108
  }
109
109
  } catch (error) {
@@ -157,7 +157,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
157
157
  router.push(generateUrl({ page: Modules.User, id: updatedUser.id }));
158
158
  }
159
159
  } catch (error) {
160
- errorToast({ title: user ? t(`generic.errors.update`) : t(`generic.errors.create`), error });
160
+ errorToast({ title: user ? t(`common.errors.update`) : t(`common.errors.create`), error });
161
161
  }
162
162
  };
163
163
 
@@ -216,7 +216,7 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
216
216
  <DialogContent
217
217
  className={`flex max-h-[70vh] ${canChangeRoles ? `max-w-[90vw]` : `max-w-3xl`} min-h-3xl max-h-[90vh] flex-col overflow-y-auto`}
218
218
  >
219
- <CommonEditorHeader type={t(`types.users`, { count: 1 })} name={user?.name} />
219
+ <CommonEditorHeader type={t(`entities.users`, { count: 1 })} name={user?.name} />
220
220
  <Form {...form}>
221
221
  <form onSubmit={form.handleSubmit(onSubmit)} className={`flex w-full flex-col gap-y-4`}>
222
222
  <div className={`flex flex-row gap-x-4`}>
@@ -233,54 +233,50 @@ function UserEditorInternal({ user, propagateChanges, adminCreated, trigger, onR
233
233
  <FormInput
234
234
  form={form}
235
235
  id="name"
236
- name={t(`foundations.user.fields.name.label`)}
237
- placeholder={t(`foundations.user.fields.name.placeholder`)}
236
+ name={t(`user.fields.name.label`)}
237
+ placeholder={t(`user.fields.name.placeholder`)}
238
238
  />
239
239
  <FormInput
240
240
  form={form}
241
241
  id="email"
242
- name={t(`generic.fields.email.label`)}
243
- placeholder={t(`generic.fields.email.placeholder`)}
242
+ name={t(`common.fields.email.label`)}
243
+ placeholder={t(`common.fields.email.placeholder`)}
244
244
  />
245
245
  <FormInput
246
246
  form={form}
247
247
  id="phone"
248
- name={t(`foundations.user.fields.phone.label`)}
249
- placeholder={t(`foundations.user.fields.phone.placeholder`)}
248
+ name={t(`user.fields.phone.label`)}
249
+ placeholder={t(`user.fields.phone.placeholder`)}
250
250
  />
251
251
  <FormPassword
252
252
  form={form}
253
253
  id="password"
254
- name={t(`foundations.user.fields.password.label`)}
255
- placeholder={t(`foundations.user.fields.password.placeholder`)}
254
+ name={t(`user.fields.password.label`)}
255
+ placeholder={t(`user.fields.password.placeholder`)}
256
256
  />
257
257
  <FormInput
258
258
  form={form}
259
259
  id="title"
260
- name={t(`foundations.user.fields.title.label`)}
261
- placeholder={t(`foundations.user.fields.title.placeholder`)}
260
+ name={t(`user.fields.title.label`)}
261
+ placeholder={t(`user.fields.title.placeholder`)}
262
262
  />
263
263
  <FormTextarea
264
264
  form={form}
265
265
  id="bio"
266
- name={t(`foundations.user.fields.bio.label`)}
267
- placeholder={t(`foundations.user.fields.bio.placeholder`)}
266
+ name={t(`user.fields.bio.label`)}
267
+ placeholder={t(`user.fields.bio.placeholder`)}
268
268
  className="min-h-40"
269
269
  />
270
270
  </div>
271
271
  {canChangeRoles && (
272
272
  <div className="flex w-1/3 flex-col">
273
273
  {canChangeRoles && (
274
- <FormRoles form={form} id="roleIds" name={t(`types.roles`, { count: 2 })} roles={roles} />
274
+ <FormRoles form={form} id="roleIds" name={t(`entities.roles`, { count: 2 })} roles={roles} />
275
275
  )}
276
276
  {!user && (
277
277
  <div className="flex flex-col gap-y-4">
278
- <div className="text-sm font-semibold">{t(`foundations.user.send_activation_email`)}</div>
279
- <FormCheckbox
280
- form={form}
281
- id="sendInvitationEmail"
282
- name={t(`foundations.user.send_activation_email`)}
283
- />
278
+ <div className="text-sm font-semibold">{t(`user.send_activation_email`)}</div>
279
+ <FormCheckbox form={form} id="sendInvitationEmail" name={t(`user.send_activation_email`)} />
284
280
  </div>
285
281
  )}
286
282
  </div>
@@ -35,7 +35,7 @@ function UserReactivatorInterface({ user, propagateChanges }: UserReactivatorPro
35
35
  setOpen(false);
36
36
  propagateChanges(updatedUser);
37
37
  } catch (error) {
38
- errorToast({ title: t(`generic.errors.error`), error: error });
38
+ errorToast({ title: t(`common.errors.error`), error: error });
39
39
  }
40
40
  };
41
41
 
@@ -44,18 +44,18 @@ function UserReactivatorInterface({ user, propagateChanges }: UserReactivatorPro
44
44
  <DialogTrigger>
45
45
  <Button size="sm">
46
46
  <UserCheckIcon className="mr-3 h-3.5 w-3.5" />
47
- {t(`foundations.user.buttons.reactivate`)}
47
+ {t(`user.buttons.reactivate`)}
48
48
  </Button>
49
49
  </DialogTrigger>
50
50
  <DialogContent className={`flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`}>
51
51
  <DialogHeader>
52
- <DialogTitle>{t(`foundations.user.reactivate.title`)}</DialogTitle>
53
- <DialogDescription>{t(`foundations.user.reactivate.subtitle`)}</DialogDescription>
52
+ <DialogTitle>{t(`user.reactivate.title`)}</DialogTitle>
53
+ <DialogDescription>{t(`user.reactivate.subtitle`)}</DialogDescription>
54
54
  </DialogHeader>
55
- {t(`foundations.user.reactivate.description`, { name: user.name })}
55
+ {t(`user.reactivate.description`, { name: user.name })}
56
56
  <div className="flex justify-end">
57
57
  <Button className="mr-2" variant={"outline"} type={`button`} onClick={() => setOpen(false)}>
58
- {t(`generic.buttons.cancel`)}
58
+ {t(`ui.buttons.cancel`)}
59
59
  </Button>
60
60
  <Button
61
61
  type="submit"
@@ -64,7 +64,7 @@ function UserReactivatorInterface({ user, propagateChanges }: UserReactivatorPro
64
64
  reactivateUser();
65
65
  }}
66
66
  >
67
- {t(`foundations.user.buttons.reactivate`)}
67
+ {t(`user.buttons.reactivate`)}
68
68
  </Button>
69
69
  </div>
70
70
  </DialogContent>
@@ -36,11 +36,11 @@ function UserResentInvitationEmailInternal({ user }: UserResentInvitationEmailPr
36
36
  await UserService.sendInvitation({ userId: user.id, companyId: user.company!.id });
37
37
 
38
38
  setOpen(false);
39
- toast.message(t(`foundations.user.resend_activation.email_sent`), {
40
- description: t(`foundations.user.resend_activation.email_sent_description`, { email: user.email }),
39
+ toast.message(t(`user.resend_activation.email_sent`), {
40
+ description: t(`user.resend_activation.email_sent_description`, { email: user.email }),
41
41
  });
42
42
  } catch (error) {
43
- errorToast({ title: t(`generic.errors.error`), error: error });
43
+ errorToast({ title: t(`common.errors.error`), error: error });
44
44
  }
45
45
  };
46
46
 
@@ -54,17 +54,17 @@ function UserResentInvitationEmailInternal({ user }: UserResentInvitationEmailPr
54
54
  </Button>
55
55
  </DialogTrigger>
56
56
  </TooltipTrigger>
57
- <TooltipContent>{t(`foundations.user.buttons.resend_activation`)}</TooltipContent>
57
+ <TooltipContent>{t(`user.buttons.resend_activation`)}</TooltipContent>
58
58
  </Tooltip>
59
59
  <DialogContent className={`flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`}>
60
60
  <DialogHeader>
61
- <DialogTitle>{t(`foundations.user.resend_activation.title`)}</DialogTitle>
62
- <DialogDescription>{t(`foundations.user.resend_activation.subtitle`)}</DialogDescription>
61
+ <DialogTitle>{t(`user.resend_activation.title`)}</DialogTitle>
62
+ <DialogDescription>{t(`user.resend_activation.subtitle`)}</DialogDescription>
63
63
  </DialogHeader>
64
- {t(`foundations.user.resend_activation.description`, { email: user.email })}
64
+ {t(`user.resend_activation.description`, { email: user.email })}
65
65
  <div className="flex justify-end">
66
66
  <Button className="mr-2" variant={"outline"} type={`button`} onClick={() => setOpen(false)}>
67
- {t(`generic.buttons.cancel`)}
67
+ {t(`ui.buttons.cancel`)}
68
68
  </Button>
69
69
  <Button
70
70
  type="submit"
@@ -73,7 +73,7 @@ function UserResentInvitationEmailInternal({ user }: UserResentInvitationEmailPr
73
73
  sendInvitationEmail();
74
74
  }}
75
75
  >
76
- {t(`foundations.user.buttons.resend_activation`)}
76
+ {t(`user.buttons.resend_activation`)}
77
77
  </Button>
78
78
  </div>
79
79
  </DialogContent>
@@ -3,9 +3,9 @@
3
3
  import { CircleX, RefreshCwIcon, SearchIcon, XIcon } from "lucide-react";
4
4
  import { useTranslations } from "next-intl";
5
5
  import { useCallback, useEffect, useRef, useState } from "react";
6
+ import { FormFieldWrapper } from "../../../../components/forms";
6
7
  import { Modules } from "../../../../core";
7
8
  import { DataListRetriever, useDataListRetriever, useDebounce } from "../../../../hooks";
8
- import { FormFieldWrapper } from "../../../../components/forms";
9
9
  import {
10
10
  Avatar,
11
11
  AvatarFallback,
@@ -88,12 +88,7 @@ export function UserSelector({ id, form, label, placeholder, onChange, isRequire
88
88
 
89
89
  return (
90
90
  <div className="flex w-full flex-col">
91
- <FormFieldWrapper
92
- form={form}
93
- name={id}
94
- label={label}
95
- isRequired={isRequired}
96
- >
91
+ <FormFieldWrapper form={form} name={id} label={label} isRequired={isRequired}>
97
92
  {(field) => (
98
93
  <Popover open={open} onOpenChange={setOpen} modal={true}>
99
94
  <div className="flex w-full flex-row items-center justify-between">
@@ -117,7 +112,7 @@ export function UserSelector({ id, form, label, placeholder, onChange, isRequire
117
112
  </>
118
113
  ) : (
119
114
  <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">
120
- {placeholder ?? t(`generic.search.placeholder`, { type: t(`types.users`, { count: 1 }) })}
115
+ {placeholder ?? t(`ui.search.placeholder`, { type: t(`entities.users`, { count: 1 }) })}
121
116
  </div>
122
117
  )}
123
118
  </div>
@@ -134,7 +129,7 @@ export function UserSelector({ id, form, label, placeholder, onChange, isRequire
134
129
  <div className="relative mb-2 w-full">
135
130
  <SearchIcon className="text-muted-foreground absolute top-2.5 left-2.5 h-4 w-4" />
136
131
  <Input
137
- placeholder={t(`generic.search.placeholder`, { type: t(`types.users`, { count: 1 }) })}
132
+ placeholder={t(`ui.search.placeholder`, { type: t(`entities.users`, { count: 1 }) })}
138
133
  type="text"
139
134
  className="w-full pr-8 pl-8"
140
135
  onChange={(e) => setSearchTerm(e.target.value)}
@@ -25,7 +25,7 @@ function AdminUsersListInternal({ company }: AdminUsersListProps) {
25
25
 
26
26
  return (
27
27
  <ContentListTable
28
- title={t(`types.users`, { count: 2 })}
28
+ title={t(`entities.users`, { count: 2 })}
29
29
  data={data}
30
30
  fields={[UserFields.name, UserFields.email, UserFields.createdAt]}
31
31
  tableGeneratorType={Modules.User}
@@ -39,7 +39,7 @@ export function CompanyUsersList({ isDeleted }: CompanyUsersListProps) {
39
39
  fields={[UserFields.name, UserFields.email]}
40
40
  tableGeneratorType={Modules.User}
41
41
  functions={functions}
42
- title={t(`types.users`, { count: 2 })}
42
+ title={t(`entities.users`, { count: 2 })}
43
43
  />
44
44
  );
45
45
  }
@@ -25,7 +25,7 @@ export function RelevantUsersList({ id }: RelevantUsersListProps) {
25
25
  data={data}
26
26
  fields={[UserFields.name, UserFields.email, UserFields.relevance]}
27
27
  tableGeneratorType={Modules.User}
28
- title={t(`generic.relevant_users`)}
28
+ title={t(`common.relevant_users`)}
29
29
  />
30
30
  );
31
31
  }
@@ -26,7 +26,7 @@ export function RoleUsersList({ role }: RoleUsersListProps) {
26
26
  data={data}
27
27
  fields={[UserFields.name, UserFields.email]}
28
28
  tableGeneratorType={Modules.User}
29
- title={t(`types.users`, { count: 2 })}
29
+ title={t(`entities.users`, { count: 2 })}
30
30
  />
31
31
  );
32
32
  }