project-booster-vue 9.43.4 → 9.44.1

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.43.4",
3
+ "version": "9.44.1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -511,10 +511,7 @@ $responsive-breakpoint: 's';
511
511
 
512
512
  color: $color-grey-600;
513
513
  height: 100%;
514
- hyphens: auto;
515
514
  max-width: 100%;
516
- overflow-wrap: break-word;
517
- word-break: break-word;
518
515
 
519
516
  .a11y-high-contrast & {
520
517
  color: $color-grey-800;
@@ -366,8 +366,11 @@ $responsive-breakpoint: 'm';
366
366
  justify-content: flex-end !important;
367
367
  margin-bottom: $mu100;
368
368
  position: sticky;
369
- width: 100%;
370
369
  z-index: 1;
370
+
371
+ @include set-from-screen($responsive-breakpoint) {
372
+ width: 100%;
373
+ }
371
374
  }
372
375
 
373
376
  &__link {
@@ -1,26 +1,26 @@
1
1
  <template>
2
- <m-flex
3
- :class="`pb-restitution-list`"
4
- align-items="center"
5
- justify-content="flex-start"
6
- direction="column"
7
- ref="pbRestitutionList"
8
- >
9
- <m-link
10
- v-if="showBackButton"
11
- :left-icon="BACK_ICON"
12
- :label="payload.backLabel || 'Modifier l\'estimation'"
13
- class="pb-restitution-list__back-button"
14
- @click.once="$emit('go-back')"
15
- />
2
+ <m-flex align-items="center" direction="column" class="pb-restitution-wrapper">
3
+ <m-flex
4
+ :class="`pb-restitution-list`"
5
+ align-items="center"
6
+ justify-content="center"
7
+ direction="column"
8
+ ref="pbRestitutionList"
9
+ >
10
+ <m-link
11
+ v-if="showBackButton"
12
+ :left-icon="BACK_ICON"
13
+ :label="payload.backLabel || 'Modifier l\'estimation'"
14
+ class="pb-restitution-list__back-button"
15
+ @click.once="$emit('go-back')"
16
+ />
17
+ </m-flex>
16
18
  <div class="pb-restitution-list__title">{{ payload?.viewModel?.title }}</div>
17
19
 
18
20
  <div class="pb-restitution-list__line">
19
21
  <pb-restitution-list-block
20
22
  @button="handleShowDialog"
21
- v-for="component in summary.components"
22
- :key="component.componentId"
23
- :payload="component"
23
+ :payload="summary"
24
24
  :legalMentions="payload?.viewModel?.legalMentions"
25
25
  ></pb-restitution-list-block>
26
26
  </div>
@@ -77,7 +77,11 @@
77
77
 
78
78
  <div class="pb-restitution-list__modal__details__row">
79
79
  <div v-for="component in summary.components" :key="component.details">
80
- <div class="pb-restitution-list__modal__details__row__title" justify-content="space-between">
80
+ <div
81
+ class="pb-restitution-list__modal__details__row__title"
82
+ :class="{ green: component.componentId == 'AID' }"
83
+ justify-content="space-between"
84
+ >
81
85
  <div v-html="component.title"></div>
82
86
  <div v-if="component.cost.min != component.cost.max">
83
87
  <strong>
@@ -126,6 +130,12 @@
126
130
  <strong v-html="formattedPriceRange(summary.cost.max)"></strong>
127
131
  </div>
128
132
  </div>
133
+
134
+ <div class="pb-restitution-list__modal__details__legal-mentions">
135
+ <p v-for="(mention, index) in payload?.viewModel?.legalMentions" :key="'lm-modal-' + index">
136
+ {{ mention }}
137
+ </p>
138
+ </div>
129
139
  </div>
130
140
  </template>
131
141
  <template #footer>
@@ -147,12 +157,11 @@ import MLink from '../mozaic/link/MLink.vue';
147
157
  import PbProjectItemSave from '../projects/project-item-save/PbProjectItemSave.vue';
148
158
  import MNotification from '../mozaic/notifications/MNotification.vue';
149
159
  import { NotificationOptions } from '@/types/pb/Notification';
150
- import { RestitutionPayload, RestitutionPayloadAction, RestitutionPayloadCallToAction } from '@/types/pb/Restitution';
160
+ import { RestitutionListPayload, RestitutionPayloadCallToAction } from '@/types/pb/Restitution';
151
161
  import { ScenarioStepAnswer } from '@/types/pb/Scenario';
152
162
  import PbRestitutionListBlock from './PbRestitutionListBlock.vue';
153
163
  import { Project } from '../../types/pb/Project';
154
164
  import { areConditionsValid } from '../../services/scenarioConditionals';
155
- import { priceFormatter } from '@/services/priceFormatter';
156
165
  const BACK_ICON =
157
166
  'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
158
167
 
@@ -183,7 +192,7 @@ export default defineComponent({
183
192
  * from the default ones.
184
193
  */
185
194
  payload: {
186
- type: Object as PropType<RestitutionPayload>,
195
+ type: Object as PropType<RestitutionListPayload>,
187
196
  default: () => ({}),
188
197
  required: true,
189
198
  },
@@ -235,6 +244,9 @@ export default defineComponent({
235
244
  this.dialogContent = content;
236
245
  this.showDialog = !this.showDialog;
237
246
  },
247
+ handleLinkClicked(href: string) {
248
+ window.open(href, '_blank');
249
+ },
238
250
  handleItemCreated({
239
251
  projectId,
240
252
  estimateName,
@@ -302,16 +314,19 @@ $responsive-breakpoint: 'm';
302
314
  display: none;
303
315
  }
304
316
 
317
+ .pb-restitution-wrapper {
318
+ height: calc(100vh - 80px);
319
+ }
320
+
305
321
  .pb-restitution-list {
306
322
  @include set-font-face('regular');
307
- height: calc(100vh - 120px);
308
323
  margin: 0 auto;
309
- padding-top: $mu250;
310
324
  position: relative;
311
325
  width: 100%;
312
326
 
313
327
  @include set-from-screen($responsive-breakpoint) {
314
328
  justify-content: space-between;
329
+ padding-bottom: $mu250;
315
330
  width: calc(100% - #{$mu050} - #{$mu050});
316
331
  }
317
332
 
@@ -333,16 +348,31 @@ $responsive-breakpoint: 'm';
333
348
 
334
349
  &__title {
335
350
  @include set-font-face('semi-bold');
336
- @include set-font-scale('07', 's');
337
- left: 0;
351
+ @include set-font-scale('10', 's');
338
352
  padding: $mu100 0 $mu100 $mu025;
339
- position: absolute;
340
- right: 0;
341
- text-align: center;
342
- top: $mu250;
353
+ text-align: left;
354
+
355
+ &::after {
356
+ background: $color-primary-01-600;
357
+ content: '';
358
+ display: block;
359
+ height: 4px;
360
+ margin-bottom: $mu150;
361
+ margin-top: $mu025;
362
+ width: 100px;
363
+ }
343
364
 
344
365
  @include set-from-screen($responsive-breakpoint) {
345
- top: 0;
366
+ left: 0;
367
+ position: absolute;
368
+ right: 0;
369
+ text-align: center;
370
+ top: 0px;
371
+ @include set-font-scale('07', 's');
372
+
373
+ &::after {
374
+ display: none;
375
+ }
346
376
  }
347
377
  }
348
378
 
@@ -364,7 +394,11 @@ $responsive-breakpoint: 'm';
364
394
  }
365
395
 
366
396
  &__line {
367
- margin-top: $mu250;
397
+ padding: 8px;
398
+
399
+ @include set-from-screen($responsive-breakpoint) {
400
+ margin-top: $mu250;
401
+ }
368
402
  }
369
403
 
370
404
  &__modal {
@@ -511,6 +545,12 @@ $responsive-breakpoint: 'm';
511
545
  }
512
546
  }
513
547
  }
548
+
549
+ &__legal-mentions {
550
+ color: $color-grey-600;
551
+ @include set-font-face('regular');
552
+ @include set-font-scale('04', 'm');
553
+ }
514
554
  }
515
555
 
516
556
  &__footer {
@@ -1,39 +1,15 @@
1
1
  <template>
2
- <m-flex align-items="center" direction="column" v-if="payload.componentId != 'AID'">
2
+ <m-flex align-items="center" direction="column">
3
3
  <m-flex :class="`pb-restitution-list-block`" direction="column" ref="pbRestitutionListBlock">
4
4
  <div class="pb-restitution-list-block__title" v-html="summary.subprojectTemplateLabel"></div>
5
5
 
6
6
  <div class="pb-restitution-list-block__body" v-if="payload">
7
- <div class="pb-restitution-list-line">
8
- <div class="pb-restitution-list-line__title" v-html="summary.components[0].title"></div>
9
- <div class="pb-restitution-list-line__price">
10
- <div class="pb-restitution-list-line__price__min">
11
- {{ formattedPriceRange(summary.components[0].cost.min) }}&nbsp;et&nbsp;
12
- </div>
13
- <div class="pb-restitution-list-line__price__max">
14
- {{ formattedPriceRange(summary.components[0].cost.max) }}
15
- </div>
16
- </div>
17
- </div>
18
-
19
7
  <pb-restitution-list-line
20
- v-for="line in payload.lines"
21
- :key="line.componentId"
22
- :component="line"
23
- :line="line"
8
+ v-for="component in payload.components"
9
+ :key="component.componentId"
10
+ :line="component"
24
11
  ></pb-restitution-list-line>
25
12
 
26
- <div v-for="aidComponent in summary.components" :key="aidComponent.componentId">
27
- <div v-if="aidComponent.componentId === 'AID'">
28
- <pb-restitution-list-line
29
- :key="aidComponent.title"
30
- :component="aidComponent"
31
- :line="aidComponent"
32
- :renovAid="true"
33
- ></pb-restitution-list-line>
34
- </div>
35
- </div>
36
-
37
13
  <div class="pb-restitution-list-block__body__row unbordered">
38
14
  <div class="pb-restitution-list-block__body__row__title full">
39
15
  <div><strong>Montant total</strong> (aides déduites)</div>
@@ -67,7 +43,7 @@ import MFlex from '../mozaic/flex/MFlex.vue';
67
43
  import MButton from '../mozaic/buttons/MButton.vue';
68
44
  import PbRestitutionListLine from './PbRestitutionListLine.vue';
69
45
  import { mapGetters } from 'vuex';
70
- import { RestitutionPayload } from '@/types/pb/Restitution';
46
+ import { Restitution } from '@/types/pb/Restitution';
71
47
 
72
48
  export default defineComponent({
73
49
  components: {
@@ -77,8 +53,7 @@ export default defineComponent({
77
53
  },
78
54
  props: {
79
55
  payload: {
80
- type: Object as PropType<RestitutionPayload>,
81
- default: () => ({}),
56
+ type: Object as PropType<Restitution>,
82
57
  required: true,
83
58
  },
84
59
  legalMentions: {
@@ -109,7 +84,6 @@ $responsive-breakpoint: 'm';
109
84
  @include set-box-shadow('l');
110
85
  margin-bottom: $mu100;
111
86
  padding: $mu150;
112
- width: 80%;
113
87
 
114
88
  @include set-from-screen($responsive-breakpoint) {
115
89
  padding: $mu250;
@@ -211,7 +185,7 @@ $responsive-breakpoint: 'm';
211
185
  border-bottom: 1px solid $color-grey-500;
212
186
  display: flex;
213
187
  flex-direction: column;
214
- padding: $mu150 0 $mu075 0;
188
+ padding: $mu150 8px $mu075 8px;
215
189
 
216
190
  @include set-from-screen($responsive-breakpoint) {
217
191
  flex-direction: row;
@@ -1,20 +1,17 @@
1
1
  <template>
2
- <div class="pb-restitution-list-line" :class="{ green: renovAid }" v-if="renovAid">
3
- <div class="pb-restitution-list-line__title" v-html="line.text || line.title"></div>
4
- <div class="pb-restitution-list-line__price" v-if="!renovAid">
5
- <div class="pb-restitution-list-line__price__min">{{ formattedPriceRange(line.cost.min) }}&nbsp;et&nbsp;</div>
6
- <div class="pb-restitution-list-line__price__max">{{ formattedPriceRange(line.cost.max) }}</div>
7
- </div>
2
+ <div class="pb-restitution-list-line" :class="{ green: line.componentId == 'AID' }">
3
+ <div class="pb-restitution-list-line__title" v-html="line.title"></div>
8
4
  <div class="pb-restitution-list-line__price">
9
- <span v-if="line.cost.min === line.cost.max">{{ formattedPriceRange(line.cost.min) }}</span>
10
- <span v-else>{{ formattedPriceRange(line.cost.min) }} et {{ formattedPriceRange(line.cost.max) }}</span>
5
+ <span v-if="line?.cost?.min === line?.cost?.max">{{ formattedPriceRange(line?.cost?.min) }}</span>
6
+ <span v-else>{{ formattedPriceRange(line?.cost?.min) }} et {{ formattedPriceRange(line?.cost?.max) }}</span>
11
7
  </div>
12
8
  </div>
13
9
  </template>
14
10
 
15
11
  <script lang="ts">
16
- import { defineComponent } from 'vue';
12
+ import { defineComponent, PropType } from 'vue';
17
13
  import MFlex from '../mozaic/flex/MFlex.vue';
14
+ import { RestitutionComponent } from '@/types/pb/Restitution';
18
15
 
19
16
  export default defineComponent({
20
17
  components: {
@@ -22,16 +19,8 @@ export default defineComponent({
22
19
  },
23
20
  props: {
24
21
  line: {
25
- type: Object,
26
- default: () => ({}),
27
- },
28
- renovAid: {
29
- type: Boolean,
30
- default: () => false,
31
- },
32
- formatPriceRange: {
33
- type: Function,
34
- default: () => '',
22
+ type: Object as PropType<RestitutionComponent>,
23
+ required: true,
35
24
  },
36
25
  },
37
26
  methods: {
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "viewModel": {
3
3
  "title": "Votre estimation par travaux",
4
+ "backButtonAction": {
5
+ "type": "STEP",
6
+ "code": "STEP_CODE"
7
+ },
4
8
  "legalMentions": [
5
9
  "* Montant estimatif établi selon les réponses renseignées dans le questionnaire et susceptible d'être ajusté lors du devis définitif. Ce montant n’engage pas Leroy Merlin."
6
10
  ]
@@ -1,3 +1,5 @@
1
+ import { array } from 'yup';
2
+
1
3
  export interface RestitutionCost {
2
4
  min: number;
3
5
  max: number;
@@ -81,3 +83,14 @@ export interface RestitutionPayload {
81
83
  callToActions: RestitutionPayloadCallToAction[];
82
84
  exitOptions: RestitutionExitOptions;
83
85
  }
86
+
87
+ export interface RestitutionListPayload {
88
+ viewModel: RestitutionListViewModelPayload;
89
+ callToActions: RestitutionPayloadCallToAction[];
90
+ exitOptions: RestitutionExitOptions;
91
+ }
92
+
93
+ export interface RestitutionListViewModelPayload {
94
+ title: string;
95
+ legalMentions?: string[];
96
+ }