@wayke-se/components-react 3.4.0 → 3.5.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/README.md +8 -4
- package/dist-node/index.js +62 -21
- package/dist-node/index.js.map +1 -1
- package/dist-src/State/RelatedSearch/useRelatedSearch.js +4 -1
- package/dist-src/components/ActionList/toggle-item.js +1 -4
- package/dist-src/components/Filter/index.js +3 -1
- package/dist-src/components/FilterPanel/faceSelector.js +2 -1
- package/dist-src/components/Grid/index.js +7 -5
- package/dist-src/components/ProductCard/index.js +8 -4
- package/dist-src/components/ProductCard/wrapper.js +6 -1
- package/dist-src/layouts/WaykeComposite.js +2 -2
- package/dist-src/layouts/search/index.js +2 -2
- package/dist-src/layouts/searchItem/Branch.js +6 -4
- package/dist-src/layouts/searchItem/Related.js +7 -3
- package/dist-src/layouts/searchItem/index.js +3 -9
- package/dist-src/queries/SEARCH_ITEM_BRANCH_QUERY.js +1 -0
- package/dist-src/utils/constants.js +1 -0
- package/dist-src/utils/formats.js +3 -1
- package/dist-src/utils/sortOptions.js +6 -0
- package/dist-src/utils/vehicle-properties/property-hint-enricher.js +2 -0
- package/dist-types/@types/codegen/types.d.ts +5 -0
- package/dist-types/@types/filter.d.ts +1 -1
- package/dist-types/@types/search.d.ts +1 -0
- package/dist-types/State/RelatedSearch/useRelatedSearch.d.ts +1 -1
- package/dist-types/components/Grid/index.d.ts +2 -1
- package/dist-types/components/ProductCard/index.d.ts +3 -1
- package/dist-types/components/ProductCard/wrapper.d.ts +1 -0
- package/dist-types/layouts/WaykeComposite.d.ts +1 -1
- package/dist-types/layouts/search/index.d.ts +2 -1
- package/dist-types/layouts/searchItem/Branch.d.ts +2 -1
- package/dist-types/layouts/searchItem/Related.d.ts +3 -1
- package/dist-types/layouts/searchItem/index.d.ts +2 -1
- package/dist-types/utils/constants.d.ts +1 -0
- package/dist-types/utils/sortOptions.d.ts +3 -1
- package/dist-web/index.js +60 -29
- package/dist-web/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,7 +164,8 @@ const App = ({}) => {
|
|
|
164
164
|
| disableResetScrollOnInit | boolean | false | |
|
|
165
165
|
| placeholderImage | string | false | |
|
|
166
166
|
| onClickSearchItem | function | false | (id: string) => void |
|
|
167
|
-
| modifyDocumentTitleItem | boolean | false | |
|
|
167
|
+
| modifyDocumentTitleItem | boolean | false | |
|
|
168
|
+
| displayBranchName | boolean | false | |
|
|
168
169
|
|
|
169
170
|
* Required
|
|
170
171
|
* `id` - Guid that represents a vehicle.
|
|
@@ -175,6 +176,7 @@ const App = ({}) => {
|
|
|
175
176
|
* `placeholderImage` - Provide custom placeholder image when image is missing.
|
|
176
177
|
* `onClickSearchItem` - Function that can be provided that will be triggered once a item is clicked.
|
|
177
178
|
* `modifyDocumentTitleItem` - Update document title with vehicle data
|
|
179
|
+
* `displayBranchName` - Displays branch name on related product cards and using branch name in presentation of where the vehicle exist
|
|
178
180
|
|
|
179
181
|
### WaykeSearch
|
|
180
182
|
| Property | Type | Values |
|
|
@@ -182,23 +184,25 @@ const App = ({}) => {
|
|
|
182
184
|
| pathRoute | string | |
|
|
183
185
|
| hashRoute | boolean | |
|
|
184
186
|
| filterList | SearchFilterTypes[] | |
|
|
185
|
-
| initialQueryParams | URLSearchParams or string | query, manufacturer, modelSeries, fuelType, gearboxType, branch, color, environmentClass, properties.segment, drivingWheel, price.min, price.max, mileage.min, mileage.max, modelYear.min, modelYear.max |
|
|
187
|
+
| initialQueryParams | URLSearchParams or string | query, manufacturer, modelSeries, fuelType, gearboxType, branch, color, environmentClass, properties.segment, drivingWheel, price.min, price.max, mileage.min, mileage.max, modelYear.min, modelYear.max, leasingPrice.min, leasingPrice.max, businessLeasingPrice.min, businessLeasingPrice.max |
|
|
186
188
|
| removeSearchBar | boolean | |
|
|
187
189
|
| removeFilterOptions | boolean | |
|
|
188
190
|
| placeholderImage | string | |
|
|
189
191
|
| onClickSearchItem | function | (id: string) => void |
|
|
190
192
|
| modifyDocumentTitleSearch | string | |
|
|
193
|
+
| displayBranchName | string | |
|
|
191
194
|
|
|
192
195
|
* Optional
|
|
193
196
|
* `pathRoute` - If set, then if a item is clicked it will use the provided url and append the guid. Supports both relative and absolute.
|
|
194
197
|
* `hashRoute` - If set to true, then if a item is clicked it will append #guid to the url (is not used if `pathRoute` is set).
|
|
195
|
-
* `filterList` - Select what filters that should be visible and in whiched order, drivingWheel, price, mileage, modelYear
|
|
198
|
+
* `filterList` - Select what filters that should be visible and in whiched order, drivingWheel, price, mileage, modelYear, leasingPrice, businessLeasingPrice
|
|
196
199
|
* `initialQueryParams` - Set the default filter that should be applid upon init.
|
|
197
200
|
* `removeSearchBar` - Removes search bar.
|
|
198
201
|
* `removeFilterOptions` - Removes filter options.
|
|
199
202
|
* `placeholderImage` - Provide custom placeholder image when image is missing.
|
|
200
203
|
* `onClickSearchItem` - Function that can be provided that will be triggered once a item is clicked.
|
|
201
204
|
* `modifyDocumentTitleSearch` - Set custom document title
|
|
205
|
+
* `displayBranchName` - Displays branch name on product cards
|
|
202
206
|
|
|
203
207
|
## Types
|
|
204
208
|
|
|
@@ -271,7 +275,7 @@ WaykeSearchItem & WaykeSearch combined without `id`
|
|
|
271
275
|
### SearchFilterTypes
|
|
272
276
|
| Property | Type | Required | Values |
|
|
273
277
|
|-------------|-----------------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
274
|
-
| filterName | SearchFilterNameTypes | true | manufacturer, modelSeries, fuelType, gearboxType, branch, color, environmentClass, properties.segment, drivingWheel, price, mileage, modelYear |
|
|
278
|
+
| filterName | SearchFilterNameTypes | true | manufacturer, modelSeries, fuelType, gearboxType, branch, color, environmentClass, properties.segment, drivingWheel, price, mileage, modelYear, leasingPrice, businessLeasingPrice |
|
|
275
279
|
| displayName | string | false | |
|
|
276
280
|
|
|
277
281
|
* `displayName` override default translation of title
|
package/dist-node/index.js
CHANGED
|
@@ -503,6 +503,7 @@ const PRICE = 'price';
|
|
|
503
503
|
const MILEAGE = 'mileage';
|
|
504
504
|
const MODEL_YEAR = 'modelYear';
|
|
505
505
|
const LEASING_PRICE = 'leasingPrice';
|
|
506
|
+
const BUSINESS_LEASING_PRICE = 'businessLeasingPrice';
|
|
506
507
|
const COLOR_WHITE = {
|
|
507
508
|
displayName: 'Vit',
|
|
508
509
|
hex: '#ffffff'
|
|
@@ -595,6 +596,8 @@ const FacetIdToTitle = f => {
|
|
|
595
596
|
return 'Modellår';
|
|
596
597
|
case LEASING_PRICE:
|
|
597
598
|
return 'Privatleasing';
|
|
599
|
+
case BUSINESS_LEASING_PRICE:
|
|
600
|
+
return 'Företagsleasing';
|
|
598
601
|
default:
|
|
599
602
|
return f;
|
|
600
603
|
}
|
|
@@ -803,7 +806,9 @@ const SortOptionDisplayName = {
|
|
|
803
806
|
PriceAsc: 'price-asc',
|
|
804
807
|
Pricedesc: 'price-desc',
|
|
805
808
|
ModelAsc: 'model-asc',
|
|
806
|
-
Modeldesc: 'model-desc'
|
|
809
|
+
Modeldesc: 'model-desc',
|
|
810
|
+
MileageAsc: 'mileage-asc',
|
|
811
|
+
Mileagedesc: 'mileage-desc'
|
|
807
812
|
};
|
|
808
813
|
const getTranslatedSortOptionDisplayName = str => {
|
|
809
814
|
switch (str) {
|
|
@@ -819,6 +824,10 @@ const getTranslatedSortOptionDisplayName = str => {
|
|
|
819
824
|
return 'Årsmodell äldst';
|
|
820
825
|
case SortOptionDisplayName.Modeldesc:
|
|
821
826
|
return 'Årsmodell nyast';
|
|
827
|
+
case SortOptionDisplayName.MileageAsc:
|
|
828
|
+
return 'Miltal lägst';
|
|
829
|
+
case SortOptionDisplayName.Mileagedesc:
|
|
830
|
+
return 'Miltal högst';
|
|
822
831
|
default:
|
|
823
832
|
return str;
|
|
824
833
|
}
|
|
@@ -1979,6 +1988,7 @@ const FacetSelector = ({
|
|
|
1979
1988
|
unit: "kr",
|
|
1980
1989
|
formatValues: true
|
|
1981
1990
|
});
|
|
1991
|
+
case BUSINESS_LEASING_PRICE:
|
|
1982
1992
|
case LEASING_PRICE:
|
|
1983
1993
|
return React__default.createElement(RangeFacet, {
|
|
1984
1994
|
facet: facet,
|
|
@@ -2035,6 +2045,8 @@ const isSelected = (f, searchParams) => {
|
|
|
2035
2045
|
switch (f.id) {
|
|
2036
2046
|
case PRICE:
|
|
2037
2047
|
case MILEAGE:
|
|
2048
|
+
case LEASING_PRICE:
|
|
2049
|
+
case BUSINESS_LEASING_PRICE:
|
|
2038
2050
|
case MODEL_YEAR:
|
|
2039
2051
|
return searchParams.has(`${f.id}.min`) || searchParams.has(`${f.id}.max`) ? 1 : 0;
|
|
2040
2052
|
default:
|
|
@@ -2178,6 +2190,11 @@ const ContentFooter = styled__default.div`
|
|
|
2178
2190
|
margin-top: auto;
|
|
2179
2191
|
padding-top: ${size(1)};
|
|
2180
2192
|
`;
|
|
2193
|
+
const PreHeading = styled__default.div`
|
|
2194
|
+
margin-bottom: ${size(0.25)};
|
|
2195
|
+
color: ${props => props.theme.color.textDarkLighten};
|
|
2196
|
+
font-size: 0.75rem;
|
|
2197
|
+
`;
|
|
2181
2198
|
const Heading$2 = styled__default.h1.attrs(() => ({
|
|
2182
2199
|
className: 'wayke__theme wayke__font--bold'
|
|
2183
2200
|
}))`
|
|
@@ -2242,7 +2259,7 @@ const OldPrice = styled__default.div`
|
|
|
2242
2259
|
`;
|
|
2243
2260
|
const Label$3 = styled__default.label`
|
|
2244
2261
|
color: ${props => props.theme.color.disabledText};
|
|
2245
|
-
font-size: 0.
|
|
2262
|
+
font-size: 0.75rem;
|
|
2246
2263
|
`;
|
|
2247
2264
|
|
|
2248
2265
|
const Item$5 = styled__default.li`
|
|
@@ -2372,11 +2389,13 @@ const ProductCard = ({
|
|
|
2372
2389
|
image,
|
|
2373
2390
|
pathRoute,
|
|
2374
2391
|
placeholderImage,
|
|
2392
|
+
branchName,
|
|
2375
2393
|
description,
|
|
2376
2394
|
uspList,
|
|
2377
2395
|
price,
|
|
2378
2396
|
oldPrice,
|
|
2379
2397
|
leasingPrice,
|
|
2398
|
+
businessLeasingPrice,
|
|
2380
2399
|
onClick
|
|
2381
2400
|
}) => {
|
|
2382
2401
|
const {
|
|
@@ -2405,7 +2424,7 @@ const ProductCard = ({
|
|
|
2405
2424
|
alt: title
|
|
2406
2425
|
}))) : React__default.createElement(Picture, null, React__default.createElement(Img, {
|
|
2407
2426
|
src: placeholderImage || DEFAULT_PLACEHOLDER_IMAGE
|
|
2408
|
-
})))), React__default.createElement(Content, null, React__default.createElement(ContentBody, null, React__default.createElement(Heading$2, null, href ? React__default.createElement(Link, {
|
|
2427
|
+
})))), React__default.createElement(Content, null, React__default.createElement(ContentBody, null, branchName && React__default.createElement(PreHeading, null, branchName), React__default.createElement(Heading$2, null, href ? React__default.createElement(Link, {
|
|
2409
2428
|
onClick: onHrefClick,
|
|
2410
2429
|
href: href,
|
|
2411
2430
|
title: title,
|
|
@@ -2413,7 +2432,7 @@ const ProductCard = ({
|
|
|
2413
2432
|
}, title) : title), description && React__default.createElement(Description$1, null, description), uspList && React__default.createElement(Usp, null, React__default.createElement(UspList, {
|
|
2414
2433
|
small: true,
|
|
2415
2434
|
items: uspList
|
|
2416
|
-
}))), React__default.createElement(ContentFooter, null, React__default.createElement(Price, null, React__default.createElement(PriceCell, null, oldPrice ? React__default.createElement(OldPrice, null, oldPrice) : React__default.createElement(Label$3, null, "Pris"), React__default.createElement(CurrentPrice, null, price)), leasingPrice && React__default.createElement(PriceCell, null, React__default.createElement(Label$3, null, "
|
|
2435
|
+
}))), React__default.createElement(ContentFooter, null, React__default.createElement(Price, null, React__default.createElement(PriceCell, null, oldPrice ? React__default.createElement(OldPrice, null, oldPrice) : React__default.createElement(Label$3, null, "Pris"), React__default.createElement(CurrentPrice, null, price)), leasingPrice && React__default.createElement(PriceCell, null, React__default.createElement(Label$3, null, "Privatleasing"), React__default.createElement(CurrentPrice, null, leasingPrice)), businessLeasingPrice && React__default.createElement(PriceCell, null, React__default.createElement(Label$3, null, "F\u00F6retagsleasing"), React__default.createElement(CurrentPrice, null, businessLeasingPrice))))));
|
|
2417
2436
|
};
|
|
2418
2437
|
|
|
2419
2438
|
const resolveImage = document => {
|
|
@@ -2429,12 +2448,14 @@ const Grid = ({
|
|
|
2429
2448
|
placeholderImage,
|
|
2430
2449
|
hashRoute,
|
|
2431
2450
|
pathRoute,
|
|
2451
|
+
displayBranchName,
|
|
2432
2452
|
onClickItem
|
|
2433
2453
|
}) => {
|
|
2434
2454
|
if (!documents) {
|
|
2435
2455
|
return null;
|
|
2436
2456
|
}
|
|
2437
2457
|
return React__default.createElement(Wrapper$7, null, React__default.createElement(List$4, null, documents.map(document => {
|
|
2458
|
+
var _document$branches, _document$branches$;
|
|
2438
2459
|
/*
|
|
2439
2460
|
const _path = pathRoute?.replace(/^\/|\/$/g, '');
|
|
2440
2461
|
const prefix = _path ? `/${_path}/` : '/';
|
|
@@ -2463,6 +2484,7 @@ const Grid = ({
|
|
|
2463
2484
|
image: resolveImage(document),
|
|
2464
2485
|
placeholderImage: placeholderImage,
|
|
2465
2486
|
description: document.shortDescription,
|
|
2487
|
+
branchName: displayBranchName ? (_document$branches = document.branches) === null || _document$branches === void 0 ? void 0 : (_document$branches$ = _document$branches[0]) === null || _document$branches$ === void 0 ? void 0 : _document$branches$.name : undefined,
|
|
2466
2488
|
uspList: [{
|
|
2467
2489
|
title: document.modelYear
|
|
2468
2490
|
}, {
|
|
@@ -2473,8 +2495,9 @@ const Grid = ({
|
|
|
2473
2495
|
title: document.fuelType
|
|
2474
2496
|
}],
|
|
2475
2497
|
price: `${numberSeparator(document.price)} kr`,
|
|
2476
|
-
|
|
2477
|
-
|
|
2498
|
+
oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice ? `${numberSeparator(document.oldPrice)} kr` : undefined,
|
|
2499
|
+
leasingPrice: document.leasingPrice !== undefined ? `${numberSeparator(document.leasingPrice)} kr/mån` : undefined,
|
|
2500
|
+
businessLeasingPrice: document.businessLeasingPrice !== undefined ? `${numberSeparator(document.businessLeasingPrice)} kr/mån` : undefined
|
|
2478
2501
|
}));
|
|
2479
2502
|
})));
|
|
2480
2503
|
};
|
|
@@ -2914,6 +2937,7 @@ const WaykeSearch = ({
|
|
|
2914
2937
|
placeholderImage,
|
|
2915
2938
|
removeFilterOptions,
|
|
2916
2939
|
modifyDocumentTitleSearch,
|
|
2940
|
+
displayBranchName,
|
|
2917
2941
|
onClickSearchItem
|
|
2918
2942
|
}) => {
|
|
2919
2943
|
const {
|
|
@@ -2958,7 +2982,8 @@ const WaykeSearch = ({
|
|
|
2958
2982
|
pathRoute: pathRoute,
|
|
2959
2983
|
onClickItem: onItemClicked,
|
|
2960
2984
|
documents: documents,
|
|
2961
|
-
placeholderImage: placeholderImage
|
|
2985
|
+
placeholderImage: placeholderImage,
|
|
2986
|
+
displayBranchName: displayBranchName
|
|
2962
2987
|
}), !error && documents && documents.length === 0 && React__default.createElement(Snackbar, {
|
|
2963
2988
|
severity: "warning",
|
|
2964
2989
|
icon: true,
|
|
@@ -6278,8 +6303,6 @@ const ManufacturerPackageOption = ({
|
|
|
6278
6303
|
})));
|
|
6279
6304
|
};
|
|
6280
6305
|
|
|
6281
|
-
const initialValue = {};
|
|
6282
|
-
const getInitialValue = title => title && !!initialValue[title];
|
|
6283
6306
|
const ToggleItem = ({
|
|
6284
6307
|
title,
|
|
6285
6308
|
value,
|
|
@@ -6287,7 +6310,7 @@ const ToggleItem = ({
|
|
|
6287
6310
|
onClickVisible,
|
|
6288
6311
|
onClickValue
|
|
6289
6312
|
}) => {
|
|
6290
|
-
const [visible, setVisible] = React.useState(
|
|
6313
|
+
const [visible, setVisible] = React.useState(false);
|
|
6291
6314
|
const _onClickValue = React.useCallback(() => {
|
|
6292
6315
|
if (onClickValue) {
|
|
6293
6316
|
onClickValue();
|
|
@@ -6295,7 +6318,6 @@ const ToggleItem = ({
|
|
|
6295
6318
|
}, []);
|
|
6296
6319
|
const onClick = React.useCallback(() => {
|
|
6297
6320
|
if (!visible) {
|
|
6298
|
-
initialValue[type] = true;
|
|
6299
6321
|
setVisible(true);
|
|
6300
6322
|
if (onClickVisible) {
|
|
6301
6323
|
onClickVisible();
|
|
@@ -6816,7 +6838,7 @@ const RelatedSearchContext = React.createContext({
|
|
|
6816
6838
|
fetchRelated: _ => {}
|
|
6817
6839
|
});
|
|
6818
6840
|
|
|
6819
|
-
const useRelatedSearch = id => {
|
|
6841
|
+
const useRelatedSearch = (id, authorizedReseller) => {
|
|
6820
6842
|
const data = React.useContext(RelatedSearchContext);
|
|
6821
6843
|
React.useEffect(() => {
|
|
6822
6844
|
const searchParams = new URLSearchParams();
|
|
@@ -6824,6 +6846,9 @@ const useRelatedSearch = id => {
|
|
|
6824
6846
|
if (data.moreLikeThisUrl && id) {
|
|
6825
6847
|
searchParams.set('id', id);
|
|
6826
6848
|
}
|
|
6849
|
+
if (authorizedReseller) {
|
|
6850
|
+
searchParams.set('isAuthorizedResellerForManufacturer', 'true');
|
|
6851
|
+
}
|
|
6827
6852
|
data.fetchRelated(searchParams);
|
|
6828
6853
|
}, [id]);
|
|
6829
6854
|
return data;
|
|
@@ -6843,13 +6868,15 @@ const Related = ({
|
|
|
6843
6868
|
id,
|
|
6844
6869
|
hashRoute,
|
|
6845
6870
|
pathRoute,
|
|
6871
|
+
authorizedReseller,
|
|
6872
|
+
displayBranchName,
|
|
6846
6873
|
onClickSearchItem
|
|
6847
6874
|
}) => {
|
|
6848
6875
|
const {
|
|
6849
6876
|
loading,
|
|
6850
6877
|
response,
|
|
6851
6878
|
moreLikeThisUrl
|
|
6852
|
-
} = useRelatedSearch(id);
|
|
6879
|
+
} = useRelatedSearch(id, !!authorizedReseller);
|
|
6853
6880
|
const onItemClicked = React.useCallback(id => {
|
|
6854
6881
|
PubSub.publish('ItemClicked', id);
|
|
6855
6882
|
if (onClickSearchItem) {
|
|
@@ -6876,7 +6903,7 @@ const Related = ({
|
|
|
6876
6903
|
}, React__default.createElement(H2, {
|
|
6877
6904
|
noMargin: true
|
|
6878
6905
|
}, "Senast inkomna"))), React__default.createElement(Repeat, null, React__default.createElement(OverflowGrid, null, React__default.createElement(OverflowGridList, null, response === null || response === void 0 ? void 0 : response.documentList.documents.map(document => {
|
|
6879
|
-
var _document$featuredIma, _document$featuredIma2, _document$featuredIma3
|
|
6906
|
+
var _document$featuredIma, _document$featuredIma2, _document$featuredIma3, _document$branches, _document$branches$;
|
|
6880
6907
|
const prefix = pathRoute ? `/${pathRoute}` : '/';
|
|
6881
6908
|
const r = regexPathGuid();
|
|
6882
6909
|
const pathRouteUrl = window.location.pathname === '/' ? `${prefix}${document._id}` : r.test(`${pathRoute}${id}`) ? window.location.pathname.replace(r, document._id) : `${window.location.pathname}${prefix}${document._id}`;
|
|
@@ -6889,6 +6916,7 @@ const Related = ({
|
|
|
6889
6916
|
href: pathRoute ? pathRouteUrl : hashRoute ? `#${document._id}` : undefined,
|
|
6890
6917
|
image: (_document$featuredIma = document.featuredImage) === null || _document$featuredIma === void 0 ? void 0 : (_document$featuredIma2 = _document$featuredIma.files) === null || _document$featuredIma2 === void 0 ? void 0 : (_document$featuredIma3 = _document$featuredIma2[0]) === null || _document$featuredIma3 === void 0 ? void 0 : _document$featuredIma3.url,
|
|
6891
6918
|
description: document.shortDescription,
|
|
6919
|
+
branchName: displayBranchName ? (_document$branches = document.branches) === null || _document$branches === void 0 ? void 0 : (_document$branches$ = _document$branches[0]) === null || _document$branches$ === void 0 ? void 0 : _document$branches$.name : undefined,
|
|
6892
6920
|
uspList: [{
|
|
6893
6921
|
title: document.modelYear
|
|
6894
6922
|
}, {
|
|
@@ -6900,6 +6928,8 @@ const Related = ({
|
|
|
6900
6928
|
}],
|
|
6901
6929
|
price: `${numberSeparator(document.price)} kr`,
|
|
6902
6930
|
oldPrice: document.oldPrice !== undefined && document.price < document.oldPrice ? `${numberSeparator(document.oldPrice)} kr` : undefined,
|
|
6931
|
+
leasingPrice: document.leasingPrice !== undefined ? `${numberSeparator(document.leasingPrice)} kr/mån` : undefined,
|
|
6932
|
+
businessLeasingPrice: document.businessLeasingPrice !== undefined ? `${numberSeparator(document.businessLeasingPrice)} kr/mån` : undefined,
|
|
6903
6933
|
pathRoute: pathRoute
|
|
6904
6934
|
}));
|
|
6905
6935
|
}))))));
|
|
@@ -7140,7 +7170,8 @@ const StaticMap = ({
|
|
|
7140
7170
|
|
|
7141
7171
|
const Branch = ({
|
|
7142
7172
|
branch,
|
|
7143
|
-
loading
|
|
7173
|
+
loading,
|
|
7174
|
+
displayBranchName
|
|
7144
7175
|
}) => {
|
|
7145
7176
|
var _branch$location, _branch$location2, _branch$location3, _branch$connections, _branch$location4, _branch$location5, _branch$location6, _branch$location7, _branch$contact;
|
|
7146
7177
|
const [modal, setModal] = React.useState(false);
|
|
@@ -7160,7 +7191,7 @@ const Branch = ({
|
|
|
7160
7191
|
onClose: closeModal
|
|
7161
7192
|
}), React__default.createElement(Repeat, null, React__default.createElement(H2, {
|
|
7162
7193
|
noMargin: true
|
|
7163
|
-
}, branch !== null && branch !== void 0 && (_branch$location = branch.location) !== null && _branch$location !== void 0 && _branch$location.city ? `Den här bilen finns på vår anläggning i ${branch === null || branch === void 0 ? void 0 : (_branch$location2 = branch.location) === null || _branch$location2 === void 0 ? void 0 : _branch$location2.city}` : 'Kontakt')), React__default.createElement(Repeat, null, React__default.createElement(StaticMap, {
|
|
7194
|
+
}, displayBranchName ? `Den här bilen finns på ${branch.name}` : branch !== null && branch !== void 0 && (_branch$location = branch.location) !== null && _branch$location !== void 0 && _branch$location.city ? `Den här bilen finns på vår anläggning i ${branch === null || branch === void 0 ? void 0 : (_branch$location2 = branch.location) === null || _branch$location2 === void 0 ? void 0 : _branch$location2.city}` : 'Kontakt')), React__default.createElement(Repeat, null, React__default.createElement(StaticMap, {
|
|
7164
7195
|
position: branch === null || branch === void 0 ? void 0 : (_branch$location3 = branch.location) === null || _branch$location3 === void 0 ? void 0 : _branch$location3.position
|
|
7165
7196
|
})), ((branch === null || branch === void 0 ? void 0 : (_branch$connections = branch.connections) === null || _branch$connections === void 0 ? void 0 : _branch$connections.length) || 0) > 1 && React__default.createElement(Repeat, null, React__default.createElement(Content$2, null, React__default.createElement("p", null, "Denna bil tillh\u00F6r ett centrallager och g\u00E5r att k\u00F6pa genom flera anl\u00E4ggningar.", ' ', React__default.createElement(ButtonInline, {
|
|
7166
7197
|
as: "span",
|
|
@@ -7218,6 +7249,7 @@ const SEARCH_ITEM_BRANCH_QUERY = client.gql`
|
|
|
7218
7249
|
mrf
|
|
7219
7250
|
centralStorage
|
|
7220
7251
|
ecommerce
|
|
7252
|
+
authorizedReseller
|
|
7221
7253
|
}
|
|
7222
7254
|
logotype
|
|
7223
7255
|
openingHours {
|
|
@@ -7612,6 +7644,8 @@ const HINTS = Object.freeze({
|
|
|
7612
7644
|
finish: '',
|
|
7613
7645
|
fuelConsumptionCityDriving: 'Bränsleförbrukning vid stadskörning.',
|
|
7614
7646
|
fuelConsumptionCountryRoadDriving: 'Bränsleförbrukning vid landsvägskörning.',
|
|
7647
|
+
fuelConsumptionMixedDrivingNEDC: 'Bränsleförbrukning vid blandad körning.',
|
|
7648
|
+
fuelConsumptionMixedDrivingWLTP: 'Bränsleförbrukning vid blandad körning.',
|
|
7615
7649
|
fuelConsumptionMixedDriving: 'Bränsleförbrukning vid blandad körning. Dvs. stadskörning och landsvägskörning under en och samma färd.',
|
|
7616
7650
|
fuelType: 'Vad bilen ska tankas med och drivs av.',
|
|
7617
7651
|
gearboxName: '',
|
|
@@ -8183,9 +8217,10 @@ const WaykeSearchItem = ({
|
|
|
8183
8217
|
disableResetScrollOnInit,
|
|
8184
8218
|
placeholderImage,
|
|
8185
8219
|
modifyDocumentTitleItem,
|
|
8220
|
+
displayBranchName,
|
|
8186
8221
|
onClickSearchItem
|
|
8187
8222
|
}) => {
|
|
8188
|
-
var _result$vehicle3, _result$vehicle3$data, _result$vehicle4;
|
|
8223
|
+
var _result$vehicle3, _result$vehicle3$data, _result$vehicle4, _branch$flags;
|
|
8189
8224
|
const {
|
|
8190
8225
|
ecomSettings
|
|
8191
8226
|
} = useSettings();
|
|
@@ -8375,6 +8410,7 @@ const WaykeSearchItem = ({
|
|
|
8375
8410
|
documents: documents
|
|
8376
8411
|
}), React__default.createElement(ProductPageMainSection, null, React__default.createElement(Branch, {
|
|
8377
8412
|
branch: branch,
|
|
8413
|
+
displayBranchName: displayBranchName,
|
|
8378
8414
|
loading: loadingCentralStorageVehicle
|
|
8379
8415
|
}), ecommerce && ecommerce.enabled && React__default.createElement(Repeat, null, React__default.createElement(ButtonPrimary, {
|
|
8380
8416
|
disabled: !!ecommerce.reserved,
|
|
@@ -8391,8 +8427,10 @@ const WaykeSearchItem = ({
|
|
|
8391
8427
|
id: id,
|
|
8392
8428
|
hashRoute: hashRoute,
|
|
8393
8429
|
pathRoute: pathRoute,
|
|
8430
|
+
authorizedReseller: !!(branch !== null && branch !== void 0 && (_branch$flags = branch.flags) !== null && _branch$flags !== void 0 && _branch$flags.authorizedReseller),
|
|
8431
|
+
displayBranchName: displayBranchName,
|
|
8394
8432
|
onClickSearchItem: onClickSearchItem
|
|
8395
|
-
})),
|
|
8433
|
+
})), React__default.createElement(PortalElement, {
|
|
8396
8434
|
id: DefaultPortal
|
|
8397
8435
|
}), demoCarModal && React__default.createElement(DemoCarModal, {
|
|
8398
8436
|
onClose: onToggleDemoCarModal
|
|
@@ -8857,7 +8895,8 @@ const WaykeComposite = ({
|
|
|
8857
8895
|
placeholderImage,
|
|
8858
8896
|
pathRoute,
|
|
8859
8897
|
modifyDocumentTitleItem,
|
|
8860
|
-
modifyDocumentTitleSearch
|
|
8898
|
+
modifyDocumentTitleSearch,
|
|
8899
|
+
displayBranchName
|
|
8861
8900
|
}) => {
|
|
8862
8901
|
const hashId = useHashGuid();
|
|
8863
8902
|
const {
|
|
@@ -8879,7 +8918,8 @@ const WaykeComposite = ({
|
|
|
8879
8918
|
disableResetScrollOnInit: disableResetScrollOnInit,
|
|
8880
8919
|
placeholderImage: placeholderImage,
|
|
8881
8920
|
pathRoute: pathRoute,
|
|
8882
|
-
modifyDocumentTitleItem: modifyDocumentTitleItem
|
|
8921
|
+
modifyDocumentTitleItem: modifyDocumentTitleItem,
|
|
8922
|
+
displayBranchName: displayBranchName
|
|
8883
8923
|
}) : React__default.createElement(WaykeSearch, {
|
|
8884
8924
|
filterList: filterList,
|
|
8885
8925
|
initialQueryParams: initialQueryParams,
|
|
@@ -8888,7 +8928,8 @@ const WaykeComposite = ({
|
|
|
8888
8928
|
placeholderImage: placeholderImage,
|
|
8889
8929
|
pathRoute: pathRoute,
|
|
8890
8930
|
removeFilterOptions: removeFilterOptions,
|
|
8891
|
-
modifyDocumentTitleSearch: modifyDocumentTitleSearch
|
|
8931
|
+
modifyDocumentTitleSearch: modifyDocumentTitleSearch,
|
|
8932
|
+
displayBranchName: displayBranchName
|
|
8892
8933
|
}));
|
|
8893
8934
|
};
|
|
8894
8935
|
|