Migrate Access administration patterns

This commit is contained in:
2026-08-03 11:01:22 +02:00
parent fe247999e9
commit 1409dbf94d
20 changed files with 498 additions and 84 deletions
@@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from "react";
import {
AdminPageLayout,
CredentialEnvelopeManager,
DocumentationHelpLink,
adminErrorMessage,
useDeltaWatermarks,
type ApiSettings,
@@ -15,6 +16,10 @@ import {
type UserAdminItem
} from "../../api/admin";
import { loadDeltaRows } from "./utils/deltaRows";
import {
ACCESS_INTERFACE_I18N,
CREDENTIAL_DOCUMENTATION
} from "./interfacePatterns";
type ScopeType = Extract<MailProfileScope, "system" | "tenant" | "user" | "group">;
@@ -116,13 +121,14 @@ export default function CredentialEnvelopesPanel({
description={scopeDescription(scopeType)}
loading={loadingTargets}
error={targetError}
actions={<DocumentationHelpLink reference={CREDENTIAL_DOCUMENTATION} />}
>
<CredentialEnvelopeManager
settings={settings}
scopeType={scopeType}
targetOptions={targets}
targetLabel={scopeType === "group" ? "Group" : "User"}
title="Reusable credentials"
targetLabel={scopeType === "group" ? "i18n:govoplan-access.group.171a0606" : "i18n:govoplan-access.user.9f8a2389"}
title={ACCESS_INTERFACE_I18N.reusableCredentials}
canWrite={canWrite}
/>
</AdminPageLayout>
@@ -130,18 +136,20 @@ export default function CredentialEnvelopesPanel({
}
function scopeTitle(scopeType: ScopeType): string {
if (scopeType === "system") return "System credentials";
if (scopeType === "tenant") return "Tenant credentials";
if (scopeType === "group") return "Group credentials";
return "User credentials";
if (scopeType === "system") return ACCESS_INTERFACE_I18N.systemCredentials;
if (scopeType === "tenant") return ACCESS_INTERFACE_I18N.tenantCredentials;
if (scopeType === "group") return ACCESS_INTERFACE_I18N.groupCredentials;
return ACCESS_INTERFACE_I18N.userCredentials;
}
function scopeDescription(scopeType: ScopeType): string {
if (scopeType === "system") {
return "Instance credentials that can be inherited by tenants and limited to selected modules or servers.";
return ACCESS_INTERFACE_I18N.systemCredentialDescription;
}
if (scopeType === "tenant") {
return "Tenant credentials shared by Mail, Files, Calendar, Addresses, and other permitted modules.";
return ACCESS_INTERFACE_I18N.tenantCredentialDescription;
}
return `Reusable credentials owned by the selected ${scopeType}.`;
return scopeType === "group"
? ACCESS_INTERFACE_I18N.groupCredentialDescription
: ACCESS_INTERFACE_I18N.userCredentialDescription;
}