Skip to content

Commit

Permalink
Merge pull request #1222 from vincent99/master
Browse files Browse the repository at this point in the history
Fix question charts saving to values (#1221)
  • Loading branch information
vincent99 committed Sep 11, 2020
2 parents 7dd90c7 + 000ad98 commit 9ab4ea3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions pages/c/_cluster/apps/install.vue
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ export default {
return EDITOR_MODES.EDIT_CODE;
},
hasQuestions() {
return this.versionInfo && !!this.versionInfo.questions;
}
},
watch: {
Expand Down Expand Up @@ -525,7 +529,7 @@ export default {
actionInput(isUpgrade) {
const fromChart = this.versionInfo.values || {};
if ( !this.valuesComponent ) {
if ( !this.valuesComponent && !this.hasQuestions ) {
try {
this.chartValues = jsyaml.safeLoad(this.valuesYaml);
} catch (err) {
Expand Down Expand Up @@ -787,7 +791,7 @@ export default {
</tab>
</template>
<Questions
v-else-if="versionInfo && versionInfo.questions"
v-else-if="hasQuestions"
v-model="chartValues"
:chart="chart"
:version="version"
Expand Down
4 changes: 2 additions & 2 deletions plugins/steve/resource-instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -958,10 +958,10 @@ export default {

for ( const item of items ) {
let name = `${ item.nameDisplay }.yaml`;
const i = 2;
let i = 2;

while ( names.includes(name) ) {
name = `${ item.nameDisplay }_${ i }.yaml`;
name = `${ item.nameDisplay }_${ i++ }.yaml`;
}

names.push(name);
Expand Down

0 comments on commit 9ab4ea3

Please sign in to comment.