project-booster-vue 10.7.12 → 10.8.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 +1 -1
- package/src/components/configurations/list/PbConfigurationsList.vue +15 -1
- package/src/components/rework/question/MPbQuestion.vue +17 -6
- package/src/components/rework/question/configurations-import/MPbConfigurationsImport.vue +28 -1
- package/src/components/rework/services/event.ts +1 -1
- package/src/components/scenario/PbScenario.vue +1 -1
- package/src/types/pb/Scenario.ts +11 -1
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
/>
|
|
32
32
|
<pb-card
|
|
33
33
|
v-else
|
|
34
|
-
class="pb-configurations-list__card"
|
|
34
|
+
class="pb-configurations-list__card js-cdl"
|
|
35
35
|
:flag-label="configuration.type"
|
|
36
36
|
:hero="configuration.label"
|
|
37
37
|
:flattened="readOnly"
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
:text="`Réalisée le ${formatDate(configuration.creationDate)}`"
|
|
44
44
|
:selected="configuration.selected"
|
|
45
45
|
@click="emitConfigurationClickEvent(configuration)"
|
|
46
|
+
data-cdl-click-type="cdl_event"
|
|
47
|
+
:data-cdl-click-data="
|
|
48
|
+
formatEvent({ button_name: configuration.label, button_location: stepLocation }, EventTypeEnum.BUTTON)
|
|
49
|
+
"
|
|
46
50
|
/>
|
|
47
51
|
</div>
|
|
48
52
|
</m-flexy-col>
|
|
@@ -81,6 +85,7 @@ import PbAnimableLoader from '../../loader/PbAnimableLoader.vue';
|
|
|
81
85
|
import PbCard from '../../cards/PbCard.vue';
|
|
82
86
|
import { format } from 'date-fns';
|
|
83
87
|
import Velocity from 'velocity-animate';
|
|
88
|
+
import { EventTypeEnum, formatEvent } from '../../rework/services/event';
|
|
84
89
|
|
|
85
90
|
export const CONFIGURATION_ANIMATION_DURATION = 50;
|
|
86
91
|
|
|
@@ -134,10 +139,18 @@ export default defineComponent({
|
|
|
134
139
|
type: Boolean,
|
|
135
140
|
default: false,
|
|
136
141
|
},
|
|
142
|
+
/**
|
|
143
|
+
* Step location
|
|
144
|
+
*/
|
|
145
|
+
stepLocation: {
|
|
146
|
+
type: String,
|
|
147
|
+
default: '',
|
|
148
|
+
},
|
|
137
149
|
},
|
|
138
150
|
|
|
139
151
|
data: () => ({
|
|
140
152
|
showMoreButtonAnimationDelay: 0,
|
|
153
|
+
EventTypeEnum,
|
|
141
154
|
}),
|
|
142
155
|
|
|
143
156
|
methods: {
|
|
@@ -196,6 +209,7 @@ export default defineComponent({
|
|
|
196
209
|
*/
|
|
197
210
|
this.$emit('refresh-configuration', configuration);
|
|
198
211
|
},
|
|
212
|
+
formatEvent,
|
|
199
213
|
},
|
|
200
214
|
});
|
|
201
215
|
</script>
|
|
@@ -216,13 +216,20 @@
|
|
|
216
216
|
<m-button
|
|
217
217
|
label="Précédent"
|
|
218
218
|
theme="bordered-neutral"
|
|
219
|
-
class="pb-question__actions-buttons-button"
|
|
219
|
+
class="pb-question__actions-buttons-button js-cdl"
|
|
220
220
|
size="m"
|
|
221
221
|
size-from-l="l"
|
|
222
222
|
@click="$emit('go-back')"
|
|
223
223
|
v-if="!payload.viewModel.hideBackButton"
|
|
224
224
|
icon="ArrowBack48"
|
|
225
225
|
:data-cerberus="sanitizeCerberusAttribut('MPB-QUESTION', 'Etape precedente')"
|
|
226
|
+
data-cdl-click-type="cdl_event"
|
|
227
|
+
:data-cdl-click-data="
|
|
228
|
+
formatEvent(
|
|
229
|
+
{ button_name: 'Etape precedente', button_location: payload.viewModel.analytics.funnel_name },
|
|
230
|
+
EventTypeEnum.BUTTON,
|
|
231
|
+
)
|
|
232
|
+
"
|
|
226
233
|
>
|
|
227
234
|
</m-button>
|
|
228
235
|
</div>
|
|
@@ -769,17 +776,21 @@ const nextStepHandler = () => {
|
|
|
769
776
|
};
|
|
770
777
|
|
|
771
778
|
const updateCdlValues = () => {
|
|
772
|
-
|
|
779
|
+
let answers: any = [];
|
|
773
780
|
|
|
774
781
|
for (const answerCode in Object.fromEntries(selectedAnswers.value)) {
|
|
775
|
-
answers.
|
|
782
|
+
if (!answers.includes(answerCode)) {
|
|
783
|
+
answers.push(answerCode);
|
|
784
|
+
} else {
|
|
785
|
+
answers = answers.filter((item: any) => item !== answerCode);
|
|
786
|
+
}
|
|
776
787
|
}
|
|
777
788
|
|
|
778
789
|
eventData.value = formatEvent(
|
|
779
790
|
{
|
|
780
|
-
field_name: props.payload.viewModel.label,
|
|
781
|
-
funnel_name: props.payload.viewModel.analytics.funnel_name,
|
|
782
|
-
field_value: answers,
|
|
791
|
+
field_name: props.payload.viewModel.label || '',
|
|
792
|
+
funnel_name: props.payload.viewModel.analytics.funnel_name || '',
|
|
793
|
+
field_value: answers || '',
|
|
783
794
|
},
|
|
784
795
|
EventTypeEnum.FIELD,
|
|
785
796
|
);
|
|
@@ -61,15 +61,32 @@
|
|
|
61
61
|
|
|
62
62
|
<div class="pb-configurations-import__redirect-link" v-if="payload.viewModel.redirectLink">
|
|
63
63
|
<m-link
|
|
64
|
+
class="js-cdl"
|
|
64
65
|
:label="payload.viewModel.redirectLink.label"
|
|
65
66
|
@click="callAction(payload.viewModel.redirectLink.nextStep)"
|
|
66
67
|
theme="primary"
|
|
68
|
+
data-cdl-click-type="cdl_event"
|
|
69
|
+
:data-cdl-click-data="
|
|
70
|
+
formatEvent(
|
|
71
|
+
{ button_name: payload.viewModel.redirectLink.label, button_location: stepLocation },
|
|
72
|
+
EventTypeEnum.BUTTON,
|
|
73
|
+
)
|
|
74
|
+
"
|
|
67
75
|
></m-link>
|
|
68
76
|
</div>
|
|
69
77
|
|
|
70
78
|
<div class="pb-configurations-import__buttons row-flex" v-if="payload.callToActions">
|
|
71
79
|
<div class="pb-configurations-import__buttons__button" v-for="button in payload.callToActions">
|
|
72
|
-
<m-button
|
|
80
|
+
<m-button
|
|
81
|
+
class="js-cdl"
|
|
82
|
+
:label="button.label"
|
|
83
|
+
@click="callAction(button.nextStep)"
|
|
84
|
+
:theme="button.theme"
|
|
85
|
+
data-cdl-click-type="cdl_event"
|
|
86
|
+
:data-cdl-click-data="
|
|
87
|
+
formatEvent({ button_name: button.label, button_location: stepLocation }, EventTypeEnum.BUTTON)
|
|
88
|
+
"
|
|
89
|
+
/>
|
|
73
90
|
</div>
|
|
74
91
|
</div>
|
|
75
92
|
</m-container>
|
|
@@ -123,6 +140,7 @@ import { ScenarioStepAnswer } from '@/types/pb/Scenario';
|
|
|
123
140
|
import { Configuration } from '@/types/pb/Configuration';
|
|
124
141
|
import { decorate } from '@/services/decorate';
|
|
125
142
|
import { PayloadAction } from '../../types/genericPayload';
|
|
143
|
+
import { EventTypeEnum, formatEvent } from '../../services/event';
|
|
126
144
|
|
|
127
145
|
const BACK_ICON =
|
|
128
146
|
'https://storage.googleapis.com/project-booster-media/mozaic-icons/svg/Navigation_Arrow_Arrow--Left_16px.svg';
|
|
@@ -192,6 +210,13 @@ export default defineComponent({
|
|
|
192
210
|
type: String,
|
|
193
211
|
default: '0px',
|
|
194
212
|
},
|
|
213
|
+
/**
|
|
214
|
+
* Step location
|
|
215
|
+
*/
|
|
216
|
+
stepLocation: {
|
|
217
|
+
type: String,
|
|
218
|
+
default: '',
|
|
219
|
+
},
|
|
195
220
|
},
|
|
196
221
|
|
|
197
222
|
setup(props, { emit }) {
|
|
@@ -280,6 +305,8 @@ export default defineComponent({
|
|
|
280
305
|
configurationImportSuccess,
|
|
281
306
|
configurationImportError,
|
|
282
307
|
callAction,
|
|
308
|
+
EventTypeEnum,
|
|
309
|
+
formatEvent,
|
|
283
310
|
};
|
|
284
311
|
},
|
|
285
312
|
});
|
|
@@ -33,7 +33,7 @@ export interface FormatEventInterface {
|
|
|
33
33
|
export const formatEvent = (
|
|
34
34
|
{ button_name, button_location, funnel_name, field_name, field_value }: FormatEventInterface,
|
|
35
35
|
type: EventTypeEnum,
|
|
36
|
-
) => {
|
|
36
|
+
): string => {
|
|
37
37
|
let event_data = {};
|
|
38
38
|
|
|
39
39
|
switch (type) {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
:sticky-bottom-offset="stickyBottomOffset()"
|
|
65
65
|
:min-height="minHeight"
|
|
66
66
|
:is-collaborator="isCollaborator"
|
|
67
|
-
:step-location="state.currentStep?.slots?.beforeContent
|
|
67
|
+
:step-location="state.currentStep?.slots?.beforeContent?.label || ''"
|
|
68
68
|
@step-completed="handleStepCompleted"
|
|
69
69
|
@update-selected="handleSemiUpdateSelected"
|
|
70
70
|
@redirection="handleRedirection"
|
package/src/types/pb/Scenario.ts
CHANGED
|
@@ -190,7 +190,7 @@ export interface ScenarioStep {
|
|
|
190
190
|
payload?: ScenarioStepPayload;
|
|
191
191
|
stepCode?: ScenarioStepNextStep;
|
|
192
192
|
meta?: any;
|
|
193
|
-
slots?: ScenarioNestedScenarioSlot
|
|
193
|
+
slots?: ScenarioNestedScenarioSlot;
|
|
194
194
|
trackProgress?: boolean;
|
|
195
195
|
// Step
|
|
196
196
|
resetAnswersOnBack?: boolean;
|
|
@@ -204,6 +204,16 @@ export interface ScenarioNestedScenarioSlotPayload {
|
|
|
204
204
|
export interface ScenarioNestedScenarioSlot {
|
|
205
205
|
component?: string;
|
|
206
206
|
payload?: ScenarioNestedScenarioSlotPayload;
|
|
207
|
+
beforeContent?: ScenarioNestedScenarioSlotBeforeContent;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface ScenarioNestedScenarioSlotBeforeContent {
|
|
211
|
+
label?: string;
|
|
212
|
+
display?: boolean;
|
|
213
|
+
sizeXlWidth?: boolean;
|
|
214
|
+
component?: string;
|
|
215
|
+
totalStep?: number;
|
|
216
|
+
currentStep?: number;
|
|
207
217
|
}
|
|
208
218
|
|
|
209
219
|
export interface ScenarioStepNextStep {
|