@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.
- package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +613 -0
- package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +335 -0
- package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +4 -2
- package/common.ts +6 -2
- package/package.json +19 -28
- package/source/components/AccordionWidget/AccordionWidget.tsx +1 -3
- package/source/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/source/components/Checkout/CheckoutStepper/CheckoutStepper.styl +2 -190
- package/source/components/Checkout/CheckoutStepper/CheckoutStepper.tsx +15 -16
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
- package/source/components/FormattedNumber/FormattedNumber.tsx +2 -3
- package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +4 -6
- package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +0 -3
- package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.js → MuiOfferPeriod.theme.tsx} +8 -13
- package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +28 -4
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +6 -12
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +0 -4
- package/source/components/OfferPanel/RangeGroup/RangeGroup.tsx +6 -4
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +6 -2
- package/source/components/SearchFilters/filters/AlternativeID.tsx +42 -53
- package/source/components/SearchFilters/filters/DriveType.tsx +1 -1
- package/source/components/SearchFilters/filters/EmissionSticker.tsx +1 -1
- package/source/components/SearchFilters/filters/FirstRegistration.tsx +0 -1
- package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
- package/source/components/SearchFilters/filters/InteriorMaterial.tsx +2 -1
- package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
- package/source/components/SearchFilters/filters/Power.tsx +36 -17
- package/source/components/SearchFilters/filters/StateOptions.tsx +0 -1
- package/source/components/SearchFilters/filters/Transmission.tsx +1 -1
- package/source/components/SearchPage/SearchChips/SearchChips.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +3 -3
- package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +2 -2
- package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -1
- package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +3 -3
- package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
- package/source/components/SearchWidget/HighlightsWidget/HighlightsWidget.tsx +2 -2
- package/source/components/SearchWidget/StateWidget/StateWidget.tsx +1 -2
- package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +4 -4
- package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +16 -16
- package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +1 -1
- package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
- package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +6 -6
- package/source/components/Stepper/Stepper.tsx +4 -3
- package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.styl +38 -0
- package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.tsx +120 -0
- package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.styl +22 -0
- package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.tsx +84 -0
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +11 -2
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +5 -5
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +57 -38
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCard.tsx +2 -2
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +183 -101
- package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +5 -7
- package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.tsx +33 -7
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +10 -2
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +54 -14
- package/source/components/VehicleDetailedSidebar/partials/Price.styl +5 -1
- package/source/components/VehicleDetailedSidebar/partials/Price.tsx +2 -1
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.styl +16 -5
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +9 -4
- package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +1 -1
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +45 -0
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +121 -42
- package/source/components/VehicleDetailedSlider/partials/PriceData.styl +4 -1
- package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +8 -1
- package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +9 -7
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +35 -1
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +9 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +11 -2
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +2 -1
- package/source/components/VehicleSmallCard/VehicleSmallCard.styl +3 -1
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +3 -7
- package/source/components/_common/Badge/Badge.styl +3 -0
- package/source/components/_common/Badge/Badge.tsx +1 -1
- package/source/components/_common/Button/Button.tsx +5 -4
- package/source/components/_common/Checkbox/FormCheckbox.tsx +4 -4
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
- package/source/components/_common/Chip/Chip.tsx +1 -3
- package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
- package/source/components/_common/IconSVG/IconSVGConfig.tsx +2 -0
- package/source/components/_common/IconSVG/SVG/flags/SK.tsx +0 -1
- package/source/components/_common/IconSVG/SVG/slider/360New.tsx +1 -1
- package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +26 -0
- package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +22 -30
- package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +0 -1
- package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +12 -15
- package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
- package/source/components/_common/MaterialSwitch/MaterialSwitch.tsx +3 -1
- package/source/components/_common/MaterialTooltip/MaterialTooltip.styled.tsx +1 -1
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
- package/source/components/_common/Modal/CookieModal.tsx +1 -3
- package/source/components/_common/Modal/Modal.styled.tsx +2 -1
- package/source/components/_common/Modal/Modal.tsx +1 -5
- package/source/components/_common/Modal/ModalsConfig.tsx +5 -1
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.styl +23 -7
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +84 -36
- package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.styl +29 -14
- package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.tsx +17 -10
- package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +12 -4
- package/source/components/_common/Range/Range.tsx +27 -14
- package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +0 -1
- package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
- package/source/components/_common/UserMenu/MaterialMenuItem.tsx +42 -20
- package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
- package/source/components/_common/withStats/withStats.styl +3 -0
- package/source/components/_common/withStats/withStats.tsx +19 -16
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +14 -1
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +78 -42
- package/source/framework/constants/common.ts +89 -60
- package/source/framework/constants/highlights.ts +1 -1
- package/source/framework/constants.ts +1 -1
- package/source/framework/types/types.ts +9 -4
- package/source/framework/utils/CommonUtils.ts +73 -62
- package/source/framework/utils/DateUtils.ts +10 -2
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +1 -2
- package/source/framework/vehiclesProps/decoratedProps.tsx +1 -2
- package/source/locales/data.ts +2 -2
- package/tslint.json +1 -2
- package/utils.ts +2 -0
|
@@ -7,23 +7,19 @@ import {
|
|
|
7
7
|
DROP_DOWN_GROUP, RATE_DEFAULT, MMS_GROUPS_KEY, MMS_GROUP_FIELDS
|
|
8
8
|
} from '../constants/SearchWidget';
|
|
9
9
|
import { priceRatings, priceRatingConfig } from '../constants/price';
|
|
10
|
-
import {
|
|
10
|
+
import { HUNDRED } from '../constants/common';
|
|
11
11
|
import { offers } 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
|
+
import { isArray } from 'lodash';
|
|
14
15
|
|
|
15
16
|
const PRICE_DEFAULT = DROP_DOWN_GROUP[PRICE].defaultValue;
|
|
16
17
|
|
|
17
18
|
declare global {
|
|
18
19
|
// tslint:disable-next-line:interface-name
|
|
19
20
|
interface Window {
|
|
20
|
-
grantHotjarCookieConsent?: () => void;
|
|
21
|
-
grantCookieConsentClarity?: () => void;
|
|
22
|
-
grantCookieConsentMicrosoft?: () => void;
|
|
23
|
-
grantCookieConsentFacebook?: () => void;
|
|
24
21
|
grantCookieConsentSentry?: () => void;
|
|
25
|
-
grantCookieConsent?: (
|
|
26
|
-
allowGoogle?: () => void;
|
|
22
|
+
grantCookieConsent?: (disabledCookies: string[]) => void;
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
25
|
|
|
@@ -220,10 +216,11 @@ export const buildQueryForSearch = (filters: any) => {
|
|
|
220
216
|
|
|
221
217
|
if (filterValue && filterValue.value) {
|
|
222
218
|
if (MMS_GROUP_FIELDS.indexOf(filter) !== -1) {
|
|
223
|
-
MMS_GROUP[filter] = filterValue.value;
|
|
224
219
|
|
|
225
220
|
if (filterValue.isSeries) {
|
|
226
221
|
MMS_GROUP.SERIES = filterValue.value;
|
|
222
|
+
} else {
|
|
223
|
+
MMS_GROUP[filter] = filterValue.value;
|
|
227
224
|
}
|
|
228
225
|
}
|
|
229
226
|
}
|
|
@@ -376,15 +373,19 @@ export const getOfferSliders = (financingConfig: any, t: (key: string, options?:
|
|
|
376
373
|
financingConfig.common ?
|
|
377
374
|
financingConfig.common.currentSalesPrice :
|
|
378
375
|
financingConfig.currentSalesPrice; // TODO: fix deprecated. Correct is "financingConfig.common.currentSalesPrice"
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
376
|
+
if (isArray(offerObj.sliders)) {
|
|
377
|
+
const sliders: any = offerObj.sliders;
|
|
378
|
+
return sliders
|
|
379
|
+
.map((slider: any, index: number) => {
|
|
380
|
+
if (componentType === 'checkout' && index === 1 && priceTabIndex === 0) return; // remove checkout annual mileage for financing
|
|
381
|
+
if (slider.name === 'firstInstallment') slider.max = offerConfig.firstInstallmentMax || currentSalesPrice;
|
|
382
|
+
slider.value = offerConfig[slider.name];
|
|
383
|
+
slider.unitName = t(`modals:financing.${slider.unit}`);
|
|
384
|
+
slider.caption = t(`modals:financing.${slider.name}`);
|
|
385
|
+
return slider;
|
|
386
|
+
}).filter(Boolean);
|
|
387
|
+
}
|
|
388
|
+
|
|
388
389
|
};
|
|
389
390
|
|
|
390
391
|
export const checkWebpFeature = async () => {
|
|
@@ -462,7 +463,9 @@ export function getChipFilterValue(
|
|
|
462
463
|
case 'SEATS':
|
|
463
464
|
case 'CUBIC_CAPACITY':
|
|
464
465
|
title = t(`SearchPage:filters.${chipFilterKey.toLocaleLowerCase()}`);
|
|
465
|
-
|
|
466
|
+
from = !!chipFilterValue.from ? `${t('SearchPage:filters.from')} ${chipFilterValue.from}` : '';
|
|
467
|
+
to = !!chipFilterValue.to ? `${t('SearchPage:filters.to')} ${chipFilterValue.to}` : '';
|
|
468
|
+
const fromTo = (from && to) ? `${chipFilterValue.from} - ${chipFilterValue.to}` : `${from || to}`;
|
|
466
469
|
filterValue = `${title} ${fromTo}`;
|
|
467
470
|
break;
|
|
468
471
|
|
|
@@ -544,64 +547,29 @@ export function setUtmParameters() {
|
|
|
544
547
|
const domain = parsedUrl.hostname.split('.').slice(-2).join('.');
|
|
545
548
|
|
|
546
549
|
document.cookie = `marketing=${JSON.stringify(marketing)};expires=${expiresDate};domain=.${domain};path=/`;
|
|
550
|
+
|
|
547
551
|
}
|
|
548
552
|
|
|
549
553
|
export const updateCookieList = (handleSentryInit: () => void) => {
|
|
550
|
-
let cookieConsentList = Object.keys(GOOGLE_BUNDLE_COOKIES);
|
|
551
|
-
let isHomeGoogleGranted = true; // home page google cookie
|
|
552
|
-
let isMicrosoftGranted = true; // Microsoft _uetvid _uetsid
|
|
553
|
-
let isMicrosoftClarity = true; // Microsoft Clarity _clck _clsk
|
|
554
|
-
let isFacebookGranted = true; // Facebook Clarity _fbp _f
|
|
555
|
-
let isSentryGranted = true; // Sentry
|
|
556
|
-
let isHotjarGranted = true;
|
|
557
554
|
const cookieConfig = JSON.parse(localStorage.getItem('cookieConfig')) || {};
|
|
558
|
-
|
|
555
|
+
let isSentryGranted = true; // Sentry
|
|
556
|
+
let disabledCookies: any[] = [];
|
|
559
557
|
const parsedUrl = new URL(window.location.href);
|
|
560
558
|
const domain = parsedUrl.hostname.split('.').slice(-2).join('.');
|
|
559
|
+
|
|
561
560
|
Object.keys(cookieConfig).forEach((group: string) => {
|
|
562
561
|
cookieConfig[group].forEach((cookie: string) => {
|
|
563
562
|
Cookies.remove(cookie, { domain, path: '/' }); // manually remove selected cookies
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
cookieConsentList = cookieConsentList.filter(i => i !== cookie); // deny google cookie consent for _gcl_au, _ga, _gid, _gat_UA-31842-13, etc
|
|
567
|
-
|
|
568
|
-
isHomeGoogleGranted = false;
|
|
563
|
+
if (cookie === 'sentry') {
|
|
564
|
+
isSentryGranted = false;
|
|
569
565
|
}
|
|
570
|
-
|
|
571
|
-
else if (cookie === '_uetvid' || cookie === '_uetsid') isMicrosoftGranted = false;
|
|
572
|
-
else if (cookie === '_clck' || cookie === '_clsk') isMicrosoftClarity = false;
|
|
573
|
-
else if (cookie === '_fbp') isFacebookGranted = false;
|
|
574
|
-
else if (cookie === 'sentry') isSentryGranted = false;
|
|
566
|
+
disabledCookies.push(cookie);
|
|
575
567
|
});
|
|
576
568
|
});
|
|
577
569
|
|
|
578
570
|
// grant google cookies
|
|
579
571
|
if (typeof window.grantCookieConsent === 'function') {
|
|
580
|
-
window.grantCookieConsent(
|
|
581
|
-
};
|
|
582
|
-
|
|
583
|
-
// grant Microsoft cookies
|
|
584
|
-
if (isMicrosoftGranted && typeof window.grantCookieConsentMicrosoft === 'function') {
|
|
585
|
-
window.grantCookieConsentMicrosoft();
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
// grant Microsoft Clarity cookies
|
|
589
|
-
if (isMicrosoftClarity && typeof window.grantCookieConsentClarity === 'function') {
|
|
590
|
-
window.grantCookieConsentClarity();
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
// grant Facebook cookies
|
|
594
|
-
if (!isFacebookGranted && typeof window.grantCookieConsentFacebook === 'function') {
|
|
595
|
-
window.grantCookieConsentFacebook();
|
|
596
|
-
};
|
|
597
|
-
|
|
598
|
-
if (isHomeGoogleGranted && typeof window.allowGoogle === 'function') {
|
|
599
|
-
window.allowGoogle();
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
// grant Hotjar cookies
|
|
603
|
-
if (isHotjarGranted && typeof window.grantHotjarCookieConsent === 'function') {
|
|
604
|
-
window.grantHotjarCookieConsent();
|
|
572
|
+
window.grantCookieConsent(disabledCookies);
|
|
605
573
|
}
|
|
606
574
|
|
|
607
575
|
// grant Sentry cookies
|
|
@@ -619,6 +587,49 @@ export const getCents = (value: number, prefix?: string, postfix?: string): stri
|
|
|
619
587
|
return `${prefix}${result}${postfix}`;
|
|
620
588
|
};
|
|
621
589
|
|
|
590
|
+
/**
|
|
591
|
+
* Generates a timestamp (Unix time) after 14 days from the current date.
|
|
592
|
+
* @returns {number} Timestamp (Unix time) after 14 days.
|
|
593
|
+
*/
|
|
594
|
+
export const getUnixTimestampAfterTwoWeeks = () => {
|
|
595
|
+
const currentDate = new Date();
|
|
596
|
+
const futureDate = new Date();
|
|
597
|
+
|
|
598
|
+
futureDate.setDate(currentDate.getDate() + 14);
|
|
599
|
+
|
|
600
|
+
const unixTimestamp = Math.floor(futureDate.getTime() / 1000);
|
|
601
|
+
return unixTimestamp;
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Converts a Unix timestamp to the day of the month.
|
|
606
|
+
* @param {number} unixTimestamp - The Unix timestamp to convert.
|
|
607
|
+
* @returns {number} Return the number of days as the result
|
|
608
|
+
*/
|
|
609
|
+
export const convertUnixTimestampToDays = (unixTimestamp: number) => {
|
|
610
|
+
const milliseconds = Number(unixTimestamp * 1000);
|
|
611
|
+
const date = new Date(milliseconds);
|
|
612
|
+
const currentDate = new Date();
|
|
613
|
+
|
|
614
|
+
// Calculate the difference between the current date and the obtained date
|
|
615
|
+
const timeDifference = currentDate.getTime() - date.getTime();
|
|
616
|
+
const daysDifference = -Math.floor(timeDifference / (1000 * 3600 * 24));
|
|
617
|
+
return daysDifference;
|
|
618
|
+
};
|
|
619
|
+
|
|
622
620
|
export const priceParse = (value: any) => {
|
|
623
621
|
return !!value ? Number.parseFloat(value) : null;
|
|
624
|
-
};
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
// iPad on iOS 13 detection
|
|
625
|
+
export const iOS = () => {
|
|
626
|
+
return [
|
|
627
|
+
'iPad Simulator',
|
|
628
|
+
'iPhone Simulator',
|
|
629
|
+
'iPod Simulator',
|
|
630
|
+
'iPad',
|
|
631
|
+
'iPhone',
|
|
632
|
+
'iPod'
|
|
633
|
+
].includes(navigator.platform)
|
|
634
|
+
|| (navigator.userAgent.includes("Mac") && "ontouchend" in document)
|
|
635
|
+
}
|
|
@@ -8,10 +8,10 @@ export interface IFormatTimestamp {
|
|
|
8
8
|
|
|
9
9
|
export const timestampToDate = (timestamp: number) => {
|
|
10
10
|
if (!timestamp) return 'N/A';
|
|
11
|
-
const date = new Date(timestamp * 1000)
|
|
11
|
+
const date = new Date(timestamp * 1000);
|
|
12
12
|
const year = date.getFullYear();
|
|
13
13
|
const month = date.getMonth() + 1;
|
|
14
|
-
const monthFormatted = month < 10 ?
|
|
14
|
+
const monthFormatted = month < 10 ? `0${month}` : month;
|
|
15
15
|
return (`${monthFormatted}/${year}`);
|
|
16
16
|
};
|
|
17
17
|
|
|
@@ -91,3 +91,11 @@ export const getYears = (minYear = 1980, maxYear = moment().year(), reverse = fa
|
|
|
91
91
|
export const createDateAsUTC = (date: Date): Date => new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()));
|
|
92
92
|
|
|
93
93
|
// end for checkout datepicker
|
|
94
|
+
|
|
95
|
+
export const fromUTCToDateString = (UTCDate: Date) => {
|
|
96
|
+
const date = new Date(UTCDate);
|
|
97
|
+
const day = date.getUTCDate().toString().padStart(2, '0');
|
|
98
|
+
const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');
|
|
99
|
+
const year = date.getUTCFullYear();
|
|
100
|
+
return `${day}.${month}.${year}`;
|
|
101
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
// import { cbdGearbox, cbdFuel } from './cbdSelectors'
|
|
4
|
-
import { isNull } from 'util';
|
|
5
4
|
import { formatMileage } from '../utils/CommonUtils';
|
|
6
5
|
import { formatTimestamp } from '../utils/DateUtils';
|
|
7
6
|
import { DELIVERY_PERIODS_EXTRA } from '../constants';
|
|
@@ -19,7 +18,7 @@ const isPropDefined = (prop: any) => {
|
|
|
19
18
|
&& prop.indexOf('unknown') === -1
|
|
20
19
|
&& prop.indexOf('N/A') === -1;
|
|
21
20
|
}
|
|
22
|
-
return !
|
|
21
|
+
return !(prop === undefined || prop === null) && type !== 'undefined';
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
const formatDeliveryPeriod = (t: (phrase: string, config?: any) => string, deliveryPeriod: string) => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { isNull } from 'util';
|
|
3
2
|
import moment from 'moment';
|
|
4
3
|
|
|
5
4
|
import Icon from '../../components/_common/IconContainer/IconContainer';
|
|
@@ -25,7 +24,7 @@ const isPropDefined = (prop: any) => {
|
|
|
25
24
|
return prop.indexOf('other') === -1
|
|
26
25
|
&& prop.indexOf('unknown') === -1;
|
|
27
26
|
}
|
|
28
|
-
return !
|
|
27
|
+
return !(prop === undefined || prop === null) && type !== 'undefined';
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
const isCheckedBatteryTime = (prop: any, t: (key: string, options?: object) => string) => {
|
package/source/locales/data.ts
CHANGED
|
@@ -56,7 +56,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
56
56
|
na: 'N/A',
|
|
57
57
|
priceSub: '/mtl.',
|
|
58
58
|
priceSubMtl: '/mtl.',
|
|
59
|
-
prefixOldPrice: '
|
|
59
|
+
prefixOldPrice: 'z.B.',
|
|
60
60
|
vehicleOwners: `${vehicleOption.vehicleOwners} Fahrzeughalter`,
|
|
61
61
|
vehicleOwners_plural: `${count} Fahrzeughalter`,
|
|
62
62
|
doorsOnly: `${vehicleOption.doorsOnly} Türen`,
|
|
@@ -164,7 +164,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
164
164
|
'firstRegistration': 'Erstzulassung',
|
|
165
165
|
'mileage': 'Kilometerstand',
|
|
166
166
|
'consumptionAndCo2': 'Kraftstoffverbrauch*',
|
|
167
|
-
'monthlyFrom': 'monatlich
|
|
167
|
+
'monthlyFrom': 'monatlich z.B.',
|
|
168
168
|
'buy': 'Kaufen',
|
|
169
169
|
'financingDescription': 'Bei der Finanzierung zahlen Sie lediglich die Zinsen des Darlehens und einen geringen Tilgungsanteil. Zum Vertragsende können Sie entscheiden, ob Sie den Restbetrag ablösen oder weiter finanzieren wollen.',
|
|
170
170
|
'leasingDescription': 'Beim Leasing zahlen Sie lediglich die Zinsen des Darlehens und einen geringen Tilgungsanteil. Zum Vertragsende geben Sie das Auto einfach wieder zurück.',
|
package/tslint.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"match-default-export-name": false,
|
|
14
14
|
"import-name": false,
|
|
15
15
|
"no-boolean-literal-compare": false,
|
|
16
|
-
"max-line-length": [
|
|
16
|
+
"max-line-length": [false],
|
|
17
17
|
"semicolon": [true, "always", "ignore-bound-class-methods"],
|
|
18
18
|
"variable-name": [true, "allow-pascal-case", "allow-leading-underscore", "allow-trailing-underscore"],
|
|
19
19
|
"trailing-comma": [true, {"multiline": "never", "singleline": "never"}],
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"interface-name": [true, "always-prefix"],
|
|
33
33
|
"class-name": true,
|
|
34
34
|
"prefer-function-over-method": false,
|
|
35
|
-
"prefer-switch": [true, {"min-cases": 2}],
|
|
36
35
|
"switch-final-break": true
|
|
37
36
|
},
|
|
38
37
|
"rulesDirectory": []
|