project-booster-vue 9.55.2 → 9.55.4

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": "9.55.2",
3
+ "version": "9.55.4",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -122,7 +122,15 @@
122
122
  <m-notification class="pb-question__notifications" :type="notification.type" v-if="notification">
123
123
  <template #default>
124
124
  <strong style="font-size: 16px; line-height: 20px">{{ notification.title }}</strong>
125
- <p style="font-size: 16px; line-height: 20px; margin-bottom: 0">{{ notification.content }}</p>
125
+ <p style="font-size: 16px; line-height: 20px; margin-bottom: 0" v-if="notification.content">
126
+ {{ notification.content }}
127
+ </p>
128
+ <m-link
129
+ style="margin-top: 15px"
130
+ v-if="notification?.modal"
131
+ :label="notification?.modal.title"
132
+ @click.prevent="displayNotificationDialog = true"
133
+ ></m-link>
126
134
  </template>
127
135
  </m-notification>
128
136
  <div class="pb-question__redirect-link" v-if="notification">
@@ -130,7 +138,7 @@
130
138
  width="full"
131
139
  width-from-xxl="full"
132
140
  width-from-l="full"
133
- :href="notification.buttonHref"
141
+ @click.prevent="handleGoTo(notification?.buttonStepCode)"
134
142
  :label="notification.buttonText"
135
143
  />
136
144
  </div>
@@ -242,13 +250,7 @@
242
250
  </m-flexy>
243
251
  </m-container>
244
252
  <div class="pb-question__padding-bottom" v-if="!payload.helpArea" />
245
- <m-flex
246
- class="pb-question__help"
247
- v-if="payload.helpArea"
248
- direction="column"
249
- align-items="center"
250
- justify-content="center"
251
- >
253
+ <m-flex class="pb-question__help" v-if="payload.helpArea" direction="column">
252
254
  <div v-for="helpItem in payload.helpArea" :key="helpItem.type">
253
255
  <div v-if="helpItem.type === 'text'">
254
256
  <p class="pb-question__help__text">{{ helpItem.label }}</p>
@@ -266,10 +268,23 @@
266
268
  </div>
267
269
  </m-flex>
268
270
 
271
+ <m-modal
272
+ :modalTitle="notification?.modal?.title"
273
+ :open="displayNotificationDialog"
274
+ @update:open="displayNotificationDialog = false"
275
+ >
276
+ <template #default>
277
+ <div v-html="notification?.modal?.htmlContent"></div>
278
+ </template>
279
+ <template #footer>
280
+ <m-button label="Fermer" @click.prevent="displayNotificationDialog = false" />
281
+ </template>
282
+ </m-modal>
283
+
269
284
  <m-modal
270
285
  :modalTitle="helpDialog?.viewModelDialog.headerTitle"
271
- v-model="displayDialogHelp"
272
- :open.sync="displayDialogHelp"
286
+ :open="displayDialogHelp"
287
+ @update:open="displayDialogHelp = false"
273
288
  v-if="helpDialog"
274
289
  >
275
290
  <template #default>
@@ -465,6 +480,7 @@ export default defineComponent({
465
480
  INFO_ICON,
466
481
  displayDialog: false,
467
482
  displayDialogHelp: false,
483
+ displayNotificationDialog: false,
468
484
  dialog: undefined as undefined | ScenarioStepAnswerDialog,
469
485
  helpDialog: undefined as undefined | ScenarioStepDialog,
470
486
  displayVideo: false,
@@ -794,12 +810,23 @@ export default defineComponent({
794
810
 
795
811
  if (answer.notification) {
796
812
  this.notification = answer.notification;
813
+
814
+ Object.keys(Object.fromEntries(this.selectedAnswers)).forEach((answerCode) => {
815
+ this.selectedAnswers.set(answerCode, false);
816
+ });
817
+ this.selectedAnswers.set(answer.code, !this.selectedAnswers.get(answer.code) ?? true);
797
818
  } else if (answer?.viewModel?.href) {
798
819
  return '';
799
820
  } else {
800
821
  return this.selectAnswer(payload.code, answer);
801
822
  }
802
823
  },
824
+ handleGoTo(stepCode: string) {
825
+ this.$emit(this.completedEventName, {
826
+ answers: [],
827
+ nextStep: stepCode,
828
+ });
829
+ },
803
830
  },
804
831
  });
805
832
  </script>
@@ -1299,6 +1326,13 @@ $answers-apparition-duration: '0.5s';
1299
1326
 
