project-booster-vue 8.115.2 → 8.115.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "8.115.2",
3
+ "version": "8.115.6",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "test:unit": "vue-cli-service test:unit --forceExit --detectOpenHandles",
@@ -54,10 +54,11 @@
54
54
  @click="skipQuestion"
55
55
  />
56
56
  <m-button
57
- v-if="hasSelectedAnswers"
57
+ v-if="hasSelectedAnswers || payload.multiSelect.alwaysDisplayMultiSelectButton"
58
58
  class="pb-list-select__validate-button"
59
59
  size="m"
60
60
  size-from-l="l"
61
+ :disabled="!hasSelectedAnswers"
61
62
  :label="validateButtonProps.label"
62
63
  :left-icon="validateButtonProps.leftIcon"
63
64
  :right-icon="validateButtonProps.rightIcon"
@@ -71,7 +72,7 @@
71
72
  </template>
72
73
 
73
74
  <script>
74
- import { ref, computed } from 'vue';
75
+ import { ref, computed, onMounted } from 'vue';
75
76
  import objectPath from 'object-path';
76
77
  import MFlex from '../../mozaic/flex/MFlex';
77
78
  import MButton from '../../mozaic/buttons/MButton';
@@ -166,10 +167,22 @@ export default {
166
167
  return displayedAnswers;
167
168
  });
168
169
 
170
+ const updateSelectedAnswers = () => {
171
+ selectedAnswers.value = displayedAnswers.value
172
+ .filter((answer) => !!answer.selected)
173
+ .map((answer) => ({ key: answer.code, value: true }));
174
+ };
169
175
  const handleSelectionChange = (items) => {
170
176
  selectedAnswers.value = Object.entries(items)
171
177
  .filter(([key, value]) => !!value)
172
178
  .map(([key, value]) => ({ key, value }));
179
+ Object.entries(items).map(([key, value]) => {
180
+ displayedAnswers.value.map((answer) => {
181
+ if (answer.code === key) {
182
+ answer.selected = value;
183
+ }
184
+ });
185
+ });
173
186
  };
174
187
 
175
188
  const hasSelectedAnswers = computed(() => {
@@ -225,7 +238,7 @@ export default {
225
238
  }
226
239
 
227
240
  let nextStep;
228
- if (props.payload?.multilselect) {
241
+ if (props.payload?.multiSelect) {
229
242
  nextStep = props.payload.multiSelect.actions.VALIDATE.nextStep;
230
243
  } else if (props.payload?.answers[answersToSubmit[0].value]?.nextStep) {
231
244
  nextStep = props.payload.answers[answersToSubmit[0].value].nextStep;
@@ -335,7 +348,9 @@ export default {
335
348
  }
336
349
  return valueToDecorate;
337
350
  };
338
-
351
+ onMounted(() => {
352
+ updateSelectedAnswers();
353
+ });
339
354
  return {
340
355
  BACK_ICON,
341
356
  INFO_ICON,
@@ -352,6 +367,7 @@ export default {
352
367
  skipQuestion,
353
368
  submitAnswers,
354
369
  decorateBoolean,
370
+ updateSelectedAnswers,
355
371
  };
356
372
  },
357
373
  };
@@ -73,10 +73,13 @@ export default {
73
73
  $responsive-breakpoint: 'l';
74
74
 
75
75
  .pb-restitution-exit {
76
- &__section {
77
- margin-bottom: $mu400;
78
- margin-top: $mu400;
76
+ margin: $mu350 0;
77
+
78
+ @include set-from-screen('m') {
79
+ margin: $mu300 0;
80
+ }
79
81
 
82
+ &__section {
80
83
  &-title {
81
84
  @include set-font-face('semi-bold');
82
85
  @include set-font-scale('07', 'm');
@@ -219,8 +219,8 @@ export default {
219
219
  };
220
220
  try {
221
221
  const event = {
222
- inhabitantProjectId: clickedCardInfo.project.project.id,
223
- businessUnit: clickedCardInfo.project.project.businessUnit,
222
+ inhabitantProjectId: clickedCardInfo.project.id,
223
+ businessUnit: clickedCardInfo.project.businessUnit,
224
224
  section: clickedCardInfo.section,
225
225
  clickedCard: formatCard(clickedCardInfo.product),
226
226
  possibleCards: state.products[clickedCardInfo.section].map((card) => {