Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cf): fix SG pipeline modal display issues #6504

Merged
merged 1 commit into from
Feb 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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