From f8b1b1bbc904c173242b17180976eb70a475e20b Mon Sep 17 00:00:00 2001 From: Devendra-Ramesh Patil Date: Thu, 8 Aug 2024 18:58:39 +0530 Subject: [PATCH] #CTCTOWALTZ-3297:#7123:Fix for the survey question field type. --- waltz-ng/client/survey/survey-template-edit.html | 10 ++++++---- waltz-ng/client/survey/survey-template-edit.js | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/waltz-ng/client/survey/survey-template-edit.html b/waltz-ng/client/survey/survey-template-edit.html index 1ba0d5d71c..fd4b66f72e 100644 --- a/waltz-ng/client/survey/survey-template-edit.html +++ b/waltz-ng/client/survey/survey-template-edit.html @@ -215,7 +215,9 @@ required class="form-control" ng-options="fieldType.value as fieldType.name for fieldType in ctrl.questionFieldTypes" - ng-model="ctrl.selectedQuestionInfo.question.fieldType"> + ng-model="ctrl.selectedQuestionInfo.question.fieldType" + ng-change="ctrl.onChangeQFieldType()" + >
diff --git a/waltz-ng/client/survey/survey-template-edit.js b/waltz-ng/client/survey/survey-template-edit.js index 048b38b7f1..0616fb48b7 100644 --- a/waltz-ng/client/survey/survey-template-edit.js +++ b/waltz-ng/client/survey/survey-template-edit.js @@ -153,6 +153,12 @@ function controller($q, vm.selectedQuestionInfo = null; }; + vm.onChangeQFieldType = () => { + if(vm.selectedQuestionInfo.question.fieldType !== 'MEASURABLE_MULTI_SELECT') { + delete vm.selectedQuestionInfo.question.qualifierEntity; + } + } + vm.createQuestion = (qi) => { if(qi.question.fieldType === "MEASURABLE_MULTI_SELECT"){