project-booster-vue 10.2.1 → 10.2.2

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": "10.2.1",
3
+ "version": "10.2.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1,50 +1,48 @@
1
1
  <template>
2
2
  <div class="pb-project-item-save">
3
- <form @submit.prevent="handleFormSubmit">
4
- <m-dialog class="pb-project-item-save__dialog" v-model:show-dialog="showDialog">
5
- <template #header>
6
- <m-flex align-items="center" justify-content="flex-start" full-width> Enregistrer l'estimation </m-flex>
7
- </template>
8
- <template #body>
9
- <m-flex direction="column" full-width class="pb-project-item-save__dialog-content">
10
- <pb-project-item-save-projects-list
11
- v-if="state.matches('selectingProject') || state.matches('validatingSelectedProject')"
12
- @project-click="
13
- $event ? send({ type: 'PROJECT_SELECTED', selectedProjectId: $event }) : send('PROJECT_RESETED')
14
- "
15
- @new-project-click="selectNewProject"
16
- />
17
- <pb-project-item-save-project-name
18
- v-else-if="state.matches('namingProject')"
19
- :default-name="defaultProjectName"
20
- @project-change="$event.valid ? send('PROJECT_VALID', $event) : send('PROJECT_INVALID')"
21
- />
22
- <pb-project-item-save-item-name
23
- v-else-if="state.matches('namingItem')"
24
- :default-name="defaultItemName"
25
- @name-change="$event.valid ? send('ESTIMATE_NAME_VALID', $event) : send('ESTIMATE_NAME_INVALID')"
26
- />
27
- </m-flex>
28
- </template>
29
- <template #footer>
30
- <m-flex align-items="center" justify-content="center" class="pb-project-item-save__dialog-footer" full-width>
31
- <m-link
32
- v-if="state.nextEvents.includes('GO_BACK_CLICKED')"
33
- label="Retour"
34
- left-icon="https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_24px.svg"
35
- @click="send('GO_BACK_CLICKED')"
36
- />
37
- <m-button
38
- :label="state.meta['projectItemSaveMachine.' + state.value].primaryButton.label"
39
- :disabled="
40
- state.meta['projectItemSaveMachine.' + state.value].primaryButton.actionDisabled || !currentFormIsValid
41
- "
42
- @click="handlePrimaryButtonClick"
43
- />
44
- </m-flex>
45
- </template>
46
- </m-dialog>
47
- </form>
3
+ <m-dialog class="pb-project-item-save__dialog" v-model:show-dialog="showDialog">
4
+ <template #header>
5
+ <m-flex align-items="center" justify-content="flex-start" full-width> Enregistrer l'estimation </m-flex>
6
+ </template>
7
+ <template #body>
8
+ <m-flex direction="column" full-width class="pb-project-item-save__dialog-content">
9
+ <pb-project-item-save-projects-list
10
+ v-if="state.matches('selectingProject') || state.matches('validatingSelectedProject')"
11
+ @project-click="
12
+ $event ? send({ type: 'PROJECT_SELECTED', selectedProjectId: $event }) : send('PROJECT_RESETED')
13
+ "
14
+ @new-project-click="selectNewProject"
15
+ />
16
+ <pb-project-item-save-project-name
17
+ v-else-if="state.matches('namingProject')"
18
+ :default-name="defaultProjectName"
19
+ @project-change="$event.valid ? send('PROJECT_VALID', $event) : send('PROJECT_INVALID')"
20
+ />
21
+ <pb-project-item-save-item-name
22
+ v-else-if="state.matches('namingItem')"
23
+ :default-name="defaultItemName"
24
+ @name-change="$event.valid ? send('ESTIMATE_NAME_VALID', $event) : send('ESTIMATE_NAME_INVALID')"
25
+ />
26
+ </m-flex>
27
+ </template>
28
+ <template #footer>
29
+ <m-flex align-items="center" justify-content="center" class="pb-project-item-save__dialog-footer" full-width>
30
+ <m-link
31
+ v-if="state.nextEvents.includes('GO_BACK_CLICKED')"
32
+ label="Retour"
33
+ left-icon="https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_24px.svg"
34
+ @click="send('GO_BACK_CLICKED')"
35
+ />
36
+ <m-button
37
+ :label="state.meta['projectItemSaveMachine.' + state.value].primaryButton.label"
38
+ :disabled="
39
+ state.meta['projectItemSaveMachine.' + state.value].primaryButton.actionDisabled || !currentFormIsValid
40
+ "
41
+ @click="handlePrimaryButtonClick"
42
+ />
43
+ </m-flex>
44
+ </template>
45
+ </m-dialog>
48
46
  <m-notification
