@bytebrand/fe-ui-core 4.8.105 → 4.8.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.8.105",
3
+ "version": "4.8.106",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
package/package.json.bak CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.8.105",
3
+ "version": "4.8.106",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -131,17 +131,16 @@ 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: only NEW plug-in hybrids get the long weighted+discharged line only those
135
- // need the full-width treatment. Other cars keep their consumption inside the grid cell.
136
- const isNewPlugin = !!_get(car, 'engineData.hybridPlugin', false)
137
- && (_get(car, 'mainData.condition', '') as unknown as string) === 'selector_condition_new';
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
+ const isPluginHybrid = !!_get(car, 'engineData.hybridPlugin', false);
138
137
  const mainPropertiesList = getOverviewDetails(consumption.fuel);
139
138
  const mainProperties = mainPropertiesList.map((prop: string) => {
140
139
  const isConsumptionAlternateView = prop.startsWith('consumption') && prop.endsWith('AlternateView');
141
140
  return {
142
141
  icon: isConsumptionAlternateView ? '' : this.props.decoratedProps[prop].icon,
143
142
  description: this.props.decoratedProps[prop].value,
144
- fullWidth: isConsumptionAlternateView && isNewPlugin
143
+ fullWidth: isConsumptionAlternateView && isPluginHybrid
145
144
  };
146
145
  });
147
146
  return (
@@ -82,9 +82,9 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
82
82
  },
83
83
  };
84
84
 
85
- // ADV-88: new plug-in hybrids carry the long weighted+discharged consumption/CO2 line —
86
- // render it on its own full-width row at the bottom of the card (all breakpoints).
87
- const isNewPlugin = !!(engineData && engineData.hybridPlugin) && condition === 'selector_condition_new';
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
+ const isPluginHybrid = !!(engineData && engineData.hybridPlugin);
88
88
  const decoratedProps = getDecoratedProps(dataDecoratedProps, t, language);
