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 { isEmpty } from '@ember/utils';
|
||||||
import CatalogApp from 'shared/mixins/catalog-app';
|
import CatalogApp from 'shared/mixins/catalog-app';
|
||||||
import { all } from 'rsvp';
|
import { all } from 'rsvp';
|
||||||
|
import { evaluate } from 'shared/utils/evaluate';
|
||||||
|
|
||||||
const OVERRIDE_HEADERS = [
|
const OVERRIDE_HEADERS = [
|
||||||
{
|
{
|
||||||
|
|
@ -377,13 +378,21 @@ export default Component.extend(NewOrEdit, CatalogApp, {
|
||||||
answers: computed('templateOrHelmChartQuestions.@each.{variable,answer}', function() {
|
answers: computed('templateOrHelmChartQuestions.@each.{variable,answer}', function() {
|
||||||
const out = {};
|
const out = {};
|
||||||
|
|
||||||
|
const allQuestions = [];
|
||||||
|
|
||||||
(get(this, 'templateOrHelmChartQuestions') || []).forEach((item) => {
|
(get(this, 'templateOrHelmChartQuestions') || []).forEach((item) => {
|
||||||
out[item.variable] = stringifyAnswer(item.answer);
|
allQuestions.push(item);
|
||||||
(get(item, 'subquestions') || []).forEach((sub) => {
|
(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;
|
return out;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { next } from '@ember/runloop';
|
||||||
import { compare as compareVersion } from 'ui/utils/parse-version';
|
import { compare as compareVersion } from 'ui/utils/parse-version';
|
||||||
import { stringifyAnswer } from 'shared/utils/evaluate';
|
import { stringifyAnswer } from 'shared/utils/evaluate';
|
||||||
import C from 'ui/utils/constants';
|
import C from 'ui/utils/constants';
|
||||||
|
import { evaluate } from 'shared/utils/evaluate';
|
||||||
|
|
||||||
export default Mixin.create({
|
export default Mixin.create({
|
||||||
previewTabDidChange: observer('previewTab', 'previewOpen', function() {
|
previewTabDidChange: observer('previewTab', 'previewOpen', function() {
|
||||||
|
|
@ -85,12 +86,11 @@ export default Mixin.create({
|
||||||
|
|
||||||
answers: computed('selectedTemplateModel.questions.@each.{variable,answer}', function() {
|
answers: computed('selectedTemplateModel.questions.@each.{variable,answer}', function() {
|
||||||
const out = {};
|
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);
|
out[item.variable] = stringifyAnswer(item.answer);
|
||||||
(get(item, 'subquestions') || []).forEach((sub) => {
|
|
||||||
out[sub.variable] = stringifyAnswer(sub.answer);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const customAnswers = get(this, 'selectedTemplateModel.customAnswers') || {};
|
const customAnswers = get(this, 'selectedTemplateModel.customAnswers') || {};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue