From 5c9e0a2630850b2ff2acd97ff8177e5b91512048 Mon Sep 17 00:00:00 2001
From: Philipinho <16838612+Philipinho@users.noreply.github.com>
Date: Sat, 8 Mar 2025 18:26:34 +0000
Subject: [PATCH] * prefetch sso providers in settings * hide sso enforcement
in standard plan
---
.../components/settings/settings-queries.tsx | 8 ++++++++
.../components/settings/settings-sidebar.tsx | 4 ++++
.../client/src/ee/security/pages/security.tsx | 20 +++++++++----------
3 files changed, 21 insertions(+), 11 deletions(-)
diff --git a/apps/client/src/components/settings/settings-queries.tsx b/apps/client/src/components/settings/settings-queries.tsx
index a37ecd8b..f4cddfaa 100644
--- a/apps/client/src/components/settings/settings-queries.tsx
+++ b/apps/client/src/components/settings/settings-queries.tsx
@@ -8,6 +8,7 @@ import { getGroups } from "@/features/group/services/group-service.ts";
import { QueryParams } from "@/lib/types.ts";
import { getWorkspaceMembers } from "@/features/workspace/services/workspace-service.ts";
import { getLicenseInfo } from "@/ee/licence/services/license-service.ts";
+import { getSsoProviders } from '@/ee/security/services/security-service.ts';
export const prefetchWorkspaceMembers = () => {
const params = { limit: 100, page: 1, query: "" } as QueryParams;
@@ -49,3 +50,10 @@ export const prefetchLicense = () => {
queryFn: () => getLicenseInfo(),
});
};
+
+export const prefetchSsoProviders = () => {
+ queryClient.prefetchQuery({
+ queryKey: ["sso-providers"],
+ queryFn: () => getSsoProviders(),
+ });
+};
\ No newline at end of file
diff --git a/apps/client/src/components/settings/settings-sidebar.tsx b/apps/client/src/components/settings/settings-sidebar.tsx
index 7c3b57dd..551758ce 100644
--- a/apps/client/src/components/settings/settings-sidebar.tsx
+++ b/apps/client/src/components/settings/settings-sidebar.tsx
@@ -24,6 +24,7 @@ import {
prefetchGroups,
prefetchLicense,
prefetchSpaces,
+ prefetchSsoProviders,
prefetchWorkspaceMembers,
} from "@/components/settings/settings-queries.tsx";
@@ -165,6 +166,9 @@ export default function SettingsSidebar() {
prefetchHandler = prefetchLicense;
}
break;
+ case "Security & SSO":
+ prefetchHandler = prefetchSsoProviders;
+ break;
default:
break;
}
diff --git a/apps/client/src/ee/security/pages/security.tsx b/apps/client/src/ee/security/pages/security.tsx
index 5399acfb..9a85cff2 100644
--- a/apps/client/src/ee/security/pages/security.tsx
+++ b/apps/client/src/ee/security/pages/security.tsx
@@ -35,17 +35,15 @@ export default function Security() {
Single sign-on (SSO)
-
-
-
-
- {!isCloud() && hasLicenseKey ? : ""}
-
- {/*TODO: revisit when we add a second plan
-
- */}
-
-
+ {/*TODO: revisit when we add a second plan */}
+ {!isCloud() && hasLicenseKey ? (
+ <>
+
+
+
+
+ >
+ ) : null}
>