@bytebrand/fe-ui-core 4.3.0 → 4.4.0

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.
Files changed (125) hide show
  1. package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +613 -0
  2. package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +335 -0
  3. package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +4 -2
  4. package/common.ts +6 -2
  5. package/package.json +19 -28
  6. package/source/components/AccordionWidget/AccordionWidget.tsx +1 -3
  7. package/source/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
  8. package/source/components/Checkout/CheckoutStepper/CheckoutStepper.styl +2 -190
  9. package/source/components/Checkout/CheckoutStepper/CheckoutStepper.tsx +15 -16
  10. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
  11. package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
  12. package/source/components/FormattedNumber/FormattedNumber.tsx +2 -3
  13. package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +4 -6
  14. package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +0 -3
  15. package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.js → MuiOfferPeriod.theme.tsx} +8 -13
  16. package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +28 -4
  17. package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +6 -12
  18. package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
  19. package/source/components/OfferPanel/OfferPanel.tsx +1 -1
  20. package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +0 -4
  21. package/source/components/OfferPanel/RangeGroup/RangeGroup.tsx +6 -4
  22. package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +6 -2
  23. package/source/components/SearchFilters/filters/AlternativeID.tsx +42 -53
  24. package/source/components/SearchFilters/filters/DriveType.tsx +1 -1
  25. package/source/components/SearchFilters/filters/EmissionSticker.tsx +1 -1
  26. package/source/components/SearchFilters/filters/FirstRegistration.tsx +0 -1
  27. package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
  28. package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -1
  29. package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
  30. package/source/components/SearchFilters/filters/Power.tsx +36 -17
  31. package/source/components/SearchFilters/filters/StateOptions.tsx +0 -1
  32. package/source/components/SearchFilters/filters/Transmission.tsx +1 -1
  33. package/source/components/SearchPage/SearchChips/SearchChips.tsx +1 -1
  34. package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +3 -3
  35. package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +2 -2
  36. package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +1 -1
  37. package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -1
  38. package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +3 -3
  39. package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
  40. package/source/components/SearchWidget/HighlightsWidget/HighlightsWidget.tsx +2 -2
  41. package/source/components/SearchWidget/StateWidget/StateWidget.tsx +1 -2
  42. package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +4 -4
  43. package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +16 -16
  44. package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +1 -1
  45. package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
  46. package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +6 -6
  47. package/source/components/Stepper/Stepper.tsx +4 -3
  48. package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.styl +38 -0
  49. package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.tsx +120 -0
  50. package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.styl +22 -0
  51. package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.tsx +84 -0
  52. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +11 -2
  53. package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +5 -5
  54. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +57 -38
  55. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCard.tsx +2 -2
  56. package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +183 -101
  57. package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +5 -7
  58. package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.tsx +33 -7
  59. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +10 -2
  60. package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +54 -14
  61. package/source/components/VehicleDetailedSidebar/partials/Price.styl +5 -1
  62. package/source/components/VehicleDetailedSidebar/partials/Price.tsx +2 -1
  63. package/source/components/VehicleDetailedSidebar/partials/PriceContent.styl +16 -5
  64. package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +9 -4
  65. package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +1 -1
  66. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +45 -0
  67. package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +121 -42
  68. package/source/components/VehicleDetailedSlider/partials/PriceData.styl +4 -1
  69. package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +8 -1
  70. package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
  71. package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +9 -7
  72. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +35 -1
  73. package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +9 -3
  74. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +11 -2
  75. package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +2 -1
  76. package/source/components/VehicleSmallCard/VehicleSmallCard.styl +3 -1
  77. package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +3 -7
  78. package/source/components/_common/Badge/Badge.styl +3 -0
  79. package/source/components/_common/Badge/Badge.tsx +1 -1
  80. package/source/components/_common/Button/Button.tsx +5 -4
  81. package/source/components/_common/Checkbox/FormCheckbox.tsx +4 -4
  82. package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
  83. package/source/components/_common/Chip/Chip.tsx +1 -3
  84. package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
  85. package/source/components/_common/IconSVG/IconSVGConfig.tsx +2 -0
  86. package/source/components/_common/IconSVG/SVG/flags/SK.tsx +0 -1
  87. package/source/components/_common/IconSVG/SVG/slider/360New.tsx +1 -1
  88. package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +26 -0
  89. package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +22 -30
  90. package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
  91. package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +0 -1
  92. package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +12 -15
  93. package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
  94. package/source/components/_common/MaterialSwitch/MaterialSwitch.tsx +3 -1
  95. package/source/components/_common/MaterialTooltip/MaterialTooltip.styled.tsx +1 -1
  96. package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
  97. package/source/components/_common/Modal/CookieModal.tsx +1 -3
  98. package/source/components/_common/Modal/Modal.styled.tsx +2 -1
  99. package/source/components/_common/Modal/Modal.tsx +1 -5
  100. package/source/components/_common/Modal/ModalsConfig.tsx +5 -1
  101. package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.styl +23 -7
  102. package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +84 -36
  103. package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.styl +29 -14
  104. package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.tsx +17 -10
  105. package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +12 -4
  106. package/source/components/_common/Range/Range.tsx +27 -14
  107. package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +0 -1
  108. package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
  109. package/source/components/_common/UserMenu/MaterialMenuItem.tsx +42 -20
  110. package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
  111. package/source/components/_common/withStats/withStats.styl +3 -0
  112. package/source/components/_common/withStats/withStats.tsx +19 -16
  113. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +14 -1
  114. package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +78 -42
  115. package/source/framework/constants/common.ts +89 -60
  116. package/source/framework/constants/highlights.ts +1 -1
  117. package/source/framework/constants.ts +1 -1
  118. package/source/framework/types/types.ts +9 -4
  119. package/source/framework/utils/CommonUtils.ts +73 -62
  120. package/source/framework/utils/DateUtils.ts +10 -2
  121. package/source/framework/vehiclesProps/decoratedLightProps.tsx +1 -2
  122. package/source/framework/vehiclesProps/decoratedProps.tsx +1 -2
  123. package/source/locales/data.ts +2 -2
  124. package/tslint.json +1 -2
  125. package/utils.ts +2 -0