49
47
  floating
50
48
  :floating-displayed="itemCreationError || projectCreationError"
@@ -231,7 +231,7 @@
231
231
  icon="ArrowNext48"
232
232
  iconPosition="right"
233
233
  label="Etape suivante"
234
- @click="validMultiSelect(payload?.multiSelect?.actions?.VALIDATE)"
234
+ @click="nextStepHandler"
235
235
  :disabled="!hasAnswersSelected"
236
236
  />
237
237
  </div>
@@ -500,6 +500,7 @@ export default defineComponent({
500
500
  showModal: false,
501
501
  notification: undefined as undefined | ScenarioStepAnswerNotification,
502
502
  widthXlSize: undefined as undefined | boolean,
503
+ currentAnswer: null as any,
503
504
  }),
504
505
 
505
506
  computed: {
@@ -615,6 +616,7 @@ export default defineComponent({
615
616
  }
616
617
  if (!this.payload.multiSelect) {
617
618
  this.initAnswersSelectedState(this.payload.answers);
619
+ this.currentAnswer = answer;
618
620
  }
619
621
 
620
622
  if (this.payload.multiSelect) {
@@ -661,7 +663,7 @@ export default defineComponent({
661
663
  sendAnalyticEvent(EventName.FIELD, {
662
664
  field_name: multiSelectOptions?.label || '',
663
665
  field_value: answers,
664
- funnel_name: this.payload.analytics.funnel_name,
666
+ funnel_name: this.payload.viewModel.analytics.funnel_name,
665
667
  });
666
668
 
667
669
  this.$emit(this.completedEventName, {
@@ -843,6 +845,20 @@ export default defineComponent({
843
845
  nextStep: stepCode,
844
846
  });
845
847
  },
848
+ nextStepHandler() {
849
+ if (this.payload?.multiSelect?.actions?.VALIDATE) {
850
+ this.validMultiSelect(this.payload?.multiSelect?.actions?.VALIDATE);
851
+ } else {
852
+ /**
853
+ * Emitted when step is completed
854
+ * @event dynamic event name according to completedEventName prop
855
+ */
856
+ this.$emit(this.completedEventName, {
857
+ answers: [this.currentAnswer],
858
+ nextStep: this.currentAnswer.nextStep,
859
+ });
860
+ }
861
+ },
846
862
  },
847
863
  });
848
864
  </script>
@@ -25,9 +25,6 @@
25
25
  "code": "LMFR_QUESTION_WORKS",
26
26
  "type": "STEP",
27
27
  "component": "MPbQuestion",
28
- "analytics": {
29
- "funnel_name": "SDB_step1"
30
- },
31
28
  "slots": {
32
29
  "stickyBottom": {
33
30
  "display": false
@@ -50,11 +47,15 @@
50
47
  "progressBar": true,
51
48
  "widthFromL": "1of3",
52
49
  "widthXlSize": true,
50
+ "hideBackButton": true,
53
51
  "forceOneCardPerLineOnMobile": true,
54
52
  "sortBy": {
55
53
  "type": ["numeric", "string"],
56
54
  "order": ["Asc"],
57
55
  "path": ["meta.ranking", "viewModel.title"]
56
+ },
57
+ "analytics": {
58
+ "funnel_name": "SDB_step1"
58
59
  }
59
60
  },
60
61
  "multiSelect": {
@@ -283,9 +284,6 @@
283
284
  "code": "LMFR_BATHROOM_BATHTUB_TYPE",
284
285
  "type": "STEP",
285
286
  "component": "MPbQuestion",
286
- "analytics": {
287
- "funnel_name": "SDB_step2"
288
- },
289
287
  "slots": {
290
288
  "beforeContent": {
291
289
  "display": true,
@@ -298,12 +296,15 @@
298
296
  },
299
297
  "payload": {
300
298
  "viewModel": {
301
- "label": "Quel type de baignoire voulez-vous installer ?",
299
+ "label": "Quel type de baignoire souhaitez-vous installer ?",
302
300
  "answersComponent": "MPbCard",
303
301
  "progressBar": true,
304
302
  "forceOneCardPerLineOnMobile": true,
305
303
  "widthFromL": "1of3",
306
- "widthXlSize": true
304
+ "widthXlSize": true,
305
+ "analytics": {
306
+ "funnel_name": "SDB_step2"
307
+ }
307
308
  },
308
309
  "answers": {
309
310
  "STRAIGH_TUB": {
@@ -393,9 +394,6 @@
393
394
  "code": "LMFR_BATHROOM_SHOWER_TYPE",
394
395
  "type": "STEP",
395
396
  "component": "MPbQuestion",
396
- "analytics": {
397
- "funnel_name": "SDB_step3"
398
- },
399
397
  "slots": {
400
398
  "beforeContent": {
401
399
  "display": true,
@@ -408,6 +406,9 @@
408
406
  },
409
407
  "payload": {
410
408
  "viewModel": {
409
+ "analytics": {
410
+ "funnel_name": "SDB_step3"
411
+ },
411
412
  "answersComponent": "MPbCard",
412
413
  "progressBar": true,
413
414
  "forceOneCardPerLineOnMobile": true,
@@ -485,9 +486,6 @@
485
486
  "code": "LMFR_BATHROOM_FURNITURE_TYPE",
486
487
  "type": "STEP",
487
488
  "component": "MPbQuestion",
488
- "analytics": {
489
- "funnel_name": "SDB_step4_1/4"
490
- },
491
489
  "slots": {
492
490
  "beforeContent": {
493
491
  "display": true,
@@ -500,6 +498,9 @@
500
498
  },
501
499
  "payload": {
502
500
  "viewModel": {
501
+ "analytics": {
502
+ "funnel_name": "SDB_step4_1/4"
503
+ },
503
504
  "answersComponent": "MPbCard",
504
505
  "progressBar": true,
505
506
  "forceOneCardPerLineOnMobile": true,
@@ -568,32 +569,36 @@
568
569
  "ranking": 6
569
570
  }
570
571
  }
571
- }
572
- },
573
- "nextStep": {
574
- "conditionals": [
575
- {
576
- "conditions": ["isAnswerContaining('LMFR_QUESTION_WORKS', 'WC')"],
577
- "nextStep": {
578
- "code": "LMFR_BATHROOM_WC_TYPE"
579
- }
580
- },
581
- {
582
- "conditions": ["true"],
583
- "nextStep": {
584
- "code": "LMFR_BATHROOM_STYLE"
572
+ },
573
+ "multiSelect": {
574
+ "actions": {
575
+ "VALIDATE": {
576
+ "label": "Étape suivante",
577
+ "nextStep": {
578
+ "conditionals": [
579
+ {
580
+ "conditions": ["isAnswerContaining('LMFR_QUESTION_WORKS', 'WC')"],
581
+ "nextStep": {
582
+ "code": "LMFR_BATHROOM_WC_TYPE"
583
+ }
584
+ },
585
+ {
586
+ "conditions": ["true"],
587
+ "nextStep": {
588
+ "code": "LMFR_BATHROOM_STYLE"
589
+ }
590
+ }
591
+ ]
592
+ }
585
593
  }
586
594
  }
587
- ]
595
+ }
588
596
  }
589
597
  },
590
598
  "LMFR_BATHROOM_WC_TYPE": {
591
599
  "code": "LMFR_BATHROOM_WC_TYPE",
592
600
  "type": "STEP",
593
601
  "component": "MPbQuestion",
594
- "analytics": {
595
- "funnel_name": "SDB_step5"
596
- },
597
602
  "slots": {
598
603
  "beforeContent": {
599
604
  "display": true,
@@ -606,6 +611,9 @@
606
611
  },
607
612
  "payload": {
608
613
  "viewModel": {
614
+ "analytics": {
615
+ "funnel_name": "SDB_step5"
616
+ },
609
617
  "answersComponent": "MPbCard",
610
618
  "progressBar": true,
611
619
  "forceOneCardPerLineOnMobile": true,
@@ -644,9 +652,6 @@
644
652
  "code": "LMFR_BATHROOM_STYLE",
645
653
  "type": "STEP",
646
654
  "component": "MPbQuestion",
647
- "analytics": {
648
- "funnel_name": "SDB_step3"
649
- },
650
655
  "slots": {
651
656
  "beforeContent": {
652
657
  "display": true,
@@ -659,6 +664,9 @@
659
664
  },
660
665
  "payload": {
661
666
  "viewModel": {
667
+ "analytics": {
668
+ "funnel_name": "SDB_step3"
669
+ },
662
670
  "answersComponent": "MPbCard",
663
671
  "progressBar": true,
664
672
  "forceOneCardPerLineOnMobile": true,
@@ -817,9 +825,6 @@
817
825
  "code": "LMFR_QUESTION_PLAN_INFO",
818
826
  "type": "STEP",
819
827
  "component": "MPbQuestion",
820
- "analytics": {
821
- "funnel_name": "SDB_step4_3/4"
822
- },
823
828
  "slots": {
824
829
  "beforeContent": {
825
830
  "display": true,
@@ -832,6 +837,9 @@
832
837
  },
833
838
  "payload": {
834
839
  "viewModel": {
840
+ "analytics": {
841
+ "funnel_name": "SDB_step4_3/4"
842
+ },
835
843
  "answersComponent": "MPbCard",
836
844
  "progressBar": true,
837
845
  "forceOneCardPerLineOnMobile": true,
@@ -897,9 +905,6 @@
897
905
  "code": "LMFR_QUESTION_ADD_PLAN_LATER",
898
906
  "type": "STEP",
899
907
  "component": "MPbAlert",
900
- "analytics": {
901
- "funnel_name": "SDB_step4_2/4"
902
- },
903
908
  "slots": {
904
909
  "beforeContent": {
905
910
  "display": true,
@@ -912,6 +917,9 @@
912
917
  },
913
918
  "payload": {
914
919
  "viewModel": {
920
+ "analytics": {
921
+ "funnel_name": "SDB_step4_2/4"
922
+ },
915
923
  "title": "Transmettre mon plan plus tard",
916
924
  "type": "warning",
917
925
  "exitOptionsTitle": "Réaliser rapidement votre plan :",
@@ -974,9 +982,6 @@
974
982
  "code": "LMFR_QUESTION_ADD_PICTURE",
975
983
  "type": "STEP",
976
984
  "component": "MPbUploadDocument",
977
- "analytics": {
978
- "funnel_name": "SDB_step5_1/2"
979
- },
980
985
  "slots": {
981
986
  "beforeContent": {
982
987
  "display": true,
@@ -989,6 +994,9 @@
989
994
  },
990
995
  "payload": {
991
996
  "viewModel": {
997
+ "analytics": {
998
+ "funnel_name": "SDB_step5_1/2"
999
+ },
992
1000
  "label": "Possédez-vous des photos de votre salle de bain actuelle ?",
993
1001
  "addText": "Plus on en sait, mieux vous serez accompagné",
994
1002
  "addTitle": "Importer des photos",
@@ -1063,9 +1071,6 @@
1063
1071
  "code": "LMFR_QUESTION_ADD_PLAN",
1064
1072
  "type": "STEP",
1065
1073
  "component": "MPbUploadDocument",
1066
- "analytics": {
1067
- "funnel_name": "SDB_step4_4/4"
1068
- },
1069
1074
  "slots": {
1070
1075
  "beforeContent": {
1071
1076
  "display": true,
@@ -1078,6 +1083,9 @@
1078
1083
  },
1079
1084
  "payload": {
1080
1085
  "viewModel": {
1086
+ "analytics": {
1087
+ "funnel_name": "SDB_step4_4/4"
1088
+ },
1081
1089
  "label": "Ajouter un plan",
1082
1090
  "addTitle": "Sélectionner un fichier",
1083
1091
  "addText": "",
@@ -1153,9 +1161,6 @@
1153
1161
  "code": "LMFR_QUESTION_WORK_START_DATE",
1154
1162
  "type": "STEP",
1155
1163
  "component": "MPbQuestion",
1156
- "analytics": {
1157
- "funnel_name": "SDB_step6"
1158
- },
1159
1164
  "slots": {
1160
1165
  "beforeContent": {
1161
1166
  "display": true,
@@ -1168,6 +1173,9 @@
1168
1173
  },
1169
1174
  "payload": {
1170
1175
  "viewModel": {
1176
+ "analytics": {
1177
+ "funnel_name": "SDB_step6"
1178
+ },
1171
1179
  "answersComponent": "MPbCard",
1172
1180
  "progressBar": true,
1173
1181
  "forceOneCardPerLineOnMobile": true,
@@ -1231,9 +1239,6 @@
1231
1239
  "code": "LMFR_QUESTION_INSTALLATION",
1232
1240
  "type": "STEP",
1233
1241
  "component": "MPbQuestion",
1234
- "analytics": {
1235
- "funnel_name": "SDB_step7"
1236
- },
1237
1242
  "slots": {
1238
1243
  "beforeContent": {
1239
1244
  "display": true,
@@ -1246,6 +1251,9 @@
1246
1251
  },
1247
1252
  "payload": {
1248
1253
  "viewModel": {
1254
+ "analytics": {
1255
+ "funnel_name": "SDB_step7"
1256
+ },
1249
1257
  "answersComponent": "MPbCard",
1250
1258
  "progressBar": true,
1251
1259
  "forceOneCardPerLineOnMobile": true,
@@ -1314,9 +1322,6 @@
1314
1322
  "code": "LMFR_QUESTION_BUDGET",
1315
1323
  "type": "STEP",
1316
1324
  "component": "MPbQuestion",
1317
- "analytics": {
1318
- "funnel_name": "SDB_step8"
1319
- },
1320
1325
  "slots": {
1321
1326
  "beforeContent": {
1322
1327
  "display": true,
@@ -1329,6 +1334,9 @@
1329
1334
  },
1330
1335
  "payload": {
1331
1336
  "viewModel": {
1337
+ "analytics": {
1338
+ "funnel_name": "SDB_step8"
1339
+ },
1332
1340
  "answersComponent": "MPbCard",
1333
1341
  "progressBar": true,
1334
1342
  "forceOneCardPerLineOnMobile": true,
@@ -1410,9 +1418,6 @@
1410
1418
  "LMFR_COMMENT": {
1411
1419
  "code": "LMFR_COMMENT",
1412
1420
  "type": "STEP",
1413
- "analytics": {
1414
- "funnel_name": "SDB_step9"
1415
- },
1416
1421
  "component": "MPbExitOptions",
1417
1422
  "slots": {
1418
1423
  "beforeContent": {
@@ -1426,6 +1431,9 @@
1426
1431
  },
1427
1432
  "payload": {
1428
1433
  "viewModel": {
1434
+ "analytics": {
1435
+ "funnel_name": "SDB_step9"
1436
+ },
1429
1437
  "title": "Pour que vous soyez pleinement satisfait et que votre projet soit réussi : qu'est-ce qui est le plus important pour vous ?",
1430
1438
  "content": "<p>Cette question est facultative.</p>",
1431
1439
  "typeForm": {
@@ -1454,11 +1462,11 @@
1454
1462
  "code": "BATHROOM_END",
1455
1463
  "type": "STEP",
1456
1464
  "component": "PbPedagogy",
1457
- "analytics": {
1458
- "funnel_name": "SDB_step5_2/2"
1459
- },
1460
1465
  "payload": {
1461
1466
  "viewModel": {
1467
+ "analytics": {
1468
+ "funnel_name": "SDB_step5_2/2"
1469
+ },
1462
1470
  "title": "Nous avons bien pris rendez-vous et enregistré vos informations",
1463
1471
  "icon": "https://storage.googleapis.com/project-booster-media/vad/fin-de-parcours/check_80.svg",
1464
1472
  "description": [
@@ -179,6 +179,7 @@ export interface ScenarioStepViewModel {
179
179
  progressBar?: boolean;
180
180
  widthXlSize?: boolean;
181
181
  notification?: ScenarioStepAnswerNotification;
182
+ analytics?: any;
182
183
  }
183
184
 
184
185
  export interface ScenarioStep {