project-booster-vue 9.13.1 → 9.14.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 +1 -1
- package/src/components/projects/project-hub/PbProjectHub-Collaborator.stories.mdx +0 -10
- package/src/components/projects/project-hub/PbProjectHub.vue +1 -1
- package/src/components/scenario/PbScenario-Features-Rehydration.stories.mdx +2 -8
- package/src/components/scenario/PbScenario.stories.mdx +16 -15
- package/src/components/scenario/PbScenario.vue +10 -5
- package/src/services/api/appointmentQualificationsApi.ts +1 -1
- package/src/stores/modules/appointmentQualificationStore.ts +1 -1
package/package.json
CHANGED
|
@@ -113,21 +113,11 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
113
113
|
if (store.getters['estimates/getCurrentProjectId'] !== projectId) {
|
|
114
114
|
store.dispatch('estimates/loadEstimates', projectId);
|
|
115
115
|
}
|
|
116
|
-
if (store.getters['media/getCurrentProjectId'] !== projectId) {
|
|
117
|
-
store.dispatch('media/loadMedia', projectId);
|
|
118
|
-
}
|
|
119
|
-
if (store.getters['documents/getCurrentProjectId'] !== projectId) {
|
|
120
|
-
store.dispatch('documents/loadMedia', projectId);
|
|
121
|
-
}
|
|
122
116
|
if (store.getters['projects/getCurrentProjectId'] !== projectId) {
|
|
123
117
|
await store.dispatch('projects/loadProject', projectId);
|
|
124
118
|
store.dispatch('projects/loadAppointment');
|
|
125
119
|
store.dispatch('projects/loadProjectAttributes');
|
|
126
120
|
}
|
|
127
|
-
const projectType = store.getters['projects/getProject']?.projectType?.href?.split('/')[2];
|
|
128
|
-
if (store.getters['tools/getCurrentProjectType'] !== projectType) {
|
|
129
|
-
store.dispatch('tools/loadTools', projectType);
|
|
130
|
-
}
|
|
131
121
|
next();
|
|
132
122
|
},
|
|
133
123
|
},
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
(isLoadingConfigurations || configurations.length > 0 || !!configurationsLoadError) &&
|
|
260
260
|
!isLoadingTools &&
|
|
261
261
|
(tools || readOnly) &&
|
|
262
|
-
configurators.length !== 0
|
|
262
|
+
(configurators.length !== 0 || readOnly)
|
|
263
263
|
),
|
|
264
264
|
}"
|
|
265
265
|
direction="column"
|
|
@@ -104,7 +104,7 @@ export const previousContext = {
|
|
|
104
104
|
display: true,
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
|
-
|
|
107
|
+
stepsToResume: null,
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
step: {
|
|
@@ -113,7 +113,7 @@ export const previousContext = {
|
|
|
113
113
|
component: 'PbQuestion',
|
|
114
114
|
payload: {
|
|
115
115
|
viewModel: {
|
|
116
|
-
label: 'Question 1',
|
|
116
|
+
label: 'Question 1 (from previous state)',
|
|
117
117
|
answersComponent: 'PbCard',
|
|
118
118
|
},
|
|
119
119
|
answers: {
|
|
@@ -198,8 +198,6 @@ export const previousState = {
|
|
|
198
198
|
stepIndex: previousContext.stepIndex,
|
|
199
199
|
steps: previousContext.stepHistory,
|
|
200
200
|
},
|
|
201
|
-
currentStep: previousContext.currentStep,
|
|
202
|
-
displayedStep: previousContext.currentStep,
|
|
203
201
|
};
|
|
204
202
|
|
|
205
203
|
<details>
|
|
@@ -491,8 +489,6 @@ export const previousStateForNested = {
|
|
|
491
489
|
stepIndex: previousContextForNested.stepIndex,
|
|
492
490
|
steps: previousContextForNested.stepHistory,
|
|
493
491
|
},
|
|
494
|
-
currentStep: previousContextForNested.currentStep,
|
|
495
|
-
displayedStep: previousContextForNested.currentStep,
|
|
496
492
|
};
|
|
497
493
|
|
|
498
494
|
<details>
|
|
@@ -539,8 +535,6 @@ export const previousStateKitchen = {
|
|
|
539
535
|
stepIndex: previousContextKitchen.stepIndex,
|
|
540
536
|
steps: previousContextKitchen.stepHistory,
|
|
541
537
|
},
|
|
542
|
-
currentStep: previousContextKitchen.currentStep,
|
|
543
|
-
displayedStep: previousContextKitchen.currentStep,
|
|
544
538
|
};
|
|
545
539
|
|
|
546
540
|
<details>
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { useStore } from 'vuex';
|
|
2
2
|
import { nestedAppDecorator } from '../../../.storybook/nested-app-decorator';
|
|
3
3
|
import { Story, Preview, Meta, Props, ArgsTable, Source, Canvas } from '@storybook/addon-docs';
|
|
4
|
+
import { rest } from 'msw';
|
|
4
5
|
import PbScenario from './PbScenario';
|
|
5
|
-
import
|
|
6
|
+
import storeOptions from '../../stores/store';
|
|
6
7
|
import DEFAULT_PAYLOAD from './default-payload.json';
|
|
8
|
+
import {
|
|
9
|
+
getDocumentsByInhabitantProjectIdResolver,
|
|
10
|
+
uploadDocumentResolver,
|
|
11
|
+
} from '../../services/api/mocks/documentsMock';
|
|
7
12
|
|
|
8
13
|
<Meta
|
|
9
14
|
title="Project Booster/Scenario/PbScenario 🦠"
|
|
@@ -30,19 +35,7 @@ import DEFAULT_PAYLOAD from './default-payload.json';
|
|
|
30
35
|
},
|
|
31
36
|
}}
|
|
32
37
|
decorators={[
|
|
33
|
-
nestedAppDecorator(
|
|
34
|
-
{
|
|
35
|
-
modules: {
|
|
36
|
-
estimates: estimatesStore,
|
|
37
|
-
},
|
|
38
|
-
actions: {
|
|
39
|
-
sendEventToBus({}, payload) {
|
|
40
|
-
console.log('Event sent to bus', payload);
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
[{ path: '/steps/:stepCode/previous/:answers', component: PbScenario }],
|
|
45
|
-
),
|
|
38
|
+
nestedAppDecorator(storeOptions, [{ path: '/steps/:stepCode/previous/:answers', component: PbScenario }]),
|
|
46
39
|
]}
|
|
47
40
|
parameters={{
|
|
48
41
|
layout: 'fullscreen',
|
|
@@ -61,6 +54,8 @@ export const TemplateSandbox = (args, { argTypes }) => {
|
|
|
61
54
|
components: { PbScenario },
|
|
62
55
|
setup() {
|
|
63
56
|
const store = useStore();
|
|
57
|
+
store.dispatch('documentsPlans/updateContext', { type: 'DOCUMENT', subType: 'PLAN' });
|
|
58
|
+
store.dispatch('documentsPictures/updateContext', { type: 'DOCUMENT', subType: 'PHOTO' });
|
|
64
59
|
store.dispatch('estimates/setSummary', {
|
|
65
60
|
cost: {},
|
|
66
61
|
});
|
|
@@ -83,7 +78,13 @@ export const TemplateSandbox = (args, { argTypes }) => {
|
|
|
83
78
|
inline={false}
|
|
84
79
|
height="758px"
|
|
85
80
|
args={{ scenarios: DEFAULT_PAYLOAD }}
|
|
86
|
-
parameters={{
|
|
81
|
+
parameters={{
|
|
82
|
+
msw: [
|
|
83
|
+
rest.post('/api/inhabitant-projects/:projectId/documents', uploadDocumentResolver),
|
|
84
|
+
rest.get('/api/inhabitant-projects/:projectId/documents', getDocumentsByInhabitantProjectIdResolver),
|
|
85
|
+
],
|
|
86
|
+
storyshots: { disable: true },
|
|
87
|
+
}}
|
|
87
88
|
>
|
|
88
89
|
{TemplateSandbox.bind({})}
|
|
89
90
|
</Story>
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
|
|
71
71
|
<script lang="ts">
|
|
72
72
|
import { v4 as uuidv4 } from 'uuid';
|
|
73
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
73
74
|
import objectHash from 'object-hash';
|
|
74
75
|
import {
|
|
75
76
|
ref,
|
|
@@ -384,8 +385,7 @@ export default defineComponent({
|
|
|
384
385
|
}
|
|
385
386
|
|
|
386
387
|
state.value.stepsToResume = requestedStep.stepsToResume!;
|
|
387
|
-
|
|
388
|
-
state.value.currentStep = requestedStep?.step;
|
|
388
|
+
state.value.currentStep = scenarios.get(requestedStep?.step.code);
|
|
389
389
|
|
|
390
390
|
animateDisplayedStep(stepIndex < state.value.history.stepIndex);
|
|
391
391
|
state.value.history.stepIndex = stepIndex;
|
|
@@ -600,9 +600,6 @@ export default defineComponent({
|
|
|
600
600
|
noPointerEvents.value = false;
|
|
601
601
|
}, 500);
|
|
602
602
|
};
|
|
603
|
-
const currentHeight = () => {
|
|
604
|
-
return questionContainer.value?.$el?.clientHeight + 'px' ?? 'auto';
|
|
605
|
-
};
|
|
606
603
|
|
|
607
604
|
watch(route, () => {
|
|
608
605
|
const requestedStepIndex = route.params?.stepCode as string;
|
|
@@ -652,6 +649,14 @@ export default defineComponent({
|
|
|
652
649
|
|
|
653
650
|
if (!props.previousState) {
|
|
654
651
|
initScenario('__START__');
|
|
652
|
+
} else {
|
|
653
|
+
state.value = cloneDeep(props.previousState);
|
|
654
|
+
if (state.value.answers && !(state.value.answers instanceof Map)) {
|
|
655
|
+
state.value.answers = new Map<string, ScenarioStepAnswer[]>(Object.entries(state.value.answers));
|
|
656
|
+
}
|
|
657
|
+
const newRoute = `/steps/${state.value.history.stepIndex}/previous/${uuidv4()}`;
|
|
658
|
+
forceRefresh.value = true;
|
|
659
|
+
router.replace(newRoute);
|
|
655
660
|
}
|
|
656
661
|
onMounted(() => {
|
|
657
662
|
document.getElementsByTagName('body')[0].style.setProperty('overflow-x', 'hidden');
|
|
@@ -70,7 +70,7 @@ const declarationsWithoutAppointment = async (data: any) => {
|
|
|
70
70
|
);
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
const linkInhabitantProjectToAppointmentQualification = async (data: any, inhabitantProjectId:
|
|
73
|
+
const linkInhabitantProjectToAppointmentQualification = async (data: any, inhabitantProjectId: string) => {
|
|
74
74
|
const response = await clientApi.post(
|
|
75
75
|
`/inhabitant-projects/${inhabitantProjectId}/appointment-qualifications`,
|
|
76
76
|
data,
|
|
@@ -178,7 +178,7 @@ export default {
|
|
|
178
178
|
},
|
|
179
179
|
correlationId: state.sessions.correlationId,
|
|
180
180
|
};
|
|
181
|
-
const result = await linkInhabitantProjectToAppointmentQualification(state.sessions.inhabitantProjectId
|
|
181
|
+
const result = await linkInhabitantProjectToAppointmentQualification(data, state.sessions.inhabitantProjectId);
|
|
182
182
|
commit('setCurrentAppointmentQualification', result);
|
|
183
183
|
commit('setIsLoadingProject', false);
|
|
184
184
|
} catch (e) {
|