diff --git a/clients/admin-ui/cypress/e2e/home.cy.ts b/clients/admin-ui/cypress/e2e/home.cy.ts index d296a8ea96..a238ed454a 100644 --- a/clients/admin-ui/cypress/e2e/home.cy.ts +++ b/clients/admin-ui/cypress/e2e/home.cy.ts @@ -27,13 +27,6 @@ describe("Home page", () => { describe("permissions", () => { beforeEach(() => { - // For these tests, let's say we always have systems and connectors - cy.intercept("GET", "/api/v1/system", { - fixture: "systems/systems.json", - }).as("getSystems"); - cy.intercept("GET", "/api/v1/connection*", { - fixture: "connectors/list.json", - }).as("getConnectors"); stubPlus(true); }); diff --git a/clients/admin-ui/src/features/common/custom-fields/hooks.ts b/clients/admin-ui/src/features/common/custom-fields/hooks.ts index 6bdd824429..dd06c5ceb7 100644 --- a/clients/admin-ui/src/features/common/custom-fields/hooks.ts +++ b/clients/admin-ui/src/features/common/custom-fields/hooks.ts @@ -131,6 +131,10 @@ export const useCustomFields = ({ */ const upsertCustomFields = useCallback( async (formValues: CustomFieldsFormValues) => { + if (!isEnabled) { + return; + } + // When creating an resource, the fides key may have initially been blank. But by the time the // form is submitted it must not be blank (not undefined, not an empty string). const fidesKey = formValues.fides_key || resourceFidesKey; @@ -190,6 +194,7 @@ export const useCustomFields = ({ } }, [ + isEnabled, definitionIdToCustomField, deleteCustomFieldMutationTrigger, errorAlert, diff --git a/clients/admin-ui/src/features/common/nav/v2/NavSideBar.tsx b/clients/admin-ui/src/features/common/nav/v2/NavSideBar.tsx index b757c80c75..f3f274568e 100644 --- a/clients/admin-ui/src/features/common/nav/v2/NavSideBar.tsx +++ b/clients/admin-ui/src/features/common/nav/v2/NavSideBar.tsx @@ -12,8 +12,8 @@ export const NavSideBar = () => { const router = useRouter(); const nav = useNav({ path: router.pathname }); - // Don't render the sidebar if no group is active or if the group only has one link. - if (!nav.active || nav.active.children.length <= 1) { + // Don't render the sidebar if no group is active + if (!nav.active) { return null; } diff --git a/clients/admin-ui/src/features/common/nav/v2/nav-config.test.ts b/clients/admin-ui/src/features/common/nav/v2/nav-config.test.ts index 8e260bb61b..975af3a080 100644 --- a/clients/admin-ui/src/features/common/nav/v2/nav-config.test.ts +++ b/clients/admin-ui/src/features/common/nav/v2/nav-config.test.ts @@ -19,6 +19,7 @@ const ALL_SCOPES = [ ScopeRegistryEnum.SYSTEM_UPDATE, ScopeRegistryEnum.CTL_DATASET_CREATE, ScopeRegistryEnum.USER_UPDATE, + ScopeRegistryEnum.USER_READ, ScopeRegistryEnum.DATA_CATEGORY_CREATE, ]; @@ -116,11 +117,6 @@ describe("configureNavGroups", () => { title: "Home", children: [{ title: "Home", path: "/" }], }); - - expect(navGroups[1]).toMatchObject({ - title: "Management", - children: [{ title: "About Fides", path: "/management/about" }], - }); }); it("conditionally shows request manager using scopes", () => { diff --git a/clients/admin-ui/src/features/common/nav/v2/nav-config.ts b/clients/admin-ui/src/features/common/nav/v2/nav-config.ts index bf27822206..0a30f9d244 100644 --- a/clients/admin-ui/src/features/common/nav/v2/nav-config.ts +++ b/clients/admin-ui/src/features/common/nav/v2/nav-config.ts @@ -105,7 +105,11 @@ export const NAV_CONFIG: NavConfigGroup[] = [ ScopeRegistryEnum.USER_PERMISSION_UPDATE, ], }, - { title: "About Fides", path: "/management/about", scopes: [] }, + { + title: "About Fides", + path: "/management/about", + scopes: [ScopeRegistryEnum.USER_READ], // temporary scope while we don't have a scope for beta features + }, ], }, ]; diff --git a/clients/admin-ui/src/home/HomeContent.tsx b/clients/admin-ui/src/home/HomeContent.tsx index 6926659251..ab4b52352c 100644 --- a/clients/admin-ui/src/home/HomeContent.tsx +++ b/clients/admin-ui/src/home/HomeContent.tsx @@ -16,9 +16,7 @@ const COLUMNS = 3; const HomeContent: React.FC = () => { const router = useRouter(); - const { connectionsCount, systemsCount, plus } = useFeatures(); - const hasConnections = connectionsCount > 0; - const hasSystems = systemsCount > 0; + const { plus } = useFeatures(); const userScopes = useAppSelector(selectThisUsersScopes); const list = useMemo( @@ -26,11 +24,9 @@ const HomeContent: React.FC = () => { configureTiles({ config: MODULE_CARD_ITEMS, hasPlus: plus, - hasConnections, - hasSystems, userScopes, }), - [hasConnections, hasSystems, plus, userScopes] + [plus, userScopes] ); return ( diff --git a/clients/admin-ui/src/home/tile-config.test.ts b/clients/admin-ui/src/home/tile-config.test.ts index 26f9d600ce..1e928911bf 100644 --- a/clients/admin-ui/src/home/tile-config.test.ts +++ b/clients/admin-ui/src/home/tile-config.test.ts @@ -18,7 +18,6 @@ describe("configureTiles", () => { const tiles = configureTiles({ config: MODULE_CARD_ITEMS, hasPlus: false, - hasSystems: true, userScopes: ALL_SCOPES_FOR_TILES, }); @@ -29,54 +28,11 @@ describe("configureTiles", () => { const tiles = configureTiles({ config: MODULE_CARD_ITEMS, hasPlus: true, - hasSystems: true, userScopes: ALL_SCOPES_FOR_TILES, }); expect(tiles.filter((t) => t.href === "/datamap").length).toEqual(1); }); - it("can exclude tiles that require systems or connectors", () => { - const tiles = configureTiles({ - config: MODULE_CARD_ITEMS, - hasPlus: true, - hasSystems: false, - hasConnections: false, - userScopes: ALL_SCOPES_FOR_TILES, - }); - expect(tiles.map((t) => t.name)).toEqual([ - "Add systems", - "Configure privacy requests", - ]); - }); - - it("can include tiles that require systems", () => { - const tiles = configureTiles({ - config: MODULE_CARD_ITEMS, - hasPlus: true, - hasSystems: true, - userScopes: ALL_SCOPES_FOR_TILES, - }); - expect(tiles.map((t) => t.name)).toEqual([ - "View data map", - "Add systems", - "View systems", - "Configure privacy requests", - ]); - }); - - it("can include tiles that require connectors", () => { - const tiles = configureTiles({ - config: MODULE_CARD_ITEMS, - hasConnections: true, - userScopes: ALL_SCOPES_FOR_TILES, - }); - expect(tiles.map((t) => t.name)).toEqual([ - "Add systems", - "Configure privacy requests", - "Review privacy requests", - ]); - }); - describe("configure by scopes", () => { it("returns no tiles if user has no scopes", () => { const tiles = configureTiles({ @@ -116,7 +72,6 @@ describe("configureTiles", () => { const tiles = configureTiles({ config: MODULE_CARD_ITEMS, hasPlus: true, - hasSystems: true, userScopes: [ScopeRegistryEnum.DATAMAP_READ], }); expect(tiles.map((t) => t.name)).toEqual(["View data map"]); @@ -125,7 +80,6 @@ describe("configureTiles", () => { it("conditionally shows reviewing privacy requests", () => { const tiles = configureTiles({ config: MODULE_CARD_ITEMS, - hasConnections: true, userScopes: [ScopeRegistryEnum.PRIVACY_REQUEST_REVIEW], }); expect(tiles.map((t) => t.name)).toEqual(["Review privacy requests"]); @@ -134,7 +88,6 @@ describe("configureTiles", () => { it("can combine scopes to show multiple tiles", () => { const tiles = configureTiles({ config: MODULE_CARD_ITEMS, - hasConnections: true, userScopes: [ ScopeRegistryEnum.PRIVACY_REQUEST_REVIEW, ScopeRegistryEnum.CONNECTION_CREATE_OR_UPDATE, diff --git a/clients/admin-ui/src/home/tile-config.ts b/clients/admin-ui/src/home/tile-config.ts index 579671021a..73d4cf50ca 100644 --- a/clients/admin-ui/src/home/tile-config.ts +++ b/clients/admin-ui/src/home/tile-config.ts @@ -6,8 +6,6 @@ export const configureTiles = ({ config, userScopes, hasPlus = false, - hasSystems = false, - hasConnections = false, }: { config: ModuleCardConfig[]; userScopes: ScopeRegistryEnum[]; @@ -21,14 +19,6 @@ export const configureTiles = ({ filteredConfig = filteredConfig.filter((c) => !c.requiresPlus); } - if (!hasSystems) { - filteredConfig = filteredConfig.filter((c) => !c.requiresSystems); - } - - if (!hasConnections) { - filteredConfig = filteredConfig.filter((c) => !c.requiresConnections); - } - const filteredByScope: ModuleCardConfig[] = []; filteredConfig.forEach((moduleConfig) => { if (moduleConfig.scopes.length === 0) {