From c033c3c919591ded7054e72e5d5473672f63e6e1 Mon Sep 17 00:00:00 2001 From: Jeet Nihalani Date: Wed, 4 Aug 2021 20:34:40 -0600 Subject: [PATCH 1/3] feat: Disable CIDR feature when AppStream is enabled --- .../base-raas-ui/src/helpers/settings.js | 3 +- .../parts/ScEnvironmentButtons.js | 4 +- .../setup/CreateInternalEnvForm.js | 4 +- .../ec2-linux-instance.cfn.yml | 41 +++-- .../ec2-windows-instance.cfn.yml | 21 ++- .../sagemaker-notebook-instance.cfn.yml | 6 +- .../environment-sc-cidr-service.test.js | 41 +++++ .../__tests__/environment-sc-service.test.js | 162 +++++++++++++++++- .../environment-sc-cidr-service.js | 8 + .../service-catalog/environment-sc-service.js | 31 +++- .../src/models/forms/CfnParamsForm.js | 15 +- .../forms/__tests__/CfnParamsForm.test.js | 134 +++++++++++++++ openapi.yaml | 1 + 13 files changed, 426 insertions(+), 45 deletions(-) create mode 100644 addons/addon-environment-sc-ui/packages/environment-type-mgmt-ui/src/models/forms/__tests__/CfnParamsForm.test.js diff --git a/addons/addon-base-raas-ui/packages/base-raas-ui/src/helpers/settings.js b/addons/addon-base-raas-ui/packages/base-raas-ui/src/helpers/settings.js index 05ff41c9c2..b430859426 100644 --- a/addons/addon-base-raas-ui/packages/base-raas-ui/src/helpers/settings.js +++ b/addons/addon-base-raas-ui/packages/base-raas-ui/src/helpers/settings.js @@ -1,5 +1,6 @@ /* eslint-disable import/prefer-default-export */ const enableBuiltInWorkspaces = process.env.REACT_APP_ENABLE_BUILT_IN_WORKSPACES === 'true'; const enableEgressStore = process.env.REACT_APP_ENABLE_EGRESS_STORE; +const isAppStreamEnabled = process.env.REACT_APP_IS_APP_STREAM_ENABLED === 'true'; -export { enableBuiltInWorkspaces, enableEgressStore }; +export { enableBuiltInWorkspaces, enableEgressStore, isAppStreamEnabled }; diff --git a/addons/addon-base-raas-ui/packages/base-raas-ui/src/parts/environments-sc/parts/ScEnvironmentButtons.js b/addons/addon-base-raas-ui/packages/base-raas-ui/src/parts/environments-sc/parts/ScEnvironmentButtons.js index 77a5ef2120..5452a3f428 100644 --- a/addons/addon-base-raas-ui/packages/base-raas-ui/src/parts/environments-sc/parts/ScEnvironmentButtons.js +++ b/addons/addon-base-raas-ui/packages/base-raas-ui/src/parts/environments-sc/parts/ScEnvironmentButtons.js @@ -9,7 +9,7 @@ import { displayError } from '@aws-ee/base-ui/dist/helpers/notification'; import ScEnvironmentConnections from './ScEnvironmentConnections'; import ScEnvironmentUpdateCidrs from './ScEnvironmentUpdateCidrs'; -import { enableEgressStore } from '../../../helpers/settings'; +import { enableEgressStore, isAppStreamEnabled } from '../../../helpers/settings'; import ScEnvironmentEgressStoreDetail from './ScEnvironmentEgressStoreDetail'; const PROCESSING_STATUS_CODE = 'PROCESSING'; @@ -212,7 +212,7 @@ class ScEnvironmentButtons extends React.Component { View Detail )} - {state.canTerminate && !state.key.includes('FAILED') && ( + {!isAppStreamEnabled && state.canTerminate && !state.key.includes('FAILED') && (