@bytebrand/fe-ui-core 4.8.109 → 4.8.111
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/bytebrand-fe-ui-core-4.8.110.tgz +0 -0
- package/media/locales/de/promoSlider.json +0 -1
- package/media/locales/en/promoSlider.json +0 -1
- package/package.json +5 -3
- package/source/components/AccordionWidget/AccordionWidget.styl +1 -13
- package/source/components/AccordionWidget/AccordionWidget.tsx +8 -49
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +2 -2
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.styl +0 -24
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +2 -1
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +11 -23
- package/source/components/VehicleDetailedSidebar/partials/Properties.styl +0 -5
- package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +18 -56
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +6 -2
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +0 -42
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +11 -23
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +5 -60
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +12 -36
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +2 -3
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +7 -18
- package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.styl +1 -4
- package/source/components/VehicleSmallCard/VehicleData/VehicleProperty/VehicleProperty.tsx +2 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -1
- package/source/components/VehicleSmallCard/VehicleSmallCard.styl +2 -67
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +8 -50
- package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +1 -4
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -4
- package/source/components/_common/withStats/withStats.styl +0 -10
- package/source/components/_common/withStats/withStats.tsx +9 -4
- package/source/framework/DataTransformers.ts +0 -2
- package/source/framework/constants/common.ts +4 -8
- package/source/framework/types/types.ts +0 -1
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +18 -109
- package/source/framework/vehiclesProps/decoratedProps.tsx +9 -68
- package/source/framework/vehiclesProps/vehicleDetails.ts +1 -3
- package/source/locales/data.ts +3 -13
- package/.husky/pre-push +0 -4
- package/.storybook/addons.js +0 -4
- package/.storybook/config.js +0 -64
- package/.storybook/postcss.config.js +0 -6
- package/.storybook/preview-head.html +0 -10
- package/.storybook/webpack.config.js +0 -130
- package/__tests__/components/Checkout/OrderOverviewItem/OrderOverviewItem.test.tsx +0 -42
- package/__tests__/components/Checkout/PaymentTypeCard/PaymentTypeCard.test.tsx +0 -50
- package/__tests__/components/Checkout/RadioGroup.test.tsx +0 -95
- package/__tests__/components/Checkout/ServiceCardWrapper.test.tsx +0 -53
- package/__tests__/components/Checkout/Switcher.test.tsx +0 -43
- package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +0 -613
- package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +0 -335
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/AdditionalOrderInfo.test.tsx +0 -127
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCar.test.tsx +0 -58
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusCard.test.tsx +0 -74
- package/__tests__/components/UserDasboardPage/sections/OrderStatusSection/OrderStatusSection.test.tsx +0 -62
- package/__tests__/components/UserDasboardPage/sections/RequestedCarsSection/RequestedCarsSection.test.tsx +0 -117
- package/__tests__/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.test.tsx +0 -58
- package/__tests__/components/VehicleSmallCard/VehicleInfo.test.tsx +0 -88
- package/__tests__/components/VehicleSmallCard/VehicleTitle.test.tsx +0 -91
- package/__tests__/components/_common/Badge/Badge.test.tsx +0 -15
- package/__tests__/components/_common/IconSVG/IconSVG.test.tsx +0 -23
- package/__tests__/components/_common/Image/Image.test.tsx +0 -82
- package/__tests__/components/_common/MaterialAutocomplete/MaterialAutocomplete.test.tsx +0 -49
- package/__tests__/components/_common/MaterialDatePicker/MaterialDatePicker.test.tsx +0 -54
- package/__tests__/components/_common/MaterialField/MaterialField.test.tsx +0 -58
- package/__tests__/components/_common/StarButton/StarButton.test.tsx +0 -46
- package/__tests__/mockedData/financingConfig.js +0 -202
- package/__tests__/mockedData/mockedPendingRequestedCar.js +0 -69
- package/__tests__/utils/CommonUtils/addPrefixToKeys.test.ts +0 -18
- package/__tests__/utils/CommonUtils/arrToObj.test.js +0 -32
- package/__tests__/utils/CommonUtils/checkRangeValuesOnEqual.test.ts +0 -17
- package/__tests__/utils/CommonUtils/fixNumber.test.ts +0 -20
- package/__tests__/utils/CommonUtils/formatMileage.test.ts +0 -8
- package/__tests__/utils/CommonUtils/getChipFilterValue.test.ts +0 -22
- package/__tests__/utils/CommonUtils/getFormattedNumber.test.ts +0 -19
- package/__tests__/utils/CommonUtils/getFormattedPrice.test.ts +0 -19
- package/__tests__/utils/CommonUtils/getGroupValuesForQuery.test.ts +0 -51
- package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +0 -64
- package/__tests__/utils/CommonUtils/getPriceRating.test.ts +0 -26
- package/__tests__/utils/CommonUtils/getPriceRatingConfig.test.ts +0 -33
- package/__tests__/utils/CommonUtils/preloadNearbyImages.test.ts +0 -9
- package/__tests__/utils/CommonUtils/sliceLessThan.test.ts +0 -23
- package/__tests__/utils/CommonUtils/sliceMoreThan.test.ts +0 -23
- package/package.json.bak +0 -118
- package/source/components/AdvantageItem/AdvantageItem.story.js +0 -23
- package/source/components/Alternative/Dealer.story.js +0 -32
- package/source/components/Alternative/Dealer.story.styl +0 -3
- package/source/components/Breadcrumbs/Breadcrumbs.story.js +0 -40
- package/source/components/Breadcrumbs/FirstInfoBlock/FirstInfoBlock.story.js +0 -45
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.js +0 -243
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.story.styl +0 -21
- package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.js +0 -105
- package/source/components/Checkout/RadioCards/RadioGroupCheckout.story.styl +0 -37
- package/source/components/Checkout/Switcher/Switcher.story.js +0 -41
- package/source/components/Checkout/Switcher/Switcher.story.styl +0 -2
- package/source/components/CompactSearchWidget/CompactSearchWidget.story.js +0 -187
- package/source/components/ContactForm/ContactForm.story.js +0 -94
- package/source/components/ContactForm/ContactForm.story.styl +0 -0
- package/source/components/ContactInfo/ContactInfo.story.js +0 -58
- package/source/components/CustomerQuote/CustomerQuote.story.js +0 -41
- package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.js +0 -73
- package/source/components/CustomerQuotesSlider/CustomerQuotesSlider.story.styl +0 -5
- package/source/components/FormattedNumber/FormattedNumber.story.js +0 -114
- package/source/components/InfoBlocks/InfoBlockWrapper.story.js +0 -101
- package/source/components/InfoBlocks/InfoBlockWrapper.story.styl +0 -46
- package/source/components/OfferPanel/AboAccordion/AboFaq/AboFaq.story.js +0 -97
- package/source/components/OfferPanel/OfferPanel.story.js +0 -139
- package/source/components/OfferPanel/RangeGroup/RangeGroup.story.js +0 -35
- package/source/components/OfferPanel/RangeGroup/RangeGroup.story.styl +0 -3
- package/source/components/PriceRating/PriceRating.story.js +0 -39
- package/source/components/PriceRating/PriceRating.story.styl +0 -2
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.js +0 -78
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.story.styl +0 -11
- package/source/components/RateSearchValue/RateSearchValue.story.js +0 -78
- package/source/components/RateSearchValue/RateSearchValue.story.styl +0 -2
- package/source/components/RateSearchWidget/RateSearchWidget.story.js +0 -57
- package/source/components/RateSearchWidget/RateSearchWidget.story.styl +0 -12
- package/source/components/SearchFilters/FiltersFactory.story.js +0 -273
- package/source/components/SearchPage/Filters/MakeModel/MakeModel.story.js +0 -12
- package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.js +0 -834
- package/source/components/SearchWidget/BasicDataWidget/BasicDataWidget.story.styl +0 -40
- package/source/components/SearchWidget/SearchWidget.story.js +0 -191
- package/source/components/SearchWidget/SearchWidget.story.styl +0 -6
- package/source/components/Stepper/Stepper.story.js +0 -119
- package/source/components/Stepper/Stepper.story.styl +0 -41
- package/source/components/Theme.story.js +0 -36
- package/source/components/Theme.story.styl +0 -85
- package/source/components/TickerText/TickerText.story.js +0 -17
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.story.js +0 -95
- package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.story.js +0 -97
- package/source/components/Vehicle/VehicleConsumption/VehicleConsumption.story.js +0 -31
- package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.story.js +0 -247
- package/source/components/VehicleCompared/CompareGeneral/CompareGeneral.story.js +0 -30
- package/source/components/VehicleCompared/ComparePrice/ComparePrice.story.js +0 -18
- package/source/components/VehicleCompared/CompareTitle/CompareTitle.story.js +0 -19
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.story.js +0 -44
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.story.js +0 -120
- package/source/components/VehiclePromoSlider/VehiclePromoInfo/VehiclePromoInfo.story.js +0 -42
- package/source/components/VehiclePromoSlider/VehiclePromoSlide/VehiclePromoSlide.story.js +0 -62
- package/source/components/VehiclePromoSlider/VehiclePromoSlider.story.js +0 -42
- package/source/components/VehicleSmallCard/VehicleSmallCard.story.js +0 -412
- package/source/components/VehicleSmallCard/VehicleSmallCard.story.styl +0 -56
- package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.js +0 -199
- package/source/components/VehicleSmallCardForDealerships/VehicleSmallCardForDealerships.story.styl +0 -40
- package/source/components/_common/Accordion/Accordion.story.js +0 -36
- package/source/components/_common/Badge/Badge.story.js +0 -27
- package/source/components/_common/Badge/Badge.story.styl +0 -5
- package/source/components/_common/Bubble/Bubble.story.js +0 -52
- package/source/components/_common/Button/Button.story.js +0 -52
- package/source/components/_common/Button/Button.story.styl +0 -5
- package/source/components/_common/ButtonOld/Button.story.js +0 -54
- package/source/components/_common/ButtonOld/Button.story.styl +0 -5
- package/source/components/_common/Checkbox/Checkbox.story.js +0 -85
- package/source/components/_common/Checkbox/Checkbox.story.styl +0 -14
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.js +0 -126
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.story.styl +0 -14
- package/source/components/_common/Chip/Chip.story.js +0 -43
- package/source/components/_common/ChipList/ChipList.story.js +0 -36
- package/source/components/_common/DropDown/DropDown.story.js +0 -35
- package/source/components/_common/ExpandablePanel/ExpandablePanel.story.js +0 -41
- package/source/components/_common/Histogram/Histogram.story.js +0 -51
- package/source/components/_common/IconSVG/IconSVG.story.js +0 -21
- package/source/components/_common/IconSVG/IconSVG.story.styl +0 -25
- package/source/components/_common/Image/Image.story.js +0 -142
- package/source/components/_common/Image/Image.story.styl +0 -18
- package/source/components/_common/ImagesSet/ImagesSet.story.js +0 -34
- package/source/components/_common/ImagesSet/ImagesSet.story.styl +0 -4
- package/source/components/_common/Loader/Loader.story.js +0 -21
- package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.story.js +0 -49
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.js +0 -45
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.story.styl +0 -6
- package/source/components/_common/MaterialField/MaterialField.story.js +0 -87
- package/source/components/_common/MaterialField/MaterialField.story.styl +0 -34
- package/source/components/_common/MaterialSelect/MaterialSelect.story.js +0 -52
- package/source/components/_common/MaterialSelect/MaterialSelect.story.styl +0 -6
- package/source/components/_common/MaterialStepButton/MaterialStepButton.story.js +0 -47
- package/source/components/_common/MaterialStepButton/MaterialStepButton.story.styl +0 -6
- package/source/components/_common/MaterialSwitch/MaterialSwitch.story.js +0 -17
- package/source/components/_common/MaterialTooltip/MaterialTooltip.story.js +0 -10
- package/source/components/_common/Modal/Modal.story.js +0 -37
- package/source/components/_common/MuiGroupedSelect/MuiGroupedSelect.story.js +0 -21
- package/source/components/_common/PropertySelector/PSGroup.story.js +0 -93
- package/source/components/_common/PropertySelector/PSGroup.story.styl +0 -25
- package/source/components/_common/PropertySelector/ProperySelector.story.js +0 -83
- package/source/components/_common/Radio/FormRadioGroup.story.js +0 -28
- package/source/components/_common/Radio/FormRadioGroup.story.styl +0 -2
- package/source/components/_common/Radio/Radio.story.js +0 -54
- package/source/components/_common/Radio/RadioGroup.story.js +0 -90
- package/source/components/_common/Radio/RadioGroup.story.styl +0 -39
- package/source/components/_common/Range/Range.story.js +0 -46
- package/source/components/_common/Range/Range.story.styl +0 -5
- package/source/components/_common/SliderArrow/SliderArrow.story.js +0 -18
- package/source/components/_common/Tabs/Tabs.story.js +0 -56
- package/source/components/_common/TimePicker/TimePicker.story.js +0 -37
- package/source/components/_common/Tooltip/Tooltip.story.js +0 -28
- package/source/components/_common/UserMenu/MaterialMenu.story.js +0 -73
- package/source/components/_common/VehicleSlider/VehicleSlider.story.js +0 -99
- package/source/components/_common/VehicleSlider/VehicleSlider.story.styl +0 -0
- package/source/components/_common/withLabel/withLabel.story.js +0 -62
- package/source/components/_common/withPopover/withPopover.story.js +0 -48
- package/source/components/_common/withPopover/withPopover.story.styl +0 -54
- package/source/components/_common/withStats/withStats.story.js +0 -75
|
@@ -34,6 +34,7 @@ export interface IStatsWrapperProps {
|
|
|
34
34
|
imagesCount?: number;
|
|
35
35
|
showNewLabel?: boolean;
|
|
36
36
|
showDownPayment?: boolean;
|
|
37
|
+
disableDownPaymentLocalStorage?: boolean;
|
|
37
38
|
onFavoriteClick?: (event: any) => void;
|
|
38
39
|
getCarImagesData?: (carId: string, force?: boolean, includeAll?: boolean, type?: any, typeAlternative?: string) => Promise<any>;
|
|
39
40
|
[key: string]: any;
|
|
@@ -52,6 +53,7 @@ const withStats = (WrappedComponent: any) => ({
|
|
|
52
53
|
classWrapPrice = '',
|
|
53
54
|
showNewLabel = false,
|
|
54
55
|
showDownPayment = false,
|
|
56
|
+
disableDownPaymentLocalStorage = false,
|
|
55
57
|
statsSize = 'xs',
|
|
56
58
|
price: { historyPriceDifference = 0, historyPriceDifferencePerCent = 0 },
|
|
57
59
|
...props
|
|
@@ -83,7 +85,10 @@ const withStats = (WrappedComponent: any) => ({
|
|
|
83
85
|
setShowByLocalStorage(fin === 0 || lea === 0);
|
|
84
86
|
}, []);
|
|
85
87
|
|
|
86
|
-
const showByBackend =
|
|
88
|
+
const showByBackend = disableDownPaymentLocalStorage
|
|
89
|
+
? !!showDownPayment
|
|
90
|
+
: showDownPayment && (lsFinancingFirst === undefined || lsFinancingFirst === null);
|
|
91
|
+
const effectiveShowByLocalStorage = disableDownPaymentLocalStorage ? false : showByLocalStorage;
|
|
87
92
|
|
|
88
93
|
const onHandleSlideChange = (activeSlide: number) => {
|
|
89
94
|
setActiveSlide(activeSlide);
|
|
@@ -171,13 +176,13 @@ const withStats = (WrappedComponent: any) => ({
|
|
|
171
176
|
|
|
172
177
|
const allFourActive = showNewLabel
|
|
173
178
|
&& !!historyPriceDifference && historyPriceDifference >= MIN_PRICE_DIFFERENCE
|
|
174
|
-
&& (
|
|
179
|
+
&& (effectiveShowByLocalStorage || showByBackend)
|
|
175
180
|
&& !!historyPriceDifferencePerCent && historyPriceDifferencePerCent >= MIN_PERCENT;
|
|
176
181
|
|
|
177
182
|
const activeBadgesCount = [
|
|
178
183
|
showNewLabel,
|
|
179
184
|
!!historyPriceDifference && historyPriceDifference >= MIN_PRICE_DIFFERENCE,
|
|
180
|
-
|
|
185
|
+
effectiveShowByLocalStorage || showByBackend,
|
|
181
186
|
!!historyPriceDifferencePerCent && historyPriceDifferencePerCent >= MIN_PERCENT
|
|
182
187
|
].filter(Boolean).length;
|
|
183
188
|
|
|
@@ -191,7 +196,7 @@ const withStats = (WrappedComponent: any) => ({
|
|
|
191
196
|
{` ${EUR}`}
|
|
192
197
|
</Badge>
|
|
193
198
|
)}
|
|
194
|
-
{(
|
|
199
|
+
{(effectiveShowByLocalStorage || showByBackend) && (
|
|
195
200
|
<Badge type='lightBlue' className={styles.badgeItem}>
|
|
196
201
|
{isWideScreen && activeBadgesCount >= 3 ? downPaymentShortText : downPaymentText}
|
|
197
202
|
</Badge>
|
|
@@ -69,8 +69,6 @@ export const transformDataForDecoratedCar = (car: any) => {
|
|
|
69
69
|
bootCapacity: _get(car, 'sizeVolumeWeight.cargoCapacity', null),
|
|
70
70
|
capacityLoad: _get(car, 'sizeVolumeWeight.completeCapacity', null),
|
|
71
71
|
wltpCo2: _get(car, 'environmentEmissions.wltpCo2', null),
|
|
72
|
-
wltpEnergyEfficiencyClass: _get(car, 'environmentEmissions.wltpEnergyEfficiencyClass', null),
|
|
73
|
-
wltpDischargedEnergyEfficiencyClass: _get(car, 'environmentEmissions.wltpDischargedEnergyEfficiencyClass', null),
|
|
74
72
|
pluginHybrid: _get(car, 'engineData.pluginHybrid', null),
|
|
75
73
|
wltpCombined: _get(car, 'consumption.wltpCombined', null),
|
|
76
74
|
wltpPowerCombined: _get(car, 'consumption.wltpPowerCombined', null),
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
const _isIP = /^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(_rawHost);
|
|
3
|
-
const _imgBase = _isIP ? 'https://images.auto.de' : 'https://images.' + _rawHost;
|
|
1
|
+
export const SITE_DOMAIN: string = 'https://www.auto.de';
|
|
4
2
|
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
export const
|
|
8
|
-
export const PLACEHOLDER_IMAGE_SMALL_URL: string = _imgBase + '/noimage/small';
|
|
9
|
-
export const PLACEHOLDER_IMAGE_LARGE_URL: string = _imgBase + '/noimage/large';
|
|
3
|
+
export const PLACEHOLDER_IMAGE: string = 'https://images.auto.de/noimage/';
|
|
4
|
+
export const PLACEHOLDER_IMAGE_SMALL_URL: string = `https://images.auto.de/noimage/noimage/small`;
|
|
5
|
+
export const PLACEHOLDER_IMAGE_LARGE_URL: string = `https://images.auto.de/noimage/noimage/large`;
|
|
10
6
|
|
|
11
7
|
export const QUOTES_SLIDES_TO_SHOW_DEFAULT = 3;
|
|
12
8
|
|
|
@@ -123,10 +123,7 @@ const getDecoratedLightProps = (
|
|
|
123
123
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
124
124
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
125
125
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
126
|
-
const
|
|
127
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
128
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
129
|
-
: null;
|
|
126
|
+
const consumptionPowerCombined = car.consumption.consumptionCombined;
|
|
130
127
|
|
|
131
128
|
const co2 = car.environmentEmissions.co2;
|
|
132
129
|
|
|
@@ -146,74 +143,41 @@ const getDecoratedLightProps = (
|
|
|
146
143
|
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
147
144
|
: t('vehicleProps:value.na');
|
|
148
145
|
|
|
146
|
+
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
147
|
+
|
|
149
148
|
const co2Value = Number.isFinite(co2)
|
|
150
149
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
151
150
|
: t('vehicleProps:value.na');
|
|
152
151
|
|
|
153
|
-
|
|
154
|
-
// not engineData.hybridPlugin.
|
|
155
|
-
const hybridPlugin = car.consumption.fuel === 'selector_fuel_hybridElectricalDiesel'
|
|
156
|
-
|| car.consumption.fuel === 'selector_fuel_hybridElectricalPetrol';
|
|
152
|
+
const hybridPlugin = car.engineData.hybridPlugin;
|
|
157
153
|
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
158
154
|
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
159
155
|
|
|
160
156
|
const wltpWeightedPowerCombinedContent = wltpWeightedPowerCombined ? t('vehicleProps:value.wltpWeightedPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
161
157
|
const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
162
158
|
|
|
163
|
-
// ADV-88: the weighted+discharged (entladen) consumption treatment is shown for ANY plug-in
|
|
164
|
-
// hybrid (new or used) — gated on hybridPlugin only, no condition check.
|
|
165
159
|
if (hybridPlugin) {
|
|
166
|
-
if (wltpWeightedPowerCombinedContent && wltpWeightedCombinedContent) {
|
|
167
|
-
const dischargedCombined = Number.isFinite(wltpConsumptionCombined) ? wltpConsumptionCombined : 19.9;
|
|
168
|
-
const dischargedClass = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass || 'selector_energyEfficiencyClass_g';
|
|
169
|
-
const weightedCombinedLabeled = t('vehicleProps:value.wltpWeightedCombinedLabel', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
|
|
170
|
-
const dischargedCombinedLabeled = t('vehicleProps:value.wltpDischargedCombinedLabel', { consumption: dischargedCombined.toLocaleString(language), unit: translatedUnit });
|
|
171
|
-
const co2WeightedContent = Number.isFinite(wltpCo2)
|
|
172
|
-
? t('vehicleProps:value.wltpCo2WtdCombinedShort', { co2: wltpCo2.toLocaleString(language) })
|
|
173
|
-
: null;
|
|
174
|
-
const co2ClassWeighted = isPropDefined(wltpEnergyEfficiencyClass)
|
|
175
|
-
? t('vehicleProps:value.co2ClassWeighted', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
176
|
-
: null;
|
|
177
|
-
const co2ClassDischarged = t('vehicleProps:value.co2ClassDischarged', { class: t(`cbd:${dischargedClass}`) });
|
|
178
|
-
return <React.Fragment>
|
|
179
|
-
{`${wltpWeightedPowerCombinedContent} + `}
|
|
180
|
-
{`${weightedCombinedLabeled}, `}
|
|
181
|
-
{`${dischargedCombinedLabeled}`}
|
|
182
|
-
{co2WeightedContent && <>, {co2WeightedContent}</>}
|
|
183
|
-
{co2ClassWeighted && <>, {co2ClassWeighted}</>}
|
|
184
|
-
{<>, {co2ClassDischarged}</>}
|
|
185
|
-
</React.Fragment>
|
|
186
|
-
}
|
|
187
|
-
|
|
188
160
|
if (wltpWeightedPowerCombinedContent && wltpWeightedCombinedContent && wltpCo2PluginValue) {
|
|
189
161
|
return <React.Fragment>
|
|
190
162
|
{`${wltpWeightedPowerCombinedContent}, `}
|
|
191
163
|
{`${wltpWeightedCombinedContent}, `}
|
|
192
164
|
{wltpCo2PluginValue}
|
|
193
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
194
165
|
</React.Fragment>
|
|
195
166
|
}
|
|
196
167
|
|
|
197
|
-
|
|
198
|
-
// power consumption — otherwise we printed "nullkWh/100km" for plug-ins lacking it.
|
|
199
|
-
const realPowerCombined = car.consumption.consumptionPowerCombined;
|
|
200
|
-
const powerCombinedLine = Number.isFinite(realPowerCombined)
|
|
201
|
-
? t('vehicleProps:value.consumptionPowerCombined', { consumption: realPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
202
|
-
: null;
|
|
203
|
-
return Number.isFinite(consumptionCombined) || Number.isFinite(realPowerCombined)
|
|
168
|
+
return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
|
|
204
169
|
? <React.Fragment>
|
|
205
|
-
{
|
|
206
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
170
|
+
{consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionValue} <br /> {co2Value}
|
|
207
171
|
</React.Fragment>
|
|
208
172
|
: t('vehicleProps:value.na');
|
|
209
173
|
|
|
210
174
|
}
|
|
211
175
|
|
|
212
176
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
213
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}
|
|
177
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
214
178
|
}
|
|
215
179
|
|
|
216
|
-
return <>{consumptionValue} <br /> {co2Value}
|
|
180
|
+
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
217
181
|
}
|
|
218
182
|
},
|
|
219
183
|
consumptionPowerCombinedAlternateView: {
|
|
@@ -227,10 +191,6 @@ const getDecoratedLightProps = (
|
|
|
227
191
|
const co2 = car.environmentEmissions.co2;
|
|
228
192
|
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
229
193
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
230
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
231
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
232
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
233
|
-
: null;
|
|
234
194
|
|
|
235
195
|
const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
|
|
236
196
|
? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -249,10 +209,10 @@ const getDecoratedLightProps = (
|
|
|
249
209
|
: t('vehicleProps:value.na');
|
|
250
210
|
|
|
251
211
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
252
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}
|
|
212
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
253
213
|
}
|
|
254
214
|
|
|
255
|
-
return <>{consumptionValue} <br /> {co2Value}
|
|
215
|
+
return <>{consumptionValue} <br /> {co2Value} </>;
|
|
256
216
|
}
|
|
257
217
|
},
|
|
258
218
|
|
|
@@ -273,12 +233,8 @@ const getDecoratedLightProps = (
|
|
|
273
233
|
|
|
274
234
|
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
275
235
|
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
276
|
-
const wltpWeightedPowerCombinedContent =
|
|
277
|
-
|
|
278
|
-
: null;
|
|
279
|
-
const wltpWeightedCombinedContent = Number.isFinite(wltpWeightedCombined)
|
|
280
|
-
? t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit })
|
|
281
|
-
: null;
|
|
236
|
+
const wltpWeightedPowerCombinedContent = t('vehicleProps:value.wltpWeightedPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
237
|
+
const wltpWeightedCombinedContent = t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
|
|
282
238
|
const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
|
|
283
239
|
? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
284
240
|
: null;
|
|
@@ -289,10 +245,6 @@ const getDecoratedLightProps = (
|
|
|
289
245
|
|
|
290
246
|
const co2 = car.environmentEmissions.co2;
|
|
291
247
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
292
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
293
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
294
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
295
|
-
: null;
|
|
296
248
|
|
|
297
249
|
const co2Value = Number.isFinite(co2)
|
|
298
250
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
@@ -306,42 +258,14 @@ const getDecoratedLightProps = (
|
|
|
306
258
|
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language), unit: translatedUnit })
|
|
307
259
|
: null;
|
|
308
260
|
|
|
309
|
-
|
|
310
|
-
// not engineData.hybridPlugin.
|
|
311
|
-
const hybridPlugin = car.consumption.fuel === 'selector_fuel_hybridElectricalDiesel'
|
|
312
|
-
|| car.consumption.fuel === 'selector_fuel_hybridElectricalPetrol';
|
|
261
|
+
const hybridPlugin = car.engineData.hybridPlugin;
|
|
313
262
|
|
|
314
|
-
// ADV-88: the weighted+discharged (entladen) consumption treatment is shown for ANY plug-in
|
|
315
|
-
// hybrid (new or used) — gated on hybridPlugin only, no condition check.
|
|
316
263
|
if (hybridPlugin) {
|
|
317
|
-
if (wltpWeightedPowerCombinedContent && wltpWeightedCombinedContent) {
|
|
318
|
-
const dischargedCombined = Number.isFinite(wltpConsumptionCombined) ? wltpConsumptionCombined : 19.9;
|
|
319
|
-
const dischargedClass = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass || 'selector_energyEfficiencyClass_g';
|
|
320
|
-
const weightedCombinedLabeled = t('vehicleProps:value.wltpWeightedCombinedLabel', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
|
|
321
|
-
const dischargedCombinedLabeled = t('vehicleProps:value.wltpDischargedCombinedLabel', { consumption: dischargedCombined.toLocaleString(language), unit: translatedUnit });
|
|
322
|
-
const co2WeightedContent = Number.isFinite(wltpCo2)
|
|
323
|
-
? t('vehicleProps:value.wltpCo2WtdCombinedShort', { co2: wltpCo2.toLocaleString(language) })
|
|
324
|
-
: null;
|
|
325
|
-
const co2ClassWeighted = isPropDefined(wltpEnergyEfficiencyClass)
|
|
326
|
-
? t('vehicleProps:value.co2ClassWeighted', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
327
|
-
: null;
|
|
328
|
-
const co2ClassDischarged = t('vehicleProps:value.co2ClassDischarged', { class: t(`cbd:${dischargedClass}`) });
|
|
329
|
-
return <React.Fragment>
|
|
330
|
-
{`${wltpWeightedPowerCombinedContent} + `}
|
|
331
|
-
{`${weightedCombinedLabeled}, `}
|
|
332
|
-
{`${dischargedCombinedLabeled}`}
|
|
333
|
-
{co2WeightedContent && <>, {co2WeightedContent}</>}
|
|
334
|
-
{co2ClassWeighted && <>, {co2ClassWeighted}</>}
|
|
335
|
-
{<>, {co2ClassDischarged}</>}
|
|
336
|
-
</React.Fragment>
|
|
337
|
-
}
|
|
338
|
-
|
|
339
264
|
if (wltpWeightedPowerCombinedContent && wltpWeightedCombinedContent && wltpCo2PluginValue) {
|
|
340
265
|
return <React.Fragment>
|
|
341
266
|
{`${wltpWeightedPowerCombinedContent}, `}
|
|
342
267
|
{`${wltpWeightedCombinedContent}, `}
|
|
343
268
|
{wltpCo2PluginValue}
|
|
344
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
345
269
|
</React.Fragment>
|
|
346
270
|
}
|
|
347
271
|
}
|
|
@@ -351,14 +275,12 @@ const getDecoratedLightProps = (
|
|
|
351
275
|
{`${wltpConsumptionPowerCombinedContent}, `}
|
|
352
276
|
{`${wltpWeightedCombinedContent}, `}
|
|
353
277
|
{wltpCo2PluginValue}
|
|
354
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
355
278
|
</React.Fragment>
|
|
356
279
|
}
|
|
357
280
|
|
|
358
281
|
return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
|
|
359
282
|
? <React.Fragment>
|
|
360
283
|
{consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionCombinedContent} <br /> {co2Value}
|
|
361
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
362
284
|
</React.Fragment>
|
|
363
285
|
: t('vehicleProps:value.na');
|
|
364
286
|
}
|
|
@@ -375,10 +297,6 @@ const getDecoratedLightProps = (
|
|
|
375
297
|
const co2 = car.environmentEmissions.co2;
|
|
376
298
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
377
299
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
378
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
379
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
380
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
381
|
-
: null;
|
|
382
300
|
|
|
383
301
|
const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
|
|
384
302
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -396,10 +314,10 @@ const getDecoratedLightProps = (
|
|
|
396
314
|
: null;
|
|
397
315
|
|
|
398
316
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
399
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}
|
|
317
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
400
318
|
}
|
|
401
319
|
|
|
402
|
-
return <>{consumptionValue} <br /> {co2Value}
|
|
320
|
+
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
403
321
|
}
|
|
404
322
|
},
|
|
405
323
|
consumptionGasCombinedAlternateView: {
|
|
@@ -413,10 +331,6 @@ const getDecoratedLightProps = (
|
|
|
413
331
|
const co2 = car.environmentEmissions.co2;
|
|
414
332
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
415
333
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
416
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
417
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
418
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
419
|
-
: null;
|
|
420
334
|
|
|
421
335
|
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
422
336
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -435,10 +349,10 @@ const getDecoratedLightProps = (
|
|
|
435
349
|
: null;
|
|
436
350
|
|
|
437
351
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
438
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}
|
|
352
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
439
353
|
}
|
|
440
354
|
|
|
441
|
-
return <>{consumptionValue} <br /> {co2Value}
|
|
355
|
+
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
442
356
|
}
|
|
443
357
|
},
|
|
444
358
|
consumptionCombinedDealer: {
|
|
@@ -450,7 +364,6 @@ const getDecoratedLightProps = (
|
|
|
450
364
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
451
365
|
|
|
452
366
|
const co2 = car.environmentEmissions.co2;
|
|
453
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
454
367
|
|
|
455
368
|
const consumptionValue = Number.isFinite(consumptionCombined)
|
|
456
369
|
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -460,11 +373,7 @@ const getDecoratedLightProps = (
|
|
|
460
373
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
461
374
|
: t('vehicleProps:value.na');
|
|
462
375
|
|
|
463
|
-
|
|
464
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
465
|
-
: null;
|
|
466
|
-
|
|
467
|
-
return <>{consumptionValue} | {co2Value}{co2ClassValue ? <> | {co2ClassValue}</> : null}</>;
|
|
376
|
+
return <>{consumptionValue} | {co2Value}</>;
|
|
468
377
|
}
|
|
469
378
|
},
|
|
470
379
|
gearbox: {
|
|
@@ -680,7 +680,6 @@ const getDecoratedProps = (
|
|
|
680
680
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
681
681
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
682
682
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
683
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
684
683
|
|
|
685
684
|
const co2 = car.environmentEmissions.co2;
|
|
686
685
|
|
|
@@ -700,15 +699,11 @@ const getDecoratedProps = (
|
|
|
700
699
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
701
700
|
: t('vehicleProps:value.na');
|
|
702
701
|
|
|
703
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
704
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
705
|
-
: null;
|
|
706
|
-
|
|
707
702
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
708
|
-
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}
|
|
703
|
+
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
|
|
709
704
|
}
|
|
710
705
|
|
|
711
|
-
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}
|
|
706
|
+
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
|
|
712
707
|
}
|
|
713
708
|
},
|
|
714
709
|
consumptionPowerCombinedAlternateView: {
|
|
@@ -721,7 +716,6 @@ const getDecoratedProps = (
|
|
|
721
716
|
const co2 = car.environmentEmissions.co2;
|
|
722
717
|
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
723
718
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
724
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
725
719
|
|
|
726
720
|
const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
|
|
727
721
|
? t('vehicleProps:value.consumptionPower', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -739,15 +733,11 @@ const getDecoratedProps = (
|
|
|
739
733
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
740
734
|
: t('vehicleProps:value.na');
|
|
741
735
|
|
|
742
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
743
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
744
|
-
: null;
|
|
745
|
-
|
|
746
736
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
747
|
-
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}
|
|
737
|
+
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
|
|
748
738
|
}
|
|
749
739
|
|
|
750
|
-
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}
|
|
740
|
+
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
|
|
751
741
|
}
|
|
752
742
|
},
|
|
753
743
|
consumptionHydrogenCombinedAlternateView: {
|
|
@@ -760,7 +750,6 @@ const getDecoratedProps = (
|
|
|
760
750
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
761
751
|
const co2 = car.environmentEmissions.co2;
|
|
762
752
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
763
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
764
753
|
|
|
765
754
|
const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
|
|
766
755
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -778,15 +767,11 @@ const getDecoratedProps = (
|
|
|
778
767
|
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
779
768
|
: null;
|
|
780
769
|
|
|
781
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
782
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
783
|
-
: null;
|
|
784
|
-
|
|
785
770
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
786
|
-
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}
|
|
771
|
+
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
|
|
787
772
|
}
|
|
788
773
|
|
|
789
|
-
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}
|
|
774
|
+
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
|
|
790
775
|
}
|
|
791
776
|
},
|
|
792
777
|
consumptionGasCombinedAlternateView: {
|
|
@@ -800,7 +785,6 @@ const getDecoratedProps = (
|
|
|
800
785
|
|
|
801
786
|
const co2 = car.environmentEmissions.co2;
|
|
802
787
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
803
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
804
788
|
|
|
805
789
|
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
806
790
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -818,15 +802,11 @@ const getDecoratedProps = (
|
|
|
818
802
|
? t('vehicleProps:value.wltpCo2Combined', { co2: wltpCo2.toLocaleString(language) })
|
|
819
803
|
: null;
|
|
820
804
|
|
|
821
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
822
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
823
|
-
: null;
|
|
824
|
-
|
|
825
805
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
826
|
-
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}
|
|
806
|
+
return <>{wrapValue(wltpConsumptionValue)}, {wrapValue(wltpCo2Value)}</>;
|
|
827
807
|
}
|
|
828
808
|
|
|
829
|
-
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}
|
|
809
|
+
return <>{wrapValue(consumptionValue)} <br /> {wrapValue(co2Value)}</>;
|
|
830
810
|
}
|
|
831
811
|
},
|
|
832
812
|
|
|
@@ -861,7 +841,6 @@ const getDecoratedProps = (
|
|
|
861
841
|
|
|
862
842
|
const co2 = car.environmentEmissions.co2;
|
|
863
843
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
864
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
865
844
|
const co2Value = Number.isFinite(co2)
|
|
866
845
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
867
846
|
: t('vehicleProps:value.na');
|
|
@@ -871,49 +850,13 @@ const getDecoratedProps = (
|
|
|
871
850
|
const wltpCo2PluginValue = Number.isFinite(wltpCo2)
|
|
872
851
|
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
|
|
873
852
|
: null;
|
|
874
|
-
const
|
|
875
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
876
|
-
: null;
|
|
877
|
-
// ADV-88: "is a hybrid car" is now determined by fuel type (hybrid electric + diesel/petrol),
|
|
878
|
-
// not engineData.hybridPlugin.
|
|
879
|
-
const hybridPlugin = car.consumption.fuel === 'selector_fuel_hybridElectricalDiesel'
|
|
880
|
-
|| car.consumption.fuel === 'selector_fuel_hybridElectricalPetrol';
|
|
881
|
-
|
|
882
|
-
// ADV-88: ANY hybrid car (new or used) shows both weighted (gew., komb) and discharged
|
|
883
|
-
// (entladen, komb) fuel consumption + a discharged CO2 class.
|
|
884
|
-
if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
|
|
885
|
-
const ADV88_DEFAULT_DISCHARGED_COMBINED = 19.9;
|
|
886
|
-
const ADV88_DEFAULT_DISCHARGED_CO2_CLASS = 'selector_energyEfficiencyClass_g';
|
|
887
|
-
|
|
888
|
-
const dischargedCombined = Number.isFinite(wltpCombined) ? wltpCombined : ADV88_DEFAULT_DISCHARGED_COMBINED;
|
|
889
|
-
const dischargedClass = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass || ADV88_DEFAULT_DISCHARGED_CO2_CLASS;
|
|
890
|
-
|
|
891
|
-
const weightedCombinedLabeled = t('vehicleProps:value.wltpWeightedCombinedLabel', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit });
|
|
892
|
-
const dischargedCombinedLabeled = t('vehicleProps:value.wltpDischargedCombinedLabel', { consumption: dischargedCombined.toLocaleString(language), unit: translatedUnit });
|
|
893
|
-
const co2WeightedContent = Number.isFinite(wltpCo2)
|
|
894
|
-
? t('vehicleProps:value.wltpCo2WtdCombinedShort', { co2: wltpCo2.toLocaleString(language) })
|
|
895
|
-
: null;
|
|
896
|
-
const co2ClassWeighted = isPropDefined(wltpEnergyEfficiencyClass)
|
|
897
|
-
? t('vehicleProps:value.co2ClassWeighted', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
898
|
-
: null;
|
|
899
|
-
const co2ClassDischarged = t('vehicleProps:value.co2ClassDischarged', { class: t(`cbd:${dischargedClass}`) });
|
|
900
|
-
|
|
901
|
-
return <React.Fragment>
|
|
902
|
-
{wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{' + '}
|
|
903
|
-
{wrapValue(weightedCombinedLabeled)}{', '}
|
|
904
|
-
{wrapValue(dischargedCombinedLabeled)}
|
|
905
|
-
{co2WeightedContent && <>{', '}{wrapValue(co2WeightedContent)}</>}
|
|
906
|
-
{co2ClassWeighted && <>{', '}{co2ClassWeighted}</>}
|
|
907
|
-
{', '}{co2ClassDischarged}
|
|
908
|
-
</React.Fragment>
|
|
909
|
-
}
|
|
853
|
+
const hybridPlugin = car.engineData.hybridPlugin;
|
|
910
854
|
|
|
911
855
|
if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
|
|
912
856
|
return <React.Fragment>
|
|
913
857
|
{wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{', '}
|
|
914
858
|
{wrapValue(wltpConsumptionWeightedCombinedContent)}{', '}
|
|
915
859
|
{wrapValue(wltpCo2PluginValue)}
|
|
916
|
-
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
917
860
|
</React.Fragment>
|
|
918
861
|
}
|
|
919
862
|
|
|
@@ -921,7 +864,6 @@ const getDecoratedProps = (
|
|
|
921
864
|
return <React.Fragment>
|
|
922
865
|
{wrapValue(wltpConsumptionCombinedContent)}{', '}
|
|
923
866
|
{wrapValue(wltpCo2Value)}
|
|
924
|
-
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
925
867
|
</React.Fragment>
|
|
926
868
|
}
|
|
927
869
|
|
|
@@ -931,7 +873,6 @@ const getDecoratedProps = (
|
|
|
931
873
|
{consumptionPowerCombined && hybridPlugin ? <br /> : ''}
|
|
932
874
|
{wrapValue(consumptionCombinedContent)} <br />
|
|
933
875
|
{wrapValue(co2Value)}
|
|
934
|
-
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
935
876
|
</React.Fragment>
|
|
936
877
|
: t('vehicleProps:value.na');
|
|
937
878
|
}
|
|
@@ -26,11 +26,9 @@ const fuel = ['fuel'];
|
|
|
26
26
|
const otherData = ['powerAlternateView', 'torque', 'acceleration', 'topSpeed', 'transmission', 'driveType'];
|
|
27
27
|
const otherDataLast = ['hsn', 'tsn'];
|
|
28
28
|
const offerAvailability = ['offerAvailability'];
|
|
29
|
-
// ADV-70: the CDP "Überblick" (Overview) no longer shows the availability ("Sofort"/"Now")
|
|
30
|
-
// row — offerAvailability stays available for the SRL/landing cards via getMainPropertiesForSRL.
|
|
31
29
|
const mainPropertiesList = [
|
|
32
30
|
'mileage', 'firstRegistration', 'numberOfPreviousOwners', 'doorsOnly',
|
|
33
|
-
'usageType', 'gearbox', 'power', 'driveType', 'accidentDamaged', 'fuel'
|
|
31
|
+
'usageType', 'gearbox', 'power', 'driveType', 'accidentDamaged', 'fuel', ...offerAvailability
|
|
34
32
|
];
|
|
35
33
|
const comparableList = ['firstRegistration', 'mileage', 'gearbox'];
|
|
36
34
|
const landingList = ['mileage', 'gearbox', 'fuel'];
|
package/source/locales/data.ts
CHANGED
|
@@ -38,8 +38,6 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
38
38
|
promoSlider: {
|
|
39
39
|
consumptionCombined: `${vehicleOption.consumptionCombined}l/100km (komb)*`,
|
|
40
40
|
co2: `${vehicleOption.co2} g CO2/km (komb)*`,
|
|
41
|
-
// wltpEnergyEfficiencyClass arrives as `selector_energyEfficiencyClass_X`; map to the bare letter via cbd dict.
|
|
42
|
-
co2Class: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (komb)`,
|
|
43
41
|
new: 'neu',
|
|
44
42
|
downPayment: '0€ Anzahlung',
|
|
45
43
|
downPaymentShort: '0€ Anz.',
|
|
@@ -50,9 +48,8 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
50
48
|
onRequest: "Auf Anfrage",
|
|
51
49
|
mileage: `${vehicleOption.mileage} km`,
|
|
52
50
|
consumption: `${vehicleOption.consumptionCombined}l/100km`,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
consumptionPowerCombined: vehicleOption.consumptionPowerCombined != null ? `${vehicleOption.consumptionPowerCombined}kWh/100km` : '',
|
|
51
|
+
consumptionPower: `${vehicleOption.consumptionPowerCombined}kWh/100km`,
|
|
52
|
+
consumptionPowerCombined: `${vehicleOption.consumptionPowerCombined}kWh/100km`,
|
|
56
53
|
consumptionGas: `${vehicleOption.consumptionCombined}kg/100km`,
|
|
57
54
|
consumptionCombined: `${vehicleOption.consumptionCombined}l/100km`,
|
|
58
55
|
wltpConsumptionCombined: `${vehicleOption.wltpCombined}l/100km`,
|
|
@@ -62,7 +59,6 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
62
59
|
deliveryPeriodMonths: `${Math.round(monthsTo)} Monat\nab Bestellung`,
|
|
63
60
|
deliveryPeriodDays: `${count} Tag\nab Bestellung`,
|
|
64
61
|
co2Combined: `${vehicleOption.co2}g CO2/km (komb)*`,
|
|
65
|
-
co2Class: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (komb)`,
|
|
66
62
|
co2: `${vehicleOption.co2} g/km `,
|
|
67
63
|
na: 'N/A',
|
|
68
64
|
priceSub: '/mtl.',
|
|
@@ -97,13 +93,7 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
97
93
|
wltpWeightedCombined: `${getFormattedNumber(vehicleOption.wltpWeightedCombined)}l/100km`,
|
|
98
94
|
wltpWeightedPowerCombined: `${getFormattedNumber(vehicleOption.wltpWeightedPowerCombined)}kWh/100km`,
|
|
99
95
|
wltpPowerCombined: `${getFormattedNumber(vehicleOption.wltpPowerCombined)}kWh/100km`,
|
|
100
|
-
wltpCombinedGas: `${getFormattedNumber(vehicleOption.wltpCombined)}kg/100km
|
|
101
|
-
// ADV-88: labelled weighted/discharged consumption + both CO2 classes for new plug-in hybrids.
|
|
102
|
-
wltpWeightedCombinedLabel: `${getFormattedNumber(vehicleOption.wltpWeightedCombined)}l/100km (gew., komb)`,
|
|
103
|
-
wltpDischargedCombinedLabel: `${getFormattedNumber(vehicleOption.wltpCombined != null ? vehicleOption.wltpCombined : 19.9)}l/100km (entladen, komb)`,
|
|
104
|
-
wltpCo2WtdCombinedShort: `${getFormattedNumber(vehicleOption.wltpCo2)}g CO2/km (gew., komb)*`,
|
|
105
|
-
co2ClassWeighted: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (gew., komb)`,
|
|
106
|
-
co2ClassDischarged: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpDischargedEnergyEfficiencyClass || 'selector_energyEfficiencyClass_g'] || ''} (entladen, komb)`
|
|
96
|
+
wltpCombinedGas: `${getFormattedNumber(vehicleOption.wltpCombined)}kg/100km`
|
|
107
97
|
},
|
|
108
98
|
title: {
|
|
109
99
|
'addOfferToMainSlide': 'Zum Schieberegler hinzufügen',
|
package/.husky/pre-push
DELETED
package/.storybook/addons.js
DELETED