Show SCIM banner if SCIM enabled

This commit is contained in:
adrinr 2023-03-21 12:06:16 +00:00
parent 1838f75dbc
commit 0c5d33a642
2 changed files with 24 additions and 8 deletions

View File

@ -11,6 +11,7 @@
notifications, notifications,
Pagination, Pagination,
Divider, Divider,
Icon,
} from "@budibase/bbui" } from "@budibase/bbui"
import AddUserModal from "./_components/AddUserModal.svelte" import AddUserModal from "./_components/AddUserModal.svelte"
import { users, groups, auth, licensing, organisation } from "stores/portal" import { users, groups, auth, licensing, organisation } from "stores/portal"
@ -230,14 +231,21 @@
</Layout> </Layout>
<Divider /> <Divider />
<div class="controls"> <div class="controls">
<ButtonGroup> {#if $licensing.scimEnabled}
<Button disabled={readonly} on:click={createUserModal.show} cta> <ButtonGroup>
Add users <Button disabled={readonly} on:click={createUserModal.show} cta>
</Button> Add users
<Button disabled={readonly} on:click={importUsersModal.show} secondary> </Button>
Import <Button disabled={readonly} on:click={importUsersModal.show} secondary>
</Button> Import
</ButtonGroup> </Button>
</ButtonGroup>
{:else}
<div class="scim-banner">
<Icon name="Info" size="S" />
Users are synced from your AD
</div>
{/if}
<div class="controls-right"> <div class="controls-right">
<Search bind:value={searchEmail} placeholder="Search" /> <Search bind:value={searchEmail} placeholder="Search" />
{#if selectedRows.length > 0} {#if selectedRows.length > 0}
@ -322,4 +330,9 @@
.controls-right :global(.spectrum-Search) { .controls-right :global(.spectrum-Search) {
width: 200px; width: 200px;
} }
.scim-banner {
display: flex;
gap: var(--spacing-s);
}
</style> </style>

View File

@ -18,6 +18,7 @@ export const createLicensingStore = () => {
groupsEnabled: false, groupsEnabled: false,
backupsEnabled: false, backupsEnabled: false,
brandingEnabled: false, brandingEnabled: false,
scimEnabled: false,
// the currently used quotas from the db // the currently used quotas from the db
quotaUsage: undefined, quotaUsage: undefined,
// derived quota metrics for percentages used // derived quota metrics for percentages used
@ -66,6 +67,7 @@ export const createLicensingStore = () => {
const backupsEnabled = license.features.includes( const backupsEnabled = license.features.includes(
Constants.Features.BACKUPS Constants.Features.BACKUPS
) )
const scimEnabled = license.features.includes(Constants.Features.SCIM)
const environmentVariablesEnabled = license.features.includes( const environmentVariablesEnabled = license.features.includes(
Constants.Features.ENVIRONMENT_VARIABLES Constants.Features.ENVIRONMENT_VARIABLES
) )
@ -88,6 +90,7 @@ export const createLicensingStore = () => {
groupsEnabled, groupsEnabled,
backupsEnabled, backupsEnabled,
brandingEnabled, brandingEnabled,
scimEnabled,
environmentVariablesEnabled, environmentVariablesEnabled,
auditLogsEnabled, auditLogsEnabled,
enforceableSSO, enforceableSSO,