@contember/create 2.1.0-rc.3 → 2.2.0-alpha.10
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/CLAUDE.md +22 -0
- package/dist/development/run.cjs +7 -7
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +8 -8
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +28 -14
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js +28 -14
- 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 +79 -67
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +72 -60
- 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 +7 -7
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +8 -8
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +28 -14
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js +28 -14
- 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 +79 -67
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +72 -60
- 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 +16 -4
- 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 +10 -2
- 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/README.md +3 -1
- package/resources/templates/default/admin/app/components/navigation.tsx +95 -8
- package/resources/templates/default/admin/app/pages/tenant.tsx +328 -77
- package/resources/templates/default/admin/entrypoint/components/login.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/magicLink.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/magicLinkSent.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/passwordReset.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/resetRequest.tsx +1 -1
- package/resources/templates/default/admin/entrypoint/pages/resetRequestSuccess.tsx +1 -1
- 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/config/auth-policy-list.tsx +86 -0
- package/resources/templates/default/admin/lib/tenant/config/common.tsx +71 -0
- package/resources/templates/default/admin/lib/tenant/config/identity-provider-list.tsx +113 -0
- package/resources/templates/default/admin/lib/tenant/config/index.ts +5 -0
- package/resources/templates/default/admin/lib/tenant/config/mail-template-list.tsx +108 -0
- package/resources/templates/default/admin/lib/tenant/config/tenant-config-view.tsx +182 -0
- package/resources/templates/default/admin/lib/tenant/dict.ts +770 -0
- package/resources/templates/default/admin/lib/tenant/errors.ts +10 -0
- package/resources/templates/default/admin/lib/tenant/forms/add-project-member.tsx +57 -0
- package/resources/templates/default/admin/lib/tenant/forms/change-my-password.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/forms/change-my-profile.tsx +40 -0
- package/resources/templates/default/admin/lib/tenant/forms/change-profile.tsx +55 -0
- package/resources/templates/default/admin/lib/tenant/forms/common.tsx +12 -5
- 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/create-global-api-key.tsx +69 -0
- package/resources/templates/default/admin/lib/tenant/forms/global-roles-control.tsx +113 -0
- package/resources/templates/default/admin/lib/tenant/forms/index.ts +23 -8
- package/resources/templates/default/admin/lib/tenant/forms/invite.tsx +46 -8
- package/resources/templates/default/admin/lib/tenant/forms/login.tsx +8 -14
- package/resources/templates/default/admin/lib/tenant/forms/memberships-control.tsx +7 -5
- package/resources/templates/default/admin/lib/tenant/forms/mfa-code-fields.tsx +81 -0
- 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 +8 -14
- package/resources/templates/default/admin/lib/tenant/forms/request-email-verification.tsx +35 -0
- package/resources/templates/default/admin/lib/tenant/forms/set-person-password.tsx +58 -0
- package/resources/templates/default/admin/lib/tenant/forms/set-project-secret.tsx +59 -0
- package/resources/templates/default/admin/lib/tenant/forms/sign-up.tsx +73 -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/index.ts +2 -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/idp/identity-provider-connections.tsx +124 -0
- package/resources/templates/default/admin/lib/tenant/idp/index.ts +1 -0
- package/resources/templates/default/admin/lib/tenant/index.ts +10 -3
- package/resources/templates/default/admin/lib/tenant/listing/api-key-list.tsx +161 -23
- package/resources/templates/default/admin/lib/tenant/listing/auth-log-list.tsx +179 -0
- package/resources/templates/default/admin/lib/tenant/listing/global-api-key-list.tsx +149 -0
- package/resources/templates/default/admin/lib/tenant/listing/index.ts +11 -4
- package/resources/templates/default/admin/lib/tenant/listing/member-delete-dialog.tsx +4 -4
- package/resources/templates/default/admin/lib/tenant/listing/member-list.tsx +28 -19
- package/resources/templates/default/admin/lib/tenant/listing/mfa.tsx +29 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-actions.tsx +179 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-detail.tsx +141 -0
- package/resources/templates/default/admin/lib/tenant/listing/person-list.tsx +17 -6
- package/resources/templates/default/admin/lib/tenant/listing/persons-list.tsx +128 -0
- package/resources/templates/default/admin/lib/tenant/listing/project-secret-list.tsx +82 -0
- package/resources/templates/default/admin/lib/tenant/otp/backup-codes.tsx +81 -0
- package/resources/templates/default/admin/lib/tenant/otp/email-otp-setup.tsx +133 -0
- package/resources/templates/default/admin/lib/tenant/otp/index.ts +3 -1
- package/resources/templates/default/admin/lib/tenant/otp/otp-setup.tsx +6 -6
- package/resources/templates/default/admin/lib/tenant/security/index.ts +2 -0
- package/resources/templates/default/admin/lib/tenant/security/passwordless-toggle.tsx +63 -0
- package/resources/templates/default/admin/lib/tenant/security/session-list.tsx +143 -0
- 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/admin/package.json +1 -0
- package/resources/templates/default/docker/object-storage/README.md +13 -0
- package/resources/templates/default/docker/object-storage/identities.json +13 -0
- package/resources/templates/default/docker-compose.yaml +29 -7
- 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 +45 -17
- package/src/commands/index.ts +1 -1
- package/src/lib/FileSystem.ts +2 -2
- package/src/lib/TemplateInstaller.ts +87 -69
- package/src/lib/version.ts +1 -1
- package/src/run.ts +11 -10
- package/tests/cases/unit/create-process.test.ts +66 -0
- package/tests/cases/unit/template-installer-cleanup.test.ts +150 -0
- package/tests/cases/unit/workspace-create.test.ts +81 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { Loader, Table, TableCell, TableHead, TableHeader, TableRow } from '~/lib'
|
|
3
|
+
import { useAuthPoliciesQuery, useTenantQueryLoader } from '@contember/react-client-tenant'
|
|
4
|
+
import { dict } from '../dict.js'
|
|
5
|
+
import { formatConfigValue, ManagedByCliNote, renderConfigQueryState } from './common.js'
|
|
6
|
+
|
|
7
|
+
export interface AuthPolicyListController {
|
|
8
|
+
refresh: () => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface AuthPolicyListProps {
|
|
12
|
+
controller?: { current?: AuthPolicyListController }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* `AuthPolicyList` shows the configured per-role MFA / session policies read-only.
|
|
17
|
+
*
|
|
18
|
+
* Without this view an enforced MFA requirement is invisible to an administrator —
|
|
19
|
+
* they only meet it as a sign-in prompt. Policies are written with
|
|
20
|
+
* `contember tenant:apply`; requires `system:configure` to read.
|
|
21
|
+
*
|
|
22
|
+
* ## Example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <AuthPolicyList />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export const AuthPolicyList = ({ controller }: AuthPolicyListProps) => {
|
|
28
|
+
const [query, { refresh }] = useTenantQueryLoader(useAuthPoliciesQuery(), {})
|
|
29
|
+
if (controller) {
|
|
30
|
+
controller.current = { refresh }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const nonData = renderConfigQueryState({
|
|
34
|
+
query,
|
|
35
|
+
forbiddenMessage: dict.tenant.authPolicyList.forbidden,
|
|
36
|
+
failedMessage: dict.tenant.authPolicyList.failedToLoadData,
|
|
37
|
+
})
|
|
38
|
+
if (nonData !== null) {
|
|
39
|
+
return nonData
|
|
40
|
+
}
|
|
41
|
+
if (!('data' in query)) {
|
|
42
|
+
return null
|
|
43
|
+
}
|
|
44
|
+
const policies = query.data
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<div className="relative flex flex-col gap-3">
|
|
48
|
+
{query.state !== 'success' && <Loader position="absolute" />}
|
|
49
|
+
<ManagedByCliNote />
|
|
50
|
+
|
|
51
|
+
{policies.length === 0
|
|
52
|
+
? <div className="text-gray-500 italic">{dict.tenant.authPolicyList.noResults}</div>
|
|
53
|
+
: (
|
|
54
|
+
<>
|
|
55
|
+
<Table>
|
|
56
|
+
<TableHeader>
|
|
57
|
+
<TableRow>
|
|
58
|
+
<TableHead>{dict.tenant.authPolicyList.scope}</TableHead>
|
|
59
|
+
<TableHead>{dict.tenant.authPolicyList.project}</TableHead>
|
|
60
|
+
<TableHead>{dict.tenant.authPolicyList.roles}</TableHead>
|
|
61
|
+
<TableHead>{dict.tenant.authPolicyList.mfaRequired}</TableHead>
|
|
62
|
+
<TableHead>{dict.tenant.authPolicyList.tokenExpiration}</TableHead>
|
|
63
|
+
<TableHead>{dict.tenant.authPolicyList.idleTimeout}</TableHead>
|
|
64
|
+
<TableHead>{dict.tenant.authPolicyList.mfaGraceDuration}</TableHead>
|
|
65
|
+
<TableHead>{dict.tenant.authPolicyList.rememberMeAllowed}</TableHead>
|
|
66
|
+
</TableRow>
|
|
67
|
+
</TableHeader>
|
|
68
|
+
{policies.map(policy => (
|
|
69
|
+
<TableRow key={policy.id}>
|
|
70
|
+
<TableCell className="font-medium">{policy.scope}</TableCell>
|
|
71
|
+
<TableCell>{policy.project ?? '—'}</TableCell>
|
|
72
|
+
<TableCell className="font-mono text-xs">{policy.roles.join(', ')}</TableCell>
|
|
73
|
+
<TableCell>{formatConfigValue(policy.mfaRequired)}</TableCell>
|
|
74
|
+
<TableCell className="whitespace-nowrap">{formatConfigValue(policy.tokenExpiration)}</TableCell>
|
|
75
|
+
<TableCell className="whitespace-nowrap">{formatConfigValue(policy.idleTimeout)}</TableCell>
|
|
76
|
+
<TableCell className="whitespace-nowrap">{formatConfigValue(policy.mfaGraceDuration)}</TableCell>
|
|
77
|
+
<TableCell>{formatConfigValue(policy.rememberMeAllowed)}</TableCell>
|
|
78
|
+
</TableRow>
|
|
79
|
+
))}
|
|
80
|
+
</Table>
|
|
81
|
+
<p className="text-sm text-gray-500">{dict.tenant.authPolicyList.aggregationNote}</p>
|
|
82
|
+
</>
|
|
83
|
+
)}
|
|
84
|
+
</div>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { ReactNode } from 'react'
|
|
3
|
+
import { Loader } from '~/lib'
|
|
4
|
+
import { isForbiddenError, TenantQueryLoaderState } from '@contember/react-client-tenant'
|
|
5
|
+
import { TerminalIcon } from 'lucide-react'
|
|
6
|
+
import { dict } from '../dict.js'
|
|
7
|
+
|
|
8
|
+
export interface ConfigQueryStateProps {
|
|
9
|
+
forbiddenMessage: string
|
|
10
|
+
failedMessage: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Renders the non-data states of a configuration query, or `null` once data is
|
|
15
|
+
* available — a plain helper, not a component, so the caller can `return` it and
|
|
16
|
+
* then narrow on `'data' in query`.
|
|
17
|
+
*
|
|
18
|
+
* The read-only configuration views all share one shape: a permission-gated
|
|
19
|
+
* query that throws rather than returning an empty result, so "you may not see
|
|
20
|
+
* this" has to be rendered as an ordinary state instead of a failure.
|
|
21
|
+
*/
|
|
22
|
+
export const renderConfigQueryState = <Result,>(
|
|
23
|
+
{ query, forbiddenMessage, failedMessage }: ConfigQueryStateProps & { query: TenantQueryLoaderState<Result> },
|
|
24
|
+
): ReactNode => {
|
|
25
|
+
if (query.state === 'error') {
|
|
26
|
+
return isForbiddenError(query.error)
|
|
27
|
+
? <div className="text-gray-500 italic">{forbiddenMessage}</div>
|
|
28
|
+
: <div className="text-destructive italic">{failedMessage}</div>
|
|
29
|
+
}
|
|
30
|
+
if (!('data' in query)) {
|
|
31
|
+
return (
|
|
32
|
+
<div className="relative min-h-24">
|
|
33
|
+
<Loader position="absolute" />
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
return null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Points at the write path these views deliberately do not offer. */
|
|
41
|
+
export const ManagedByCliNote = () => (
|
|
42
|
+
<p className="flex items-center gap-2 text-sm text-gray-500">
|
|
43
|
+
<TerminalIcon className="w-3.5 h-3.5 shrink-0" />
|
|
44
|
+
<span>
|
|
45
|
+
{dict.tenant.configView.managedByCli} <code className="font-mono">{dict.tenant.configView.managedByCliCommand}</code>
|
|
46
|
+
</span>
|
|
47
|
+
</p>
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
export const ConfigSection = ({ title, children }: { title: string; children: ReactNode }) => (
|
|
51
|
+
<div className="flex flex-col gap-2">
|
|
52
|
+
<h3 className="text-sm font-semibold text-gray-700">{title}</h3>
|
|
53
|
+
{children}
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
/** Formats a config leaf value for display; `null`/`undefined` read as "not set". */
|
|
58
|
+
export const formatConfigValue = (value: unknown): string => {
|
|
59
|
+
if (value === null || value === undefined) {
|
|
60
|
+
return dict.tenant.configView.notSet
|
|
61
|
+
}
|
|
62
|
+
if (typeof value === 'boolean') {
|
|
63
|
+
return value ? dict.tenant.configView.enabled : dict.tenant.configView.disabled
|
|
64
|
+
}
|
|
65
|
+
if (Array.isArray(value)) {
|
|
66
|
+
// An empty list is a meaningful setting, not a missing one — for the panel policy it means
|
|
67
|
+
// nobody may enter — so it must not fall through to `String([])` and render as a blank cell.
|
|
68
|
+
return value.length === 0 ? dict.tenant.configView.emptyList : value.join(', ')
|
|
69
|
+
}
|
|
70
|
+
return String(value)
|
|
71
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
import { Button, Loader, Table, TableCell, TableHead, TableHeader, TableRow } from '~/lib'
|
|
4
|
+
import { useIdentityProvidersQuery, useTenantQueryLoader } from '@contember/react-client-tenant'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
|
+
import { formatConfigValue, ManagedByCliNote, renderConfigQueryState } from './common.js'
|
|
7
|
+
|
|
8
|
+
export interface IdentityProviderListController {
|
|
9
|
+
refresh: () => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface IdentityProviderListProps {
|
|
13
|
+
controller?: { current?: IdentityProviderListController }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* `IdentityProviderList` shows the identity providers configured on the tenant, read-only.
|
|
18
|
+
*
|
|
19
|
+
* This is an administration view (`idp:list`), not a source for login-screen
|
|
20
|
+
* buttons — an unauthenticated visitor cannot run the query. Providers are
|
|
21
|
+
* written with `contember tenant:apply`.
|
|
22
|
+
*
|
|
23
|
+
* The configuration blob is collapsed by default and comes from
|
|
24
|
+
* `getPublicConfiguration`, which strips the client secret for the built-in
|
|
25
|
+
* handlers. A custom handler that does not implement it returns the raw stored
|
|
26
|
+
* configuration, hence the note under the table.
|
|
27
|
+
*
|
|
28
|
+
* ## Example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <IdentityProviderList />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const IdentityProviderList = ({ controller }: IdentityProviderListProps) => {
|
|
34
|
+
const [query, { refresh }] = useTenantQueryLoader(useIdentityProvidersQuery(), {})
|
|
35
|
+
const [expanded, setExpanded] = useState<string | null>(null)
|
|
36
|
+
if (controller) {
|
|
37
|
+
controller.current = { refresh }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const nonData = renderConfigQueryState({
|
|
41
|
+
query,
|
|
42
|
+
forbiddenMessage: dict.tenant.identityProviderList.forbidden,
|
|
43
|
+
failedMessage: dict.tenant.identityProviderList.failedToLoadData,
|
|
44
|
+
})
|
|
45
|
+
if (nonData !== null) {
|
|
46
|
+
return nonData
|
|
47
|
+
}
|
|
48
|
+
if (!('data' in query)) {
|
|
49
|
+
return null
|
|
50
|
+
}
|
|
51
|
+
const providers = query.data
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className="relative flex flex-col gap-3">
|
|
55
|
+
{query.state !== 'success' && <Loader position="absolute" />}
|
|
56
|
+
<ManagedByCliNote />
|
|
57
|
+
|
|
58
|
+
<Table>
|
|
59
|
+
<TableHeader>
|
|
60
|
+
<TableRow>
|
|
61
|
+
<TableHead>{dict.tenant.identityProviderList.slug}</TableHead>
|
|
62
|
+
<TableHead>{dict.tenant.identityProviderList.type}</TableHead>
|
|
63
|
+
<TableHead>{dict.tenant.identityProviderList.status}</TableHead>
|
|
64
|
+
<TableHead>{dict.tenant.identityProviderList.autoSignUp}</TableHead>
|
|
65
|
+
<TableHead>{dict.tenant.identityProviderList.exclusive}</TableHead>
|
|
66
|
+
<TableHead>{dict.tenant.identityProviderList.configuration}</TableHead>
|
|
67
|
+
</TableRow>
|
|
68
|
+
</TableHeader>
|
|
69
|
+
{providers.length === 0 && (
|
|
70
|
+
<TableRow>
|
|
71
|
+
<TableCell colSpan={6}>{dict.tenant.identityProviderList.noResults}</TableCell>
|
|
72
|
+
</TableRow>
|
|
73
|
+
)}
|
|
74
|
+
{providers.map(provider => (
|
|
75
|
+
<React.Fragment key={provider.slug}>
|
|
76
|
+
<TableRow>
|
|
77
|
+
<TableCell className="font-medium">{provider.slug}</TableCell>
|
|
78
|
+
<TableCell className="font-mono text-xs">{provider.type}</TableCell>
|
|
79
|
+
<TableCell>
|
|
80
|
+
{provider.disabledAt
|
|
81
|
+
? <span className="text-destructive">{dict.tenant.configView.disabled}</span>
|
|
82
|
+
: <span>{dict.tenant.configView.enabled}</span>}
|
|
83
|
+
</TableCell>
|
|
84
|
+
<TableCell>{formatConfigValue(provider.options.autoSignUp)}</TableCell>
|
|
85
|
+
<TableCell>{formatConfigValue(provider.options.exclusive)}</TableCell>
|
|
86
|
+
<TableCell>
|
|
87
|
+
<Button
|
|
88
|
+
variant="outline"
|
|
89
|
+
size="sm"
|
|
90
|
+
onClick={() => setExpanded(expanded === provider.slug ? null : provider.slug)}
|
|
91
|
+
>
|
|
92
|
+
{expanded === provider.slug
|
|
93
|
+
? dict.tenant.identityProviderList.hideConfiguration
|
|
94
|
+
: dict.tenant.identityProviderList.showConfiguration}
|
|
95
|
+
</Button>
|
|
96
|
+
</TableCell>
|
|
97
|
+
</TableRow>
|
|
98
|
+
{expanded === provider.slug && (
|
|
99
|
+
<TableRow>
|
|
100
|
+
<TableCell colSpan={6}>
|
|
101
|
+
<pre className="overflow-x-auto text-xs bg-gray-50 p-3 rounded">
|
|
102
|
+
{JSON.stringify(provider.configuration, null, 2)}
|
|
103
|
+
</pre>
|
|
104
|
+
</TableCell>
|
|
105
|
+
</TableRow>
|
|
106
|
+
)}
|
|
107
|
+
</React.Fragment>
|
|
108
|
+
))}
|
|
109
|
+
</Table>
|
|
110
|
+
<p className="text-sm text-gray-500">{dict.tenant.identityProviderList.secretsNote}</p>
|
|
111
|
+
</div>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
import { Button, Loader, Table, TableCell, TableHead, TableHeader, TableRow } from '~/lib'
|
|
4
|
+
import { useMailTemplatesQuery, useTenantQueryLoader } from '@contember/react-client-tenant'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
|
+
import { formatConfigValue, ManagedByCliNote, renderConfigQueryState } from './common.js'
|
|
7
|
+
|
|
8
|
+
export interface MailTemplateListController {
|
|
9
|
+
refresh: () => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface MailTemplateListProps {
|
|
13
|
+
controller?: { current?: MailTemplateListController }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Templates have no id; type + variant + project is what identifies one server-side. */
|
|
17
|
+
const templateKey = (template: { type: string; variant?: string | null; projectSlug?: string | null }) =>
|
|
18
|
+
`${template.projectSlug ?? ''}/${template.type}/${template.variant ?? ''}`
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* `MailTemplateList` shows the configured mail templates read-only, with the body
|
|
22
|
+
* collapsed behind a toggle.
|
|
23
|
+
*
|
|
24
|
+
* Templates are written with `contember tenant:apply`; reading them requires
|
|
25
|
+
* `mailTemplate:list`. A type missing from this list is not broken — it means the
|
|
26
|
+
* built-in default is in use.
|
|
27
|
+
*
|
|
28
|
+
* ## Example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <MailTemplateList />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const MailTemplateList = ({ controller }: MailTemplateListProps) => {
|
|
34
|
+
const [query, { refresh }] = useTenantQueryLoader(useMailTemplatesQuery(), {})
|
|
35
|
+
const [expanded, setExpanded] = useState<string | null>(null)
|
|
36
|
+
if (controller) {
|
|
37
|
+
controller.current = { refresh }
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const nonData = renderConfigQueryState({
|
|
41
|
+
query,
|
|
42
|
+
forbiddenMessage: dict.tenant.mailTemplateList.forbidden,
|
|
43
|
+
failedMessage: dict.tenant.mailTemplateList.failedToLoadData,
|
|
44
|
+
})
|
|
45
|
+
if (nonData !== null) {
|
|
46
|
+
return nonData
|
|
47
|
+
}
|
|
48
|
+
if (!('data' in query)) {
|
|
49
|
+
return null
|
|
50
|
+
}
|
|
51
|
+
const templates = query.data
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className="relative flex flex-col gap-3">
|
|
55
|
+
{query.state !== 'success' && <Loader position="absolute" />}
|
|
56
|
+
<ManagedByCliNote />
|
|
57
|
+
|
|
58
|
+
{templates.length === 0
|
|
59
|
+
? <div className="text-gray-500 italic">{dict.tenant.mailTemplateList.noResults}</div>
|
|
60
|
+
: (
|
|
61
|
+
<Table>
|
|
62
|
+
<TableHeader>
|
|
63
|
+
<TableRow>
|
|
64
|
+
<TableHead>{dict.tenant.mailTemplateList.type}</TableHead>
|
|
65
|
+
<TableHead>{dict.tenant.mailTemplateList.variant}</TableHead>
|
|
66
|
+
<TableHead>{dict.tenant.mailTemplateList.project}</TableHead>
|
|
67
|
+
<TableHead>{dict.tenant.mailTemplateList.subject}</TableHead>
|
|
68
|
+
<TableHead>{dict.tenant.mailTemplateList.replyTo}</TableHead>
|
|
69
|
+
<TableHead>{dict.tenant.mailTemplateList.useLayout}</TableHead>
|
|
70
|
+
<TableHead />
|
|
71
|
+
</TableRow>
|
|
72
|
+
</TableHeader>
|
|
73
|
+
{templates.map(template => {
|
|
74
|
+
const key = templateKey(template)
|
|
75
|
+
return (
|
|
76
|
+
<React.Fragment key={key}>
|
|
77
|
+
<TableRow>
|
|
78
|
+
<TableCell className="font-mono text-xs">{template.type}</TableCell>
|
|
79
|
+
<TableCell>{template.variant || '—'}</TableCell>
|
|
80
|
+
<TableCell>{template.projectSlug ?? '—'}</TableCell>
|
|
81
|
+
<TableCell className="font-medium">{template.subject}</TableCell>
|
|
82
|
+
<TableCell>{template.replyTo ?? '—'}</TableCell>
|
|
83
|
+
<TableCell>{formatConfigValue(template.useLayout)}</TableCell>
|
|
84
|
+
<TableCell>
|
|
85
|
+
<Button variant="outline" size="sm" onClick={() => setExpanded(expanded === key ? null : key)}>
|
|
86
|
+
{expanded === key
|
|
87
|
+
? dict.tenant.mailTemplateList.hideContent
|
|
88
|
+
: dict.tenant.mailTemplateList.showContent}
|
|
89
|
+
</Button>
|
|
90
|
+
</TableCell>
|
|
91
|
+
</TableRow>
|
|
92
|
+
{expanded === key && (
|
|
93
|
+
<TableRow>
|
|
94
|
+
<TableCell colSpan={7}>
|
|
95
|
+
<pre className="overflow-x-auto whitespace-pre-wrap text-xs bg-gray-50 p-3 rounded">
|
|
96
|
+
{template.content}
|
|
97
|
+
</pre>
|
|
98
|
+
</TableCell>
|
|
99
|
+
</TableRow>
|
|
100
|
+
)}
|
|
101
|
+
</React.Fragment>
|
|
102
|
+
)
|
|
103
|
+
})}
|
|
104
|
+
</Table>
|
|
105
|
+
)}
|
|
106
|
+
</div>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { ReactNode } from 'react'
|
|
3
|
+
import { Loader, Table, TableCell, TableHead, TableHeader, TableRow } from '~/lib'
|
|
4
|
+
import { useConfigurationQuery, useTenantQueryLoader } from '@contember/react-client-tenant'
|
|
5
|
+
import { dict } from '../dict.js'
|
|
6
|
+
import { ConfigSection, formatConfigValue, ManagedByCliNote, renderConfigQueryState } from './common.js'
|
|
7
|
+
|
|
8
|
+
export interface TenantConfigViewController {
|
|
9
|
+
refresh: () => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface TenantConfigViewProps {
|
|
13
|
+
controller?: { current?: TenantConfigViewController }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Listed explicitly rather than via Object.entries so the order is stable and a
|
|
17
|
+
// non-window field added to ConfigRateLimits cannot leak into the table.
|
|
18
|
+
const rateLimitKeys = [
|
|
19
|
+
'signUpPerIp',
|
|
20
|
+
'loginPerIp',
|
|
21
|
+
'passwordResetPerIp',
|
|
22
|
+
'passwordlessInitPerIp',
|
|
23
|
+
'emailOtpPerPerson',
|
|
24
|
+
'emailVerificationPerIp',
|
|
25
|
+
] as const
|
|
26
|
+
|
|
27
|
+
const SettingsTable = ({ rows }: { rows: readonly (readonly [string, ReactNode])[] }) => (
|
|
28
|
+
<Table>
|
|
29
|
+
<TableHeader>
|
|
30
|
+
<TableRow>
|
|
31
|
+
<TableHead className="w-1/2">{dict.tenant.configView.setting}</TableHead>
|
|
32
|
+
<TableHead>{dict.tenant.configView.value}</TableHead>
|
|
33
|
+
</TableRow>
|
|
34
|
+
</TableHeader>
|
|
35
|
+
{rows.map(([label, value]) => (
|
|
36
|
+
<TableRow key={label}>
|
|
37
|
+
<TableCell className="font-medium">{label}</TableCell>
|
|
38
|
+
<TableCell>{value}</TableCell>
|
|
39
|
+
</TableRow>
|
|
40
|
+
))}
|
|
41
|
+
</Table>
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* `TenantConfigView` shows the tenant-wide configuration read-only. There is no
|
|
46
|
+
* editing counterpart on purpose — the write path is `contember tenant:apply`.
|
|
47
|
+
*
|
|
48
|
+
* Requires `system:viewConfig` (the read counterpart of `system:configure`). A
|
|
49
|
+
* caller without it gets a "no permission" message rather than an error, because
|
|
50
|
+
* the resolver rejects instead of returning defaults.
|
|
51
|
+
*
|
|
52
|
+
* ## Example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <TenantConfigView />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export const TenantConfigView = ({ controller }: TenantConfigViewProps) => {
|
|
58
|
+
const [query, { refresh }] = useTenantQueryLoader(useConfigurationQuery(), {})
|
|
59
|
+
if (controller) {
|
|
60
|
+
controller.current = { refresh }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const nonData = renderConfigQueryState({
|
|
64
|
+
query,
|
|
65
|
+
forbiddenMessage: dict.tenant.configView.forbidden,
|
|
66
|
+
failedMessage: dict.tenant.configView.failedToLoadData,
|
|
67
|
+
})
|
|
68
|
+
if (nonData !== null) {
|
|
69
|
+
return nonData
|
|
70
|
+
}
|
|
71
|
+
if (!('data' in query)) {
|
|
72
|
+
return null
|
|
73
|
+
}
|
|
74
|
+
const config = query.data
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div className="relative flex flex-col gap-6">
|
|
78
|
+
{query.state !== 'success' && <Loader position="absolute" />}
|
|
79
|
+
<ManagedByCliNote />
|
|
80
|
+
|
|
81
|
+
<ConfigSection title={dict.tenant.configView.panelAccess}>
|
|
82
|
+
<SettingsTable
|
|
83
|
+
rows={[
|
|
84
|
+
['globalRoles', formatConfigValue(config.panel.globalRoles)],
|
|
85
|
+
['projectRoles', formatConfigValue(config.panel.projectRoles)],
|
|
86
|
+
]}
|
|
87
|
+
/>
|
|
88
|
+
</ConfigSection>
|
|
89
|
+
|
|
90
|
+
<ConfigSection title={dict.tenant.configView.signup}>
|
|
91
|
+
<SettingsTable rows={[['requireEmailVerification', formatConfigValue(config.signup.requireEmailVerification)]]} />
|
|
92
|
+
</ConfigSection>
|
|
93
|
+
|
|
94
|
+
<ConfigSection title={dict.tenant.configView.emailChange}>
|
|
95
|
+
<SettingsTable rows={[['requireVerification', formatConfigValue(config.emailChange.requireVerification)]]} />
|
|
96
|
+
</ConfigSection>
|
|
97
|
+
|
|
98
|
+
<ConfigSection title={dict.tenant.configView.password}>
|
|
99
|
+
<SettingsTable
|
|
100
|
+
rows={[
|
|
101
|
+
['minLength', formatConfigValue(config.password.minLength)],
|
|
102
|
+
['requireUppercase', formatConfigValue(config.password.requireUppercase)],
|
|
103
|
+
['requireLowercase', formatConfigValue(config.password.requireLowercase)],
|
|
104
|
+
['requireDigit', formatConfigValue(config.password.requireDigit)],
|
|
105
|
+
['requireSpecial', formatConfigValue(config.password.requireSpecial)],
|
|
106
|
+
['pattern', formatConfigValue(config.password.pattern)],
|
|
107
|
+
['checkBlacklist', formatConfigValue(config.password.checkBlacklist)],
|
|
108
|
+
['checkHibp', formatConfigValue(config.password.checkHibp)],
|
|
109
|
+
]}
|
|
110
|
+
/>
|
|
111
|
+
</ConfigSection>
|
|
112
|
+
|
|
113
|
+
<ConfigSection title={dict.tenant.configView.passwordless}>
|
|
114
|
+
<SettingsTable
|
|
115
|
+
rows={[
|
|
116
|
+
['enabled', formatConfigValue(config.passwordless.enabled)],
|
|
117
|
+
['url', formatConfigValue(config.passwordless.url)],
|
|
118
|
+
['expiration', formatConfigValue(config.passwordless.expiration)],
|
|
119
|
+
]}
|
|
120
|
+
/>
|
|
121
|
+
</ConfigSection>
|
|
122
|
+
|
|
123
|
+
<ConfigSection title={dict.tenant.configView.login}>
|
|
124
|
+
<SettingsTable
|
|
125
|
+
rows={[
|
|
126
|
+
['baseBackoff', formatConfigValue(config.login.baseBackoff)],
|
|
127
|
+
['maxBackoff', formatConfigValue(config.login.maxBackoff)],
|
|
128
|
+
['attemptWindow', formatConfigValue(config.login.attemptWindow)],
|
|
129
|
+
['revealUserExists', formatConfigValue(config.login.revealUserExists)],
|
|
130
|
+
['revealLoginMethod', formatConfigValue(config.login.revealLoginMethod)],
|
|
131
|
+
['defaultTokenExpiration', formatConfigValue(config.login.defaultTokenExpiration)],
|
|
132
|
+
['maxTokenExpiration', formatConfigValue(config.login.maxTokenExpiration)],
|
|
133
|
+
['mfaGraceDuration', formatConfigValue(config.login.mfaGraceDuration)],
|
|
134
|
+
]}
|
|
135
|
+
/>
|
|
136
|
+
</ConfigSection>
|
|
137
|
+
|
|
138
|
+
<ConfigSection title={dict.tenant.configView.anomalyDetection}>
|
|
139
|
+
<SettingsTable
|
|
140
|
+
rows={[
|
|
141
|
+
['enabled', formatConfigValue(config.login.anomalyDetection.enabled)],
|
|
142
|
+
['historySize', formatConfigValue(config.login.anomalyDetection.historySize)],
|
|
143
|
+
['emailThreshold', formatConfigValue(config.login.anomalyDetection.emailThreshold)],
|
|
144
|
+
['stepUpThreshold', formatConfigValue(config.login.anomalyDetection.stepUpThreshold)],
|
|
145
|
+
]}
|
|
146
|
+
/>
|
|
147
|
+
</ConfigSection>
|
|
148
|
+
|
|
149
|
+
<ConfigSection title={dict.tenant.configView.captcha}>
|
|
150
|
+
<SettingsTable
|
|
151
|
+
rows={[
|
|
152
|
+
['provider', formatConfigValue(config.captcha.provider)],
|
|
153
|
+
['threshold', formatConfigValue(config.captcha.threshold)],
|
|
154
|
+
['protect.signUp', formatConfigValue(config.captcha.protect.signUp)],
|
|
155
|
+
['protect.passwordReset', formatConfigValue(config.captcha.protect.passwordReset)],
|
|
156
|
+
['protect.passwordlessInit', formatConfigValue(config.captcha.protect.passwordlessInit)],
|
|
157
|
+
['protect.emailVerification', formatConfigValue(config.captcha.protect.emailVerification)],
|
|
158
|
+
]}
|
|
159
|
+
/>
|
|
160
|
+
</ConfigSection>
|
|
161
|
+
|
|
162
|
+
<ConfigSection title={dict.tenant.configView.rateLimits}>
|
|
163
|
+
<Table>
|
|
164
|
+
<TableHeader>
|
|
165
|
+
<TableRow>
|
|
166
|
+
<TableHead className="w-1/2">{dict.tenant.configView.setting}</TableHead>
|
|
167
|
+
<TableHead>{dict.tenant.configView.limit}</TableHead>
|
|
168
|
+
<TableHead>{dict.tenant.configView.window}</TableHead>
|
|
169
|
+
</TableRow>
|
|
170
|
+
</TableHeader>
|
|
171
|
+
{rateLimitKeys.map(key => (
|
|
172
|
+
<TableRow key={key}>
|
|
173
|
+
<TableCell className="font-medium">{key}</TableCell>
|
|
174
|
+
<TableCell>{formatConfigValue(config.rateLimits[key].limit)}</TableCell>
|
|
175
|
+
<TableCell>{formatConfigValue(config.rateLimits[key].window)}</TableCell>
|
|
176
|
+
</TableRow>
|
|
177
|
+
))}
|
|
178
|
+
</Table>
|
|
179
|
+
</ConfigSection>
|
|
180
|
+
</div>
|
|
181
|
+
)
|
|
182
|
+
}
|