mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
fix: check for enterprise in the create/edit templates UI (#8985)
This commit is contained in:
parent
3696420c51
commit
37b55eff5a
@ -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 (
|
||||
<>
|
||||
<PageContent
|
||||
@ -32,7 +40,7 @@ export const ReleaseManagement = () => {
|
||||
}}
|
||||
maxWidth='700px'
|
||||
permission={CREATE_RELEASE_TEMPLATE}
|
||||
disabled={false}
|
||||
disabled={!isEnterprise()}
|
||||
>
|
||||
New template
|
||||
</ResponsiveButton>
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user