project-booster-vue 8.99.1 → 8.101.0

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.99.1",
3
+ "version": "8.101.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "test:unit": "vue-cli-service test:unit --forceExit --detectOpenHandles",
@@ -277,7 +277,13 @@
277
277
  "subtitle": "Votre conseiller aura besoin de ces mesures pour créer votre plan de cuisine en 3D.",
278
278
  "widthFromL": "1of3",
279
279
  "forceOneCardPerLineOnMobile": true,
280
- "answersComponent": "PbCard"
280
+ "answersComponent": "PbCard",
281
+ "video": {
282
+ "src": "https://players.brightcove.net/2812541250001/SkgXKciHDZ_default/index.html?videoId=6270735637001&autoplay=play",
283
+ "theme": "bordered",
284
+ "label": "Voir le guide en vidéo",
285
+ "icon": "https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Media_Play_24px.svg"
286
+ }
281
287
  },
282
288
  "skippable": [
283
289
  {
@@ -353,7 +359,13 @@
353
359
  "subtitle": "Sur une feuille, dessinez la pièce et reportez les bonnes mesures, prenez une photo du plan et ajoutez la.",
354
360
  "answersComponent": "PbCard",
355
361
  "forceOneCardPerLineOnMobile": true,
356
- "widthFromL": "1of3"
362
+ "widthFromL": "1of3",
363
+ "video": {
364
+ "src": "https://players.brightcove.net/2812541250001/SkgXKciHDZ_default/index.html?videoId=6270735637001&autoplay=play",
365
+ "theme": "bordered",
366
+ "label": "Voir le guide en vidéo",
367
+ "icon": "https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Media_Play_24px.svg"
368
+ }
357
369
  },
358
370
  "skippable": [
359
371
  {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="pb-products">
2
+ <div class="pb-products" ref="pbProducts">
3
3
  <m-link
4
4
  class="pb-products__back-button"
5
5
  :label="project.name"
@@ -91,6 +91,7 @@ export default {
91
91
  },
92
92
  mounted() {
93
93
  this.updateProduct();
94
+ this.scrollToTop();
94
95
  },
95
96
  methods: {
96
97
  displayProductsList(item, section) {
@@ -103,6 +104,16 @@ export default {
103
104
  this.categoryName = selectedCategory.title ?? selectedCategory.viewModel.title;
104
105
  this.$store.dispatch('loadProductsByWorkKind', categoryId);
105
106
  },
107
+ scrollToTop() {
108
+ setTimeout(() => {
109
+ const top = this.$refs.pbProducts.getBoundingClientRect().top;
110
+ window.scroll({
111
+ top,
112
+ left: 0,
113
+ behavior: 'smooth',
114
+ });
115
+ }, 200);
116
+ },
106
117
  },
107
118
  };
108
119
  </script>
@@ -21,6 +21,12 @@
21
21
  </div>
22
22
  <div v-if="payload.viewModel.subtitle" class="pb-question__subtitle">
23
23
  {{ payload.viewModel.subtitle }}
24
+ <m-link
25
+ v-if="payload.viewModel.video"
26
+ :label="payload.viewModel.video.label"
27
+ theme="primary"
28
+ @click="displayVideoGuide"
29
+ />
24
30
  </div>
25
31
  </div>
26
32
  <m-container fluid class="pb-question__answers-container">
@@ -201,27 +207,35 @@
201
207
  </m-flexy>
202
208
  </m-container>
203
209
  <m-dialog class="pb-question__dialog" v-model:show-dialog="displayDialog">
204
- <template #header>
210
+ <template #header v-if="!displayVideo">
205
211
  <span>{{ dialog.headerTitle }}</span>
206
212
  </template>
207
213
  <template #body>
208
- <div class="pb-question__dialog-body">
214
+ <div class="pb-question__dialog-body" v-if="!displayVideo">
209
215
  <div :style="`background-image: url(${dialog.imageUrl});`" class="pb-question__dialog-body-image" />
210
216
  <m-flex direction="column" class="pb-question__dialog-body-description">
211
217
  <div class="pb-question__dialog-body-title">{{ dialog.title }}</div>
212
218
  <div class="pb-question__dialog-body-text" v-html="dialog.text" />
213
- <m-link
214
- v-if="dialog.link"
215
- :label="dialog.link.label"
216
- :theme="dialog.link.theme"
217
- :href="dialog.link.href"
218
- width-from-m="fit"
219
- width="full"
219
+ <m-button
220
+ class="pb-question__dialog-body-button"
221
+ :label="payload.viewModel.video.label"
222
+ :theme="payload.viewModel.video.theme"
223
+ :left-icon="payload.viewModel.video.icon"
224
+ width="fit"
225
+ @click="displayVideo = true"
220
226
  />
221
227
  </m-flex>
222
228
  </div>
229
+ <iframe
230
+ v-else
231
+ :src="payload.viewModel.video.src"
232
+ class="pb-question__dialog-video-container"
233
+ frameborder="0"
234
+ allowfullscreen
235
+ allow="autoplay"
236
+ ></iframe>
223
237
  </template>
224
- <template #footer>
238
+ <template #footer v-if="!displayVideo">
225
239
  <m-flex class="pb-question__dialog-footer" justify-content="center">
226
240
  <m-button
227
241
  label="Fermer"
@@ -235,7 +249,6 @@
235
249
  </m-dialog>
236
250
  </div>
237
251
  </template>
238
-
239
252
  <script>
240
253
  import objectPath from 'object-path';
241
254
  import MButton from '../mozaic/buttons/MButton';
@@ -335,6 +348,7 @@ export default {
335
348
  INFO_ICON,
336
349
  displayDialog: false,
337
350
  dialog: null,
351
+ displayVideo: false,
338
352
  pbQuestionActionsButtonsMaxHeight: 0,
339
353
  }),
340
354
 
@@ -358,6 +372,11 @@ export default {
358
372
  answers() {
359
373
  this.updateSelectedAnswers();
360
374
  },
375
+ displayDialog(newVal) {
376
+ if (!newVal) {
377
+ this.displayVideo = false;
378
+ }
379
+ },
361
380
  },
362
381
 
363
382
  mounted() {
@@ -658,6 +677,10 @@ export default {
658
677
  },
659
678
  });
660
679
  },
