Skip to content

Commit

Permalink
Rename networking module to ECS Networking React
Browse files Browse the repository at this point in the history
  • Loading branch information
piradeepk authored and mergify[bot] committed Nov 3, 2020
1 parent 5283f9f commit 10b17b9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app/scripts/modules/ecs/src/ecs.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { COMMON_MODULE } from './common/common.module';
import { ECS_SERVERGROUP_MODULE } from './serverGroup/serverGroup.module';
import { ECS_SERVER_GROUP_LOGGING } from './serverGroup/configure/wizard/logging/logging.component';
import { CONTAINER_REACT } from './serverGroup/configure/wizard/container/Container';
import { NETWORKING_REACT } from './serverGroup/configure/wizard/networking/Networking';
import { ECS_NETWORKING_REACT } from './serverGroup/configure/wizard/networking/Networking';
import { SERVICE_DISCOVERY_REACT } from './serverGroup/configure/wizard/serviceDiscovery/ServiceDiscovery';
import { TASK_DEFINITION_REACT } from './serverGroup/configure/wizard/taskDefinition/TaskDefinition';
import { ECS_SECURITY_GROUP_MODULE } from './securityGroup/securityGroup.module';
Expand Down Expand Up @@ -64,7 +64,7 @@ module(ECS_MODULE, [
ECS_SERVERGROUP_CONFIGURE_WIZARD_HORIZONTALSCALING_HORIZONTALSCALING_COMPONENT,
TASK_DEFINITION_REACT,
CONTAINER_REACT,
NETWORKING_REACT,
ECS_NETWORKING_REACT,
SERVICE_DISCOVERY_REACT,
ECS_SERVER_GROUP_LOGGING,
ECS_CLUSTER_READ_SERVICE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { HelpField, TetheredSelect, withErrorBoundary } from '@spinnaker/core';
import { Alert } from 'react-bootstrap';
import { Option } from 'react-select';

export interface INetworkingProps {
export interface IEcsNetworkingProps {
command: IEcsServerGroupCommand;
notifyAngular: (key: string, value: any) => void;
configureCommand: (query: string) => PromiseLike<void>;
}

interface INetworkingState {
interface IEcsNetworkingState {
associatePublicIpAddress: boolean;
networkMode: string;
networkModesAvailable: string[];
Expand All @@ -22,8 +22,8 @@ interface INetworkingState {
subnetTypesAvailable: string[];
}

export class Networking extends React.Component<INetworkingProps, INetworkingState> {
constructor(props: INetworkingProps) {
export class EcsNetworking extends React.Component<IEcsNetworkingProps, IEcsNetworkingState> {
constructor(props: IEcsNetworkingProps) {
super(props);
const cmd = this.props.command;

Expand Down Expand Up @@ -70,7 +70,7 @@ export class Networking extends React.Component<INetworkingProps, INetworkingSta

private updateSecurityGroups = (newSecurityGroups: Option<string>) => {
const updatedSecurityGroups = Array.isArray(newSecurityGroups)
? newSecurityGroups.map(securityGroups => securityGroups.value)
? newSecurityGroups.map((securityGroups) => securityGroups.value)
: [];
this.props.notifyAngular('securityGroups', updatedSecurityGroups);
this.setState({ securityGroups: updatedSecurityGroups });
Expand All @@ -87,21 +87,21 @@ export class Networking extends React.Component<INetworkingProps, INetworkingSta
this.setState({ associatePublicIpAddress: usePublicIp });
};

public render(): React.ReactElement<Networking> {
public render(): React.ReactElement<EcsNetworking> {
const updateAssociatePublicIpAddress = this.updateAssociatePublicIpAddress;
const updateNetworkMode = this.updateNetworkMode;
const updateSecurityGroups = this.updateSecurityGroups;
const updateSubnetType = this.updateSubnetType;

const networkModesAvailable = this.state.networkModesAvailable.map(function(networkMode) {
const networkModesAvailable = this.state.networkModesAvailable.map(function (networkMode) {
return { label: `${networkMode}`, value: networkMode };
});

const securityGroupsAvailable = this.state.securityGroupsAvailable.map(function(securityGroup) {
const securityGroupsAvailable = this.state.securityGroupsAvailable.map(function (securityGroup) {
return { label: `${securityGroup}`, value: securityGroup };
});

const subnetTypesAvailable = this.state.subnetTypesAvailable.map(function(subnetType) {
const subnetTypesAvailable = this.state.subnetTypesAvailable.map(function (subnetType) {
return { label: `${subnetType}`, value: subnetType };
});

Expand Down Expand Up @@ -216,8 +216,12 @@ export class Networking extends React.Component<INetworkingProps, INetworkingSta
}
}

export const NETWORKING_REACT = 'spinnaker.ecs.serverGroup.configure.wizard.networking.react';
module(NETWORKING_REACT, []).component(
'networkingReact',
react2angular(withErrorBoundary(Networking, 'networkingReact'), ['command', 'notifyAngular', 'configureCommand']),
export const ECS_NETWORKING_REACT = 'spinnaker.ecs.serverGroup.configure.wizard.networking.react';
module(ECS_NETWORKING_REACT, []).component(
'ecsNetworkingReact',
react2angular(withErrorBoundary(EcsNetworking, 'ecsNetworkingReact'), [
'command',
'notifyAngular',
'configureCommand',
]),
);
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="clearfix">
<div class="col-md-12">
<networking-react
<ecs-networking-react
command="command"
notify-angular="notifyAngular"
configure-command="configureCommand"
></networking-react>
></ecs-networking-react>
</div>
</div>

0 comments on commit 10b17b9

Please sign in to comment.