mirror of https://github.com/rancher/ui.git
Do not pass hiden fields in catalog answers
https://github.com/rancher/rancher/issues/22265
This commit is contained in:
parent
5c52fb0d20
commit
3881f5809a
|
|
@ -16,6 +16,7 @@ import { stringifyAnswer } from 'shared/utils/evaluate';
|
|||
import { isEmpty } from '@ember/utils';
|
||||
import CatalogApp from 'shared/mixins/catalog-app';
|
||||
import { all } from 'rsvp';
|
||||
import { evaluate } from 'shared/utils/evaluate';
|
||||
|
||||
const OVERRIDE_HEADERS = [
|
||||
{
|
||||
|
|
@ -377,13 +378,21 @@ export default Component.extend(NewOrEdit, CatalogApp, {
|
|||
answers: computed('templateOrHelmChartQuestions.@each.{variable,answer}', function() {
|
||||
const out = {};
|
||||
|
||||
const allQuestions = [];
|
||||
|
||||
(get(this, 'templateOrHelmChartQuestions') || []).forEach((item) => {
|
||||
out[item.variable] = stringifyAnswer(item.answer);
|
||||
allQuestions.push(item);
|
||||
(get(item, 'subquestions') || []).forEach((sub) => {
|
||||
out[sub.variable] = stringifyAnswer(sub.answer);
|
||||
allQuestions.push(sub);
|
||||
});
|
||||
});
|
||||
|
||||
const filteredQuestions = allQuestions.filter((q) => evaluate(q, allQuestions));
|
||||
|
||||
filteredQuestions.forEach((item) => {
|
||||
out[item.variable] = stringifyAnswer(item.answer);
|
||||
});
|
||||
|
||||
return out;
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { next } from '@ember/runloop';
|
|||
import { compare as compareVersion } from 'ui/utils/parse-version';
|
||||
import { stringifyAnswer } from 'shared/utils/evaluate';
|
||||
import C from 'ui/utils/constants';
|
||||
import { evaluate } from 'shared/utils/evaluate';
|
||||
|
||||
export default Mixin.create({
|
||||
previewTabDidChange: observer('previewTab', 'previewOpen', function() {
|
||||
|
|
@ -85,12 +86,11 @@ export default Mixin.create({
|
|||
|
||||
answers: computed('selectedTemplateModel.questions.@each.{variable,answer}', function() {
|
||||
const out = {};
|
||||
const allQuestions = (get(this, 'selectedTemplateModel.allQuestions') || []);
|
||||
const filteredQuestions = allQuestions.filter((q) => evaluate(q, allQuestions));
|
||||
|
||||
(get(this, 'selectedTemplateModel.questions') || []).forEach((item) => {
|
||||
filteredQuestions.forEach((item) => {
|
||||
out[item.variable] = stringifyAnswer(item.answer);
|
||||
(get(item, 'subquestions') || []).forEach((sub) => {
|
||||
out[sub.variable] = stringifyAnswer(sub.answer);
|
||||
});
|
||||
});
|
||||
|
||||
const customAnswers = get(this, 'selectedTemplateModel.customAnswers') || {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue