project-booster-vue 9.33.0 → 9.34.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "9.33.0",
3
+ "version": "9.34.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -65,7 +65,7 @@ export const TemplateSandbox = (args, { argTypes }) => {
65
65
  businessUnit: '001',
66
66
  correlationId: uuidv4(),
67
67
  groupId: 'groupId',
68
- interventionIds: ['interventionId'],
68
+ calendarId: 'calendarId',
69
69
  appointmentId: 'appointmentId',
70
70
  sourceDetail: 'Appointment_email',
71
71
  });
@@ -55,7 +55,7 @@ export const TemplateSandbox = (args, { argTypes }) => ({
55
55
  businessUnit: '001',
56
56
  source: 'APPOINTMENT_QUALIFICATION',
57
57
  sourceDetail: 'KITCHEN',
58
- interventionIds: ['375615'],
58
+ calendarId: '375615',
59
59
  storeId: '006',
60
60
  appointmentQualificationFormStructure: SCENARIO,
61
61
  });
@@ -48,8 +48,8 @@ export default defineComponent({
48
48
  if (props.payload?.viewModel?.calendarUrlPath) {
49
49
  url = `${baseUrl}/${props.payload.viewModel.calendarUrlPath}?`;
50
50
  } else {
51
- url = `${baseUrl}/leroy-merlin-${sessions.storeId}?`;
52
- url += sessions.interventionIds.map((id: string) => 'intervention_ids[]=' + id).join('&');
51
+ url = `${baseUrl}/leroy-merlin-${sessions.storeId}`;
52
+ url += `?calendar_id=${sessions.calendarId}`;
53
53
  url += `&vevent[str5]=${currentAppointmentQualification.inhabitantProjectId}`;
54
54
  }
55
55
 
@@ -73,7 +73,7 @@ export const TemplateSandbox = (args, { argTypes }) => {
73
73
  controls: { disabled: true },
74
74
  msw: [
75
75
  rest.post('/api/events/documents', acceptedResolver),
76
- rest.get('/api/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
76
+ rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
77
77
  rest.get(
78
78
  '/api/inhabitant-projects/:projectId/documents/:documentId/thumbnail',
79
79
  getDocumentsImageThumbnailResolver,
@@ -115,7 +115,7 @@ export const TemplateSandbox = (args, { argTypes }) => {
115
115
  controls: { disabled: true },
116
116
  msw: [
117
117
  rest.post('/api/inhabitant-projects/:projectId/documents', uploadDocumentResolver),
118
- rest.get('/api/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
118
+ rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
119
119
  rest.get(
120
120
  '/api/inhabitant-projects/:projectId/documents/:documentId/thumbnail',
121
121
  getDocumentsImageThumbnailResolver,
@@ -178,7 +178,7 @@ export const TemplateSandbox = (args, { argTypes }) => {
178
178
  controls: { disabled: true },
179
179
  msw: [
180
180
  rest.post('/api/inhabitant-projects/:projectId/documents', uploadDocumentResolver),
181
- rest.get('/api/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
181
+ rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
182
182
  rest.get(
183
183
  '/api/inhabitant-projects/:projectId/documents/:documentId/thumbnail',
184
184
  getDocumentsImageThumbnailResolver,
@@ -280,7 +280,7 @@ $responsive-breakpoint: 'm';
280
280
  top: 0;
281
281
 
282
282
  &--is-visible {
283
- transform: translateX(0);
283
+ transform: translateX(0) !important;
284
284
  }
285
285
 
286
286
  &--is-hidden {
@@ -240,7 +240,7 @@ $responsive-breakpoint: 'm';
240
240
  &__button-informations {
241
241
  @include set-font-scale('07', 'm');
242
242
  @include set-font-face('semi-bold');
243
- margin-bottom: calc($mu100 * -1);
243
+ margin-bottom: ($mu100 * -1);
244
244
  margin-top: $mu200;
245
245
  }
246
246
  }
@@ -200,13 +200,13 @@ The `PbProjectHub` component to access your project.
200
200
  '/api/inhabitant-projects/:inhabitantProjectId/simulations',
201
201
  getConfigurationsWithUpdatedPricesByProjectIdResolver,
202
202
  ),
203
- rest.get('//apisimulations', getConfigurationsByProjectIdResolver),
203
+ rest.get('/api/simulations?inhabitantProjectId=:projectId', getConfigurationsByProjectIdResolver),
204
204
  rest.get(
205
205
  'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
206
206
  getToolsByProjectTypeResolver,
207
207
  ),
208
208
  rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
209
- rest.get('/api/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
209
+ rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
210
210
  rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
211
211
  rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
212
212
  rest.get(
@@ -256,13 +256,13 @@ The `PbProjectHub` component to access your project.
256
256
  '/api/inhabitant-projects/:inhabitantProjectId/simulations',
257
257
  getConfigurationsWithUpdatedPricesByProjectIdResolver,
258
258
  ),
259
- rest.get('/api/simulations', getConfigurationsByProjectIdResolver),
259
+ rest.get('/api/simulations?inhabitantProjectId=:projectId', getConfigurationsByProjectIdResolver),
260
260
  rest.get(
261
261
  'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
262
262
  getToolsByProjectTypeResolver,
263
263
  ),
264
264
  rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
265
- rest.get('/api/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
265
+ rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
266
266
  rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
267
267
  rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
268
268
  rest.get(
@@ -383,13 +383,13 @@ The `PbProjectHub` component to access your project.
383
383
  '/api/inhabitant-projects/:inhabitantProjectId/simulations',
384
384
  getConfigurationsWithUpdatedPricesByProjectIdResolver,
385
385
  ),
386
- rest.get('/api/simulations', getConfigurationsByProjectIdResolver),
386
+ rest.get('/api/simulations?inhabitantProjectId=:projectId', getConfigurationsByProjectIdResolver),
387
387
  rest.get(
388
388
  'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
389
389
  getToolsByProjectTypeResolver,
390
390
  ),
391
391
  rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
392
- rest.get('/api/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
392
+ rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
393
393
  rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
394
394
  rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
395
395
  rest.get(
@@ -464,13 +464,13 @@ The `PbProjectHub` component to access your project.
464
464
  '/api/inhabitant-projects/:inhabitantProjectId/simulations',
465
465
  getConfigurationsWithUpdatedPricesByProjectIdResolver,
466
466
  ),
467
- rest.get('/api/simulations', getConfigurationsByProjectIdResolver),
467
+ rest.get('/api/simulations?inhabitantProjectId=:projectId', getConfigurationsByProjectIdResolver),
468
468
  rest.get(
469
469
  'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
470
470
  getToolsByProjectTypeResolver,
471
471
  ),
472
472
  rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
473
- rest.get('/api/inhabitant-projects/:projectId/documents/', getDocumentsByInhabitantProjectIdResolver),
473
+ rest.get('/api/inhabitant-projects/:projectId/documents?range=0-5', getDocumentsByInhabitantProjectIdResolver),
474
474
  rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
475
475
  rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
476
476
  rest.get(
@@ -518,13 +518,16 @@ The `PbProjectHub` component to access your project.
518
518
  '/api/inhabitant-projects/:inhabitantProjectId/simulations',
519
519
  getEmptyConfigurationsByProjectIdResolver,
520
520
  ),
521
- rest.get('/api/simulations', getEmptyConfigurationsByProjectIdResolver),
521
+ rest.get('/api/simulations?inhabitantProjectId=:projectId', getEmptyConfigurationsByProjectIdResolver),
522
522
  rest.get(
523
523
  'https://storage.googleapis.com/pb-dev-adeo-disp-project-tools/:id.json',
524
524
  getEmptyToolsByProjectTypeResolver,
525
525
  ),
526
526
  rest.get('/api/project-types/:projectTypeId/products-feature-flag', getEnabledProductsFeatureFlagResolver),
527
- rest.get('/api/inhabitant-projects/:projectId/documents/', getEmptyDocumentsByInhabitantProjectIdResolver),
527
+ rest.get(
528
+ '/api/inhabitant-projects/:projectId/documents?range=0-5',
529
+ getEmptyDocumentsByInhabitantProjectIdResolver,
530
+ ),
528
531
  rest.get('/api/inhabitant-projects/:projectId/documents/:documentId', getDocumentByIdResolver),
529
532
  rest.delete('/api/inhabitant-projects/:projectId/documents/:documentId', successResolver),
530
533
  rest.get(
@@ -64,7 +64,7 @@ The `PbProjectsList` component to access your project.
64
64
  name="Showcase"
65
65
  parameters={{
66
66
  controls: { disable: true },
67
- msw: [rest.get('/api/inhabitant-projects', getProjectsResolver)],
67
+ msw: [rest.get('/api/inhabitant-projects?range=0-5&status=ACTIVE', getProjectsResolver)],
68
68
  }}
69
69
  height="100vh"
70
70
  >
@@ -79,7 +79,7 @@ The `PbProjectsList` component to access your project.
79
79
  name="Showcase empty state"
80
80
  parameters={{
81
81
  controls: { disable: true },
82
- msw: [rest.get('/api/inhabitant-projects', getEmptyProjectsResolver)],
82
+ msw: [rest.get('/api/inhabitant-projects?range=0-5&status=ACTIVE', getEmptyProjectsResolver)],
83
83
  }}
84
84
  height="100vh"
85
85
  >
@@ -94,7 +94,7 @@ The `PbProjectsList` component to access your project.
94
94
  name="Showcase with error"
95
95
  parameters={{
96
96
  controls: { disable: true },
97
- msw: [rest.get('/api/inhabitant-projects', internalServerErrorResolver)],
97
+ msw: [rest.get('/api/inhabitant-projects?range=0-5&status=ACTIVE', internalServerErrorResolver)],
98
98
  storyshots: { disable: true },
99
99
  }}
100
100
  height="100vh"
@@ -1,7 +1,13 @@
1
1
  <template>
2
2
  <m-flex class="pb-projects-list" ref="pbProjectsList" direction="column">
3
+ <m-link
4
+ :label="linkLabel"
5
+ class="pb-projects-list__back-button"
6
+ :left-icon="BACK_ICON"
7
+ @click.prevent="window.history.go(-1)"
8
+ />
3
9
  <m-flex class="pb-projects-list__title-container" direction="column">
4
- <m-flex justify-content="space-between" wrap full-width>
10
+ <m-flex justify-content="space-between" align-items="center" wrap full-width>
5
11
  <m-heading :label="title" size="s" underline-color="primary-01" />
6
12
  <m-button
7
13
  class="pb-projects-list__hero-button"
@@ -182,6 +188,7 @@ import MButton from '../../../components/mozaic/buttons/MButton.vue';
182
188
  import MContainer from '../../../components/mozaic/grid/MContainer.vue';
183
189
  import MFlex from './../../../components/mozaic/flex/MFlex.vue';
184
190
  import MFlexy from '../../../components/mozaic/grid/MFlexy.vue';
191
+ import MLink from './../../../components/mozaic/link/MLink.vue';
185
192
  import MFlexyCol from '../../../components/mozaic/grid/MFlexyCol.vue';
186
193
  import MHeading from '../../../components/mozaic/heading/MHeading.vue';
187
194
  import MIcon from '../../../components/mozaic/icon/MIcon.vue';
@@ -190,6 +197,9 @@ import PbAnimableLoader from '../../../components/loader/PbAnimableLoader.vue';
190
197
  import PbCard from '../../../components/cards/PbCard.vue';
191
198
  import { Project } from '@/types/pb/Project';
192
199
 
200
+ const BACK_ICON =
201
+ 'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
202
+
193
203
  const PLUS_ICON =
194
204
  'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Control_More_32px.svg';
195
205
  const PROJECT_ICON =
@@ -210,6 +220,7 @@ export default defineComponent({
210
220
  MNotification,
211
221
  PbAnimableLoader,
212
222
  PbCard,
223
+ MLink,
213
224
  },
214
225
 
215
226
  props: {
@@ -234,6 +245,13 @@ export default defineComponent({
234
245
  type: Boolean,
235
246
  default: true,
236
247
  },
248
+ /**
249
+ * Link label
250
+ */
251
+ linkLabel: {
252
+ type: String,
253
+ default: 'Retour',
254
+ },
237
255
  },
238
256
 
239
257
  data: () => ({
@@ -243,6 +261,7 @@ export default defineComponent({
243
261
  showProjectDialog: false,
244
262
  window,
245
263
  showMoreButtonAnimationDelay: 0,
264
+ BACK_ICON,
246
265
  }),
247
266
 
248
267
  computed: {
@@ -353,6 +372,15 @@ $responsive-breakpoint: 'm';
353
372
  padding-right: 0;
354
373
  }
355
374
 
375
+ &__back-button {
376
+ justify-content: flex-start;
377
+ margin-top: $mu200;
378
+
379
+ @include set-from-screen($responsive-breakpoint) {
380
+ margin-top: 0;
381
+ }
382
+ }
383
+
356
384
  &--fade {
357
385
  &-enter-active {
358
386
  transition: opacity 0.3s;
@@ -40,7 +40,7 @@ const getDocumentsByInhabitantProjectId = async (
40
40
  start: number,
41
41
  end: number,
42
42
  inhabitantProjectId: string,
43
- type: string,
43
+ type?: string,
44
44
  ) => {
45
45
  let response;
46
46
  if (type) {
@@ -372,11 +372,12 @@ export const mediaDocumentsListStoreOptions = {
372
372
  ? 0
373
373
  : (state.mediaPerPageCount - (state.mediaList.length % state.mediaPerPageCount)) % state.mediaPerPageCount;
374
374
  const mediaNumberToAdd = mediaNumberToAddOffset + state.mediaPerPageCount;
375
+ const subType = state.context ? state.context.subType : undefined;
375
376
  let media = await getDocumentsByInhabitantProjectId(
376
377
  state.currentMediaPage * state.mediaPerPageCount,
377
378
  state.currentMediaPage * state.mediaPerPageCount + mediaNumberToAdd - 1,
378
379
  state.currentProjectId,
379
- state.context?.subType,
380
+ subType,
380
381
  );
381
382
  commit('addMedia', media.results ? media.results : []);
382
383
 
@@ -411,11 +412,12 @@ export const mediaDocumentsListStoreOptions = {
411
412
  },
412
413
  async refreshMediaList({ commit, dispatch, state }: MediaDocumentsContext) {
413
414
  if (state.currentMediaPage > 0) {
415
+ const subType = state.context ? state.context.subType : undefined;
414
416
  let media = await getDocumentsByInhabitantProjectId(
415
417
  0,
416
418
  state.currentMediaPage * state.mediaPerPageCount - 1,
417
419
  state.currentProjectId,
418
- state.context?.subType,
420
+ subType,
419
421
  );
420
422
  commit('setMediaList', media.results);
421
423