mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
fix: route for environments for pro customers (#8390)
This commit is contained in:
parent
48eee2043f
commit
18ae49900b
@ -42,7 +42,7 @@ export const EnvironmentTable = () => {
|
|||||||
const { environments, mutateEnvironments } = useEnvironments();
|
const { environments, mutateEnvironments } = useEnvironments();
|
||||||
const [purchaseDialogOpen, setPurchaseDialogOpen] = useState(false);
|
const [purchaseDialogOpen, setPurchaseDialogOpen] = useState(false);
|
||||||
const isFeatureEnabled = useUiFlag('EEA');
|
const isFeatureEnabled = useUiFlag('EEA');
|
||||||
const isPurchaseAdditionalEnvronmentsEnabled = useUiFlag(
|
const isPurchaseAdditionalEnvironmentsEnabled = useUiFlag(
|
||||||
'purchaseAdditionalEnvironments',
|
'purchaseAdditionalEnvironments',
|
||||||
);
|
);
|
||||||
const { isPro } = useUiConfig();
|
const { isPro } = useUiConfig();
|
||||||
@ -121,7 +121,7 @@ export const EnvironmentTable = () => {
|
|||||||
<PageHeader title={`Environments (${count})`} actions={headerActions} />
|
<PageHeader title={`Environments (${count})`} actions={headerActions} />
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isFeatureEnabled && !isPurchaseAdditionalEnvronmentsEnabled) {
|
if (!isFeatureEnabled && !isPurchaseAdditionalEnvironmentsEnabled) {
|
||||||
return (
|
return (
|
||||||
<PageContent header={header}>
|
<PageContent header={header}>
|
||||||
<PremiumFeature feature='environments' />
|
<PremiumFeature feature='environments' />
|
||||||
@ -131,7 +131,7 @@ export const EnvironmentTable = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PageContent header={header}>
|
<PageContent header={header}>
|
||||||
{isPro() && isPurchaseAdditionalEnvronmentsEnabled ? (
|
{isPro() && isPurchaseAdditionalEnvironmentsEnabled ? (
|
||||||
<>
|
<>
|
||||||
<PurchasableFeature
|
<PurchasableFeature
|
||||||
title='Purchase additional environments'
|
title='Purchase additional environments'
|
||||||
|
@ -247,19 +247,7 @@ exports[`returns all baseRoutes 1`] = `
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": [Function],
|
"component": [Function],
|
||||||
"flag": "EEA",
|
"enterprise": true,
|
||||||
"menu": {
|
|
||||||
"advanced": true,
|
|
||||||
"mobile": true,
|
|
||||||
},
|
|
||||||
"notFlag": "purchaseAdditionalEnvironments",
|
|
||||||
"path": "/environments",
|
|
||||||
"title": "Environments",
|
|
||||||
"type": "protected",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"component": [Function],
|
|
||||||
"flag": "purchaseAdditionalEnvironments",
|
|
||||||
"menu": {
|
"menu": {
|
||||||
"advanced": true,
|
"advanced": true,
|
||||||
"mobile": true,
|
"mobile": true,
|
||||||
|
@ -4,7 +4,7 @@ import { StrategiesList } from 'component/strategies/StrategiesList/StrategiesLi
|
|||||||
import { TagTypeList } from 'component/tags/TagTypeList/TagTypeList';
|
import { TagTypeList } from 'component/tags/TagTypeList/TagTypeList';
|
||||||
import { IntegrationList } from 'component/integrations/IntegrationList/IntegrationList';
|
import { IntegrationList } from 'component/integrations/IntegrationList/IntegrationList';
|
||||||
import Login from 'component/user/Login/Login';
|
import Login from 'component/user/Login/Login';
|
||||||
import { EEA, P } from 'component/common/flags';
|
import { P } from 'component/common/flags';
|
||||||
import { NewUser } from 'component/user/NewUser/NewUser';
|
import { NewUser } from 'component/user/NewUser/NewUser';
|
||||||
import ResetPassword from 'component/user/ResetPassword/ResetPassword';
|
import ResetPassword from 'component/user/ResetPassword/ResetPassword';
|
||||||
import ForgottenPassword from 'component/user/ForgottenPassword/ForgottenPassword';
|
import ForgottenPassword from 'component/user/ForgottenPassword/ForgottenPassword';
|
||||||
@ -266,17 +266,8 @@ export const routes: IRoute[] = [
|
|||||||
title: 'Environments',
|
title: 'Environments',
|
||||||
component: EnvironmentTable,
|
component: EnvironmentTable,
|
||||||
type: 'protected',
|
type: 'protected',
|
||||||
flag: EEA,
|
|
||||||
notFlag: 'purchaseAdditionalEnvironments',
|
|
||||||
menu: { mobile: true, advanced: true },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/environments',
|
|
||||||
title: 'Environments',
|
|
||||||
component: EnvironmentTable,
|
|
||||||
type: 'protected',
|
|
||||||
flag: 'purchaseAdditionalEnvironments',
|
|
||||||
menu: { mobile: true, advanced: true },
|
menu: { mobile: true, advanced: true },
|
||||||
|
enterprise: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/feedback',
|
path: '/feedback',
|
||||||
|
Loading…
Reference in New Issue
Block a user