@bytebrand/fe-ui-core 4.8.46 → 4.8.48
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.47.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 +0 -1
- package/source/components/AccordionWidget/AccordionWidget.tsx +4 -8
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +11 -23
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +6 -1
- package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +9 -8
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +0 -5
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +1 -3
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +1 -1
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +11 -24
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +2 -3
- 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.tsx +6 -15
- package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +1 -4
- package/source/components/_common/withStats/withStats.styl +21 -0
- package/source/components/_common/withStats/withStats.tsx +21 -4
- package/source/framework/DataTransformers.ts +0 -1
- package/source/framework/constants/common.ts +4 -8
- package/source/framework/types/types.ts +0 -1
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +12 -48
- package/source/framework/vehiclesProps/decoratedProps.tsx +8 -35
- package/source/locales/data.ts +5 -4
- 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/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
|
@@ -124,10 +124,6 @@ const getDecoratedLightProps = (
|
|
|
124
124
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
125
125
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
126
126
|
const consumptionPowerCombined = car.consumption.consumptionCombined;
|
|
127
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
128
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
129
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
130
|
-
: null;
|
|
131
127
|
|
|
132
128
|
const co2 = car.environmentEmissions.co2;
|
|
133
129
|
|
|
@@ -147,9 +143,7 @@ const getDecoratedLightProps = (
|
|
|
147
143
|
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
148
144
|
: t('vehicleProps:value.na');
|
|
149
145
|
|
|
150
|
-
const consumptionPowerCombinedContent =
|
|
151
|
-
? t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
152
|
-
: null;
|
|
146
|
+
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
153
147
|
|
|
154
148
|
const co2Value = Number.isFinite(co2)
|
|
155
149
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
@@ -168,24 +162,22 @@ const getDecoratedLightProps = (
|
|
|
168
162
|
{`${wltpWeightedPowerCombinedContent}, `}
|
|
169
163
|
{`${wltpWeightedCombinedContent}, `}
|
|
170
164
|
{wltpCo2PluginValue}
|
|
171
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
172
165
|
</React.Fragment>
|
|
173
166
|
}
|
|
174
167
|
|
|
175
168
|
return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
|
|
176
169
|
? <React.Fragment>
|
|
177
170
|
{consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionValue} <br /> {co2Value}
|
|
178
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
179
171
|
</React.Fragment>
|
|
180
172
|
: t('vehicleProps:value.na');
|
|
181
173
|
|
|
182
174
|
}
|
|
183
175
|
|
|
184
176
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
185
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}
|
|
177
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
186
178
|
}
|
|
187
179
|
|
|
188
|
-
return <>{consumptionValue} <br /> {co2Value}
|
|
180
|
+
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
189
181
|
}
|
|
190
182
|
},
|
|
191
183
|
consumptionPowerCombinedAlternateView: {
|
|
@@ -199,10 +191,6 @@ const getDecoratedLightProps = (
|
|
|
199
191
|
const co2 = car.environmentEmissions.co2;
|
|
200
192
|
const wltpConsumptionPowerCombined = car.consumption.wltpPowerCombined;
|
|
201
193
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
202
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
203
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
204
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
205
|
-
: null;
|
|
206
194
|
|
|
207
195
|
const wltpConsumptionValue = Number.isFinite(wltpConsumptionPowerCombined)
|
|
208
196
|
? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -221,10 +209,10 @@ const getDecoratedLightProps = (
|
|
|
221
209
|
: t('vehicleProps:value.na');
|
|
222
210
|
|
|
223
211
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
224
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}
|
|
212
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
225
213
|
}
|
|
226
214
|
|
|
227
|
-
return <>{consumptionValue} <br /> {co2Value}
|
|
215
|
+
return <>{consumptionValue} <br /> {co2Value} </>;
|
|
228
216
|
}
|
|
229
217
|
},
|
|
230
218
|
|
|
@@ -245,12 +233,8 @@ const getDecoratedLightProps = (
|
|
|
245
233
|
|
|
246
234
|
const consumptionPowerCombinedContent = t('vehicleProps:value.consumptionPowerCombined', { consumption: consumptionPowerCombined.toLocaleString(language), unit: translatedUnit });
|
|
247
235
|
const consumptionCombinedContent = t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit });
|
|
248
|
-
const wltpWeightedPowerCombinedContent =
|
|
249
|
-
|
|
250
|
-
: null;
|
|
251
|
-
const wltpWeightedCombinedContent = Number.isFinite(wltpWeightedCombined)
|
|
252
|
-
? t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit })
|
|
253
|
-
: 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 });
|
|
254
238
|
const wltpConsumptionPowerCombinedContent = wltpConsumptionPowerCombined
|
|
255
239
|
? t('vehicleProps:value.wltpPowerCombined', { consumption: wltpConsumptionPowerCombined.toLocaleString(language), unit: translatedUnit })
|
|
256
240
|
: null;
|
|
@@ -261,10 +245,6 @@ const getDecoratedLightProps = (
|
|
|
261
245
|
|
|
262
246
|
const co2 = car.environmentEmissions.co2;
|
|
263
247
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
264
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
265
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
266
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
267
|
-
: null;
|
|
268
248
|
|
|
269
249
|
const co2Value = Number.isFinite(co2)
|
|
270
250
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
@@ -286,7 +266,6 @@ const getDecoratedLightProps = (
|
|
|
286
266
|
{`${wltpWeightedPowerCombinedContent}, `}
|
|
287
267
|
{`${wltpWeightedCombinedContent}, `}
|
|
288
268
|
{wltpCo2PluginValue}
|
|
289
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
290
269
|
</React.Fragment>
|
|
291
270
|
}
|
|
292
271
|
}
|
|
@@ -296,14 +275,12 @@ const getDecoratedLightProps = (
|
|
|
296
275
|
{`${wltpConsumptionPowerCombinedContent}, `}
|
|
297
276
|
{`${wltpWeightedCombinedContent}, `}
|
|
298
277
|
{wltpCo2PluginValue}
|
|
299
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
300
278
|
</React.Fragment>
|
|
301
279
|
}
|
|
302
280
|
|
|
303
281
|
return Number.isFinite(consumptionCombined) || Number.isFinite(consumptionPowerCombined)
|
|
304
282
|
? <React.Fragment>
|
|
305
283
|
{consumptionPowerCombined ? consumptionPowerCombinedContent : t('vehicleProps:value.na')} <br />{consumptionCombinedContent} <br /> {co2Value}
|
|
306
|
-
{co2ClassValue && <>, {co2ClassValue}</>}
|
|
307
284
|
</React.Fragment>
|
|
308
285
|
: t('vehicleProps:value.na');
|
|
309
286
|
}
|
|
@@ -320,10 +297,6 @@ const getDecoratedLightProps = (
|
|
|
320
297
|
const co2 = car.environmentEmissions.co2;
|
|
321
298
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
322
299
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
323
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
324
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
325
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
326
|
-
: null;
|
|
327
300
|
|
|
328
301
|
const consumptionValue = Number.isFinite(consumptionHydrogenCombined)
|
|
329
302
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionHydrogenCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -341,10 +314,10 @@ const getDecoratedLightProps = (
|
|
|
341
314
|
: null;
|
|
342
315
|
|
|
343
316
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
344
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}
|
|
317
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
345
318
|
}
|
|
346
319
|
|
|
347
|
-
return <>{consumptionValue} <br /> {co2Value}
|
|
320
|
+
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
348
321
|
}
|
|
349
322
|
},
|
|
350
323
|
consumptionGasCombinedAlternateView: {
|
|
@@ -358,10 +331,6 @@ const getDecoratedLightProps = (
|
|
|
358
331
|
const co2 = car.environmentEmissions.co2;
|
|
359
332
|
const wltpConsumptionCombined = car.consumption.wltpCombined;
|
|
360
333
|
const wltpCo2 = car.environmentEmissions.wltpCo2;
|
|
361
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
362
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
363
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
364
|
-
: null;
|
|
365
334
|
|
|
366
335
|
const consumptionValue = Number.isFinite(consumptionGasCombined)
|
|
367
336
|
? t('vehicleProps:value.consumptionGas', { consumption: consumptionGasCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -380,10 +349,10 @@ const getDecoratedLightProps = (
|
|
|
380
349
|
: null;
|
|
381
350
|
|
|
382
351
|
if (wltpConsumptionValue && wltpCo2Value) {
|
|
383
|
-
return <>{wltpConsumptionValue}, {wltpCo2Value}
|
|
352
|
+
return <>{wltpConsumptionValue}, {wltpCo2Value}</>;
|
|
384
353
|
}
|
|
385
354
|
|
|
386
|
-
return <>{consumptionValue} <br /> {co2Value}
|
|
355
|
+
return <>{consumptionValue} <br /> {co2Value}</>;
|
|
387
356
|
}
|
|
388
357
|
},
|
|
389
358
|
consumptionCombinedDealer: {
|
|
@@ -395,7 +364,6 @@ const getDecoratedLightProps = (
|
|
|
395
364
|
const translatedUnit = t(`cbd:${consumptionUnit}`);
|
|
396
365
|
|
|
397
366
|
const co2 = car.environmentEmissions.co2;
|
|
398
|
-
const wltpEnergyEfficiencyClass = car.environmentEmissions.wltpEnergyEfficiencyClass;
|
|
399
367
|
|
|
400
368
|
const consumptionValue = Number.isFinite(consumptionCombined)
|
|
401
369
|
? t('vehicleProps:value.consumptionCombined', { consumption: consumptionCombined.toLocaleString(language), unit: translatedUnit })
|
|
@@ -405,11 +373,7 @@ const getDecoratedLightProps = (
|
|
|
405
373
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
406
374
|
: t('vehicleProps:value.na');
|
|
407
375
|
|
|
408
|
-
|
|
409
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
410
|
-
: null;
|
|
411
|
-
|
|
412
|
-
return <>{consumptionValue} | {co2Value}{co2ClassValue ? <> | {co2ClassValue}</> : null}</>;
|
|
376
|
+
return <>{consumptionValue} | {co2Value}</>;
|
|
413
377
|
}
|
|
414
378
|
},
|
|
415
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,9 +850,6 @@ const getDecoratedProps = (
|
|
|
871
850
|
const wltpCo2PluginValue = Number.isFinite(wltpCo2)
|
|
872
851
|
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language) })
|
|
873
852
|
: null;
|
|
874
|
-
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
875
|
-
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
876
|
-
: null;
|
|
877
853
|
const hybridPlugin = car.engineData.hybridPlugin;
|
|
878
854
|
|
|
879
855
|
if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
|
|
@@ -881,7 +857,6 @@ const getDecoratedProps = (
|
|
|
881
857
|
{wrapValue(wltpConsumptionWeightedPowerCombinedContent)}{', '}
|
|
882
858
|
{wrapValue(wltpConsumptionWeightedCombinedContent)}{', '}
|
|
883
859
|
{wrapValue(wltpCo2PluginValue)}
|
|
884
|
-
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
885
860
|
</React.Fragment>
|
|
886
861
|
}
|
|
887
862
|
|
|
@@ -889,7 +864,6 @@ const getDecoratedProps = (
|
|
|
889
864
|
return <React.Fragment>
|
|
890
865
|
{wrapValue(wltpConsumptionCombinedContent)}{', '}
|
|
891
866
|
{wrapValue(wltpCo2Value)}
|
|
892
|
-
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
893
867
|
</React.Fragment>
|
|
894
868
|
}
|
|
895
869
|
|
|
@@ -899,7 +873,6 @@ const getDecoratedProps = (
|
|
|
899
873
|
{consumptionPowerCombined && hybridPlugin ? <br /> : ''}
|
|
900
874
|
{wrapValue(consumptionCombinedContent)} <br />
|
|
901
875
|
{wrapValue(co2Value)}
|
|
902
|
-
{co2ClassValue && <><br />{co2ClassValue}</>}
|
|
903
876
|
</React.Fragment>
|
|
904
877
|
: t('vehicleProps:value.na');
|
|
905
878
|
}
|
package/source/locales/data.ts
CHANGED
|
@@ -38,9 +38,9 @@ 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',
|
|
42
|
+
downPayment: '0€ Anzahlung',
|
|
43
|
+
downPaymentShort: '0€ Anz.',
|
|
44
44
|
wltpCo2: `${vehicleOption.wltpCo2}g CO2/km (WLTP, komb.)*`,
|
|
45
45
|
wltpConsumptionCombined: `${vehicleOption.consumptionCombined}l/100km`
|
|
46
46
|
},
|
|
@@ -59,7 +59,6 @@ export const vehicleProps = (car?: any, isOfferAvailable: boolean = true) => {
|
|
|
59
59
|
deliveryPeriodMonths: `${Math.round(monthsTo)} Monat\nab Bestellung`,
|
|
60
60
|
deliveryPeriodDays: `${count} Tag\nab Bestellung`,
|
|
61
61
|
co2Combined: `${vehicleOption.co2}g CO2/km (komb)*`,
|
|
62
|
-
co2Class: `CO2-Klasse ${(cbd.cbd as any)[vehicleOption.wltpEnergyEfficiencyClass] || vehicleOption.wltpEnergyEfficiencyClass || ''} (komb)`,
|
|
63
62
|
co2: `${vehicleOption.co2} g/km `,
|
|
64
63
|
na: 'N/A',
|
|
65
64
|
priceSub: '/mtl.',
|
|
@@ -747,7 +746,9 @@ export const SearchPage = (chip?: any) => {
|
|
|
747
746
|
'error': 'Das Angebot konnte nicht zum Hauptschieberegler hinzugefügt werden. Versuchen Sie es später noch einmal.'
|
|
748
747
|
},
|
|
749
748
|
'promoSlider': {
|
|
750
|
-
'new': 'neu'
|
|
749
|
+
'new': 'neu',
|
|
750
|
+
'downPayment': '0€ Anzahlung',
|
|
751
|
+
'downPaymentShort': '0€ Anz.'
|
|
751
752
|
},
|
|
752
753
|
'rateSearchWidget': {
|
|
753
754
|
'changeRateLink': 'ändern',
|
package/.husky/pre-push
DELETED
package/.storybook/addons.js
DELETED
package/.storybook/config.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { configure, addDecorator, addParameters } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import i18n from 'i18next';
|
|
4
|
-
import centered from '@storybook/addon-centered/react';
|
|
5
|
-
|
|
6
|
-
import { reactI18nextModule } from 'react-i18next';
|
|
7
|
-
import { withI18next } from 'storybook-addon-i18next';
|
|
8
|
-
import { en, de } from '@bytebrand/i18n-dictionaries';
|
|
9
|
-
|
|
10
|
-
import '!style-loader!css-loader!stylus-loader!../source/theme/colors.styl';
|
|
11
|
-
|
|
12
|
-
i18n
|
|
13
|
-
.use(reactI18nextModule)
|
|
14
|
-
.init({
|
|
15
|
-
whitelist: ['en', 'de'],
|
|
16
|
-
lng: 'de',
|
|
17
|
-
fallbackLng: 'de',
|
|
18
|
-
interpolation: {
|
|
19
|
-
escapeValue: false,
|
|
20
|
-
},
|
|
21
|
-
debug: process.env.NODE_ENV === 'development',
|
|
22
|
-
react: {
|
|
23
|
-
wait: true
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
(err, t) => {
|
|
27
|
-
if (err) {
|
|
28
|
-
return console.error('Something went wrong loading', err);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
i18n.addResourceBundle('en', 'cbd', en, true, true);
|
|
32
|
-
i18n.addResourceBundle('de', 'cbd', de, true, true);
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
addDecorator(withI18next({
|
|
37
|
-
i18n,
|
|
38
|
-
languages: {
|
|
39
|
-
en: 'English',
|
|
40
|
-
de: 'Deutsch',
|
|
41
|
-
}
|
|
42
|
-
}));
|
|
43
|
-
|
|
44
|
-
addParameters({
|
|
45
|
-
options: {
|
|
46
|
-
sortStoriesByKind: true
|
|
47
|
-
},
|
|
48
|
-
backgrounds: [
|
|
49
|
-
{ name: 'white', value: '#fff' },
|
|
50
|
-
{ name: 'grey', value: '#808080', default: true },
|
|
51
|
-
{ name: 'black', value: '#000' }
|
|
52
|
-
]
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
addDecorator(centered);
|
|
56
|
-
|
|
57
|
-
// automatically import all files ending in *.stories.js
|
|
58
|
-
const req = require.context('../source/components', true, /.story.js$/);
|
|
59
|
-
|
|
60
|
-
function loadStories() {
|
|
61
|
-
req.keys().forEach(filename => req(filename));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
configure(loadStories, module);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<link rel="stylesheet" type="text/css" charset="UTF-8"
|
|
2
|
-
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" />
|
|
3
|
-
<link rel="stylesheet" type="text/css"
|
|
4
|
-
href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css" />
|
|
5
|
-
|
|
6
|
-
<link rel="stylesheet" type="text/css"
|
|
7
|
-
href="https://cdn.jsdelivr.net/npm/react-checkbox-tree@1.5.1/lib/react-checkbox-tree.css" />
|
|
8
|
-
|
|
9
|
-
<link rel="stylesheet" type="text/css"
|
|
10
|
-
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" />
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const autoprefixer = require('autoprefixer');
|
|
3
|
-
|
|
4
|
-
const babelPlugins = [
|
|
5
|
-
[require('@babel/plugin-proposal-decorators').default , { legacy: true }],
|
|
6
|
-
require('@babel/plugin-transform-react-constant-elements').default,
|
|
7
|
-
require('@babel/plugin-proposal-class-properties').default,
|
|
8
|
-
require('babel-plugin-minify-dead-code-elimination'),
|
|
9
|
-
require('babel-plugin-transform-imports')
|
|
10
|
-
];
|
|
11
|
-
|
|
12
|
-
const presetOptions = {
|
|
13
|
-
useBuiltIns: 'usage',
|
|
14
|
-
corejs: '2'
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const babelPresets = [
|
|
18
|
-
[require('@babel/preset-env').default, presetOptions],
|
|
19
|
-
require('@babel/preset-react').default,
|
|
20
|
-
require('@babel/preset-typescript').default
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
const BABEL_LOADER = {
|
|
24
|
-
loader: require.resolve('babel-loader'),
|
|
25
|
-
options: {
|
|
26
|
-
babelrc: false,
|
|
27
|
-
cacheDirectory: true,
|
|
28
|
-
presets: babelPresets,
|
|
29
|
-
plugins: babelPlugins
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const TSLINT_LOADER = {
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const CSS_LOADER = ({ modules }) => ({
|
|
38
|
-
loader: require.resolve('css-loader'),
|
|
39
|
-
options: {
|
|
40
|
-
modules,
|
|
41
|
-
sourceMap: true,
|
|
42
|
-
importLoaders: 1,
|
|
43
|
-
localsConvention: 'camelCase'
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
const STYLUS_LOADER = {
|
|
48
|
-
loader: require.resolve('stylus-loader'),
|
|
49
|
-
options: {
|
|
50
|
-
sourceMap: 'inline'
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const POST_CSS_LOADER = {
|
|
55
|
-
loader: require.resolve('postcss-loader'),
|
|
56
|
-
options: {
|
|
57
|
-
sourceMap: 'inline',
|
|
58
|
-
ident: 'postcss',
|
|
59
|
-
config: {
|
|
60
|
-
path: path.join(__dirname, './postcss.config.js')
|
|
61
|
-
},
|
|
62
|
-
plugins: () => [
|
|
63
|
-
autoprefixer({
|
|
64
|
-
grid: false
|
|
65
|
-
})
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const STYLE_LOADER = {
|
|
71
|
-
loader: require.resolve('style-loader'),
|
|
72
|
-
options: {
|
|
73
|
-
injectType: 'singletonStyleTag'
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
const buildConfig = async ({ config, mode }) => {
|
|
78
|
-
config.module.rules.push({
|
|
79
|
-
enforce: 'pre',
|
|
80
|
-
test: /\.tsx?$/,
|
|
81
|
-
loader: require.resolve('tslint-loader'),
|
|
82
|
-
exclude: '/node_modules/',
|
|
83
|
-
options: {
|
|
84
|
-
emitErrors: true
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
config.module.rules.push({
|
|
89
|
-
test: /\.tsx?$/,
|
|
90
|
-
exclude: /(node_modules|public)\/(?!@bytebrand).*/,
|
|
91
|
-
use: [BABEL_LOADER]
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
config.module.rules.push({
|
|
95
|
-
test: /\.css$/,
|
|
96
|
-
use: [
|
|
97
|
-
STYLE_LOADER,
|
|
98
|
-
CSS_LOADER({ modules: true }),
|
|
99
|
-
POST_CSS_LOADER
|
|
100
|
-
]
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
config.module.rules.push({
|
|
104
|
-
test: /\.styl$/,
|
|
105
|
-
exclude: /\.global.styl$/,
|
|
106
|
-
use: [
|
|
107
|
-
STYLE_LOADER,
|
|
108
|
-
CSS_LOADER({ modules: true }),
|
|
109
|
-
POST_CSS_LOADER,
|
|
110
|
-
STYLUS_LOADER
|
|
111
|
-
]
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// prepend .global to *.stylus file to import it globally
|
|
115
|
-
config.module.rules.push({
|
|
116
|
-
test: /\.global.styl$/,
|
|
117
|
-
use: [
|
|
118
|
-
STYLE_LOADER,
|
|
119
|
-
CSS_LOADER({ modules: false }),
|
|
120
|
-
POST_CSS_LOADER,
|
|
121
|
-
STYLUS_LOADER
|
|
122
|
-
]
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
config.resolve.extensions.push('.ts', '.tsx', '.styl');
|
|
126
|
-
|
|
127
|
-
return config;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
module.exports = buildConfig;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import OrderOverviewItem from '../../../../source/components/Checkout/OrderOverviewItem/OrderOverviewItem';
|
|
4
|
-
|
|
5
|
-
describe('OrderOverviewItem', () => {
|
|
6
|
-
it('renders the component with the correct data', () => {
|
|
7
|
-
const fields = {
|
|
8
|
-
title: 'Test Title',
|
|
9
|
-
oneLineRate: '10',
|
|
10
|
-
additionalTitle: 'Additional Title',
|
|
11
|
-
content: [
|
|
12
|
-
{
|
|
13
|
-
rate: '5',
|
|
14
|
-
fieldName: 'Field Name'
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
rate: '15'
|
|
18
|
-
};
|
|
19
|
-
const activeStep = 1;
|
|
20
|
-
const handleClick = jest.fn();
|
|
21
|
-
render(
|
|
22
|
-
<OrderOverviewItem
|
|
23
|
-
fields={fields}
|
|
24
|
-
activeStep={activeStep}
|
|
25
|
-
handleStep={handleClick}
|
|
26
|
-
titleClassName="test-title-class"
|
|
27
|
-
fieldClassName="test-field-class"
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
// Test that the correct elements are rendered with the correct values
|
|
31
|
-
expect(screen.getByText(fields.title)).toBeInTheDocument();
|
|
32
|
-
expect(screen.getByText(fields.oneLineRate)).toBeInTheDocument();
|
|
33
|
-
expect(screen.getByText(fields.additionalTitle)).toBeInTheDocument();
|
|
34
|
-
expect(screen.getByText(fields.content[0].rate)).toBeInTheDocument();
|
|
35
|
-
// Test that the correct classes are applied
|
|
36
|
-
expect(screen.getByText(fields.title)).toHaveClass('test-title-class');
|
|
37
|
-
expect(screen.getByText(fields.oneLineRate)).toHaveClass('test-field-class');
|
|
38
|
-
// Test that the edit icon is clickable and calls the handleStep function
|
|
39
|
-
expect(screen.getByTestId('editIcon')).toBeInTheDocument();
|
|
40
|
-
|
|
41
|
-
});
|
|
42
|
-
});
|