project-booster-vue 10.2.4 → 10.3.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 +1 -1
- package/src/components/mozaic/text-input/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-mozaic-components-m-text-input-/342/232/233/357/270/217-showcase-type-1-snap.png +0 -0
- package/src/components/projects/projects/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-projects-pb-projects-/360/237/246/240-showcase-autoscroll-to-estimates-1-snap.png +0 -0
- package/src/components/rework/alert/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-rework-alert-m-pb-alert-/360/237/246/240-101-sandbox-1-snap.png +0 -0
- package/src/components/rework/question/configurations-import/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-rework-questions-m-pb-configurations-import-/360/237/246/240-with-simulations-linked-1-snap.png +0 -0
- package/src/components/scenario/PbScenario.vue +9 -0
- package/src/components/trezor/PbTrezor.vue +80 -2
- package/src/stores/modules/trezorStore.ts +1 -1
package/package.json
CHANGED
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
completed-event-name="step-completed"
|
|
64
64
|
:sticky-bottom-offset="stickyBottomOffset()"
|
|
65
65
|
:min-height="minHeight"
|
|
66
|
+
:is-collaborator="isCollaborator"
|
|
66
67
|
@step-completed="handleStepCompleted"
|
|
67
68
|
@update-selected="handleSemiUpdateSelected"
|
|
68
69
|
@redirection="handleRedirection"
|
|
@@ -235,6 +236,14 @@ export default defineComponent({
|
|
|
235
236
|
type: Object,
|
|
236
237
|
default: () => ({}),
|
|
237
238
|
},
|
|
239
|
+
/**
|
|
240
|
+
* Indicates whether the authenticated user is a collaborator
|
|
241
|
+
*/
|
|
242
|
+
isCollaborator: {
|
|
243
|
+
type: Boolean,
|
|
244
|
+
default: false,
|
|
245
|
+
required: false,
|
|
246
|
+
},
|
|
238
247
|
},
|
|
239
248
|
|
|
240
249
|
setup(props, { emit }) {
|
|
@@ -136,6 +136,36 @@
|
|
|
136
136
|
|
|
137
137
|
<div class="ml-flexy">
|
|
138
138
|
<div class="pb-trezor__form__col ml-flexy__col--5of6 no-padding">
|
|
139
|
+
<m-flex v-if="isCollaborator" class="pb-trezor__form__row space" direction="column">
|
|
140
|
+
<label class="pb-trezor__form__label"
|
|
141
|
+
>Partenaire à privilégier<span> *sous réserve de disponibilité</span></label
|
|
142
|
+
>
|
|
143
|
+
<div class="pb-trezor__form__cards-container">
|
|
144
|
+
<m-pb-card
|
|
145
|
+
v-for="partner in partners"
|
|
146
|
+
:key="partner.id"
|
|
147
|
+
:title="partner.name"
|
|
148
|
+
:selected="formData.values.selectedPreferredPartner == partner.id"
|
|
149
|
+
@card-click="handleSelectPartner(partner)"
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
</m-flex>
|
|
153
|
+
|
|
154
|
+
<m-flex v-if="isCollaborator" class="pb-trezor__form__row space" direction="column">
|
|
155
|
+
<label class="pb-trezor__form__label"
|
|
156
|
+
>Commentaire du collaborateur<span> *minimum 10 caractères</span></label
|
|
157
|
+
>
|
|
158
|
+
<div class="pb-trezor__form__textarea-container">
|
|
159
|
+
<textarea
|
|
160
|
+
class="pb-trezor__textarea"
|
|
161
|
+
v-model="formData.values.comment"
|
|
162
|
+
placeholder="Votre texte ici.."
|
|
163
|
+
:required="false"
|
|
164
|
+
rows="5"
|
|
165
|
+
/>
|
|
166
|
+
</div>
|
|
167
|
+
</m-flex>
|
|
168
|
+
|
|
139
169
|
<m-flex class="pb-trezor__form__row space" direction="column">
|
|
140
170
|
<label class="pb-trezor__form__label"><span>obligatoire</span></label>
|
|
141
171
|
<div class="pb-trezor__form__checkbox-container">
|
|
@@ -207,7 +237,7 @@
|
|
|
207
237
|
<template #default>
|
|
208
238
|
<h4>Nos partenaires sont :</h4>
|
|
209
239
|
<ul>
|
|
210
|
-
<li v-for="(partner, i) in partners" :key="'partner_' + i">{{ partner }}</li>
|
|
240
|
+
<li v-for="(partner, i) in partners" :key="'partner_' + i">{{ partner.name }}</li>
|
|
211
241
|
</ul>
|
|
212
242
|
</template>
|
|
213
243
|
<template #footer>
|
|
@@ -225,6 +255,7 @@ import MCheckbox from '../mozaic/checkbox/MCheckbox.vue';
|
|
|
225
255
|
import MLink from '../mozaic/link/MLink.vue';
|
|
226
256
|
import MTextInput from '../mozaic/text-input/MTextInput.vue';
|
|
227
257
|
import MRadio from '../mozaic/radio/MRadio.vue';
|
|
258
|
+
import MPbCard from '../rework/cards/MPbCards.vue';
|
|
228
259
|
import { ScenarioStepAnswer } from '@/types/pb/Scenario';
|
|
229
260
|
import { object, string, boolean, number } from 'yup';
|
|
230
261
|
import { TrezorInterface } from './PbTrezorInterface';
|
|
@@ -246,6 +277,7 @@ export default defineComponent({
|
|
|
246
277
|
MLink,
|
|
247
278
|
MRadio,
|
|
248
279
|
MModal,
|
|
280
|
+
MPbCard,
|
|
249
281
|
},
|
|
250
282
|
props: {
|
|
251
283
|
/**
|
|
@@ -285,6 +317,14 @@ export default defineComponent({
|
|
|
285
317
|
type: Object as PropType<Map<string, ScenarioStepAnswer[]>>,
|
|
286
318
|
default: () => new Map<string, ScenarioStepAnswer[]>(),
|
|
287
319
|
},
|
|
320
|
+
/**
|
|
321
|
+
* Indicates whether the authenticated user is a collaborator
|
|
322
|
+
*/
|
|
323
|
+
isCollaborator: {
|
|
324
|
+
type: Boolean,
|
|
325
|
+
default: false,
|
|
326
|
+
required: false,
|
|
327
|
+
},
|
|
288
328
|
},
|
|
289
329
|
setup(props, { emit }) {
|
|
290
330
|
const store = useStore();
|
|
@@ -350,6 +390,8 @@ export default defineComponent({
|
|
|
350
390
|
optin: false,
|
|
351
391
|
optinPartners: false,
|
|
352
392
|
optinOffers: false,
|
|
393
|
+
selectedPreferredPartner: null,
|
|
394
|
+
comment: undefined,
|
|
353
395
|
},
|
|
354
396
|
errors: {},
|
|
355
397
|
});
|
|
@@ -377,6 +419,8 @@ export default defineComponent({
|
|
|
377
419
|
return formData.value.values.optinPartners === true;
|
|
378
420
|
}),
|
|
379
421
|
optinOffers: boolean(),
|
|
422
|
+
selectedPreferredPartner: number().integer().min(1).nullable(true),
|
|
423
|
+
comment: string().notRequired().nullable(true),
|
|
380
424
|
});
|
|
381
425
|
|
|
382
426
|
const isSubmitDisabled = ref(false);
|
|
@@ -405,6 +449,8 @@ export default defineComponent({
|
|
|
405
449
|
optinPartners: formData.value.values.optinPartners,
|
|
406
450
|
optinOffers: formData.value.values.optinOffers,
|
|
407
451
|
metadata: sendingMetadata,
|
|
452
|
+
description: formData.values.comment,
|
|
453
|
+
preferredCompany: formData.values.selectedPreferredPartner,
|
|
408
454
|
},
|
|
409
455
|
typeLead: props.payload.viewModel.typeLead,
|
|
410
456
|
});
|
|
@@ -437,7 +483,7 @@ export default defineComponent({
|
|
|
437
483
|
}
|
|
438
484
|
};
|
|
439
485
|
|
|
440
|
-
//
|
|
486
|
+
// Partners
|
|
441
487
|
let showModal = ref(false);
|
|
442
488
|
|
|
443
489
|
store.dispatch('trezor/loadPartners', {
|
|
@@ -446,6 +492,10 @@ export default defineComponent({
|
|
|
446
492
|
|
|
447
493
|
const partners = computed(() => store.getters['trezor/getPartners']);
|
|
448
494
|
|
|
495
|
+
const handleSelectPartner = (partner: any) => {
|
|
496
|
+
formData.value.values.selectedPreferredPartner = partner.id;
|
|
497
|
+
};
|
|
498
|
+
|
|
449
499
|
return {
|
|
450
500
|
formData,
|
|
451
501
|
callAction,
|
|
@@ -454,6 +504,7 @@ export default defineComponent({
|
|
|
454
504
|
showModal,
|
|
455
505
|
partners,
|
|
456
506
|
isSubmitDisabled,
|
|
507
|
+
handleSelectPartner,
|
|
457
508
|
};
|
|
458
509
|
},
|
|
459
510
|
});
|
|
@@ -503,6 +554,10 @@ $responsive-breakpoint: 'm';
|
|
|
503
554
|
width: 100%;
|
|
504
555
|
}
|
|
505
556
|
|
|
557
|
+
&__textarea {
|
|
558
|
+
width: 100%;
|
|
559
|
+
}
|
|
560
|
+
|
|
506
561
|
&__form {
|
|
507
562
|
padding: 30px;
|
|
508
563
|
width: calc(100% - 60px);
|
|
@@ -529,6 +584,29 @@ $responsive-breakpoint: 'm';
|
|
|
529
584
|
}
|
|
530
585
|
}
|
|
531
586
|
|
|
587
|
+
&__textarea-container {
|
|
588
|
+
display: flex;
|
|
589
|
+
flex-direction: row;
|
|
590
|
+
width: 100%;
|
|
591
|
+
|
|
592
|
+
&__label {
|
|
593
|
+
font-family: LeroyMerlin, sans-serif;
|
|
594
|
+
margin-left: 0.5rem;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
&__cards-container {
|
|
599
|
+
display: flex;
|
|
600
|
+
flex-direction: row;
|
|
601
|
+
flex-wrap: wrap;
|
|
602
|
+
gap: 1.5rem;
|
|
603
|
+
|
|
604
|
+
&__label {
|
|
605
|
+
font-family: LeroyMerlin, sans-serif;
|
|
606
|
+
margin-left: 0.5rem;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
532
610
|
&__radio {
|
|
533
611
|
margin-right: 15px;
|
|
534
612
|
}
|