Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:replicatedhq/ship
Browse files Browse the repository at this point in the history
  • Loading branch information
GraysonNull committed Jul 27, 2018
2 parents ea4eb23 + b710519 commit d5757b3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
37 changes: 29 additions & 8 deletions web/src/components/kustomize/HelmValuesEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ export default class HelmValuesEditor extends React.Component {
this.setState(nextState)
}

handleContinue() {
const { actions } = this.props;
const submitAction = find(actions, { sort: 1 }); // Find the continue action
this.props.handleAction(submitAction);
}

onValuesSaved() {
let nextState = {};
nextState.toastDetails = {
Expand All @@ -96,18 +102,28 @@ export default class HelmValuesEditor extends React.Component {
opts: {
showCancelButton: true,
confirmButtonText: "Continue to next step",
confirmAction: async () => {
const { actions } = this.props;
const submitAction = find(actions, { sort: 1 }); // Find the continue action
this.props.handleAction(submitAction);
return;
}
confirmAction: () => { this.handleContinue(); }
}
}
this.setState(nextState);
}

async handleSaveValues() {
handleSkip() {
const { initialSpecValue } = this.state;
const payload = {
values: initialSpecValue
}
this.props.saveValues(payload)
.then(() => {
this.handleContinue();
})
.catch((err) => {
// TODO: better handling
console.log(err);
})
}

handleSaveValues() {
const { specValue, initialSpecValue } = this.state;
const payload = {
values: specValue
Expand All @@ -119,6 +135,10 @@ export default class HelmValuesEditor extends React.Component {
this.setState({ saving: false, savedYaml: true });
this.onValuesSaved();
})
.catch((err) => {
// TODO: better handling
console.log(err);
})
}
}

Expand Down Expand Up @@ -171,7 +191,8 @@ export default class HelmValuesEditor extends React.Component {
<Linter errors={this.state.specErrors} spec={values} previewEnabled={true} readme={readme} />
</div>
</div>
<div className="action container u-width--full u-marginTop--30 flex flex1 justifyContent--flexEnd u-position--fixed u-bottom--0 u-right--0 u-left--0">
<div className="action container u-width--full u-marginTop--30 flex flex1 alignItems--center justifyContent--flexEnd u-position--fixed u-bottom--0 u-right--0 u-left--0">
<p className="u-color--astral u-fontSize--normal u-fontWeight--medium u-marginRight--20 u-cursor--pointer" onClick={() => { this.handleSkip() }} >Skip this step</p>
<button
className="btn primary"
onClick={() => this.handleSaveValues()}
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/shared/Linter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export default class Linter extends React.Component {
constructor() {
super();
this.state = {
showHelp: true,
showPreview: false
showHelp: false,
showPreview: true
};
autoBind(this);
}
Expand Down

0 comments on commit d5757b3

Please sign in to comment.