1300
1327
  &__help {
1301
1328
  margin-bottom: $mu250;
1329
+
1330
+ @include set-from-screen($responsive-breakpoint) {
1331
+ max-width: 554px;
1332
+ margin: 0 auto;
1333
+ text-align: left;
1334
+ }
1335
+
1302
1336
  &__link,
1303
1337
  &__text {
1304
1338
  margin: 0;
@@ -105,29 +105,20 @@
105
105
  </m-flex>
106
106
  </form>
107
107
 
108
- <m-dialog
108
+ <m-modal
109
+ :modalTitle="contentModal.headerTitle"
110
+ :open="showModal"
111
+ @update:open="showModal = false"
109
112
  class="pb-space-input__dialog"
110
- :show-dialog="showModal"
111
- width="680px"
112
- height="520px"
113
- maxHeight="100vh"
114
- @update:show-dialog="handleShowModal"
115
- v-if="computedPayload.helpArea"
116
113
  >
117
- <template v-slot:header>
118
- <div class="pb-space-input__dialog__title">
119
- <h2>{{ contentModal.headerTitle }}</h2>
120
- </div>
114
+ <template #default>
115
+ <h3>{{ contentModal.headerTitle }}</h3>
116
+ <div v-html="contentModal.htmlContent"></div>
121
117
  </template>
122
- <template v-slot:body>
123
- <div class="pb-space-input__dialog__body" v-html="contentModal.htmlContent"></div>
118
+ <template #footer>
119
+ <m-button label="Fermer" @click.prevent="showModal = false" />
124
120
  </template>
125
- <template v-slot:footer>
126
- <m-flex class="pb-space-input__dialog__footer" align-items="center" justify-content="center">
127
- <m-button label="Fermer" theme="bordered-neutral" @click.prevent="handleShowModal"></m-button>
128
- </m-flex>
129
- </template>
130
- </m-dialog>
121
+ </m-modal>
131
122
  </m-flex>
132
123
  </template>
133
124
 
@@ -146,6 +137,7 @@ import MFlexyCol from '../../../mozaic/grid/MFlexyCol.vue';
146
137
  import MIcon from '../../../mozaic/icon/MIcon.vue';
147
138
  import MDialog from '../../../mozaic/dialog/MDialog.vue';
148
139
  import DEFAULT_PAYLOAD from './default-payload.json';
140
+ import { MModal } from '@mozaic-ds/vue-3';
149
141
  import { SpaceInputPayload } from '@/components/question/space-input/SpaceInput';
150
142
  import { ScenarioStepAnswer } from '@/types/pb/Scenario';
151
143
  import { decorate } from '@/services/decorate';
@@ -200,6 +192,7 @@ export default defineComponent({
200
192
  MTextInput,
201
193
  MIcon,
202
194
  MDialog,
195
+ MModal,
203
196
  },
204
197
 
205
198
  props: {
@@ -287,6 +287,10 @@ $responsive-breakpoint: 'm';
287
287
  display: none;
288
288
  }
289
289
 
290
+ .pb-restitution-wrapper {
291
+ margin-bottom: $mu250;
292
+ }
293
+
290
294
  .pb-restitution-list {
291
295
  @include set-font-face('regular');
292
296
 
@@ -68,11 +68,13 @@
68
68
  "title": "Locataire"
69
69
  },
70
70
  "notification": {
71
- "type": "warning",
71
+ "type": "information",
72
72
  "title": "Le calcul des aides se base sur les revenus de votre propriétaire La plupart des aides sont destinées aux propriétaires.",
73
73
  "content": "Nous vous conseillons donc de vous rapprocher de votre propriétaire, c'est lui qui pourra monter le dossier d'obtention des aides pour votre projet.",
74
74
  "buttonText": "Voir d'autres solutions pour faire des économies de chauffage",
75
- "buttonHref": "https://google.fr/"
75
+ "buttonStepCode": {
76
+ "code": "LMFR_FLOOR_INSULATION_ADVICE"
77
+ }
76
78
  }
77
79
  }
78
80
  }
@@ -123,11 +125,17 @@
123
125
  "image": "https://storage.googleapis.com/project-booster-media/energyrenovation/apartement.jpg"
124
126
  },
