project-booster-vue 9.0.0 → 9.0.3

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": "9.0.0",
3
+ "version": "9.0.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -60,7 +60,7 @@
60
60
  "uuid": "8.3.2",
61
61
  "vee-validate": "4.4.5",
62
62
  "velocity-animate": "1.5.2",
63
- "vue": "3.2.21",
63
+ "vue": "3.2.31",
64
64
  "vue-router": "4.0.12",
65
65
  "vue3-cookies": "1.0.6",
66
66
  "vuex": "4.0.2",
@@ -81,21 +81,21 @@
81
81
  "@mswjs/interceptors": "0.12.7",
82
82
  "@semantic-release/changelog": "5.0.1",
83
83
  "@semantic-release/git": "9.0.0",
84
- "@storybook/addon-a11y": "6.4.19",
85
- "@storybook/addon-essentials": "6.4.19",
84
+ "@storybook/addon-a11y": "6.4.20",
85
+ "@storybook/addon-essentials": "6.4.20",
86
86
  "@storybook/addon-knobs": "6.3.1",
87
- "@storybook/addon-links": "6.4.19",
87
+ "@storybook/addon-links": "6.4.20",
88
88
  "@storybook/addon-postcss": "2.0.0",
89
- "@storybook/addon-storyshots": "6.4.19",
90
- "@storybook/addon-storyshots-puppeteer": "6.4.19",
91
- "@storybook/addon-storysource": "6.4.19",
92
- "@storybook/addons": "6.4.19",
93
- "@storybook/builder-webpack5": "6.4.19",
94
- "@storybook/manager-webpack5": "6.4.19",
95
- "@storybook/source-loader": "6.4.19",
96
- "@storybook/storybook-deployer": "2.8.10",
97
- "@storybook/theming": "6.4.19",
98
- "@storybook/vue3": "6.4.19",
89
+ "@storybook/addon-storyshots": "6.4.20",
90
+ "@storybook/addon-storyshots-puppeteer": "6.4.20",
91
+ "@storybook/addon-storysource": "6.4.20",
92
+ "@storybook/addons": "6.4.20",
93
+ "@storybook/builder-webpack5": "6.4.20",
94
+ "@storybook/manager-webpack5": "6.4.20",
95
+ "@storybook/source-loader": "6.4.20",
96
+ "@storybook/storybook-deployer": "2.8.11",
97
+ "@storybook/theming": "6.4.20",
98
+ "@storybook/vue3": "6.4.20",
99
99
  "@testing-library/jest-dom": "5.16.2",
100
100
  "@testing-library/vue": "6.5.1",
101
101
  "@types/axios": "0.14.0",
@@ -125,7 +125,7 @@
125
125
  "@vue/cli-plugin-typescript": "4.5.13",
126
126
  "@vue/cli-plugin-unit-jest": "4.5.16",
127
127
  "@vue/cli-service": "5.0.0-beta.7",
128
- "@vue/compiler-sfc": "3.2.21",
128
+ "@vue/compiler-sfc": "3.2.31",
129
129
  "@vue/eslint-config-prettier": "6.0.0",
130
130
  "@vue/eslint-config-standard": "6.0.0",
131
131
  "@vue/eslint-config-typescript": "10.0.0",
@@ -147,7 +147,7 @@
147
147
  </template>
148
148
 
149
149
  <script lang="ts">
150
- import { ref, computed, onMounted, defineComponent, ComponentPublicInstance } from 'vue';
150
+ import { ref, computed, onMounted, defineComponent, ComponentPublicInstance, ComponentCustomProperties } from 'vue';
151
151
  import { useStore } from 'vuex';
152
152
  import { useRoute, useRouter } from 'vue-router';
153
153
  import { Media } from '../../types/pb/Media';
@@ -164,7 +164,6 @@ import PbStickyFooter from '../sticky-footer/PbStickyFooter.vue';
164
164
  import MEDIA_LIST_PAYLOAD from './list/media-list-payload.json';
165
165
  import MEDIA_DETAIL_PAYLOAD from './detail/media-detail-payload.json';
166
166
  import MEDIA_UPLOAD_PAYLOAD from './upload/media-upload-payload.json';
167
- import { ComponentCustomProperties } from '@vue/runtime-core';
168
167
 
169
168
  const BACK_ICON =
170
169
  'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
