Skip to content

Commit

Permalink
chore: mark SSO as an Enterprise only feature (#9071)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois authored Jan 9, 2025
1 parent 0dbecd7 commit 537ef42
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 46 deletions.
2 changes: 1 addition & 1 deletion frontend/src/component/admin/adminRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const adminRoutes: INavigationMenuItem[] = [
{
path: '/admin/auth',
title: 'Single sign-on',
menu: { adminSettings: true, mode: ['pro', 'enterprise'] },
menu: { adminSettings: true, mode: ['enterprise'] },
group: 'access',
},
{
Expand Down
80 changes: 36 additions & 44 deletions frontend/src/component/admin/auth/AuthSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Tab, Tabs } from '@mui/material';
import { PageContent } from 'component/common/PageContent/PageContent';
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { OidcAuth } from './OidcAuth/OidcAuth';
import { SamlAuth } from './SamlAuth/SamlAuth';
Expand Down Expand Up @@ -45,58 +44,51 @@ export const AuthSettings = () => {
const [activeTab, setActiveTab] = useState(0);
usePageTitle(`Single sign-on: ${tabs[activeTab].label}`);

if (!isEnterprise()) {
return <PremiumFeature feature='sso' page />;
}

return (
<div>
<PermissionGuard permissions={[ADMIN, UPDATE_AUTH_CONFIGURATION]}>
<PageContent
withTabs
header={
<ConditionallyRender
condition={isEnterprise()}
show={
<Tabs
value={activeTab}
onChange={(_, tabId) => {
setActiveTab(tabId);
<Tabs
value={activeTab}
onChange={(_, tabId) => {
setActiveTab(tabId);
}}
indicatorColor='primary'
textColor='primary'
>
{tabs.map((tab, index) => (
<Tab
key={`${tab.label}_${index}`}
label={tab.label}
id={`tab-${index}`}
aria-controls={`tabpanel-${index}`}
sx={{
minWidth: {
lg: 160,
},
}}
indicatorColor='primary'
textColor='primary'
>
{tabs.map((tab, index) => (
<Tab
key={`${tab.label}_${index}`}
label={tab.label}
id={`tab-${index}`}
aria-controls={`tabpanel-${index}`}
sx={{
minWidth: {
lg: 160,
},
}}
/>
))}
</Tabs>
}
/>
/>
))}
</Tabs>
}
>
<ConditionallyRender
condition={isEnterprise()}
show={
<div>
{tabs.map((tab, index) => (
<TabPanel
key={index}
value={activeTab}
index={index}
>
{tab.component}
</TabPanel>
))}
</div>
}
elseShow={<PremiumFeature feature='sso' />}
/>
<div>
{tabs.map((tab, index) => (
<TabPanel
key={index}
value={activeTab}
index={index}
>
{tab.component}
</TabPanel>
))}
</div>
</PageContent>
</PermissionGuard>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const PremiumFeatures = {
label: 'User groups',
},
sso: {
plan: FeaturePlan.PRO,
plan: FeaturePlan.ENTERPRISE,
url: 'https://docs.getunleash.io/reference/rbac#user-group-sso-integration',
label: 'Single Sign-On',
},
Expand Down

0 comments on commit 537ef42

Please sign in to comment.