project-booster-vue 9.31.3 → 9.33.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 +1 -1
- package/src/components/media/PbMedia.stories.mdx +3 -3
- package/src/components/media/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-documents-media-pb-media-/360/237/246/240-with-media-1-snap.png +0 -0
- package/src/components/media/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-documents-media-pb-media-/360/237/246/240-with-media-read-only-1-snap.png +0 -0
- package/src/components/pedagogy/PbPedagogy.stories.mdx +9 -0
- package/src/components/pedagogy/PbPedagogy.vue +14 -0
- package/src/components/pedagogy/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-pedagogy-pb-pedagogy-/360/237/246/240-with-instruction-1-snap.png +0 -0
- package/src/components/pedagogy/with-instructions.json +45 -0
- package/src/components/projects/project-hub/PbProjectHub.stories.mdx +13 -10
- package/src/components/projects/projects-list/PbProjectsList.stories.mdx +3 -3
- package/src/services/api/documentsApi.ts +1 -1
- package/src/stores/modules/documentsStore.ts +4 -2
package/package.json
CHANGED
|
@@ -73,7 +73,7 @@ export const TemplateSandbox = (args, { argTypes }) => {
|
|
|
73
73
|
controls: { disabled: true },
|
|
74
74
|
msw: [
|
|
75
75
|
rest.post('/api/events/documents', acceptedResolver),
|
|
76
|
-
rest.get('/api/inhabitant-projects/:projectId/documents
|
|
76
|
+
rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
|
|
77
77
|
rest.get(
|
|
78
78
|
'/api/inhabitant-projects/:projectId/documents/:documentId/thumbnail',
|
|
79
79
|
getDocumentsImageThumbnailResolver,
|
|
@@ -115,7 +115,7 @@ export const TemplateSandbox = (args, { argTypes }) => {
|
|
|
115
115
|
controls: { disabled: true },
|
|
116
116
|
msw: [
|
|
117
117
|
rest.post('/api/inhabitant-projects/:projectId/documents', uploadDocumentResolver),
|
|
118
|
-
rest.get('/api/inhabitant-projects/:projectId/documents
|
|
118
|
+
rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
|
|
119
119
|
rest.get(
|
|
120
120
|
'/api/inhabitant-projects/:projectId/documents/:documentId/thumbnail',
|
|
121
121
|
getDocumentsImageThumbnailResolver,
|
|
@@ -178,7 +178,7 @@ export const TemplateSandbox = (args, { argTypes }) => {
|
|
|
178
178
|
controls: { disabled: true },
|
|
179
179
|
msw: [
|
|
180
180
|
rest.post('/api/inhabitant-projects/:projectId/documents', uploadDocumentResolver),
|
|
181
|
-
rest.get('/api/inhabitant-projects/:projectId/documents
|
|
181
|
+
rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
|
|
182
182
|
rest.get(
|
|
183
183
|
'/api/inhabitant-projects/:projectId/documents/:documentId/thumbnail',
|
|
184
184
|
getDocumentsImageThumbnailResolver,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Anchor, Story, Preview, Meta, Props, ArgsTable, Source, Canvas } from '@storybook/addon-docs';
|
|
2
2
|
import DEFAULT_PAYLOAD from './default-payload';
|
|
3
|
+
import WITH_INSTRUCTIONS from './with-instructions';
|
|
3
4
|
import { nestedAppDecorator } from '../../../.storybook/nested-app-decorator';
|
|
4
5
|
import PbPedagogy from './PbPedagogy';
|
|
5
6
|
import store from '../../stores/store';
|
|
@@ -48,3 +49,11 @@ export const TemplateSandbox = (args, { argTypes }) => ({
|
|
|
48
49
|
{TemplateSandbox.bind({})}
|
|
49
50
|
</Story>
|
|
50
51
|
</Canvas>
|
|
52
|
+
|
|
53
|
+
## showCase
|
|
54
|
+
|
|
55
|
+
<Canvas>
|
|
56
|
+
<Story inline={false} height="862px" name="With instruction" args={{ payload: WITH_INSTRUCTIONS }}>
|
|
57
|
+
{TemplateSandbox.bind({})}
|
|
58
|
+
</Story>
|
|
59
|
+
</Canvas>
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
<div class="pb-pedagogy__content-description-line-text" v-html="line.label" />
|
|
15
15
|
</div>
|
|
16
16
|
</m-flex>
|
|
17
|
+
<m-flex
|
|
18
|
+
class="pb-pedagogy__content__button-informations"
|
|
19
|
+
align-items="center"
|
|
20
|
+
v-if="payload.viewModel.instructionsButton"
|
|
21
|
+
>
|
|
22
|
+
{{ payload.viewModel.instructionsButton.text }}
|
|
23
|
+
</m-flex>
|
|
17
24
|
<m-button
|
|
18
25
|
v-if="payload.viewModel.downloadButton"
|
|
19
26
|
:theme="payload.viewModel.downloadButton.theme"
|
|
@@ -229,6 +236,13 @@ $responsive-breakpoint: 'm';
|
|
|
229
236
|
margin-bottom: $mu100;
|
|
230
237
|
}
|
|
231
238
|
}
|
|
239
|
+
|
|
240
|
+
&__button-informations {
|
|
241
|
+
@include set-font-scale('07', 'm');
|
|
242
|
+
@include set-font-face('semi-bold');
|
|
243
|
+
margin-bottom: calc($mu100 * -1);
|
|
244
|
+
margin-top: $mu200;
|
|
245
|
+
}
|
|
232
246
|
}
|
|
233
247
|
|
|
234
248
|
:deep(.pb-pedagogy__content-description-bold) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"viewModel": {
|
|
3
|
+
"title": "Un email de rappel pour préparer votre RDV vous sera envoyé",
|
|
4
|
+
"icon": "https://storage.googleapis.com/project-booster-media/vad/fin-de-parcours/mail_80.svg",
|
|
5
|
+
"description": [
|
|
6
|
+
{
|
|
7
|
+
"label": "Les mesures et <span class='pb-pedagogy__content-description-bold'> plans de votre pièce </span> sont importants pour le rendez-vous. Ils\n permettront à votre conseiller de créer un <span class='pb-pedagogy__content-description-bold'> plan 3D adapté </span> à votre cuisine.\n <span class='pb-pedagogy__content-description-bold'> Vous pouvez les ajouter à partir à partir du mail que vous avez reçu. </span>",
|
|
8
|
+
"icon": "https://storage.googleapis.com/project-booster-media/vad/lm-advisor.png"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"instructionsButton": {
|
|
12
|
+
"text": "Vous pouvez maintenant choisir votre créneau de RDV"
|
|
13
|
+
},
|
|
14
|
+
"downloadButton": {
|
|
15
|
+
"label": "Comment faire son plan ? (PDF)",
|
|
16
|
+
"theme": "bordered",
|
|
17
|
+
"href": "https://storage.googleapis.com/project-booster-media/vad/PDF/Plan_Prise-de-mesure_Leroy-Merlin.pdf"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"cards": [
|
|
21
|
+
{
|
|
22
|
+
"code": "CARD-2",
|
|
23
|
+
"viewModel": {
|
|
24
|
+
"url": "https://www.leroymerlin.fr/produits/cuisine/cuisine-equipee-delinia-id/",
|
|
25
|
+
"image": "https://storage.googleapis.com/project-booster-media/kitchen/kitchen-range.jpeg",
|
|
26
|
+
"title": "Découvrir nos gammes de cuisines",
|
|
27
|
+
"width": "full",
|
|
28
|
+
"widthFromM": "1of3",
|
|
29
|
+
"widthFromL": "1of3"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"code": "CARD-3",
|
|
34
|
+
"viewModel": {
|
|
35
|
+
"value": "3",
|
|
36
|
+
"url": "https://www.leroymerlin.fr/produits/cuisine/cuisine-equipee-delinia-id/",
|
|
37
|
+
"image": "https://images.ctfassets.net/8q8qvv8j6cpk/59igdEVBhIa37nrfbnGs4V/252c4bb73bf865a68b53036fba6dba21/carrelage.jpg",
|
|
38
|
+
"title": "Des idées et conseils pour votre cuisine",
|
|
39
|
+
"width": "full",
|
|
40
|
+
"widthFromM": "1of3",
|
|
41
|
+
"widthFromL": "1of3"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -200,13 +200,13 @@ The `PbProjectHub` component to access your project.
|
|
|
200
200
|
'/api/inhabitant-projects/:inhabitantProjectId/simulations',
|
|
201
201
|
getConfigurationsWithUpdatedPricesByProjectIdResolver,
|
|
202
202
|
),
|
|
203
|
-
rest.get('
|
|
203
|
+
rest.get('/api/simulations?inhabitantProjectId=:projectId', getConfigurationsByProjectIdResolver),
|
|
204
204
|
rest.get(
|
|
205
205
|
'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
|
|
206
206
|
getToolsByProjectTypeResolver,
|
|
207
207
|
),
|
|
208
208
|
rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
|
|
209
|
-
rest.get('/api/inhabitant-projects/:projectId/documents
|
|
209
|
+
rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
|
|
210
210
|
rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
|
|
211
211
|
rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
|
|
212
212
|
rest.get(
|
|
@@ -256,13 +256,13 @@ The `PbProjectHub` component to access your project.
|
|
|
256
256
|
'/api/inhabitant-projects/:inhabitantProjectId/simulations',
|
|
257
257
|
getConfigurationsWithUpdatedPricesByProjectIdResolver,
|
|
258
258
|
),
|
|
259
|
-
rest.get('/api/simulations', getConfigurationsByProjectIdResolver),
|
|
259
|
+
rest.get('/api/simulations?inhabitantProjectId=:projectId', getConfigurationsByProjectIdResolver),
|
|
260
260
|
rest.get(
|
|
261
261
|
'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
|
|
262
262
|
getToolsByProjectTypeResolver,
|
|
263
263
|
),
|
|
264
264
|
rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
|
|
265
|
-
rest.get('/api/inhabitant-projects/:projectId/documents
|
|
265
|
+
rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
|
|
266
266
|
rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
|
|
267
267
|
rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
|
|
268
268
|
rest.get(
|
|
@@ -383,13 +383,13 @@ The `PbProjectHub` component to access your project.
|
|
|
383
383
|
'/api/inhabitant-projects/:inhabitantProjectId/simulations',
|
|
384
384
|
getConfigurationsWithUpdatedPricesByProjectIdResolver,
|
|
385
385
|
),
|
|
386
|
-
rest.get('/api/simulations', getConfigurationsByProjectIdResolver),
|
|
386
|
+
rest.get('/api/simulations?inhabitantProjectId=:projectId', getConfigurationsByProjectIdResolver),
|
|
387
387
|
rest.get(
|
|
388
388
|
'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
|
|
389
389
|
getToolsByProjectTypeResolver,
|
|
390
390
|
),
|
|
391
391
|
rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
|
|
392
|
-
rest.get('/api/inhabitant-projects/:projectId/documents
|
|
392
|
+
rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
|
|
393
393
|
rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
|
|
394
394
|
rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
|
|
395
395
|
rest.get(
|
|
@@ -464,13 +464,13 @@ The `PbProjectHub` component to access your project.
|
|
|
464
464
|
'/api/inhabitant-projects/:inhabitantProjectId/simulations',
|
|
465
465
|
getConfigurationsWithUpdatedPricesByProjectIdResolver,
|
|
466
466
|
),
|
|
467
|
-
rest.get('/api/simulations', getConfigurationsByProjectIdResolver),
|
|
467
|
+
rest.get('/api/simulations?inhabitantProjectId=:projectId', getConfigurationsByProjectIdResolver),
|
|
468
468
|
rest.get(
|
|
469
469
|
'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
|
|
470
470
|
getToolsByProjectTypeResolver,
|
|
471
471
|
),
|
|
472
472
|
rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
|
|
473
|
-
rest.get('/api/inhabitant-projects/:projectId/documents
|
|
473
|
+
rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
|
|
474
474
|
rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
|
|
475
475
|
rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
|
|
476
476
|
rest.get(
|
|
@@ -518,13 +518,16 @@ The `PbProjectHub` component to access your project.
|
|
|
518
518
|
'/api/inhabitant-projects/:inhabitantProjectId/simulations',
|
|
519
519
|
getEmptyConfigurationsByProjectIdResolver,
|
|
520
520
|
),
|
|
521
|
-
rest.get('/api/simulations', getEmptyConfigurationsByProjectIdResolver),
|
|
521
|
+
rest.get('/api/simulations?inhabitantProjectId=:projectId', getEmptyConfigurationsByProjectIdResolver),
|
|
522
522
|
rest.get(
|
|
523
523
|
'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
|
|
524
524
|
getEmptyToolsByProjectTypeResolver,
|
|
525
525
|
),
|
|
526
526
|
rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
|
|
527
|
-
rest.get(
|
|
527
|
+
rest.get(
|
|
528
|
+
'/api/inhabitant-projects/:projectId/documents?range=0-5',
|
|
529
|
+
getEmptyDocumentsByInhabitantProjectIdResolver,
|
|
530
|
+
),
|
|
528
531
|
rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
|
|
529
532
|
rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
|
|
530
533
|
rest.get(
|
|
@@ -64,7 +64,7 @@ The `PbProjectsList` component to access your project.
|
|
|
64
64
|
name="Showcase"
|
|
65
65
|
parameters={{
|
|
66
66
|
controls: { disable: true },
|
|
67
|
-
msw: [rest.get('/api/inhabitant-projects', getProjectsResolver)],
|
|
67
|
+
msw: [rest.get('/api/inhabitant-projects?range=0-5&status=ACTIVE', getProjectsResolver)],
|
|
68
68
|
}}
|
|
69
69
|
height="100vh"
|
|
70
70
|
>
|
|
@@ -79,7 +79,7 @@ The `PbProjectsList` component to access your project.
|
|
|
79
79
|
name="Showcase empty state"
|
|
80
80
|
parameters={{
|
|
81
81
|
controls: { disable: true },
|
|
82
|
-
msw: [rest.get('/api/inhabitant-projects', getEmptyProjectsResolver)],
|
|
82
|
+
msw: [rest.get('/api/inhabitant-projects?range=0-5&status=ACTIVE', getEmptyProjectsResolver)],
|
|
83
83
|
}}
|
|
84
84
|
height="100vh"
|
|
85
85
|
>
|
|
@@ -94,7 +94,7 @@ The `PbProjectsList` component to access your project.
|
|
|
94
94
|
name="Showcase with error"
|
|
95
95
|
parameters={{
|
|
96
96
|
controls: { disable: true },
|
|
97
|
-
msw: [rest.get('/api/inhabitant-projects', internalServerErrorResolver)],
|
|
97
|
+
msw: [rest.get('/api/inhabitant-projects?range=0-5&status=ACTIVE', internalServerErrorResolver)],
|
|
98
98
|
storyshots: { disable: true },
|
|
99
99
|
}}
|
|
100
100
|
height="100vh"
|
|
@@ -372,11 +372,12 @@ export const mediaDocumentsListStoreOptions = {
|
|
|
372
372
|
? 0
|
|
373
373
|
: (state.mediaPerPageCount - (state.mediaList.length % state.mediaPerPageCount)) % state.mediaPerPageCount;
|
|
374
374
|
const mediaNumberToAdd = mediaNumberToAddOffset + state.mediaPerPageCount;
|
|
375
|
+
const subType = state.context ? state.context.subType : undefined;
|
|
375
376
|
let media = await getDocumentsByInhabitantProjectId(
|
|
376
377
|
state.currentMediaPage * state.mediaPerPageCount,
|
|
377
378
|
state.currentMediaPage * state.mediaPerPageCount + mediaNumberToAdd - 1,
|
|
378
379
|
state.currentProjectId,
|
|
379
|
-
|
|
380
|
+
subType,
|
|
380
381
|
);
|
|
381
382
|
commit('addMedia', media.results ? media.results : []);
|
|
382
383
|
|
|
@@ -411,11 +412,12 @@ export const mediaDocumentsListStoreOptions = {
|
|
|
411
412
|
},
|
|
412
413
|
async refreshMediaList({ commit, dispatch, state }: MediaDocumentsContext) {
|
|
413
414
|
if (state.currentMediaPage > 0) {
|
|
415
|
+
const subType = state.context ? state.context.subType : undefined;
|
|
414
416
|
let media = await getDocumentsByInhabitantProjectId(
|
|
415
417
|
0,
|
|
416
418
|
state.currentMediaPage * state.mediaPerPageCount - 1,
|
|
417
419
|
state.currentProjectId,
|
|
418
|
-
|
|
420
|
+
subType,
|
|
419
421
|
);
|
|
420
422
|
commit('setMediaList', media.results);
|
|
421
423
|
|