project-booster-vue 8.122.3 → 8.123.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "8.122.3",
3
+ "version": "8.123.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "test:unit": "vue-cli-service test:unit --forceExit --detectOpenHandles",
@@ -80,21 +80,21 @@
80
80
  "@mswjs/interceptors": "0.12.7",
81
81
  "@semantic-release/changelog": "5.0.1",
82
82
  "@semantic-release/git": "9.0.0",
83
- "@storybook/addon-a11y": "6.4.17",
84
- "@storybook/addon-essentials": "6.4.17",
83
+ "@storybook/addon-a11y": "6.4.18",
84
+ "@storybook/addon-essentials": "6.4.18",
85
85
  "@storybook/addon-knobs": "6.3.1",
86
- "@storybook/addon-links": "6.4.17",
86
+ "@storybook/addon-links": "6.4.18",
87
87
  "@storybook/addon-postcss": "2.0.0",
88
- "@storybook/addon-storyshots": "6.4.17",
89
- "@storybook/addon-storyshots-puppeteer": "6.4.17",
90
- "@storybook/addon-storysource": "6.4.17",
91
- "@storybook/addons": "6.4.17",
92
- "@storybook/builder-webpack5": "6.4.17",
93
- "@storybook/manager-webpack5": "6.4.17",
94
- "@storybook/source-loader": "6.4.17",
88
+ "@storybook/addon-storyshots": "6.4.18",
89
+ "@storybook/addon-storyshots-puppeteer": "6.4.18",
90
+ "@storybook/addon-storysource": "6.4.18",
91
+ "@storybook/addons": "6.4.18",
92
+ "@storybook/builder-webpack5": "6.4.18",
93
+ "@storybook/manager-webpack5": "6.4.18",
94
+ "@storybook/source-loader": "6.4.18",
95
95
  "@storybook/storybook-deployer": "2.8.10",
96
- "@storybook/theming": "6.4.17",
97
- "@storybook/vue3": "6.4.17",
96
+ "@storybook/theming": "6.4.18",
97
+ "@storybook/vue3": "6.4.18",
98
98
  "@testing-library/jest-dom": "5.14.1",
99
99
  "@testing-library/vue": "6.4.2",
100
100
  "@vue/cli": "5.0.0-beta.7",
