From 897670b2332734ab84ffe5b537fc35f3ab17343c Mon Sep 17 00:00:00 2001 From: Sanket Dharwadkar Date: Thu, 3 Mar 2022 16:46:39 -0500 Subject: [PATCH] fix: select cidr field only in non-TRE env (#941) * fix: select cidr field only in non-TRE env --- .../parts/environments-sc/setup/CreateInternalEnvForm.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/addon-base-raas-ui/packages/base-raas-ui/src/parts/environments-sc/setup/CreateInternalEnvForm.js b/addons/addon-base-raas-ui/packages/base-raas-ui/src/parts/environments-sc/setup/CreateInternalEnvForm.js index 6ef5acc6c6..4b9c7e4d85 100644 --- a/addons/addon-base-raas-ui/packages/base-raas-ui/src/parts/environments-sc/setup/CreateInternalEnvForm.js +++ b/addons/addon-base-raas-ui/packages/base-raas-ui/src/parts/environments-sc/setup/CreateInternalEnvForm.js @@ -162,9 +162,9 @@ class CreateInternalEnvForm extends React.Component { renderForm() { const form = this.form; - const askForCidr = !_.isUndefined(this.props.defaultCidr) && !this.isAppStreamEnabled; + const shouldAskforCidr = !_.isUndefined(this.props.defaultCidr) && !this.isAppStreamEnabled; const configurations = this.configurations; - const field = form.$('cidr'); + const cidrField = shouldAskforCidr ? form.$('cidr') : undefined; // we show the AppStream configuration warning when the feature is enabled, // and the user's projects are not linked to AppStream-configured accounts @@ -179,8 +179,8 @@ class CreateInternalEnvForm extends React.Component { {({ processing, onCancel }) => ( <> - {askForCidr && } - {askForCidr && !_.isEmpty(field.value) && field.value.split('/')[1] <= 16 && ( + {shouldAskforCidr && } + {shouldAskforCidr && !_.isEmpty(cidrField.value) && cidrField.value.split('/')[1] <= 16 && (