@@ -10,37 +10,59 @@ interface IListItem {
10
10
  label: any;
11
11
  amount?: number;
12
12
  divider?: boolean;
13
- onClick?: (e: React.MouseEvent<HTMLSpanElement>) => void;
13
+ onClick?: (e: React.MouseEvent<HTMLLIElement>) => void;
14
14
  href?: string;
15
15
  isComponent?: boolean;
16
16
  isSelect?: boolean;
17
17
  Link?: any;
18
18
  handleClose?: () => void;
19
19
  isActive?: boolean;
20
+ isExternalLink?: boolean;
20
21
  }
21
22
 
22
- const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Link, handleClose, isActive }: IListItem) => {
23
- return !!href ? (
24
- <Link color='#4C4E64DE' variant='caption' to={href} underline='none' onClick={onClick}>
25
- <MenuItem
26
- divider={divider}
27
- >
28
- {icon && <ListItemIcon><IconSVG customDimensions name={icon} /></ListItemIcon>}
29
- <ListItemText>
30
- {label}
31
- </ListItemText>
32
- {(amount || amount === 0) && <AmountBlock>{amount}</AmountBlock>}
33
- </MenuItem>
34
- </Link>
35
- ) : (
23
+ const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Link, handleClose, isActive, isExternalLink }: IListItem) => {
24
+
25
+ const onMenuItemClick = (e: React.MouseEvent<HTMLLIElement>) => {
26
+ onClick(e);
27
+ handleClose();
28
+ };
29
+
30
+ const renderLink = () => {
31
+ return (
32
+ <>
33
+ {isExternalLink ? (
34
+ <a href={href}>
35
+ <MenuItem
36
+ divider={divider}
37
+ >
38
+ {icon && <ListItemIcon><IconSVG customDimensions name={icon} /></ListItemIcon>}
39
+ <ListItemText>
40
+ {label}
41
+ </ListItemText>
42
+ {(amount || amount === 0) && <AmountBlock>{amount}</AmountBlock>}
43
+ </MenuItem>
44
+ </a>
45
+ ) : (
46
+ <Link color='#4C4E64DE' variant='caption' to={href} underline='none' onClick={onClick}>
47
+ <MenuItem divider={divider}>
48
+ {icon && <ListItemIcon><IconSVG customDimensions name={icon} /></ListItemIcon>}
49
+ <ListItemText>
50
+ {label}
51
+ </ListItemText>
52
+ {(amount || amount === 0) && <AmountBlock>{amount}</AmountBlock>}
53
+ </MenuItem>
54
+ </Link>
55
+ )}
56
+ </>
57
+ )
58
+ }
59
+
60
+ return !!href ? renderLink() : (
36
61
  <MenuItem
37
- onClick={(e: React.MouseEvent<HTMLSpanElement>) => {
38
- onClick(e);
39
- handleClose();
40
- }}
62
+ onClick={onMenuItemClick}
41
63
  divider={divider}
42
64
  disableRipple={isComponent ? true : false}
43
- isactive={!!isActive ? isActive.toString() : 'false'}
65
+ selected={!!isActive ? isActive : false}
44
66
  >
45
67
  {icon && <ListItemIcon><IconSVG customDimensions name={icon} /></ListItemIcon>}
46
68
  <ListItemText>
@@ -17,7 +17,7 @@ export interface INestedMenuProps {
17
17
  const NestedMenu = ({ nestedItems, label, icon, amount }: INestedMenuProps) => {
18
18
  const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
19
19
  const open = Boolean(anchorEl);
20
- const handleClick = (event: React.MouseEvent<HTMLElement>) => {
20
+ const handleClick = (event: React.MouseEvent<HTMLLIElement>) => {
21
21
  setAnchorEl(event.currentTarget);
22
22
  };
23
23
  const handleClose = () => {
@@ -148,3 +148,6 @@ $indent = 10px
148
148
 
149
149
  .new
150
150
  text-transform: uppercase
151
+
152
+ .imagesCount
153
+ margin-left: 0 !important
@@ -71,7 +71,7 @@ const withStats = (WrappedComponent: any) => ({
71
71
  const delimiters = { xs: '|', sm: '|', md: 'von' };
72
72
 
73
73
  return (
74
- <div className={styles.section}>
74
+ <div className={classnames(styles.section, styles.imagesCount)}>
75
75
  {statsSize === 'md' ? <IconSVG name='common_camera' customDimensions className={styles.cameraIcon} /> : null}
76
76
  {!!imagesCount && <span>{`${activeSlide + 1} ${delimiters[statsSize]} ${imagesCount}`}</span>}
77
77
  </div>
@@ -79,7 +79,7 @@ const withStats = (WrappedComponent: any) => ({
79
79
  };
80
80
 
81
81
  const renderRotateSvg = (): JSX.Element => {
82
- const hasExteriorPhotos = hasInteriorExteriorPhoto && Array.isArray(images) && images.length > 0;
82
+ const hasExteriorPhotos = hasInteriorExteriorPhoto && imagesCount > 0;
83
83
  if (!hasExteriorPhotos) return null;
84
84
  return (
85
85
  <div className={styles.section}>
@@ -115,20 +115,23 @@ const withStats = (WrappedComponent: any) => ({
115
115
  const favoritesIconClassName = classnames(styles.statsStarIcon, { [styles.accented]: isFavoured });
116
116
 
117
117
  return (
118
- <div className={styles.section}>
119
- {!!totalCarImpCount ? <div className={styles.statsViewsCount}>
120
- <IconSVG name='common_SliderEye' customDimensions className={styles.statsEyeIcon} />
121
- <span>
122
- {totalCarImpCount}
123
- </span>
124
- </div> : null}
125
- {!!totalFavCount ? <div className={favoritesClassName} onClick={onFavoriteClick}>
126
- <IconSVG name='star' customDimensions className={favoritesIconClassName} />
127
- <span>
128
- {totalFavCount}
129
- </span>
130
- </div> : null}
131
- </div>
118
+ <>
119
+ {(!!totalCarImpCount || !!totalFavCount) && <div className={styles.section}>
120
+ {!!totalCarImpCount ? <div className={styles.statsViewsCount}>
121
+ <IconSVG name='common_SliderEye' customDimensions className={styles.statsEyeIcon} />
122
+ <span>
123
+ {totalCarImpCount}
124
+ </span>
125
+ </div> : null}
126
+ {!!totalFavCount ? <div className={favoritesClassName} onClick={onFavoriteClick}>
127
+ <IconSVG name='star' customDimensions className={favoritesIconClassName} />
128
+ <span>
129
+ {totalFavCount}
130
+ </span>
131
+ </div> : null}
132
+ </div>
133
+ }
134
+ </>
132
135
  );
133
136
  };
134
137
 
@@ -52,4 +52,17 @@
52
52
  font-weight: 700
53
53
  font-size: 14px
54
54
  border-bottom-left-radius: 10px;
55
- border-bottom-right-radius: 10px;
55
+ border-bottom-right-radius: 10px;
56
+
57
+ .vehicleId
58
+ padding: 11px
59
+ background-color: #fff
60
+ border-bottom: 1px solid #e8e8e8;
61
+ padding-bottom: 19px;
62
+
63
+ .vehicleIdLabel
64
+ font-size: 14px
65
+ font-weight: 700
66
+ line-height: 16px
67
+ margin-bottom: 12px
68
+ padding: 0 5px
@@ -3,16 +3,17 @@ import _get from 'lodash/get';
3
3
  import _startsWith from 'lodash/startsWith';
4
4
  import _debounce from 'lodash/debounce';
5
5
  import qs from 'qs';
6
- import { isEqual } from 'lodash';
6
+ import { isArray, isEqual } from 'lodash';
7
7
  import { checkRangeValuesOnEqual, getGroupValuesForQuery } from '../../../../framework/utils/CommonUtils';
8
8
  import { FilterBlockFactory } from '../../../SearchFilters/common/FilterBlock/FilterBlockFactory';
9
9
  import { FilterGroups, IFilters } from '../../../SearchFilters/FiltersFactory';
10
- import { MANUFACTURER_KEY, MM_GROUPS_EXCLUDE_KEY, MODEL_KEY, RANGE_FILTERS, SERIES_KEY, SUPER_ADMIN_FILTER_NAME, SUB_MODEL_KEY } from '../../../../framework/constants/Search';
10
+ import { MANUFACTURER_KEY, MM_GROUPS_EXCLUDE_KEY, MODEL_KEY, RANGE_FILTERS, SERIES_KEY, SUPER_ADMIN_FILTER_NAME } from '../../../../framework/constants/Search';
11
11
  import { MMS_GROUPS_KEY, OBJECT_FILTERS } from '../../../../framework/constants/SearchWidget';
12
12
  import { resolveMmsValue } from '../../../../framework/utils/FiltersUtils';
13
13
  import FilterBlock from '../../../SearchFilters/common/FilterBlock/FilterBlock';
14
14
  import styles from './FiltersContainer.styl';
15
15
  import AlternativeID from '../../../SearchFilters/filters/AlternativeID';
16
+ import MaterialField from '../../../_common/MaterialField/MaterialField';
16
17
 
17
18
  type PathParamsType = {
18
19
  location?: any;
@@ -33,7 +34,7 @@ interface IFiltersContainerProps extends IRouteComponentProps<PathParamsType> {
33
34
  aggregation: {};
34
35
  setActiveSorting: (newActiveSorting: string) => void;
35
36
  setLastSearchString: (filters: IFilters, query: string) => void;
36
- search: (filters: any, page?: number, getStats?: boolean) => void;
37
+ search: (filters: any, page?: number, getStats?: boolean, vehicleID?: string|null) => void;
37
38
  resetFiltersToDefault: () => void;
38
39
  clearSearchState: (clearSorting?: boolean) => void;
39
40
  addMmsGroup: () => void;
@@ -54,6 +55,7 @@ interface IFiltersContainerProps extends IRouteComponentProps<PathParamsType> {
54
55
  t?: (phrase: string) => string;
55
56
  isDealerPage?: boolean;
56
57
  isAlternative?: boolean;
58
+ vehicleID?: string;
57
59
  successTransition?: boolean;
58
60
  isErrorAlternativeField: boolean;
59
61
  Link?: any;
@@ -66,8 +68,12 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
66
68
  }
67
69
 
68
70
  componentDidUpdate(prevProps: IFiltersContainerProps) {
69
- const { location, filters, resetFiltersToDefault, clearSearchState, search, activeSorting, setActiveSorting } = this.props;
70
- if ((prevProps.location.search !== location.search) && !_startsWith(location.search, '?pageNumber')) {
71
+ const { location, filters, resetFiltersToDefault, clearSearchState, search, activeSorting, setActiveSorting, vehicleID } = this.props;
72
+ console.log('vehicleID', vehicleID);
73
+ if (
74
+ (prevProps.location.search !== location.search) &&
75
+ !_startsWith(location.search, '?pageNumber'))
76
+ {
71
77
  const queryFromFilters = this.getQueryFromFilters();
72
78
  const prevQueryFromFilters = ['pageNumber', 'activeSort'].reduce((url, param) => url.replace(new RegExp(`(^${param}=\\w*&|&${param}=\\w*)`), ''), prevProps.location.search.slice(1));
73
79
  const paramsFromQuery = qs.parse(location.search, { ignoreQueryPrefix: true });
@@ -83,11 +89,11 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
83
89
 
84
90
  if (activeSort !== activeSorting) {
85
91
  // activeSorting = activeSort; // TODO make a function to change at searchStore
86
- setActiveSorting(activeSort);
92
+ setActiveSorting(activeSort as string);
87
93
  }
88
94
 
89
95
  clearSearchState(!activeSort);
90
- search(filters, pageNumber || 1, true);
96
+ search(filters, Number(pageNumber) || 1, true, vehicleID);
91
97
  }
92
98
 
93
99
  this.updateFinancingSearchConfig();
@@ -194,41 +200,46 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
194
200
  if (paramsKeys.length) {
195
201
  paramsKeys.forEach((filter: string) => {
196
202
  const paramValue = paramsFromQuery[filter];
197
-
198
203
  if (filter === MMS_GROUPS_KEY) { //tslint:disable-line
199
- paramValue.map((group: any, index: number) => {
200
- if (index >= 1) {
201
- if (filter === MMS_GROUPS_KEY) addMmsGroup();
202
- }
203
-
204
- Object.keys(group).forEach((key: string) => {
205
- changeFilterValue(key, group[key], index);
206
- if (key === MANUFACTURER_KEY) {
207
- getModelsInfoByMaker(group[key], true).then((response: any) => {
208
- const models = response || [];
209
- addModelsToFilters(models, index);
210
- });
204
+ if (isArray(paramValue)) {
205
+ const stringParamValue: string[] = paramValue as string[];
206
+ stringParamValue.map((group: any, index: number) => {
207
+ if (index >= 1) {
208
+ if (filter === MMS_GROUPS_KEY) addMmsGroup();
211
209
  }
210
+
211
+ Object.keys(group).forEach((key: string) => {
212
+ changeFilterValue(key, group[key], index);
213
+ if (key === MANUFACTURER_KEY) {
214
+ getModelsInfoByMaker(group[key], true).then((response: any) => {
215
+ const models = response || [];
216
+ addModelsToFilters(models, index);
217
+ });
218
+ }
219
+ });
212
220
  });
213
- });
221
+ }
214
222
  } else if (filter === MM_GROUPS_EXCLUDE_KEY) {
215
- paramValue.map((group: any, index: number) => {
216
- if (index >= 1) {
217
- addMmExcludeGroup();
218
- }
223
+ if (isArray(paramValue)) {
224
+ const stringParamValue: string[] = paramValue as string[];
225
+ stringParamValue.map((group: any, index: number) => {
226
+ if (index >= 1) {
227
+ addMmExcludeGroup();
228
+ }
219
229
 
220
- Object.keys(group).forEach((key: string) => {
221
- changeFilterValue(key, group[key], index);
230
+ Object.keys(group).forEach((key: string) => {
231
+ changeFilterValue(key, group[key], index);
232
+ });
222
233
  });
223
- });
234
+ }
224
235
  } else {
225
236
  // Defines whether filter is range or not.
226
237
  const isRange = rangeFiltersStrings.indexOf(filter) !== -1;
227
238
  const isObject = objectFiltersStrings.indexOf(filter) !== -1;
228
239
 
229
240
  // Transform url encoded param into range filter object.
230
- const valueToSend = isRange ? qs.parse(paramValue, { ignoreQueryPrefix: true }) : paramValue;
231
- changeFilterValue(filter, valueToSend);
241
+ const valueToSend = isRange ? qs.parse(paramValue as string, { ignoreQueryPrefix: true }) : paramValue;
242
+ changeFilterValue(filter, valueToSend as string);
232
243
  if (isRange || isObject) { changeRangeFilterControls(filter, valueToSend); }
233
244
  }
234
245
  });
@@ -303,7 +314,7 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
303
314
  if (isHistogram) {
304
315
  const histogramData = histograms[filterField].length ? histograms[filterField] : RANGE_FILTERS[filter].options;
305
316
  const actualValues = {
306
- from: histogramData[0].from,
317
+ from: filters[filter].value.from ? filters[filter].value.from : histogramData[0].from,
307
318
  to: histogramData[histogramData.length - 1].to
308
319
  };
309
320
 
@@ -377,24 +388,37 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
377
388
  });
378
389
  };
379
390
 
391
+ onVehicleIdChange = (value: string) => {
392
+ const { filters, changeFilterValue, search } = this.props;
393
+ const upperCaseValue = value.toLocaleUpperCase().trim();
394
+ if (upperCaseValue.length === 6 || !value) {
395
+ this.onFilterChange('VEHICLE_ID', upperCaseValue);
396
+ changeFilterValue('VEHICLE_ID', upperCaseValue);
397
+ search(filters, 1, true);
398
+ }
399
+ };
400
+
380
401
  render() {
381
- const { t, onAlternativeRedirect, isAlternative, isErrorAlternativeField, Link, locationSearch, successTransition } = this.props;
402
+ const { t, onAlternativeRedirect, isAlternative, isErrorAlternativeField, Link, locationSearch, successTransition, filters } = this.props;
382
403
  const paramsFromQuery = qs.parse(location.search, { ignoreQueryPrefix: true });
404
+
405
+ const { VEHICLE_ID } = filters;
406
+
383
407
  const alternativeIDProps = {
384
408
  t,
385
409
  successTransition,
386
- autoDeId: paramsFromQuery.autoDeId,
410
+ autoDeId: paramsFromQuery.autoDeId as string,
387
411
  error: isErrorAlternativeField,
388
412
  onChange: onAlternativeRedirect
389
413
  };
390
-
414
+ console.log('isErrorAlternativeField', isErrorAlternativeField);
391
415
  return (
392
416
  <div className={styles.filters}>
393
417
  {isAlternative ? (
394
418
  <div className={styles.titleAlternative}>
395
419
  <div className={styles.titleWrap}>
396
420
  <h3 className={styles.titleTextAlternative}>auto.de-ID</h3>
397
- <Link to={ `/alternative/detailed${locationSearch}` } className={styles.titleLink}>
421
+ <Link to={`/alternative/detailed${locationSearch}`} className={styles.titleLink}>
398
422
  {this.props.t('SearchPage:detailedSearch')}
399
423
  </Link>
400
424
  </div>
@@ -404,8 +428,19 @@ class FiltersContainer extends React.Component<IFiltersContainerProps, {}> {
404
428
  <div className={styles.title}>
405
429
  <h3 className={styles.titleText}>{this.props.t('SearchPage:filterBy')}</h3>
406
430
  </div>
431
+ {!isAlternative ? (
432
+ <div className={styles.vehicleId}>
433
+ <div className={styles.vehicleIdLabel}>auto.de-ID</div>
434
+ <MaterialField
435
+ value={VEHICLE_ID.value}
436
+ onChange={this.onVehicleIdChange}
437
+ size='custom'
438
+ placeholder={t('SearchPage:vehicleIdexample')}
439
+ />
440
+ </div>
441
+ ) : ''}
407
442
  {this.renderFilters()}
408
- <Link className={styles.linkToDetailed} to={ `/${isAlternative ? 'alternative' : 'search'}/detailed${locationSearch}` }>{t('SearchPage:detailedSearch')}</Link>
443
+ <Link className={styles.linkToDetailed} to={`/${isAlternative ? 'alternative' : 'search'}/detailed${locationSearch}`}>{t('SearchPage:detailedSearch')}</Link>
409
444
  </div>
410
445
  );
411
446
  }
@@ -419,9 +454,10 @@ const removeUnknownOptions = (options: any) => {
419
454
  // export default React.memo(FiltersContainer);
420
455
 
421
456
  export default React.memo(FiltersContainer, (props, nextProps) => {
422
- const { t, location, filters, aggregation } = props;
423
- return t === nextProps.t &&
424
- location.search === nextProps.location.search &&
425
- isEqual(aggregation, nextProps.aggregation) &&
426
- isEqual(filters.MMS_GROUPS, nextProps.filters.MMS_GROUPS)
427
- });
457
+ const { t, location, filters, aggregation, isErrorAlternativeField } = props;
458
+ return t === nextProps.t &&
459
+ location.search === nextProps.location.search &&
460
+ isErrorAlternativeField === nextProps.isErrorAlternativeField &&
461
+ isEqual(aggregation, nextProps.aggregation) &&
462
+ isEqual(filters.MMS_GROUPS, nextProps.filters.MMS_GROUPS);
463
+ });
@@ -8,74 +8,103 @@ export const QUOTES_SLIDES_TO_SHOW_DEFAULT = 3;
8
8
 
9
9
  export const HUNDRED = 100;
10
10
 
11
- export const GOOGLE_BUNDLE_COOKIES = {
12
- analytics_storage: { name: 'Google-Analytics' },
13
- ad_storage: { name: 'Google-Werbeausrichtung' },
14
- functionality_storage: { name: 'Google-Funktionalität' },
15
- personalization_storage: { name: 'Google-Personalisierung' },
16
- security_storage: { name: 'Google-Sicherheit' }
17
- };
11
+ export const GOOGLE_BUNDLE_COOKIES = [
12
+ 'analytics_storage',
13
+ 'ad_storage',
14
+ 'functionality_storage',
15
+ 'personalization_storage',
16
+ 'security_storage'
17
+ ];
18
18
 
19
19
  /* tslint:disable */
20
+
21
+ export const COOKIE_SCHEMA_LINKS = {
22
+ ['auto.de']: 'https://www.auto.de/datenschutz/',
23
+ Cloudflare: 'https://www.cloudflare.com/de-de/gdpr/introduction/',
24
+ Firebase: 'https://firebase.google.com/support/privacy?hl=de',
25
+ Google: 'https://policies.google.com/privacy?hl=de',
26
+ Criteo: 'https://www.criteo.com/de/privacy/',
27
+ Facebook: 'https://www.facebook.com/privacy/policies/cookies/?entry_point=cookie_policy_redirect&entry=0',
28
+ ['Google Analytics']: 'https://policies.google.com/privacy?hl=de',
29
+ Hotjar: 'https://www.hotjar.com/legal/policies/privacy/de/',
30
+ Microsoft: 'https://privacy.microsoft.com/de-de/privacystatement',
31
+ Matomo: 'https://matomo.org/privacy-policy/',
32
+ Trustpilot: 'https://de.legal.trustpilot.com/for-reviewers/end-user-privacy-terms',
33
+ Awin: 'https://www.awin.com/de/datenschutzerklarung',
34
+ Youtube:'https://www.youtube.com/howyoutubeworks/our-commitments/protecting-user-data/'
35
+ }
36
+
20
37
  export const COOKIE_SCHEMA = {
21
38
  necessary: {
22
- __cfruid: { name: 'Cloudflare' },
23
- cf_chl_2: { name: 'Cloudflare für Webverkehr zu identifizieren' },
24
- cf_chl_rc_ni: { name: 'Cloudflare für den internen Gebrauch' },
25
- ['next-i18next']: { name: 'Spracheinstellungen' },
26
- _cfuvid: { name: 'Cloudflare WAF' },
27
- cf_chl_prog: { name: 'Cloudflare für JS' },
28
- __cf_bm: { name: 'Cloudflare bot' }
39
+ ['auto.de']: ['next-i18next'],
40
+ Cloudflare: [
41
+ 'cf_chl_2',
42
+ 'cf_chl_rc_ni',
43
+ 'cf_chl_prog'
44
+ ],
45
+ Firebase: [''],
46
+ Matomo: ['MATOMO_SESSID','_pk_ses.1.4d04', '_pk_id.1.4d04'],
47
+ Trustpilot: ['']
29
48
  },
30
49
  analytics: {
31
- PugT: {name: 'PubMatic' },
32
- locale: {name: 'Personio' },
33
- uid: { name: 'criteo' },
34
- callback: { name: 'callback' },
35
- demdex: { name: 'demdex' },
36
- vuid: { name: 'Vimeo' },
37
- _fbp: { name: 'Facebook' },
38
- hotjar: { name: 'Hotjar-Analytics'},
39
- _clck: { name: 'Clarity' },
40
- _clsk: { name: 'Clarity' },
41
- _uetsid: { name: 'Microsoft-Werbeausrichtung' },
42
- _uetvid: { name: 'Microsoft-Werbeausrichtung' },
43
- sentry: { name: 'Sentry' },
44
- ...GOOGLE_BUNDLE_COOKIES
50
+ ['auto.de']: [
51
+ 'sentry',
52
+ 'callback',
53
+ 'locale'
54
+ ],
55
+ Criteo: [
56
+ 'uid',
57
+ 'PugT',
58
+ 'demdex',
59
+ 'cto_bundle',
60
+ 'tuuid',
61
+ 'tuuid_lu',
62
+ 'c',
63
+ 'CMID',
64
+ 'CMPS',
65
+ 'CMPRO',
66
+ 'uuid2',
67
+ 'um',
68
+ 'umeh',
69
+ 'KRTBCOOKIE_97',
70
+ 'IDSYNC',
71
+ 'dpm',
72
+ '_kuid_',
73
+ 'visitor-id',
74
+ 'data-c-ts',
75
+ 'data-c',
76
+ 'CMTS',
77
+ 'mv_tokens',
78
+ 'A3',
79
+ 'mv_tokens_eu-v1',
80
+ 'am_tokens',
81
+ 'am_tokens_eu-v1',
82
+ 'iteo'
83
+ ],
84
+ Facebook: ['_fbp'],
85
+ ['Google Analytics']: [
86
+ ...GOOGLE_BUNDLE_COOKIES
87
+ ],
88
+ Hotjar: ['hotjar'],
89
+ Microsoft: ['_clck', '_clsk', '_uetsid', '_uetvid']
45
90
  },
46
91
  marketing: {
47
- test_cookie: { name: 'doubleclick.net' },
48
- tuuid: { name: '360yield.com' },
49
- tuuid_lu: { name: '360yield.com' },
50
- c: { name: 'bidswitch.net' },
51
- CMID: { name: 'casalemedia.com' },
52
- CMPS: { name: 'casalemedia.com' },
53
- CMPRO: { name: 'casalemedia.com' },
54
- uuid2: { name: 'adnxs.com' },
55
- IDE: { name: 'Google DoubleClick' },
56
- um: { name: '360yield.com' },
57
- umeh: { name: '360yield.com' },
58
- cf: { name: 'id5-sync.com' },
59
- cip: { name: 'id5-sync.com' },
60
- cnac: { name: 'id5-sync.com' },
61
- car: { name: 'id5-sync.com' },
62
- KRTBCOOKIE_97: { name: 'PubMatic' },
63
- IDSYNC: { name: 'analytics.yahoo.com' },
64
- dpm: { name: 'Demdex' },
65
- _kuid_: { name: 'Krux' },
66
- cto_bundle: { name: 'Criteo' },
67
- ['visitor-id']: { name: 'media.net' },
68
- ['data-c-ts']: { name: 'media.net' },
69
- ['data-c']: { name: 'media.net' },
70
- CMTS: { name: 'casalemedia.com' },
71
- ['mv_tokens']: { name: 'mediavine' },
72
- A3: { name: 'yahoo.com' },
73
- ['mv_tokens_eu-v1']: { name: 'mediavine' },
74
- am_tokens: { name: 'mediavine' },
75
- ['am_tokens_eu-v1']: { name: 'mediavine' },
76
- iteo: { name: 'mediavine' },
77
- MyVerivoxAuth: { name: 'www.verivox.de' },
78
- VxCheckAuth: { name: 'www.verivox.de' }
92
+ ['auto.de']: [
93
+ 'cf',
94
+ 'cip',
95
+ 'cnac',
96
+ 'car'
97
+ ],
98
+ Awin: [
99
+ 'bid'
100
+ ],
101
+ Google: [
102
+ 'test_cookie',
103
+ 'IDE',
104
+ ],
105
+ Youtube: [
106
+ 'youtube'
107
+ ]
79
108
  }
80
109
  };
81
110
 
@@ -4,7 +4,7 @@ import { selectors } from '@bytebrand/car-schema-selectors';
4
4
  export const climatisation = {
5
5
  key: 'heatingCooling_climatisation',
6
6
  climatisationKeys: [
7
- 'selector_climatisation_no_airCondition',
7
+ // 'selector_climatisation_no_airCondition',
8
8
  'selector_climatisation_airCondition',
9
9
  'selector_climatisation_automaticAirCondition',
10
10
  'selector_climatisation_2_automaticAirCondition',
@@ -59,7 +59,7 @@ export const offers = [
59
59
  name: 'financing',
60
60
  periods: [12, 24, 36, 48, 60, 72, 84, 96], // tslint:disable-line
61
61
  sliders: [
62
- { name: 'firstInstallment', min: 0, step: 100, unit: 'euro' }, // tslint:disable-line
62
+ { name: 'firstInstallment', min: 0, step: 100, unit: 'euro', withRangeLimit: true }, // tslint:disable-line
63
63
  { name: 'annualMileage', min: 5000, max: 60000, step: 5000, unit: 'km' } // tslint:disable-line
64
64
  ]
65
65
  },
@@ -32,6 +32,7 @@ export interface IImage {
32
32
  isSimpleTemp: boolean;
33
33
  isInProcessing: boolean;
34
34
  isTemp: boolean;
35
+ videoUrl:string; // youtube link that can be used in src in youtube video,
35
36
  }
36
37
 
37
38
  export interface IPrice {
@@ -96,7 +97,7 @@ export interface IVehicleInfo {
96
97
  linkTag?: string;
97
98
  mlCurrentSalesPricePredicted?: number;
98
99
  location?: IVehicleLocation;
99
- common: {
100
+ common?: {
100
101
  currentSalesPrice?: number;
101
102
  isStrikeShown?: boolean;
102
103
  };
@@ -187,7 +188,9 @@ export interface IVehicleDetailedSidebarPriceProps {
187
188
  isAlternative?: boolean;
188
189
  // currentSalesPrice?: number;
189
190
  originalSalesPrice?: number;
190
- common: { isStrikeShown?: boolean, currentSalesPrice?: number };
191
+ common?: { isStrikeShown?: boolean, currentSalesPrice?: number };
192
+ financing?: any;
193
+ currentSalesPrice?: number;
191
194
  }
192
195
  export interface ITabsProps {
193
196
  t?: (key: string, options?: object) => string;
@@ -248,6 +251,8 @@ export interface IVehicleDetailedSidebarProps {
248
251
  infoSections: { title: string, value: string, icon?: string }[];
249
252
  isAlternative?: boolean;
250
253
  onCurrentSalesPriceChange: (price: number) => void;
254
+ className?: string;
255
+ isFetching?: boolean;
251
256
  }
252
257
 
253
258
  interface IOfferRequestButtonWrapper {
@@ -340,7 +345,7 @@ export interface IVehicleCompareProps {
340
345
  onRemoveClick: () => void;
341
346
  }
342
347
 
343
- export interface TFunction {
348
+ export interface ITFunction {
344
349
  <T = string>(key: string, options?: object): T;
345
350
  <T = string>(keys: string[], options?: object): T;
346
- }
351
+ }