@bytebrand/fe-ui-core 4.8.105 → 4.8.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/package.json.bak +1 -1
- package/source/components/AccordionWidget/AccordionWidget.tsx +6 -5
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +10 -8
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +8 -9
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +14 -14
- package/source/framework/vehiclesProps/decoratedProps.tsx +7 -5
package/package.json
CHANGED
package/package.json.bak
CHANGED
|
@@ -131,17 +131,18 @@ class AccordionWidget extends React.Component<IAccardionSectionProps> {
|
|
|
131
131
|
const { car } = this.props;
|
|
132
132
|
const autoDeId = car.metaData && car.metaData.vehicleId;
|
|
133
133
|
const { consumption } = car;
|
|
134
|
-
// ADV-88:
|
|
135
|
-
//
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
// ADV-88: ANY plug-in hybrid (new or used) gets the long weighted+discharged line and the
|
|
135
|
+
// full-width treatment. Gated on hybridPlugin only, no condition check.
|
|
136
|
+
// ADV-88: "is a hybrid car" is determined by fuel type (hybrid electric + diesel/petrol), not hybridPlugin.
|
|
137
|
+
const isPluginHybrid = consumption.fuel === 'selector_fuel_hybridElectricalDiesel'
|
|
138
|
+
|| consumption.fuel === 'selector_fuel_hybridElectricalPetrol';
|
|
138
139
|
const mainPropertiesList = getOverviewDetails(consumption.fuel);
|
|
139
140
|
const mainProperties = mainPropertiesList.map((prop: string) => {
|
|
140
141
|
const isConsumptionAlternateView = prop.startsWith('consumption') && prop.endsWith('AlternateView');
|
|
141
142
|
return {
|
|
142
143
|
icon: isConsumptionAlternateView ? '' : this.props.decoratedProps[prop].icon,
|
|
143
144
|
description: this.props.decoratedProps[prop].value,
|
|
144
|
-
fullWidth: isConsumptionAlternateView &&
|
|
145
|
+
fullWidth: isConsumptionAlternateView && isPluginHybrid
|
|
145
146
|
};
|
|
146
147
|
});
|
|
147
148
|
return (
|
|
@@ -82,9 +82,11 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
82
82
|
},
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
// ADV-88:
|
|
86
|
-
// render it
|
|
87
|
-
|
|
85
|
+
// ADV-88: ANY plug-in hybrid (new or used) carries the long weighted+discharged consumption/CO2
|
|
86
|
+
// line — render it full-width. Gated on hybridPlugin only, no condition check.
|
|
87
|
+
// ADV-88: "is a hybrid car" is determined by fuel type (hybrid electric + diesel/petrol), not hybridPlugin.
|
|
88
|
+
const isPluginHybrid = consumption.fuel === 'selector_fuel_hybridElectricalDiesel'
|
|
89
|
+
|| consumption.fuel === 'selector_fuel_hybridElectricalPetrol';
|
|
88
90
|
const decoratedProps = getDecoratedProps(dataDecoratedProps, t, language);
|
|
89
91
|
const renderProperty = (renderProperties: any, vehicleComponentName?: any) => {
|
|
90
92
|
const mainPropertiesList = renderProperties(dataDecoratedProps.consumption.fuel, combineRefAlternative)
|
|
@@ -93,14 +95,14 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
93
95
|
.map((prop: string) => {
|
|
94
96
|
const isConsumption = decoratedProps[prop].name === 'consumptionCombined';
|
|
95
97
|
// On non-SRL cards (and for the full-width plug-in line) drop the fuel-pump icon to free up space.
|
|
96
|
-
const hideConsumptionIcon = isConsumption && (vehicleComponentName !== 'search' ||
|
|
98
|
+
const hideConsumptionIcon = isConsumption && (vehicleComponentName !== 'search' || isPluginHybrid);
|
|
97
99
|
return {
|
|
98
100
|
icon: hideConsumptionIcon ? '' : decoratedProps[prop].icon,
|
|
99
101
|
description: decoratedProps[prop].value,
|
|
100
|
-
className: classnames(styles[decoratedProps[prop].name], { [styles.pluginFullWidth]: isConsumption &&
|
|
102
|
+
className: classnames(styles[decoratedProps[prop].name], { [styles.pluginFullWidth]: isConsumption && isPluginHybrid }),
|
|
101
103
|
classNameIcon: (vehicleComponentName === 'search' || 'myVehicles' || 'favorite' || 'recently') && styles.carIconSearch,
|
|
102
104
|
smalltext: isConsumption && (vehicleComponentName !== 'search'),
|
|
103
|
-
hybridPlugin:
|
|
105
|
+
hybridPlugin: isPluginHybrid && isConsumption && vehicleComponentName !== 'search'
|
|
104
106
|
};
|
|
105
107
|
});
|
|
106
108
|
|
|
@@ -115,8 +117,8 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
|
|
|
115
117
|
{ [styles.vehiclePropertiesLanding]: vehicleComponentName === 'landing' },
|
|
116
118
|
{ [styles.vehiclePropertiesMain]: vehicleComponentName === 'main' },
|
|
117
119
|
{ [styles.vehiclePropertiesSearch]: vehicleComponentName === 'search' },
|
|
118
|
-
// ADV-88: mark a
|
|
119
|
-
{ [styles.searchPluginInfo]:
|
|
120
|
+
// ADV-88: mark a plug-in SRL card so its "good price" underline can be dropped on mobile.
|
|
121
|
+
{ [styles.searchPluginInfo]: isPluginHybrid && vehicleComponentName === 'search' },
|
|
120
122
|
{ [styles.vehiclePropertiesFavorite]: vehicleComponentName === 'favorite' },
|
|
121
123
|
{ [styles.vehiclePropertiesMyVehicles]: vehicleComponentName === 'myVehicles' },
|
|
122
124
|
{ [styles.vehiclePropertiesRecently]: vehicleComponentName === 'recently' },
|
|
@@ -152,15 +152,14 @@ const VehicleSmallCard: FunctionComponent<IVehicleSmallCardProps> = (props) => {
|
|
|
152
152
|
// ADV-88: on the narrow landing/main recommendation cards the long plug-in consumption line
|
|
153
153
|
// doesn't fit the slim `info` column — render it as its own full-width row below the price
|
|
154
154
|
// block (under "Zum Angebot") instead, and suppress it inside VehicleInfo to avoid duplication.
|
|
155
|
-
// ADV-88:
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const
|
|
163
|
-
const externalizeConsumption = isNewPlugin
|
|
155
|
+
// ADV-88: ANY plug-in hybrid (new or used) carries the long weighted+discharged consumption/CO2
|
|
156
|
+
// line — externalise it to a full-width row so it doesn't overflow the narrow info column. Gated
|
|
157
|
+
// on hybridPlugin only, no condition check.
|
|
158
|
+
// ADV-88: "is a hybrid car" is determined by fuel type (hybrid electric + diesel/petrol), not hybridPlugin.
|
|
159
|
+
const isPlugin = !!consumption
|
|
160
|
+
&& (consumption.fuel === 'selector_fuel_hybridElectricalDiesel'
|
|
161
|
+
|| consumption.fuel === 'selector_fuel_hybridElectricalPetrol');
|
|
162
|
+
const externalizeConsumption = isPlugin
|
|
164
163
|
&& (vehicleComponentName === 'landing' || vehicleComponentName === 'main'
|
|
165
164
|
|| vehicleComponentName === 'search' || vehicleComponentName === 'comparable'
|
|
166
165
|
|| vehicleComponentName === 'favorite');
|
|
@@ -150,19 +150,19 @@ const getDecoratedLightProps = (
|
|
|
150
150
|
? t('vehicleProps:value.co2Combined', { co2: co2.toLocaleString(language) })
|
|
151
151
|
: t('vehicleProps:value.na');
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
// ADV-88: "is a hybrid car" is now determined by fuel type (hybrid electric + diesel/petrol),
|
|
154
|
+
// not engineData.hybridPlugin.
|
|
155
|
+
const hybridPlugin = car.consumption.fuel === 'selector_fuel_hybridElectricalDiesel'
|
|
156
|
+
|| car.consumption.fuel === 'selector_fuel_hybridElectricalPetrol';
|
|
154
157
|
const wltpWeightedPowerCombined = car.consumption.wltpWeightedPowerCombined;
|
|
155
158
|
const wltpWeightedCombined = car.consumption.wltpWeightedCombined;
|
|
156
159
|
|
|
157
160
|
const wltpWeightedPowerCombinedContent = wltpWeightedPowerCombined ? t('vehicleProps:value.wltpWeightedPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
158
161
|
const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit }) : null;
|
|
159
162
|
|
|
160
|
-
// ADV-88: the
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
const isNewPlugin = condition === 'selector_condition_new';
|
|
164
|
-
if (hybridPlugin && isNewPlugin) {
|
|
165
|
-
// new plug-in hybrids additionally show discharged (entladen, komb) consumption + CO2 class.
|
|
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
|
+
if (hybridPlugin) {
|
|
166
166
|
if (wltpWeightedPowerCombinedContent && wltpWeightedCombinedContent) {
|
|
167
167
|
const dischargedCombined = Number.isFinite(wltpConsumptionCombined) ? wltpConsumptionCombined : 19.9;
|
|
168
168
|
const dischargedClass = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass || 'selector_energyEfficiencyClass_g';
|
|
@@ -306,14 +306,14 @@ const getDecoratedLightProps = (
|
|
|
306
306
|
? t('vehicleProps:value.wltpCo2WtdCombined', { co2: wltpCo2.toLocaleString(language), unit: translatedUnit })
|
|
307
307
|
: null;
|
|
308
308
|
|
|
309
|
-
|
|
309
|
+
// ADV-88: "is a hybrid car" is now determined by fuel type (hybrid electric + diesel/petrol),
|
|
310
|
+
// not engineData.hybridPlugin.
|
|
311
|
+
const hybridPlugin = car.consumption.fuel === 'selector_fuel_hybridElectricalDiesel'
|
|
312
|
+
|| car.consumption.fuel === 'selector_fuel_hybridElectricalPetrol';
|
|
310
313
|
|
|
311
|
-
// ADV-88: the
|
|
312
|
-
//
|
|
313
|
-
|
|
314
|
-
const isNewPlugin = condition === 'selector_condition_new';
|
|
315
|
-
if (hybridPlugin && isNewPlugin) {
|
|
316
|
-
// new plug-in hybrids additionally show discharged (entladen, komb) consumption + CO2 class.
|
|
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
|
+
if (hybridPlugin) {
|
|
317
317
|
if (wltpWeightedPowerCombinedContent && wltpWeightedCombinedContent) {
|
|
318
318
|
const dischargedCombined = Number.isFinite(wltpConsumptionCombined) ? wltpConsumptionCombined : 19.9;
|
|
319
319
|
const dischargedClass = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass || 'selector_energyEfficiencyClass_g';
|
|
@@ -874,12 +874,14 @@ const getDecoratedProps = (
|
|
|
874
874
|
const co2ClassValue = isPropDefined(wltpEnergyEfficiencyClass)
|
|
875
875
|
? t('vehicleProps:value.co2Class', { class: t(`cbd:${wltpEnergyEfficiencyClass}`) })
|
|
876
876
|
: null;
|
|
877
|
-
|
|
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';
|
|
878
881
|
|
|
879
|
-
// ADV-88: new
|
|
880
|
-
// fuel consumption + a discharged CO2 class
|
|
881
|
-
|
|
882
|
-
if (isNewPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
|
|
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) {
|
|
883
885
|
const ADV88_DEFAULT_DISCHARGED_COMBINED = 19.9;
|
|
884
886
|
const ADV88_DEFAULT_DISCHARGED_CO2_CLASS = 'selector_energyEfficiencyClass_g';
|
|
885
887
|
|