mirror of https://github.com/rancher/ui.git
Fix MCA view answer yaml issue
https://github.com/rancher/rancher/issues/18196
This commit is contained in:
parent
6d75ad47e6
commit
9af7b24edc
|
|
@ -419,14 +419,16 @@ export default Component.extend(NewOrEdit, CatalogApp, {
|
|||
if (get(model, 'questions')) {
|
||||
let neu = {};
|
||||
|
||||
(get(this, 'answersArray') || []).forEach((a) => {
|
||||
(get(this, 'answersArray') || []).filter((a) => typeof a.answer !== 'object' ).forEach((a) => {
|
||||
neu[a.variable] = isEmpty(a.answer) ? a.default : a.answer;
|
||||
});
|
||||
|
||||
const customAnswers = get(model, 'customAnswers') || {};
|
||||
|
||||
Object.keys(customAnswers).forEach((key) => {
|
||||
neu[key] = customAnswers[key];
|
||||
if ( typeof customAnswers[key] !== 'object' ) {
|
||||
neu[key] = customAnswers[key];
|
||||
}
|
||||
});
|
||||
|
||||
return YAML.stringify(neu);
|
||||
|
|
|
|||
Loading…
Reference in New Issue