project-booster-vue 9.62.0 → 9.62.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/mozaic/flag/MFlag.vue +1 -1
- package/src/components/projects/project-attributes/PbProjectAttributes.vue +21 -4
- package/src/components/projects/project-hub/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-projects-pb-project-hub-/360/237/246/240-features-project-attributes-showcase-with-project-attributes-1-snap.png +0 -0
- package/src/components/question/configurations-import/ConfigurationsImport.ts +3 -0
- package/src/components/rework/alert/MPbAlert.vue +7 -3
- 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/alert/default-payload.json +20 -2
- package/src/components/rework/cards/MPbCards.vue +2 -2
- package/src/components/rework/exit-options/MPbExitOptions.vue +7 -1
- package/src/components/rework/question/configurations-import/ConfigurationsImport.ts +37 -0
- package/src/components/rework/question/configurations-import/MPbConfigurationsImport.stories.mdx +163 -0
- package/src/components/rework/question/configurations-import/MPbConfigurationsImport.vue +520 -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-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-error-while-importing-simulation-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/rework/question/configurations-import/default-payload.json +55 -0
- package/src/components/rework/question/upload-document/MPbUploadDocument.vue +5 -1
- package/src/components/rework/question/upload-document/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-rework-questions-m-pb-upload-document-/360/237/246/240-101-sandbox-1-snap.png +0 -0
- package/src/components/rework/question/upload-document/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-rework-questions-m-pb-upload-document-/360/237/246/240-feature-show-more-documents-1-snap.png +0 -0
- package/src/components/rework/question/upload-document/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-rework-questions-m-pb-upload-document-/360/237/246/240-feature-start-open-1-snap.png +0 -0
- package/src/components/rework/question/upload-document/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-rework-questions-m-pb-upload-document-/360/237/246/240-pictures-1-snap.png +0 -0
- package/src/components/scenario/PbScenario.vue +4 -2
- package/src/components/scenario/scenarii/appointment-qualification-bathroom.json +206 -231
- package/src/components/trezor/PbTrezor.vue +0 -41
- package/src/components/trezor/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-trezor-pb-trezor-/360/237/246/240-101-sandbox-1-snap.png +0 -0
- package/src/services/api/mocks/jsons/configurations.json +1 -1
- package/src/services/api/mocks/jsons/projects.json +10 -0
package/package.json
CHANGED
|
@@ -101,9 +101,7 @@
|
|
|
101
101
|
/>
|
|
102
102
|
</template>
|
|
103
103
|
|
|
104
|
-
<div class="pb-project-attributes__section-title">
|
|
105
|
-
<h2>Les éléments que vous souhaitez installer</h2>
|
|
106
|
-
</div>
|
|
104
|
+
<div class="pb-project-attributes__section-title">Les éléments que vous souhaitez installer</div>
|
|
107
105
|
|
|
108
106
|
<ul class="pb-project-attributes__works">
|
|
109
107
|
<template v-for="[attributeId, attribute] of displayedProjectAttributes" :key="attributeId">
|
|
@@ -127,6 +125,16 @@
|
|
|
127
125
|
</template>
|
|
128
126
|
</template>
|
|
129
127
|
</ul>
|
|
128
|
+
|
|
129
|
+
<div class="pb-project-attributes__section-title">Détails</div>
|
|
130
|
+
|
|
131
|
+
<div
|
|
132
|
+
class="pb-project-attributes__details"
|
|
133
|
+
v-for="[attributeId, attribute] of displayedProjectAttributes"
|
|
134
|
+
:key="attributeId"
|
|
135
|
+
>
|
|
136
|
+
<p v-if="attributeId === 'comment'" v-html="attribute.value"></p>
|
|
137
|
+
</div>
|
|
130
138
|
</m-flexy>
|
|
131
139
|
</template>
|
|
132
140
|
|
|
@@ -202,10 +210,19 @@ $responsive-breakpoint: 'l';
|
|
|
202
210
|
&__section-title {
|
|
203
211
|
width: 100%;
|
|
204
212
|
@include set-font-face('semi-bold');
|
|
205
|
-
@include set-font-scale('
|
|
213
|
+
@include set-font-scale('07', 'm');
|
|
206
214
|
|
|
207
215
|
color: $color-grey-800;
|
|
208
216
|
margin-left: $mu100;
|
|
217
|
+
margin-top: $mu250;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
&__details {
|
|
221
|
+
padding: 0 $mu100;
|
|
222
|
+
|
|
223
|
+
p {
|
|
224
|
+
@include set-font-scale('06', 'm');
|
|
225
|
+
}
|
|
209
226
|
}
|
|
210
227
|
|
|
211
228
|
&__works {
|
|
@@ -19,6 +19,8 @@ export interface ConfigurationsImportSkippable {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export interface ConfigurationsImportViewModel {
|
|
22
|
+
redirectLink: any;
|
|
23
|
+
callToActions: any;
|
|
22
24
|
label: string;
|
|
23
25
|
backLink?: string;
|
|
24
26
|
notificationPayload: {
|
|
@@ -31,6 +33,7 @@ export interface ConfigurationsImportViewModel {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
export interface ConfigurationsImportPayload {
|
|
36
|
+
[x: string]: any;
|
|
34
37
|
viewModel: ConfigurationsImportViewModel;
|
|
35
38
|
skippable: ConfigurationsImportSkippable[];
|
|
36
39
|
multiSelect: ConfigurationsImportMultiSelect;
|
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
<div class="m-pb-alert__title">
|
|
4
4
|
{{ payload.viewModel.title }}
|
|
5
5
|
</div>
|
|
6
|
-
<m-notification
|
|
7
|
-
|
|
6
|
+
<m-notification
|
|
7
|
+
v-if="payload.viewModel.notification"
|
|
8
|
+
:title="payload.viewModel.notification.title"
|
|
9
|
+
:type="payload.viewModel.type"
|
|
10
|
+
>
|
|
11
|
+
<p>{{ payload.viewModel.notification.content }}</p>
|
|
8
12
|
</m-notification>
|
|
9
13
|
|
|
10
14
|
<div class="m-pb-alert__exit-options">
|
|
@@ -21,7 +25,7 @@
|
|
|
21
25
|
:imgSrc="options.viewModel.image"
|
|
22
26
|
>
|
|
23
27
|
<template #footer>
|
|
24
|
-
<m-button label="
|
|
28
|
+
<m-button :label="options.viewModel.button.label" size="s" theme="bordered-primary-02" />
|
|
25
29
|
</template>
|
|
26
30
|
</m-card>
|
|
27
31
|
</div>
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
"title": "Voulez-vous télécharger vos plans plus tard ?",
|
|
4
4
|
"type": "warning",
|
|
5
5
|
"exitOptionsTitle": "Réaliser rapidement votre plan :",
|
|
6
|
+
"notification": {
|
|
7
|
+
"title": "Envoyez votre plan au plus tard 48h avant le rendez-vous.",
|
|
8
|
+
"content": "Nous avons besoin d’un plan pour connaitre les mesures et ouvertures de votre salle de bain actuelle. Sans ces informations, nous serons obligés d'annuler le rendez-vous."
|
|
9
|
+
},
|
|
6
10
|
"exitOptions": [
|
|
7
11
|
{
|
|
8
12
|
"code": "CARD-1",
|
|
@@ -10,7 +14,14 @@
|
|
|
10
14
|
"url": "https://www.leroymerlin.fr/produits/cuisine/cuisine-equipee-delinia-id/",
|
|
11
15
|
"image": "https://storage.googleapis.com/project-booster-media/kitchen/kitchen-range.jpeg",
|
|
12
16
|
"title": "Découvrir nos gammes de cuisines",
|
|
13
|
-
"subtitle": "Découvrir nos gammes de cuisines"
|
|
17
|
+
"subtitle": "Découvrir nos gammes de cuisines",
|
|
18
|
+
"button": {
|
|
19
|
+
"label": "Regarder le tutoriel video",
|
|
20
|
+
"href": "",
|
|
21
|
+
"nextStep": {
|
|
22
|
+
"code": ""
|
|
23
|
+
}
|
|
24
|
+
}
|
|
14
25
|
}
|
|
15
26
|
},
|
|
16
27
|
{
|
|
@@ -19,7 +30,14 @@
|
|
|
19
30
|
"url": "https://www.leroymerlin.fr/produits/cuisine/cuisine-equipee-delinia-id/",
|
|
20
31
|
"image": "https://storage.googleapis.com/project-booster-media/kitchen/kitchen-range.jpeg",
|
|
21
32
|
"title": "Découvrir nos gammes de cuisines",
|
|
22
|
-
"subtitle": "Découvrir nos gammes de cuisines"
|
|
33
|
+
"subtitle": "Découvrir nos gammes de cuisines",
|
|
34
|
+
"button": {
|
|
35
|
+
"label": "Accéder à l’outil",
|
|
36
|
+
"href": "",
|
|
37
|
+
"nextStep": {
|
|
38
|
+
"code": ""
|
|
39
|
+
}
|
|
40
|
+
}
|
|
23
41
|
}
|
|
24
42
|
}
|
|
25
43
|
]
|
|
@@ -147,10 +147,16 @@ const isValidCondition = (conditions: any) => {
|
|
|
147
147
|
@import 'pb-variables';
|
|
148
148
|
@import '../styles/global.scss';
|
|
149
149
|
|
|
150
|
+
$responsive-breakpoint: 'm';
|
|
151
|
+
|
|
150
152
|
.m-pb-exit-options {
|
|
151
|
-
width:
|
|
153
|
+
width: 100%;
|
|
152
154
|
margin: 4rem auto;
|
|
153
155
|
|
|
156
|
+
@include set-from-screen($responsive-breakpoint) {
|
|
157
|
+
width: 724px;
|
|
158
|
+
}
|
|
159
|
+
|
|
154
160
|
&__title {
|
|
155
161
|
@include set-font-scale('08', 'm');
|
|
156
162
|
@include set-font-face('semi-bold');
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ScenarioStepNextStep } from '@/types/pb/Scenario';
|
|
2
|
+
|
|
3
|
+
export interface ConfigurationsImportMultiSelectAction {
|
|
4
|
+
label: string;
|
|
5
|
+
nextStep: ScenarioStepNextStep;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ConfigurationsImportMultiSelect {
|
|
9
|
+
actions: Map<string, ConfigurationsImportMultiSelectAction>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ConfigurationsImportSkippable {
|
|
13
|
+
isAnswer: boolean;
|
|
14
|
+
label: string;
|
|
15
|
+
theme: string;
|
|
16
|
+
width: string;
|
|
17
|
+
widthFromM: string;
|
|
18
|
+
nextStep: ScenarioStepNextStep;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ConfigurationsImportViewModel {
|
|
22
|
+
label: string;
|
|
23
|
+
backLink?: string;
|
|
24
|
+
notificationPayload: {
|
|
25
|
+
viewModel: {
|
|
26
|
+
successTitle: string;
|
|
27
|
+
errorTitle: string;
|
|
28
|
+
errorText: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ConfigurationsImportPayload {
|
|
34
|
+
viewModel: ConfigurationsImportViewModel;
|
|
35
|
+
skippable: ConfigurationsImportSkippable[];
|
|
36
|
+
multiSelect: ConfigurationsImportMultiSelect;
|
|
37
|
+
}
|
package/src/components/rework/question/configurations-import/MPbConfigurationsImport.stories.mdx
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { Story, Meta, ArgsTable, Canvas } from '@storybook/addon-docs';
|
|
2
|
+
import { nestedAppDecorator } from '../../../../../.storybook/nested-app-decorator';
|
|
3
|
+
import { useStore } from 'vuex';
|
|
4
|
+
import PbScenario from '../../../../components/scenario/PbScenario';
|
|
5
|
+
import MPbConfigurationsImport from './MPbConfigurationsImport';
|
|
6
|
+
import DEFAULT_PAYLOAD from './default-payload.json';
|
|
7
|
+
import configurationsStore from '../../../../stores/modules/configurationsStore';
|
|
8
|
+
import projectsStore from '../../../../stores/modules/projectsStore';
|
|
9
|
+
import toolsStore from '../../../../stores/modules/toolsStore';
|
|
10
|
+
import { rest } from 'msw';
|
|
11
|
+
import {
|
|
12
|
+
getConfigurationsByProjectIdResolver,
|
|
13
|
+
getEmptyConfigurationsByProjectIdResolver,
|
|
14
|
+
} from '../../../../services/api/mocks/configurationsMock';
|
|
15
|
+
import { internalServerErrorResolver, notContentResolver } from '../../../../services/api/mocks/commonMock';
|
|
16
|
+
import { getProjectByIdResolver } from '../../../../services/api/mocks/projectsMock';
|
|
17
|
+
|
|
18
|
+
<Meta
|
|
19
|
+
title="Project Booster/Rework/Questions/MPbConfigurationsImport 🦠"
|
|
20
|
+
component={MPbConfigurationsImport}
|
|
21
|
+
argTypes={{
|
|
22
|
+
payload: {
|
|
23
|
+
table: {
|
|
24
|
+
defaultValue: {
|
|
25
|
+
summary: 'object',
|
|
26
|
+
detail: JSON.stringify(DEFAULT_PAYLOAD, null, ' '),
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
control: {
|
|
30
|
+
type: 'object',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
onStepCompleted: {
|
|
34
|
+
action: 'Step completed',
|
|
35
|
+
table: { disable: true },
|
|
36
|
+
},
|
|
37
|
+
}}
|
|
38
|
+
decorators={[
|
|
39
|
+
nestedAppDecorator(
|
|
40
|
+
{
|
|
41
|
+
modules: {
|
|
42
|
+
configurations: configurationsStore,
|
|
43
|
+
projects: projectsStore,
|
|
44
|
+
tools: toolsStore,
|
|
45
|
+
},
|
|
46
|
+
actions: {
|
|
47
|
+
sendEventToBus({}, payload) {
|
|
48
|
+
console.log('Event sent to bus', payload);
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
[{ path: '/steps/:stepCode/previous/:answers', component: PbScenario }],
|
|
53
|
+
),
|
|
54
|
+
]}
|
|
55
|
+
parameters={{
|
|
56
|
+
layout: 'fullscreen',
|
|
57
|
+
}}
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
# 🦠 `MPbConfigurationsImport` - Components
|
|
61
|
+
|
|
62
|
+
[](https://github.com/adeo/project-booster-vue/tree/master/src/components/question)
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
The `MPbConfigurationsImport` allows to linked configurations to a project.
|
|
67
|
+
It is customizable through the payload property. It has the same
|
|
68
|
+
behaviour as the `PbQuestion` component and is designed to work in a scenario.
|
|
69
|
+
|
|
70
|
+
# `PbConfigurationImport` - Component props
|
|
71
|
+
|
|
72
|
+
export const TemplateSandbox = (args, { argTypes }) => ({
|
|
73
|
+
props: Object.keys(argTypes),
|
|
74
|
+
components: { MPbConfigurationsImport },
|
|
75
|
+
setup() {
|
|
76
|
+
const store = useStore();
|
|
77
|
+
store.dispatch('projects/loadProject', '001');
|
|
78
|
+
store.dispatch('configurations/loadConfigurations', { projectId: '001' });
|
|
79
|
+
store.dispatch('configurations/searchConfigurations', '001');
|
|
80
|
+
return { args };
|
|
81
|
+
},
|
|
82
|
+
template: `<m-pb-configurations-import
|
|
83
|
+
:payload="args.payload"
|
|
84
|
+
:show-back-button="args.showBackButton"
|
|
85
|
+
:answers="args.answers"
|
|
86
|
+
:runtime-options="args.runtimeOptions"
|
|
87
|
+
:completed-event-name="args.completedEventName"
|
|
88
|
+
:sticky-bottom-offset="args.stickyBottomOffset"
|
|
89
|
+
@step-completed="args.onStepCompleted"
|
|
90
|
+
/>`,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
<Canvas>
|
|
94
|
+
<Story
|
|
95
|
+
inline={false}
|
|
96
|
+
height="862px"
|
|
97
|
+
name="101 Sandbox"
|
|
98
|
+
args={{ payload: DEFAULT_PAYLOAD }}
|
|
99
|
+
parameters={{
|
|
100
|
+
msw: [
|
|
101
|
+
rest.get('/api/inhabitant-projects/:inhabitantProjectId', getProjectByIdResolver),
|
|
102
|
+
rest.get('/api/simulations', getConfigurationsByProjectIdResolver),
|
|
103
|
+
rest.get(
|
|
104
|
+
'/api/inhabitant-projects/:inhabitantProjectId/simulations',
|
|
105
|
+
getEmptyConfigurationsByProjectIdResolver,
|
|
106
|
+
),
|
|
107
|
+
rest.post('/api/inhabitant-projects/:inhabitantProjectId/simulations/:simulationId', notContentResolver),
|
|
108
|
+
],
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
{TemplateSandbox.bind({})}
|
|
112
|
+
</Story>
|
|
113
|
+
</Canvas>
|
|
114
|
+
|
|
115
|
+
<ArgsTable story="101 Sandbox" />
|
|
116
|
+
|
|
117
|
+
# Simulations already linked to project
|
|
118
|
+
|
|
119
|
+
<Canvas>
|
|
120
|
+
<Story
|
|
121
|
+
inline={false}
|
|
122
|
+
height="862px"
|
|
123
|
+
name="With simulations linked"
|
|
124
|
+
args={{ payload: DEFAULT_PAYLOAD }}
|
|
125
|
+
parameters={{
|
|
126
|
+
msw: [
|
|
127
|
+
rest.get('/api/inhabitant-projects/:inhabitantProjectId', getProjectByIdResolver),
|
|
128
|
+
rest.get('/api/simulations', getConfigurationsByProjectIdResolver),
|
|
129
|
+
rest.get('/api/inhabitant-projects/:inhabitantProjectId/simulations', getConfigurationsByProjectIdResolver),
|
|
130
|
+
rest.post('/api/inhabitant-projects/:inhabitantProjectId/simulations/:simulationId', notContentResolver),
|
|
131
|
+
],
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
{TemplateSandbox.bind({})}
|
|
135
|
+
</Story>
|
|
136
|
+
</Canvas>
|
|
137
|
+
|
|
138
|
+
# Error importing configuration
|
|
139
|
+
|
|
140
|
+
<Canvas>
|
|
141
|
+
<Story
|
|
142
|
+
inline={false}
|
|
143
|
+
height="862px"
|
|
144
|
+
name="Error while importing simulation"
|
|
145
|
+
args={{ payload: DEFAULT_PAYLOAD }}
|
|
146
|
+
parameters={{
|
|
147
|
+
msw: [
|
|
148
|
+
rest.get('/api/inhabitant-projects/:inhabitantProjectId', getProjectByIdResolver),
|
|
149
|
+
rest.get('/api/simulations', getConfigurationsByProjectIdResolver),
|
|
150
|
+
rest.get(
|
|
151
|
+
'/api/inhabitant-projects/:inhabitantProjectId/simulations',
|
|
152
|
+
getEmptyConfigurationsByProjectIdResolver,
|
|
153
|
+
),
|
|
154
|
+
rest.post(
|
|
155
|
+
'/api/inhabitant-projects/:inhabitantProjectId/simulations/:simulationId',
|
|
156
|
+
internalServerErrorResolver,
|
|
157
|
+
),
|
|
158
|
+
],
|
|
159
|
+
}}
|
|
160
|
+
>
|
|
161
|
+
{TemplateSandbox.bind({})}
|
|
162
|
+
</Story>
|
|
163
|
+
</Canvas>
|