125
127
  "notification": {
126
- "type": "warning",
127
- "title": "Le calcul des aides se base sur les revenus de votre propriétaire La plupart des aides sont destinées aux propriétaires.",
128
- "content": "Nous vous conseillons donc de vous rapprocher de votre propriétaire, c'est lui qui pourra monter le dossier d'obtention des aides pour votre projet.",
128
+ "type": "information",
129
+ "title": "Nous attirons votre attention ! Faire des travaux d’isolation dans un appartement nécessite certaines précautions.",
130
+ "modal": {
131
+ "link": "Voir les précautions pour isoler son appartement",
132
+ "title": "Nos recommandations pour vos projets de rénovations",
133
+ "htmlContent": " <h4 style='margin-top:0;'>Avant d’isoler votre appartement, voici quelques précautions à prendre :</h4> <ul style='padding-left:30px;'> <li>Informez-vous sur les modes d'isolation possible pour votre sol.</li> <li>Informez la copropriété de votre projet, et notamment du bruit que peuvent générer les travaux.</li> </ul>"
134
+ },
129
135
  "buttonText": "Voir d'autres solutions pour faire des économies de chauffage",
130
- "buttonHref": "https://google.fr/"
136
+ "buttonStepCode": {
137
+ "code": "LMFR_FLOOR_INSULATION_ADVICE"
138
+ }
131
139
  }
132
140
  }
133
141
  }
@@ -137,7 +145,7 @@
137
145
  {
138
146
  "conditions": ["isAnswerMatching('LMFR_FLOOR_INSULATION_QUESTION_HOUSING_TYPE', 'HOUSE')"],
139
147
  "nextStep": {
140
- "code": "LMFR_FLOOR_INSULATION_QUESTION_CONSTRUCTION_AGE"
148
+ "code": "LMFR_FLOOR_INSULATION_QUESTION_SURFACE_AREA"
141
149
  }
142
150
  }
143
151
  ]
@@ -167,8 +175,7 @@
167
175
  "NEW": {
168
176
  "code": "NEW",
169
177
  "viewModel": {
170
- "title": "Moins de 2 ans",
171
- "text": "Si votre logement à moins de 2 ans, vous ne serez pas éligible aux aides"
178
+ "title": "Moins de 2 ans"
172
179
  }
173
180
  },
174
181
  "RECENT": {
@@ -1989,7 +1996,7 @@
1989
1996
  "type": "MODAL",
1990
1997
  "dialogViewModel": {
1991
1998
  "headerTitle": "Pour calculer la surface de vos planchers bas à isoler c'est facile.",
1992
- "htmlContent": "<p>Vous devrez simplement connaître la longueur et la largeur au sol de votre cave, garage ou sous sol à isoler. Il suffit ensuite de multiplier la longueur par la largeur de la façon suivante :<br/><b>Surface de la pièce à isoler = Longueur x Largeur</b></p>"
1999
+ "htmlContent": "<p>Vous devrez simplement connaître la longueur et la largeur au sol de votre cave, garage ou sous sol à isoler. Il suffit ensuite de multiplier la longueur par la largeur de la façon suivante :<br/><br/><b>Surface de la pièce à isoler = Longueur x Largeur</b></p>"
1993
2000
  }
1994
2001
  }
1995
2002
  }
@@ -2056,7 +2063,9 @@
2056
2063
  "viewModel": {
2057
2064
  "label": "Pour aller plus loin dans votre projet",
2058
2065
  "answersComponent": "MPbCard",
2059
- "forceOneCardPerLineOnMobile": true
2066
+ "widthFromL": "1of2",
2067
+ "forceOneCardPerLineOnMobile": true,
2068
+ "progressBar": true
2060
2069
  },
2061
2070
  "answers": {
2062
2071
  "DISCOVER_OUR_HEATERS": {
@@ -413,14 +413,14 @@ export default defineComponent({
413
413
  optinOffers: boolean(),
414
414
  });
415
415
 
416
- let isSubmitDisabled = false;
416
+ const isSubmitDisabled = ref(false);
417
417
 
418
418
  const validateAllFields = async (action: any) => {
419
+ isSubmitDisabled.value = true;
420
+
419
421
  await validationSchema
420
422
  .validate(formData.value.values, { abortEarly: false })
421
423
  .then(async () => {
422
- isSubmitDisabled = true;
423
-
424
424
  const leadSaveStatus = await store.dispatch('trezor/sendFormData', {
425
425
  payload: {
426
426
  customer: {
@@ -456,7 +456,7 @@ export default defineComponent({
456
456
  }
457
457
  })
458
458
  .catch((err) => {
459
- isSubmitDisabled = false;
459
+ isSubmitDisabled.value = false;
460
460
 
461
461
  formData.value.errors = {};
462
462
 
@@ -104,9 +104,14 @@ export interface ScenarioStepDialog {
104
104
  export interface ScenarioStepAnswerNotification {
105
105
  type: string;
106
106
  title: string;
107
- content: string;
107
+ content?: string;
108
108
  buttonText: string;
109
- buttonHref: string;
109
+ buttonStepCode: string;
110
+ modal?: {
111
+ title: string;
112
+ htmlContent: string;
113
+ link: string;
114
+ };
110
115
  }
111
116
 
112
117
  export interface ScenarioStepAnswers {