680
+ displayVideoGuide() {
681
+ this.displayDialog = true;
682
+ this.displayVideo = true;
683
+ },
661
684
  },
662
685
  };
663
686
  </script>
@@ -947,7 +970,9 @@ $answers-apparition-duration: '0.5s';
947
970
  color: $color-grey-600;
948
971
  padding: $mu150 $mu350 $mu150 $mu150;
949
972
  }
950
-
973
+ :deep(.m-dialog__close) {
974
+ background-color: transparent;
975
+ }
951
976
  :deep(.m-dialog__body) {
952
977
  display: flex;
953
978
  flex-grow: 1;
@@ -1011,7 +1036,9 @@ $answers-apparition-duration: '0.5s';
1011
1036
  @include set-font-face('semi-bold');
1012
1037
  }
1013
1038
  }
1014
-
1039
+ &-video-container {
1040
+ width: 100%;
1041
+ }
1015
1042
  &-footer {
1016
1043
  box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.2);
1017
1044
  padding: $mu100;
@@ -57,6 +57,7 @@ import PbRestitutionBody from './PbRestitutionBody';
57
57
  import PbProgressionPrice from '../progression-price/PbProgressionPrice';
58
58
  import PbProjectItemSave from '../project-item-save/PbProjectItemSave';
59
59
  import PbRestitutionExit from './PbRestitutionExit';
60
+
60
61
  const BACK_ICON =
61
62
  'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
62
63
 
@@ -153,9 +154,14 @@ export default {
153
154
  return this.payload?.theme ?? this.theme;
154
155
  },
155
156
  displayedExitOptions() {
156
- return this.payload?.exitOptions.filter(
157
- (exitOption) => !exitOption.conditions || this.areConditionsValid(exitOption.conditions),
157
+ let formattedExitOptions = {
158
+ title: this.payload?.exitOptions.title,
159
+ options: [],
160
+ };
161
+ formattedExitOptions.options = this.payload?.exitOptions?.options?.filter(
162
+ (option) => !option.conditions || this.areConditionsValid(option.conditions),
158
163
  );
164
+ return formattedExitOptions;
159
165
  },
160
166
  },
161
167
 
@@ -7,12 +7,12 @@
7
7
  align-items="center"
8
8
  justify-content="center"
9
9
  >
10
- <div class="pb-restitution-exit__section-title">{{ title }}</div>
10
+ <div class="pb-restitution-exit__section-title">{{ exitOptions.title }}</div>
11
11
  <m-container class="pb-restitution-exit__section-content-cards-container" fluid>
12
12
  <m-flexy class="pb-restitution-exit__section-content-cards-flexy">
13
13
  <m-flexy-col
14
14
  class="pb-restitution-exit__section-content-card-flexy"
