project-booster-vue 9.63.0 → 9.63.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 +1 -1
- package/src/components/appointment/PbAppointmentForm.vue +7 -6
- package/src/components/projects/project-hub/PbProjectHub.vue +2 -0
- package/src/components/projects/projects-list/PbProjectHub.vue +2 -0
- package/src/services/api/appointmentQualificationsApi.ts +0 -16
- package/src/stores/modules/appointmentQualificationStore.ts +0 -18
package/package.json
CHANGED
|
@@ -39,18 +39,19 @@ export default defineComponent({
|
|
|
39
39
|
|
|
40
40
|
const appointmentFormUrl = computed(() => {
|
|
41
41
|
const sessions = store.getters['appointmentQualification/getSessions'];
|
|
42
|
-
store.dispatch('appointmentQualification/getDynamicCalendarId');
|
|
43
42
|
const currentAppointmentQualification =
|
|
44
43
|
store.getters['appointmentQualification/getCurrentAppointmentQualification'];
|
|
45
44
|
const currentUser = store.getters['inhabitants/getCurrentInhabitant'];
|
|
46
45
|
const baseUrl = store.getters['appointmentQualification/getClicRDVBaseUrl'];
|
|
47
|
-
const calendarId = store.getters['appointmentQualification/getCalendarId'];
|
|
48
46
|
|
|
49
47
|
let url = '';
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
+
}
|
|
54
55
|
|
|
55
56
|
if (currentUser) {
|
|
56
57
|
url += `&fiche[email]=${currentUser.email}`;
|
|
@@ -1052,6 +1052,8 @@ export default defineComponent({
|
|
|
1052
1052
|
KITCHEN_REMOTE: 'à distance',
|
|
1053
1053
|
BATHROOM_REMOTE: 'à distance',
|
|
1054
1054
|
BATHROOM_IN_STORE: 'en magasin',
|
|
1055
|
+
BATHROOM_AT_HOME: 'à domicile',
|
|
1056
|
+
BATHROOM_FURNITURES_AND_SHOWER: 'à distance',
|
|
1055
1057
|
})[this.appointment.appointmentType];
|
|
1056
1058
|
return `${prefix} le ${appointmenDateLabel} ${appointmentTypeLabel}`;
|
|
1057
1059
|
},
|
|
@@ -1052,6 +1052,8 @@ export default defineComponent({
|
|
|
1052
1052
|
KITCHEN_REMOTE: 'à distance',
|
|
1053
1053
|
BATHROOM_REMOTE: 'à distance',
|
|
1054
1054
|
BATHROOM_IN_STORE: 'en magasin',
|
|
1055
|
+
BATHROOM_AT_HOME: 'à domicile',
|
|
1056
|
+
BATHROOM_FURNITURES_AND_SHOWER: 'à distance',
|
|
1055
1057
|
})[this.appointment.appointmentType];
|
|
1056
1058
|
return `${prefix} le ${appointmenDateLabel} ${appointmentTypeLabel}`;
|
|
1057
1059
|
},
|
|
@@ -86,26 +86,10 @@ const linkInhabitantProjectToAppointmentQualification = async (data: any, inhabi
|
|
|
86
86
|
);
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
const getCalendarIdFromApi = async (storeId: string, appointmentType: string) => {
|
|
90
|
-
const response = await clientApi.get(
|
|
91
|
-
`/appointment-qualifications/contextualize?storeId=${storeId}&appointmentType=${appointmentType}?`,
|
|
92
|
-
{
|
|
93
|
-
headers: { 'Content-Type': 'application/json' },
|
|
94
|
-
},
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
return JSON.parse(
|
|
98
|
-
JSON.stringify(response.data).replace(/:"([^"]+)"/g, (match, $1) => {
|
|
99
|
-
return `: "${escape($1)}"`;
|
|
100
|
-
}),
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
89
|
export {
|
|
105
90
|
linkInhabitantProjectToAppointmentQualification,
|
|
106
91
|
declarationsWithAppointment,
|
|
107
92
|
saveAnswersByAppointmentQualificationId,
|
|
108
93
|
getAppointmentQualification,
|
|
109
94
|
declarationsWithoutAppointment,
|
|
110
|
-
getCalendarIdFromApi,
|
|
111
95
|
};
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
declarationsWithAppointment,
|
|
5
5
|
declarationsWithoutAppointment,
|
|
6
6
|
linkInhabitantProjectToAppointmentQualification,
|
|
7
|
-
getCalendarIdFromApi,
|
|
8
7
|
} from '../../services/api/appointmentQualificationsApi';
|
|
9
8
|
import { sendAppointmentQualificationEvent, sendAppointmentQualificationAnswers } from '../../services/api/eventsApi';
|
|
10
9
|
import { ActionContext } from 'vuex';
|
|
@@ -21,7 +20,6 @@ export interface AppointmentQualificationState {
|
|
|
21
20
|
currentAppointmentQualification: any;
|
|
22
21
|
sessions: any;
|
|
23
22
|
isQualificationAborted: boolean;
|
|
24
|
-
calendarId: string;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
type AppointmentQualificationContext = ActionContext<AppointmentQualificationState, State>;
|
|
@@ -40,7 +38,6 @@ export default {
|
|
|
40
38
|
currentAppointmentQualification: {},
|
|
41
39
|
sessions: {},
|
|
42
40
|
isQualificationAborted: false,
|
|
43
|
-
calendarId: '',
|
|
44
41
|
},
|
|
45
42
|
|
|
46
43
|
getters: {
|
|
@@ -68,9 +65,6 @@ export default {
|
|
|
68
65
|
isQualificationAborted(state: AppointmentQualificationState) {
|
|
69
66
|
return state.isQualificationAborted;
|
|
70
67
|
},
|
|
71
|
-
getCalendarId(state: AppointmentQualificationState) {
|
|
72
|
-
return state.calendarId;
|
|
73
|
-
},
|
|
74
68
|
},
|
|
75
69
|
|
|
76
70
|
mutations: {
|
|
@@ -98,9 +92,6 @@ export default {
|
|
|
98
92
|
setIsQualificationAborted(state: AppointmentQualificationState, isQualificationAborted: boolean) {
|
|
99
93
|
state.isQualificationAborted = isQualificationAborted;
|
|
100
94
|
},
|
|
101
|
-
setCalendarId(state: AppointmentQualificationState, calendarId: string) {
|
|
102
|
-
state.calendarId = calendarId;
|
|
103
|
-
},
|
|
104
95
|
},
|
|
105
96
|
|
|
106
97
|
actions: {
|
|
@@ -224,14 +215,5 @@ export default {
|
|
|
224
215
|
commit('setCurrentAppointmentQualification', null);
|
|
225
216
|
}
|
|
226
217
|
},
|
|
227
|
-
async getDynamicCalendarId({ commit, state }: AppointmentQualificationContext) {
|
|
228
|
-
try {
|
|
229
|
-
const type = state.sessions.appointmentQualificationFormStructure['__START__']?.meta?.webAnalytics.scenario;
|
|
230
|
-
const result = await getCalendarIdFromApi(state.sessions.storeId, type);
|
|
231
|
-
if (result) {
|
|
232
|
-
commit('setCalendarId', result.id);
|
|
233
|
-
}
|
|
234
|
-
} catch (e) {}
|
|
235
|
-
},
|
|
236
218
|
},
|
|
237
219
|
};
|