Disable client policies tab if feature is disabled. (#19558)
Closes #19460
This commit is contained in:
parent
51a1dd61d2
commit
2c663c2fcc
1 changed files with 53 additions and 42 deletions
|
@ -48,6 +48,7 @@ import { RealmSettingsThemesTab } from "./ThemesTab";
|
|||
import { RealmSettingsTokensTab } from "./TokensTab";
|
||||
import { UserProfileTab } from "./user-profile/UserProfileTab";
|
||||
import { UserRegistration } from "./UserRegistration";
|
||||
import { useServerInfo } from "../context/server-info/ServerInfoProvider";
|
||||
|
||||
type RealmSettingsHeaderProps = {
|
||||
onChange: (value: boolean) => void;
|
||||
|
@ -236,6 +237,8 @@ export const RealmSettingsTabs = ({
|
|||
const sessionsTab = useTab("sessions");
|
||||
const tokensTab = useTab("tokens");
|
||||
const clientPoliciesTab = useTab("client-policies");
|
||||
const clientPoliciesDisabled =
|
||||
useServerInfo().profileInfo?.disabledFeatures?.includes("CLIENT_POLICIES");
|
||||
const userProfileTab = useTab("user-profile");
|
||||
const userRegistrationTab = useTab("user-registration");
|
||||
|
||||
|
@ -350,9 +353,12 @@ export const RealmSettingsTabs = ({
|
|||
>
|
||||
<RealmSettingsTokensTab save={save} realm={realm} />
|
||||
</Tab>
|
||||
{!clientPoliciesDisabled && (
|
||||
<Tab
|
||||
title={
|
||||
<TabTitleText>{t("realm-settings:clientPolicies")}</TabTitleText>
|
||||
<TabTitleText>
|
||||
{t("realm-settings:clientPolicies")}
|
||||
</TabTitleText>
|
||||
}
|
||||
data-testid="rs-clientPolicies-tab"
|
||||
{...clientPoliciesTab}
|
||||
|
@ -371,7 +377,9 @@ export const RealmSettingsTabs = ({
|
|||
title={<TabTitleText>{t("profiles")}</TabTitleText>}
|
||||
tooltip={
|
||||
<Tooltip
|
||||
content={t("realm-settings:clientPoliciesProfilesHelpText")}
|
||||
content={t(
|
||||
"realm-settings:clientPoliciesProfilesHelpText"
|
||||
)}
|
||||
/>
|
||||
}
|
||||
{...clientPoliciesProfilesTab}
|
||||
|
@ -386,7 +394,9 @@ export const RealmSettingsTabs = ({
|
|||
title={<TabTitleText>{t("policies")}</TabTitleText>}
|
||||
tooltip={
|
||||
<Tooltip
|
||||
content={t("realm-settings:clientPoliciesPoliciesHelpText")}
|
||||
content={t(
|
||||
"realm-settings:clientPoliciesPoliciesHelpText"
|
||||
)}
|
||||
/>
|
||||
}
|
||||
>
|
||||
|
@ -394,6 +404,7 @@ export const RealmSettingsTabs = ({
|
|||
</Tab>
|
||||
</RoutableTabs>
|
||||
</Tab>
|
||||
)}
|
||||
{isFeatureEnabled(Feature.DeclarativeUserProfile) &&
|
||||
realm.attributes?.userProfileEnabled === "true" && (
|
||||
<Tab
|
||||
|
|
Loading…
Reference in a new issue