@bytebrand/fe-ui-core 4.1.50 → 4.1.52
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/source/components/SearchPage/SearchTopBar/SearchTopBar.tsx +1 -1
- package/source/components/_common/IconSVG/SVG/vehicle/Date.tsx +0 -1
- package/source/components/_common/IconSVG/SVG/vehicle/Owner.tsx +0 -1
- package/source/components/_common/MaterialSwitch/MaterialSwitch.tsx +1 -1
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.styl +5 -1
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +84 -9
- package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.tsx +2 -1
- package/source/framework/constants/common.ts +7 -0
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ import { searchTopBarTranslate } from '../../../locales/data';
|
|
|
6
6
|
import MaterialMenu from '../../_common/UserMenu/MaterialMenu';
|
|
7
7
|
import { isMobileOnly } from 'react-device-detect';
|
|
8
8
|
import MaterialAutocomplete from '../../_common/MaterialAutocomplete/MaterialAutocomplete';
|
|
9
|
-
import
|
|
9
|
+
import IconSVG from '../../_common/IconSVG/IconSVG';
|
|
10
10
|
|
|
11
11
|
interface ISearchTopBarProps {
|
|
12
12
|
t?: (key: string, options?: object) => string;
|
|
@@ -22,7 +22,7 @@ const MaterialSwitch = ({ disabled, label, onChange, value = false, labelPlaceme
|
|
|
22
22
|
labelPlacement={labelPlacement}
|
|
23
23
|
control={
|
|
24
24
|
<Switch
|
|
25
|
-
checked={checked}
|
|
25
|
+
checked={value || checked}
|
|
26
26
|
onChange={handleChange}
|
|
27
27
|
disabled={disabled}
|
|
28
28
|
onClick={e => e.stopPropagation()}
|
|
@@ -1,12 +1,54 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import _merge from 'lodash/merge';
|
|
2
3
|
import styles from './ManageCookieModal.styl';
|
|
3
4
|
|
|
4
5
|
import IconSVG from '../../../IconSVG/IconSVG';
|
|
5
6
|
import Button from '../../../Button/Button';
|
|
6
7
|
import MaterialAccordionGroup from '../../../MaterialAccordionGroup/MaterialAccordionGroup';
|
|
7
8
|
import classNames from 'classnames';
|
|
9
|
+
import MaterialSwitch from '../../../MaterialSwitch/MaterialSwitch';
|
|
10
|
+
import { COOKIE_SCHEMA } from '@bytebrand/fe-ui-core/source/framework/constants/common';
|
|
8
11
|
|
|
9
12
|
const ManageCookieModal = () => {
|
|
13
|
+
const [analytcisMasterSwitch, setAnalyticsMasterSwitch] = useState(true);
|
|
14
|
+
const [marketingMasterSwitch, setMarketingMasterSwitch] = useState(true);
|
|
15
|
+
const [analyticsSwitches, setAnalyticsSwitches] = useState({});
|
|
16
|
+
const [marketingSwitches, setMarketingSwitches] = useState({});
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const newAnalyticsSwitches = COOKIE_SCHEMA.analytics.reduce((acc, item) => ({...acc, [item]: true}), {});
|
|
21
|
+
const newMarketingSwitches = COOKIE_SCHEMA.marketing.reduce((acc, item) => ({...acc, [item]: true}), {});
|
|
22
|
+
setAnalyticsSwitches(newAnalyticsSwitches);
|
|
23
|
+
setMarketingSwitches(newMarketingSwitches);
|
|
24
|
+
}, []);
|
|
25
|
+
|
|
26
|
+
const onHandleAnalyticsSwitchValue = (value: boolean) => {
|
|
27
|
+
const newAnalyticsSwitches = Object.keys(analyticsSwitches).reduce((acc, item) => ({ ...acc, [item]: value }), {})
|
|
28
|
+
setAnalyticsSwitches(newAnalyticsSwitches);
|
|
29
|
+
setAnalyticsMasterSwitch(value);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const onHandleMarketingSwitchValue = (value: boolean) => {
|
|
33
|
+
const newAnalyticsSwitches = Object.keys(analyticsSwitches).reduce((acc, item) => ({ ...acc, [item]: value }), {})
|
|
34
|
+
setMarketingSwitches(newAnalyticsSwitches);
|
|
35
|
+
setMarketingMasterSwitch(value);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const marketingSwitchProps = {
|
|
39
|
+
value: marketingMasterSwitch,
|
|
40
|
+
onChange: onHandleMarketingSwitchValue
|
|
41
|
+
};
|
|
42
|
+
const analyticsSwitchProps = {
|
|
43
|
+
value: analytcisMasterSwitch,
|
|
44
|
+
onChange: onHandleAnalyticsSwitchValue
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const necessarySwitchProps = {
|
|
48
|
+
value: true,
|
|
49
|
+
onChange: () => {}
|
|
50
|
+
};
|
|
51
|
+
|
|
10
52
|
return (
|
|
11
53
|
<div className={styles.modalWrapper}>
|
|
12
54
|
<IconSVG name='autodeLogo' customDimensions />
|
|
@@ -17,30 +59,63 @@ const ManageCookieModal = () => {
|
|
|
17
59
|
title='Notwendig'
|
|
18
60
|
tooltipText='tooltip text'
|
|
19
61
|
withSwitch
|
|
62
|
+
switchProps={necessarySwitchProps}
|
|
20
63
|
>
|
|
64
|
+
<span>
|
|
21
65
|
Wir verwenden Browser-Cookies, die notwendig sind, damit die Website wie vorgesehen funktioniert.
|
|
22
66
|
Beispiel: Wir speichern Ihre Präferenzen bei der Datenerfassung auf der Website, damit wir sie berücksichtigen
|
|
23
67
|
können, wenn Sie auf unsere Website zurückkehren.
|
|
24
68
|
For example, we store your website data collection preferences so we can honor them if you return to our site.
|
|
25
69
|
You can disable these cookies in your browser settings but if you do the site may not work as intended.
|
|
70
|
+
</span>
|
|
71
|
+
{COOKIE_SCHEMA.necessary.map(cookie =>
|
|
72
|
+
<div className={styles.switchBlock}>
|
|
73
|
+
<span>{cookie}</span>
|
|
74
|
+
<MaterialSwitch value={true} onChange={(value: boolean) => {}} />
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
26
77
|
</MaterialAccordionGroup>
|
|
27
78
|
<MaterialAccordionGroup
|
|
28
79
|
title='Analytisch'
|
|
29
80
|
withSwitch
|
|
81
|
+
switchProps={analyticsSwitchProps}
|
|
30
82
|
>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
83
|
+
<span>
|
|
84
|
+
Um das Nutzerverhalten zu verstehen und Ihnen ein relevanteres Surferlebnis zu bieten oder den Inhalt
|
|
85
|
+
unserer Website zu personalisieren. Beispiel: Wir sammeln Informationen darüber, welche Seiten Sie besuchen,
|
|
86
|
+
damit wir Ihnen relevantere Informationen präsentieren können.
|
|
87
|
+
For example, we collect information about which pages you visit to help us present more relevant information.
|
|
88
|
+
</span>
|
|
89
|
+
{COOKIE_SCHEMA.analytics.map(cookie =>
|
|
90
|
+
<div className={styles.switchBlock}>
|
|
91
|
+
<span>{cookie}</span>
|
|
92
|
+
<MaterialSwitch
|
|
93
|
+
value={analyticsSwitches[cookie]}
|
|
94
|
+
onChange={() => { setAnalyticsSwitches(s => ({ ...s, [cookie]: !s[cookie]})) }}
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
)}
|
|
35
98
|
</MaterialAccordionGroup>
|
|
36
99
|
<MaterialAccordionGroup
|
|
37
100
|
title='Marketing'
|
|
38
101
|
withSwitch
|
|
102
|
+
switchProps={marketingSwitchProps}
|
|
39
103
|
>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
104
|
+
<span>
|
|
105
|
+
Zur Personalisierung und Messung der Effektivität von Werbung auf unserer Website und anderen Websites.
|
|
106
|
+
Beispiel: Wir können Ihnen eine personalisierte Werbung auf der Grundlage der Seiten, die Sie auf unserer
|
|
107
|
+
Website besuchen, anzeigen.
|
|
108
|
+
For example, we may serve you a personalized ad based on the pages you visit on our site.
|
|
109
|
+
</span>
|
|
110
|
+
{COOKIE_SCHEMA.marketing.map(cookie =>
|
|
111
|
+
<div className={styles.switchBlock}>
|
|
112
|
+
<span>Cookie</span>
|
|
113
|
+
<MaterialSwitch
|
|
114
|
+
value={marketingSwitches[cookie]}
|
|
115
|
+
onChange={() => setMarketingSwitches(s => ({ ...s, [cookie]: !s[cookie]}))}
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
44
119
|
</MaterialAccordionGroup>
|
|
45
120
|
</div>
|
|
46
121
|
<div className={styles.buttonsContainer}>
|
|
@@ -13,7 +13,8 @@ const PreviewCookieModal = ({ toggleModal, setModal }: IPreviewCookieModal) => {
|
|
|
13
13
|
const onAcceptAll = () => {
|
|
14
14
|
localStorage.setItem('cookieConfig', JSON.stringify([]));
|
|
15
15
|
toggleModal();
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
|
|
17
18
|
return (
|
|
18
19
|
<div className={styles.modalWrapper}>
|
|
19
20
|
<IconSVG name='autodeLogo' customDimensions />
|
|
@@ -7,3 +7,10 @@ export const PLACEHOLDER_IMAGE_LARGE_URL: string = `https://images.auto.de/noima
|
|
|
7
7
|
export const QUOTES_SLIDES_TO_SHOW_DEFAULT = 3;
|
|
8
8
|
|
|
9
9
|
export const HUNDRED = 100;
|
|
10
|
+
|
|
11
|
+
export const COOKIE_SCHEMA = {
|
|
12
|
+
necessary: ['gdpr', '__cfruid', 'cf_chl_2', 'cf_chl_rc_ni', 'next-i18next', '_cfuvid', 'cf_chl_prog', '__cf_bm'],
|
|
13
|
+
analytics: ['PugT', 'locale', '_gcl_au', '_ga', '_gid', '_gat_UA-31842-13', 'uid', 'callback', 'demdex', '_hjFirstSeen', '_hjIncludedInSessionSample', '_hjIncludedInPageviewSample', '_hjAbsoluteSessionInProgress', 'vuid'],
|
|
14
|
+
marketing: ['_fbp', 'test_cookie', 'tuuid', 'tuuid_lu', 'c', 'CMID', 'CMPS', 'CMPRO', 'uuid2', 'IDE', 'um', 'umeh', 'cf', 'cip', 'cnac', 'car', 'KRTBCOOKIE_97', 'IDSYNC', 'dpm', '_kuid_', 'fr', 'cto_bundle',
|
|
15
|
+
'visitor-id', 'data-c-ts', 'data-c', 'CMTS', 'mv_tokens', 'A3', 'mv_tokens_eu-v1', 'am_tokens', 'am_tokens_eu-v1', '_hjSessionUser_2590373', 'iteo', '_hjSession_2590373', 'MyVerivoxAuth', 'VxCheckAuth']
|
|
16
|
+
}
|