Skip to content

Commit

Permalink
fix(cf): fix SG pipeline modal display issues (spinnaker#6504)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jammy Louie authored and jkschneider committed Feb 7, 2019
1 parent a35088a commit 539457c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface ICloudFoundryCreateServerGroupProps extends IModalComponentProp

export interface ICloudFoundryCreateServerGroupState {
artifactAccounts: IArtifactAccount[];
loading: boolean;
requiresTemplateSelection: boolean;
taskMonitor: TaskMonitor;
}
Expand All @@ -58,6 +59,7 @@ export class CloudFoundryCreateServerGroupModal extends React.Component<
super(props);
this.state = {
artifactAccounts: [],
loading: false,
requiresTemplateSelection: get(props, 'command.viewState.requiresTemplateSelection', false),
taskMonitor: new TaskMonitor({
application: props.application,
Expand All @@ -76,6 +78,11 @@ export class CloudFoundryCreateServerGroupModal extends React.Component<

private templateSelected = () => {
this.setState({ requiresTemplateSelection: false });
this.initialize();
};

private initialize = () => {
this.setState({ loading: false });
};

private onTaskComplete = () => {
Expand All @@ -94,7 +101,7 @@ export class CloudFoundryCreateServerGroupModal extends React.Component<
};

public render(): React.ReactElement<CloudFoundryCreateServerGroupModal> {
const { artifactAccounts, requiresTemplateSelection, taskMonitor } = this.state;
const { artifactAccounts, loading, requiresTemplateSelection, taskMonitor } = this.state;
const { application, command, dismissModal, isSourceConstant, serverGroup, title } = this.props;

if (requiresTemplateSelection) {
Expand All @@ -112,6 +119,7 @@ export class CloudFoundryCreateServerGroupModal extends React.Component<
<WizardModal<ICloudFoundryCreateServerGroupCommand>
heading={title}
initialValues={command}
loading={loading}
taskMonitor={taskMonitor}
dismissModal={dismissModal}
closeModal={this.submit}
Expand Down

0 comments on commit 539457c

Please sign in to comment.