Merge pull request #4062 from westlywright/bug.mac.custom.answer

MC App Upgrade Error
This commit is contained in:
Westly Wright 2020-06-26 10:37:25 -07:00 committed by GitHub
commit 2a382f570b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -332,7 +332,7 @@ export default Component.extend(NewOrEdit, CatalogApp, {
let nueOverride = {
scope: answer.clusterId || answer.projectId,
answer: get(answer.values, valueKey),
answer: answer.values[valueKey] ? answer.values[valueKey] : null,
question: valueKey,
isSubQuestion,
}

View File

@ -86,9 +86,13 @@ export default Component.extend({
allQuestions.forEach( (q) => {
if (questionMatch && questionMatch.variable === q.variable) {
if ( q.showSubquestionIf && q.subquestions) {
let showSubquestionsIfAnswerIs = q.showSubquestionIf;
let answerMatchesSubQuestionIf = false;
if ( answer.answer.toString() === showSubquestionsIfAnswerIs ) {
if (answer.answer && answer.answer.toString) {
answerMatchesSubQuestionIf = answer.answer.toString() === q.showSubquestionIf;
}
if (answerMatchesSubQuestionIf) {
this.buildSubquestions(q.subquestions);
} else {
if (this.subquestionAnswers && this.subquestionAnswers.length > 0) {