@contember/create 2.1.0-beta.2 → 2.2.0-alpha.1
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/development/run.cjs.map +1 -1
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +2 -2
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs +1 -2
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js +1 -2
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +16 -16
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.cjs +6 -6
- package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/development/src/lib/version.cjs +2 -2
- package/dist/development/src/lib/version.cjs.map +1 -1
- package/dist/development/src/lib/version.js.map +1 -1
- package/dist/development/src/paths.cjs +3 -3
- package/dist/development/src/paths.cjs.map +1 -1
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +2 -2
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs +1 -2
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js +1 -2
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +16 -16
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.cjs +6 -6
- package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/production/src/lib/version.cjs +2 -2
- package/dist/production/src/lib/version.cjs.map +1 -1
- package/dist/production/src/lib/version.js.map +1 -1
- package/dist/production/src/paths.cjs +3 -3
- package/dist/production/src/paths.cjs.map +1 -1
- package/dist/types/commands/WorkspaceCreateCommand.d.ts +1 -1
- package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/index.d.ts.map +1 -1
- package/dist/types/lib/FileSystem.d.ts +3 -2
- package/dist/types/lib/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -4
- package/resources/templates/default/admin/lib/binding/binding.tsx +19 -4
- package/resources/templates/default/admin/lib/binding/delete.tsx +37 -3
- package/resources/templates/default/admin/lib/binding/hooks.tsx +65 -3
- package/resources/templates/default/admin/lib/binding/identity.tsx +17 -4
- package/resources/templates/default/admin/lib/binding/index.ts +5 -5
- package/resources/templates/default/admin/lib/binding/navigation-guard-dialog.tsx +15 -3
- package/resources/templates/default/admin/lib/binding/persist.tsx +27 -5
- package/resources/templates/default/admin/lib/block-repeater/block-repeater.tsx +15 -11
- package/resources/templates/default/admin/lib/block-repeater/index.ts +1 -1
- package/resources/templates/default/admin/lib/board/board.tsx +2 -2
- package/resources/templates/default/admin/lib/board/index.ts +1 -1
- package/resources/templates/default/admin/lib/buttons/back-button.tsx +22 -2
- package/resources/templates/default/admin/lib/buttons/index.ts +2 -2
- package/resources/templates/default/admin/lib/buttons/link-back-button.tsx +11 -2
- package/resources/templates/default/admin/lib/datagrid/cells.tsx +3 -3
- package/resources/templates/default/admin/lib/datagrid/column-header.tsx +4 -4
- package/resources/templates/default/admin/lib/datagrid/columns.tsx +28 -14
- package/resources/templates/default/admin/lib/datagrid/elements.tsx +2 -2
- package/resources/templates/default/admin/lib/datagrid/empty.tsx +1 -1
- package/resources/templates/default/admin/lib/datagrid/export.tsx +2 -2
- package/resources/templates/default/admin/lib/datagrid/filters/boolean.tsx +13 -13
- package/resources/templates/default/admin/lib/datagrid/filters/common.tsx +2 -2
- package/resources/templates/default/admin/lib/datagrid/filters/date.tsx +37 -16
- package/resources/templates/default/admin/lib/datagrid/filters/defined.tsx +13 -12
- package/resources/templates/default/admin/lib/datagrid/filters/enum.tsx +56 -22
- package/resources/templates/default/admin/lib/datagrid/filters/index.ts +7 -7
- package/resources/templates/default/admin/lib/datagrid/filters/mobile.tsx +18 -0
- package/resources/templates/default/admin/lib/datagrid/filters/number.tsx +10 -13
- package/resources/templates/default/admin/lib/datagrid/filters/relation.tsx +8 -8
- package/resources/templates/default/admin/lib/datagrid/filters/text.tsx +9 -9
- package/resources/templates/default/admin/lib/datagrid/grid.tsx +31 -23
- package/resources/templates/default/admin/lib/datagrid/index.ts +12 -12
- package/resources/templates/default/admin/lib/datagrid/labels.tsx +22 -4
- package/resources/templates/default/admin/lib/datagrid/layout-switcher.tsx +10 -4
- package/resources/templates/default/admin/lib/datagrid/loader.tsx +4 -4
- package/resources/templates/default/admin/lib/datagrid/pagination.tsx +16 -6
- package/resources/templates/default/admin/lib/datagrid/table.tsx +8 -6
- package/resources/templates/default/admin/lib/datagrid/tiles.tsx +6 -5
- package/resources/templates/default/admin/lib/datagrid/toolbar.tsx +15 -19
- package/resources/templates/default/admin/lib/datagrid/ui.tsx +3 -3
- package/resources/templates/default/admin/lib/dev/index.ts +2 -2
- package/resources/templates/default/admin/lib/dev/login-panel.tsx +12 -3
- package/resources/templates/default/admin/lib/dev/todo.tsx +12 -0
- package/resources/templates/default/admin/lib/dict.ts +0 -261
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +85 -4
- package/resources/templates/default/admin/lib/dimensions/index.ts +1 -1
- package/resources/templates/default/admin/lib/editor/block-editor.tsx +72 -3
- package/resources/templates/default/admin/lib/editor/common/baseEditorPlugins.tsx +54 -11
- package/resources/templates/default/admin/lib/editor/common/buttons.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/editor-block-toolbar.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/HorizontalRuleRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/ListItemRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/OrderedListRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/TableElementRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/UnorderedListRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/index.ts +6 -6
- package/resources/templates/default/admin/lib/editor/editor-block.tsx +54 -3
- package/resources/templates/default/admin/lib/editor/index.ts +6 -6
- package/resources/templates/default/admin/lib/editor/plugins.tsx +46 -2
- package/resources/templates/default/admin/lib/editor/rich-text-view.tsx +44 -0
- package/resources/templates/default/admin/lib/editor/rich-text.tsx +31 -3
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +34 -2
- package/resources/templates/default/admin/lib/errors/index.ts +1 -1
- package/resources/templates/default/admin/lib/errors/use-error-formatter.ts +22 -1
- package/resources/templates/default/admin/lib/field/formatted-field.tsx +16 -1
- package/resources/templates/default/admin/lib/field/index.ts +2 -1
- package/resources/templates/default/admin/lib/field/list-field.tsx +56 -0
- package/resources/templates/default/admin/lib/form/container.tsx +33 -3
- package/resources/templates/default/admin/lib/form/index.ts +6 -5
- package/resources/templates/default/admin/lib/form/inputs.tsx +105 -6
- package/resources/templates/default/admin/lib/form/labels.tsx +1 -1
- package/resources/templates/default/admin/lib/form/select.tsx +162 -5
- package/resources/templates/default/admin/lib/form/ui.tsx +2 -2
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +159 -5
- package/resources/templates/default/admin/lib/form/upload.tsx +116 -3
- package/resources/templates/default/admin/lib/formatting/formatting.ts +106 -1
- package/resources/templates/default/admin/lib/formatting/index.ts +1 -1
- package/resources/templates/default/admin/lib/images/formatImageResizeUrl.ts +19 -0
- package/resources/templates/default/admin/lib/images/index.ts +1 -1
- package/resources/templates/default/admin/lib/index.ts +54 -0
- package/resources/templates/default/admin/lib/labels/index.ts +2 -2
- package/resources/templates/default/admin/lib/layout/index.ts +3 -3
- package/resources/templates/default/admin/lib/layout/layout-boxed.tsx +5 -5
- package/resources/templates/default/admin/lib/layout/layout.tsx +3 -3
- package/resources/templates/default/admin/lib/outdated-application-dialog/index.ts +1 -1
- package/resources/templates/default/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +2 -2
- package/resources/templates/default/admin/lib/repeater/index.ts +1 -1
- package/resources/templates/default/admin/lib/repeater/repeater.tsx +26 -9
- package/resources/templates/default/admin/lib/select/create-new.tsx +19 -3
- package/resources/templates/default/admin/lib/select/filter.tsx +8 -2
- package/resources/templates/default/admin/lib/select/highlight.tsx +16 -0
- package/resources/templates/default/admin/lib/select/index.ts +6 -6
- package/resources/templates/default/admin/lib/select/list.tsx +30 -6
- package/resources/templates/default/admin/lib/select/multi-select.tsx +41 -4
- package/resources/templates/default/admin/lib/select/select.tsx +44 -6
- package/resources/templates/default/admin/lib/select/sortable-select.tsx +15 -6
- package/resources/templates/default/admin/lib/select/ui.tsx +100 -4
- package/resources/templates/default/admin/lib/tenant/dict.ts +324 -0
- package/resources/templates/default/admin/lib/tenant/forms/change-my-password.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/common.tsx +3 -3
- package/resources/templates/default/admin/lib/tenant/forms/confirm-email-change.tsx +38 -0
- package/resources/templates/default/admin/lib/tenant/forms/create-api-key.tsx +5 -5
- package/resources/templates/default/admin/lib/tenant/forms/index.ts +12 -8
- package/resources/templates/default/admin/lib/tenant/forms/invite.tsx +5 -5
- package/resources/templates/default/admin/lib/tenant/forms/login.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/memberships-control.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/password-reset-request.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/password-reset.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin-init.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/request-email-verification.tsx +35 -0
- package/resources/templates/default/admin/lib/tenant/forms/update-project-member.tsx +14 -5
- package/resources/templates/default/admin/lib/tenant/forms/verify-email.tsx +38 -0
- package/resources/templates/default/admin/lib/tenant/hooks/useInvite.ts +41 -0
- package/resources/templates/default/admin/lib/tenant/hooks/useInviteUser.tsx +32 -3
- package/resources/templates/default/admin/lib/tenant/index.ts +3 -3
- package/resources/templates/default/admin/lib/tenant/listing/api-key-list.tsx +3 -3
- package/resources/templates/default/admin/lib/tenant/listing/index.ts +4 -4
- package/resources/templates/default/admin/lib/tenant/listing/member-delete-dialog.tsx +3 -3
- package/resources/templates/default/admin/lib/tenant/listing/member-list.tsx +8 -8
- package/resources/templates/default/admin/lib/tenant/listing/person-list.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/otp/index.ts +1 -1
- package/resources/templates/default/admin/lib/tenant/otp/otp-setup.tsx +6 -6
- package/resources/templates/default/admin/lib/toast/index.ts +2 -2
- package/resources/templates/default/admin/lib/toast/toast.tsx +3 -3
- package/resources/templates/default/admin/lib/ui/alert-dialog.tsx +114 -3
- package/resources/templates/default/admin/lib/ui/avatar.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/button.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/card.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/collapsible.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/dialog.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/dimension.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/divider.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/dropdown.tsx +3 -3
- package/resources/templates/default/admin/lib/ui/input.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/label.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/loader.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/menu.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/overlay.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/popover.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/progress.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/property-list.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/scroll-area.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/select.tsx +44 -2
- package/resources/templates/default/admin/lib/ui/separator.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/sheet.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/sidebar.tsx +8 -8
- package/resources/templates/default/admin/lib/ui/skeleton.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/sortable.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/switch.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/table.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/textarea.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/toggle-group.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/toggle.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/tooltip.tsx +2 -2
- package/resources/templates/default/admin/lib/upload/dropzone.tsx +20 -3
- package/resources/templates/default/admin/lib/upload/index.ts +3 -3
- package/resources/templates/default/admin/lib/upload/repeater.tsx +5 -1
- package/resources/templates/default/admin/lib/upload/ui.tsx +2 -2
- package/resources/templates/default/admin/lib/upload/upload-progress.tsx +6 -6
- package/resources/templates/default/admin/lib/upload/view.tsx +4 -4
- package/resources/templates/default/admin/lib/utils/cn.ts +18 -0
- package/resources/templates/default/admin/lib/utils/createComponentOpenHooks.tsx +33 -0
- package/resources/templates/default/admin/lib/utils/index.ts +2 -2
- package/resources/templates/default/admin/lib/utils/uic.tsx +59 -0
- package/resources/templates/default/admin/lib/utils/use-mobile.ts +19 -0
- package/resources/templates/default/scripts/assemble-ui-lib.mjs +132 -0
- package/resources/templates/default/scripts/update-ui-lib.sh +101 -185
- package/src/commands/WorkspaceCreateCommand.ts +3 -3
- package/src/commands/index.ts +1 -1
- package/src/lib/FileSystem.ts +2 -2
- package/src/lib/TemplateInstaller.ts +1 -1
- package/src/lib/version.ts +1 -1
- package/src/run.ts +4 -4
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { InviteErrorCodes } from './hooks/useInvite.js'
|
|
2
|
+
import { ChangeMyPasswordFormErrorCode, CreateApiKeyFormErrorCode } from '@contember/interface'
|
|
3
|
+
import {
|
|
4
|
+
ConfirmEmailChangeFormErrorCode,
|
|
5
|
+
InviteFormErrorCode,
|
|
6
|
+
LoginFormErrorCode,
|
|
7
|
+
OtpConfirmFormErrorCode,
|
|
8
|
+
OtpPrepareFormErrorCode,
|
|
9
|
+
PasswordlessSignInFormErrorCode,
|
|
10
|
+
PasswordlessSignInInitFormErrorCode,
|
|
11
|
+
PasswordResetFormErrorCode,
|
|
12
|
+
PasswordResetRequestFormErrorCode,
|
|
13
|
+
RequestEmailVerificationFormErrorCode,
|
|
14
|
+
UpdateProjectMemberFormErrorCode,
|
|
15
|
+
VerifyEmailFormErrorCode,
|
|
16
|
+
} from '@contember/react-identity'
|
|
17
|
+
import { ActivatePasswordlessOtpErrorCode } from '@contember/graphql-client-tenant'
|
|
18
|
+
|
|
19
|
+
export const dict = {
|
|
20
|
+
inviteErrors: {
|
|
21
|
+
ALREADY_MEMBER: 'This user is already a member of the project',
|
|
22
|
+
INVALID_EMAIL_FORMAT: 'Invalid email format',
|
|
23
|
+
INVALID_MEMBERSHIP: 'Invalid membership',
|
|
24
|
+
PROJECT_NOT_FOUND: 'Project not found',
|
|
25
|
+
ROLE_NOT_FOUND: 'Role not found',
|
|
26
|
+
VARIABLE_EMPTY: 'Variable is empty',
|
|
27
|
+
VARIABLE_NOT_FOUND: 'Variable not found',
|
|
28
|
+
fallback: 'Failed to invite user',
|
|
29
|
+
} satisfies Record<InviteErrorCodes | 'fallback', string>,
|
|
30
|
+
tenant: {
|
|
31
|
+
memberList: {
|
|
32
|
+
failedToLoadData: 'Failed to load data',
|
|
33
|
+
noResults: 'No results',
|
|
34
|
+
previous: 'Previous',
|
|
35
|
+
next: 'Next',
|
|
36
|
+
roles: 'Roles',
|
|
37
|
+
action: 'Action',
|
|
38
|
+
},
|
|
39
|
+
apiKeyList: {
|
|
40
|
+
deleted: 'API key deleted',
|
|
41
|
+
deleteFailed: 'Failed to delete API key',
|
|
42
|
+
unnamed: 'Unnamed API key',
|
|
43
|
+
noResults: 'No API keys',
|
|
44
|
+
description: 'Description',
|
|
45
|
+
role: 'Role',
|
|
46
|
+
action: 'Action',
|
|
47
|
+
deleteConfirmation: 'Are you sure you want to delete this API key?',
|
|
48
|
+
deleteCancelAction: 'Cancel',
|
|
49
|
+
deleteConfirmAction: 'Delete',
|
|
50
|
+
},
|
|
51
|
+
createApiKey: {
|
|
52
|
+
description: 'Description',
|
|
53
|
+
roles: 'Roles',
|
|
54
|
+
submit: 'Create API key',
|
|
55
|
+
errorMessages: {
|
|
56
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
57
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
58
|
+
'INVALID_MEMBERSHIP': 'Invalid membership',
|
|
59
|
+
'PROJECT_NOT_FOUND': 'Project not found',
|
|
60
|
+
'ROLE_NOT_FOUND': 'Role not found',
|
|
61
|
+
'VARIABLE_EMPTY': 'Variable empty',
|
|
62
|
+
'VARIABLE_NOT_FOUND': 'Variable not found',
|
|
63
|
+
} satisfies Record<CreateApiKeyFormErrorCode, string>,
|
|
64
|
+
},
|
|
65
|
+
invite: {
|
|
66
|
+
email: 'Email',
|
|
67
|
+
name: 'Name',
|
|
68
|
+
roles: 'Roles',
|
|
69
|
+
submit: 'Invite',
|
|
70
|
+
addRole: 'Add new role',
|
|
71
|
+
errorMessages: {
|
|
72
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
73
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
74
|
+
'ALREADY_MEMBER': 'This person is already a member',
|
|
75
|
+
'INVALID_EMAIL_FORMAT': 'Invalid email format',
|
|
76
|
+
'INVALID_MEMBERSHIP': 'Invalid membership',
|
|
77
|
+
'PROJECT_NOT_FOUND': 'Project not found',
|
|
78
|
+
'ROLE_NOT_FOUND': 'Role not found',
|
|
79
|
+
'VARIABLE_EMPTY': 'Variable empty',
|
|
80
|
+
'VARIABLE_NOT_FOUND': 'Variable not found',
|
|
81
|
+
} satisfies Record<InviteFormErrorCode, string>,
|
|
82
|
+
},
|
|
83
|
+
changePassword: {
|
|
84
|
+
currentPassword: 'Current password',
|
|
85
|
+
newPassword: 'New password',
|
|
86
|
+
confirmPassword: 'Confirm password',
|
|
87
|
+
submit: 'Change password',
|
|
88
|
+
errorMessages: {
|
|
89
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
90
|
+
'INVALID_VALUE': 'Invalid value',
|
|
91
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
92
|
+
'PASSWORD_MISMATCH': 'Passwords do not match',
|
|
93
|
+
'TOO_WEAK': 'Password is too weak',
|
|
94
|
+
'NO_PASSWORD_SET': 'Your account has no password set',
|
|
95
|
+
'INVALID_PASSWORD': 'Invalid password',
|
|
96
|
+
'NOT_A_PERSON': 'Invalid user',
|
|
97
|
+
} satisfies Record<ChangeMyPasswordFormErrorCode, string>,
|
|
98
|
+
},
|
|
99
|
+
login: {
|
|
100
|
+
email: 'Email',
|
|
101
|
+
password: 'Password',
|
|
102
|
+
otpToken: '2FA OTP token',
|
|
103
|
+
forgotPassword: 'Forgot password?',
|
|
104
|
+
login: 'Login',
|
|
105
|
+
errorMessages: {
|
|
106
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
107
|
+
'INVALID_VALUE': 'Invalid value',
|
|
108
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
109
|
+
'INVALID_PASSWORD': 'Invalid password',
|
|
110
|
+
'INVALID_OTP_TOKEN': 'Invalid OTP token',
|
|
111
|
+
'NO_PASSWORD_SET': 'No password set',
|
|
112
|
+
'PERSON_DISABLED': 'Person disabled',
|
|
113
|
+
'UNKNOWN_EMAIL': 'Unknown email',
|
|
114
|
+
'INVALID_CREDENTIALS': 'Invalid credentials',
|
|
115
|
+
'RATE_LIMIT_EXCEEDED': 'Too many failed attempts, please try again later',
|
|
116
|
+
'OTP_REQUIRED': undefined,
|
|
117
|
+
'MFA_ENROLLMENT_REQUIRED': 'Multi-factor authentication enrollment is required',
|
|
118
|
+
'EMAIL_NOT_VERIFIED': 'Your e-mail address has not been verified',
|
|
119
|
+
} satisfies Record<LoginFormErrorCode, string | undefined>,
|
|
120
|
+
idpInitError: 'Failed to initialize IdP login:',
|
|
121
|
+
idpResponseError: 'Failed to process IdP response:',
|
|
122
|
+
title: 'Login',
|
|
123
|
+
description: 'Enter your email below to login to your account',
|
|
124
|
+
backToLogin: 'Back to login',
|
|
125
|
+
},
|
|
126
|
+
personList: {
|
|
127
|
+
email: 'Email',
|
|
128
|
+
name: 'Name',
|
|
129
|
+
deleted: 'Member deleted',
|
|
130
|
+
deleteFailed: 'Failed to delete member',
|
|
131
|
+
noEmail: 'User has no email',
|
|
132
|
+
noName: 'User has no name',
|
|
133
|
+
role: 'Role',
|
|
134
|
+
action: 'Action',
|
|
135
|
+
noResults: 'No members',
|
|
136
|
+
deleteConfirmation: 'Are you sure you want to delete this member?',
|
|
137
|
+
deleteCancelAction: 'Cancel',
|
|
138
|
+
deleteConfirmAction: 'Delete',
|
|
139
|
+
},
|
|
140
|
+
memberDelete: {
|
|
141
|
+
cancel: 'Cancel',
|
|
142
|
+
confirm: 'Confirm',
|
|
143
|
+
},
|
|
144
|
+
otpSetup: {
|
|
145
|
+
prepareContinue: 'Continue',
|
|
146
|
+
otpConfirmFormErrorMessages: {
|
|
147
|
+
UNKNOWN_ERROR: 'Something went wrong. Please try again later',
|
|
148
|
+
INVALID_OTP_TOKEN: 'Invalid OTP token',
|
|
149
|
+
FIELD_REQUIRED: 'This field is required',
|
|
150
|
+
NOT_PREPARED: 'OTP setup was not initialized',
|
|
151
|
+
} satisfies Record<OtpConfirmFormErrorCode, string>,
|
|
152
|
+
otpPrepareFormErrorMessages: {
|
|
153
|
+
UNKNOWN_ERROR: 'Something went wrong. Please try again later',
|
|
154
|
+
} satisfies Record<OtpPrepareFormErrorCode, string>,
|
|
155
|
+
alreadyHaveOtp: 'You already have two-factor authentication active. By clicking "Continue", the old one will no longer work.',
|
|
156
|
+
nowScanQrCode: 'Now scan the following QR code in your application:',
|
|
157
|
+
writeDownCode: 'After registering to your application, write down a code from the application.',
|
|
158
|
+
twoFactorEnabled: 'Two factor authentication is ENABLED.',
|
|
159
|
+
disableTwoFactor: 'Disable two-factor authentication',
|
|
160
|
+
disableTwoFactorConfirm: 'Are you sure you want to disable two-factor authentication?',
|
|
161
|
+
cancel: 'Cancel',
|
|
162
|
+
disable: 'Disable',
|
|
163
|
+
disabledSuccess: 'Two-factor authentication was disabled.',
|
|
164
|
+
setupAgain: 'Setup again',
|
|
165
|
+
description:
|
|
166
|
+
'2-Step Verification provides stronger security for your account by requiring a second step of verification when you sign in. In addition to your password, you’ll also need a code generated by an application on your phone.',
|
|
167
|
+
setupTwoFactor: 'Setup two-factor authentication',
|
|
168
|
+
enabledSuccess: 'Two-factor authentication was enabled.',
|
|
169
|
+
otpToken: 'OTP token',
|
|
170
|
+
label: 'Label',
|
|
171
|
+
confirm: 'Confirm',
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
passwordReset: {
|
|
175
|
+
token: 'Reset code',
|
|
176
|
+
password: 'Password',
|
|
177
|
+
passwordConfirmation: 'Confirm password',
|
|
178
|
+
submit: 'Reset password',
|
|
179
|
+
errorMessages: {
|
|
180
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
181
|
+
'INVALID_VALUE': 'Invalid value',
|
|
182
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
183
|
+
'PASSWORD_MISMATCH': 'Passwords do not match',
|
|
184
|
+
'PASSWORD_TOO_WEAK': 'Password is too weak',
|
|
185
|
+
'TOKEN_EXPIRED': 'Token expired',
|
|
186
|
+
'TOKEN_NOT_FOUND': 'Token not found',
|
|
187
|
+
'TOKEN_USED': 'Token already used',
|
|
188
|
+
'TOKEN_INVALID': 'Invalid token',
|
|
189
|
+
} satisfies Record<PasswordResetFormErrorCode, string>,
|
|
190
|
+
title: 'Reset password',
|
|
191
|
+
description: 'Enter new password below',
|
|
192
|
+
success: 'Password has been reset',
|
|
193
|
+
},
|
|
194
|
+
passwordResetRequest: {
|
|
195
|
+
email: 'E-mail',
|
|
196
|
+
submit: 'Request reset code',
|
|
197
|
+
errorMessages: {
|
|
198
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
199
|
+
'INVALID_VALUE': 'Invalid value',
|
|
200
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
201
|
+
'PERSON_NOT_FOUND': 'Unknown email',
|
|
202
|
+
'RATE_LIMIT_EXCEEDED': 'Too many requests, please try again later',
|
|
203
|
+
'INVALID_CAPTCHA': 'Captcha verification failed',
|
|
204
|
+
} satisfies Record<PasswordResetRequestFormErrorCode, string>,
|
|
205
|
+
title: 'Reset password',
|
|
206
|
+
description: 'Enter your email below to reset your password',
|
|
207
|
+
success: 'Password reset link has been sent',
|
|
208
|
+
checkMail: 'Please check your mailbox for instructions on how to reset your password.',
|
|
209
|
+
entryCode: 'Or enter the reset code directly.',
|
|
210
|
+
},
|
|
211
|
+
verifyEmail: {
|
|
212
|
+
token: 'Verification code',
|
|
213
|
+
submit: 'Verify e-mail',
|
|
214
|
+
errorMessages: {
|
|
215
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
216
|
+
'INVALID_VALUE': 'Invalid value',
|
|
217
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
218
|
+
'TOKEN_EXPIRED': 'Token expired',
|
|
219
|
+
'TOKEN_NOT_FOUND': 'Token not found',
|
|
220
|
+
'TOKEN_USED': 'Token already used',
|
|
221
|
+
'TOKEN_INVALID': 'Invalid token',
|
|
222
|
+
} satisfies Record<VerifyEmailFormErrorCode, string>,
|
|
223
|
+
title: 'Verify e-mail',
|
|
224
|
+
description: 'Enter the verification code to confirm your e-mail address',
|
|
225
|
+
success: 'Your e-mail address has been verified',
|
|
226
|
+
},
|
|
227
|
+
confirmEmailChange: {
|
|
228
|
+
token: 'Confirmation code',
|
|
229
|
+
submit: 'Confirm e-mail change',
|
|
230
|
+
errorMessages: {
|
|
231
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
232
|
+
'INVALID_VALUE': 'Invalid value',
|
|
233
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
234
|
+
'TOKEN_EXPIRED': 'Token expired',
|
|
235
|
+
'TOKEN_NOT_FOUND': 'Token not found',
|
|
236
|
+
'TOKEN_USED': 'Token already used',
|
|
237
|
+
'TOKEN_INVALID': 'Invalid token',
|
|
238
|
+
'EMAIL_ALREADY_EXISTS': 'This e-mail address is already in use',
|
|
239
|
+
'INVALID_EMAIL_FORMAT': 'Invalid email format',
|
|
240
|
+
} satisfies Record<ConfirmEmailChangeFormErrorCode, string>,
|
|
241
|
+
title: 'Confirm e-mail change',
|
|
242
|
+
description: 'Enter the confirmation code to change your e-mail address',
|
|
243
|
+
success: 'Your e-mail address has been changed',
|
|
244
|
+
},
|
|
245
|
+
requestEmailVerification: {
|
|
246
|
+
email: 'E-mail',
|
|
247
|
+
submit: 'Send verification link',
|
|
248
|
+
errorMessages: {
|
|
249
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
250
|
+
'INVALID_VALUE': 'Invalid value',
|
|
251
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
252
|
+
'RATE_LIMIT_EXCEEDED': 'Too many requests, please try again later',
|
|
253
|
+
'INVALID_CAPTCHA': 'Captcha verification failed',
|
|
254
|
+
} satisfies Record<RequestEmailVerificationFormErrorCode, string>,
|
|
255
|
+
title: 'Verify e-mail',
|
|
256
|
+
description: 'Enter your e-mail below to receive a verification link',
|
|
257
|
+
success: 'Verification link has been sent',
|
|
258
|
+
checkMail: 'Please check your mailbox for instructions on how to verify your e-mail address.',
|
|
259
|
+
entryCode: 'Or enter the verification code directly.',
|
|
260
|
+
},
|
|
261
|
+
passwordlessSignInInit: {
|
|
262
|
+
email: 'E-mail',
|
|
263
|
+
submit: 'Send magic link',
|
|
264
|
+
errorMessages: {
|
|
265
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
266
|
+
'INVALID_VALUE': 'Invalid value',
|
|
267
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
268
|
+
'PERSON_NOT_FOUND': 'Unknown email',
|
|
269
|
+
'PASSWORDLESS_DISABLED': 'Passwordless sign-in is not available',
|
|
270
|
+
'RATE_LIMIT_EXCEEDED': 'Too many requests, please try again later',
|
|
271
|
+
'INVALID_CAPTCHA': 'Captcha verification failed',
|
|
272
|
+
} satisfies Record<PasswordlessSignInInitFormErrorCode, string>,
|
|
273
|
+
title: 'Sign in',
|
|
274
|
+
description: 'Enter your email below to sign in to your account',
|
|
275
|
+
success: 'Magic link has been sent',
|
|
276
|
+
checkMail: 'Please check your mailbox for instructions on how to sign in.',
|
|
277
|
+
entryCode: 'Or enter the reset code directly.',
|
|
278
|
+
},
|
|
279
|
+
passwordlessSignIn: {
|
|
280
|
+
token: 'Verification code',
|
|
281
|
+
otpToken: '2FA OTP token',
|
|
282
|
+
submit: 'Sign in',
|
|
283
|
+
errorMessages: {
|
|
284
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
285
|
+
'INVALID_VALUE': 'Invalid value',
|
|
286
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
287
|
+
'INVALID_OTP_TOKEN': 'Invalid OTP token',
|
|
288
|
+
'OTP_REQUIRED': undefined,
|
|
289
|
+
'PERSON_DISABLED': 'Person disabled',
|
|
290
|
+
'TOKEN_EXPIRED': 'Token expired',
|
|
291
|
+
'TOKEN_NOT_FOUND': 'Token not found',
|
|
292
|
+
'TOKEN_USED': 'Token already used',
|
|
293
|
+
'TOKEN_INVALID': 'Invalid token',
|
|
294
|
+
'MFA_ENROLLMENT_REQUIRED': 'Multi-factor authentication enrollment is required',
|
|
295
|
+
} satisfies Record<PasswordlessSignInFormErrorCode, string | undefined>,
|
|
296
|
+
title: 'Sign in',
|
|
297
|
+
},
|
|
298
|
+
otpActivation: {
|
|
299
|
+
errorMessages: {
|
|
300
|
+
'TOKEN_INVALID': 'This token is not valid. Please try again.',
|
|
301
|
+
'TOKEN_USED': 'Token already used',
|
|
302
|
+
'TOKEN_NOT_FOUND': 'Token not found',
|
|
303
|
+
'TOKEN_EXPIRED': 'Token expired',
|
|
304
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
305
|
+
} satisfies Record<ActivatePasswordlessOtpErrorCode | 'UNKNOWN_ERROR', string>,
|
|
306
|
+
},
|
|
307
|
+
|
|
308
|
+
updateProjectMember: {
|
|
309
|
+
updateSuccess: 'Roles updated',
|
|
310
|
+
roles: 'Roles',
|
|
311
|
+
submit: 'Update role',
|
|
312
|
+
errorMessages: {
|
|
313
|
+
'FIELD_REQUIRED': 'This field is required',
|
|
314
|
+
'UNKNOWN_ERROR': 'Something went wrong. Please try again later',
|
|
315
|
+
'INVALID_MEMBERSHIP': 'Invalid membership',
|
|
316
|
+
'PROJECT_NOT_FOUND': 'Project not found',
|
|
317
|
+
'ROLE_NOT_FOUND': 'Role not found',
|
|
318
|
+
'VARIABLE_EMPTY': 'Variable empty',
|
|
319
|
+
'VARIABLE_NOT_FOUND': 'Variable not found',
|
|
320
|
+
'NOT_MEMBER': 'Not a member',
|
|
321
|
+
} satisfies Record<UpdateProjectMemberFormErrorCode, string>,
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ChangeMyPasswordFormErrorCode, useChangeMyPasswordForm } from '@contember/react-identity'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Loader } from '
|
|
4
|
-
import { TenantFormError, TenantFormField } from './common'
|
|
5
|
-
import { dict } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField } from './common.js'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
6
|
|
|
7
7
|
export const ChangeMyPasswordFormFields = () => {
|
|
8
8
|
const form = useChangeMyPasswordForm()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FormContextValue } from '@contember/react-identity'
|
|
2
|
-
import { FormErrorUI } from '
|
|
3
|
-
import { Input } from '
|
|
2
|
+
import { FormErrorUI } from '~/lib'
|
|
3
|
+
import { Input } from '~/lib'
|
|
4
4
|
import { HTMLInputTypeAttribute, useState } from 'react'
|
|
5
5
|
import { dataAttribute } from '@contember/utilities'
|
|
6
|
-
import { Label } from '
|
|
6
|
+
import { Label } from '~/lib'
|
|
7
7
|
|
|
8
8
|
type FormErrorMessages<CtxValue extends FormContextValue<any, any, any>> = Record<
|
|
9
9
|
(CtxValue extends FormContextValue<any, infer E> ? E : never) & string,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useConfirmEmailChangeForm } from '@contember/react-identity'
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField } from './common.js'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
|
+
|
|
7
|
+
export const ConfirmEmailChangeFormFields = ({ hasToken }: { hasToken?: boolean }) => {
|
|
8
|
+
const form = useConfirmEmailChangeForm()
|
|
9
|
+
const fieldErrors = form.errors.map(it => it.field)
|
|
10
|
+
return (
|
|
11
|
+
<div className="relative flex flex-col gap-2">
|
|
12
|
+
{form.state === 'success' || form.state === 'submitting' ? <Loader position="absolute" /> : null}
|
|
13
|
+
|
|
14
|
+
<TenantFormError
|
|
15
|
+
form={form}
|
|
16
|
+
messages={dict.tenant.confirmEmailChange.errorMessages}
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
{(!hasToken || fieldErrors.includes('token')) && (
|
|
20
|
+
<TenantFormField
|
|
21
|
+
form={form}
|
|
22
|
+
messages={dict.tenant.confirmEmailChange.errorMessages}
|
|
23
|
+
field="token"
|
|
24
|
+
type="text"
|
|
25
|
+
required
|
|
26
|
+
autoFocus
|
|
27
|
+
autoComplete="off"
|
|
28
|
+
>
|
|
29
|
+
{dict.tenant.confirmEmailChange.token}
|
|
30
|
+
</TenantFormField>
|
|
31
|
+
)}
|
|
32
|
+
|
|
33
|
+
<Button type="submit" className="w-full" disabled={form.state === 'submitting'}>
|
|
34
|
+
{dict.tenant.confirmEmailChange.submit}
|
|
35
|
+
</Button>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CreateApiKeyFormErrorCode, useCreateApiKeyForm } from '@contember/react-identity'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Loader } from '
|
|
4
|
-
import { TenantFormError, TenantFormField, TenantFormLabel } from './common'
|
|
5
|
-
import { MembershipsControl, useIntrospectionRolesConfig } from './memberships-control'
|
|
6
|
-
import { dict } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField, TenantFormLabel } from './common.js'
|
|
5
|
+
import { MembershipsControl, useIntrospectionRolesConfig } from './memberships-control.js'
|
|
6
|
+
import { dict } from '../dict.js'
|
|
7
7
|
|
|
8
8
|
export const CreateApiKeyFormFields = ({ projectSlug }: { projectSlug: string }) => {
|
|
9
9
|
const form = useCreateApiKeyForm()
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
export * from './change-my-password'
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
1
|
+
export * from './change-my-password.js'
|
|
2
|
+
export * from './common.js'
|
|
3
|
+
export * from './confirm-email-change.js'
|
|
4
|
+
export * from './create-api-key.js'
|
|
5
|
+
export * from './invite.js'
|
|
6
|
+
export * from './login.js'
|
|
7
|
+
export * from './memberships-control.js'
|
|
8
|
+
export * from './password-reset.js'
|
|
9
|
+
export * from './password-reset-request.js'
|
|
10
|
+
export * from './request-email-verification.js'
|
|
11
|
+
export * from './update-project-member.js'
|
|
12
|
+
export * from './verify-email.js'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InviteFormErrorCode, useInviteForm } from '@contember/react-identity'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Loader } from '
|
|
4
|
-
import { TenantFormError, TenantFormField, TenantFormLabel } from './common'
|
|
5
|
-
import { MembershipsControl, RolesConfig, useIntrospectionRolesConfig } from './memberships-control'
|
|
6
|
-
import { dict } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField, TenantFormLabel } from './common.js'
|
|
5
|
+
import { MembershipsControl, RolesConfig, useIntrospectionRolesConfig } from './memberships-control.js'
|
|
6
|
+
import { dict } from '../dict.js'
|
|
7
7
|
|
|
8
8
|
export const InviteFormFields = ({ projectSlug, roles }: { projectSlug: string; roles?: RolesConfig }) => {
|
|
9
9
|
const form = useInviteForm()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LoginFormErrorCode, useLoginForm } from '@contember/react-identity'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Loader } from '
|
|
4
|
-
import { TenantFormError, TenantFormField } from './common'
|
|
5
|
-
import { dict } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField } from './common.js'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
6
|
import { Link } from '@contember/interface'
|
|
7
7
|
|
|
8
8
|
export const LoginFormFields = () => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MembershipInput } from '@contember/graphql-client-tenant'
|
|
2
|
-
import { dict } from '
|
|
3
|
-
import { Button } from '
|
|
2
|
+
import { dict } from '../dict.js'
|
|
3
|
+
import { Button } from '~/lib'
|
|
4
4
|
import { PlusIcon, XIcon } from 'lucide-react'
|
|
5
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '~/lib'
|
|
6
6
|
import { Fragment, ReactNode, useMemo } from 'react'
|
|
7
7
|
import { useProjectRolesDefinitionQuery, useTenantQueryLoader } from '@contember/react-client-tenant'
|
|
8
|
-
import { Textarea } from '
|
|
8
|
+
import { Textarea } from '~/lib'
|
|
9
9
|
|
|
10
10
|
export type VariableRendererProps = { value: readonly string[]; onChange: (newValues: readonly string[]) => void }
|
|
11
11
|
export type RolesConfig = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { usePasswordResetRequestForm } from '@contember/react-identity'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Loader } from '
|
|
4
|
-
import { TenantFormError, TenantFormField } from './common'
|
|
5
|
-
import { dict } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField } from './common.js'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
6
|
|
|
7
7
|
export const PasswordResetRequestFormFields = () => {
|
|
8
8
|
const form = usePasswordResetRequestForm()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { usePasswordResetForm } from '@contember/react-identity'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Loader } from '
|
|
4
|
-
import { TenantFormError, TenantFormField } from './common'
|
|
5
|
-
import { dict } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField } from './common.js'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
6
|
|
|
7
7
|
export const PasswordResetFormFields = ({ hasToken }: { hasToken?: boolean }) => {
|
|
8
8
|
const form = usePasswordResetForm()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { usePasswordlessSignInInitForm } from '@contember/react-identity'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Loader } from '
|
|
4
|
-
import { TenantFormError, TenantFormField } from './common'
|
|
5
|
-
import { dict } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField } from './common.js'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
6
|
|
|
7
7
|
export const PasswordlessSignInInitFormFields = () => {
|
|
8
8
|
const form = usePasswordlessSignInInitForm()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { usePasswordlessSignInForm } from '@contember/react-identity'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Loader } from '
|
|
4
|
-
import { TenantFormError, TenantFormField } from './common'
|
|
5
|
-
import { dict } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField } from './common.js'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
6
|
import { useEffect, useRef, useState } from 'react'
|
|
7
7
|
|
|
8
8
|
export const PasswordlessSignInFormFields = ({ type, email }: { type: 'token' | 'otp'; email?: string }) => {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useRequestEmailVerificationForm } from '@contember/react-identity'
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField } from './common.js'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
|
+
|
|
7
|
+
export const RequestEmailVerificationFormFields = () => {
|
|
8
|
+
const form = useRequestEmailVerificationForm()
|
|
9
|
+
return (
|
|
10
|
+
<div className="relative flex flex-col gap-2">
|
|
11
|
+
{form.state === 'success' || form.state === 'submitting' ? <Loader position="absolute" /> : null}
|
|
12
|
+
|
|
13
|
+
<TenantFormError
|
|
14
|
+
form={form}
|
|
15
|
+
messages={dict.tenant.requestEmailVerification.errorMessages}
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<TenantFormField
|
|
19
|
+
form={form}
|
|
20
|
+
messages={dict.tenant.requestEmailVerification.errorMessages}
|
|
21
|
+
field="email"
|
|
22
|
+
type="email"
|
|
23
|
+
required
|
|
24
|
+
autoFocus
|
|
25
|
+
autoComplete="email"
|
|
26
|
+
>
|
|
27
|
+
{dict.tenant.requestEmailVerification.email}
|
|
28
|
+
</TenantFormField>
|
|
29
|
+
|
|
30
|
+
<Button type="submit" className="w-full" disabled={form.state === 'submitting'}>
|
|
31
|
+
{dict.tenant.requestEmailVerification.submit}
|
|
32
|
+
</Button>
|
|
33
|
+
</div>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { useUpdateProjectMemberForm } from '@contember/react-identity'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { Loader } from '
|
|
4
|
-
import { TenantFormError, TenantFormLabel } from './common'
|
|
5
|
-
import { MembershipsControl, RolesConfig, useIntrospectionRolesConfig } from './memberships-control'
|
|
6
|
-
import { dict } from '
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormLabel } from './common.js'
|
|
5
|
+
import { MembershipsControl, RolesConfig, useIntrospectionRolesConfig } from './memberships-control.js'
|
|
6
|
+
import { dict } from '../dict.js'
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* `UpdateProjectMemberFormFields` is a component for managing and updating a project member's roles and memberships.
|
|
10
|
+
* It integrates with the `useUpdateProjectMemberForm` hook and supports role introspection.
|
|
11
|
+
*
|
|
12
|
+
* ## Example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <UpdateProjectMemberFormFields projectSlug="my-project" />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
8
17
|
export const UpdateProjectMemberFormFields = ({ projectSlug, roles }: { projectSlug: string; roles?: RolesConfig }) => {
|
|
9
18
|
const form = useUpdateProjectMemberForm()
|
|
10
19
|
const rolesResolved = roles ?? useIntrospectionRolesConfig(projectSlug)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useVerifyEmailForm } from '@contember/react-identity'
|
|
2
|
+
import { Button } from '~/lib'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { TenantFormError, TenantFormField } from './common.js'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
|
+
|
|
7
|
+
export const VerifyEmailFormFields = ({ hasToken }: { hasToken?: boolean }) => {
|
|
8
|
+
const form = useVerifyEmailForm()
|
|
9
|
+
const fieldErrors = form.errors.map(it => it.field)
|
|
10
|
+
return (
|
|
11
|
+
<div className="relative flex flex-col gap-2">
|
|
12
|
+
{form.state === 'success' || form.state === 'submitting' ? <Loader position="absolute" /> : null}
|
|
13
|
+
|
|
14
|
+
<TenantFormError
|
|
15
|
+
form={form}
|
|
16
|
+
messages={dict.tenant.verifyEmail.errorMessages}
|
|
17
|
+
/>
|
|
18
|
+
|
|
19
|
+
{(!hasToken || fieldErrors.includes('token')) && (
|
|
20
|
+
<TenantFormField
|
|
21
|
+
form={form}
|
|
22
|
+
messages={dict.tenant.verifyEmail.errorMessages}
|
|
23
|
+
field="token"
|
|
24
|
+
type="text"
|
|
25
|
+
required
|
|
26
|
+
autoFocus
|
|
27
|
+
autoComplete="off"
|
|
28
|
+
>
|
|
29
|
+
{dict.tenant.verifyEmail.token}
|
|
30
|
+
</TenantFormField>
|
|
31
|
+
)}
|
|
32
|
+
|
|
33
|
+
<Button type="submit" className="w-full" disabled={form.state === 'submitting'}>
|
|
34
|
+
{dict.tenant.verifyEmail.submit}
|
|
35
|
+
</Button>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
}
|