15
- v-for="tool in exitOptions"
15
+ v-for="tool in exitOptions.options"
16
16
  :key="tool.id"
17
17
  width="full"
18
18
  width-from-m="1of4"
@@ -46,12 +46,8 @@ export default {
46
46
  components: { PbCard, MFlexyCol, MFlexy, MContainer, MFlex },
47
47
  props: {
48
48
  exitOptions: {
49
- type: Array,
50
- default: () => [],
51
- },
52
- title: {
53
- type: String,
54
- default: 'Concevoir ma cuisine',
49
+ type: Object,
50
+ default: null,
55
51
  },
56
52
  },
57
53
  methods: {
@@ -3,35 +3,38 @@
3
3
  "title": "Votre projet de construction neuve se situe entre",
4
4
  "subtitle": "Construire ma nouvelle maison"
5
5
  },
6
- "exitOptions": [
7
- {
8
- "id": "Concevoir-ma-cuisine-en-3D",
9
- "title": "Concevoir ma cuisine en 3D",
10
- "subtitle": "Concevez votre cuisine vous-même avec notre configurateur 3D et finalisez votre projet en magasin",
11
- "type": "oaa",
12
- "link": "https://cuisine3d-did.leroymerlin.fr/Page_Tunnel_Cuisine/page_tunnel_cuisine.html",
13
- "image": "https://storage.googleapis.com/project-booster-media/common/services/tools.jpg",
14
- "conditions": ["isAnswerMatching('QUESTION_1', 'QUESTION_1--ANSWER_1')"]
15
- },
16
- {
17
- "id": "Réaliser votre plan de cuisine avec un expert",
18
- "title": "Réaliser votre plan de cuisine avec un expert",
19
- "subtitle": "Sur rendez-vous à distance",
20
- "type": "oaa",
21
- "link": "https://www.leroymerlin.fr/assistance-technique.html",
22
- "image": "https://storage.googleapis.com/project-booster-media/common/services/appointment.jpg",
23
- "conditions": ["isAnswerMatching('QUESTION_1', 'QUESTION_1--ANSWER_1')"]
24
- },
25
- {
26
- "id": "Découvrir nos cuisines",
27
- "title": "Découvrir nos cuisines",
28
- "subtitle": "Découvrez l’ensemble de nos cuisines Delinia ID et leurs nombreuses possibilités de personnalisation.",
29
- "type": "oaa",
30
- "link": "https://cuisine3d-did.leroymerlin.fr/Page_Tunnel_Cuisine/page_tunnel_cuisine.html?mag=190",
31
- "image": "https://storage.googleapis.com/project-booster-media/kitchen/kitchen-range.jpeg",
32
- "conditions": ["isAnswerMatching('QUESTION_1', 'QUESTION_1--ANSWER_2')"]
33
- }
34
- ],
6
+ "exitOptions": {
7
+ "title": "Concevoir ma cuisine",
8
+ "options": [
9
+ {
10
+ "id": "Concevoir-ma-cuisine-en-3D",
11
+ "title": "Concevoir ma cuisine en 3D",
12
+ "subtitle": "Concevez votre cuisine vous-même avec notre configurateur 3D et finalisez votre projet en magasin",
13
+ "type": "oaa",
14
+ "link": "https://cuisine3d-did.leroymerlin.fr/Page_Tunnel_Cuisine/page_tunnel_cuisine.html",
15
+ "image": "https://storage.googleapis.com/project-booster-media/common/services/tools.jpg",
16
+ "conditions": ["isAnswerMatching('QUESTION_1', 'QUESTION_1--ANSWER_1')"]
17
+ },
18
+ {
19
+ "id": "Réaliser votre plan de cuisine avec un expert",
20
+ "title": "Réaliser votre plan de cuisine avec un expert",
21
+ "subtitle": "Sur rendez-vous à distance",
22
+ "type": "oaa",
23
+ "link": "https://www.leroymerlin.fr/assistance-technique.html",
24
+ "image": "https://storage.googleapis.com/project-booster-media/common/services/appointment.jpg",
25
+ "conditions": ["isAnswerMatching('QUESTION_1', 'QUESTION_1--ANSWER_1')"]
26
+ },
27
+ {
28
+ "id": "Découvrir nos cuisines",
29
+ "title": "Découvrir nos cuisines",
30
+ "subtitle": "Découvrez l’ensemble de nos cuisines Delinia ID et leurs nombreuses possibilités de personnalisation.",
31
+ "type": "oaa",
32
+ "link": "https://cuisine3d-did.leroymerlin.fr/Page_Tunnel_Cuisine/page_tunnel_cuisine.html?mag=190",
33
+ "image": "https://storage.googleapis.com/project-booster-media/kitchen/kitchen-range.jpeg",
34
+ "conditions": ["isAnswerMatching('QUESTION_1', 'QUESTION_1--ANSWER_2')"]
35
+ }
36
+ ]
37
+ },
35
38
  "callToActions": [
36
39
  {
37
40
  "type": "button",
@@ -3,32 +3,35 @@
3
3
  "title": "Votre projet de construction neuve se situe entre",
4
4
  "subtitle": "Construire ma nouvelle maison"
5
5
  },
6
- "exitOptions": [
7
- {
8
- "id": "Concevoir-ma-cuisine-en-3D",
9
- "title": "Concevoir ma cuisine en 3D",
10
- "subtitle": "Concevez votre cuisine vous-même avec notre configurateur 3D et finalisez votre projet en magasin",
11
- "type": "oaa",
12
- "link": "https://cuisine3d-did.leroymerlin.fr/Page_Tunnel_Cuisine/page_tunnel_cuisine.html",
13
- "image": "https://storage.googleapis.com/project-booster-media/common/services/tools.jpg"
14
- },
15
- {
16
- "id": "Réaliser votre plan de cuisine avec un expert",
17
- "title": "Réaliser votre plan de cuisine avec un expert",
18
- "subtitle": "Sur rendez-vous à distance",
19
- "type": "oaa",
20
- "link": "https://www.leroymerlin.fr/assistance-technique.html",
21
- "image": "https://storage.googleapis.com/project-booster-media/common/services/appointment.jpg"
22
- },
23
- {
24
- "id": "Découvrir nos cuisines",
25
- "title": "Découvrir nos cuisines",
26
- "subtitle": "Découvrez l’ensemble de nos cuisines Delinia ID et leurs nombreuses possibilités de personnalisation.",
27
- "type": "oaa",
28
- "link": "https://cuisine3d-did.leroymerlin.fr/Page_Tunnel_Cuisine/page_tunnel_cuisine.html?mag=190",
29
- "image": "https://storage.googleapis.com/project-booster-media/kitchen/kitchen-range.jpeg"
30
- }
31
- ],
6
+ "exitOptions": {
7
+ "title": "Concevoir ma cuisine",
8
+ "options": [
9
+ {
10
+ "id": "Concevoir-ma-cuisine-en-3D",
11
+ "title": "Concevoir ma cuisine en 3D",
12
+ "subtitle": "Concevez votre cuisine vous-même avec notre configurateur 3D et finalisez votre projet en magasin",
13
+ "type": "oaa",
14
+ "link": "https://cuisine3d-did.leroymerlin.fr/Page_Tunnel_Cuisine/page_tunnel_cuisine.html",
15
+ "image": "https://storage.googleapis.com/project-booster-media/common/services/tools.jpg"
16
+ },
17
+ {
18
+ "id": "Réaliser votre plan de cuisine avec un expert",
19
+ "title": "Réaliser votre plan de cuisine avec un expert",
20
+ "subtitle": "Sur rendez-vous à distance",
21
+ "type": "oaa",
22
+ "link": "https://www.leroymerlin.fr/assistance-technique.html",
23
+ "image": "https://storage.googleapis.com/project-booster-media/common/services/appointment.jpg"
24
+ },
25
+ {
26
+ "id": "Découvrir nos cuisines",
27
+ "title": "Découvrir nos cuisines",
28
+ "subtitle": "Découvrez l’ensemble de nos cuisines Delinia ID et leurs nombreuses possibilités de personnalisation.",
29
+ "type": "oaa",
30
+ "link": "https://cuisine3d-did.leroymerlin.fr/Page_Tunnel_Cuisine/page_tunnel_cuisine.html?mag=190",
31
+ "image": "https://storage.googleapis.com/project-booster-media/kitchen/kitchen-range.jpeg"
32
+ }
33
+ ]
34
+ },
32
35
  "callToActions": [
33
36
  {
34
37
  "type": "button",
@@ -1085,7 +1085,7 @@ export default {
1085
1085
  },
1086
1086
 
1087
1087
  scrollToTop() {
1088
- const top = this.$refs.pbProjectHubContainer.$el.offsetTop;
1088
+ const top = this.$refs.pbProjectHubContainer.getBoundingClientRect().offsetTop;
1089
1089
  window.scroll({
1090
1090
  top,
1091
1091
  left: 0,