project-booster-vue 9.17.1 → 9.17.4
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 +7 -4
- package/src/components/question/PbQuestion.vue +7 -6
- package/src/components/question/configurations-import/PbConfigurationsImport.vue +1 -1
- package/src/components/question/dimensions-input/PbDimensionsInput.vue +5 -5
- package/src/components/question/name-input/PbNameInput.vue +3 -3
- package/src/components/scenario/PbScenario-Demo-Project.stories.js +12 -75
- package/src/components/scenario/scenarii/appointment-qualification-kitchen.json +1 -78
- package/tsconfig.json +3 -0
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-booster-vue",
|
|
3
|
-
"version": "9.17.
|
|
3
|
+
"version": "9.17.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
7
7
|
"test:unit": "vue-cli-service test:unit --forceExit --detectOpenHandles",
|
|
8
8
|
"kozikaza-tokens-build": "env PB_THEME=kozikaza mozaic-tokens-build",
|
|
9
|
-
"
|
|
9
|
+
"check-types": "vue-tsc --noemit",
|
|
10
|
+
"eslint": "eslint",
|
|
11
|
+
"lint:js": "yarn eslint && npm run check-types",
|
|
10
12
|
"lint:js:fix": "vue-cli-service lint --fix -- ./",
|
|
11
13
|
"lint:style": "stylelint '**/*.vue' '**/*.scss'",
|
|
12
14
|
"lint:style:fix": "stylelint '**/*.vue' '**/*.scss' --fix",
|
|
@@ -118,13 +120,13 @@
|
|
|
118
120
|
"@typescript-eslint/eslint-plugin": "4.18.0",
|
|
119
121
|
"@typescript-eslint/parser": "4.18.0",
|
|
120
122
|
"@vue/babel-preset-app": "4.5.13",
|
|
121
|
-
"@vue/compat": "3.2.6",
|
|
122
123
|
"@vue/cli": "5.0.4",
|
|
123
124
|
"@vue/cli-plugin-babel": "5.0.4",
|
|
124
125
|
"@vue/cli-plugin-eslint": "5.0.4",
|
|
125
126
|
"@vue/cli-plugin-typescript": "5.0.4",
|
|
126
127
|
"@vue/cli-plugin-unit-jest": "4.5.16",
|
|
127
128
|
"@vue/cli-service": "5.0.4",
|
|
129
|
+
"@vue/compat": "3.2.6",
|
|
128
130
|
"@vue/compiler-sfc": "3.2.31",
|
|
129
131
|
"@vue/eslint-config-prettier": "6.0.0",
|
|
130
132
|
"@vue/eslint-config-standard": "6.0.0",
|
|
@@ -174,7 +176,8 @@
|
|
|
174
176
|
"tsconfig-paths-webpack-plugin": "3.5.2",
|
|
175
177
|
"typescript": "4.1.6",
|
|
176
178
|
"vue-jest": "5.0.0-alpha.10",
|
|
177
|
-
"vue-loader": "17.0.0"
|
|
179
|
+
"vue-loader": "17.0.0",
|
|
180
|
+
"vue-tsc": "0.34.13"
|
|
178
181
|
},
|
|
179
182
|
"eslintConfig": {
|
|
180
183
|
"fix": false,
|
|
@@ -346,7 +346,7 @@ export const doEval = (
|
|
|
346
346
|
return new Function('getAnswerValue', 'answers', 'defaultValue', 'runtimeOptions', `return ${valueToEval}`).call(
|
|
347
347
|
this,
|
|
348
348
|
getAnswerValue(answers),
|
|
349
|
-
answers,
|
|
349
|
+
Object.fromEntries(answers),
|
|
350
350
|
defaultValue,
|
|
351
351
|
runtimeOptions,
|
|
352
352
|
);
|
|
@@ -358,15 +358,16 @@ export const decorate = (
|
|
|
358
358
|
valueToDecorate: string,
|
|
359
359
|
defaultValue = '',
|
|
360
360
|
) => {
|
|
361
|
+
let decoratedValue = valueToDecorate;
|
|
361
362
|
if (valueToDecorate) {
|
|
362
|
-
|
|
363
|
+
const stringToEval = `\`${valueToDecorate}\``;
|
|
363
364
|
try {
|
|
364
|
-
|
|
365
|
+
decoratedValue = doEval(answers, stringToEval, defaultValue, runtimeOptions);
|
|
365
366
|
} catch (error) {
|
|
366
|
-
|
|
367
|
+
decoratedValue = valueToDecorate || defaultValue;
|
|
367
368
|
}
|
|
368
369
|
}
|
|
369
|
-
return
|
|
370
|
+
return decoratedValue;
|
|
370
371
|
};
|
|
371
372
|
|
|
372
373
|
export default defineComponent({
|
|
@@ -681,7 +682,7 @@ export default defineComponent({
|
|
|
681
682
|
},
|
|
682
683
|
navigateTo(viewModel: ScenarioStepViewModel) {
|
|
683
684
|
if (viewModel.backLink) {
|
|
684
|
-
window.location = decorate(this.answers, this.runtimeOptions, viewModel.backLink, '');
|
|
685
|
+
(<any>window).location = decorate(this.answers, this.runtimeOptions, viewModel.backLink, '');
|
|
685
686
|
} else {
|
|
686
687
|
/**
|
|
687
688
|
* Emitted when go back link is clicked
|
|
@@ -256,7 +256,7 @@ export default defineComponent({
|
|
|
256
256
|
|
|
257
257
|
const navigateTo = (viewModel: ConfigurationsImportViewModel) => {
|
|
258
258
|
if (viewModel.backLink) {
|
|
259
|
-
window.location = decorate(props.answers, props.runtimeOptions, viewModel.backLink);
|
|
259
|
+
(<any>window).location = decorate(props.answers, props.runtimeOptions, viewModel.backLink);
|
|
260
260
|
} else {
|
|
261
261
|
/**
|
|
262
262
|
* Emitted when go back link is clicked
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
</template>
|
|
87
87
|
|
|
88
88
|
<script lang="ts">
|
|
89
|
-
import { defineComponent, computed, onMounted, ComputedRef, PropType } from 'vue';
|
|
89
|
+
import { defineComponent, computed, onMounted, ComputedRef, PropType, Ref } from 'vue';
|
|
90
90
|
import { v4 as uuidv4 } from 'uuid';
|
|
91
91
|
import cloneDeep from 'lodash.clonedeep';
|
|
92
92
|
import merge from 'lodash.merge';
|
|
@@ -117,13 +117,13 @@ const initValidation = (componentId: string, computedPayload: ComputedRef<Dimens
|
|
|
117
117
|
[`text-input-length-${componentId}`]: yup
|
|
118
118
|
.number()
|
|
119
119
|
.typeError(validation.requiredErrorMessage ?? 'Veuillez remplir ce champ')
|
|
120
|
-
.required(
|
|
120
|
+
.required()
|
|
121
121
|
.min(
|
|
122
122
|
(validation.lengthMinValue ?? 0) + (!validation.thresholdsIncluded ? 0.1 : 0) ?? 0,
|
|
123
123
|
validation.lengthMinErrorMessage ?? 'Veuillez saisir un nombre plus grand que ${min}',
|
|
124
124
|
)
|
|
125
125
|
.max(
|
|
126
|
-
(validation.
|
|
126
|
+
(validation.lengthMaxValue ?? 1000000000) - (!validation.thresholdsIncluded ? 0.1 : 0) ?? 1000000000,
|
|
127
127
|
validation.lengthMaxErrorMessage ?? 'Veuillez saisir un nombre plus petit que ${max}',
|
|
128
128
|
),
|
|
129
129
|
[`text-input-width-${componentId}`]: yup
|
|
@@ -148,8 +148,8 @@ const computeDefaultValue = (
|
|
|
148
148
|
answers: Map<string, ScenarioStepAnswer[]>,
|
|
149
149
|
computedPayload: ComputedRef<DimensionsInputPayload>,
|
|
150
150
|
) => {
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
const length: Ref<string | undefined> = ref(undefined);
|
|
152
|
+
const width: Ref<string | undefined> = ref(undefined);
|
|
153
153
|
|
|
154
154
|
if (computedPayload?.value?.value) {
|
|
155
155
|
length.value = decorate(
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
</template>
|
|
46
46
|
|
|
47
47
|
<script lang="ts">
|
|
48
|
-
import { defineComponent, computed, ref, onMounted, ComputedRef, PropType } from 'vue';
|
|
48
|
+
import { defineComponent, computed, ref, onMounted, ComputedRef, PropType, Ref } from 'vue';
|
|
49
49
|
import { v4 as uuidv4 } from 'uuid';
|
|
50
50
|
import { useStore } from 'vuex';
|
|
51
51
|
import { useForm } from 'vee-validate';
|
|
@@ -91,8 +91,8 @@ const computeDefaultValue = (
|
|
|
91
91
|
answers: Map<string, ScenarioStepAnswer[]>,
|
|
92
92
|
computedPayload: ComputedRef<NameInputPayload>,
|
|
93
93
|
) => {
|
|
94
|
-
let name = ref(
|
|
95
|
-
let optin = ref(
|
|
94
|
+
let name: Ref<string | undefined> = ref(undefined);
|
|
95
|
+
let optin: Ref<string | undefined> = ref(undefined);
|
|
96
96
|
|
|
97
97
|
if (computedPayload?.value?.value) {
|
|
98
98
|
name.value = decorate(
|
|
@@ -35,7 +35,7 @@ const generateStory = (jsonLocation) => () => ({
|
|
|
35
35
|
});
|
|
36
36
|
const scenarios = ref(null);
|
|
37
37
|
const hasScenario = ref(false);
|
|
38
|
-
axios.get(jsonLocation).then((result) => {
|
|
38
|
+
axios.get(jsonLocation, { headers: { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' } }).then((result) => {
|
|
39
39
|
scenarios.value = result.data.scenario ?? result.data;
|
|
40
40
|
hasScenario.value = true;
|
|
41
41
|
});
|
|
@@ -53,98 +53,35 @@ const generateStory = (jsonLocation) => () => ({
|
|
|
53
53
|
'<pb-scenario v-if="hasScenario" :scenarios="scenarios" :runtime-options="runtimeOptions" @scenario-event="handleScenarioEvent" />',
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
export const estimateNewConstructionProd = generateStory(
|
|
57
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/6e3e9d6d-a019-4c1c-8d25-002a4ebfcb46.json',
|
|
58
|
-
);
|
|
59
|
-
export const estimateDressingProd = generateStory(
|
|
60
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/10df6aa4-4ae0-41a0-93e3-dc66eb9d39c8.json',
|
|
61
|
-
);
|
|
62
|
-
export const estimateBookcaseProd = generateStory(
|
|
63
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/88d96e4c-685b-4275-8eae-f50828fe4755.json',
|
|
64
|
-
);
|
|
65
|
-
export const estimateKitchenProd = generateStory(
|
|
66
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/068160b2-b28a-46fa-8fd6-4775450fa7b4.json',
|
|
67
|
-
);
|
|
68
|
-
export const estimateInsulationProd = generateStory(
|
|
69
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/60100496-92ea-49ab-8a43-c08afa57cd60.json',
|
|
70
|
-
);
|
|
71
|
-
export const estimateTvProd = generateStory(
|
|
72
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/dc5370cf-0761-43a0-8309-ced76be08d8b.json',
|
|
73
|
-
);
|
|
74
|
-
export const estimateStorageProd = generateStory(
|
|
75
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/e39126db-03f7-4b07-975a-97b4cf603ef1.json',
|
|
76
|
-
);
|
|
77
|
-
export const estimateHeatingProd = generateStory(
|
|
78
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/eaba8264-620d-475e-830f-89166b49a667.json',
|
|
79
|
-
);
|
|
80
|
-
export const estimateBathroomProd = generateStory(
|
|
81
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/c9c4df50-cbcb-4265-b9a7-6645d3adb03b.json',
|
|
82
|
-
);
|
|
83
|
-
export const estimateFloorProd = generateStory(
|
|
84
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/LMFR_FLOOR.json',
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
export const projectDeclarationGenericProd = generateStory(
|
|
88
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-generic-generated.json',
|
|
89
|
-
);
|
|
90
|
-
export const projectDeclarationBlindProd = generateStory(
|
|
91
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-blind-generated.json',
|
|
92
|
-
);
|
|
93
|
-
export const projectDeclarationCanopyProd = generateStory(
|
|
94
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-canopy-generated.json',
|
|
95
|
-
);
|
|
96
|
-
export const projectDeclarationCoolingProd = generateStory(
|
|
97
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-cooling-generated.json',
|
|
98
|
-
);
|
|
99
|
-
export const projectDeclarationFrontDoorProd = generateStory(
|
|
100
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-front-door-generated.json',
|
|
101
|
-
);
|
|
102
|
-
export const projectDeclarationGarageDoorProd = generateStory(
|
|
103
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-garage-door-generated.json',
|
|
104
|
-
);
|
|
105
|
-
export const projectDeclarationKitchenProd = generateStory(
|
|
106
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-kitchen-generated.json',
|
|
107
|
-
);
|
|
108
|
-
export const projectDeclarationShutterProd = generateStory(
|
|
109
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-shutter-generated.json',
|
|
110
|
-
);
|
|
111
|
-
export const projectDeclarationWindowProd = generateStory(
|
|
112
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-project-declaration-forms/forms/project-declaration-window-generated.json',
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
export const appointmentKitchenProd = generateStory(
|
|
116
|
-
'https://storage.googleapis.com/pb-prod-adeo-disp-subproject-forms/forms/appointment-qualification-kitchen.json',
|
|
117
|
-
);
|
|
118
|
-
|
|
119
56
|
export const estimateNewConstructionPrep = generateStory(
|
|
120
|
-
'https://
|
|
57
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/6e3e9d6d-a019-4c1c-8d25-002a4ebfcb46',
|
|
121
58
|
);
|
|
122
59
|
export const estimateDressingPrep = generateStory(
|
|
123
|
-
'https://
|
|
60
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/10df6aa4-4ae0-41a0-93e3-dc66eb9d39c8',
|
|
124
61
|
);
|
|
125
62
|
export const estimateBookcasePrep = generateStory(
|
|
126
|
-
'https://
|
|
63
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/88d96e4c-685b-4275-8eae-f50828fe4755',
|
|
127
64
|
);
|
|
128
65
|
export const estimateKitchenPrep = generateStory(
|
|
129
|
-
'https://
|
|
66
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/068160b2-b28a-46fa-8fd6-4775450fa7b4',
|
|
130
67
|
);
|
|
131
68
|
export const estimateInsulationPrep = generateStory(
|
|
132
|
-
'https://
|
|
69
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/60100496-92ea-49ab-8a43-c08afa57cd60',
|
|
133
70
|
);
|
|
134
71
|
export const estimateTvPrep = generateStory(
|
|
135
|
-
'https://
|
|
72
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/dc5370cf-0761-43a0-8309-ced76be08d8b',
|
|
136
73
|
);
|
|
137
74
|
export const estimateStoragePrep = generateStory(
|
|
138
|
-
'https://
|
|
75
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/e39126db-03f7-4b07-975a-97b4cf603ef1',
|
|
139
76
|
);
|
|
140
77
|
export const estimateHeatingPrep = generateStory(
|
|
141
|
-
'https://
|
|
78
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/eaba8264-620d-475e-830f-89166b49a667',
|
|
142
79
|
);
|
|
143
80
|
export const estimateBathroomPrep = generateStory(
|
|
144
|
-
'https://
|
|
81
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/c9c4df50-cbcb-4265-b9a7-6645d3adb03b',
|
|
145
82
|
);
|
|
146
83
|
export const estimateFloorPrep = generateStory(
|
|
147
|
-
'https://
|
|
84
|
+
'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/LMFR_FLOOR',
|
|
148
85
|
);
|
|
149
86
|
|
|
150
87
|
export const projectDeclarationGenericPrep = generateStory(
|
|
@@ -176,5 +113,5 @@ export const projectDeclarationWindowPrep = generateStory(
|
|
|
176
113
|
);
|
|
177
114
|
|
|
178
115
|
export const appointmentKitchenPrep = generateStory(
|
|
179
|
-
'https://storage.googleapis.com/pb-preprod-adeo-disp-
|
|
116
|
+
'https://storage.googleapis.com/pb-preprod-adeo-disp-appointment-qualification-forms/forms/appointment-qualification-kitchen.json',
|
|
180
117
|
);
|
|
@@ -17,84 +17,7 @@
|
|
|
17
17
|
"MAIN_SCENARIO": {
|
|
18
18
|
"code": "MAIN_SCENARIO",
|
|
19
19
|
"type": "SCENARIO",
|
|
20
|
-
"stepCode": "
|
|
21
|
-
},
|
|
22
|
-
"START_SCENARIO": {
|
|
23
|
-
"code": "START_SCENARIO",
|
|
24
|
-
"type": "STEP",
|
|
25
|
-
"component": "PbAppointmentStartSection",
|
|
26
|
-
"payload": {
|
|
27
|
-
"viewModel": {
|
|
28
|
-
"title": "${runtimeOptions.postQualificationAppointment === false ? 'Gagnez du temps en préparant votre rendez-vous' : 'Préparez votre Rendez-vous.'}"
|
|
29
|
-
},
|
|
30
|
-
"answers": {
|
|
31
|
-
"CONTINUE": {
|
|
32
|
-
"code": "CONTINUE",
|
|
33
|
-
"viewModel": {
|
|
34
|
-
"label": "Continuer"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"LATER": {
|
|
38
|
-
"code": "LATER",
|
|
39
|
-
"viewModel": {
|
|
40
|
-
"label": "Préparer plus tard",
|
|
41
|
-
"theme": "text-primary"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"items": [
|
|
46
|
-
{
|
|
47
|
-
"code": "ITEM-1",
|
|
48
|
-
"viewModel": {
|
|
49
|
-
"title": "Les informations sur votre projet",
|
|
50
|
-
"image": "https://storage.googleapis.com/project-booster-media/vad/liste-etapes/picto_planner-bien-choisir_small_40.svg",
|
|
51
|
-
"imageSize": "small"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"code": "ITEM-2",
|
|
56
|
-
"viewModel": {
|
|
57
|
-
"title": "Un plan aux mesures de votre pièce (dessin, document, plan 3D...)",
|
|
58
|
-
"image": "https://storage.googleapis.com/project-booster-media/vad/liste-etapes/picto_planner-plan_40.svg",
|
|
59
|
-
"imageSize": "small"
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"code": "ITEM-3",
|
|
64
|
-
"viewModel": {
|
|
65
|
-
"title": "Des photos de votre cuisine",
|
|
66
|
-
"image": "https://storage.googleapis.com/project-booster-media/vad/picto_planner-penser_photo-small.svg",
|
|
67
|
-
"imageSize": "small"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
"nextStep": {
|
|
73
|
-
"conditionals": [
|
|
74
|
-
{
|
|
75
|
-
"conditions": ["isAnswerMatching('START_SCENARIO', 'CONTINUE')"],
|
|
76
|
-
"nextStep": {
|
|
77
|
-
"code": "LMFR_QUESTION_SCENARIO"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"conditions": [
|
|
82
|
-
"isAnswerMatching('START_SCENARIO', 'LATER') && runtimeOptions.postQualificationAppointment === true"
|
|
83
|
-
],
|
|
84
|
-
"nextStep": {
|
|
85
|
-
"code": "START_LATER"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"conditions": [
|
|
90
|
-
"isAnswerMatching('START_SCENARIO', 'LATER') && runtimeOptions.postQualificationAppointment === false"
|
|
91
|
-
],
|
|
92
|
-
"nextStep": {
|
|
93
|
-
"code": "LMFR_QUESTION_QUALIFICATION_EXIT"
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
]
|
|
97
|
-
}
|
|
20
|
+
"stepCode": "LMFR_QUESTION_WORK_START_DATE"
|
|
98
21
|
},
|
|
99
22
|
"LMFR_QUESTION_QUALIFICATION_EXIT": {
|
|
100
23
|
"code": "LMFR_QUESTION_QUALIFICATION_EXIT",
|