project-booster-vue 9.12.0 → 9.13.2

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.12.0",
3
+ "version": "9.13.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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
  },
@@ -220,7 +210,7 @@ The `PbProjectHub` component to access your project.
220
210
  rest.patch('/api/media/:mediaId', getMediumByIdResolver),
221
211
  rest.delete('/api/media/:mediaId', successResolver),
222
212
  rest.patch('/api/media/:mediaId', notContentResolver),
223
- rest.get('/api/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
213
+ rest.get('/api/inhabitant-projects/:projectId/documents', getDocumentsByInhabitantProjectIdResolver),
224
214
  rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
225
215
  rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
226
216
  rest.get(
@@ -237,6 +227,10 @@ The `PbProjectHub` component to access your project.
237
227
  >
238
228
  {{
239
229
  components: { PbProjectHub },
230
+ mounted() {
231
+ this.$store.dispatch('media/updateContext', { type: 'MEDIA' });
232
+ this.$store.dispatch('documents/updateContext', { type: 'DOCUMENTS' });
233
+ },
240
234
  template: ` <div style="margin: 0 auto;min-height: 100vh;width: 100%;max-width: 1024px;">
241
235
  <router-view v-slot="{ Component }">
242
236
  <keep-alive include="PbProjectHub">
@@ -301,6 +295,8 @@ The `PbProjectHub` component to access your project.
301
295
  {{
302
296
  components: { PbProjectHub },
303
297
  mounted() {
298
+ this.$store.dispatch('media/updateContext', { type: 'MEDIA' });
299
+ this.$store.dispatch('documents/updateContext', { type: 'DOCUMENTS' });
304
300
  this.$router.push({
305
301
  name: 'ProjectHub',
306
302
  params: { projectId: 'EMPTY' },
@@ -84,7 +84,7 @@
84
84
  <div class="pb-project-hub__section-title-container">
85
85
  <div class="pb-project-hub__section-title">{{ titleDocument }}</div>
86
86
  <pb-media-upload
87
- v-if="displayedDocuments && displayedDocuments.length > 0"
87
+ v-if="!readOnly && displayedDocuments && displayedDocuments.length > 0"
88
88
  storeModuleName="documents"
89
89
  :payload="DOCUMENT_UPLOAD_PAYLOAD"
90
90
  acceptedFileTypes="image jpeg, image png, image heif, image heic, image/heif-sequence, image/heic-sequence, application
@@ -258,8 +258,8 @@
258
258
  'pb-project-hub__section--hidden': !(
259
259
  (isLoadingConfigurations || configurations.length > 0 || !!configurationsLoadError) &&
260
260
  !isLoadingTools &&
261
- tools &&
262
- configurators.length !== 0
261
+ (tools || readOnly) &&
262
+ (configurators.length !== 0 || readOnly)
263
263
  ),
264
264
  }"
265
265
  direction="column"
@@ -394,7 +394,7 @@
394
394
  <div class="pb-project-hub__section-title-container">
395
395
  <div class="pb-project-hub__section-title">{{ titlePhotoInspiration }}</div>
396
396
  <pb-media-upload
397
- v-if="displayedInspirations && displayedInspirations.length > 0"
397
+ v-if="!readOnly && displayedInspirations && displayedInspirations.length > 0"
398
398
  storeModuleName="documents"
399
399
  :payload="MEDIA_UPLOAD_PAYLOAD"
400
400
  @media-uploaded="handleMediaUploaded"
@@ -25,9 +25,10 @@ const getAppointmentQualification = async (
25
25
  groupId: string,
26
26
  appointmentId: string,
27
27
  ) => {
28
- const url = inhabitantProjectId
29
- ? `/appointment-qualifications?range=${start}-${end}&inhabitantProjectId=${inhabitantProjectId}`
30
- : `/appointment-qualifications?range=${start}-${end}&groupId=${groupId}&appointmentId=${appointmentId}`;
28
+ let url = `/appointment-qualifications?range=${start}-${end}&groupId=${groupId}&appointmentId=${appointmentId}`;
29
+ if (inhabitantProjectId) {
30
+ url += `&inhabitantProjectId=${inhabitantProjectId}`;
31
+ }
31
32
  const response = await clientApi.get(url);
32
33
 
33
34
  return response.data;