diff --git a/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx b/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx index 5962d7eaabb7..1f3febae5d2d 100644 --- a/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx +++ b/frontend/src/component/releases/ReleaseManagement/ReleaseManagement.tsx @@ -10,12 +10,20 @@ import { useNavigate } from 'react-router-dom'; import { useReleasePlanTemplates } from 'hooks/api/getters/useReleasePlanTemplates/useReleasePlanTemplates'; import { EmptyTemplatesListMessage } from './EmptyTemplatesListMessage'; import { ReleasePlanTemplateList } from './ReleasePlanTemplateList'; +import { useUiFlag } from 'hooks/useUiFlag'; +import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig'; export const ReleaseManagement = () => { usePageTitle('Release management'); const navigate = useNavigate(); const data = useReleasePlanTemplates(); + const { isEnterprise } = useUiConfig(); + const releasePlansEnabled = useUiFlag('releasePlans'); + if (!releasePlansEnabled) { + return null; + } + return ( <> { }} maxWidth='700px' permission={CREATE_RELEASE_TEMPLATE} - disabled={false} + disabled={!isEnterprise()} > New template diff --git a/frontend/src/component/releases/ReleasePlanTemplate/CreateReleasePlanTemplate.tsx b/frontend/src/component/releases/ReleasePlanTemplate/CreateReleasePlanTemplate.tsx index 8f7580bdedec..09cbeb82417b 100644 --- a/frontend/src/component/releases/ReleasePlanTemplate/CreateReleasePlanTemplate.tsx +++ b/frontend/src/component/releases/ReleasePlanTemplate/CreateReleasePlanTemplate.tsx @@ -24,7 +24,7 @@ const StyledCancelButton = styled(Button)(({ theme }) => ({ })); export const CreateReleasePlanTemplate = () => { - const { uiConfig } = useUiConfig(); + const { uiConfig, isEnterprise } = useUiConfig(); const releasePlansEnabled = useUiFlag('releasePlans'); const { setToastApiError, setToastData } = useToast(); const navigate = useNavigate(); @@ -75,7 +75,7 @@ export const CreateReleasePlanTemplate = () => { --header 'Content-Type: application/json' \\ --data-raw '${JSON.stringify(getTemplatePayload(), undefined, 2)}'`; - if (!releasePlansEnabled) { + if (!releasePlansEnabled || !isEnterprise()) { return null; } diff --git a/frontend/src/component/releases/ReleasePlanTemplate/EditReleasePlanTemplate.tsx b/frontend/src/component/releases/ReleasePlanTemplate/EditReleasePlanTemplate.tsx index 0445e8e2c08d..2da6c7207851 100644 --- a/frontend/src/component/releases/ReleasePlanTemplate/EditReleasePlanTemplate.tsx +++ b/frontend/src/component/releases/ReleasePlanTemplate/EditReleasePlanTemplate.tsx @@ -24,7 +24,7 @@ const StyledCancelButton = styled(Button)(({ theme }) => ({ })); export const EditReleasePlanTemplate = () => { - const { uiConfig } = useUiConfig(); + const { uiConfig, isEnterprise } = useUiConfig(); const releasePlansEnabled = useUiFlag('releasePlans'); const templateId = useRequiredPathParam('templateId'); const { template, loading, error, refetch } = @@ -82,7 +82,7 @@ export const EditReleasePlanTemplate = () => { --header 'Content-Type: application/json' \\ --data-raw '${JSON.stringify(getTemplatePayload(), undefined, 2)}'`; - if (!releasePlansEnabled) { + if (!releasePlansEnabled || !isEnterprise()) { return null; }