project-booster-vue 9.0.3 → 9.0.4
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/stores/modules/metaDataStore.ts +3 -3
- 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
|
@@ -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/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
|
-
}
|