From 4871cd57d146e9a9279fa4e0e2de36464b259df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Thu, 6 Feb 2025 09:59:38 +0000 Subject: [PATCH] chore: mark release management as an enterprise feature (#9229) https://linear.app/unleash/issue/2-3093/sales-pitch-ui-for-release-management-to-show-non-enterprise-users Marks Release Management as a premium Enterprise feature. Once the `releasePlans` flag is enabled for everyone / removed, this is what non-Enterprise users will see: ![image](https://github.com/user-attachments/assets/7191fb09-976e-4e14-8e2f-6db114b5e2ca) --- .../common/PremiumFeature/PremiumFeature.tsx | 23 ++++++++++++------- .../__snapshots__/routes.test.tsx.snap | 1 - frontend/src/component/menu/routes.ts | 1 - .../ReleaseManagement/ReleaseManagement.tsx | 5 ++++ 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx b/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx index 2f7ff59996..6798175654 100644 --- a/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx +++ b/frontend/src/component/common/PremiumFeature/PremiumFeature.tsx @@ -128,6 +128,11 @@ const PremiumFeatures = { url: 'https://docs.getunleash.io/reference/environments', label: 'Environments management', }, + releaseManagement: { + plan: FeaturePlan.ENTERPRISE, + url: '', + label: 'Release management', + }, }; type PremiumFeatureType = keyof typeof PremiumFeatures; @@ -255,14 +260,16 @@ export const PremiumFeature = ({ )} - + {url && ( + + )} } diff --git a/frontend/src/component/menu/__tests__/__snapshots__/routes.test.tsx.snap b/frontend/src/component/menu/__tests__/__snapshots__/routes.test.tsx.snap index 76c49f2077..668a1b20e6 100644 --- a/frontend/src/component/menu/__tests__/__snapshots__/routes.test.tsx.snap +++ b/frontend/src/component/menu/__tests__/__snapshots__/routes.test.tsx.snap @@ -266,7 +266,6 @@ exports[`returns all baseRoutes 1`] = ` }, { "component": [Function], - "enterprise": true, "flag": "releasePlans", "menu": { "advanced": true, diff --git a/frontend/src/component/menu/routes.ts b/frontend/src/component/menu/routes.ts index ba5ae4c23c..3ddbbf606f 100644 --- a/frontend/src/component/menu/routes.ts +++ b/frontend/src/component/menu/routes.ts @@ -289,7 +289,6 @@ export const routes: IRoute[] = [ type: 'protected', menu: { advanced: true, mode: ['enterprise'] }, flag: 'releasePlans', - enterprise: true, }, { path: '/release-management/create-template', diff --git a/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx b/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx index 1f3febae5d..681e104261 100644 --- a/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx +++ b/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx @@ -12,6 +12,7 @@ import { EmptyTemplatesListMessage } from './EmptyTemplatesListMessage'; import { ReleasePlanTemplateList } from './ReleasePlanTemplateList'; import { useUiFlag } from 'hooks/useUiFlag'; import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; +import { PremiumFeature } from 'component/common/PremiumFeature/PremiumFeature'; export const ReleaseManagement = () => { usePageTitle('Release management'); @@ -24,6 +25,10 @@ export const ReleaseManagement = () => { return null; } + if (!isEnterprise()) { + return ; + } + return ( <>