@@ -166,6 +166,8 @@ export const TemplateSandbox = (args, { argTypes }) => ({
166
166
  args={{
167
167
  storeModuleName: 'documents',
168
168
  payload: DOCUMENT_UPLOAD_PAYLOAD,
169
+ acceptedFileTypes:
170
+ 'image/jpeg, image/png, image/heif, image/heic, image/heif-sequence, image/heic-sequence, application/pdf',
169
171
  }}
170
172
  >
171
173
  {TemplateSandbox.bind({})}
@@ -196,6 +198,8 @@ export const TemplateSandbox = (args, { argTypes }) => ({
196
198
  args={{
197
199
  storeModuleName: 'documents',
198
200
  payload: DOCUMENT_UPLOAD_PAYLOAD,
201
+ acceptedFileTypes:
202
+ 'image/jpeg, image/png, image/heif, image/heic, image/heif-sequence, image/heic-sequence, application/pdf',
199
203
  }}
200
204
  >
201
205
  {TemplateSandbox.bind({})}
@@ -269,7 +269,6 @@ export default {
269
269
  fileName: null,
270
270
  selectedType: null,
271
271
  isRoomPicture: false,
272
- PDF_IMAGE,
273
272
  };
274
273
  },
275
274
 
@@ -436,14 +435,16 @@ export default {
436
435
  this.$store.dispatch('sendEventToBus', { code: 'documentUploadValidation', payload: validationData });
437
436
  this.$store.dispatch(this.storePrefix + 'validateFileData', validationData);
438
437
  this.validationErrors = validationData.validation;
438
+ this.updateMediaPreviewUrl(file);
439
439
  } else {
440
440
  const fileValidChecker = isFileTypeValid(this.acceptedUploadedTypes)(file);
441
441
  if (!fileValidChecker) {
442
442
  this.validationErrors['invalidFileType'] = true;
443
443
  }
444
+ this.mediaPreviewUrl = PDF_IMAGE;
445
+ this.displayAddDialog = true;
444
446
  }
445
447
  this.$store.dispatch(this.storePrefix + 'sendEvent', { eventName: 'qualify-by-the-front', file: file });
446
- this.updateMediaPreviewUrl(file);
447
448
  this.formData.append(fieldName, file, file.name);
448
449
 
449
450
  if (!this.validationErrors || Object.values(this.validationErrors).length === 0) {
@@ -50,6 +50,14 @@ export const summary = {
50
50
  currency: 'EURO',
51
51
  },
52
52
  },
53
+ {
54
+ text: '- Pose d'un ragréage',
55
+ cost: {
56
+ min: 984,
57
+ max: 2853.6,
58
+ currency: 'EURO',
59
+ },
60
+ },
53
61
  ],
54
62
  },
55
63
  {
@@ -64,7 +72,7 @@ export const summary = {
64
72
  {
65
73
  text: '- Budget construction maison',
66
74
  details:
67
- "Ce budget n'inclut pas : le terrain, la viabilisation, l'aménagement extérieur et la taxe d'aménagement.",
75
+ "Ce budget n'inclut pas : le terrain, la viabilisation, l'aménagement extérieur et la taxe d'aménagement.",
68
76
  cost: {
69
77
  min: 651000,
70
78
  max: 1255500,
@@ -75,9 +83,9 @@ export const summary = {
75
83
  },
76
84
  {
77
85
  componentId: 'TAXES',
78
- title: "Taxe d'aménagement",
86
+ title: 'Taxe d'aménagement',
79
87
  details:
80
- "Taxe qui s'applique pour les projets de construction, de reconstruction et d'agrandissement qui nécessitent des autorisations de travaux. Un abattement de 50% est prévu sur les 100 premiers m².",
88
+ "Taxe qui s'applique pour les projets de construction, de reconstruction et d'agrandissement qui nécessitent des autorisations de travaux. Un abattement de 50% est prévu sur les 100 premiers m².",
81
89
  cost: {
82
90
  min: 6299.7,
83
91
  max: 23623.88,
@@ -8,9 +8,7 @@
8
8
  align-items="baseline"
9
9
  class="pb-restitution-block__head"
10
10
  >
11
- <div v-if="component.details" class="pb-restitution-block__details">
12
- {{ component.details }}
13
- </div>
11
+ <div v-if="component.details" class="pb-restitution-block__details" v-html="component.details"></div>
14
12
  </div>
15
13
  <pb-restitution-line
16
14
  v-for="(line, index) in component.lines"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <m-flex :class="`pb-restitution-line`" direction="column">
3
3
  <m-flex full-width>
4
- <div class="pb-restitution-line__label">{{ line.text }}</div>
4
+ <div class="pb-restitution-line__label" v-html="line.text"></div>
5
5
  <m-flex class="pb-restitution-line__price" v-if="line.cost" justify-content="flex-end" wrap>
6
6
  <div v-if="line.cost.min !== line.cost.max" class="pb-restitution-line__price-min">
7
7
  {{ formatPriceRange(line.cost.min, line.cost.max).min }}&nbsp;-&nbsp;
@@ -11,7 +11,7 @@
11
11
  </div>
12
12
  </m-flex>
13
13
  </m-flex>
14
- <div v-if="line.details" class="pb-restitution-line__details">{{ line.details }}</div>
14
+ <div v-if="line.details" class="pb-restitution-line__details" v-html="line.details"></div>
15
15
  </m-flex>
16
16
  </template>
17
17
 
@@ -41,7 +41,7 @@ import conditionalScenarioSchema from './Conditional-scenario.svg';
41
41
 
42
42
  ## Conditional routing
43
43
 
44
- Conditions can be applied to next steps:
44
+ Conditions can be applied to next steps or scenario step code:
45
45
 
46
46
  ```json
47
47
  {
@@ -160,7 +160,7 @@ export default {
160
160
  const stickyBottom = ref(null);
161
161
 
162
162
  const state = ref({
163
- answers: {},
163
+ answers: props.runtimeOptions?.answersToInject ?? {},
164
164
  stepsToResume: [],
165
165
  currentStep: null,
166
166
  displayedStep: null,
@@ -194,7 +194,9 @@ export default {
194
194
  stepToResume = currentScenario;
195
195
  }
196
196
  state.value.stepsToResume.push(stepToResume);
197
- const currentStep = props.scenarios[currentScenario.stepCode];
197
+ const currentStep = currentScenario.stepCode?.conditionals
198
+ ? props.scenarios[computeNextStep(currentScenario.stepCode).code]
199
+ : props.scenarios[currentScenario.stepCode];
198
200
  initStep(currentStep);
199
201
  };
200
202
  const initStep = (step, previousAnswerCode = '__START__') => {
@@ -27,9 +27,15 @@ const saveAnswersByAppointmentQualificationId = async (appointmentQualificationI
27
27
  };
28
28
 
29
29
  const declarationsWithAppointment = async (data) => {
30
- return await axios.post('/api/declarations-with-appointment', data, {
30
+ const response = await axios.post('/api/declarations-with-appointment', data, {
31
31
  headers: { 'Content-Type': 'application/json' },
32
32
  });
33
+
34
+ return JSON.parse(
35
+ JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
36
+ return `: "${he.escape($1)}"`;
37
+ }),
38
+ );
33
39
  };
34
40
 
35
41
  export { declarationsWithAppointment, saveAnswersByAppointmentQualificationId, getAppointmentQualification };
@@ -244,7 +244,7 @@ export default {
244
244
  correlationId: state.sessions.correlationId,
245
245
  };
246
246
  const result = await declarationsWithAppointment(project);
247
- commit('setCurrentAppointmentQualification', result.body);
247
+ commit('setCurrentAppointmentQualification', result);
248
248
  commit('setIsLoadingProject', false);
249
249
  } catch (e) {
250
250
  commit('setCreateProjectError', new Error());
@@ -371,7 +371,7 @@ export const documentsUploadStoreOptions = {
371
371
  parentCorrelationId: rootState?.appointmentQualification?.sessions?.correlationId,
372
372
  inhabitantProjectId: rootState?.appointmentQualification?.currentAppointmentQualification?.inhabitantProjectId,
373
373
  };
374
- if (state.uploadedId) {
374
+ if (state.uploadedId && event.eventName !== 'start') {
375
375
  documentEvent['documentId'] = state.uploadedId;
376
376
  }
377
377
  if (event.eventName === 'qualify-by-the-front') {
@@ -704,7 +704,7 @@ export const projectItemSaveStoreOptions = {
704
704
  name: 'recorded',
705
705
  correlationId,
706
706
  businessUnit: '001',
707
- projectId,
707
+ inhabitantProjectId: projectId,
708
708
  ...metaDataWithDate,
709
709
  };
710
710