From 879221b0b4db1f5fd0435b24765d42c203df78dd Mon Sep 17 00:00:00 2001 From: Alan Quach Date: Mon, 21 Jan 2019 15:04:07 -0800 Subject: [PATCH] fix(amazon): Fixing load balancers isInternal flag (#6402) --- .../configure/common/LoadBalancerLocation.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/scripts/modules/amazon/src/loadBalancer/configure/common/LoadBalancerLocation.tsx b/app/scripts/modules/amazon/src/loadBalancer/configure/common/LoadBalancerLocation.tsx index 339aadea09e..59bd1c01c95 100644 --- a/app/scripts/modules/amazon/src/loadBalancer/configure/common/LoadBalancerLocation.tsx +++ b/app/scripts/modules/amazon/src/loadBalancer/configure/common/LoadBalancerLocation.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import * as classNames from 'classnames'; import { IPromise } from 'angular'; import { chain, isNil, uniq, groupBy } from 'lodash'; -import { Field, FormikErrors } from 'formik'; +import { Field, FormikErrors, FieldProps } from 'formik'; import { Observable, Subject } from 'rxjs'; import { @@ -107,6 +107,7 @@ class LoadBalancerLocationImpl extends React.Component { this.props.formik.setFieldValue('vpcId', subnet && subnet.vpcIds[0]); this.props.formik.setFieldValue('subnetType', subnet && subnet.purpose); + if (!this.state.hideInternalFlag && !this.state.internalFlagToggled && subnet && subnet.purpose) { + // Even if inferInternalFlagFromSubnet is false, deck will still try to guess which the user wants unless explicitly toggled + this.props.formik.setFieldValue('isInternal', subnet.purpose.includes('internal')); + } }); moniker$.takeUntil(this.destroy$).subscribe(moniker => { @@ -374,7 +379,11 @@ class LoadBalancerLocationImpl extends React.Component