project-booster-vue 9.28.2 → 9.29.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.
Files changed (9) hide show
  1. package/package.json +1 -1
  2. package/src/components/appointment/PbAppointmentForm.stories.mdx +22 -2
  3. package/src/components/appointment/PbAppointmentForm.vue +21 -4
  4. package/src/components/appointment/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-appointment-qualification-pb-appointment-form-/360/237/246/240-101-sandbox-1-snap.png +0 -0
  5. package/src/components/appointment/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-appointment-qualification-pb-appointment-form-/360/237/246/240-with-custom-calendar-1-snap.png +0 -0
  6. package/src/components/projects/project-hub/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-components-projects-pb-project-hub-/360/237/246/240-features-documents-media-showcase-with-media-documents-1-snap.png +0 -0
  7. package/src/components/question/city-search/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-scenario-questions-pb-city-search-/360/237/246/240-showcase-feature-customize-1-snap.png +0 -0
  8. package/src/components/question/city-search/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-scenario-questions-pb-city-search-/360/237/246/240-showcase-feature-previous-value-from-answer-1-snap.png +0 -0
  9. package/src/components/question/city-search/__snapshots__/storyshots-puppeteer-test-puppeteer-ts-image-storyshots-project-booster-scenario-questions-pb-city-search-/360/237/246/240-showcase-feature-previous-value-from-default-1-snap.png +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-booster-vue",
3
- "version": "9.28.2",
3
+ "version": "9.29.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -71,8 +71,7 @@ export const TemplateSandbox = (args, { argTypes }) => ({
71
71
  store.commit('appointmentQualification/setClicRDVBaseUrl', 'https://sandbox-user.clicrdv.com');
72
72
  return { args };
73
73
  },
74
- template: `<pb-appointment-form />
75
- />`,
74
+ template: `<pb-appointment-form :payload="args.payload" />`,
76
75
  });
77
76
 
78
77
  <Canvas>
@@ -92,3 +91,24 @@ export const TemplateSandbox = (args, { argTypes }) => ({
92
91
  </Canvas>
93
92
 
94
93
  <ArgsTable story="101 Sandbox" />
94
+
95
+ # 🦠 `PbAppointmentForm` - Component with custom calendar
96
+
97
+ The `PbAppointmentForm` component that include in a iframe the clicRDV form with custom calendar.
98
+
99
+ <Canvas>
100
+ <Story
101
+ inline={false}
102
+ height="862px"
103
+ name="With custom calendar"
104
+ args={{ payload: { viewModel: { calendarUrlPath: 'custom-calendar' } } }}
105
+ parameters={{
106
+ msw: [
107
+ rest.get('/api/inhabitant-api/users/:buId/:inhabitantId', getInhabitantByIdResolver),
108
+ rest.post('/api/declarations-without-appointment', declarationsWithAppointmentResolver),
109
+ ],
110
+ }}
111
+ >
112
+ {TemplateSandbox.bind({})}
113
+ </Story>
114
+ </Canvas>
@@ -23,7 +23,18 @@ export default defineComponent({
23
23
  name: 'PbAppointmentForm',
24
24
  components: { MFlex },
25
25
 
26
- setup() {
26
+ props: {
27
+ /**
28
+ * The component view model and business data as an object.
29
+ */
30
+ payload: {
31
+ type: Object,
32
+ default: () => null,
33
+ required: false,
34
+ },
35
+ },
36
+
37
+ setup(props) {
27
38
  const store = useStore();
28
39
 
29
40
  const appointmentFormUrl = computed(() => {
@@ -33,9 +44,15 @@ export default defineComponent({
33
44
  const currentUser = store.getters['inhabitants/getCurrentInhabitant'];
34
45
  const baseUrl = store.getters['appointmentQualification/getClicRDVBaseUrl'];
35
46
 
36
- let url = `${baseUrl}/leroy-merlin-${sessions.storeId}`;
37
- url += `?calendar_id=${sessions.calendarId}`;
38
- url += `&vevent[str5]=${currentAppointmentQualification.inhabitantProjectId}`;
47
+ let url = '';
48
+ if (props.payload?.viewModel?.calendarUrlPath) {
49
+ url = `${baseUrl}/${props.payload.viewModel.calendarUrlPath}?`;
50
+ } else {
51
+ url = `${baseUrl}/leroy-merlin-${sessions.storeId}`;
52
+ url += `?calendar_id=${sessions.calendarId}`;
53
+ url += `&vevent[str5]=${currentAppointmentQualification.inhabitantProjectId}`;
54
+ }
55
+
39
56
  if (currentUser) {
40
57
  url += `&fiche[email]=${currentUser.email}`;
41
58
  url += `&fiche[lastname]=${currentUser.lastName}`;