project-booster-vue 10.2.2 → 10.2.3

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.2.2",
3
+ "version": "10.2.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -77,11 +77,13 @@ import { PayloadAction } from '../types/genericPayload';
77
77
  import { sanitizeCerberusAttribut } from '@/services/sanitize';
78
78
  import { ref } from 'vue';
79
79
  import { ButtonType, EventName, sendAnalyticEvent } from '../services/event';
80
+ import { useStore } from 'vuex';
80
81
 
81
82
  const emit = defineEmits(['go-back', 'step-completed']);
82
83
  const showModal = ref(false);
83
84
  const titleModal = ref('');
84
85
  const srcModal = ref('');
86
+ const store = useStore();
85
87
 
86
88
  const props = defineProps({
87
89
  /**
@@ -101,7 +103,7 @@ const handleCloseModal = () => {
101
103
  };
102
104
 
103
105
  const handleShowModal = (option: any) => {
104
- sendAnalyticEvent(EventName.CLICK, {
106
+ sendAnalyticEvent(store, EventName.CLICK, {
105
107
  button_name: option.viewModel.button.label || '',
106
108
  button_location: '',
107
109
  button_type: ButtonType.ACTION,
@@ -121,7 +123,7 @@ const handleShowModal = (option: any) => {
121
123
  * @param action
122
124
  */
123
125
  const callAction = (button: PayloadAction) => {
124
- sendAnalyticEvent(EventName.CLICK, {
126
+ sendAnalyticEvent(store, EventName.CLICK, {
125
127
  button_name: button.label || '',
126
128
  button_location: '',
127
129
  button_type: ButtonType.ACTION,
@@ -89,9 +89,11 @@ import { areConditionsValid } from '../../../services/scenarioConditionals';
89
89
  import { sanitizeCerberusAttribut } from '@/services/sanitize';
90
90
  import { ScenarioStepAnswer } from '@/types/pb/Scenario';
91
91
  import { ButtonType, EventName, sendAnalyticEvent } from '../services/event';
92
+ import { useStore } from 'vuex';
92
93
 
93
94
  const emit = defineEmits(['go-back', 'step-completed']);
94
95
  const message = ref('');
96
+ const store = useStore();
95
97
 
96
98
  const props = defineProps({
97
99
  /**
@@ -124,7 +126,7 @@ const props = defineProps({
124
126
  * @param action
125
127
  */
126
128
  const callAction = (action: PayloadAction, label: string) => {
127
- sendAnalyticEvent(EventName.CLICK, {
129
+ sendAnalyticEvent(store, EventName.CLICK, {
128
130
  button_name: label || '',
129
131
  button_location: '',
130
132
  button_type: ButtonType.ACTION,
@@ -660,7 +660,7 @@ export default defineComponent({
660
660
  }
661
661
  }
662
662
 
663
- sendAnalyticEvent(EventName.FIELD, {
663
+ sendAnalyticEvent(this.$store, EventName.FIELD, {
664
664
  field_name: multiSelectOptions?.label || '',
665
665
  field_value: answers,
666
666
  funnel_name: this.payload.viewModel.analytics.funnel_name,
@@ -787,7 +787,7 @@ export default defineComponent({
787
787
  });
788
788
 
789
789
  if (answer.viewModel) {
790
- sendAnalyticEvent(EventName.CLICK, {
790
+ sendAnalyticEvent(this.$store, EventName.CLICK, {
791
791
  button_name: answer.viewModel?.title || '',
792
792
  button_location: '',
793
793
  button_type: ButtonType.ACTION,
@@ -204,7 +204,7 @@ export default defineComponent({
204
204
  const configurationImportError = ref(false);
205
205
 
206
206
  const navigateTo = (viewModel: ConfigurationsImportViewModel) => {
207
- sendAnalyticEvent(EventName.CLICK, {
207
+ sendAnalyticEvent(store, EventName.CLICK, {
208
208
  button_name: viewModel.label || '',
209
209
  button_location: '',
210
210
  button_type: ButtonType.ACTION,
@@ -246,7 +246,7 @@ export default defineComponent({
246
246
  };
247
247
 
248
248
  const skipQuestion = (button: ConfigurationsImportSkippable) => {
249
- sendAnalyticEvent(EventName.CLICK, {
249
+ sendAnalyticEvent(store, EventName.CLICK, {
250
250
  button_name: button.label || '',
251
251
  button_location: '',
252
252
  button_type: ButtonType.ACTION,
@@ -260,7 +260,7 @@ export default defineComponent({
260
260
  };
261
261
 
262
262
  const validMultiSelect = (multiSelectOptions: ConfigurationsImportMultiSelectAction) => {
263
- sendAnalyticEvent(EventName.CLICK, {
263
+ sendAnalyticEvent(store, EventName.CLICK, {
264
264
  button_name: multiSelectOptions.label || '',
265
265
  button_location: '',
266
266
  button_type: ButtonType.ACTION,
@@ -273,7 +273,7 @@ export default defineComponent({
273
273
  };
274
274
 
275
275
  const callAction = (action: PayloadAction) => {
276
- sendAnalyticEvent(EventName.CLICK, {
276
+ sendAnalyticEvent(store, EventName.CLICK, {
277
277
  button_name: action.label || '',
278
278
  button_location: '',
279
279
  button_type: ButtonType.ACTION,
@@ -235,7 +235,7 @@ export default defineComponent({
235
235
  });
236
236
 
237
237
  const navigateTo = (viewModel: UploadDocumentViewModel) => {
238
- sendAnalyticEvent(EventName.CLICK, {
238
+ sendAnalyticEvent(store, EventName.CLICK, {
239
239
  button_name: viewModel.label || '',
240
240
  button_location: '',
241
241
  button_type: ButtonType.ACTION,
@@ -259,7 +259,7 @@ export default defineComponent({
259
259
  };
260
260
 
261
261
  const validMultiSelect = (multiSelectOptions: UploadDocumentMultiSelectAction) => {
262
- sendAnalyticEvent(EventName.CLICK, {
262
+ sendAnalyticEvent(store, EventName.CLICK, {
263
263
  button_name: multiSelectOptions.label || '',
264
264
  button_location: '',
265
265
  button_type: ButtonType.ACTION,
@@ -276,7 +276,7 @@ export default defineComponent({
276
276
  };
277
277
 
278
278
  const skipQuestion = (button: UploadDocumentMultiSelectAction) => {
279
- sendAnalyticEvent(EventName.CLICK, {
279
+ sendAnalyticEvent(store, EventName.CLICK, {
280
280
  button_name: button.label || '',
281
281
  button_location: '',
282
282
  button_type: ButtonType.ACTION,
@@ -1,7 +1,3 @@
1
- import { useStore } from 'vuex';
2
-
3
- const store = useStore();
4
-
5
1
  export enum EventName {
6
2
  CLICK = 'button.click',
7
3
  FIELD = 'step.field',
@@ -28,7 +24,7 @@ interface EventField {
28
24
  * @param event_name
29
25
  * @param event_data
30
26
  */
31
- export const sendAnalyticEvent = (event_name: EventName, event_data: EventData | EventField) => {
27
+ export const sendAnalyticEvent = (store: any, event_name: EventName, event_data: EventData | EventField) => {
32
28
  store.dispatch('sendEventToBus', {
33
29
  code: 'EMIT-ANALYTIC-EVENT',
34
30
  payload: {