mirror of https://github.com/rancher/dashboard.git
Fix question charts saving to values (#1221)
This commit is contained in:
parent
7dd90c7777
commit
000ad98d30
|
|
@ -306,6 +306,10 @@ export default {
|
||||||
|
|
||||||
return EDITOR_MODES.EDIT_CODE;
|
return EDITOR_MODES.EDIT_CODE;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hasQuestions() {
|
||||||
|
return this.versionInfo && !!this.versionInfo.questions;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -525,7 +529,7 @@ export default {
|
||||||
actionInput(isUpgrade) {
|
actionInput(isUpgrade) {
|
||||||
const fromChart = this.versionInfo.values || {};
|
const fromChart = this.versionInfo.values || {};
|
||||||
|
|
||||||
if ( !this.valuesComponent ) {
|
if ( !this.valuesComponent && !this.hasQuestions ) {
|
||||||
try {
|
try {
|
||||||
this.chartValues = jsyaml.safeLoad(this.valuesYaml);
|
this.chartValues = jsyaml.safeLoad(this.valuesYaml);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -787,7 +791,7 @@ export default {
|
||||||
</tab>
|
</tab>
|
||||||
</template>
|
</template>
|
||||||
<Questions
|
<Questions
|
||||||
v-else-if="versionInfo && versionInfo.questions"
|
v-else-if="hasQuestions"
|
||||||
v-model="chartValues"
|
v-model="chartValues"
|
||||||
:chart="chart"
|
:chart="chart"
|
||||||
:version="version"
|
:version="version"
|
||||||
|
|
|
||||||
|
|
@ -958,10 +958,10 @@ export default {
|
||||||
|
|
||||||
for ( const item of items ) {
|
for ( const item of items ) {
|
||||||
let name = `${ item.nameDisplay }.yaml`;
|
let name = `${ item.nameDisplay }.yaml`;
|
||||||
const i = 2;
|
let i = 2;
|
||||||
|
|
||||||
while ( names.includes(name) ) {
|
while ( names.includes(name) ) {
|
||||||
name = `${ item.nameDisplay }_${ i }.yaml`;
|
name = `${ item.nameDisplay }_${ i++ }.yaml`;
|
||||||
}
|
}
|
||||||
|
|
||||||
names.push(name);
|
names.push(name);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue