From ce11a5a85292c242bab577f3796f8edff21185eb Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 29 Aug 2023 09:46:15 +0200 Subject: [PATCH] Lock feature based on ff --- .../buttons/grid/GridManageAccessButton.svelte | 6 +++++- packages/builder/src/stores/portal/licensing.js | 4 ++++ packages/frontend-core/src/constants.js | 12 +----------- packages/types/src/sdk/licensing/feature.ts | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte index 0cd008bab1..a7f18464ef 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte @@ -1,4 +1,5 @@ - + diff --git a/packages/builder/src/stores/portal/licensing.js b/packages/builder/src/stores/portal/licensing.js index 4a59f29f52..eb9c9abe93 100644 --- a/packages/builder/src/stores/portal/licensing.js +++ b/packages/builder/src/stores/portal/licensing.js @@ -125,6 +125,9 @@ export const createLicensingStore = () => { const syncAutomationsEnabled = license.features.includes( Constants.Features.SYNC_AUTOMATIONS ) + const isViewPermissionsEnabled = license.features.includes( + Constants.Features.VIEW_PERMISSIONS + ) store.update(state => { return { ...state, @@ -140,6 +143,7 @@ export const createLicensingStore = () => { auditLogsEnabled, enforceableSSO, syncAutomationsEnabled, + isViewPermissionsEnabled, } }) }, diff --git a/packages/frontend-core/src/constants.js b/packages/frontend-core/src/constants.js index 0497a392f3..93a857ef9d 100644 --- a/packages/frontend-core/src/constants.js +++ b/packages/frontend-core/src/constants.js @@ -2,6 +2,7 @@ * Operator options for lucene queries */ export { OperatorOptions, SqlNumberTypeRangeMap } from "@budibase/shared-core" +export { Feature as Features } from "@budibase/types" // Cookie names export const Cookies = { @@ -62,17 +63,6 @@ export const PlanType = { */ export const ApiVersion = "1" -export const Features = { - USER_GROUPS: "userGroups", - BACKUPS: "appBackups", - ENVIRONMENT_VARIABLES: "environmentVariables", - AUDIT_LOGS: "auditLogs", - ENFORCEABLE_SSO: "enforceableSSO", - BRANDING: "branding", - SCIM: "scim", - SYNC_AUTOMATIONS: "syncAutomations", -} - // Role IDs export const Roles = { ADMIN: "ADMIN", diff --git a/packages/types/src/sdk/licensing/feature.ts b/packages/types/src/sdk/licensing/feature.ts index 218c2c5429..bd3a6583bf 100644 --- a/packages/types/src/sdk/licensing/feature.ts +++ b/packages/types/src/sdk/licensing/feature.ts @@ -12,7 +12,7 @@ export enum Feature { APP_BUILDERS = "appBuilders", OFFLINE = "offline", USER_ROLE_PUBLIC_API = "userRolePublicApi", - VIEW_PERMISSIONS = "viewPermission", + VIEW_PERMISSIONS = "viewPermissions", } export type PlanFeatures = { [key in PlanType]: Feature[] | undefined }