project-booster-vue 9.0.2 → 9.0.5
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/README.md +1 -1
- package/package.json +1 -1
- package/src/components/projects/project-item-save/PbProjectItemSave.vue +1 -1
- package/src/components/question/PbQuestion.vue +2 -2
- package/src/components/question/city-search/PbCitySearch.vue +0 -1
- package/src/stores/modules/metaDataStore.ts +3 -3
- package/src/types/pb/Scenario.ts +1 -1
- package/src/services/metadata.ts +0 -33
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# project-booster-vue
|
|
2
2
|
|
|
3
|
-
**project-booster-vue** is the [
|
|
3
|
+
**project-booster-vue** is the [typescript / vue3](https://vuejs.org) implementation of the Project Booster components library.
|
|
4
4
|
|
|
5
5
|
It is based on the [mozaic design system](https://mozaic.appspot.com/).
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -217,7 +217,7 @@ export default defineComponent({
|
|
|
217
217
|
try {
|
|
218
218
|
await store.dispatch('projects/saveProjectForItem', {
|
|
219
219
|
projectToSave,
|
|
220
|
-
metaData: store.getters['metaData/metaData']
|
|
220
|
+
metaData: store.getters['metaData/metaData'],
|
|
221
221
|
});
|
|
222
222
|
projectId = store.getters['projects/getCurrentProjectId'];
|
|
223
223
|
} catch (err) {
|
|
@@ -559,11 +559,11 @@ export default defineComponent({
|
|
|
559
559
|
nextStep: button.nextStep,
|
|
560
560
|
});
|
|
561
561
|
},
|
|
562
|
-
resetMultiSelect(answers:
|
|
562
|
+
resetMultiSelect(answers: Record<string, ScenarioStepAnswer>) {
|
|
563
563
|
this.initAnswersSelectedState(answers);
|
|
564
564
|
this.$forceUpdate();
|
|
565
565
|
},
|
|
566
|
-
initAnswersSelectedState(answers:
|
|
566
|
+
initAnswersSelectedState(answers: Record<string, ScenarioStepAnswer>) {
|
|
567
567
|
Object.values(answers).forEach((answer) => {
|
|
568
568
|
answer.selected = false;
|
|
569
569
|
});
|
|
@@ -227,7 +227,6 @@ export default defineComponent({
|
|
|
227
227
|
},
|
|
228
228
|
updateHeaderHeight() {
|
|
229
229
|
this.headerHeight = this.$refs?.pbCitySearchHeader?.$el?.offsetHeight;
|
|
230
|
-
console.log(this.headerHeight);
|
|
231
230
|
},
|
|
232
231
|
decorate(valueToDecorate: string, defaultValue = '') {
|
|
233
232
|
if (valueToDecorate) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getMetaDataFromCookies } from '../../services/metadata';
|
|
2
1
|
import { ActionContext } from 'vuex';
|
|
3
2
|
import { State } from '@/stores/state';
|
|
4
3
|
|
|
@@ -10,13 +9,14 @@ type MetaDataContext = ActionContext<MetaDataState, State>;
|
|
|
10
9
|
|
|
11
10
|
export default {
|
|
12
11
|
namespaced: true,
|
|
12
|
+
|
|
13
13
|
state: {
|
|
14
14
|
metaDataFromCookies: null,
|
|
15
15
|
},
|
|
16
16
|
|
|
17
17
|
getters: {
|
|
18
|
-
metaData() {
|
|
19
|
-
return
|
|
18
|
+
metaData(state: MetaDataState) {
|
|
19
|
+
return state.metaDataFromCookies;
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
|
package/src/types/pb/Scenario.ts
CHANGED
|
@@ -81,7 +81,7 @@ export interface ScenarioStepMultiSelectOptions {
|
|
|
81
81
|
|
|
82
82
|
export interface ScenarioStepPayload {
|
|
83
83
|
viewModel: ScenarioStepViewModel;
|
|
84
|
-
answers:
|
|
84
|
+
answers: Record<string, ScenarioStepAnswer>;
|
|
85
85
|
skippable?: ScenarioStepSkippableOptions[];
|
|
86
86
|
multiSelect?: ScenarioStepMultiSelectOptions;
|
|
87
87
|
}
|
package/src/services/metadata.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export function getMetaDataFromCookies(cookies: any) {
|
|
2
|
-
let metaData = {
|
|
3
|
-
userAgent: window.navigator.userAgent,
|
|
4
|
-
viewPortHeightPx: window.innerHeight !== 0 ? window.innerHeight : null,
|
|
5
|
-
viewPortWidthPx: window.innerWidth !== 0 ? window.innerWidth : null,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
if (process.env.VUE_APP_BUILD_FOR_KOBI) {
|
|
9
|
-
metaData = { ...metaData, ...getMetaDataFromKobiCookies(cookies) };
|
|
10
|
-
}
|
|
11
|
-
return metaData;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function getMetaDataFromKobiCookies(kobiCookies: any) {
|
|
15
|
-
const userDoesConsentToTracking =
|
|
16
|
-
kobiCookies.get('OptanonConsent') && kobiCookies.get('OptanonConsent').includes('C0002:1');
|
|
17
|
-
if (userDoesConsentToTracking) {
|
|
18
|
-
const metadata: Record<string, any> = {};
|
|
19
|
-
const addIfNotNull = (name: string, cookieName: string) => {
|
|
20
|
-
const value = kobiCookies.get(cookieName);
|
|
21
|
-
if (value !== null && value !== undefined) {
|
|
22
|
-
metadata[name] = value;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
addIfNotNull('googleAnalyticsClientId', '_ga');
|
|
27
|
-
addIfNotNull('tagCommanderId', 'TCID');
|
|
28
|
-
addIfNotNull('storeId', 'lmfr_store_id');
|
|
29
|
-
|
|
30
|
-
return metadata;
|
|
31
|
-
}
|
|
32
|
-
return {};
|
|
33
|
-
}
|