project-booster-vue 9.0.0 → 9.0.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 +16 -16
- package/src/components/media/PbMedia.vue +1 -2
- package/src/components/projects/project-hub/plannerTask.json +1 -1
- package/src/components/question/PbQuestion.vue +8 -9
- package/src/components/scenario/PbScenario.vue +1 -10
- package/src/components/tasks/details/PbTaskDetails.vue +12 -12
- package/src/components/tasks/task-to-create-generic-planner.json +1 -0
- package/src/components/tasks/tasks-generic-planner.json +2 -0
- package/src/stores/modules/projectsStore.ts +1 -0
- package/src/types/pb/Scenario.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-booster-vue",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.1",
|
|
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.
|
|
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.
|
|
85
|
-
"@storybook/addon-essentials": "6.4.
|
|
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.
|
|
87
|
+
"@storybook/addon-links": "6.4.20",
|
|
88
88
|
"@storybook/addon-postcss": "2.0.0",
|
|
89
|
-
"@storybook/addon-storyshots": "6.4.
|
|
90
|
-
"@storybook/addon-storyshots-puppeteer": "6.4.
|
|
91
|
-
"@storybook/addon-storysource": "6.4.
|
|
92
|
-
"@storybook/addons": "6.4.
|
|
93
|
-
"@storybook/builder-webpack5": "6.4.
|
|
94
|
-
"@storybook/manager-webpack5": "6.4.
|
|
95
|
-
"@storybook/source-loader": "6.4.
|
|
96
|
-
"@storybook/storybook-deployer": "2.8.
|
|
97
|
-
"@storybook/theming": "6.4.
|
|
98
|
-
"@storybook/vue3": "6.4.
|
|
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.
|
|
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';
|
|
@@ -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.
|
|
546
|
+
answers.push({ ...this.questionPossibleAnswers.get(answerCode), selected: true });
|
|
547
547
|
}
|
|
548
548
|
}
|
|
549
549
|
|
|
@@ -594,20 +594,19 @@ export default defineComponent({
|
|
|
594
594
|
let areMultiselectButtonsDisplayed = false;
|
|
595
595
|
|
|
596
596
|
if (this.payload?.multiSelect?.actions) {
|
|
597
|
-
|
|
598
|
-
|
|
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
|
|
606
|
+
return this.payload?.multiSelect?.actions['VALIDATE'] && this.questionPossibleAnswers;
|
|
608
607
|
},
|
|
609
608
|
isResetMultiselectButtonDisplayed() {
|
|
610
|
-
return this.payload?.multiSelect?.actions
|
|
609
|
+
return this.payload?.multiSelect?.actions['RESET'] && this.questionPossibleAnswers;
|
|
611
610
|
},
|
|
612
611
|
isSkipButtonsDisplayed() {
|
|
613
612
|
return this.payload?.skippable;
|
|
@@ -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
|
-
:
|
|
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
|
-
:
|
|
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<
|
|
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
|
|
306
|
+
tempOptionValues.value[taskId] = tempTask.value?.optionValues[taskId] ?? '';
|
|
305
307
|
} else {
|
|
306
|
-
tempOptionValues.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
|
|
322
|
-
(tempOptionValues.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
|
|
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
|
|
|
@@ -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 {
|
package/src/types/pb/Scenario.ts
CHANGED
|
@@ -76,7 +76,7 @@ export interface ScenarioStepMultiSelectAction {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
export interface ScenarioStepMultiSelectOptions {
|
|
79
|
-
actions:
|
|
79
|
+
actions: Record<string, ScenarioStepMultiSelectAction>;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
export interface ScenarioStepPayload {
|