@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.
- package/dist/{BlockNoteEditor-7BDLLHRA.js → BlockNoteEditor-CJWHJRG3.js} +17 -17
- package/dist/BlockNoteEditor-CJWHJRG3.js.map +1 -0
- package/dist/{BlockNoteEditor-F5KCNLVF.mjs → BlockNoteEditor-ZET7ANBC.mjs} +7 -7
- package/dist/BlockNoteEditor-ZET7ANBC.mjs.map +1 -0
- package/dist/billing/index.js +334 -333
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +8 -7
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-YLSLXQ3O.mjs → chunk-3HGZMKT4.mjs} +494 -524
- package/dist/chunk-3HGZMKT4.mjs.map +1 -0
- package/dist/{chunk-7M7NPKOF.js → chunk-6HQ6CPVL.js} +916 -946
- package/dist/chunk-6HQ6CPVL.js.map +1 -0
- package/dist/{chunk-DU64WMZD.mjs → chunk-NYNLJEPF.mjs} +4 -4
- package/dist/chunk-NYNLJEPF.mjs.map +1 -0
- package/dist/{chunk-J22NEVSK.js → chunk-UYBCHXXL.js} +4 -4
- package/dist/chunk-UYBCHXXL.js.map +1 -0
- package/dist/client/index.js +3 -3
- package/dist/client/index.mjs +2 -2
- package/dist/components/index.js +3 -3
- package/dist/components/index.mjs +2 -2
- package/dist/contexts/index.js +3 -3
- package/dist/contexts/index.mjs +2 -2
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/server/index.js +3 -3
- package/dist/server/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/core/abstracts/AbstractService.ts +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/billing/stripe-subscription/hooks/useSubscriptionWizard.ts +5 -4
- 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/utils/blocknote-diff.util.ts +1 -1
- package/dist/BlockNoteEditor-7BDLLHRA.js.map +0 -1
- package/dist/BlockNoteEditor-F5KCNLVF.mjs.map +0 -1
- package/dist/chunk-7M7NPKOF.js.map +0 -1
- package/dist/chunk-DU64WMZD.mjs.map +0 -1
- package/dist/chunk-J22NEVSK.js.map +0 -1
- package/dist/chunk-YLSLXQ3O.mjs.map +0 -1
|
@@ -30,19 +30,19 @@ export default function Register() {
|
|
|
30
30
|
|
|
31
31
|
const formSchema = z.object({
|
|
32
32
|
company: z.string().min(1, {
|
|
33
|
-
message: t(`
|
|
33
|
+
message: t(`common.errors.missing_company_name`),
|
|
34
34
|
}),
|
|
35
35
|
name: z.string().min(1, {
|
|
36
|
-
message: t("
|
|
36
|
+
message: t("common.errors.missing_name"),
|
|
37
37
|
}),
|
|
38
38
|
email: z.string().email({
|
|
39
|
-
message: t(`
|
|
39
|
+
message: t(`common.errors.invalid_email`),
|
|
40
40
|
}),
|
|
41
41
|
password: z
|
|
42
42
|
.string()
|
|
43
|
-
.min(8, t(`
|
|
43
|
+
.min(8, t(`auth.errors.password_too_short`))
|
|
44
44
|
.regex(/^(?=.*[0-9])(?=.*[^a-zA-Z0-9]).*$/, {
|
|
45
|
-
message: t(`
|
|
45
|
+
message: t(`auth.errors.password_invalid_format`),
|
|
46
46
|
}),
|
|
47
47
|
});
|
|
48
48
|
|
|
@@ -78,17 +78,15 @@ export default function Register() {
|
|
|
78
78
|
<CardHeader>
|
|
79
79
|
<CardTitle className="text-primary flex flex-col items-center pb-10 text-4xl">
|
|
80
80
|
<Image src="/logo.webp" alt="Logo" width={100} height={100} priority />
|
|
81
|
-
{t(`
|
|
81
|
+
{t(`auth.register`)}
|
|
82
82
|
</CardTitle>
|
|
83
83
|
<CardDescription className="text-sm">
|
|
84
|
-
{showConfirmation ? <> </> : <>{t(`
|
|
84
|
+
{showConfirmation ? <> </> : <>{t(`auth.register_description`)}</>}
|
|
85
85
|
</CardDescription>
|
|
86
86
|
</CardHeader>
|
|
87
87
|
{showConfirmation ? (
|
|
88
88
|
<CardContent>
|
|
89
|
-
<CardDescription className="text-center text-xl">
|
|
90
|
-
{t("foundations.auth.register_confirmation")}
|
|
91
|
-
</CardDescription>
|
|
89
|
+
<CardDescription className="text-center text-xl">{t("auth.register_confirmation")}</CardDescription>
|
|
92
90
|
</CardContent>
|
|
93
91
|
) : (
|
|
94
92
|
<Form {...form}>
|
|
@@ -98,32 +96,32 @@ export default function Register() {
|
|
|
98
96
|
isRequired
|
|
99
97
|
form={form}
|
|
100
98
|
id="company"
|
|
101
|
-
name={t(`
|
|
102
|
-
placeholder={t(`
|
|
99
|
+
name={t(`company.fields.name.label`)}
|
|
100
|
+
placeholder={t(`company.fields.name.placeholder`)}
|
|
103
101
|
/>
|
|
104
102
|
<FormInput
|
|
105
103
|
isRequired
|
|
106
104
|
form={form}
|
|
107
105
|
id="name"
|
|
108
|
-
name={t(`
|
|
109
|
-
placeholder={t(`
|
|
106
|
+
name={t(`user.fields.name.label`)}
|
|
107
|
+
placeholder={t(`user.fields.name.placeholder`)}
|
|
110
108
|
/>
|
|
111
109
|
<FormInput
|
|
112
110
|
isRequired
|
|
113
111
|
form={form}
|
|
114
112
|
id="email"
|
|
115
|
-
name={t(`
|
|
116
|
-
placeholder={t(`
|
|
113
|
+
name={t(`common.fields.email.label`)}
|
|
114
|
+
placeholder={t(`common.fields.email.placeholder`)}
|
|
117
115
|
/>
|
|
118
116
|
<FormPassword
|
|
119
117
|
isRequired
|
|
120
118
|
form={form}
|
|
121
119
|
id="password"
|
|
122
|
-
name={t(`
|
|
123
|
-
placeholder={t(`
|
|
120
|
+
name={t(`user.fields.password.label`)}
|
|
121
|
+
placeholder={t(`user.fields.password.placeholder`)}
|
|
124
122
|
/>
|
|
125
123
|
<Button className="mt-4 w-full" type={"submit"}>
|
|
126
|
-
{t(`
|
|
124
|
+
{t(`auth.buttons.register`)}
|
|
127
125
|
</Button>
|
|
128
126
|
</CardContent>
|
|
129
127
|
<CardFooter className="flex w-full flex-row justify-between">
|
|
@@ -132,14 +130,14 @@ export default function Register() {
|
|
|
132
130
|
className="flex w-full justify-start"
|
|
133
131
|
onClick={() => setComponentType(AuthComponent.Login)}
|
|
134
132
|
>
|
|
135
|
-
{t(`
|
|
133
|
+
{t(`auth.buttons.login`)}
|
|
136
134
|
</Link>
|
|
137
135
|
<Link
|
|
138
136
|
href="#"
|
|
139
137
|
className="flex w-full justify-end"
|
|
140
138
|
onClick={() => setComponentType(AuthComponent.ForgotPassword)}
|
|
141
139
|
>
|
|
142
|
-
{t(`
|
|
140
|
+
{t(`auth.buttons.forgot_password`)}
|
|
143
141
|
</Link>
|
|
144
142
|
</CardFooter>
|
|
145
143
|
</form>
|
|
@@ -29,28 +29,28 @@ export function ResetPassword() {
|
|
|
29
29
|
await AuthService.validateCode(payload);
|
|
30
30
|
} catch (e) {
|
|
31
31
|
setError(e instanceof Error ? e.message : String(e));
|
|
32
|
-
errorToast({ title: t(`
|
|
32
|
+
errorToast({ title: t(`common.errors.error`), error: e });
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if (params && params.code) {
|
|
37
37
|
validateResetPasswordCode(params.code);
|
|
38
38
|
} else {
|
|
39
|
-
setError(t(`
|
|
39
|
+
setError(t(`auth.errors.invalid_password_reset_code`));
|
|
40
40
|
}
|
|
41
41
|
}, []);
|
|
42
42
|
|
|
43
43
|
const formSchema = z
|
|
44
44
|
.object({
|
|
45
45
|
password: z.string().min(1, {
|
|
46
|
-
message: t(`
|
|
46
|
+
message: t(`user.fields.password.error`),
|
|
47
47
|
}),
|
|
48
48
|
passwordRetype: z.string().min(1, {
|
|
49
|
-
message: t(`
|
|
49
|
+
message: t(`auth.fields.retype_password.error`),
|
|
50
50
|
}),
|
|
51
51
|
})
|
|
52
52
|
.refine((data) => data.password === data.passwordRetype, {
|
|
53
|
-
message: t(`
|
|
53
|
+
message: t(`auth.fields.retype_password.error_not_match`),
|
|
54
54
|
path: ["passwordRetype"],
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -74,8 +74,8 @@ export function ResetPassword() {
|
|
|
74
74
|
await AuthService.resetPassword(payload);
|
|
75
75
|
setShowConfirmation(true);
|
|
76
76
|
|
|
77
|
-
toast.success(t(`
|
|
78
|
-
description: t(`
|
|
77
|
+
toast.success(t(`auth.reset_success`), {
|
|
78
|
+
description: t(`auth.reset_success_description`),
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
setTimeout(() => {
|
|
@@ -83,7 +83,7 @@ export function ResetPassword() {
|
|
|
83
83
|
setParams(undefined);
|
|
84
84
|
}, 2000);
|
|
85
85
|
} catch (e) {
|
|
86
|
-
errorToast({ title: t(`
|
|
86
|
+
errorToast({ title: t(`common.errors.error`), error });
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
|
|
@@ -92,21 +92,15 @@ export function ResetPassword() {
|
|
|
92
92
|
<CardHeader>
|
|
93
93
|
<CardTitle className="text-primary flex flex-col items-center pb-10 text-4xl">
|
|
94
94
|
<Image src="/logo.webp" alt="Logo" width={100} height={100} priority />
|
|
95
|
-
{t(`
|
|
95
|
+
{t(`auth.password_reset`)}
|
|
96
96
|
</CardTitle>
|
|
97
97
|
<CardDescription className="text-center text-sm">
|
|
98
|
-
{error ? (
|
|
99
|
-
<>{t(`foundations.auth.errors.password_reset_error`)}</>
|
|
100
|
-
) : (
|
|
101
|
-
<>{t(`foundations.auth.reset_password`)}</>
|
|
102
|
-
)}
|
|
98
|
+
{error ? <>{t(`auth.errors.password_reset_error`)}</> : <>{t(`auth.reset_password`)}</>}
|
|
103
99
|
</CardDescription>
|
|
104
100
|
</CardHeader>
|
|
105
101
|
<CardContent>
|
|
106
102
|
{showConfirmation ? (
|
|
107
|
-
<CardDescription className="text-center text-xl">
|
|
108
|
-
{t(`foundations.auth.reset_success_description`)}
|
|
109
|
-
</CardDescription>
|
|
103
|
+
<CardDescription className="text-center text-xl">{t(`auth.reset_success_description`)}</CardDescription>
|
|
110
104
|
) : error ? (
|
|
111
105
|
<CardDescription className="text-center text-xl">{error}</CardDescription>
|
|
112
106
|
) : (
|
|
@@ -115,7 +109,7 @@ export function ResetPassword() {
|
|
|
115
109
|
<FormPassword form={form} id="password" name={"Password"} />
|
|
116
110
|
<FormPassword form={form} id="passwordRetype" name={"Retype Password"} />
|
|
117
111
|
<Button className="mt-4 w-full" type={"submit"}>
|
|
118
|
-
{t(`
|
|
112
|
+
{t(`auth.buttons.reset_password`)}
|
|
119
113
|
</Button>
|
|
120
114
|
</form>
|
|
121
115
|
</Form>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useCallback, useMemo, useReducer, useRef } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import { StripePriceInterface } from "../../stripe-price/data/stripe-price.interface";
|
|
6
|
-
import { BillingInterval } from "../components/widgets/IntervalToggle";
|
|
4
|
+
import { v4 } from "uuid";
|
|
7
5
|
import { StripeCustomerService } from "../../stripe-customer/data/stripe-customer.service";
|
|
8
6
|
import { ProrationPreviewInterface } from "../../stripe-invoice/data/stripe-invoice.interface";
|
|
7
|
+
import { StripePriceInterface } from "../../stripe-price/data/stripe-price.interface";
|
|
8
|
+
import { BillingInterval } from "../components/widgets/IntervalToggle";
|
|
9
|
+
import { StripeSubscriptionInterface, StripeSubscriptionService } from "../data";
|
|
9
10
|
|
|
10
11
|
export type WizardStep = "plan-selection" | "review" | "payment-method";
|
|
11
12
|
|
|
@@ -145,7 +146,7 @@ export function useSubscriptionWizard({ subscription, onSuccess, onClose }: UseS
|
|
|
145
146
|
} else {
|
|
146
147
|
// Create new subscription
|
|
147
148
|
await StripeSubscriptionService.createSubscription({
|
|
148
|
-
id:
|
|
149
|
+
id: v4(),
|
|
149
150
|
priceId: state.selectedPrice.id,
|
|
150
151
|
});
|
|
151
152
|
}
|
|
@@ -86,35 +86,35 @@ export function TokenStatusIndicator({ className, size = "md", showExtraPages =
|
|
|
86
86
|
|
|
87
87
|
const tooltipContent = (
|
|
88
88
|
<div className="flex flex-col gap-2 p-1">
|
|
89
|
-
<div className="font-semibold text-sm">{t("
|
|
89
|
+
<div className="font-semibold text-sm">{t("billing.tokens.status", { defaultValue: "Page Status" })}</div>
|
|
90
90
|
<div className="flex flex-col gap-1 text-xs">
|
|
91
91
|
<div className="flex items-center justify-between gap-4">
|
|
92
92
|
<span className="text-muted-foreground">
|
|
93
|
-
{t("
|
|
93
|
+
{t("billing.tokens.monthly", { defaultValue: "Monthly Pages" })}:
|
|
94
94
|
</span>
|
|
95
95
|
<span className={cn("font-medium", getStatusColor())}>
|
|
96
96
|
{availableMonthlyTokens} / {monthlyTokens}
|
|
97
97
|
</span>
|
|
98
98
|
</div>
|
|
99
99
|
<div className="flex items-center justify-between gap-4">
|
|
100
|
-
<span className="text-muted-foreground">{t("
|
|
100
|
+
<span className="text-muted-foreground">{t("billing.tokens.available", { defaultValue: "Available" })}:</span>
|
|
101
101
|
<span className={cn("font-medium", getStatusColor())}>{percentage.toFixed(0)}%</span>
|
|
102
102
|
</div>
|
|
103
103
|
<Link href="/settings/billing?action=subscribe" className="w-full flex justify-end my-4">
|
|
104
104
|
<Button variant="outline" size="sm">
|
|
105
|
-
{t("
|
|
105
|
+
{t("billing.tokens.upgrade_plan", { defaultValue: "Upgrade plan" })}
|
|
106
106
|
</Button>
|
|
107
107
|
</Link>
|
|
108
108
|
<Separator />
|
|
109
109
|
<div className="flex items-center justify-between gap-4 pt-1 mt-1">
|
|
110
110
|
<span className="text-muted-foreground">
|
|
111
|
-
{t("
|
|
111
|
+
{t("billing.tokens.available_extra", { defaultValue: "Extra Pages" })}:
|
|
112
112
|
</span>
|
|
113
113
|
<span className="font-medium text-blue-500">{availableExtraTokens}</span>
|
|
114
114
|
</div>
|
|
115
115
|
<Link href="/settings/billing?action=subscribe" className="w-full flex justify-end my-4">
|
|
116
116
|
<Button variant="outline" size="sm">
|
|
117
|
-
{t("
|
|
117
|
+
{t("billing.tokens.purchase_extra", { defaultValue: "Purchase additional analysis" })}
|
|
118
118
|
</Button>
|
|
119
119
|
</Link>
|
|
120
120
|
</div>
|
|
@@ -126,7 +126,7 @@ export function TokenStatusIndicator({ className, size = "md", showExtraPages =
|
|
|
126
126
|
<TooltipTrigger>
|
|
127
127
|
<div
|
|
128
128
|
className={cn("inline-flex items-center gap-1.5 cursor-default", className)}
|
|
129
|
-
aria-label={t("
|
|
129
|
+
aria-label={t("billing.tokens.status", { defaultValue: "Page Status" })}
|
|
130
130
|
>
|
|
131
131
|
{getBatteryIcon()}
|
|
132
132
|
<span className={cn(textSize, "text-muted-foreground font-medium")}>{availableMonthlyTokens}</span>
|
|
@@ -95,7 +95,7 @@ function CompanyConfigurationEditorInternal({ company }: CompanyConfigurationEdi
|
|
|
95
95
|
close();
|
|
96
96
|
} catch (error) {
|
|
97
97
|
errorToast({
|
|
98
|
-
title: t(`
|
|
98
|
+
title: t(`common.errors.update`),
|
|
99
99
|
error,
|
|
100
100
|
});
|
|
101
101
|
}
|
|
@@ -110,7 +110,7 @@ function CompanyConfigurationEditorInternal({ company }: CompanyConfigurationEdi
|
|
|
110
110
|
</DialogTrigger>
|
|
111
111
|
<DialogContent className={`flex max-h-[70vh] max-w-4xl flex-col overflow-y-auto`}>
|
|
112
112
|
<DialogHeader>
|
|
113
|
-
<DialogTitle>{t(`
|
|
113
|
+
<DialogTitle>{t(`entities.configuration`, { count: 2 })}</DialogTitle>
|
|
114
114
|
<DialogDescription className="text-destructive">
|
|
115
115
|
{t(`features.configuration.warning_description`)}
|
|
116
116
|
</DialogDescription>
|
|
@@ -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,
|