@bytebrand/fe-ui-core 4.2.251 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__tests__/utils/CommonUtils/getOfferSliders.test.ts +2 -4
- package/common.ts +2 -6
- package/package.json +2 -3
- package/source/components/AccordionWidget/AccordionWidget.tsx +3 -1
- package/source/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/source/components/Checkout/CheckoutStepper/CheckoutStepper.styl +190 -2
- package/source/components/Checkout/CheckoutStepper/CheckoutStepper.tsx +16 -15
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.styl +2 -2
- package/source/components/Checkout/OrderOverviewItem/OrderOverviewItem.tsx +3 -3
- package/source/components/FormattedNumber/FormattedNumber.tsx +3 -2
- package/source/components/InfoBlocks/FirstInfoBlock/FirstInfoBlockItem/FirstInfoBlockItem.styl +6 -4
- package/source/components/OfferDetailedSection/partials/PanelConfig.tsx +3 -0
- package/source/components/OfferPanel/MuiOfferPeriod/{MuiOfferPeriod.theme.tsx → MuiOfferPeriod.theme.js} +13 -8
- package/source/components/OfferPanel/MuiOfferPeriod/MuiOfferPeriod.tsx +4 -28
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +12 -6
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +1 -1
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/OfferPanel/OfferPeriod/OfferPeriod.tsx +4 -0
- package/source/components/OfferPanel/RangeGroup/RangeGroup.tsx +4 -6
- package/source/components/PriceRatingDetailed/PriceRatingDetailed.tsx +2 -6
- package/source/components/SearchFilters/filters/AlternativeID.tsx +53 -42
- package/source/components/SearchFilters/filters/DriveType.tsx +1 -1
- package/source/components/SearchFilters/filters/EmissionSticker.tsx +1 -1
- package/source/components/SearchFilters/filters/FirstRegistration.tsx +1 -0
- package/source/components/SearchFilters/filters/InteriorColor.tsx +1 -1
- package/source/components/SearchFilters/filters/InteriorMaterial.tsx +1 -2
- package/source/components/SearchFilters/filters/Mileage.tsx +1 -1
- package/source/components/SearchFilters/filters/Power.tsx +17 -36
- package/source/components/SearchFilters/filters/StateOptions.tsx +1 -0
- package/source/components/SearchFilters/filters/Transmission.tsx +1 -1
- package/source/components/SearchPage/SearchChips/SearchChips.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/BodyType.tsx +3 -3
- package/source/components/SearchPageMobile/FiltersDetailed/Consumption.tsx +2 -2
- package/source/components/SearchPageMobile/FiltersDetailed/Doors.tsx +1 -1
- package/source/components/SearchPageMobile/FiltersDetailed/MakeModel.tsx +1 -1
- package/source/components/SearchWidget/ColorWidget/BodyColorWidget.tsx +3 -3
- package/source/components/SearchWidget/EnvironmentWidget/EnvironmentWidget.tsx +3 -3
- package/source/components/SearchWidget/HighlightsWidget/HighlightsWidget.tsx +2 -2
- package/source/components/SearchWidget/StateWidget/StateWidget.tsx +2 -1
- package/source/components/SearchWidgetsMobile/BasicDataWidgetMobile/BasicDataWidgetMobile.tsx +4 -4
- package/source/components/SearchWidgetsMobile/EquipmentsWidget/EquipmentsWidget.tsx +16 -16
- package/source/components/SearchWidgetsMobile/HighlightsWidgetMobile/HighlightsWidgetMobile.tsx +1 -1
- package/source/components/SearchWidgetsMobile/InteriorWidget/InteriorWidget.tsx +1 -1
- package/source/components/SearchWidgetsMobile/SafetyWidget/SafetyWidget.tsx +6 -6
- package/source/components/Stepper/Stepper.tsx +3 -4
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.styl +2 -11
- package/source/components/UserDashboardPage/sections/OrderStatusSection/AdditionalOrderInfo.tsx +5 -5
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCar.tsx +38 -57
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusCard.tsx +2 -2
- package/source/components/UserDashboardPage/sections/OrderStatusSection/OrderStatusSection.tsx +101 -183
- package/source/components/UserDashboardPage/sections/RequestedCarsSection/RequestedCarsSection.tsx +7 -5
- package/source/components/Vehicle/VehicleFormattedPrice/VehicleFormattedPrice.tsx +7 -33
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.styl +2 -10
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +14 -54
- package/source/components/VehicleDetailedSidebar/partials/Price.styl +1 -5
- package/source/components/VehicleDetailedSidebar/partials/Price.tsx +1 -2
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.styl +5 -16
- package/source/components/VehicleDetailedSidebar/partials/PriceContent.tsx +4 -9
- package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +1 -1
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.styl +0 -45
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +42 -121
- package/source/components/VehicleDetailedSlider/partials/PriceData.styl +1 -4
- package/source/components/VehicleDetailedSlider/partials/PriceData.tsx +1 -8
- package/source/components/VehicleDetailedSlider/partials/Stats.tsx +2 -2
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +7 -9
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +1 -35
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +3 -9
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.styl +2 -11
- package/source/components/VehicleSmallCard/VehicleData/VehicleTitle/VehicleTitle.tsx +1 -2
- package/source/components/VehicleSmallCard/VehicleSmallCard.styl +1 -3
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +7 -3
- package/source/components/_common/Badge/Badge.styl +0 -3
- package/source/components/_common/Badge/Badge.tsx +1 -1
- package/source/components/_common/Button/Button.tsx +4 -5
- package/source/components/_common/Checkbox/FormCheckbox.tsx +4 -4
- package/source/components/_common/CheckboxMaterial/CheckboxMaterial.tsx +1 -1
- package/source/components/_common/Chip/Chip.tsx +3 -1
- package/source/components/_common/ExpansionPanel/ExpansionPanel.tsx +3 -3
- package/source/components/_common/IconSVG/IconSVGConfig.tsx +0 -2
- package/source/components/_common/IconSVG/SVG/flags/SK.tsx +1 -0
- package/source/components/_common/IconSVG/SVG/slider/360New.tsx +1 -1
- package/source/components/_common/MaterialAccordion/MaterialAccordion.tsx +30 -22
- package/source/components/_common/MaterialAutocomplete/MaterialAutocomplete.styled.tsx +8 -8
- package/source/components/_common/MaterialDatePicker/MaterialDatePicker.styled.tsx +1 -0
- package/source/components/_common/MaterialSelect/MaterialSelect.styled.tsx +15 -12
- package/source/components/_common/MaterialSelect/MaterialSelect.tsx +3 -3
- package/source/components/_common/MaterialSwitch/MaterialSwitch.tsx +1 -3
- package/source/components/_common/MaterialTooltip/MaterialTooltip.styled.tsx +1 -1
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -3
- package/source/components/_common/Modal/CookieModal.tsx +3 -1
- package/source/components/_common/Modal/Modal.styled.tsx +1 -2
- package/source/components/_common/Modal/Modal.tsx +5 -1
- package/source/components/_common/Modal/ModalsConfig.tsx +1 -5
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.styl +7 -23
- package/source/components/_common/Modal/modals/ManageCookieModal/ManageCookieModal.tsx +36 -84
- package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.styl +14 -29
- package/source/components/_common/Modal/modals/PreviewCookieModal/PreviewCookieModal.tsx +10 -17
- package/source/components/_common/OfferRequestButtonWrapper/OfferRequestButtonWrapper.tsx +4 -12
- package/source/components/_common/Range/Range.tsx +16 -26
- package/source/components/_common/UserMenu/MaterialMenu.styled.tsx +1 -0
- package/source/components/_common/UserMenu/MaterialMenu.tsx +3 -3
- package/source/components/_common/UserMenu/MaterialMenuItem.tsx +20 -42
- package/source/components/_common/UserMenu/NestedMenu.tsx +1 -1
- package/source/components/_common/withStats/withStats.styl +0 -3
- package/source/components/_common/withStats/withStats.tsx +16 -19
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.styl +1 -14
- package/source/components/containers/SearchPage/FiltersContainer/FiltersContainer.tsx +42 -78
- package/source/framework/constants/common.ts +60 -89
- package/source/framework/constants/highlights.ts +1 -1
- package/source/framework/constants.ts +1 -1
- package/source/framework/types/types.ts +4 -9
- package/source/framework/utils/CommonUtils.ts +62 -73
- package/source/framework/utils/DateUtils.ts +2 -10
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +2 -1
- package/source/framework/vehiclesProps/decoratedProps.tsx +2 -1
- package/source/locales/data.ts +2 -2
- package/tslint.json +2 -1
- package/utils.ts +0 -2
- package/__tests__/components/UserDasboardPage/sections/CheckoutSection/CheckoutSection.test.tsx +0 -613
- package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx +0 -335
- package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.styl +0 -38
- package/source/components/UserDashboardPage/sections/CheckoutSection/CheckoutSection.tsx +0 -120
- package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.styl +0 -22
- package/source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection.tsx +0 -84
- package/source/components/_common/IconSVG/SVG/slider/YoutubeButton.tsx +0 -26
package/__tests__/components/UserDasboardPage/sections/FavoriteSection/FavoriteSection.test.tsx
DELETED
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
|
-
import FavoriteSection from '../../../../../source/components/UserDashboardPage/sections/FavoriteSection/FavoriteSection';
|
|
4
|
-
import { observable } from 'mobx';
|
|
5
|
-
import qs from 'qs';
|
|
6
|
-
|
|
7
|
-
const t = (phrase: string | string[], options: object) => {
|
|
8
|
-
if (options) {
|
|
9
|
-
const value = Object.values(options).map((option) => option);
|
|
10
|
-
return `${phrase} ${value}`;
|
|
11
|
-
}
|
|
12
|
-
return phrase;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
interface IWithRouter {
|
|
16
|
-
children?: JSX.Element;
|
|
17
|
-
link?: string;
|
|
18
|
-
}
|
|
19
|
-
const LinkRouter = ({ children, link }: IWithRouter) => {
|
|
20
|
-
return (
|
|
21
|
-
<a href={link} >
|
|
22
|
-
{children}
|
|
23
|
-
</a>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
const favoriteCars = [
|
|
27
|
-
{
|
|
28
|
-
parkedFor: 'N/A',
|
|
29
|
-
id: 'c4c9141a-5e4c-4d75-9d0f-c2f1b8f31241',
|
|
30
|
-
mainImageId: ' ',
|
|
31
|
-
imagesCount: ' ',
|
|
32
|
-
hasInteriorExteriorPhoto: ' ',
|
|
33
|
-
title: {
|
|
34
|
-
make: 'Volkswagen',
|
|
35
|
-
model: 'Polo',
|
|
36
|
-
subModel: '1.0 TSI Style',
|
|
37
|
-
option: '',
|
|
38
|
-
to: ''
|
|
39
|
-
},
|
|
40
|
-
showNewLabel: false,
|
|
41
|
-
info: {
|
|
42
|
-
regDate: ' ',
|
|
43
|
-
mileage: 0,
|
|
44
|
-
gearbox: 'selector_gearbox_manualShift',
|
|
45
|
-
numberOfPreviousOwners: 0,
|
|
46
|
-
usageType: 'selector_unknown',
|
|
47
|
-
condition: 'selector_condition_new',
|
|
48
|
-
damaged: false,
|
|
49
|
-
driveType: 'selector_driveType_frontWheelDrive'
|
|
50
|
-
},
|
|
51
|
-
location: {
|
|
52
|
-
city: 't',
|
|
53
|
-
street: 't',
|
|
54
|
-
zipCode: 12345
|
|
55
|
-
},
|
|
56
|
-
consumption: {
|
|
57
|
-
fuel: 'selector_fuel_petrol',
|
|
58
|
-
consumptionCombined: 5.2,
|
|
59
|
-
consumptionPowerCombined: ' '
|
|
60
|
-
},
|
|
61
|
-
engineData: {
|
|
62
|
-
powerKW: 70,
|
|
63
|
-
powerPS: 70
|
|
64
|
-
},
|
|
65
|
-
environmentEmissions: {
|
|
66
|
-
co2: 118
|
|
67
|
-
},
|
|
68
|
-
offer: {
|
|
69
|
-
offerId: ' ',
|
|
70
|
-
autoDeOfferId: ' ',
|
|
71
|
-
offerFrom: 'selector_unknown',
|
|
72
|
-
offerSource: ' ',
|
|
73
|
-
offerAvailability: 'selector_unknown',
|
|
74
|
-
offerDescription: '',
|
|
75
|
-
deliveryDate: 1698969600,
|
|
76
|
-
deliveryPeriod: 'selector_deliveryPeriod_days270',
|
|
77
|
-
dealerHomepage: ' ',
|
|
78
|
-
closedDomain: ' ',
|
|
79
|
-
export: ' ',
|
|
80
|
-
commercial: ' ',
|
|
81
|
-
warranty: false,
|
|
82
|
-
rentingPossible: ' ',
|
|
83
|
-
newHuAu: true,
|
|
84
|
-
internalNumber: '118_92436S/3243',
|
|
85
|
-
availabilityMode: 'selector_availabilityMode_fromDate',
|
|
86
|
-
mobileDeOfferId: ' ',
|
|
87
|
-
as24DeOfferId: ' ',
|
|
88
|
-
elnOfferId: 'bd11b00a8d643e16b69c308360e5236b'
|
|
89
|
-
},
|
|
90
|
-
price: {
|
|
91
|
-
offerIndex: 0,
|
|
92
|
-
isStrike: false,
|
|
93
|
-
comparable: {
|
|
94
|
-
annualMileage: 10000,
|
|
95
|
-
firstInstallment: ' ',
|
|
96
|
-
paybackPeriod: 48,
|
|
97
|
-
withAddServices: ' ',
|
|
98
|
-
withTransportation: ' '
|
|
99
|
-
},
|
|
100
|
-
checkout: {
|
|
101
|
-
warrantyRates: [
|
|
102
|
-
0,
|
|
103
|
-
0,
|
|
104
|
-
0
|
|
105
|
-
],
|
|
106
|
-
warrantyPackage: 0,
|
|
107
|
-
warrantyPeriod: 1,
|
|
108
|
-
admissionService: 0,
|
|
109
|
-
licensePlateFee: 0
|
|
110
|
-
},
|
|
111
|
-
common: {
|
|
112
|
-
firstRegistration: ' ',
|
|
113
|
-
mileage: 0,
|
|
114
|
-
currentSalesPrice: 30666,
|
|
115
|
-
highestPrice: 34232,
|
|
116
|
-
isStrikeShown: true,
|
|
117
|
-
isHybridOrElectric: false
|
|
118
|
-
},
|
|
119
|
-
financing: {
|
|
120
|
-
grossLoanAmountWithoutFinalInstallment: 0,
|
|
121
|
-
purchasePrice: 0,
|
|
122
|
-
hasPaymentProtection: false,
|
|
123
|
-
paymentProtectionInsurance: 0,
|
|
124
|
-
monthlyInstallment: 142,
|
|
125
|
-
oldMonthlyInstallment: 180,
|
|
126
|
-
annualMileage: 25000,
|
|
127
|
-
firstInstallment: 11900,
|
|
128
|
-
withTransportation: false,
|
|
129
|
-
withAddServices: true,
|
|
130
|
-
addServicesCostRaw: 799,
|
|
131
|
-
addServicesCost: 799,
|
|
132
|
-
transportationCostRaw: 499,
|
|
133
|
-
transportationCost: 499,
|
|
134
|
-
withFinalInstallment: true,
|
|
135
|
-
paybackPeriod: 72,
|
|
136
|
-
rawPaybackPeriod: 72,
|
|
137
|
-
nominalInterestRate: 3.92,
|
|
138
|
-
annualPercentageRate: 6.99,
|
|
139
|
-
financialInstitution: 'Santander Consumer Bank AG, Santander-Platz 1, 41061 Mönchengladbach',
|
|
140
|
-
periodInterestRate: [
|
|
141
|
-
{
|
|
142
|
-
duration: 12,
|
|
143
|
-
recommended: 70,
|
|
144
|
-
current: 88,
|
|
145
|
-
inEUR: ' ',
|
|
146
|
-
value: 18766,
|
|
147
|
-
highestValue: 30124.16
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
duration: 24,
|
|
151
|
-
recommended: 66,
|
|
152
|
-
current: 77,
|
|
153
|
-
inEUR: ' ',
|
|
154
|
-
value: 18766,
|
|
155
|
-
highestValue: 26358.64
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
duration: 36,
|
|
159
|
-
recommended: 60,
|
|
160
|
-
current: 66,
|
|
161
|
-
inEUR: ' ',
|
|
162
|
-
value: 18766,
|
|
163
|
-
highestValue: 22593.12
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
duration: 48,
|
|
167
|
-
recommended: 50,
|
|
168
|
-
current: 60,
|
|
169
|
-
inEUR: ' ',
|
|
170
|
-
value: 17920.2,
|
|
171
|
-
highestValue: 20539.2
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
duration: 60,
|
|
175
|
-
recommended: 40,
|
|
176
|
-
current: 50,
|
|
177
|
-
inEUR: ' ',
|
|
178
|
-
value: 14933.5,
|
|
179
|
-
highestValue: 17116
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
duration: 72,
|
|
183
|
-
recommended: 30,
|
|
184
|
-
current: 40,
|
|
185
|
-
inEUR: ' ',
|
|
186
|
-
value: 11946.8,
|
|
187
|
-
highestValue: 13692.8
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
duration: 84,
|
|
191
|
-
recommended: 20,
|
|
192
|
-
current: 30,
|
|
193
|
-
inEUR: ' ',
|
|
194
|
-
value: 8960.1,
|
|
195
|
-
highestValue: 10269.6
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
duration: 96,
|
|
199
|
-
recommended: 10,
|
|
200
|
-
current: 20,
|
|
201
|
-
inEUR: ' ',
|
|
202
|
-
value: 5973.4,
|
|
203
|
-
highestValue: 6846.4
|
|
204
|
-
}
|
|
205
|
-
],
|
|
206
|
-
closingCosts: 0,
|
|
207
|
-
offersFinancing: true,
|
|
208
|
-
rateMode: 'dealer'
|
|
209
|
-
},
|
|
210
|
-
buy: {
|
|
211
|
-
withTransportation: false,
|
|
212
|
-
withAddServices: true,
|
|
213
|
-
withoutAddServices: true,
|
|
214
|
-
transportationCost: 499,
|
|
215
|
-
addServicesCost: 799,
|
|
216
|
-
currentSalesPriceExtra: 30666,
|
|
217
|
-
highestPriceExtra: 34232,
|
|
218
|
-
extraCost: 0
|
|
219
|
-
},
|
|
220
|
-
leasing: {
|
|
221
|
-
RWG: 7,
|
|
222
|
-
maxAge: 24,
|
|
223
|
-
maxMileage: 1000000,
|
|
224
|
-
isActive: true,
|
|
225
|
-
withTransportation: false,
|
|
226
|
-
withAddServices: false,
|
|
227
|
-
addServicesCostRaw: 799,
|
|
228
|
-
transportationCostRaw: 499,
|
|
229
|
-
addServicesCost: 799,
|
|
230
|
-
transportationCost: 499,
|
|
231
|
-
monthlyAddServices: 0,
|
|
232
|
-
monthlyTransportation: 0,
|
|
233
|
-
monthlyInstallment: 441,
|
|
234
|
-
oldMonthlyInstallment: 526,
|
|
235
|
-
firstInstallment: 20,
|
|
236
|
-
firstInstallmentMax: 2000,
|
|
237
|
-
annualMileage: 10000,
|
|
238
|
-
paybackPeriodRange: [
|
|
239
|
-
30,
|
|
240
|
-
36,
|
|
241
|
-
42,
|
|
242
|
-
48,
|
|
243
|
-
54,
|
|
244
|
-
60
|
|
245
|
-
],
|
|
246
|
-
paybackPeriod: 48,
|
|
247
|
-
santanderPayBackMin: 250,
|
|
248
|
-
nominalInterestRate: 6.78,
|
|
249
|
-
financialInstitution: 'Santander Consumer Bank AG, Santander-Platz 1, 41061 Mönchengladbach',
|
|
250
|
-
grossLoanAmountWithoutFinalInstallment: 0,
|
|
251
|
-
hasPaymentProtection: false,
|
|
252
|
-
paymentProtectionInsurance: 1100,
|
|
253
|
-
leasingMode: 'default',
|
|
254
|
-
currentSalesPrice: 30666
|
|
255
|
-
},
|
|
256
|
-
abo: {
|
|
257
|
-
paybackPeriod: 6,
|
|
258
|
-
annualMileage: 10000
|
|
259
|
-
},
|
|
260
|
-
firstRegistration: ' ',
|
|
261
|
-
mileage: 0,
|
|
262
|
-
currentSalesPrice: 30666,
|
|
263
|
-
highestPrice: 34232,
|
|
264
|
-
isStrikeShown: true,
|
|
265
|
-
carId: 'c4c9141a-5e4c-4d75-9d0f-c2f1b8f31241',
|
|
266
|
-
offerName: 'financing',
|
|
267
|
-
vehicleId: 'c4c9141a-5e4c-4d75-9d0f-c2f1b8f31241',
|
|
268
|
-
vatRate: 19,
|
|
269
|
-
mlCurrentSalesPricePredicted: ' ',
|
|
270
|
-
historyPriceDifference: 3566,
|
|
271
|
-
historyPriceDifferencePerCent: 10,
|
|
272
|
-
margin: 30666,
|
|
273
|
-
toRound: false
|
|
274
|
-
},
|
|
275
|
-
internalNumber: '118_92436S/3243',
|
|
276
|
-
vin: '',
|
|
277
|
-
isOnline: true,
|
|
278
|
-
firstIsOnline: 1675668230,
|
|
279
|
-
url: '/search/vehicle/c4c9141a-5e4c-4d75-9d0f-c2f1b8f31241',
|
|
280
|
-
relativeScore: 0,
|
|
281
|
-
baseUrl: '',
|
|
282
|
-
offerSource: '',
|
|
283
|
-
crawledAt: '',
|
|
284
|
-
ownerName: 'Guardian of Auto.de',
|
|
285
|
-
modificationDate: '18.05.2023',
|
|
286
|
-
seoText: ''
|
|
287
|
-
}
|
|
288
|
-
];
|
|
289
|
-
const favoritesIDs = [
|
|
290
|
-
'b359d74f-bb96-4fca-9539-579792fe7c36'
|
|
291
|
-
];
|
|
292
|
-
const getFavoriteCarsMock = jest.fn();
|
|
293
|
-
|
|
294
|
-
const aggStatsData = observable({
|
|
295
|
-
'b359d74f-bb96-4fca-9539-579792fe7c36': {
|
|
296
|
-
carId: 'b359d74f-bb96-4fca-9539-579792fe7c36',
|
|
297
|
-
totalFavCount: 3,
|
|
298
|
-
totalCarImpCount: 7399,
|
|
299
|
-
slidingCarImpCount: 10
|
|
300
|
-
},
|
|
301
|
-
get() {
|
|
302
|
-
return {
|
|
303
|
-
'b359d74f-bb96-4fca-9539-579792fe7c36': {
|
|
304
|
-
carId: 'b359d74f-bb96-4fca-9539-579792fe7c36',
|
|
305
|
-
totalFavCount: 3,
|
|
306
|
-
totalCarImpCount: 7399,
|
|
307
|
-
slidingCarImpCount: 10
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
const mockProps = {
|
|
313
|
-
t,
|
|
314
|
-
LinkRouter,
|
|
315
|
-
favoriteCars,
|
|
316
|
-
PLACEHOLDER_IMAGE_SMALL_URL: 'PLACEHOLDER_IMAGE_SMALL_URL',
|
|
317
|
-
favoriteStore: { favoriteCars, favoritesIDs, showList: true, getFavouriteCars: getFavoriteCarsMock, getFavoritesIDs: jest.fn() },
|
|
318
|
-
appStore: {},
|
|
319
|
-
carsStore: { aggStatsData, getAggStatsData: jest.fn() },
|
|
320
|
-
imagesStore: { getSupportedImageFormat: jest.fn() }
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
describe('FavoriteSection', () => {
|
|
324
|
-
test('calls getFavouriteCars when component is mounted', () => {
|
|
325
|
-
const { container } = render(<FavoriteSection {...mockProps as any} />);
|
|
326
|
-
expect(container).toBeInTheDocument();
|
|
327
|
-
// expect(mockProps.favoriteStore.getFavouriteCars).toHaveBeenCalledTimes(1);
|
|
328
|
-
});
|
|
329
|
-
test('should display correct car data', () => {
|
|
330
|
-
const { container } = render(<FavoriteSection {...mockProps as any} />);
|
|
331
|
-
mockProps.favoriteCars.forEach((element:any) => {
|
|
332
|
-
expect(container).toHaveTextContent(element.title.make);
|
|
333
|
-
});
|
|
334
|
-
});
|
|
335
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@import '../../../../theme/mixins.styl'
|
|
2
|
-
|
|
3
|
-
.checkoutSection
|
|
4
|
-
padding: 0;
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
max-width: calc(100vw - 32px);
|
|
7
|
-
// padding: 16px 16px 16px 22px;
|
|
8
|
-
|
|
9
|
-
+media-tablet-landscape-up()
|
|
10
|
-
max-width: 1100px;
|
|
11
|
-
padding: 0;
|
|
12
|
-
|
|
13
|
-
[class*='RecentlySection__wrapVehicleSmallCard']
|
|
14
|
-
max-width: calc(100vw - 32px);
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
|
|
17
|
-
+media-tablet-up()
|
|
18
|
-
max-width: calc(50vw - 64px);
|
|
19
|
-
|
|
20
|
-
+media-tablet-landscape-up()
|
|
21
|
-
max-width: 346px;
|
|
22
|
-
|
|
23
|
-
.checkoutWrapItem
|
|
24
|
-
& + &
|
|
25
|
-
border-top: 1px solid rgba(76,78,100,0.12);
|
|
26
|
-
|
|
27
|
-
.wrapFavorites
|
|
28
|
-
border: none !important;
|
|
29
|
-
|
|
30
|
-
.favoriteBtn
|
|
31
|
-
height: 30px;
|
|
32
|
-
font-size: 13px;
|
|
33
|
-
text-transform: none !important
|
|
34
|
-
font-weight: 400 !important;
|
|
35
|
-
|
|
36
|
-
+media-tablet-landscape-up()
|
|
37
|
-
height: 38px;
|
|
38
|
-
font-size: 14px;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import _get from 'lodash/get';
|
|
3
|
-
import DashboardSection from '../../../containers/DasboardSection/DashboardSection';
|
|
4
|
-
import styles from './CheckoutSection.styl';
|
|
5
|
-
import { isMobileOnly } from 'react-device-detect';
|
|
6
|
-
import Slider from 'react-slick';
|
|
7
|
-
import { VehicleSmallCard } from '../../../../../common';
|
|
8
|
-
import { toJS } from 'mobx';
|
|
9
|
-
// import { toJS } from 'mobx';
|
|
10
|
-
|
|
11
|
-
interface ITFunction {
|
|
12
|
-
<T = string>(key: string, options?: object): T;
|
|
13
|
-
<T = string>(keys: string[], options?: object): T;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface ICheckoutSectionProps {
|
|
17
|
-
carsStore: any;
|
|
18
|
-
appStore: any;
|
|
19
|
-
imagesStore: any;
|
|
20
|
-
t?: ITFunction;
|
|
21
|
-
LinkRouter: any;
|
|
22
|
-
PLACEHOLDER_IMAGE_SMALL_URL:string;
|
|
23
|
-
checkoutCars?:any;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
class CheckoutSection extends React.Component<ICheckoutSectionProps, {}> {
|
|
27
|
-
onCarSelectCheckout = (carId?: string) => {
|
|
28
|
-
const checkoutCars = this.props.checkoutCars;
|
|
29
|
-
const car = checkoutCars.find((item: any) => item.id === carId);
|
|
30
|
-
const { mainImageId, title: { model, subModel, make } } = car;
|
|
31
|
-
window.open(`/checkout/contact-information?carId=${carId}&isSavedCheckout=true&mainImageId=${mainImageId}&model=${model}&subModel=${subModel}&make=${make}`, '_blank');
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
renderCheckouts = () => {
|
|
35
|
-
const { t, appStore: { language }, carsStore, imagesStore , PLACEHOLDER_IMAGE_SMALL_URL, checkoutCars } = this.props;
|
|
36
|
-
return checkoutCars.map((car: any) => {
|
|
37
|
-
const carId = _get(car, 'id');
|
|
38
|
-
const { mainImageId, title: { model, subModel, make } } = car;
|
|
39
|
-
const src = !!mainImageId && !!car.imagesCount
|
|
40
|
-
? imagesStore.getSupportedImageFormat(carId, mainImageId, 'small')
|
|
41
|
-
: PLACEHOLDER_IMAGE_SMALL_URL;
|
|
42
|
-
const vehicleProps = {
|
|
43
|
-
...car,
|
|
44
|
-
t,
|
|
45
|
-
language,
|
|
46
|
-
mainImageId,
|
|
47
|
-
src,
|
|
48
|
-
url: `/checkout/contact-information?carId=${carId}&isSavedCheckout=true&mainImageId=${mainImageId}&model=${model}&subModel=${subModel}&make=${make}`,
|
|
49
|
-
id: carId,
|
|
50
|
-
target: '_blank',
|
|
51
|
-
rel: 'noopener noreferrer',
|
|
52
|
-
showSlider: false,
|
|
53
|
-
showOfferBtn: true,
|
|
54
|
-
showFavoriteStar: false,
|
|
55
|
-
priceSubMtl: !isMobileOnly ? t('vehicleProps:value.priceSub') : null,
|
|
56
|
-
stats: {
|
|
57
|
-
imagesCount: _get(car, 'imagesCount'),
|
|
58
|
-
statsData: carsStore.aggStatsData.get(car.id)
|
|
59
|
-
},
|
|
60
|
-
dashboardButtonText: t('vehicleProps:title.toCheckoutCar'),
|
|
61
|
-
i18nPrefixForPriceRating: 'common:',
|
|
62
|
-
className: styles.wrapFavorites,
|
|
63
|
-
classButton: styles.favoriteBtn,
|
|
64
|
-
onDetailsClick: this.onCarSelectCheckout,
|
|
65
|
-
vehicleComponentName: 'favorite'
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<div key={`checkoutCar${carId}`} className={styles.checkoutWrapItem}>
|
|
70
|
-
<VehicleSmallCard {...vehicleProps} />
|
|
71
|
-
</div>
|
|
72
|
-
);
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
render(): JSX.Element {
|
|
77
|
-
const { t, checkoutCars } = this.props;
|
|
78
|
-
|
|
79
|
-
const sliderProps = {
|
|
80
|
-
slidesToShow: 3,
|
|
81
|
-
slidesToScroll: 1,
|
|
82
|
-
initialSlide: 2,
|
|
83
|
-
dots: false,
|
|
84
|
-
arrow: false,
|
|
85
|
-
mobileFirst: true,
|
|
86
|
-
responsive: [
|
|
87
|
-
{
|
|
88
|
-
breakpoint: 991,
|
|
89
|
-
settings: { slidesToShow: 3 }
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
breakpoint: 767,
|
|
93
|
-
settings: { slidesToShow: 2 }
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
breakpoint: 574,
|
|
97
|
-
settings: { slidesToShow: 1 }
|
|
98
|
-
}
|
|
99
|
-
]
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<>
|
|
104
|
-
{checkoutCars?.length !== 0 ?
|
|
105
|
-
<DashboardSection className={styles.checkoutSection} title={t('DashboardPage:checkoutTitle')}>
|
|
106
|
-
{!isMobileOnly ?
|
|
107
|
-
this.renderCheckouts()
|
|
108
|
-
: <Slider {...sliderProps}>
|
|
109
|
-
{this.renderCheckouts()}
|
|
110
|
-
</Slider>
|
|
111
|
-
}
|
|
112
|
-
</DashboardSection>
|
|
113
|
-
: false
|
|
114
|
-
}
|
|
115
|
-
</>
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export default CheckoutSection;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
@import '../../../../theme/mixins.styl'
|
|
2
|
-
|
|
3
|
-
.wrapFavorites
|
|
4
|
-
border: none !important;
|
|
5
|
-
|
|
6
|
-
.favoriteBtn
|
|
7
|
-
height: 30px;
|
|
8
|
-
font-size: 13px;
|
|
9
|
-
text-transform: none !important
|
|
10
|
-
font-weight: 400 !important;
|
|
11
|
-
|
|
12
|
-
+media-tablet-landscape-up()
|
|
13
|
-
height: 38px;
|
|
14
|
-
font-size: 14px;
|
|
15
|
-
|
|
16
|
-
.btnCarToFavorites
|
|
17
|
-
height: 38px;
|
|
18
|
-
min-width: 160px !important;
|
|
19
|
-
font-size: 13px !important;
|
|
20
|
-
+media-tablet-landscape-up()
|
|
21
|
-
min-width: 224px !important;
|
|
22
|
-
font-size: 14px !important;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import _get from 'lodash/get';
|
|
3
|
-
import DashboardSection from '../../../containers/DasboardSection/DashboardSection';
|
|
4
|
-
import styles from './FavoriteSection.styl';
|
|
5
|
-
import { isMobileOnly } from 'react-device-detect';
|
|
6
|
-
import { VehicleSmallCard, Button } from '../../../../../common';
|
|
7
|
-
|
|
8
|
-
interface ITFunction {
|
|
9
|
-
<T = string>(key: string, options?: object): T;
|
|
10
|
-
<T = string>(keys: string[], options?: object): T;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface IFavoriteSectionProps {
|
|
14
|
-
favoriteStore: any;
|
|
15
|
-
carsStore: any;
|
|
16
|
-
appStore: any;
|
|
17
|
-
imagesStore: any;
|
|
18
|
-
t?: ITFunction;
|
|
19
|
-
PLACEHOLDER_IMAGE_SMALL_URL: string;
|
|
20
|
-
LinkRouter: any;
|
|
21
|
-
favoriteCars:any;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
class FavoriteSection extends React.Component<IFavoriteSectionProps, {}> {
|
|
25
|
-
|
|
26
|
-
onCarSelectFavorite = (url: string) => window.open(`/search/vehicle/${url}`, '_blank');
|
|
27
|
-
|
|
28
|
-
private renderFavorites = () => {
|
|
29
|
-
const { t, appStore: { language }, carsStore, imagesStore, PLACEHOLDER_IMAGE_SMALL_URL, LinkRouter,favoriteCars } = this.props;
|
|
30
|
-
return favoriteCars.map((car: any, key: any) => {
|
|
31
|
-
const carId = _get(car, 'id');
|
|
32
|
-
const mainImageId = _get(car, 'mainImageId');
|
|
33
|
-
const src = !!mainImageId && !!car.imagesCount
|
|
34
|
-
? imagesStore.getSupportedImageFormat(carId, mainImageId, 'small')
|
|
35
|
-
: PLACEHOLDER_IMAGE_SMALL_URL;
|
|
36
|
-
const vehicleProps = {
|
|
37
|
-
...car,
|
|
38
|
-
t,
|
|
39
|
-
language,
|
|
40
|
-
src,
|
|
41
|
-
linkTag: LinkRouter,
|
|
42
|
-
showSlider: false,
|
|
43
|
-
showOfferBtn: true,
|
|
44
|
-
showFavoriteStar: false,
|
|
45
|
-
priceSubMtl: !isMobileOnly ? t('vehicleProps:value.priceSub') : null,
|
|
46
|
-
stats: {
|
|
47
|
-
imagesCount: _get(car, 'imagesCount'),
|
|
48
|
-
statsData: carsStore.aggStatsData.get(car.id)
|
|
49
|
-
},
|
|
50
|
-
i18nPrefixForPriceRating: 'common:',
|
|
51
|
-
className: styles.wrapFavorites,
|
|
52
|
-
classButton: styles.favoriteBtn,
|
|
53
|
-
onDetailsClick: this.onCarSelectFavorite,
|
|
54
|
-
vehicleComponentName: 'favorite'
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return (key === 0) && <VehicleSmallCard key={`favoriteCar${carId}`} {...vehicleProps} />;
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
render(): JSX.Element {
|
|
62
|
-
const { t, favoriteStore, LinkRouter } = this.props;
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<>
|
|
66
|
-
{favoriteStore.showList ? (
|
|
67
|
-
<DashboardSection
|
|
68
|
-
title={t('DashboardPage:favoriteTitle')}
|
|
69
|
-
link={
|
|
70
|
-
<LinkRouter to='/favourites'>
|
|
71
|
-
<Button className={styles.btnCarToFavorites} variant='outlined'>
|
|
72
|
-
{t('vehicleProps:title.toFavoritesCar')}
|
|
73
|
-
</Button>
|
|
74
|
-
</LinkRouter>}
|
|
75
|
-
>
|
|
76
|
-
{this.renderFavorites()}
|
|
77
|
-
</DashboardSection>
|
|
78
|
-
) : false}
|
|
79
|
-
</>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export default FavoriteSection;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
const SvgYoutubeButton = (props: any) => (
|
|
5
|
-
<svg
|
|
6
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
-
width="146"
|
|
8
|
-
height="103"
|
|
9
|
-
viewBox="0 0 146 103"
|
|
10
|
-
fill="none"
|
|
11
|
-
{...props}
|
|
12
|
-
>
|
|
13
|
-
<g clipPath="url(#clip0_13856_24182)">
|
|
14
|
-
<path d="M142.741 16.6087C141.067 10.3215 137.398 4.99979 131.11 3.32604C119.716 0.278958 72.9583 0 72.9583 0C72.9583 0 26.2006 0.278958 14.8063 3.32604C8.51896 4.99979 4.87104 10.3215 3.17583 16.6087C0.12875 28.0031 0 51.5 0 51.5C0 51.5 0.12875 74.9969 3.17583 86.3912C4.84958 92.6785 8.51896 98.0002 14.8063 99.674C26.2006 102.721 72.9583 103 72.9583 103C72.9583 103 119.716 102.721 131.11 99.674C137.398 98.0002 141.067 92.6785 142.741 86.3912C145.788 74.9969 145.917 51.5 145.917 51.5C145.917 51.5 145.788 28.0031 142.741 16.6087Z" fill="#FF0000" />
|
|
15
|
-
<path d="M96.5625 51.5003L57.9375 30.042V72.9587" fill="white" />
|
|
16
|
-
</g>
|
|
17
|
-
<defs>
|
|
18
|
-
<clipPath id="clip0_13856_24182">
|
|
19
|
-
<rect width="145.917" height="103" fill="white" />
|
|
20
|
-
</clipPath>
|
|
21
|
-
</defs>
|
|
22
|
-
</svg>
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
export default SvgYoutubeButton;
|
|
26
|
-
/* tslint:enable */
|