project-booster-vue 10.22.8 → 10.22.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 +1 -1
- package/src/components/configurations/list/PbConfigurationsList.vue +0 -4
- package/src/components/pedagogy/PbPedagogy.vue +0 -30
- package/src/components/products/PbProducts.vue +0 -4
- package/src/components/question/PbQuestion.vue +0 -28
- package/src/components/question/city-search/PbCitySearch.vue +0 -10
- package/src/components/question/incremental-amount-input/PbIncrementalAmountInput.vue +0 -10
- package/src/components/question/name-input/PbNameInput.vue +0 -10
- package/src/components/rework/alert/MPbAlert.vue +18 -12
- package/src/components/rework/exit-options/MPbExitOptions.vue +17 -22
- package/src/components/rework/navigation/MPbNavigation.vue +29 -20
- package/src/components/rework/products/MPbProducts.vue +2 -15
- package/src/components/rework/question/MPbQuestion.vue +22 -46
- package/src/components/rework/question/city-search/MPbCitySearch.vue +8 -0
- package/src/components/rework/question/configurations-import/MPbConfigurationsImport.vue +8 -11
- package/src/components/rework/question/dimensions-input/MPbDimensionsInput.vue +8 -0
- package/src/components/rework/question/incremental-amount-input/MPbIncrementalAmountInput.vue +8 -0
- package/src/components/rework/question/list-select/MPbListSelect.vue +10 -2
- package/src/components/rework/question/space-input/MPbSpaceInput.vue +8 -0
- package/src/components/rework/question/upload-document/MPbUploadDocument.vue +8 -0
- package/src/components/rework/restitution/MPbRestitutionList.vue +0 -8
- package/src/components/rework/services/event.ts +49 -47
- package/src/components/scenario/PbScenario.vue +3 -0
- package/src/components/trezor/PbTrezor.vue +0 -8
- package/src/components/warning-message/PbWarningMessage.vue +0 -12
package/package.json
CHANGED
|
@@ -44,10 +44,6 @@
|
|
|
44
44
|
:text="`Réalisée le ${formatDate(configuration.creationDate)}`"
|
|
45
45
|
:selected="configuration.selected"
|
|
46
46
|
@click="emitConfigurationClickEvent(configuration)"
|
|
47
|
-
data-cdl-click-type="cdl_event"
|
|
48
|
-
:data-cdl-click-data="
|
|
49
|
-
formatEvent({ button_name: configuration.label, button_location: stepLocation }, EventTypeEnum.BUTTON)
|
|
50
|
-
"
|
|
51
47
|
/>
|
|
52
48
|
</div>
|
|
53
49
|
</m-flexy-col>
|
|
@@ -27,16 +27,6 @@
|
|
|
27
27
|
:label="payload.viewModel.showFormLead.buttonLabel"
|
|
28
28
|
class="pb-pedagogy__form-lead__button mc-button--full js-cdl"
|
|
29
29
|
@click="saveFormLead(payload.viewModel.showFormLead)"
|
|
30
|
-
data-cdl-click-type="cdl_event"
|
|
31
|
-
:data-cdl-click-data="
|
|
32
|
-
formatEvent(
|
|
33
|
-
{
|
|
34
|
-
button_name: payload.viewModel.showFormLead.buttonLabel,
|
|
35
|
-
button_location: stepLocation || '',
|
|
36
|
-
},
|
|
37
|
-
EventTypeEnum.BUTTON,
|
|
38
|
-
)
|
|
39
|
-
"
|
|
40
30
|
/>
|
|
41
31
|
</form>
|
|
42
32
|
<m-flex
|
|
@@ -53,16 +43,6 @@
|
|
|
53
43
|
:label="payload.viewModel.downloadButton.label"
|
|
54
44
|
class="pb-pedagogy__content-upload-button mc-button--full js-cdl"
|
|
55
45
|
@click="handleButtonLinkClicked"
|
|
56
|
-
data-cdl-click-type="cdl_event"
|
|
57
|
-
:data-cdl-click-data="
|
|
58
|
-
formatEvent(
|
|
59
|
-
{
|
|
60
|
-
button_name: payload.viewModel.downloadButton.label,
|
|
61
|
-
button_location: stepLocation || '',
|
|
62
|
-
},
|
|
63
|
-
EventTypeEnum.BUTTON,
|
|
64
|
-
)
|
|
65
|
-
"
|
|
66
46
|
/>
|
|
67
47
|
<m-button
|
|
68
48
|
v-for="action in payload.callToActions"
|
|
@@ -70,16 +50,6 @@
|
|
|
70
50
|
:label="action.label"
|
|
71
51
|
class="pb-pedagogy__content-action-button mc-button--full js-cdl"
|
|
72
52
|
@click="handleValidateClicked(action)"
|
|
73
|
-
data-cdl-click-type="cdl_event"
|
|
74
|
-
:data-cdl-click-data="
|
|
75
|
-
formatEvent(
|
|
76
|
-
{
|
|
77
|
-
button_name: action.label,
|
|
78
|
-
button_location: stepLocation || '',
|
|
79
|
-
},
|
|
80
|
-
EventTypeEnum.BUTTON,
|
|
81
|
-
)
|
|
82
|
-
"
|
|
83
53
|
/>
|
|
84
54
|
</m-flex>
|
|
85
55
|
<m-flex
|
|
@@ -37,10 +37,6 @@
|
|
|
37
37
|
v-for="action in payload.callToActions"
|
|
38
38
|
:key="action.label"
|
|
39
39
|
@click="callAction(action.action)"
|
|
40
|
-
data-cdl-click-type="cdl_event"
|
|
41
|
-
:data-cdl-click-data="
|
|
42
|
-
formatEvent({ button_name: action.label, button_location: stepLocation }, EventTypeEnum.BUTTON)
|
|
43
|
-
"
|
|
44
40
|
/>
|
|
45
41
|
</m-flex>
|
|
46
42
|
</m-flex>
|
|
@@ -118,21 +118,6 @@
|
|
|
118
118
|
@card-click="answer?.viewModel?.href ? '' : selectAnswer(payload.code, answer)"
|
|
119
119
|
@button-click="handleAnswerButtonClick"
|
|
120
120
|
@link-click="handleLinkClick(answer)"
|
|
121
|
-
data-cdl-click-type="cdl_event"
|
|
122
|
-
:data-cdl-click-data="
|
|
123
|
-
formatEvent(
|
|
124
|
-
{
|
|
125
|
-
button_name: decorate(
|
|
126
|
-
answers,
|
|
127
|
-
runtimeOptions,
|
|
128
|
-
answer?.viewModel?.title,
|
|
129
|
-
payload.defaultDecoratorValue,
|
|
130
|
-
),
|
|
131
|
-
button_location: stepLocation || '',
|
|
132
|
-
},
|
|
133
|
-
EventTypeEnum.BUTTON,
|
|
134
|
-
)
|
|
135
|
-
"
|
|
136
121
|
/>
|
|
137
122
|
<m-button
|
|
138
123
|
v-else
|
|
@@ -224,8 +209,6 @@
|
|
|
224
209
|
v-if="isValidateMultiselectButtonDisplayed()"
|
|
225
210
|
class="pb-question__actions-buttons-button"
|
|
226
211
|
:class="{ 'js-cdl': trackingStatus }"
|
|
227
|
-
data-cdl-click-type="cdl_event"
|
|
228
|
-
:data-cdl-click-data="eventData"
|
|
229
212
|
size="m"
|
|
230
213
|
size-from-l="l"
|
|
231
214
|
:label="payload.multiSelect.actions.VALIDATE.label"
|
|
@@ -527,7 +510,6 @@ export default defineComponent({
|
|
|
527
510
|
showNotification: false,
|
|
528
511
|
showModal: false,
|
|
529
512
|
EventTypeEnum,
|
|
530
|
-
eventData: {},
|
|
531
513
|
}),
|
|
532
514
|
|
|
533
515
|
computed: {
|
|
@@ -856,16 +838,6 @@ export default defineComponent({
|
|
|
856
838
|
answers = answers.filter((item: any) => item !== answerCode);
|
|
857
839
|
}
|
|
858
840
|
}
|
|
859
|
-
|
|
860
|
-
this.eventData = formatEvent(
|
|
861
|
-
{
|
|
862
|
-
field_name: this.payload.viewModel?.label || '',
|
|
863
|
-
funnel_name: this.payload.viewModel.analytics?.funnel_name || '',
|
|
864
|
-
field_value: answers || '',
|
|
865
|
-
step_number: this.payload.viewModel?.stepNumber,
|
|
866
|
-
},
|
|
867
|
-
EventTypeEnum.SUBMIT,
|
|
868
|
-
);
|
|
869
841
|
},
|
|
870
842
|
},
|
|
871
843
|
});
|
|
@@ -97,16 +97,6 @@
|
|
|
97
97
|
size="l"
|
|
98
98
|
@click="handleFormValidation"
|
|
99
99
|
:data-cerberus="sanitizeCerberusAttribut('PB-CITY-SEARCH', 'VALIDATE')"
|
|
100
|
-
data-cdl-click-type="cdl_event"
|
|
101
|
-
:data-cdl-click-data="
|
|
102
|
-
formatEvent(
|
|
103
|
-
{
|
|
104
|
-
button_name: computedPayload.viewModel.actionLabel,
|
|
105
|
-
button_location: stepLocation || '',
|
|
106
|
-
},
|
|
107
|
-
EventTypeEnum.BUTTON,
|
|
108
|
-
)
|
|
109
|
-
"
|
|
110
100
|
/>
|
|
111
101
|
</m-flex>
|
|
112
102
|
</div>
|
|
@@ -57,16 +57,6 @@
|
|
|
57
57
|
size="l"
|
|
58
58
|
type="submit"
|
|
59
59
|
:data-cerberus="sanitizeCerberusAttribut('PB-INCREMENTAL-AMOUNT', 'INPUT')"
|
|
60
|
-
data-cdl-click-type="cdl_event"
|
|
61
|
-
:data-cdl-click-data="
|
|
62
|
-
formatEvent(
|
|
63
|
-
{
|
|
64
|
-
button_name: computedPayload.viewModel.actionLabel,
|
|
65
|
-
button_location: stepLocation || '',
|
|
66
|
-
},
|
|
67
|
-
EventTypeEnum.BUTTON,
|
|
68
|
-
)
|
|
69
|
-
"
|
|
70
60
|
/>
|
|
71
61
|
</m-flex>
|
|
72
62
|
</form>
|
|
@@ -39,16 +39,6 @@
|
|
|
39
39
|
size="l"
|
|
40
40
|
@click="handleFormSubmit"
|
|
41
41
|
:data-cerberus="sanitizeCerberusAttribut('PB-NAME-INPUT', 'BUTTON')"
|
|
42
|
-
data-cdl-click-type="cdl_event"
|
|
43
|
-
:data-cdl-click-data="
|
|
44
|
-
formatEvent(
|
|
45
|
-
{
|
|
46
|
-
button_name: computedPayload.viewModel.actionLabel,
|
|
47
|
-
button_location: stepLocation || '',
|
|
48
|
-
},
|
|
49
|
-
EventTypeEnum.BUTTON,
|
|
50
|
-
)
|
|
51
|
-
"
|
|
52
42
|
/>
|
|
53
43
|
</m-flex>
|
|
54
44
|
</m-flex>
|
|
@@ -31,17 +31,6 @@
|
|
|
31
31
|
size="s"
|
|
32
32
|
theme="bordered-primary-02"
|
|
33
33
|
:class="{ 'js-cdl': trackingStatus }"
|
|
34
|
-
:data-cdl-click="
|
|
35
|
-
JSON.stringify([
|
|
36
|
-
[
|
|
37
|
-
'cdl_event',
|
|
38
|
-
formatEvent(
|
|
39
|
-
{ button_name: options?.viewModel?.button?.label, button_location: stepLocation },
|
|
40
|
-
EventTypeEnum.BUTTON,
|
|
41
|
-
),
|
|
42
|
-
],
|
|
43
|
-
])
|
|
44
|
-
"
|
|
45
34
|
/>
|
|
46
35
|
</template>
|
|
47
36
|
</m-card>
|
|
@@ -54,6 +43,8 @@
|
|
|
54
43
|
:step-number="stepNumber"
|
|
55
44
|
:next-step-type="EventTypeEnum.BUTTON"
|
|
56
45
|
:trackingStatus="trackingStatus"
|
|
46
|
+
:answers="answers"
|
|
47
|
+
:funnel-name="funnelName"
|
|
57
48
|
@go-back="$emit('go-back')"
|
|
58
49
|
@next-step="callAction(payload.viewModel.nextStep, [], emit)"
|
|
59
50
|
/>
|
|
@@ -82,10 +73,11 @@
|
|
|
82
73
|
<script lang="ts" setup>
|
|
83
74
|
import { MNotification, MButton, MCard, MModal } from '@mozaic-ds/vue-3';
|
|
84
75
|
import { callAction } from '../services/navigate';
|
|
85
|
-
import { ref } from 'vue';
|
|
76
|
+
import { ref, PropType } from 'vue';
|
|
86
77
|
import { useStore } from 'vuex';
|
|
87
78
|
import { EventTypeEnum, formatEvent } from '../services/event';
|
|
88
79
|
import MPbNavigation from '../navigation/MPbNavigation.vue';
|
|
80
|
+
import { ScenarioStepAnswer } from '@/types/pb/Scenario';
|
|
89
81
|
|
|
90
82
|
const emit = defineEmits(['go-back', 'step-completed']);
|
|
91
83
|
const showModal = ref(false);
|
|
@@ -103,6 +95,13 @@ const props = defineProps({
|
|
|
103
95
|
type: Object,
|
|
104
96
|
default: () => ({}),
|
|
105
97
|
},
|
|
98
|
+
/**
|
|
99
|
+
* The previous answers to inject
|
|
100
|
+
*/
|
|
101
|
+
answers: {
|
|
102
|
+
type: Object as PropType<Map<string, ScenarioStepAnswer[]>>,
|
|
103
|
+
default: () => new Map<string, ScenarioStepAnswer[]>(),
|
|
104
|
+
},
|
|
106
105
|
/**
|
|
107
106
|
* Show step location
|
|
108
107
|
*/
|
|
@@ -124,6 +123,13 @@ const props = defineProps({
|
|
|
124
123
|
type: Number,
|
|
125
124
|
default: 0,
|
|
126
125
|
},
|
|
126
|
+
/**
|
|
127
|
+
* Analytics funnel name
|
|
128
|
+
*/
|
|
129
|
+
funnelName: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: '',
|
|
132
|
+
},
|
|
127
133
|
});
|
|
128
134
|
|
|
129
135
|
const handleCloseModal = () => {
|
|
@@ -40,17 +40,6 @@
|
|
|
40
40
|
:data-cerberus="sanitizeCerberusAttribut('MPB-EXIT-OPTIONS', payload.viewModel.backButton.label)"
|
|
41
41
|
icon="ArrowBack48"
|
|
42
42
|
:class="{ 'js-cdl': trackingStatus }"
|
|
43
|
-
:data-cdl-click="
|
|
44
|
-
JSON.stringify([
|
|
45
|
-
[
|
|
46
|
-
'cdl_event',
|
|
47
|
-
formatEvent(
|
|
48
|
-
{ button_name: payload?.viewModel?.backButton?.label || 'Précédent', button_location: stepLocation },
|
|
49
|
-
EventTypeEnum.BUTTON,
|
|
50
|
-
),
|
|
51
|
-
],
|
|
52
|
-
])
|
|
53
|
-
"
|
|
54
43
|
/>
|
|
55
44
|
</div>
|
|
56
45
|
|
|
@@ -66,17 +55,14 @@
|
|
|
66
55
|
iconPosition="right"
|
|
67
56
|
:class="{ 'js-cdl': trackingStatus }"
|
|
68
57
|
:data-cdl-click="
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
EventTypeEnum.BUTTON,
|
|
78
|
-
),
|
|
79
|
-
],
|
|
58
|
+
formatEvent([
|
|
59
|
+
{
|
|
60
|
+
attributes: {
|
|
61
|
+
button_name: condition.viewModel?.nextStep?.label || 'Étape suivante',
|
|
62
|
+
button_location: payload.viewModel?.title,
|
|
63
|
+
},
|
|
64
|
+
type: EventTypeEnum.BUTTON,
|
|
65
|
+
},
|
|
80
66
|
])
|
|
81
67
|
"
|
|
82
68
|
/>
|
|
@@ -85,12 +71,14 @@
|
|
|
85
71
|
|
|
86
72
|
<m-pb-navigation
|
|
87
73
|
v-if="payload?.viewModel?.nextStep"
|
|
74
|
+
:answers="answers"
|
|
88
75
|
:payload="payload"
|
|
89
76
|
:nextButtonAction="payload.viewModel.nextStep"
|
|
90
77
|
:step-number="stepNumber"
|
|
91
78
|
:next-step-type="EventTypeEnum.BUTTON"
|
|
92
79
|
:trackingStatus="trackingStatus"
|
|
93
80
|
:runtime-options="runtimeOptions"
|
|
81
|
+
:funnel-name="funnelName"
|
|
94
82
|
@go-back="$emit('go-back')"
|
|
95
83
|
@next-step="goToNavigation(payload.viewModel.nextStep)"
|
|
96
84
|
/>
|
|
@@ -158,6 +146,13 @@ const props = defineProps({
|
|
|
158
146
|
type: Number,
|
|
159
147
|
default: 0,
|
|
160
148
|
},
|
|
149
|
+
/**
|
|
150
|
+
* Analytics funnel name
|
|
151
|
+
*/
|
|
152
|
+
funnelName: {
|
|
153
|
+
type: String,
|
|
154
|
+
default: '',
|
|
155
|
+
},
|
|
161
156
|
});
|
|
162
157
|
|
|
163
158
|
const store = useStore();
|
|
@@ -8,14 +8,6 @@
|
|
|
8
8
|
icon="ArrowBack48"
|
|
9
9
|
:data-cerberus="sanitizeCerberusAttribut('MPB-NAVIGATION', backButtonLabel)"
|
|
10
10
|
:class="{ 'js-cdl': trackingStatus }"
|
|
11
|
-
:data-cdl-click="
|
|
12
|
-
JSON.stringify([
|
|
13
|
-
[
|
|
14
|
-
'cdl_event',
|
|
15
|
-
formatEvent({ button_name: backButtonLabel, button_location: stepLocation }, EventTypeEnum.BUTTON),
|
|
16
|
-
],
|
|
17
|
-
])
|
|
18
|
-
"
|
|
19
11
|
/>
|
|
20
12
|
</div>
|
|
21
13
|
<div class="m-pb-navigation__right column-full">
|
|
@@ -31,18 +23,7 @@
|
|
|
31
23
|
:data-cerberus="sanitizeCerberusAttribut('MPB-NAVIGATION', nextButtonLabel)"
|
|
32
24
|
:class="{ 'js-cdl': trackingStatus }"
|
|
33
25
|
:disabled="disabledNextButton"
|
|
34
|
-
:data-cdl-click="
|
|
35
|
-
JSON.stringify([
|
|
36
|
-
[
|
|
37
|
-
'cdl_event',
|
|
38
|
-
formatEvent(
|
|
39
|
-
{ button_name: nextButtonLabel, funnel_name: stepLocation, step_number: stepNumber },
|
|
40
|
-
nextStepType,
|
|
41
|
-
),
|
|
42
|
-
],
|
|
43
|
-
['cdl_event', formatEvent({ step_number: stepNumber, field_value: answers }, EventTypeEnum.SUBMIT)],
|
|
44
|
-
])
|
|
45
|
-
"
|
|
26
|
+
:data-cdl-click="cdlClickDate"
|
|
46
27
|
/>
|
|
47
28
|
</div>
|
|
48
29
|
</div>
|
|
@@ -136,6 +117,13 @@ const props = defineProps({
|
|
|
136
117
|
type: String as () => EventTypeEnum,
|
|
137
118
|
default: EventTypeEnum.SUBMIT,
|
|
138
119
|
},
|
|
120
|
+
/**
|
|
121
|
+
* Analytics funnel name
|
|
122
|
+
*/
|
|
123
|
+
funnelName: {
|
|
124
|
+
type: String,
|
|
125
|
+
default: '',
|
|
126
|
+
},
|
|
139
127
|
});
|
|
140
128
|
|
|
141
129
|
const emitClickEvent = (nextStep: any) => {
|
|
@@ -160,6 +148,27 @@ const emitClickEvent = (nextStep: any) => {
|
|
|
160
148
|
}
|
|
161
149
|
}
|
|
162
150
|
};
|
|
151
|
+
|
|
152
|
+
const cdlClickDate = (): String => {
|
|
153
|
+
return formatEvent([
|
|
154
|
+
// {
|
|
155
|
+
// attributes: {
|
|
156
|
+
// field_name: props.payload?.viewModel?.label,
|
|
157
|
+
// field_value: props.selectedAnswer,
|
|
158
|
+
// funnel_name: props.funnelName,
|
|
159
|
+
// step_number: props.stepNumber,
|
|
160
|
+
// },
|
|
161
|
+
// type: EventTypeEnum.FIELD,
|
|
162
|
+
// },
|
|
163
|
+
{
|
|
164
|
+
attributes: {
|
|
165
|
+
funnel_name: props.funnelName,
|
|
166
|
+
step_number: props.stepNumber,
|
|
167
|
+
},
|
|
168
|
+
type: EventTypeEnum.SUBMIT,
|
|
169
|
+
},
|
|
170
|
+
]);
|
|
171
|
+
};
|
|
163
172
|
</script>
|
|
164
173
|
|
|
165
174
|
<style lang="scss">
|
|
@@ -35,14 +35,6 @@
|
|
|
35
35
|
:theme="action.bordered ? 'bordered' : 'solid'"
|
|
36
36
|
class="pb-products__container--button__ok"
|
|
37
37
|
:class="{ 'js-cdl': trackingStatus }"
|
|
38
|
-
:data-cdl-click="
|
|
39
|
-
JSON.stringify([
|
|
40
|
-
[
|
|
41
|
-
'cdl_event',
|
|
42
|
-
formatEvent({ button_name: action.label, button_location: stepLocation }, EventTypeEnum.BUTTON),
|
|
43
|
-
],
|
|
44
|
-
])
|
|
45
|
-
"
|
|
46
38
|
:type="action.type"
|
|
47
39
|
:label="action.label"
|
|
48
40
|
icon-position="right"
|
|
@@ -61,7 +53,7 @@
|
|
|
61
53
|
import { useStore } from 'vuex';
|
|
62
54
|
import { MButton, MLink } from '@mozaic-ds/vue-3';
|
|
63
55
|
import { ScenarioProduct, ScenarioStepAnswer } from '@/types/pb/Scenario';
|
|
64
|
-
import { defineProps, PropType, onMounted, ref, Ref } from 'vue';
|
|
56
|
+
import { defineProps, PropType, onMounted, ref, Ref, computed } from 'vue';
|
|
65
57
|
import { PayloadAction } from '../types/genericPayload';
|
|
66
58
|
import { formatEvent, EventTypeEnum } from '../services/event';
|
|
67
59
|
|
|
@@ -70,11 +62,7 @@ const emit = defineEmits(['go-back', 'step-completed']);
|
|
|
70
62
|
const store = useStore();
|
|
71
63
|
const metadata = store.getters['metaData/metaData'];
|
|
72
64
|
const refProduct = store.getters['products/getRefProduct'];
|
|
73
|
-
const product
|
|
74
|
-
photo: '',
|
|
75
|
-
designation: '',
|
|
76
|
-
value: '',
|
|
77
|
-
});
|
|
65
|
+
const product = computed(() => store.getters['products/getCurrentProduct']);
|
|
78
66
|
|
|
79
67
|
const props = defineProps({
|
|
80
68
|
/**
|
|
@@ -139,7 +127,6 @@ onMounted(() => {
|
|
|
139
127
|
payload: props.payload.viewModel.defaultProduct,
|
|
140
128
|
storeId: metadata && metadata.storeId ? metadata.storeId : '',
|
|
141
129
|
});
|
|
142
|
-
product.value = store.getters['products/getCurrentProduct'];
|
|
143
130
|
}
|
|
144
131
|
});
|
|
145
132
|
|
|
@@ -81,25 +81,6 @@
|
|
|
81
81
|
@card-click="handleCardClick(answer, payload)"
|
|
82
82
|
@button-click="handleAnswerButtonClick"
|
|
83
83
|
@link-click="handleLinkClick(answer)"
|
|
84
|
-
:data-cdl-click="
|
|
85
|
-
JSON.stringify([
|
|
86
|
-
[
|
|
87
|
-
'cdl_event',
|
|
88
|
-
formatEvent(
|
|
89
|
-
{
|
|
90
|
-
button_name: decorate(
|
|
91
|
-
answers,
|
|
92
|
-
runtimeOptions,
|
|
93
|
-
answer?.viewModel?.title,
|
|
94
|
-
payload?.defaultDecoratorValue,
|
|
95
|
-
),
|
|
96
|
-
button_location: stepLocation,
|
|
97
|
-
},
|
|
98
|
-
EventTypeEnum.BUTTON,
|
|
99
|
-
),
|
|
100
|
-
],
|
|
101
|
-
])
|
|
102
|
-
"
|
|
103
84
|
/>
|
|
104
85
|
<m-button
|
|
105
86
|
v-else
|
|
@@ -256,20 +237,6 @@
|
|
|
256
237
|
v-if="!payload.viewModel.hideBackButton"
|
|
257
238
|
icon="ArrowBack48"
|
|
258
239
|
:data-cerberus="sanitizeCerberusAttribut('MPB-QUESTION', 'Etape precedente')"
|
|
259
|
-
:data-cdl-click="
|
|
260
|
-
JSON.stringify([
|
|
261
|
-
[
|
|
262
|
-
'cdl_event',
|
|
263
|
-
formatEvent(
|
|
264
|
-
{
|
|
265
|
-
button_name: 'Etape precedente',
|
|
266
|
-
button_location: payload?.viewModel?.analytics?.funnel_name || '',
|
|
267
|
-
},
|
|
268
|
-
EventTypeEnum.BUTTON,
|
|
269
|
-
),
|
|
270
|
-
],
|
|
271
|
-
])
|
|
272
|
-
"
|
|
273
240
|
>
|
|
274
241
|
</m-button>
|
|
275
242
|
</div>
|
|
@@ -882,19 +849,28 @@ const updateCdlValues = () => {
|
|
|
882
849
|
}
|
|
883
850
|
}
|
|
884
851
|
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
852
|
+
let analyticsEvents = [
|
|
853
|
+
{
|
|
854
|
+
attributes: {
|
|
855
|
+
funnel_name: props.payload?.viewModel?.analytics?.funnel_name || props.payload?.viewModel?.label || '',
|
|
856
|
+
step_number: props.stepNumber,
|
|
857
|
+
},
|
|
858
|
+
type: EventTypeEnum.SUBMIT,
|
|
859
|
+
},
|
|
860
|
+
] as any[];
|
|
861
|
+
if (answers.length) {
|
|
862
|
+
analyticsEvents.push({
|
|
863
|
+
attributes: {
|
|
864
|
+
field_name: props.payload?.viewModel?.label,
|
|
865
|
+
field_value: answers,
|
|
866
|
+
funnel_name: props.payload?.viewModel?.analytics?.funnel_name || props.payload?.viewModel?.label || '',
|
|
867
|
+
step_number: props.stepNumber,
|
|
868
|
+
},
|
|
869
|
+
type: EventTypeEnum.FIELD,
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
eventData.value = formatEvent(analyticsEvents);
|
|
898
874
|
};
|
|
899
875
|
</script>
|
|
900
876
|
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
:trackingStatus="trackingStatus"
|
|
77
77
|
:step-number="stepNumber"
|
|
78
78
|
:runtime-options="runtimeOptions"
|
|
79
|
+
:funnel-name="funnelName"
|
|
79
80
|
@go-back="$emit('go-back')"
|
|
80
81
|
@next-step="nextStep"
|
|
81
82
|
/>
|
|
@@ -176,6 +177,13 @@ export default defineComponent({
|
|
|
176
177
|
type: Number,
|
|
177
178
|
default: 0,
|
|
178
179
|
},
|
|
180
|
+
/**
|
|
181
|
+
* Analytics funnel name
|
|
182
|
+
*/
|
|
183
|
+
funnelName: {
|
|
184
|
+
type: String,
|
|
185
|
+
default: '',
|
|
186
|
+
},
|
|
179
187
|
},
|
|
180
188
|
|
|
181
189
|
data: () => ({
|
|
@@ -53,17 +53,6 @@
|
|
|
53
53
|
:label="payload.viewModel.redirectLink.label"
|
|
54
54
|
@click="callAction(payload.viewModel.redirectLink.nextStep)"
|
|
55
55
|
theme="primary"
|
|
56
|
-
:data-cdl-click="
|
|
57
|
-
JSON.stringify([
|
|
58
|
-
[
|
|
59
|
-
'cdl_event',
|
|
60
|
-
formatEvent(
|
|
61
|
-
{ button_name: payload.viewModel?.redirectLink?.label, button_location: stepLocation },
|
|
62
|
-
EventTypeEnum.BUTTON,
|
|
63
|
-
),
|
|
64
|
-
],
|
|
65
|
-
])
|
|
66
|
-
"
|
|
67
56
|
></m-link>
|
|
68
57
|
</div>
|
|
69
58
|
|
|
@@ -73,6 +62,7 @@
|
|
|
73
62
|
:trackingStatus="trackingStatus"
|
|
74
63
|
:step-number="stepNumber"
|
|
75
64
|
:runtime-options="runtimeOptions"
|
|
65
|
+
:funnel-name="funnelName"
|
|
76
66
|
@go-back="$emit('go-back')"
|
|
77
67
|
@next-step="callAction(payload?.viewModel?.nextStep)"
|
|
78
68
|
/>
|
|
@@ -197,6 +187,13 @@ const props = defineProps({
|
|
|
197
187
|
type: Number,
|
|
198
188
|
default: 0,
|
|
199
189
|
},
|
|
190
|
+
/**
|
|
191
|
+
* Analytics funnel name
|
|
192
|
+
*/
|
|
193
|
+
funnelName: {
|
|
194
|
+
type: String,
|
|
195
|
+
default: '',
|
|
196
|
+
},
|
|
200
197
|
});
|
|
201
198
|
|
|
202
199
|
const store = useStore();
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
:trackingStatus="trackingStatus"
|
|
56
56
|
:step-number="stepNumber"
|
|
57
57
|
:runtime-options="runtimeOptions"
|
|
58
|
+
:funnel-name="funnelName"
|
|
58
59
|
@go-back="$emit('go-back')"
|
|
59
60
|
@next-step="handleFormSubmit"
|
|
60
61
|
/>
|
|
@@ -173,6 +174,13 @@ const props = defineProps({
|
|
|
173
174
|
type: Number,
|
|
174
175
|
default: 0,
|
|
175
176
|
},
|
|
177
|
+
/**
|
|
178
|
+
* Analytics funnel name
|
|
179
|
+
*/
|
|
180
|
+
funnelName: {
|
|
181
|
+
type: String,
|
|
182
|
+
default: '',
|
|
183
|
+
},
|
|
176
184
|
});
|
|
177
185
|
|
|
178
186
|
// Logic
|
package/src/components/rework/question/incremental-amount-input/MPbIncrementalAmountInput.vue
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
:step-number="stepNumber"
|
|
26
26
|
:answers="answers"
|
|
27
27
|
:runtime-options="runtimeOptions"
|
|
28
|
+
:funnel-name="funnelName"
|
|
28
29
|
@go-back="$emit('go-back')"
|
|
29
30
|
@next-step="nextStep"
|
|
30
31
|
/>
|
|
@@ -129,6 +130,13 @@ const props = defineProps({
|
|
|
129
130
|
type: Number,
|
|
130
131
|
default: 0,
|
|
131
132
|
},
|
|
133
|
+
/**
|
|
134
|
+
* Analytics funnel name
|
|
135
|
+
*/
|
|
136
|
+
funnelName: {
|
|
137
|
+
type: String,
|
|
138
|
+
default: '',
|
|
139
|
+
},
|
|
132
140
|
});
|
|
133
141
|
|
|
134
142
|
const $emit = defineEmits(['go-back', 'step-completed']);
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
:trackingStatus="trackingStatus"
|
|
35
35
|
:step-number="stepNumber"
|
|
36
36
|
:runtime-options="runtimeOptions"
|
|
37
|
+
:funnel-name="funnelName"
|
|
37
38
|
@go-back="$emit('go-back')"
|
|
38
39
|
@next-step="submitAnswers"
|
|
39
40
|
/>
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
</template>
|
|
43
44
|
|
|
44
45
|
<script lang="ts" setup>
|
|
45
|
-
import { ref, computed, onMounted, Ref, defineProps, defineEmits } from 'vue';
|
|
46
|
+
import { ref, computed, onMounted, Ref, defineProps, defineEmits, PropType } from 'vue';
|
|
46
47
|
import PbItemsList from '../../../items/PbItemsList.vue';
|
|
47
48
|
import { sortAnswers } from '../sortAnswers';
|
|
48
49
|
import { ScenarioStepAnswer } from '@/types/pb/Scenario';
|
|
@@ -68,7 +69,7 @@ const props = defineProps({
|
|
|
68
69
|
default: 'step-completed',
|
|
69
70
|
},
|
|
70
71
|
answers: {
|
|
71
|
-
type: Object,
|
|
72
|
+
type: Object as PropType<Map<string, ScenarioStepAnswer[]>>,
|
|
72
73
|
default: () => new Map<string, ScenarioStepAnswer[]>(),
|
|
73
74
|
},
|
|
74
75
|
stickyBottomOffset: {
|
|
@@ -83,6 +84,13 @@ const props = defineProps({
|
|
|
83
84
|
type: Number,
|
|
84
85
|
default: 0,
|
|
85
86
|
},
|
|
87
|
+
/**
|
|
88
|
+
* Analytics funnel name
|
|
89
|
+
*/
|
|
90
|
+
funnelName: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: '',
|
|
93
|
+
},
|
|
86
94
|
});
|
|
87
95
|
|
|
88
96
|
// Answers
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
:trackingStatus="true"
|
|
69
69
|
:step-number="stepNumber"
|
|
70
70
|
:runtime-options="runtimeOptions"
|
|
71
|
+
:funnel-name="funnelName"
|
|
71
72
|
@go-back="$emit('go-back')"
|
|
72
73
|
@next-step="nextStep"
|
|
73
74
|
/>
|
|
@@ -176,6 +177,13 @@ const props = defineProps({
|
|
|
176
177
|
type: Number,
|
|
177
178
|
default: 0,
|
|
178
179
|
},
|
|
180
|
+
/**
|
|
181
|
+
* Analytics funnel name
|
|
182
|
+
*/
|
|
183
|
+
funnelName: {
|
|
184
|
+
type: String,
|
|
185
|
+
default: '',
|
|
186
|
+
},
|
|
179
187
|
});
|
|
180
188
|
|
|
181
189
|
const componentId = uuidv4();
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
:trackingStatus="true"
|
|
92
92
|
:step-number="stepNumber"
|
|
93
93
|
:runtime-options="runtimeOptions"
|
|
94
|
+
:funnel-name="funnelName"
|
|
94
95
|
@go-back="$emit('go-back')"
|
|
95
96
|
@next-step="validMultiSelect"
|
|
96
97
|
/>
|
|
@@ -197,6 +198,13 @@ const props = defineProps({
|
|
|
197
198
|
type: Number,
|
|
198
199
|
default: 0,
|
|
199
200
|
},
|
|
201
|
+
/**
|
|
202
|
+
* Analytics funnel name
|
|
203
|
+
*/
|
|
204
|
+
funnelName: {
|
|
205
|
+
type: String,
|
|
206
|
+
default: '',
|
|
207
|
+
},
|
|
200
208
|
});
|
|
201
209
|
|
|
202
210
|
const store = useStore();
|
|
@@ -111,14 +111,6 @@
|
|
|
111
111
|
theme="bordered-neutral"
|
|
112
112
|
@click.prevent="handleShowDialog"
|
|
113
113
|
:class="{ 'js-cdl': trackingStatus }"
|
|
114
|
-
:data-cdl-click="
|
|
115
|
-
JSON.stringify([
|
|
116
|
-
[
|
|
117
|
-
'cdl_event',
|
|
118
|
-
formatEvent({ button_name: 'Fermer', button_location: stepLocation }, EventTypeEnum.BUTTON),
|
|
119
|
-
],
|
|
120
|
-
])
|
|
121
|
-
"
|
|
122
114
|
>
|
|
123
115
|
</m-button>
|
|
124
116
|
</m-flex>
|
|
@@ -29,60 +29,62 @@ export interface FormatEventInterface {
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Format event click, field
|
|
32
|
-
* @param
|
|
33
|
-
* @param type
|
|
32
|
+
* @param events
|
|
34
33
|
* @returns
|
|
35
34
|
*/
|
|
36
35
|
export const formatEvent = (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
funnel_name,
|
|
41
|
-
field_name,
|
|
42
|
-
field_value,
|
|
43
|
-
step_name,
|
|
44
|
-
step_number,
|
|
45
|
-
button_type,
|
|
46
|
-
}: FormatEventInterface,
|
|
47
|
-
type: EventTypeEnum,
|
|
36
|
+
events:
|
|
37
|
+
| { attributes: FormatEventInterface; type: EventTypeEnum }
|
|
38
|
+
| { attributes: FormatEventInterface; type: EventTypeEnum }[],
|
|
48
39
|
): string => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
switch (type) {
|
|
52
|
-
case EventTypeEnum.BUTTON:
|
|
53
|
-
event_data = {
|
|
54
|
-
button_name,
|
|
55
|
-
button_location,
|
|
56
|
-
button_type,
|
|
57
|
-
};
|
|
58
|
-
break;
|
|
59
|
-
case EventTypeEnum.FIELD:
|
|
60
|
-
event_data = {
|
|
61
|
-
field_name,
|
|
62
|
-
field_value,
|
|
63
|
-
funnel_name,
|
|
64
|
-
};
|
|
65
|
-
break;
|
|
66
|
-
case EventTypeEnum.DISPLAY:
|
|
67
|
-
event_data = {
|
|
68
|
-
funnel_name,
|
|
69
|
-
step_name,
|
|
70
|
-
step_number,
|
|
71
|
-
};
|
|
72
|
-
break;
|
|
73
|
-
case EventTypeEnum.SUBMIT:
|
|
74
|
-
event_data = {
|
|
75
|
-
funnel_name,
|
|
76
|
-
step_name,
|
|
77
|
-
step_number,
|
|
78
|
-
};
|
|
79
|
-
break;
|
|
40
|
+
if (!Array.isArray(events)) {
|
|
41
|
+
events = [events];
|
|
80
42
|
}
|
|
81
43
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
44
|
+
let events_data = [] as any[];
|
|
45
|
+
events.forEach((event) => {
|
|
46
|
+
let data = {};
|
|
47
|
+
switch (event.type) {
|
|
48
|
+
case EventTypeEnum.DISPLAY:
|
|
49
|
+
data = {
|
|
50
|
+
step_name: event.attributes.step_name,
|
|
51
|
+
funnel_name: event.attributes.funnel_name,
|
|
52
|
+
step_number: event.attributes.step_number,
|
|
53
|
+
};
|
|
54
|
+
break;
|
|
55
|
+
case EventTypeEnum.BUTTON:
|
|
56
|
+
data = {
|
|
57
|
+
button_name: event.attributes.button_name,
|
|
58
|
+
button_location: event.attributes.button_location,
|
|
59
|
+
button_type: event.attributes.button_type,
|
|
60
|
+
};
|
|
61
|
+
break;
|
|
62
|
+
case EventTypeEnum.FIELD:
|
|
63
|
+
data = {
|
|
64
|
+
field_name: event.attributes.field_name,
|
|
65
|
+
field_value: event.attributes.field_value,
|
|
66
|
+
funnel_name: event.attributes.funnel_name,
|
|
67
|
+
step_number: event.attributes.step_number,
|
|
68
|
+
};
|
|
69
|
+
break;
|
|
70
|
+
case EventTypeEnum.SUBMIT:
|
|
71
|
+
data = {
|
|
72
|
+
funnel_name: event.attributes.funnel_name,
|
|
73
|
+
step_number: event.attributes.step_number,
|
|
74
|
+
};
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
events_data.push([
|
|
79
|
+
'cdl_event',
|
|
80
|
+
{
|
|
81
|
+
event_name: getEventType(event.type),
|
|
82
|
+
event_data: data,
|
|
83
|
+
},
|
|
84
|
+
]);
|
|
85
85
|
});
|
|
86
|
+
|
|
87
|
+
return JSON.stringify(events_data);
|
|
86
88
|
};
|
|
87
89
|
|
|
88
90
|
/**
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
:step-location="state.currentStep?.slots?.beforeContent?.label || ''"
|
|
72
72
|
:tracking-status="isTrackingEnabled"
|
|
73
73
|
:step-number="state.history.stepIndex - 1"
|
|
74
|
+
:funnel-name="funnelName"
|
|
74
75
|
@step-completed="handleStepCompleted"
|
|
75
76
|
@update-selected="handleSemiUpdateSelected"
|
|
76
77
|
@redirection="handleRedirection"
|
|
@@ -271,6 +272,7 @@ export default defineComponent({
|
|
|
271
272
|
|
|
272
273
|
const scenarios = new Map<string, ScenarioStep>(Object.entries(props.scenarios));
|
|
273
274
|
const isTrackingEnabled = Object.entries(props.scenarios)[0][1].meta?.webAnalytics?.tracking || false;
|
|
275
|
+
const funnelName = Object.entries(props.scenarios)[0][1].meta?.webAnalytics?.funnel_name || '';
|
|
274
276
|
const state: Ref<ScenarioState> = ref({
|
|
275
277
|
answers: new Map<string, ScenarioStepAnswer[]>(Object.entries(props.runtimeOptions?.answersToInject ?? {})),
|
|
276
278
|
stepsToResume: [],
|
|
@@ -763,6 +765,7 @@ export default defineComponent({
|
|
|
763
765
|
handleClickSaveItem,
|
|
764
766
|
handleGoBack,
|
|
765
767
|
isTrackingEnabled,
|
|
768
|
+
funnelName,
|
|
766
769
|
};
|
|
767
770
|
},
|
|
768
771
|
});
|
|
@@ -230,14 +230,6 @@
|
|
|
230
230
|
@click.prevent="callAction(action)"
|
|
231
231
|
:data-cerberus="sanitizeCerberusAttribut('PB-TREZOR', 'SENDFORM')"
|
|
232
232
|
:disabled="isSubmitDisabled"
|
|
233
|
-
:data-cdl-click="
|
|
234
|
-
JSON.stringify([
|
|
235
|
-
[
|
|
236
|
-
'cdl_event',
|
|
237
|
-
formatEvent({ button_name: action.label, button_location: stepLocation }, EventTypeEnum.BUTTON),
|
|
238
|
-
],
|
|
239
|
-
])
|
|
240
|
-
"
|
|
241
233
|
/>
|
|
242
234
|
</m-flex>
|
|
243
235
|
</div>
|
|
@@ -68,18 +68,6 @@
|
|
|
68
68
|
:key="action.label"
|
|
69
69
|
@click="callAction(action.action)"
|
|
70
70
|
:data-cerberus="sanitizeCerberusAttribut('PB-WARNING-BUTTON', action.action.code)"
|
|
71
|
-
:data-cdl-click="
|
|
72
|
-
JSON.stringify([
|
|
73
|
-
'cdl_event',
|
|
74
|
-
formatEvent(
|
|
75
|
-
{
|
|
76
|
-
button_name: action.label,
|
|
77
|
-
button_location: stepLocation || '',
|
|
78
|
-
},
|
|
79
|
-
EventTypeEnum.BUTTON,
|
|
80
|
-
),
|
|
81
|
-
])
|
|
82
|
-
"
|
|
83
71
|
/>
|
|
84
72
|
</m-flex>
|
|
85
73
|
</div>
|