project-booster-vue 9.0.6 → 9.2.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 +15 -15
- package/src/components/media/upload/PbMediaUpload.vue +9 -7
- package/src/components/media/upload/document-upload-payload.json +7 -3
- package/src/components/projects/project-hub/PbProjectHub-Features-Documents&Media.stories.mdx +7 -1
- package/src/components/projects/project-hub/PbProjectHub.stories.mdx +28 -19
- package/src/components/projects/project-hub/PbProjectHub.vue +92 -87
- package/src/components/question/PbQuestion.vue +11 -4
- package/src/components/question/upload-document/UploadDocument.ts +2 -1
- package/src/components/scenario/PbScenario.vue +3 -0
- package/src/services/api/appointmentQualificationsApi.ts +1 -5
- package/src/services/api/documentsApi.ts +2 -2
- package/src/services/scenarioConditionals.ts +1 -1
- package/src/stores/modules/mediaDocumentsStore.ts +2 -2
- package/src/types/pb/Media.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-booster-vue",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "vue-cli-service serve",
|
|
@@ -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.21",
|
|
85
|
+
"@storybook/addon-essentials": "6.4.21",
|
|
86
86
|
"@storybook/addon-knobs": "6.3.1",
|
|
87
|
-
"@storybook/addon-links": "6.4.
|
|
87
|
+
"@storybook/addon-links": "6.4.21",
|
|
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.
|
|
89
|
+
"@storybook/addon-storyshots": "6.4.21",
|
|
90
|
+
"@storybook/addon-storyshots-puppeteer": "6.4.21",
|
|
91
|
+
"@storybook/addon-storysource": "6.4.21",
|
|
92
|
+
"@storybook/addons": "6.4.21",
|
|
93
|
+
"@storybook/builder-webpack5": "6.4.21",
|
|
94
|
+
"@storybook/manager-webpack5": "6.4.21",
|
|
95
|
+
"@storybook/source-loader": "6.4.21",
|
|
96
96
|
"@storybook/storybook-deployer": "2.8.11",
|
|
97
|
-
"@storybook/theming": "6.4.
|
|
98
|
-
"@storybook/vue3": "6.4.
|
|
97
|
+
"@storybook/theming": "6.4.21",
|
|
98
|
+
"@storybook/vue3": "6.4.21",
|
|
99
99
|
"@testing-library/jest-dom": "5.16.2",
|
|
100
100
|
"@testing-library/vue": "6.5.1",
|
|
101
101
|
"@types/axios": "0.14.0",
|
|
@@ -147,13 +147,13 @@
|
|
|
147
147
|
"eslint-plugin-import": "2.25.4",
|
|
148
148
|
"eslint-plugin-mdx": "1.16.0",
|
|
149
149
|
"eslint-plugin-prettier": "4.0.0",
|
|
150
|
-
"eslint-plugin-storybook": "0.5.
|
|
150
|
+
"eslint-plugin-storybook": "0.5.8",
|
|
151
151
|
"eslint-plugin-vue": "7.11.1",
|
|
152
152
|
"fluent-json-schema": "3.0.1",
|
|
153
153
|
"husky": "6.0.0",
|
|
154
154
|
"jest": "26.6.3",
|
|
155
155
|
"msw": "0.39.1",
|
|
156
|
-
"msw-storybook-addon": "1.6.
|
|
156
|
+
"msw-storybook-addon": "1.6.3",
|
|
157
157
|
"mutationobserver-shim": "0.3.7",
|
|
158
158
|
"postcss": "8.3.11",
|
|
159
159
|
"postcss-loader": "4.2.0",
|
|
@@ -135,10 +135,10 @@
|
|
|
135
135
|
<m-radio
|
|
136
136
|
class="pb-media-upload__preview-document-types-list"
|
|
137
137
|
name="radio-group"
|
|
138
|
-
v-for="
|
|
139
|
-
:label="
|
|
140
|
-
:key="type.
|
|
141
|
-
@click="updateMediaType(
|
|
138
|
+
v-for="mediaType in payload.viewModel.dialog.mediaTypes"
|
|
139
|
+
:label="mediaType.label"
|
|
140
|
+
:key="mediaType.type + '_' + mediaType.subtype"
|
|
141
|
+
@click="updateMediaType(mediaType)"
|
|
142
142
|
/>
|
|
143
143
|
</div>
|
|
144
144
|
<transition name="pb-media-upload--fade" mode="out-in" @before-leave="beforeLeave">
|
|
@@ -209,6 +209,7 @@ import PbStickyFooter from '../../sticky-footer/PbStickyFooter.vue';
|
|
|
209
209
|
import { isFileTypeValid, MediaValidationErrors, mediaValidator } from './mediaValidator';
|
|
210
210
|
import MEDIA_UPLOAD_PAYLOAD from './media-upload-payload.json';
|
|
211
211
|
import { MediaEventOptions, MediaUploadOptions } from '@/types/pb/Media';
|
|
212
|
+
import { UploadDocumentMediaType } from '@/components/question/upload-document/UploadDocument';
|
|
212
213
|
|
|
213
214
|
const NAME_MAX_LENGTH = 60;
|
|
214
215
|
const PDF_IMAGE = 'https://storage.googleapis.com/project-booster-media/vad/PDF/visuel_PDF_plan.png';
|
|
@@ -269,7 +270,7 @@ export default defineComponent({
|
|
|
269
270
|
displayAddDialog: false,
|
|
270
271
|
formData: null as FormData | null,
|
|
271
272
|
fileName: null as string | null,
|
|
272
|
-
selectedType: null as
|
|
273
|
+
selectedType: null as UploadDocumentMediaType | null,
|
|
273
274
|
isRoomPicture: false,
|
|
274
275
|
};
|
|
275
276
|
},
|
|
@@ -410,7 +411,8 @@ export default defineComponent({
|
|
|
410
411
|
formData: this.formData,
|
|
411
412
|
fileName: this.fileName,
|
|
412
413
|
isRoomPicture: this.isRoomPicture,
|
|
413
|
-
documentType: this.selectedType?.
|
|
414
|
+
documentType: this.selectedType?.type,
|
|
415
|
+
documentSubtype: this.selectedType?.subtype,
|
|
414
416
|
} as MediaUploadOptions);
|
|
415
417
|
} else {
|
|
416
418
|
this.displayAddDialog = false;
|
|
@@ -504,7 +506,7 @@ export default defineComponent({
|
|
|
504
506
|
return valid;
|
|
505
507
|
},
|
|
506
508
|
|
|
507
|
-
updateMediaType(type:
|
|
509
|
+
updateMediaType(type: UploadDocumentMediaType) {
|
|
508
510
|
this.selectedType = type;
|
|
509
511
|
},
|
|
510
512
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"viewModel": {
|
|
3
3
|
"title": "Ajouter un document",
|
|
4
|
+
"acceptedFileTypes": "image/jpeg, image/png, image/heif, image/heic, image/heif-sequence, image/heic-sequence, application/pdf",
|
|
4
5
|
"dialog": {
|
|
5
6
|
"hideCross": false,
|
|
6
7
|
"fullscreen": false,
|
|
@@ -14,15 +15,18 @@
|
|
|
14
15
|
"acceptedMediaTypesErrorLabel": "Seuls les formats JPG et PNG, et PDF sont acceptés",
|
|
15
16
|
"mediaTypes": [
|
|
16
17
|
{
|
|
17
|
-
"
|
|
18
|
+
"type": "PLAN",
|
|
19
|
+
"subtype": "HAND_DRAWN_PLAN",
|
|
18
20
|
"label": "Un plan fait moi même"
|
|
19
21
|
},
|
|
20
22
|
{
|
|
21
|
-
"
|
|
23
|
+
"type": "PLAN",
|
|
24
|
+
"subtype": "ARCHITECT_PLAN",
|
|
22
25
|
"label": "Un plan d’architecte"
|
|
23
26
|
},
|
|
24
27
|
{
|
|
25
|
-
"
|
|
28
|
+
"type": "PLAN",
|
|
29
|
+
"subtype": "KITCHEN_DESIGNER_PLAN",
|
|
26
30
|
"label": "Un plan d’un autre cuisiniste"
|
|
27
31
|
}
|
|
28
32
|
]
|
package/src/components/projects/project-hub/PbProjectHub-Features-Documents&Media.stories.mdx
CHANGED
|
@@ -54,9 +54,11 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
54
54
|
store.dispatch('projects/loadProject', '001');
|
|
55
55
|
}
|
|
56
56
|
if (store.getters['media/getCurrentProjectId'] !== '001') {
|
|
57
|
+
store.dispatch('media/updateContext', { type: 'MEDIA' });
|
|
57
58
|
store.dispatch('media/loadMedia', '001');
|
|
58
59
|
}
|
|
59
60
|
if (store.getters['documents/getCurrentProjectId'] !== '001') {
|
|
61
|
+
store.dispatch('documents/updateContext', { type: 'DOCUMENTS' });
|
|
60
62
|
store.dispatch('documents/loadMedia', '001');
|
|
61
63
|
}
|
|
62
64
|
next();
|
|
@@ -72,6 +74,7 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
72
74
|
uploadPayload: MEDIA_UPLOAD_PAYLOAD,
|
|
73
75
|
},
|
|
74
76
|
beforeEnter: async (to, from, next, store) => {
|
|
77
|
+
store.dispatch('media/updateContext', { type: 'MEDIA' });
|
|
75
78
|
if (store.getters['projects/getCurrentProjectId'] !== '001') {
|
|
76
79
|
store.dispatch('projects/loadProject', '001');
|
|
77
80
|
}
|
|
@@ -91,6 +94,7 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
91
94
|
uploadPayload: MEDIA_UPLOAD_PAYLOAD,
|
|
92
95
|
},
|
|
93
96
|
beforeEnter: async (to, from, next, store) => {
|
|
97
|
+
store.dispatch('media/updateContext', { type: 'MEDIA' });
|
|
94
98
|
if (store.getters['projects/getCurrentProjectId'] !== '001') {
|
|
95
99
|
store.dispatch('projects/loadProject', '001');
|
|
96
100
|
}
|
|
@@ -114,6 +118,7 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
114
118
|
uploadPayload: DOCUMENT_UPLOAD_PAYLOAD,
|
|
115
119
|
},
|
|
116
120
|
beforeEnter: async (to, from, next, store) => {
|
|
121
|
+
store.dispatch('documents/updateContext', { type: 'DOCUMENTS' });
|
|
117
122
|
if (store.getters['projects/getCurrentProjectId'] !== '001') {
|
|
118
123
|
store.dispatch('projects/loadProject', '001');
|
|
119
124
|
}
|
|
@@ -134,6 +139,7 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
134
139
|
uploadPayload: DOCUMENT_UPLOAD_PAYLOAD,
|
|
135
140
|
},
|
|
136
141
|
beforeEnter: async (to, from, next, store) => {
|
|
142
|
+
store.dispatch('documents/updateContext', { type: 'DOCUMENTS' });
|
|
137
143
|
if (store.getters['projects/getCurrentProjectId'] !== '001') {
|
|
138
144
|
store.dispatch('projects/loadProject', '001');
|
|
139
145
|
}
|
|
@@ -148,7 +154,7 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
148
154
|
},
|
|
149
155
|
]),
|
|
150
156
|
]}
|
|
151
|
-
|
|
157
|
+
/>
|
|
152
158
|
|
|
153
159
|
# 🦠 `PbProjectHub` - Component
|
|
154
160
|
|
|
@@ -97,9 +97,11 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
97
97
|
store.dispatch('estimates/loadEstimates', projectId);
|
|
98
98
|
}
|
|
99
99
|
if (store.getters['media/getCurrentProjectId'] !== projectId) {
|
|
100
|
+
store.dispatch('media/updateContext', { type: 'MEDIA' });
|
|
100
101
|
store.dispatch('media/loadMedia', projectId);
|
|
101
102
|
}
|
|
102
103
|
if (store.getters['documents/getCurrentProjectId'] !== projectId) {
|
|
104
|
+
store.dispatch('documents/updateContext', { type: 'DOCUMENTS' });
|
|
103
105
|
store.dispatch('documents/loadMedia', projectId);
|
|
104
106
|
}
|
|
105
107
|
if (store.getters['projects/getCurrentProjectId'] !== projectId) {
|
|
@@ -125,6 +127,7 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
125
127
|
beforeEnter: async (to, from, next, store) => {
|
|
126
128
|
store.dispatch('media/updateCurrentMedia', null);
|
|
127
129
|
const projectId = to.params.projectId;
|
|
130
|
+
store.dispatch('media/updateContext', { type: 'MEDIA' });
|
|
128
131
|
if (store.getters['projects/getCurrentProjectId'] !== projectId) {
|
|
129
132
|
store.dispatch('projects/loadProject', projectId);
|
|
130
133
|
}
|
|
@@ -141,6 +144,7 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
141
144
|
beforeEnter: async (to, from, next, store) => {
|
|
142
145
|
const projectId = to.params.projectId;
|
|
143
146
|
const mediaId = to.params.inspirationId;
|
|
147
|
+
store.dispatch('media/updateContext', { type: 'MEDIA' });
|
|
144
148
|
if (store.getters['projects/getCurrentProjectId'] !== projectId) {
|
|
145
149
|
store.dispatch('projects/loadProject', projectId);
|
|
146
150
|
}
|
|
@@ -164,6 +168,7 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
164
168
|
uploadPayload: DOCUMENT_UPLOAD_PAYLOAD,
|
|
165
169
|
},
|
|
166
170
|
beforeEnter: async (to, from, next, store) => {
|
|
171
|
+
store.dispatch('documents/updateContext', { type: 'DOCUMENTS' });
|
|
167
172
|
store.dispatch('documents/updateCurrentMedia', null);
|
|
168
173
|
const projectId = to.params.projectId;
|
|
169
174
|
if (store.getters['projects/getCurrentProjectId'] !== projectId) {
|
|
@@ -188,6 +193,7 @@ import DOCUMENT_UPLOAD_PAYLOAD from '../../media/upload/document-upload-payload.
|
|
|
188
193
|
beforeEnter: async (to, from, next, store) => {
|
|
189
194
|
const projectId = to.params.projectId;
|
|
190
195
|
const mediaId = to.params.documentId;
|
|
196
|
+
store.dispatch('documents/updateContext', { type: 'DOCUMENTS' });
|
|
191
197
|
if (store.getters['projects/getCurrentProjectId'] !== projectId) {
|
|
192
198
|
store.dispatch('projects/loadProject', projectId);
|
|
193
199
|
}
|
|
@@ -245,31 +251,34 @@ The `PbProjectHub` component to access your project.
|
|
|
245
251
|
rest.get('/api/estimates', getEstimatesByProjectIdResolver),
|
|
246
252
|
rest.post('/api/estimates', successResolver),
|
|
247
253
|
rest.get(
|
|
248
|
-
'/inhabitant-projects/:inhabitantProjectId/simulations',
|
|
254
|
+
'/api/inhabitant-projects/:inhabitantProjectId/simulations',
|
|
249
255
|
getConfigurationsWithUpdatedPricesByProjectIdResolver,
|
|
250
256
|
),
|
|
251
|
-
rest.get('
|
|
257
|
+
rest.get('//apisimulations', getConfigurationsByProjectIdResolver),
|
|
252
258
|
rest.get(
|
|
253
259
|
'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
|
|
254
260
|
getToolsByProjectTypeResolver,
|
|
255
261
|
),
|
|
256
|
-
rest.get('/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
|
|
257
|
-
rest.get('/media', getAllMediaPaginationResolver),
|
|
258
|
-
rest.get('/media/:mediaId', getMediumByIdResolver),
|
|
259
|
-
rest.get('/media/:mediaId/thumbnail', getMediaThumbnailResolver),
|
|
260
|
-
rest.get('/media/:mediaId/file', getMediaFileResolver),
|
|
261
|
-
rest.post('/media', uploadMediaResolver),
|
|
262
|
-
rest.patch('/media/:mediaId', getMediumByIdResolver),
|
|
263
|
-
rest.delete('/media/:mediaId', successResolver),
|
|
264
|
-
rest.patch('/media/:mediaId', notContentResolver),
|
|
265
|
-
rest.get('/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
|
|
266
|
-
rest.get('/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
|
|
267
|
-
rest.delete('/inhabitant-projects/:projectId/documents/:documentId', successResolver),
|
|
268
|
-
rest.get(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
rest.get('/inhabitant-
|
|
262
|
+
rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
|
|
263
|
+
rest.get('/api/media', getAllMediaPaginationResolver),
|
|
264
|
+
rest.get('/api/media/:mediaId', getMediumByIdResolver),
|
|
265
|
+
rest.get('/api/media/:mediaId/thumbnail', getMediaThumbnailResolver),
|
|
266
|
+
rest.get('/api/media/:mediaId/file', getMediaFileResolver),
|
|
267
|
+
rest.post('/api/media', uploadMediaResolver),
|
|
268
|
+
rest.patch('/api/media/:mediaId', getMediumByIdResolver),
|
|
269
|
+
rest.delete('/api/media/:mediaId', successResolver),
|
|
270
|
+
rest.patch('/api/media/:mediaId', notContentResolver),
|
|
271
|
+
rest.get('/api/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
|
|
272
|
+
rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
|
|
273
|
+
rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
|
|
274
|
+
rest.get(
|
|
275
|
+
'/api/inhabitant-projects/:projectId/documents/:documentId/thumbnail',
|
|
276
|
+
getDocumentsImageThumbnailResolver,
|
|
277
|
+
),
|
|
278
|
+
rest.get('/api/inhabitant-projects/:projectId/documents/:documentId/file', getDocumentsImageFileResolver),
|
|
279
|
+
rest.post('/api/inhabitant-projects/:projectId/documents', uploadDocumentResolver),
|
|
280
|
+
rest.get('/api/inhabitant-projects/:projectId/attributes', getProjectAttributesByIdResolver),
|
|
281
|
+
rest.get('/api/inhabitant-api/users/:buId/:inhabitantId', getInhabitantByIdResolver),
|
|
273
282
|
],
|
|
274
283
|
storyshots: { disable: true },
|
|
275
284
|
}}
|
|
@@ -81,35 +81,61 @@
|
|
|
81
81
|
/>
|
|
82
82
|
</m-flex>
|
|
83
83
|
</m-flex>
|
|
84
|
-
<m-flex
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
84
|
+
<m-flex v-if="isDocumentsDisplayed" class="pb-project-hub__section" direction="column" full-width>
|
|
85
|
+
<div class="pb-project-hub__section-header">
|
|
86
|
+
<div class="pb-project-hub__section-title">{{ titleDocument }}</div>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="pb-project-hub__section-content">
|
|
89
|
+
<m-flex
|
|
90
|
+
class="pb-project-hub__section-content--loading"
|
|
91
|
+
v-if="isLoadingDocuments"
|
|
92
|
+
direction="column"
|
|
93
|
+
align-items="center"
|
|
94
|
+
justify-content="center"
|
|
95
|
+
align-content="center"
|
|
96
|
+
>
|
|
97
|
+
<pb-animable-loader class="pb-project-hub__section-content--loading-loader" />
|
|
98
|
+
<div class="pb-project-hub__section-content--loading-label">Chargement...</div>
|
|
99
|
+
</m-flex>
|
|
100
|
+
<m-container
|
|
101
|
+
class="pb-project-hub__section-content-cards-container"
|
|
102
|
+
fluid
|
|
103
|
+
v-if="displayedDocuments && displayedDocuments.length > 0"
|
|
104
|
+
>
|
|
105
|
+
<m-flexy class="pb-project-hub__section-content-cards-flexy">
|
|
106
|
+
<m-flexy-col
|
|
107
|
+
class="pb-project-hub__section-content-card-flexy"
|
|
108
|
+
v-for="document in displayedDocuments"
|
|
109
|
+
:key="document.id"
|
|
110
|
+
width="full"
|
|
111
|
+
width-from-m="1of3"
|
|
112
|
+
>
|
|
113
|
+
<div class="pb-project-hub__section-content-card-container">
|
|
114
|
+
<pb-card
|
|
115
|
+
@cardClick="handleDocumentClick(document.id)"
|
|
116
|
+
class="pb-project-hub__section-content-card"
|
|
117
|
+
:image="documentThumbnailUrl.replace('@@PB_MEDIA_ID_FILLER@@', document.id)"
|
|
118
|
+
:text="document.title ? document.title : 'Image sans nom'"
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
</m-flexy-col>
|
|
122
|
+
</m-flexy>
|
|
123
|
+
<m-link
|
|
124
|
+
class="pb-project-hub__section-content-link"
|
|
125
|
+
label="Gérer vos documents"
|
|
126
|
+
@click="$router.push({ name: 'PbDocuments' })"
|
|
127
|
+
/>
|
|
128
|
+
</m-container>
|
|
129
|
+
<pb-empty-state
|
|
130
|
+
v-else
|
|
131
|
+
:title="!readOnly ? 'Centraliser vos documents' : ''"
|
|
132
|
+
:subtitle="!readOnly ? '' : 'Aucune information renseignée'"
|
|
133
|
+
image="https://storage.googleapis.com/project-booster-media/media/empty-media.png"
|
|
134
|
+
:button-label="!readOnly ? 'Ajouter des documents' : ''"
|
|
135
|
+
@button-click="handleClickDocumentEmptyState"
|
|
136
|
+
:disabled="readOnly"
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
113
139
|
</m-flex>
|
|
114
140
|
<m-flex
|
|
115
141
|
v-if="isEstimatesDisplayed"
|
|
@@ -360,7 +386,7 @@
|
|
|
360
386
|
</m-flexy>
|
|
361
387
|
<m-link
|
|
362
388
|
class="pb-project-hub__section-content-link"
|
|
363
|
-
label="
|
|
389
|
+
label="Gérer vos inspirations"
|
|
364
390
|
@click="$router.push({ name: 'PbInspirations' })"
|
|
365
391
|
/>
|
|
366
392
|
</m-container>
|
|
@@ -375,63 +401,12 @@
|
|
|
375
401
|
/>
|
|
376
402
|
</div>
|
|
377
403
|
</m-flex>
|
|
378
|
-
<m-flex
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
class="pb-project-hub__section-content--loading"
|
|
385
|
-
v-if="isLoadingDocuments"
|
|
386
|
-
direction="column"
|
|
387
|
-
align-items="center"
|
|
388
|
-
justify-content="center"
|
|
389
|
-
align-content="center"
|
|
390
|
-
>
|
|
391
|
-
<pb-animable-loader class="pb-project-hub__section-content--loading-loader" />
|
|
392
|
-
<div class="pb-project-hub__section-content--loading-label">Chargement...</div>
|
|
393
|
-
</m-flex>
|
|
394
|
-
<m-container
|
|
395
|
-
class="pb-project-hub__section-content-cards-container"
|
|
396
|
-
fluid
|
|
397
|
-
v-if="displayedDocuments && displayedDocuments.length > 0"
|
|
398
|
-
>
|
|
399
|
-
<m-flexy class="pb-project-hub__section-content-cards-flexy">
|
|
400
|
-
<m-flexy-col
|
|
401
|
-
class="pb-project-hub__section-content-card-flexy"
|
|
402
|
-
v-for="document in displayedDocuments"
|
|
403
|
-
:key="document.id"
|
|
404
|
-
width="full"
|
|
405
|
-
width-from-m="1of3"
|
|
406
|
-
>
|
|
407
|
-
<div class="pb-project-hub__section-content-card-container">
|
|
408
|
-
<pb-card
|
|
409
|
-
@cardClick="handleDocumentClick(document.id)"
|
|
410
|
-
class="pb-project-hub__section-content-card"
|
|
411
|
-
:image="documentThumbnailUrl.replace('@@PB_MEDIA_ID_FILLER@@', document.id)"
|
|
412
|
-
:text="document.title ? document.title : 'Image sans nom'"
|
|
413
|
-
/>
|
|
414
|
-
</div>
|
|
415
|
-
</m-flexy-col>
|
|
416
|
-
</m-flexy>
|
|
417
|
-
<m-link
|
|
418
|
-
class="pb-project-hub__section-content-link"
|
|
419
|
-
label="Voir tous les documents"
|
|
420
|
-
@click="$router.push({ name: 'PbDocuments' })"
|
|
421
|
-
/>
|
|
422
|
-
</m-container>
|
|
423
|
-
<pb-empty-state
|
|
424
|
-
v-else
|
|
425
|
-
:title="!readOnly ? 'Centraliser vos documents' : ''"
|
|
426
|
-
:subtitle="!readOnly ? '' : 'Aucune information renseignée'"
|
|
427
|
-
image="https://storage.googleapis.com/project-booster-media/media/empty-media.png"
|
|
428
|
-
:button-label="!readOnly ? 'Ajouter des documents' : ''"
|
|
429
|
-
@button-click="handleClickDocumentEmptyState"
|
|
430
|
-
:disabled="readOnly"
|
|
431
|
-
/>
|
|
432
|
-
</div>
|
|
433
|
-
</m-flex>
|
|
434
|
-
<m-flex v-if="areProjectAttributesDisplayed" class="pb-project-hub__section" direction="column" full-width>
|
|
404
|
+
<m-flex
|
|
405
|
+
v-if="areProjectAttributesDisplayed && projectAttributes && Object.keys(projectAttributes).length > 0"
|
|
406
|
+
class="pb-project-hub__section"
|
|
407
|
+
direction="column"
|
|
408
|
+
full-width
|
|
409
|
+
>
|
|
435
410
|
<div class="pb-project-hub__section-header">
|
|
436
411
|
<div class="pb-project-hub__section-title" ref="pbProjectAttributeList">
|
|
437
412
|
{{ titleProjectAttribute }}
|
|
@@ -466,6 +441,36 @@
|
|
|
466
441
|
</m-flex>
|
|
467
442
|
</div>
|
|
468
443
|
</m-flex>
|
|
444
|
+
<m-flex
|
|
445
|
+
v-if="isPlannerDisplayed"
|
|
446
|
+
class="pb-project-hub__section pb-project-hub__planner-section"
|
|
447
|
+
direction="column"
|
|
448
|
+
full-width
|
|
449
|
+
>
|
|
450
|
+
<pb-tasks-preview
|
|
451
|
+
v-if="!plannerError"
|
|
452
|
+
class="pb-project-hub__planner"
|
|
453
|
+
:tasks="tasks"
|
|
454
|
+
:tasks-number="3"
|
|
455
|
+
:read-only="readOnly"
|
|
456
|
+
@show-task-details="handleShowTaskDetails"
|
|
457
|
+
@create-task="handleCreateTask"
|
|
458
|
+
@view-tasks="handleViewTasks"
|
|
459
|
+
@task-completed="handleCompleteTask"
|
|
460
|
+
/>
|
|
461
|
+
<m-flex
|
|
462
|
+
v-else-if="plannerError"
|
|
463
|
+
class="pb-project-hub__planner--error"
|
|
464
|
+
direction="column"
|
|
465
|
+
align-items="center"
|
|
466
|
+
justify-content="center"
|
|
467
|
+
gap="2rem"
|
|
468
|
+
full-width
|
|
469
|
+
>
|
|
470
|
+
<div>Une erreur est survenue lors du chargement des étapes</div>
|
|
471
|
+
<m-button label="Réessayer" @click="$store.dispatch('tasks/reloadPlanner')" />
|
|
472
|
+
</m-flex>
|
|
473
|
+
</m-flex>
|
|
469
474
|
<m-flex v-if="isMailConsentDisplayed" class="pb-project-hub__section" direction="column" full-width>
|
|
470
475
|
<div class="pb-project-hub__section-header">
|
|
471
476
|
<div class="pb-project-hub__section-title" ref="pbConsent">Souscription newsletter</div>
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
{{ payload.viewModel.hero }}
|
|
17
17
|
</div>
|
|
18
18
|
<div class="pb-question__title-container">
|
|
19
|
-
<div
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
<div
|
|
20
|
+
v-if="payload.viewModel.label"
|
|
21
|
+
class="pb-question__title"
|
|
22
|
+
v-html="decorate(payload.viewModel.label, payload.defaultDecoratorValue)"
|
|
23
|
+
/>
|
|
22
24
|
<div v-if="payload.viewModel.subtitle" class="pb-question__subtitle">
|
|
23
25
|
{{ decorate(payload.viewModel.subtitle, payload.defaultDecoratorValue) }}
|
|
24
26
|
<m-link
|
|
@@ -452,7 +454,12 @@ export default defineComponent({
|
|
|
452
454
|
decorate(valueToDecorate: string, defaultValue = '') {
|
|
453
455
|
if (valueToDecorate) {
|
|
454
456
|
valueToDecorate = `\`${valueToDecorate}\``;
|
|
455
|
-
|
|
457
|
+
try {
|
|
458
|
+
return this.doEval(valueToDecorate, defaultValue);
|
|
459
|
+
} catch (e) {
|
|
460
|
+
console.error(e);
|
|
461
|
+
return valueToDecorate;
|
|
462
|
+
}
|
|
456
463
|
}
|
|
457
464
|
return valueToDecorate;
|
|
458
465
|
},
|
|
@@ -606,6 +606,9 @@ export default defineComponent({
|
|
|
606
606
|
(newValue) => {
|
|
607
607
|
if (newValue && scenarios) {
|
|
608
608
|
state.value = newValue;
|
|
609
|
+
if (state.value.answers && !(state.value.answers instanceof Map)) {
|
|
610
|
+
state.value.answers = new Map<string, ScenarioStepAnswer[]>(Object.entries(state.value.answers));
|
|
611
|
+
}
|
|
609
612
|
goToStep(state.value.history.stepIndex);
|
|
610
613
|
}
|
|
611
614
|
},
|
|
@@ -30,11 +30,7 @@ const getAppointmentQualification = async (
|
|
|
30
30
|
: `/appointment-qualifications?range=${start}-${end}&groupId=${groupId}&appointmentId=${appointmentId}`;
|
|
31
31
|
const response = await clientApi.get(url);
|
|
32
32
|
|
|
33
|
-
return
|
|
34
|
-
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
35
|
-
return `: "${he.escape($1)}"`;
|
|
36
|
-
}),
|
|
37
|
-
);
|
|
33
|
+
return response.data;
|
|
38
34
|
};
|
|
39
35
|
|
|
40
36
|
const saveAnswersByAppointmentQualificationId = async (appointmentQualificationId: string, data: any) => {
|
|
@@ -22,15 +22,15 @@ const uploadDocument = async (
|
|
|
22
22
|
formData: FormData,
|
|
23
23
|
inhabitantProjectId: string,
|
|
24
24
|
correlationId: string,
|
|
25
|
-
subType: string,
|
|
26
25
|
trackProgress: (progressEvent: ProgressEvent) => void,
|
|
27
26
|
fileName: string,
|
|
28
27
|
type: string,
|
|
28
|
+
subtype: string,
|
|
29
29
|
) => {
|
|
30
30
|
const [name, file] = formData.entries().next().value;
|
|
31
31
|
const data = new FormData();
|
|
32
32
|
data.append('document', file);
|
|
33
|
-
data.append('metadata', JSON.stringify({ type: type, correlationId, subType, title: fileName }, null, '\t'));
|
|
33
|
+
data.append('metadata', JSON.stringify({ type: type, correlationId, subType: subtype, title: fileName }, null, '\t'));
|
|
34
34
|
return await clientApi.post(`/inhabitant-projects/${inhabitantProjectId}/documents`, data, {
|
|
35
35
|
onUploadProgress: trackProgress,
|
|
36
36
|
});
|
|
@@ -7,7 +7,7 @@ const Condition = (
|
|
|
7
7
|
) => {
|
|
8
8
|
const isAnswerMatching = (questionCode: string, answerCode: string) => {
|
|
9
9
|
const questionAnswers = answers.get(questionCode)!;
|
|
10
|
-
return questionAnswers[0]?.code === answerCode;
|
|
10
|
+
return questionAnswers ? questionAnswers[0]?.code === answerCode : false;
|
|
11
11
|
};
|
|
12
12
|
const isAnswerContaining = (questionCode: string, answerCode: string) => {
|
|
13
13
|
const questionAnswers = answers.get(questionCode)!;
|
|
@@ -177,10 +177,10 @@ export const mediaDocumentsUploadStoreOptions = {
|
|
|
177
177
|
uploadFile.formData,
|
|
178
178
|
state.currentProjectId,
|
|
179
179
|
correlationId,
|
|
180
|
-
uploadFile.documentType ? uploadFile.documentType : 'ROOM_PHOTO',
|
|
181
180
|
trackProgress,
|
|
182
181
|
uploadFile.fileName,
|
|
183
|
-
|
|
182
|
+
uploadFile.documentType,
|
|
183
|
+
uploadFile.documentSubtype,
|
|
184
184
|
);
|
|
185
185
|
}
|
|
186
186
|
const location = response.headers.location;
|