project-booster-vue 10.7.8 → 10.7.10

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": "10.7.8",
3
+ "version": "10.7.10",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -1019,9 +1019,7 @@ export default defineComponent({
1019
1019
  ? ''
1020
1020
  : this.appointment.isPast
1021
1021
  ? 'Date du rendez-vous passée.'
1022
- : this.appointment.appointmentType === 'KITCHEN_IN_STORE'
1023
- ? 'Si vous le souhaitez vous pourrez annuler le rendez-vous dans le mail qui vous a été envoyé.<br/>N’oubliez pas !'
1024
- : "Retrouvez le lien d'accès à la visio-conférence dans le mail qui vous a été envoyé.<br/>Si vous le souhaitez vous pourrez annuler le rendez-vous dans ce mail.<br/>N’oubliez pas !";
1022
+ : 'Si vous le souhaitez vous pourrez annuler le rendez-vous dans le mail qui vous a été envoyé.<br/>N’oubliez pas !';
1025
1023
  },
1026
1024
 
1027
1025
  appointmentNotificationLinkLabel() {
@@ -1020,9 +1020,7 @@ export default defineComponent({
1020
1020
  ? ''
1021
1021
  : this.appointment.isPast
1022
1022
  ? 'Date du rendez-vous passée.'
1023
- : this.appointment.appointmentType === 'KITCHEN_IN_STORE'
1024
- ? 'Si vous le souhaitez vous pourrez annuler le rendez-vous dans le mail qui vous a été envoyé.<br/>N’oubliez pas !'
1025
- : "Retrouvez le lien d'accès à la visio-conférence dans le mail qui vous a été envoyé.<br/>Si vous le souhaitez vous pourrez annuler le rendez-vous dans ce mail.<br/>N’oubliez pas !";
1023
+ : 'Si vous le souhaitez vous pourrez annuler le rendez-vous dans le mail qui vous a été envoyé.<br/>N’oubliez pas !';
1026
1024
  },
1027
1025
 
1028
1026
  appointmentNotificationLinkLabel() {
@@ -35,29 +35,25 @@ const props = defineProps({
35
35
 
36
36
  const iframeUri = ref('https://book.timify.com/services?');
37
37
  const store = useStore();
38
+ const showClicRDV = computed(() => store.getters['timify/getShowClicRDV']);
39
+ const getShowServices = computed(() => store.getters['timify/getShowServices']);
40
+ const getAccountId = computed(() => store.getters['timify/getAccountId']);
41
+ const projectId = computed(() => store.getters['appointmentQualification/getCurrentAppointmentQualification']);
42
+ const currentUser = computed(() => store.getters['inhabitants/getCurrentInhabitant']);
43
+ const collaboratorUri = computed(() => store.getters['timify/getCollaboratorUri']);
38
44
 
39
- onBeforeMount(() => {
40
- const sessions: any = computed(() => store.getters['appointmentQualification/getSessions']);
41
- const showClicRDV = computed(() => store.getters['timify/getShowClicRDV']);
42
- const getShowServices = computed(() => store.getters['timify/getShowServices']);
43
- const getAccountId = computed(() => store.getters['timify/getAccountId']);
44
- const currentUser = computed(() => store.getters['inhabitants/getCurrentInhabitant']);
45
- const projectId = computed(() => store.getters['appointmentQualification/getCurrentAppointmentQualification']);
46
- const collaboratorUri = computed(() => store.getters['timify/getCollaboratorUri']);
47
- const metadata = computed(() => store.getters['metaData/metaData']);
48
-
49
- store.dispatch('timify/loadTimify', {
50
- appointmentCategory: props.payload.viewModel.appointmentCategory,
51
- storeId: metadata.value.storeId || sessions.storeId,
52
- });
53
-
54
- store.dispatch('timify/loadCollaboratorUri', {
45
+ onBeforeMount(async () => {
46
+ await store.dispatch('timify/loadCollaboratorUri', {
55
47
  projectId: projectId.value.inhabitantProjectId,
56
48
  });
57
49
 
58
50
  iframeUri.value += `accountId=${getAccountId.value}&showServices=${getShowServices.value}`;
59
- iframeUri.value += `&guestFirstName=${currentUser.value.firstname}&guestLastName=${currentUser.value.lastname}&guestEmail=${currentUser.value.email}&guestPhone=${currentUser.value.phone}`;
60
- iframeUri.value += `&externalCustomerField[inhabitantProjectId]=${projectId.value.inhabitantProjectId}&externalCustomerField[collaboratorLink]=${collaboratorUri.value}&hideCloseButton=true`;
51
+ if (currentUser.value) {
52
+ iframeUri.value += `&guestFirstName=${currentUser.value.firstname || ''}&guestLastName=${
53
+ currentUser.value.lastname || ''
54
+ }&guestEmail=${currentUser.value.email || ''}&guestPhone=${currentUser.value.phone || ''}`;
55
+ }
56
+ iframeUri.value += `&externalCustomerField[inhabitantProjectId]=${projectId.value.inhabitantProjectId}&externalCustomerField[collaboratorLink]=${collaboratorUri.value}&hideCloseButton=true&hideFilledFields=true`;
61
57
  });
62
58
  </script>
63
59
 
@@ -16,15 +16,18 @@ if ((<any>window).config) {
16
16
  * @returns
17
17
  */
18
18
  export const getTimifyObject = async (appointmentCategory: string, storeId: string) => {
19
- const { data, status } = await clientApi.get(
20
- `/appointment-qualifications/timify/is-enabled?storeId=${storeId}&appointmentCategory=${appointmentCategory}`,
21
- );
22
- return {
23
- data: JSON.parse(
24
- JSON.stringify(data).replace(/:"([^"]+)"/g, (match, $1) => {
25
- return `: "${escape($1)}"`;
26
- }),
27
- ),
28
- status,
29
- };
19
+ try {
20
+ const { data, status } = await clientApi.get(
21
+ `/appointment-qualifications/timify/is-enabled?storeId=${storeId}&appointmentCategory=${appointmentCategory}`,
22
+ );
23
+ if (status == 200) {
24
+ return JSON.parse(
25
+ JSON.stringify(data).replace(/:"([^"]+)"/g, (match, $1) => {
26
+ return `: "${escape($1)}"`;
27
+ }),
28
+ );
29
+ }
30
+ } catch (error) {}
31
+
32
+ return null;
30
33
  };
@@ -56,26 +56,22 @@ export default {
56
56
  { commit, state }: TimifyContext,
57
57
  { appointmentCategory, storeId }: { appointmentCategory: string; storeId: string },
58
58
  ) {
59
- const { data, status } = await getTimifyObject(appointmentCategory, storeId.toString());
59
+ const data = await getTimifyObject(appointmentCategory, storeId.toString());
60
60
 
61
- if (status === RequestStatus.SUCCESS) {
62
- if (data) {
63
- if (data.services.length) {
64
- const servicesIds = data.services.map((service: TimifyServices) => {
65
- return service.id;
66
- });
67
- commit('setShowServices', servicesIds.toString());
68
- } else {
69
- commit('setShowClicRDV', true);
70
- }
71
-
72
- if (data.company) {
73
- const accountId = data.company.id;
74
- commit('setAccountId', accountId);
75
- }
61
+ if (data) {
62
+ if (data.services.length) {
63
+ const servicesIds = data.services.map((service: TimifyServices) => {
64
+ return service.id;
65
+ });
66
+ commit('setShowServices', servicesIds.toString());
76
67
  } else {
77
68
  commit('setShowClicRDV', true);
78
69
  }
70
+
71
+ if (data.company) {
72
+ const accountId = data.company.id;
73
+ commit('setAccountId', accountId);
74
+ }
79
75
  } else {
80
76
  commit('setShowClicRDV', true);
81
77
  }