project-booster-vue 8.91.9 → 8.93.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/categories/PbCategoriesSection.vue +0 -2
- package/src/components/configurations/search/PbConfigurationsSearchStore.js +3 -3
- package/src/components/configurations/section/PbConfigurationsSection.stories.mdx +5 -1
- package/src/components/media/upload/PbMediaUpload.vue +0 -2
- package/src/components/mozaic/dialog/MDialog.vue +0 -1
- package/src/components/pedagogy/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-components-/360/237/246/240-pb-pedagogy-101-sandbox-1-snap.png +0 -0
- package/src/components/products/PbProductsStore.js +2 -2
- package/src/components/project-item-save/PbProjectItemSave.vue +0 -2
- package/src/components/project-item-save/PbProjectItemSaveProjectsList.vue +2 -0
- package/src/components/question/list-select/PbListSelect.vue +3 -1
- package/src/components/question/upload-document/PbUploadDocumentForm.vue +0 -2
- package/src/components/restitution/PbRestitution.stories.mdx +31 -1
- package/src/components/restitution/PbRestitution.vue +9 -5
- package/src/components/restitution/PbRestitutionBody.stories.mdx +34 -3
- package/src/components/restitution/PbRestitutionBody.vue +1 -1
- package/src/components/restitution/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-components-/360/237/246/240-pb-restitution-feature-conditional-exit-options-1-snap.png +0 -0
- package/src/components/restitution/restitution-with-conditionnal-exit-options.json +50 -0
- package/src/components/scenario/PbScenario-Demo-Project.stories.js +6 -0
- package/src/components/scenario/PbScenario-Features-Conditional-With-List-Select.stories.json +143 -0
- package/src/components/scenario/PbScenario-Features-Conditional.stories.mdx +14 -2
- package/src/components/scenario/PbScenario-Test-Project.stories.js +22 -19
- package/src/components/scenario/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-scenario-/360/237/246/240-pb-scenario-features-conditional-conditional-scenario-with-cards-1-snap.png +0 -0
- package/src/components/scenario/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-scenario-/360/237/246/240-pb-scenario-features-conditional-conditional-scenario-with-list-select-1-snap.png +0 -0
- package/src/components/tasks/details/PbTaskDetails.vue +12 -14
- package/src/components/tasks/preview/PbTasksPreview.stories.mdx +13 -12
- package/src/pages/project/projects-list/PbProjectsList.stories.js +10 -10
- package/src/pages/project/projects-list/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-to-migrate-components-project-booster-pb-projects-list-showcase-empty-1-snap.png +0 -0
- package/src/pages/project/projects-list/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-to-migrate-components-project-booster-pb-projects-list-showcase-with-projects-1-snap.png +0 -0
- package/src/components/configurations/section/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-components-/360/237/246/240-configurations-/360/237/246/240-pb-configurations-section-feature-loading-1-snap.png +0 -0
- package/src/components/scenario/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-scenario-pb-scenario-features-101-101-simple-scenario-1-snap.png +0 -0
- package/src/components/scenario/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-scenario-pb-scenario-features-conditional-conditional-scenario-1-snap.png +0 -0
- package/src/components/scenario/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-scenario-pb-scenario-features-nested-scenario-nested-scenario-1-snap.png +0 -0
- package/src/components/scenario/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-scenario-pb-scenario-features-reset-answers-reset-answers-scenario-1-snap.png +0 -0
- package/src/components/scenario/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-scenario-pb-scenario-features-slots-slot-scenario-1-snap.png +0 -0
- package/src/components/scenario/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-scenario-pb-scenario-sandbox-1-snap.png +0 -0
- package/src/components/scenario/__snapshots__/storyshots-puppeteer-test-puppeteer-js-image-storyshots-project-booster-scenario-/360/237/246/240-pb-scenario-101-/357/270/217-sandbox-1-snap.png +0 -0
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ let searchConfigurationsFn = ({ commit, dispatch }) => {
|
|
|
7
7
|
|
|
8
8
|
setTimeout(() => {
|
|
9
9
|
dispatch('displayFoundConfigurations');
|
|
10
|
-
},
|
|
10
|
+
}, 200);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
function ConfigurationsSearchStoreOptions(emptyConfigurationList = false) {
|
|
@@ -147,8 +147,8 @@ function ConfigurationsSearchStoreOptions(emptyConfigurationList = false) {
|
|
|
147
147
|
setTimeout(() => {
|
|
148
148
|
dispatch('startLoadingStory');
|
|
149
149
|
}, 300);
|
|
150
|
-
},
|
|
151
|
-
},
|
|
150
|
+
}, 200);
|
|
151
|
+
}, 200);
|
|
152
152
|
},
|
|
153
153
|
|
|
154
154
|
startEmptyStateStory({ commit }) {
|
|
@@ -28,7 +28,11 @@ The `PbConfigurationsSection` component displays a list of configurations with a
|
|
|
28
28
|
## Loading
|
|
29
29
|
|
|
30
30
|
<Canvas>
|
|
31
|
-
<Story
|
|
31
|
+
<Story
|
|
32
|
+
name="Feature - Loading"
|
|
33
|
+
parameters={{ controls: { disable: true }, storyshots: { disable: true } }}
|
|
34
|
+
height="512px"
|
|
35
|
+
>
|
|
32
36
|
{{
|
|
33
37
|
components: { PbConfigurationsSection },
|
|
34
38
|
created() {
|
|
Binary file
|
|
@@ -63,13 +63,13 @@ const pbProductsStore = {
|
|
|
63
63
|
setTimeout(() => {
|
|
64
64
|
commit('addProducts', products);
|
|
65
65
|
commit('setIsLoadingProducts', false);
|
|
66
|
-
},
|
|
66
|
+
}, 0);
|
|
67
67
|
},
|
|
68
68
|
async loadProductsError({ commit, state }) {
|
|
69
69
|
setTimeout(() => {
|
|
70
70
|
commit('addProducts', []);
|
|
71
71
|
commit('setProductsLoadError', true);
|
|
72
|
-
},
|
|
72
|
+
}, 0);
|
|
73
73
|
},
|
|
74
74
|
pushedCardClickEvent({ commit, state }, clickedCardInfo) {
|
|
75
75
|
window.open(clickedCardInfo.url, '_blank');
|
|
@@ -212,6 +212,7 @@ export default {
|
|
|
212
212
|
answersToSubmit.push({
|
|
213
213
|
selected: true,
|
|
214
214
|
value: typeof answer.value === 'string' ? answer.value : answer.key,
|
|
215
|
+
code: answer.key,
|
|
215
216
|
});
|
|
216
217
|
}
|
|
217
218
|
|
|
@@ -221,7 +222,7 @@ export default {
|
|
|
221
222
|
} else if (props.payload?.answers[answersToSubmit[0].value]?.nextStep) {
|
|
222
223
|
nextStep = props.payload.answers[answersToSubmit[0].value].nextStep;
|
|
223
224
|
} else {
|
|
224
|
-
nextStep =
|
|
225
|
+
nextStep = null;
|
|
225
226
|
}
|
|
226
227
|
|
|
227
228
|
/**
|
|
@@ -340,6 +341,7 @@ export default {
|
|
|
340
341
|
itemsListProps,
|
|
341
342
|
skipQuestion,
|
|
342
343
|
submitAnswers,
|
|
344
|
+
decorateBoolean,
|
|
343
345
|
};
|
|
344
346
|
},
|
|
345
347
|
};
|
|
@@ -5,6 +5,7 @@ import DEFAULT_PAYLOAD from './restitution-default.json';
|
|
|
5
5
|
import NO_PRICE_BAR from './restitution-no-pricebar.json';
|
|
6
6
|
import SAVE_ITEM from './restitution-with-save-item.json';
|
|
7
7
|
import EXIT_OPTIONS from './restitution-with-exit-options.json';
|
|
8
|
+
import EXIT_OPTIONS_WITH_CONDITIONNAL from './restitution-with-conditionnal-exit-options.json';
|
|
8
9
|
|
|
9
10
|
<Meta
|
|
10
11
|
title="Project Booster/Components/ 🦠 PbRestitution"
|
|
@@ -139,9 +140,11 @@ export const TemplateSandbox = (args, { argTypes }) => ({
|
|
|
139
140
|
template: `<pb-restitution
|
|
140
141
|
:theme="args.theme"
|
|
141
142
|
:payload="args.payload"
|
|
143
|
+
:answers="args.answers"
|
|
142
144
|
:show-save-estimate="args.showSaveEstimate"
|
|
143
145
|
:runtime-options="args.runtimeOptions"
|
|
144
|
-
:show-back-button="args.showBackButton"
|
|
146
|
+
:show-back-button="args.showBackButton"
|
|
147
|
+
/>`,
|
|
145
148
|
});
|
|
146
149
|
|
|
147
150
|
<Canvas>
|
|
@@ -241,3 +244,30 @@ Restitution theming can be achieved with the `theme` prop or thanks to the `payl
|
|
|
241
244
|
{TemplateSandbox.bind({})}
|
|
242
245
|
</Story>
|
|
243
246
|
</Canvas>
|
|
247
|
+
|
|
248
|
+
## Customize exit options according to previous answers
|
|
249
|
+
|
|
250
|
+
It is possible to customize the cards displayed in the exit options of the restitution.
|
|
251
|
+
|
|
252
|
+
export const previousAnswers = {
|
|
253
|
+
QUESTION_1: [
|
|
254
|
+
{
|
|
255
|
+
code: 'QUESTION_1--ANSWER_1',
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
<Source language="json" code={JSON.stringify(previousAnswers, null, ' ')} />
|
|
261
|
+
|
|
262
|
+
<Canvas>
|
|
263
|
+
<Story
|
|
264
|
+
name="Feature/Conditional exit options"
|
|
265
|
+
parameters={{ controls: { disable: true } }}
|
|
266
|
+
args={{
|
|
267
|
+
payload: EXIT_OPTIONS_WITH_CONDITIONNAL,
|
|
268
|
+
answers: previousAnswers,
|
|
269
|
+
}}
|
|
270
|
+
>
|
|
271
|
+
{TemplateSandbox.bind({})}
|
|
272
|
+
</Story>
|
|
273
|
+
</Canvas>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
v-if="isLoggedIn"
|
|
46
46
|
></pb-project-item-save>
|
|
47
47
|
</m-flex>
|
|
48
|
-
<pb-restitution-exit :exit-options="
|
|
48
|
+
<pb-restitution-exit :exit-options="displayedExitOptions" v-if="displayRestitutionExit" ref="pbRestitutionExit" />
|
|
49
49
|
</m-flex>
|
|
50
50
|
</template>
|
|
51
51
|
|
|
@@ -147,11 +147,16 @@ export default {
|
|
|
147
147
|
return this.runtimeOptions.isLoggedIn === true;
|
|
148
148
|
},
|
|
149
149
|
displayRestitutionExit() {
|
|
150
|
-
return !this.runtimeOptions.projectMode && this.exitOptions;
|
|
150
|
+
return !this.runtimeOptions.projectMode && this.payload?.exitOptions;
|
|
151
151
|
},
|
|
152
152
|
componentTheme() {
|
|
153
153
|
return this.payload?.theme ?? this.theme;
|
|
154
154
|
},
|
|
155
|
+
displayedExitOptions() {
|
|
156
|
+
return this.payload?.exitOptions.filter(
|
|
157
|
+
(exitOption) => !exitOption.conditions || this.areConditionsValid(exitOption.conditions),
|
|
158
|
+
);
|
|
159
|
+
},
|
|
155
160
|
},
|
|
156
161
|
|
|
157
162
|
watch: {
|
|
@@ -173,6 +178,7 @@ export default {
|
|
|
173
178
|
this.showSaveProjectItem = this.showSaveEstimate;
|
|
174
179
|
}
|
|
175
180
|
},
|
|
181
|
+
|
|
176
182
|
mounted() {
|
|
177
183
|
this.updateDisplayedCta();
|
|
178
184
|
this.notifications = [];
|
|
@@ -185,9 +191,6 @@ export default {
|
|
|
185
191
|
return this.areConditionsValid(cta.conditions);
|
|
186
192
|
});
|
|
187
193
|
}
|
|
188
|
-
if (this.payload?.exitOptions) {
|
|
189
|
-
this.exitOptions = this.payload?.exitOptions;
|
|
190
|
-
}
|
|
191
194
|
},
|
|
192
195
|
|
|
193
196
|
areConditionsValid(conditions) {
|
|
@@ -244,6 +247,7 @@ export default {
|
|
|
244
247
|
});
|
|
245
248
|
}
|
|
246
249
|
},
|
|
250
|
+
|
|
247
251
|
handleItemCreated(notification) {
|
|
248
252
|
// eslint-disable-next-line vue/no-mutating-props
|
|
249
253
|
this.runtimeOptions.estimateCreated = true;
|
|
@@ -61,6 +61,11 @@ import { Meta, Canvas, Story, ArgsTable, Source } from '@storybook/addon-docs';
|
|
|
61
61
|
return state.summary;
|
|
62
62
|
},
|
|
63
63
|
},
|
|
64
|
+
actions: {
|
|
65
|
+
sendEventToBus({ commit }, action) {
|
|
66
|
+
console.log('Event sent to bus: ', JSON.stringify(action, null, '\t'));
|
|
67
|
+
},
|
|
68
|
+
},
|
|
64
69
|
},
|
|
65
70
|
[],
|
|
66
71
|
),
|
|
@@ -207,15 +212,41 @@ listenMessage();
|
|
|
207
212
|
|
|
208
213
|
<Canvas>
|
|
209
214
|
<Story
|
|
210
|
-
name="Message on click"
|
|
215
|
+
name="Message on button click"
|
|
211
216
|
args={{
|
|
212
217
|
callToActions: [
|
|
213
218
|
{
|
|
214
219
|
type: 'button',
|
|
215
220
|
label: 'Voir les cuisines Delinia ID',
|
|
216
|
-
href: 'https://www.leroymerlin.fr/v3/p/produits/cuisine/meuble-de-cuisine/cuisine-equipee-l1501755932',
|
|
217
221
|
bordered: true,
|
|
218
222
|
message: 'Voir les cuisines Delinia button clicked',
|
|
223
|
+
action: {
|
|
224
|
+
code: '__END__',
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
}}
|
|
229
|
+
parameters={{ storyshots: { disable: true } }}
|
|
230
|
+
inline={false}
|
|
231
|
+
height="1024px"
|
|
232
|
+
>
|
|
233
|
+
{TemplateSandbox.bind({})}
|
|
234
|
+
</Story>
|
|
235
|
+
</Canvas>
|
|
236
|
+
|
|
237
|
+
<Canvas>
|
|
238
|
+
<Story
|
|
239
|
+
name="Message on link click"
|
|
240
|
+
args={{
|
|
241
|
+
callToActions: [
|
|
242
|
+
{
|
|
243
|
+
type: 'link',
|
|
244
|
+
label: 'Voir les cuisines Delinia ID',
|
|
245
|
+
bordered: true,
|
|
246
|
+
message: 'Voir les cuisines Delinia button clicked',
|
|
247
|
+
action: {
|
|
248
|
+
code: '__END__',
|
|
249
|
+
},
|
|
219
250
|
},
|
|
220
251
|
],
|
|
221
252
|
}}
|
|
@@ -232,7 +263,7 @@ export const listenMessage = function () {
|
|
|
232
263
|
global.window.addEventListener(
|
|
233
264
|
'message',
|
|
234
265
|
(event) => {
|
|
235
|
-
if (event.data === 'Voir les cuisines Delinia button clicked') {
|
|
266
|
+
if (event.data === 'Voir les cuisines Delinia button/link clicked') {
|
|
236
267
|
console.log(event);
|
|
237
268
|
}
|
|
238
269
|
},
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"priceBar": {
|
|
3
|
+
"title": "Votre projet de construction neuve se situe entre",
|
|
4
|
+
"subtitle": "Construire ma nouvelle maison"
|
|
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
|
+
],
|
|
35
|
+
"callToActions": [
|
|
36
|
+
{
|
|
37
|
+
"type": "button",
|
|
38
|
+
"label": "J enregistre mon estimation",
|
|
39
|
+
"bordered": true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "link",
|
|
43
|
+
"label": "Envie d’aller plus loin dans votre projet ? Découvrez nos services",
|
|
44
|
+
"action": {
|
|
45
|
+
"type": "EXIT",
|
|
46
|
+
"code": "SUMMARY"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
@@ -163,6 +163,9 @@ export const estimateHeatingProd = generateStory(
|
|
|
163
163
|
export const estimateBathroomProd = generateStory(
|
|
164
164
|
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/c9c4df50-cbcb-4265-b9a7-6645d3adb03b.json',
|
|
165
165
|
);
|
|
166
|
+
export const estimateFloorProd = generateStory(
|
|
167
|
+
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/LMFR_FLOOR.json',
|
|
168
|
+
);
|
|
166
169
|
|
|
167
170
|
export const projectDeclarationGenericProd = generateStory(
|
|
168
171
|
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-generic-generated.json',
|
|
@@ -219,6 +222,9 @@ export const estimateHeatingPrep = generateStory(
|
|
|
219
222
|
export const estimateBathroomPrep = generateStory(
|
|
220
223
|
'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/c9c4df50-cbcb-4265-b9a7-6645d3adb03b.json',
|
|
221
224
|
);
|
|
225
|
+
export const estimateFloorPrep = generateStory(
|
|
226
|
+
'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/LMFR_FLOOR.json',
|
|
227
|
+
);
|
|
222
228
|
|
|
223
229
|
export const projectDeclarationGenericPrep = generateStory(
|
|
224
230
|
'https://storage.googleapis.com/pb-preprod-adeo-disp-project-declaration-forms/forms/project-declaration-generic-generated.json',
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
{
|
|
2
|
+
"__START__": { "code": "__START__", "type": "SCENARIO", "stepCode": "SCENARIO-1" },
|
|
3
|
+
"SCENARIO-1": { "code": "SCENARIO-1", "type": "SCENARIO", "stepCode": "SCENARIO-1__STEP-1" },
|
|
4
|
+
"SCENARIO-1__STEP-1": {
|
|
5
|
+
"code": "SCENARIO-1__STEP-1",
|
|
6
|
+
"type": "STEP",
|
|
7
|
+
"component": "PbListSelect",
|
|
8
|
+
"nextStep": { "code": "SCENARIO-1__STEP-2" },
|
|
9
|
+
"payload": {
|
|
10
|
+
"viewModel": { "label": "Scenario 1 - Step 1", "actionLabel": "Validate" },
|
|
11
|
+
"answers": {
|
|
12
|
+
"SCENARIO-1__STEP-1--ANSWER-1": {
|
|
13
|
+
"code": "SCENARIO-1__STEP-1--ANSWER-1",
|
|
14
|
+
"viewModel": { "title": "Answer 1" }
|
|
15
|
+
},
|
|
16
|
+
"SCENARIO-1__STEP-1--ANSWER-2": {
|
|
17
|
+
"code": "SCENARIO-1__STEP-1--ANSWER-2",
|
|
18
|
+
"viewModel": { "title": "Answer 2" }
|
|
19
|
+
},
|
|
20
|
+
"SCENARIO-1__STEP-1--ANSWER-3": {
|
|
21
|
+
"code": "SCENARIO-1__STEP-1--ANSWER-3",
|
|
22
|
+
"viewModel": { "title": "Answer 3" }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"SCENARIO-1__STEP-2": {
|
|
28
|
+
"code": "SCENARIO-1__STEP-2",
|
|
29
|
+
"type": "STEP",
|
|
30
|
+
"component": "PbListSelect",
|
|
31
|
+
"nextStep": { "code": "SCENARIO-1__STEP-3" },
|
|
32
|
+
"payload": {
|
|
33
|
+
"viewModel": { "label": "Scenario 1 - Step 2", "actionLabel": "Validate" },
|
|
34
|
+
"answers": {
|
|
35
|
+
"SCENARIO-1__STEP-2--ANSWER-1": {
|
|
36
|
+
"code": "SCENARIO-1__STEP-2--ANSWER-1",
|
|
37
|
+
"viewModel": { "title": "Answer 1" }
|
|
38
|
+
},
|
|
39
|
+
"SCENARIO-1__STEP-2--ANSWER-2": {
|
|
40
|
+
"code": "SCENARIO-1__STEP-2--ANSWER-2",
|
|
41
|
+
"viewModel": { "title": "Answer 2" }
|
|
42
|
+
},
|
|
43
|
+
"SCENARIO-1__STEP-2--ANSWER-3": {
|
|
44
|
+
"code": "SCENARIO-1__STEP-2--ANSWER-3",
|
|
45
|
+
"viewModel": { "title": "Answer 3" }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"SCENARIO-1__STEP-3": {
|
|
51
|
+
"code": "SCENARIO-1__STEP-3",
|
|
52
|
+
"type": "STEP",
|
|
53
|
+
"component": "PbListSelect",
|
|
54
|
+
"nextStep": {
|
|
55
|
+
"conditionals": [
|
|
56
|
+
{
|
|
57
|
+
"conditions": [
|
|
58
|
+
"isAnswerMatching('SCENARIO-1__STEP-1', 'SCENARIO-1__STEP-1--ANSWER-1')",
|
|
59
|
+
"isAnswerMatching('SCENARIO-1__STEP-2', 'SCENARIO-1__STEP-2--ANSWER-1')"
|
|
60
|
+
],
|
|
61
|
+
"nextStep": { "code": "SCENARIO-1__STEP-5" }
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"conditions": [
|
|
65
|
+
"isAnswerMatching('SCENARIO-1__STEP-1', 'SCENARIO-1__STEP-1--ANSWER-2')",
|
|
66
|
+
"isAnswerMatching('SCENARIO-1__STEP-2', 'SCENARIO-1__STEP-2--ANSWER-2')"
|
|
67
|
+
],
|
|
68
|
+
"nextStep": { "code": "__END__" }
|
|
69
|
+
},
|
|
70
|
+
{ "conditions": ["true"], "nextStep": { "code": "SCENARIO-1__STEP-4" } }
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"payload": {
|
|
74
|
+
"viewModel": { "label": "Scenario 1 - Step 3", "actionLabel": "Validate" },
|
|
75
|
+
"answers": {
|
|
76
|
+
"SCENARIO-1__STEP-3--ANSWER-1": {
|
|
77
|
+
"code": "SCENARIO-1__STEP-3--ANSWER-1",
|
|
78
|
+
"viewModel": { "title": "Answer 1" }
|
|
79
|
+
},
|
|
80
|
+
"SCENARIO-1__STEP-3--ANSWER-2": {
|
|
81
|
+
"code": "SCENARIO-1__STEP-3--ANSWER-2",
|
|
82
|
+
"viewModel": { "title": "Answer 2" }
|
|
83
|
+
},
|
|
84
|
+
"SCENARIO-1__STEP-3--ANSWER-3": {
|
|
85
|
+
"code": "SCENARIO-1__STEP-3--ANSWER-3",
|
|
86
|
+
"viewModel": { "title": "Answer 3" }
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"SCENARIO-1__STEP-4": {
|
|
92
|
+
"code": "SCENARIO-1__STEP-4",
|
|
93
|
+
"type": "STEP",
|
|
94
|
+
"component": "PbListSelect",
|
|
95
|
+
"nextStep": { "code": "SCENARIO-1__STEP-5" },
|
|
96
|
+
"payload": {
|
|
97
|
+
"viewModel": { "label": "Scenario 1 - Step 4", "actionLabel": "Validate" },
|
|
98
|
+
"answers": {
|
|
99
|
+
"SCENARIO-1__STEP-4--ANSWER-1": {
|
|
100
|
+
"code": "SCENARIO-1__STEP-4--ANSWER-1",
|
|
101
|
+
"viewModel": { "title": "Answer 1" }
|
|
102
|
+
},
|
|
103
|
+
"SCENARIO-1__STEP-4--ANSWER-2": {
|
|
104
|
+
"code": "SCENARIO-1__STEP-4--ANSWER-2",
|
|
105
|
+
"viewModel": { "title": "Answer 2" }
|
|
106
|
+
},
|
|
107
|
+
"SCENARIO-1__STEP-4--ANSWER-3": {
|
|
108
|
+
"code": "SCENARIO-1__STEP-4--ANSWER-3",
|
|
109
|
+
"viewModel": { "title": "Answer 3" }
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"SCENARIO-1__STEP-5": {
|
|
115
|
+
"code": "SCENARIO-1__STEP-5",
|
|
116
|
+
"type": "STEP",
|
|
117
|
+
"component": "PbListSelect",
|
|
118
|
+
"nextStep": { "code": "__END__" },
|
|
119
|
+
"payload": {
|
|
120
|
+
"viewModel": { "label": "Scenario 1 - Step 5", "actionLabel": "Validate" },
|
|
121
|
+
"answers": {
|
|
122
|
+
"SCENARIO-1__STEP-5--ANSWER-1": {
|
|
123
|
+
"code": "SCENARIO-1__STEP-5--ANSWER-1",
|
|
124
|
+
"viewModel": { "title": "Answer 1" }
|
|
125
|
+
},
|
|
126
|
+
"SCENARIO-1__STEP-5--ANSWER-2": {
|
|
127
|
+
"code": "SCENARIO-1__STEP-5--ANSWER-2",
|
|
128
|
+
"viewModel": { "title": "Answer 2" }
|
|
129
|
+
},
|
|
130
|
+
"SCENARIO-1__STEP-5--ANSWER-3": {
|
|
131
|
+
"code": "SCENARIO-1__STEP-5--ANSWER-3",
|
|
132
|
+
"viewModel": { "title": "Answer 3" }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"__END__": {
|
|
138
|
+
"code": "__END__",
|
|
139
|
+
"type": "STEP",
|
|
140
|
+
"component": "PbListSelect",
|
|
141
|
+
"payload": { "viewModel": { "label": "Fin" } }
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -3,6 +3,7 @@ import { Anchor, Story, Preview, Meta, Props, ArgsTable, Source, Canvas } from '
|
|
|
3
3
|
import PbScenario from './PbScenario';
|
|
4
4
|
import DEFAULT_PAYLOAD from './default-payload.json';
|
|
5
5
|
import conditionalScenarioJson from './PbScenario-Features-Conditional.stories.json';
|
|
6
|
+
import conditionalWithListSelectScenarioJson from './PbScenario-Features-Conditional-With-List-Select.stories.json';
|
|
6
7
|
import { TemplateSandbox } from './PbScenario.stories.mdx';
|
|
7
8
|
import conditionalScenarioSchema from './Conditional-scenario.svg';
|
|
8
9
|
|
|
@@ -99,11 +100,22 @@ You can also use variables from runtimeOptions injected into the scenario.
|
|
|
99
100
|
|
|
100
101
|
<Canvas>
|
|
101
102
|
<Story
|
|
102
|
-
name="Conditional scenario"
|
|
103
|
+
name="Conditional scenario with cards"
|
|
103
104
|
inline={false}
|
|
104
|
-
height="
|
|
105
|
+
height="512px"
|
|
105
106
|
args={{ scenarios: conditionalScenarioJson, minHeight: 'auto' }}
|
|
106
107
|
>
|
|
107
108
|
{TemplateSandbox.bind({})}
|
|
108
109
|
</Story>
|
|
109
110
|
</Canvas>
|
|
111
|
+
|
|
112
|
+
<Canvas>
|
|
113
|
+
<Story
|
|
114
|
+
name="Conditional scenario with list select"
|
|
115
|
+
inline={false}
|
|
116
|
+
height="512px"
|
|
117
|
+
args={{ scenarios: conditionalWithListSelectScenarioJson, minHeight: 'auto' }}
|
|
118
|
+
>
|
|
119
|
+
{TemplateSandbox.bind({})}
|
|
120
|
+
</Story>
|
|
121
|
+
</Canvas>
|
|
@@ -143,60 +143,63 @@ const generateStory = (jsonLocation) => {
|
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
export const estimateNewConstructionKozikaza = generateStory(
|
|
146
|
-
'https://storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
146
|
+
'https://storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/cba6210a-dfba-4556-ad8b-e17a37b029c4.json',
|
|
147
147
|
);
|
|
148
148
|
export const estimateNewConstruction = generateStory(
|
|
149
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
149
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/6e3e9d6d-a019-4c1c-8d25-002a4ebfcb46.json',
|
|
150
150
|
);
|
|
151
151
|
export const estimateDressing = generateStory(
|
|
152
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
152
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/10df6aa4-4ae0-41a0-93e3-dc66eb9d39c8.json',
|
|
153
153
|
);
|
|
154
154
|
export const estimateBookcase = generateStory(
|
|
155
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
155
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/88d96e4c-685b-4275-8eae-f50828fe4755.json',
|
|
156
156
|
);
|
|
157
157
|
export const estimateKitchen = generateStory(
|
|
158
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
158
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/068160b2-b28a-46fa-8fd6-4775450fa7b4.json',
|
|
159
159
|
);
|
|
160
160
|
export const estimateInsulation = generateStory(
|
|
161
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
161
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/60100496-92ea-49ab-8a43-c08afa57cd60.json',
|
|
162
162
|
);
|
|
163
163
|
export const estimateTv = generateStory(
|
|
164
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
164
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/dc5370cf-0761-43a0-8309-ced76be08d8b.json',
|
|
165
165
|
);
|
|
166
166
|
export const estimateStorage = generateStory(
|
|
167
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
167
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/e39126db-03f7-4b07-975a-97b4cf603ef1.json',
|
|
168
168
|
);
|
|
169
169
|
export const estimateHeating = generateStory(
|
|
170
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
170
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/eaba8264-620d-475e-830f-89166b49a667.json',
|
|
171
171
|
);
|
|
172
172
|
export const estimateBathroom = generateStory(
|
|
173
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
173
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/c9c4df50-cbcb-4265-b9a7-6645d3adb03b.json',
|
|
174
|
+
);
|
|
175
|
+
export const estimateFloor = generateStory(
|
|
176
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/LMFR_FLOOR.json',
|
|
174
177
|
);
|
|
175
178
|
|
|
176
179
|
export const projectDeclarationGeneric = generateStory(
|
|
177
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
180
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/project-declaration-generic-generated.json',
|
|
178
181
|
);
|
|
179
182
|
export const projectDeclarationBlind = generateStory(
|
|
180
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
183
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/project-declaration-blind-generated.json',
|
|
181
184
|
);
|
|
182
185
|
export const projectDeclarationCanopy = generateStory(
|
|
183
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
186
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/project-declaration-canopy-generated.json',
|
|
184
187
|
);
|
|
185
188
|
export const projectDeclarationCooling = generateStory(
|
|
186
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
189
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/project-declaration-cooling-generated.json',
|
|
187
190
|
);
|
|
188
191
|
export const projectDeclarationFrontDoor = generateStory(
|
|
189
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
192
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/project-declaration-front-door-generated.json',
|
|
190
193
|
);
|
|
191
194
|
export const projectDeclarationGarageDoor = generateStory(
|
|
192
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
195
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/project-declaration-garage-door-generated.json',
|
|
193
196
|
);
|
|
194
197
|
export const projectDeclarationKitchen = generateStory(
|
|
195
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
198
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/project-declaration-kitchen-generated.json',
|
|
196
199
|
);
|
|
197
200
|
export const projectDeclarationShutter = generateStory(
|
|
198
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
201
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/project-declaration-shutter-generated.json',
|
|
199
202
|
);
|
|
200
203
|
export const projectDeclarationWindow = generateStory(
|
|
201
|
-
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/
|
|
204
|
+
'https:/storage.googleapis.com/pb-dev-adeo-disp-subproject-forms/forms/project-declaration-window-generated.json',
|
|
202
205
|
);
|
|
@@ -384,19 +384,15 @@ export default {
|
|
|
384
384
|
|
|
385
385
|
dirty.value = tempDirty;
|
|
386
386
|
};
|
|
387
|
-
const saveTask = async (
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
*/
|
|
397
|
-
context.emit('save-task', props.task);
|
|
398
|
-
dirty.value = false;
|
|
399
|
-
}
|
|
387
|
+
const saveTask = async () => {
|
|
388
|
+
updateOptionValues();
|
|
389
|
+
/**
|
|
390
|
+
* Emitted to save a task
|
|
391
|
+
* @event save-task
|
|
392
|
+
* @type {Event}
|
|
393
|
+
*/
|
|
394
|
+
context.emit('save-task', props.task);
|
|
395
|
+
dirty.value = false;
|
|
400
396
|
};
|
|
401
397
|
const updateOptionValues = () => {
|
|
402
398
|
if (props.task?.viewModel?.sections) {
|
|
@@ -484,7 +480,9 @@ export default {
|
|
|
484
480
|
return yup.object(options);
|
|
485
481
|
});
|
|
486
482
|
const { handleSubmit, errors, submitCount } = useForm({ validationSchema });
|
|
487
|
-
const handleFormSubmit = handleSubmit((values) => {
|
|
483
|
+
const handleFormSubmit = handleSubmit((values) => {
|
|
484
|
+
saveTask();
|
|
485
|
+
});
|
|
488
486
|
const getErrorsCount = computed(() => {
|
|
489
487
|
let errorsCount = 0;
|
|
490
488
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useStore } from 'vuex';
|
|
1
2
|
import { nestedAppDecorator } from '../../../../.storybook/nested-app-decorator';
|
|
2
3
|
import { Meta, Canvas, Story, ArgsTable, Source } from '@storybook/addon-docs';
|
|
3
4
|
import PbTasksPreview from './PbTasksPreview';
|
|
@@ -40,18 +41,18 @@ The `PbTasksPreview` component display all the task for a planner.
|
|
|
40
41
|
|
|
41
42
|
# `PbTasksPreview` - Component props
|
|
42
43
|
|
|
43
|
-
export const TemplateSandbox = (args, { argTypes }) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
44
|
+
export const TemplateSandbox = (args, { argTypes }) => ({
|
|
45
|
+
props: Object.keys(argTypes),
|
|
46
|
+
components: { PbTasksPreview },
|
|
47
|
+
setup() {
|
|
48
|
+
const store = useStore();
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
store.dispatch('togglePlannerProjectPlannerInitialized');
|
|
51
|
+
}, 2000);
|
|
52
|
+
return { args };
|
|
53
|
+
},
|
|
54
|
+
template: `<pb-tasks-preview :tasks="args.tasks" :tasks-number="args.tasksNumber" style="margin: 0 auto;max-width: 1024px; padding: 0 1rem;" />`,
|
|
55
|
+
});
|
|
55
56
|
|
|
56
57
|
<Canvas>
|
|
57
58
|
<Story name="101 Sandbox" inline={false} args={{ tasks: TASKS.slice() }} height="512px">
|
|
@@ -178,7 +178,7 @@ const storeOptions = {
|
|
|
178
178
|
}
|
|
179
179
|
commit('setCurrentProjectsPage', state.currentProjectsPage + state.projectsPerPageCount);
|
|
180
180
|
commit('setIsLoadingProjects', false);
|
|
181
|
-
},
|
|
181
|
+
}, 300);
|
|
182
182
|
}
|
|
183
183
|
state._bypassProjectsLoad = false;
|
|
184
184
|
|
|
@@ -203,8 +203,8 @@ const storeOptions = {
|
|
|
203
203
|
}
|
|
204
204
|
commit('setCurrentProjectsPage', state.currentProjectsPage + state.projectsPerPageCount);
|
|
205
205
|
commit('setIsLoadingProjects', false);
|
|
206
|
-
},
|
|
207
|
-
},
|
|
206
|
+
}, 300);
|
|
207
|
+
}, 300);
|
|
208
208
|
},
|
|
209
209
|
|
|
210
210
|
loadProjectsEmpty({ commit }) {
|
|
@@ -215,7 +215,7 @@ const storeOptions = {
|
|
|
215
215
|
setTimeout(() => {
|
|
216
216
|
commit('setProjects', projectsListEmpty);
|
|
217
217
|
commit('setIsLoadingProjects', false);
|
|
218
|
-
},
|
|
218
|
+
}, 300);
|
|
219
219
|
},
|
|
220
220
|
|
|
221
221
|
loadProjectsError({ commit }) {
|
|
@@ -224,7 +224,7 @@ const storeOptions = {
|
|
|
224
224
|
|
|
225
225
|
setTimeout(() => {
|
|
226
226
|
commit('setProjectsLoadError', new Error());
|
|
227
|
-
},
|
|
227
|
+
}, 300);
|
|
228
228
|
},
|
|
229
229
|
|
|
230
230
|
loadProject({ commit }, projectId) {
|
|
@@ -245,7 +245,7 @@ const storeOptions = {
|
|
|
245
245
|
commit('setIsLoadingProject', false);
|
|
246
246
|
}
|
|
247
247
|
failedProjectLoadedCounter++;
|
|
248
|
-
},
|
|
248
|
+
}, 300);
|
|
249
249
|
},
|
|
250
250
|
|
|
251
251
|
deleteProject({ commit, state }, projectId) {
|
|
@@ -271,10 +271,10 @@ const storeOptions = {
|
|
|
271
271
|
|
|
272
272
|
setTimeout(() => {
|
|
273
273
|
commit('setIsProjectDeletedSuccessDisplayed', false);
|
|
274
|
-
},
|
|
274
|
+
}, 300);
|
|
275
275
|
}
|
|
276
276
|
failedDeletionCounter++;
|
|
277
|
-
},
|
|
277
|
+
}, 300);
|
|
278
278
|
},
|
|
279
279
|
|
|
280
280
|
retryProjectDeletion({ commit, state }) {
|
|
@@ -290,8 +290,8 @@ const storeOptions = {
|
|
|
290
290
|
setTimeout(() => {
|
|
291
291
|
// Hide save success notification
|
|
292
292
|
commit('setIsProjectDeletedSuccessDisplayed', false);
|
|
293
|
-
},
|
|
294
|
-
},
|
|
293
|
+
}, 300);
|
|
294
|
+
}, 300);
|
|
295
295
|
},
|
|
296
296
|
|
|
297
297
|
resetProjectDeletionError({ commit }) {
|
|
Binary file
|
|
Binary file
|