project-booster-vue 9.17.2 → 9.18.0

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,12 +1,14 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "9.17.2",
3
+ "version": "9.18.0",
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
- "lint:js": "vue-cli-service lint --no-fix -- ./",
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,
@@ -186,7 +186,10 @@
186
186
  </div>
187
187
  </m-flex>
188
188
  <m-flex
189
- v-if="isEstimatesDisplayed"
189
+ v-if="
190
+ isEstimatesDisplayed &&
191
+ (isLoadingEstimates || estimatesLoadError || (estimates && estimates.length > 0))
192
+ "
190
193
  class="pb-project-hub__section"
191
194
  direction="column"
192
195
  full-width
@@ -682,7 +682,7 @@ export default defineComponent({
682
682
  },
683
683
  navigateTo(viewModel: ScenarioStepViewModel) {
684
684
  if (viewModel.backLink) {
685
- window.location = decorate(this.answers, this.runtimeOptions, viewModel.backLink, '');
685
+ (<any>window).location = decorate(this.answers, this.runtimeOptions, viewModel.backLink, '');
686
686
  } else {
687
687
  /**
688
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(validation.requiredErrorMessage ?? 'Veuillez remplir ce champ')
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.lengthMinValue ?? 1000000000) - (!validation.thresholdsIncluded ? 0.1 : 0) ?? 1000000000,
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
- let length = ref(null);
152
- let width = ref(null);
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(null);
95
- let optin = ref(null);
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(
@@ -16,135 +16,84 @@ export default {
16
16
  parameters: { storyshots: { disable: true }, layout: 'fullscreen' },
17
17
  };
18
18
 
19
- const generateStory = (jsonLocation) => () => ({
20
- components: {
21
- PbScenario,
22
- },
23
- props: {
24
- runtimeOptions: {
25
- type: Object,
26
- default: () => object('Runtime options', { projectMode: true }),
19
+ const generateStory =
20
+ (jsonLocation, headers = {}) =>
21
+ () => ({
22
+ components: {
23
+ PbScenario,
27
24
  },
28
- },
29
- setup() {
30
- const store = useStore();
31
- store.dispatch('documentsPlans/updateContext', { type: 'DOCUMENT', subType: 'PLAN' });
32
- store.dispatch('documentsPictures/updateContext', { type: 'DOCUMENT', subType: 'PHOTO' });
33
- store.dispatch('estimates/setSummary', {
34
- cost: {},
35
- });
36
- const scenarios = ref(null);
37
- const hasScenario = ref(false);
38
- axios.get(jsonLocation).then((result) => {
39
- scenarios.value = result.data.scenario ?? result.data;
40
- hasScenario.value = true;
41
- });
42
- const handleScenarioEvent = (event) => {
43
- console.log('Event', event);
44
- };
45
- return {
46
- scenarios,
47
- hasScenario,
48
- handleScenarioEvent,
49
- };
50
- },
51
- // eslint-disable-next-line
52
- template:
53
- '<pb-scenario v-if="hasScenario" :scenarios="scenarios" :runtime-options="runtimeOptions" @scenario-event="handleScenarioEvent" />',
54
- });
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
- );
25
+ props: {
26
+ runtimeOptions: {
27
+ type: Object,
28
+ default: () => object('Runtime options', { projectMode: true }),
29
+ },
30
+ },
31
+ setup() {
32
+ const store = useStore();
33
+ store.dispatch('documentsPlans/updateContext', { type: 'DOCUMENT', subType: 'PLAN' });
34
+ store.dispatch('documentsPictures/updateContext', { type: 'DOCUMENT', subType: 'PHOTO' });
35
+ store.dispatch('estimates/setSummary', {
36
+ cost: {},
37
+ });
38
+ const scenarios = ref(null);
39
+ const hasScenario = ref(false);
40
+ axios.get(jsonLocation, { headers }).then((result) => {
41
+ scenarios.value = result.data.scenario ?? result.data;
42
+ hasScenario.value = true;
43
+ });
44
+ const handleScenarioEvent = (event) => {
45
+ console.log('Event', event);
46
+ };
47
+ return {
48
+ scenarios,
49
+ hasScenario,
50
+ handleScenarioEvent,
51
+ };
52
+ },
53
+ // eslint-disable-next-line
54
+ template:
55
+ '<pb-scenario v-if="hasScenario" :scenarios="scenarios" :runtime-options="runtimeOptions" @scenario-event="handleScenarioEvent" />',
56
+ });
118
57
 
119
58
  export const estimateNewConstructionPrep = generateStory(
120
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/6e3e9d6d-a019-4c1c-8d25-002a4ebfcb46.json',
59
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/6e3e9d6d-a019-4c1c-8d25-002a4ebfcb46',
60
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
121
61
  );
122
62
  export const estimateDressingPrep = generateStory(
123
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/10df6aa4-4ae0-41a0-93e3-dc66eb9d39c8.json',
63
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/10df6aa4-4ae0-41a0-93e3-dc66eb9d39c8',
64
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
124
65
  );
125
66
  export const estimateBookcasePrep = generateStory(
126
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/88d96e4c-685b-4275-8eae-f50828fe4755.json',
67
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/88d96e4c-685b-4275-8eae-f50828fe4755',
68
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
127
69
  );
128
70
  export const estimateKitchenPrep = generateStory(
129
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/068160b2-b28a-46fa-8fd6-4775450fa7b4.json',
71
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/068160b2-b28a-46fa-8fd6-4775450fa7b4',
72
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
130
73
  );
131
74
  export const estimateInsulationPrep = generateStory(
132
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/60100496-92ea-49ab-8a43-c08afa57cd60.json',
75
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/60100496-92ea-49ab-8a43-c08afa57cd60',
76
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
133
77
  );
134
78
  export const estimateTvPrep = generateStory(
135
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/dc5370cf-0761-43a0-8309-ced76be08d8b.json',
79
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/dc5370cf-0761-43a0-8309-ced76be08d8b',
80
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
136
81
  );
137
82
  export const estimateStoragePrep = generateStory(
138
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/e39126db-03f7-4b07-975a-97b4cf603ef1.json',
83
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/e39126db-03f7-4b07-975a-97b4cf603ef1',
84
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
139
85
  );
140
86
  export const estimateHeatingPrep = generateStory(
141
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/eaba8264-620d-475e-830f-89166b49a667.json',
87
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/eaba8264-620d-475e-830f-89166b49a667',
88
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
142
89
  );
143
90
  export const estimateBathroomPrep = generateStory(
144
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/c9c4df50-cbcb-4265-b9a7-6645d3adb03b.json',
91
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/c9c4df50-cbcb-4265-b9a7-6645d3adb03b',
92
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
145
93
  );
146
94
  export const estimateFloorPrep = generateStory(
147
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/LMFR_FLOOR.json',
95
+ 'https://api-prep.adeo.cloud/api-project-booster-budget-estimate/v1/scenarios/LMFR_FLOOR',
96
+ { 'X-gateway-apikey': 'nII0D8gvbudmDONHRJo0wbYKJAytn97x' },
148
97
  );
149
98
 
150
99
  export const projectDeclarationGenericPrep = generateStory(
@@ -176,5 +125,5 @@ export const projectDeclarationWindowPrep = generateStory(
176
125
  );
177
126
 
178
127
  export const appointmentKitchenPrep = generateStory(
179
- 'https://storage.googleapis.com/pb-preprod-adeo-disp-subproject-forms/forms/appointment-qualification-kitchen.json',
128
+ 'https://storage.googleapis.com/pb-preprod-adeo-disp-appointment-qualification-forms/forms/appointment-qualification-kitchen.json',
180
129
  );
package/tsconfig.json CHANGED
@@ -19,6 +19,9 @@
19
19
  "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
20
20
  "resolveJsonModule": true
21
21
  },
22
+ "vueCompilerOptions": {
23
+ "experimentalDisableTemplateSupport": true
24
+ },
22
25
  "include": [
23
26
  "src/**/*.ts",
24
27
  "src/**/*.tsx",