@bytebrand/fe-ui-core 4.8.18 → 4.8.20
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
|
@@ -55,7 +55,6 @@ export const COOKIE_SCHEMA = {
|
|
|
55
55
|
],
|
|
56
56
|
Facebook: ['_fbp'],
|
|
57
57
|
Hotjar: ['hotjar'],
|
|
58
|
-
Microsoft: ['_clck', '_clsk', '_uetsid', '_uetvid']
|
|
59
58
|
},
|
|
60
59
|
marketing: {
|
|
61
60
|
['auto.de']: [
|
|
@@ -113,6 +112,7 @@ export const COOKIE_SCHEMA = {
|
|
|
113
112
|
'ts',
|
|
114
113
|
'receive-cookie-deprecation'
|
|
115
114
|
],
|
|
115
|
+
Microsoft: ['_clck', '_clsk', '_uetsid', '_uetvid'],
|
|
116
116
|
Youtube: [
|
|
117
117
|
'youtube'
|
|
118
118
|
]
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '../constants/SearchWidget';
|
|
9
9
|
import { priceRatings, priceRatingConfig } from '../constants/price';
|
|
10
10
|
import { HUNDRED } from '../constants/common';
|
|
11
|
-
import { offers } from '../constants';
|
|
11
|
+
import { offers, PREDICTABLE_PRICE_INDEX } from '../constants';
|
|
12
12
|
import { FILTERS_IN_TITLE, MANUFACTURER_KEY, MAX_FILTERS_IN_TITLE, MODEL_KEY } from '../constants/Search';
|
|
13
13
|
import { SearchPage as SearchPageTranslate } from '../../locales/data';
|
|
14
14
|
import { isArray } from 'lodash';
|
|
@@ -342,13 +342,24 @@ export const getPriceRatingConfig = (currentPrice: number, pricePredicted: numbe
|
|
|
342
342
|
}, {}); // tslint:disable-line
|
|
343
343
|
};
|
|
344
344
|
|
|
345
|
+
export const getPredictablePrice = (currentSalesPrice: number, predictablePrice: number) => {
|
|
346
|
+
if (Number.isFinite(Number.parseFloat(`${predictablePrice}`))) {
|
|
347
|
+
return predictablePrice;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return currentSalesPrice * PREDICTABLE_PRICE_INDEX;
|
|
351
|
+
}
|
|
352
|
+
|
|
345
353
|
export const getPriceRating = (currentSalesPrice: number, predictablePrice: number) => {
|
|
346
354
|
const isCorrectCurrentSalesPrice = Number.isFinite(Number.parseFloat(`${currentSalesPrice}`));
|
|
347
|
-
const isCorrectPredictablePrice = Number.isFinite(Number.parseFloat(`${predictablePrice}`));
|
|
355
|
+
// const isCorrectPredictablePrice = Number.isFinite(Number.parseFloat(`${predictablePrice}`));
|
|
356
|
+
|
|
357
|
+
if (!isCorrectCurrentSalesPrice) return 0;
|
|
358
|
+
|
|
348
359
|
|
|
349
|
-
|
|
360
|
+
const validatedPredictablePrice = getPredictablePrice(currentSalesPrice, predictablePrice);
|
|
350
361
|
|
|
351
|
-
const ratingConfig = getPriceRatingConfig(currentSalesPrice,
|
|
362
|
+
const ratingConfig = getPriceRatingConfig(currentSalesPrice, validatedPredictablePrice);
|
|
352
363
|
|
|
353
364
|
for (const key of Object.keys(ratingConfig)) {
|
|
354
365
|
const { min, max } = ratingConfig[key];
|