@webitel/ui-sdk 3.1.79 → 3.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +1 -1
- package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +4 -1
- package/src/modules/AuditForm/components/audit-form-question.vue +4 -1
- package/src/modules/AuditForm/components/audit-form.vue +1 -1
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +4 -1
package/package.json
CHANGED
|
@@ -61,6 +61,6 @@ describe('AuditForm', () => {
|
|
|
61
61
|
questions: [generateQuestionSchema(), generateQuestionSchema(), generateQuestionSchema()],
|
|
62
62
|
},
|
|
63
63
|
});
|
|
64
|
-
expect(wrapper.emitted()['update:result'][0][0]).toEqual([
|
|
64
|
+
expect(wrapper.emitted()['update:result'][0][0]).toEqual([{}, {}, {}]);
|
|
65
65
|
});
|
|
66
66
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<article
|
|
3
3
|
class="audit-form-question-read"
|
|
4
4
|
:class="{
|
|
5
|
-
'audit-form-question-read--filled':
|
|
5
|
+
'audit-form-question-read--filled': isResult && result.score != null,
|
|
6
6
|
'audit-form-question-read--readonly': readonly,
|
|
7
7
|
}"
|
|
8
8
|
@keyup.enter="emit('activate')"
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
<script setup>
|
|
38
38
|
import { computed } from 'vue';
|
|
39
39
|
import { EngineAuditQuestionType } from 'webitel-sdk';
|
|
40
|
+
import isEmpty from '../../../scripts/isEmpty';
|
|
40
41
|
import AuditFormQuestionOptions from './questions/options/audit-form-question-options.vue';
|
|
41
42
|
import AuditFormQuestionScore from './questions/score/audit-form-question-score.vue';
|
|
42
43
|
import WtIcon from '../../../components/atoms/wt-icon/wt-icon.vue';
|
|
@@ -70,6 +71,8 @@ const QuestionTypeComponent = computed(() => {
|
|
|
70
71
|
if (props.question.type === EngineAuditQuestionType.Score) return AuditFormQuestionScore;
|
|
71
72
|
return null;
|
|
72
73
|
});
|
|
74
|
+
|
|
75
|
+
const isResult = computed(() => !isEmpty(props.result));
|
|
73
76
|
</script>
|
|
74
77
|
|
|
75
78
|
<style lang="scss" scoped>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:class="[
|
|
6
6
|
`audit-form-question--mode-${mode}`,
|
|
7
7
|
{
|
|
8
|
-
'audit-form-question--answered':
|
|
8
|
+
'audit-form-question--answered': isResult,
|
|
9
9
|
},
|
|
10
10
|
]"
|
|
11
11
|
:disable-dragging="mode === 'fill'"
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
import { useVuelidate } from '@vuelidate/core';
|
|
28
28
|
import { required } from '@vuelidate/validators';
|
|
29
29
|
import { computed, onMounted, ref, toRefs } from 'vue';
|
|
30
|
+
import isEmpty from '../../../scripts/isEmpty';
|
|
30
31
|
import vClickaway from '../../../directives/clickaway/clickaway';
|
|
31
32
|
import QuestionRead from './audit-form-question-read-wrapper.vue';
|
|
32
33
|
import QuestionWrite from './audit-form-question-write-wrapper.vue';
|
|
@@ -90,6 +91,8 @@ const component = computed(() => {
|
|
|
90
91
|
return QuestionRead;
|
|
91
92
|
});
|
|
92
93
|
|
|
94
|
+
const isResult = computed(() => !isEmpty(props.result));
|
|
95
|
+
|
|
93
96
|
function saveQuestion() {
|
|
94
97
|
state.value = QuestionState.SAVED;
|
|
95
98
|
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
:key="value"
|
|
35
35
|
:label="`${value}`"
|
|
36
36
|
:value="value"
|
|
37
|
-
:selected="
|
|
37
|
+
:selected="isResult ? result.score : null"
|
|
38
38
|
@input="emit('change:result', { score: value })"
|
|
39
39
|
></wt-radio>
|
|
40
40
|
</div>
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
import { useVuelidate } from '@vuelidate/core';
|
|
46
46
|
import { maxValue, minValue, required } from '@vuelidate/validators';
|
|
47
47
|
import { computed, onMounted, toRefs } from 'vue';
|
|
48
|
+
import isEmpty from '../../../../../scripts/isEmpty';
|
|
48
49
|
import updateObject from '../../../../../scripts/updateObject';
|
|
49
50
|
import WtRadio from '../../../../../components/molecules/wt-radio/wt-radio.vue';
|
|
50
51
|
import WtInput from '../../../../../components/molecules/wt-input/wt-input.vue';
|
|
@@ -103,6 +104,8 @@ const scoreRange = computed(() => {
|
|
|
103
104
|
return result;
|
|
104
105
|
});
|
|
105
106
|
|
|
107
|
+
const isResult = computed(() => !isEmpty(props.result));
|
|
108
|
+
|
|
106
109
|
function updateQuestion({ path, value }) {
|
|
107
110
|
emit('change:question', updateObject({ obj: props.question, path, value }));
|
|
108
111
|
}
|