89
89
  const renderProperty = (renderProperties: any, vehicleComponentName?: any) => {
90
90
  const mainPropertiesList = renderProperties(dataDecoratedProps.consumption.fuel, combineRefAlternative)
@@ -93,11 +93,11 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
93
93
  .map((prop: string) => {
94
94
  const isConsumption = decoratedProps[prop].name === 'consumptionCombined';
95
95
  // 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' || isNewPlugin);
96
+ const hideConsumptionIcon = isConsumption && (vehicleComponentName !== 'search' || isPluginHybrid);
97
97
  return {
98
98
  icon: hideConsumptionIcon ? '' : decoratedProps[prop].icon,
99
99
  description: decoratedProps[prop].value,
100
- className: classnames(styles[decoratedProps[prop].name], { [styles.pluginFullWidth]: isConsumption && isNewPlugin }),
100
+ className: classnames(styles[decoratedProps[prop].name], { [styles.pluginFullWidth]: isConsumption && isPluginHybrid }),
101
101
  classNameIcon: (vehicleComponentName === 'search' || 'myVehicles' || 'favorite' || 'recently') && styles.carIconSearch,
102
102
  smalltext: isConsumption && (vehicleComponentName !== 'search'),
103
103
  hybridPlugin: engineData.hybridPlugin && isConsumption && vehicleComponentName !== 'search'
@@ -115,8 +115,8 @@ const VehicleInfo: React.FC<IVehicleInfoProps> = (props) => {
115
115
  { [styles.vehiclePropertiesLanding]: vehicleComponentName === 'landing' },
116
116
  { [styles.vehiclePropertiesMain]: vehicleComponentName === 'main' },
117
117
  { [styles.vehiclePropertiesSearch]: vehicleComponentName === 'search' },
118
- // ADV-88: mark a new plug-in SRL card so its "good price" underline can be dropped on mobile.
119
- { [styles.searchPluginInfo]: isNewPlugin && vehicleComponentName === 'search' },
118
+ // ADV-88: mark a plug-in SRL card so its "good price" underline can be dropped on mobile.
119
+ { [styles.searchPluginInfo]: isPluginHybrid && vehicleComponentName === 'search' },
120
120
  { [styles.vehiclePropertiesFavorite]: vehicleComponentName === 'favorite' },
121
121
  { [styles.vehiclePropertiesMyVehicles]: vehicleComponentName === 'myVehicles' },
122
122
  { [styles.vehiclePropertiesRecently]: vehicleComponentName === 'recently' },
@@ -152,15 +152,11 @@ 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: the weighted+discharged consumption/CO2 line is ONLY for NEW plug-in hybrids — only
156
- // those get the full-width externalised row. Used plug-ins (and non-plug-ins) keep the normal
157
- // consumption inside the info column like any other car.
158
- // NOTE: requires `condition` in the card data on every surface (SRL/landing/home/comparable/
159
- // favourites). If a projection omits it, the new-plug-in row won't externalise there — keep
160
- // mainData.condition in those projections.
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.
161
158
  const isPlugin = !!(engineData && (engineData as any).hybridPlugin);
162
- const isNewPlugin = isPlugin && (_get(info, 'condition') as any) === 'selector_condition_new';
163
- const externalizeConsumption = isNewPlugin
159
+ const externalizeConsumption = isPlugin
164
160
  && (vehicleComponentName === 'landing' || vehicleComponentName === 'main'
165
161
  || vehicleComponentName === 'search' || vehicleComponentName === 'comparable'
166
162
  || vehicleComponentName === 'favorite');
@@ -157,12 +157,9 @@ const getDecoratedLightProps = (
157
157
  const wltpWeightedPowerCombinedContent = wltpWeightedPowerCombined ? t('vehicleProps:value.wltpWeightedPowerCombined', { consumption: wltpWeightedPowerCombined.toLocaleString(language), unit: translatedUnit }) : null;
158
158
  const wltpWeightedCombinedContent = wltpWeightedCombined ? t('vehicleProps:value.wltpWeightedCombined', { consumption: wltpWeightedCombined.toLocaleString(language), unit: translatedUnit }) : null;
159
159
 
160
- // ADV-88: the whole plug-in consumption treatment (electric kWh + weighted/discharged) is
161
- // ONLY for NEW plug-in hybrids. Used plug-ins fall through to the regular consumption line
162
- // below, exactly like a non-plug-in car.
163
- const isNewPlugin = condition === 'selector_condition_new';
164
- if (hybridPlugin && isNewPlugin) {
165
- // new plug-in hybrids additionally show discharged (entladen, komb) consumption + CO2 class.
160
+ // ADV-88: the weighted+discharged (entladen) consumption treatment is shown for ANY plug-in
161
+ // hybrid (new or used) gated on hybridPlugin only, no condition check.
162
+ if (hybridPlugin) {
166
163
  if (wltpWeightedPowerCombinedContent && wltpWeightedCombinedContent) {
167
164
  const dischargedCombined = Number.isFinite(wltpConsumptionCombined) ? wltpConsumptionCombined : 19.9;
168
165
  const dischargedClass = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass || 'selector_energyEfficiencyClass_g';
@@ -308,12 +305,9 @@ const getDecoratedLightProps = (
308
305
 
309
306
  const hybridPlugin = car.engineData.hybridPlugin;
310
307
 
311
- // ADV-88: the whole plug-in consumption treatment (electric kWh + weighted/discharged) is
312
- // ONLY for NEW plug-in hybrids. Used plug-ins fall through to the regular consumption line
313
- // below, exactly like a non-plug-in car.
314
- const isNewPlugin = condition === 'selector_condition_new';
315
- if (hybridPlugin && isNewPlugin) {
316
- // new plug-in hybrids additionally show discharged (entladen, komb) consumption + CO2 class.
308
+ // ADV-88: the weighted+discharged (entladen) consumption treatment is shown for ANY plug-in
309
+ // hybrid (new or used) gated on hybridPlugin only, no condition check.
310
+ if (hybridPlugin) {
317
311
  if (wltpWeightedPowerCombinedContent && wltpWeightedCombinedContent) {
318
312
  const dischargedCombined = Number.isFinite(wltpConsumptionCombined) ? wltpConsumptionCombined : 19.9;
319
313
  const dischargedClass = car.environmentEmissions.wltpDischargedEnergyEfficiencyClass || 'selector_energyEfficiencyClass_g';
@@ -876,10 +876,9 @@ const getDecoratedProps = (
876
876
  : null;
877
877
  const hybridPlugin = car.engineData.hybridPlugin;
878
878
 
879
- // ADV-88: new plug-in hybrids show both weighted (gew., komb) and discharged (entladen, komb)
880
- // fuel consumption + a discharged CO2 class, in addition to the weighted values.
881
- const isNewPlugin = hybridPlugin && condition === 'selector_condition_new';
882
- if (isNewPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
879
+ // ADV-88: ANY plug-in hybrid (new or used) shows both weighted (gew., komb) and discharged
880
+ // (entladen, komb) fuel consumption + a discharged CO2 class gated on hybridPlugin only.
881
+ if (hybridPlugin && wltpConsumptionWeightedPowerCombinedContent && wltpConsumptionWeightedCombinedContent) {
883
882
  const ADV88_DEFAULT_DISCHARGED_COMBINED = 19.9;
884
883
  const ADV88_DEFAULT_DISCHARGED_CO2_CLASS = 'selector_energyEfficiencyClass_g';
885
884