@@ -32,7 +32,7 @@
32
32
  "label": "Nom de l'étape",
33
33
  "isTaskName": true,
34
34
  "required": true,
35
- "focus": true,
35
+ "autofocus": true,
36
36
  "order": 1
37
37
  },
38
38
  "TASK_CUSTOM__OPTION-NOTE": {
@@ -374,7 +374,7 @@ export default defineComponent({
374
374
  return Array.isArray(this.payload.skippable) ? this.payload.skippable : [this.payload.skippable];
375
375
  },
376
376
  hasAnswersSelected() {
377
- return Object.values(this.selectedAnswers).findIndex((answerValue) => answerValue) > -1;
377
+ return Object.values(Object.fromEntries(this.selectedAnswers)).findIndex((answerValue) => answerValue) > -1;
378
378
  },
379
379
  },
380
380
 
@@ -541,9 +541,9 @@ export default defineComponent({
541
541
  validMultiSelect(multiSelectOptions: ScenarioStepMultiSelectAction) {
542
542
  const answers = [];
543
543
 
544
- for (const answerCode in this.selectedAnswers) {
544
+ for (const answerCode in Object.fromEntries(this.selectedAnswers)) {
545
545
  if (this.selectedAnswers.get(answerCode)) {
546
- answers.push({ ...this.payload.answers.get(answerCode), selected: true });
546
+ answers.push({ ...this.questionPossibleAnswers.get(answerCode), selected: true });
547
547
  }
548
548
  }
549
549
 
@@ -559,11 +559,11 @@ export default defineComponent({
559
559
  nextStep: button.nextStep,
560
560
  });
561
561
  },
562
- resetMultiSelect(answers: Map<string, ScenarioStepAnswer>) {
562
+ resetMultiSelect(answers: Record<string, ScenarioStepAnswer>) {
563
563
  this.initAnswersSelectedState(answers);
564
564
  this.$forceUpdate();
565
565
  },
566
- initAnswersSelectedState(answers: Map<string, ScenarioStepAnswer>) {
566
+ initAnswersSelectedState(answers: Record<string, ScenarioStepAnswer>) {
567
567
  Object.values(answers).forEach((answer) => {
568
568
  answer.selected = false;
569
569
  });
@@ -594,20 +594,19 @@ export default defineComponent({
594
594
  let areMultiselectButtonsDisplayed = false;
595
595
 
596
596
  if (this.payload?.multiSelect?.actions) {
597
- const actions = new Map<string, ScenarioStepMultiSelectAction>(
598
- Object.entries(this.payload?.multiSelect?.actions),
597
+ areMultiselectButtonsDisplayed = !!(
598
+ this.payload?.multiSelect?.actions['VALIDATE'] ||
599
+ (!!this.payload?.multiSelect?.actions['RESET'] && !!this.questionPossibleAnswers)
599
600
  );
600
- areMultiselectButtonsDisplayed =
601
- (!!actions.get('VALIDATE') || !!actions.get('RESET')) && !!this.questionPossibleAnswers;
602
601
  }
603
602
 
604
603
  return areMultiselectButtonsDisplayed;
605
604
  },
606
605
  isValidateMultiselectButtonDisplayed() {
607
- return this.payload?.multiSelect?.actions.get('VALIDATE') && this.questionPossibleAnswers;
606
+ return this.payload?.multiSelect?.actions['VALIDATE'] && this.questionPossibleAnswers;
608
607
  },
609
608
  isResetMultiselectButtonDisplayed() {
610
- return this.payload?.multiSelect?.actions.get('RESET') && this.questionPossibleAnswers;
609
+ return this.payload?.multiSelect?.actions['RESET'] && this.questionPossibleAnswers;
611
610
  },
612
611
  isSkipButtonsDisplayed() {
613
612
  return this.payload?.skippable;
@@ -227,7 +227,6 @@ export default defineComponent({
227
227
  },
228
228
  updateHeaderHeight() {
229
229
  this.headerHeight = this.$refs?.pbCitySearchHeader?.$el?.offsetHeight;
230
- console.log(this.headerHeight);
231
230
  },
232
231
  decorate(valueToDecorate: string, defaultValue = '') {
233
232
  if (valueToDecorate) {
@@ -138,7 +138,7 @@
138
138
  </template>
139
139
 
140
140
  <script lang="ts">
141
- import { defineComponent, computed, onMounted, ref, PropType, Ref } from 'vue';
141
+ import { defineComponent, computed, onMounted, ref, PropType, Ref, ComponentCustomProperties } from 'vue';
142
142
  import objectPath from 'object-path';
143
143
  import MButton from '../../mozaic/buttons/MButton.vue';
144
144
  import MContainer from '../../mozaic/grid/MContainer.vue';
@@ -150,7 +150,6 @@ import PbCard from '../../cards/PbCard.vue';
150
150
  import PbMediaUpload from '../../media/upload/PbMediaUpload.vue';
151
151
  import PbStickyFooter from '../../sticky-footer/PbStickyFooter.vue';
152
152
  import { useStore } from 'vuex';
153
- import { ComponentCustomProperties } from '@vue/runtime-core';
154
153
  import {
155
154
  UploadDocumentMultiSelectAction,
156
155
  UploadDocumentPayload,
@@ -300,15 +300,6 @@ export default defineComponent({
300
300
  }
301
301
  };
302
302
  const emitEventToPipeline = (code: string, payload = {}) => {
303
- // I don't know why there is a constructor, but it fucks up everything, so... dirty hack...
304
- const answers = Object.entries(state.value.answers)
305
- .filter(([key]) => key !== 'constructor')
306
- .reduce((prev, [key, val]) => {
307
- return {
308
- ...prev,
309
- [key]: val,
310
- };
311
- }, {});
312
303
  /**
313
304
  * Emitted when a significant event occurs in the scenario
314
305
  * @event scenario-event
@@ -317,7 +308,7 @@ export default defineComponent({
317
308
  code,
318
309
  payload,
319
310
  context: {
320
- answers,
311
+ answers: state.value.answers,
321
312
  currentStep: state.value.currentStep,
322
313
  stepIndex: state.value.history.stepIndex,
323
314
  stepHistory: state.value.history.steps,
@@ -95,8 +95,8 @@
95
95
  :placeholder="decorateValue(option.placeholder)"
96
96
  v-model="tempOptionValues[decorateValue(option.id)]"
97
97
  :valid="tempOptionValues[decorateValue(option.id)] != decorateValue(option.value)"
98
- :required="decorateValue(option.required)"
99
- :autofocus="decorateValue(option.focus)"
98
+ :required="!option.required || decorateValue(option.required) === 'false' ? false : true"
99
+ :autofocus="!option.focus || decorateValue(option.focus) === 'false' ? false : true"
100
100
  :disabled="readOnly || isTaskDone"
101
101
  @input="checkDirtyState()"
102
102
  />
@@ -108,7 +108,8 @@
108
108
  :placeholder="decorateValue(option.placeholder)"
109
109
  v-model="tempOptionValues[decorateValue(option.id)]"
110
110
  :valid="tempOptionValues[decorateValue(option.id)] != decorateValue(option.value)"
111
- :autofocus="decorateValue(option.focus)"
111
+ :required="!option.required || decorateValue(option.required) === 'false' ? false : true"
112
+ :autofocus="!option.focus || decorateValue(option.focus) === 'false' ? false : true"
112
113
  :disabled="readOnly || isTaskDone"
113
114
  @input="checkDirtyState()"
114
115
  />
@@ -120,7 +121,8 @@
120
121
  :label="decorateValue(option.label)"
121
122
  v-model="tempOptionValues[decorateValue(option.id)]"
122
123
  :valid="tempOptionValues[decorateValue(option.id)] != decorateValue(option.value)"
123
- :autofocus="decorateValue(option.focus)"
124
+ :required="!option.required || decorateValue(option.required) === 'false' ? false : true"
125
+ :autofocus="!option.focus || decorateValue(option.focus) === 'false' ? false : true"
124
126
  :disabled="readOnly || isTaskDone"
125
127
  @input="checkDirtyState()"
126
128
  />
@@ -227,7 +229,7 @@ export default defineComponent({
227
229
 
228
230
  const dirty = ref(false);
229
231
  const tempTask = ref<Task>();
230
- const tempOptionValues = ref<Map<string, string>>(new Map<string, string>());
232
+ const tempOptionValues = ref<Record<string, string>>({} as Record<string, string>);
231
233
  const bodyShadowTopOpacity = ref(0);
232
234
  const bodyShadowBottomOpacity = ref(0);
233
235
 
@@ -301,9 +303,9 @@ export default defineComponent({
301
303
  section.options.forEach((option: TaskSectionOption) => {
302
304
  if (tempTask.value?.optionValues && tempTask.value.optionValues[decorateValue(option.id)]) {
303
305
  const taskId = decorateValue(option.id);
304
- tempOptionValues.value.set(taskId, tempTask.value?.optionValues[taskId] ?? '');
306
+ tempOptionValues.value[taskId] = tempTask.value?.optionValues[taskId] ?? '';
305
307
  } else {
306
- tempOptionValues.value.set(decorateValue(option.id), decorateValue(option.value!));
308
+ tempOptionValues.value[decorateValue(option.id)] = decorateValue(option.value!);
307
309
  }
308
310
  });
309
311
  }
@@ -318,8 +320,8 @@ export default defineComponent({
318
320
  if (section?.options) {
319
321
  for (const option of section?.options) {
320
322
  if (
321
- !isEqual(tempOptionValues.value.get(decorateValue(option.id)), decorateValue(option.value!)) ||
322
- (tempOptionValues.value.get(decorateValue(option.id)) && !option.value)
323
+ !isEqual(tempOptionValues.value[decorateValue(option.id)], decorateValue(option.value!)) ||
324
+ (tempOptionValues.value[decorateValue(option.id)] && !option.value)
323
325
  ) {
324
326
  tempDirty = true;
325
327
  break;
@@ -350,7 +352,7 @@ export default defineComponent({
350
352
  for (const section of tempTask.value.viewModel.sections) {
351
353
  if (section?.options) {
352
354
  for (const option of section?.options) {
353
- const newValue = tempOptionValues.value.get(decorateValue(option.id));
355
+ const newValue = tempOptionValues.value[decorateValue(option.id)];
354
356
  const sanitizedNewValue = newValue !== undefined ? newValue : undefined ?? '';
355
357
  const optionValues = tempTask.value?.optionValues ?? {};
356
358
  optionValues[decorateValue(option.id)] = sanitizedNewValue;
@@ -496,8 +498,6 @@ export default defineComponent({
496
498
  pbTaskDetailsBodyContent,
497
499
  };
498
500
  },
499
-
500
- methods: {},
501
501
  });
502
502
  </script>
503
503
 
@@ -27,6 +27,7 @@
27
27
  "id": "TASK_CUSTOM__OPTION-NAME",
28
28
  "label": "Nom de l'étape",
29
29
  "required": "true",
30
+ "autofocus": "true",
30
31
  "focus": "true",
31
32
  "order": 1
32
33
  },
@@ -29,6 +29,7 @@
29
29
  "placeholder": "Etape",
30
30
  "id": "TASK_CUSTOM__OPTION-NAME",
31
31
  "label": "Nom de l'étape",
32
+ "autofocus": "true",
32
33
  "required": true
33
34
  },
34
35
  {
@@ -114,6 +115,7 @@
114
115
  "placeholder": "Etape",
115
116
  "id": "TASK_CUSTOM__OPTION-NAME",
116
117
  "label": "Nom de l'étape",
118
+ "autofocus": "true",
117
119
  "required": true
118
120
  },
119
121
  {
@@ -213,6 +213,7 @@ export const projectsListStoreOptions = {
213
213
  projects = await getAllProjects(0, state.currentProjectsPage * state.projectsPerPageCount);
214
214
  }
215
215
  commit('setProjects', projects.results);
216
+ commit('setTotalProjects', projects.total);
216
217
  if (state.currentProjectsPage * state.projectsPerPageCount >= projects.total) {
217
218
  commit('setHasStillProjects', false);
218
219
  } else {
@@ -76,12 +76,12 @@ export interface ScenarioStepMultiSelectAction {
76
76
  }
77
77
 
78
78
  export interface ScenarioStepMultiSelectOptions {
79
- actions: Map<string, ScenarioStepMultiSelectAction>;
79
+ actions: Record<string, ScenarioStepMultiSelectAction>;
80
80
  }
81
81
 
82
82
  export interface ScenarioStepPayload {
83
83
  viewModel: ScenarioStepViewModel;
84
- answers: Map<string, ScenarioStepAnswer>;
84
+ answers: Record<string, ScenarioStepAnswer>;
85
85
  skippable?: ScenarioStepSkippableOptions[];
86
86
  multiSelect?: ScenarioStepMultiSelectOptions;
87
87
  }