@bytebrand/fe-ui-core 4.8.109 → 4.8.111
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.110.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 +1 -13
- package/source/components/AccordionWidget/AccordionWidget.tsx +8 -49
- package/source/components/OfferPanel/OfferCheckboxGroup/CheckboxContainer.tsx +2 -2
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.styl +0 -24
- package/source/components/OfferPanel/OfferCheckboxGroup/OfferCheckboxGroup.tsx +2 -1
- package/source/components/OfferPanel/OfferPanel.tsx +1 -1
- package/source/components/VehicleDetailedSidebar/VehicleDetailedSidebar.tsx +11 -23
- package/source/components/VehicleDetailedSidebar/partials/Properties.styl +0 -5
- package/source/components/VehicleDetailedSidebar/partials/Properties.tsx +18 -56
- package/source/components/VehicleDetailedSlider/VehicleDetailedSlider.tsx +6 -2
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.styl +0 -42
- package/source/components/VehicleSmallCard/VehicleData/VechiclePriceItem/VechiclePriceItem.tsx +11 -23
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.styl +5 -60
- package/source/components/VehicleSmallCard/VehicleData/VehicleInfo/VehicleInfo.tsx +12 -36
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.styl +2 -3
- package/source/components/VehicleSmallCard/VehicleData/VehiclePrice/VehiclePrice.tsx +7 -18
- 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.styl +2 -67
- package/source/components/VehicleSmallCard/VehicleSmallCard.tsx +8 -50
- package/source/components/_common/MaterialAccordionGroup/MaterialAccordionGroup.styled.tsx +1 -4
- package/source/components/_common/MaterialTooltip/MaterialTooltip.tsx +3 -4
- package/source/components/_common/withStats/withStats.styl +0 -10
- package/source/components/_common/withStats/withStats.tsx +9 -4
- package/source/framework/DataTransformers.ts +0 -2
- package/source/framework/constants/common.ts +4 -8
- package/source/framework/types/types.ts +0 -1
- package/source/framework/vehiclesProps/decoratedLightProps.tsx +18 -109
- package/source/framework/vehiclesProps/decoratedProps.tsx +9 -68
- package/source/framework/vehiclesProps/vehicleDetails.ts +1 -3
- package/source/locales/data.ts +3 -13
- 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/package.json.bak +0 -118
- 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
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
.default
|
|
2
|
-
padding: 10px
|
|
3
|
-
border-radius: 5px
|
|
4
|
-
margin-bottom: 20px
|
|
5
|
-
display: flex
|
|
6
|
-
flex-direction: row
|
|
7
|
-
align-items: center
|
|
8
|
-
justify-content: space-between
|
|
9
|
-
|
|
10
|
-
.vertical
|
|
11
|
-
composes: default
|
|
12
|
-
display: flex
|
|
13
|
-
flex-direction: column
|
|
14
|
-
align-items: center
|
|
15
|
-
padding: 10px
|
|
16
|
-
max-width: 500px
|
|
17
|
-
|
|
18
|
-
.verticalChild:not(:last-of-type)
|
|
19
|
-
margin-bottom: 10px
|
|
20
|
-
|
|
21
|
-
.equipment
|
|
22
|
-
display: flex
|
|
23
|
-
flex-direction: row
|
|
24
|
-
align-items: center
|
|
25
|
-
justify-content: space-between
|
|
26
|
-
|
|
27
|
-
.column
|
|
28
|
-
display: flex
|
|
29
|
-
flex-direction: column
|
|
30
|
-
align-items: stretch
|
|
31
|
-
|
|
32
|
-
.title
|
|
33
|
-
font-size: 10px
|
|
34
|
-
|
|
35
|
-
.value
|
|
36
|
-
font-size: 14px
|
|
37
|
-
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
import { action } from '@storybook/addon-actions';
|
|
4
|
-
|
|
5
|
-
import Switcher from './Switcher';
|
|
6
|
-
|
|
7
|
-
import styles from './Switcher.story.styl';
|
|
8
|
-
export class SwitcherGroup extends React.Component {
|
|
9
|
-
state = {
|
|
10
|
-
value: 0
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
action = action('change');
|
|
14
|
-
onChange = (event, value) => {
|
|
15
|
-
this.action(event, value);
|
|
16
|
-
this.setState(() => ({ value }));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
onChange = (e, value, name) => {
|
|
20
|
-
this.setState({ value: value });
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
const warrantyPeriodOptions = ['1 Jahr', '2 Jahre'];
|
|
25
|
-
return (
|
|
26
|
-
<Switcher
|
|
27
|
-
options={warrantyPeriodOptions}
|
|
28
|
-
value={this.state.value}
|
|
29
|
-
onChange={this.onChange}
|
|
30
|
-
name={'warrantyPeriod'}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
storiesOf('checkout', module)
|
|
37
|
-
.add('switcherGroup', () => (
|
|
38
|
-
<div>
|
|
39
|
-
<SwitcherGroup />
|
|
40
|
-
</div>
|
|
41
|
-
));
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
// Components
|
|
5
|
-
import CompactSearchWidget from './CompactSearchWidget';
|
|
6
|
-
|
|
7
|
-
// utils
|
|
8
|
-
import { getRequestOptions } from '../../framework/utils/RequestUtils';
|
|
9
|
-
import { buildBodyForRequest, buildQueryForSearch, changeLocation } from '../../framework/utils/CommonUtils';
|
|
10
|
-
import { transformManufacturers, transformModelsGeneral } from '../../framework/DataTransformers';
|
|
11
|
-
import { MANUFACTURER, MODEL, THROTTLE_DELAY, RATE_DEFAULT } from '../../framework/constants/SearchWidget';
|
|
12
|
-
import { BODY_TYPES } from '../../framework/constants/selectors';
|
|
13
|
-
|
|
14
|
-
const containerStyles = {
|
|
15
|
-
position: 'relative',
|
|
16
|
-
width: '600px',
|
|
17
|
-
height: '550px',
|
|
18
|
-
backgroundImage: 'url("https://dev.autode-static.de/wp-content/uploads/2019/02/startseite_br_tor_AXEL.png")'
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const widget = {
|
|
22
|
-
position: 'absolute',
|
|
23
|
-
top: '5%',
|
|
24
|
-
left: '50%',
|
|
25
|
-
transform: 'translateX(-50%)',
|
|
26
|
-
padding: '15px'
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const getCarsCounterUrl = 'https://www.autode-dev.de/service/car-search-endpoint/api/v1/count/car';
|
|
30
|
-
const getManufacturersUrl = 'https://www.autode-dev.de/service/car-makemodel-mapping/api/v1/information/makers';
|
|
31
|
-
const getModelsUrl = 'https://www.autode-dev.de/service/car-makemodel-mapping/api/v1/information/models?maker=';
|
|
32
|
-
|
|
33
|
-
let timeout = null;
|
|
34
|
-
|
|
35
|
-
class CompactWidgetContainer extends React.Component {
|
|
36
|
-
constructor(props) {
|
|
37
|
-
super(props);
|
|
38
|
-
|
|
39
|
-
this.state = {
|
|
40
|
-
counter: 0,
|
|
41
|
-
counterLoading: false,
|
|
42
|
-
manufacturers: [],
|
|
43
|
-
models: [],
|
|
44
|
-
bodyTypes: [],
|
|
45
|
-
filters: {
|
|
46
|
-
MANUFACTURER: '',
|
|
47
|
-
MODEL: '',
|
|
48
|
-
BODY_TYPE: [],
|
|
49
|
-
FIRST_REGISTRATION: '',
|
|
50
|
-
MILEAGE: '',
|
|
51
|
-
PRICE: { from: '', to: '' },
|
|
52
|
-
RATE: RATE_DEFAULT
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
componentDidMount() {
|
|
58
|
-
this.getCarsCounter();
|
|
59
|
-
this.getManufacturers();
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
componentWillUnmount() {
|
|
63
|
-
timeout = null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
onFilterChange = (value, name) => {
|
|
67
|
-
if (!name) return false;
|
|
68
|
-
const newState = Object.assign({}, this.state);
|
|
69
|
-
newState.filters[name] = value;
|
|
70
|
-
|
|
71
|
-
if (name === MANUFACTURER) {
|
|
72
|
-
newState.filters[MODEL] = '';
|
|
73
|
-
this.getModels(value.value);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
this.setState(() => (newState), () => {
|
|
77
|
-
clearTimeout(timeout);
|
|
78
|
-
timeout = setTimeout(this.getCarsCounter, THROTTLE_DELAY);
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
onSearchButtonClick = () => {
|
|
83
|
-
const { filters } = this.state;
|
|
84
|
-
const query = buildQueryForSearch(filters);
|
|
85
|
-
const resolvePrefix = query ? `search?${query}` : 'search';
|
|
86
|
-
this.onChangeLocation(resolvePrefix);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
onChangeLocation = (path) =>
|
|
90
|
-
changeLocation(path);
|
|
91
|
-
|
|
92
|
-
onBrandPanelClick = () => {
|
|
93
|
-
console.log(this.state.filters[MANUFACTURER]);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
getManufacturers = () =>
|
|
97
|
-
fetch(getManufacturersUrl, getRequestOptions('get'))
|
|
98
|
-
.then((res) => res.json())
|
|
99
|
-
.then((res) => {
|
|
100
|
-
const manufacturers = transformManufacturers(res.data);
|
|
101
|
-
this.updateManufacturersList(manufacturers);
|
|
102
|
-
})
|
|
103
|
-
.catch((error) => {
|
|
104
|
-
throw error;
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
getModels = (maker) =>
|
|
108
|
-
fetch(`${getModelsUrl}${maker}`, getRequestOptions('get'))
|
|
109
|
-
.then((res) => res.json())
|
|
110
|
-
.then((res) => {
|
|
111
|
-
const models = transformModelsGeneral(res.data);
|
|
112
|
-
this.setState(() => ({
|
|
113
|
-
models
|
|
114
|
-
}));
|
|
115
|
-
})
|
|
116
|
-
.catch((error) => {
|
|
117
|
-
throw error;
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
getCarsCounter = () => {
|
|
121
|
-
const { filters } = this.state;
|
|
122
|
-
const data = buildBodyForRequest(filters);
|
|
123
|
-
const obj = getRequestOptions('post', data);
|
|
124
|
-
this.setState(() => ({ counterLoading: true }));
|
|
125
|
-
|
|
126
|
-
fetch(getCarsCounterUrl, obj)
|
|
127
|
-
.then((res) => res.json())
|
|
128
|
-
.then((res) => {
|
|
129
|
-
this.updateCarCounter(res.count);
|
|
130
|
-
this.setState(() => ({ counterLoading: false }));
|
|
131
|
-
})
|
|
132
|
-
.catch((error) => {
|
|
133
|
-
this.setState(() => ({ counterLoading: false }));
|
|
134
|
-
throw error;
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
updateManufacturersList = (manufacturers) =>
|
|
139
|
-
this.setState(() => ({
|
|
140
|
-
manufacturers
|
|
141
|
-
}));
|
|
142
|
-
|
|
143
|
-
updateCarCounter = (counter) =>
|
|
144
|
-
this.setState(() => ({
|
|
145
|
-
counter,
|
|
146
|
-
counterLoading: false
|
|
147
|
-
}));
|
|
148
|
-
|
|
149
|
-
render() {
|
|
150
|
-
const { counter, counterLoading, manufacturers, models, filters } = this.state;
|
|
151
|
-
const query = buildQueryForSearch(filters);
|
|
152
|
-
|
|
153
|
-
const searchWidgetProps = {
|
|
154
|
-
counter,
|
|
155
|
-
counterLoading,
|
|
156
|
-
manufacturers,
|
|
157
|
-
models,
|
|
158
|
-
bodyTypes: BODY_TYPES,
|
|
159
|
-
filters,
|
|
160
|
-
contrastMode: true,
|
|
161
|
-
onFilterChange: this.onFilterChange,
|
|
162
|
-
rateWidgetModalSizes: ['xs', 'sm', 'md', 'lg'],
|
|
163
|
-
searchButtonLink: `search?${query}`,
|
|
164
|
-
detailedSearchLink: `search/detailed?${query}`,
|
|
165
|
-
onDetailedSearchClick: () => console.log('detailed'),
|
|
166
|
-
onBrandPanelClick: this.onBrandPanelClick
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
return (
|
|
170
|
-
<div>
|
|
171
|
-
<CompactSearchWidget {...searchWidgetProps} />
|
|
172
|
-
</div>
|
|
173
|
-
)
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// For testing with api you need run storybook with custom port and host
|
|
178
|
-
// to prevent CORS issues for carCounter and manufacturer list requests:
|
|
179
|
-
// yarn storybook -p 8080 -h local.autode-dev.de
|
|
180
|
-
storiesOf('CompactSearchWidget', module)
|
|
181
|
-
.add('default', () => (
|
|
182
|
-
<div style={containerStyles}>
|
|
183
|
-
<div style={widget}>
|
|
184
|
-
<CompactWidgetContainer />
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
));
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import ContactForm from "./ContactForm";
|
|
3
|
-
import { storiesOf } from "@storybook/react";
|
|
4
|
-
import styles from './ContactForm.story.styl';
|
|
5
|
-
|
|
6
|
-
const ContactFormContainer = () => {
|
|
7
|
-
|
|
8
|
-
const [contactFormValues, setContactFormValues] = useState({
|
|
9
|
-
firstName: {
|
|
10
|
-
value: 'firstname',
|
|
11
|
-
type: 'text',
|
|
12
|
-
hasError: 'true',
|
|
13
|
-
error: 'this field is required',
|
|
14
|
-
name: 'firstName'
|
|
15
|
-
},
|
|
16
|
-
lastName: {
|
|
17
|
-
value: 'lastName',
|
|
18
|
-
type: 'text',
|
|
19
|
-
hasError: 'true',
|
|
20
|
-
error: 'this field is required',
|
|
21
|
-
name: 'lastName'
|
|
22
|
-
},
|
|
23
|
-
email: {
|
|
24
|
-
value: 'email',
|
|
25
|
-
type: 'text',
|
|
26
|
-
hasError: 'true',
|
|
27
|
-
error: 'this field is required',
|
|
28
|
-
name: 'email'
|
|
29
|
-
},
|
|
30
|
-
countryCode: {
|
|
31
|
-
value: 'countryCode',
|
|
32
|
-
type: 'text',
|
|
33
|
-
hasError: 'true',
|
|
34
|
-
error: 'this field is required',
|
|
35
|
-
name: 'countryCode',
|
|
36
|
-
extra: [10, 20, 30]
|
|
37
|
-
},
|
|
38
|
-
areaCode: {
|
|
39
|
-
value: 'areaCode',
|
|
40
|
-
type: 'text',
|
|
41
|
-
hasError: 'true',
|
|
42
|
-
error: 'this field is required',
|
|
43
|
-
name: 'areaCode'
|
|
44
|
-
},
|
|
45
|
-
phoneNumber: {
|
|
46
|
-
value: 'phoneNumber',
|
|
47
|
-
type: 'text',
|
|
48
|
-
hasError: 'true',
|
|
49
|
-
error: 'this field is required',
|
|
50
|
-
name: 'phoneNumber'
|
|
51
|
-
},
|
|
52
|
-
message: {
|
|
53
|
-
value: 'message',
|
|
54
|
-
type: 'text',
|
|
55
|
-
hasError: 'true',
|
|
56
|
-
error: 'this field is required',
|
|
57
|
-
name: 'message',
|
|
58
|
-
placeHolder: 'placeHolder'
|
|
59
|
-
},
|
|
60
|
-
checkBox: {
|
|
61
|
-
error: null,
|
|
62
|
-
hasError: true,
|
|
63
|
-
name: 'terms',
|
|
64
|
-
placeHolder: '',
|
|
65
|
-
type: 'checkbox',
|
|
66
|
-
value: false,
|
|
67
|
-
bind: () => {}
|
|
68
|
-
},
|
|
69
|
-
formIsValid: true
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
const config = {
|
|
73
|
-
recaptchaSiteKey: '6LdunNEaAAAAAB1DazkKJFN2CbCT7YbMfUZ80R6C'
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const contactFormProps = {
|
|
77
|
-
t: () => {},
|
|
78
|
-
carStore: {
|
|
79
|
-
formStatus: 'done'
|
|
80
|
-
},
|
|
81
|
-
contactFormValues,
|
|
82
|
-
config
|
|
83
|
-
}
|
|
84
|
-
return (
|
|
85
|
-
<ContactForm { ...contactFormProps }/>
|
|
86
|
-
)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
storiesOf('ContactForm', module)
|
|
90
|
-
.add('ContactForm', () => (
|
|
91
|
-
<>
|
|
92
|
-
<ContactFormContainer/>
|
|
93
|
-
</>
|
|
94
|
-
));
|
|
File without changes
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import { Container, Row, Col } from 'react-grid-system';
|
|
5
|
-
|
|
6
|
-
import ContactInfo from './ContactInfo';
|
|
7
|
-
|
|
8
|
-
const colStyle = {
|
|
9
|
-
outline: 'silver solid 1px'
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const props = {
|
|
13
|
-
t: key => key,
|
|
14
|
-
|
|
15
|
-
title: 1,
|
|
16
|
-
gender: 2,
|
|
17
|
-
street: 'Musterstraße',
|
|
18
|
-
number: '14',
|
|
19
|
-
streetAddition: 'A',
|
|
20
|
-
city: 'Musterstadt',
|
|
21
|
-
zip: '01234',
|
|
22
|
-
countryName: 'Deutschland',
|
|
23
|
-
firstName: 'Peter',
|
|
24
|
-
lastName: 'Mustermann',
|
|
25
|
-
company: 'Company',
|
|
26
|
-
email: 'email@email.com',
|
|
27
|
-
|
|
28
|
-
phoneMain: '(+49) 123 456789',
|
|
29
|
-
phoneMobile: '(+49) 341 456789',
|
|
30
|
-
|
|
31
|
-
ustIdNr: '122134',
|
|
32
|
-
|
|
33
|
-
website: 'www.mustermann.ag',
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
storiesOf('ContactInfo', module)
|
|
37
|
-
.add('default', () => (
|
|
38
|
-
<div style={{ width: 992 }}>
|
|
39
|
-
<Container fluid>
|
|
40
|
-
<Row>
|
|
41
|
-
<Col sm={6} style={colStyle}>
|
|
42
|
-
<ContactInfo {...props}/>
|
|
43
|
-
</Col>
|
|
44
|
-
<Col sm={6} style={colStyle}>
|
|
45
|
-
<ContactInfo {...props} company={undefined} phoneMain={undefined}/>
|
|
46
|
-
</Col>
|
|
47
|
-
</Row>
|
|
48
|
-
<Row>
|
|
49
|
-
<Col sm={6} style={colStyle}>
|
|
50
|
-
<ContactInfo {...props} ustIdNr={undefined} website={undefined} company={undefined}/>
|
|
51
|
-
</Col>
|
|
52
|
-
<Col sm={6} style={colStyle}>
|
|
53
|
-
<ContactInfo {...props} phones={undefined} streetAddress={undefined}/>
|
|
54
|
-
</Col>
|
|
55
|
-
</Row>
|
|
56
|
-
</Container>
|
|
57
|
-
</div>
|
|
58
|
-
));
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
// import { action } from '@storybook/addon-actions';
|
|
4
|
-
|
|
5
|
-
import CustomerQuote from './CustomerQuote';
|
|
6
|
-
|
|
7
|
-
const vertical = {
|
|
8
|
-
margin: '10px 0',
|
|
9
|
-
width: '220px',
|
|
10
|
-
backgroundColor: 'white'
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const horizontal = {
|
|
14
|
-
width: '375px',
|
|
15
|
-
backgroundColor: 'white'
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const verticalProps = {
|
|
19
|
-
image: 'http://placekitten.com/200/200',
|
|
20
|
-
name: 'First Last',
|
|
21
|
-
source: 'Kundenbewertung via Google',
|
|
22
|
-
review: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam, aperiam autem, culpa doloribus eum nesciunt nihil nulla officia quo ratione velit, vitae voluptatem. Consequuntur distinctio facilis minus necessitatibus possimus quisquam!'
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const horizontalProps = {
|
|
26
|
-
...verticalProps,
|
|
27
|
-
isHorizontal: true
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
storiesOf('CustomerQuote', module)
|
|
31
|
-
.add('CustomerQuote', () => (
|
|
32
|
-
<div>
|
|
33
|
-
<div style={vertical}>
|
|
34
|
-
<CustomerQuote {...verticalProps} />
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<div style={horizontal}>
|
|
38
|
-
<CustomerQuote {...horizontalProps} />
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
));
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
import styles from './CustomerQuotesSlider.story.styl';
|
|
4
|
-
import CustomerQuotesSlider from './CustomerQuotesSlider';
|
|
5
|
-
|
|
6
|
-
const quotes = [
|
|
7
|
-
{
|
|
8
|
-
id: Date.now().toString(),
|
|
9
|
-
image: 'http://placekitten.com/200/200',
|
|
10
|
-
name: 'First Last',
|
|
11
|
-
source: 'Kundenbewertung via Google',
|
|
12
|
-
review: '“BRückfragen wurden innerhalb kurzer Zeit telefonisch oder per Mail'
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
id: Date.now().toString(),
|
|
16
|
-
image: 'http://placekitten.com/200/200',
|
|
17
|
-
name: 'Klaus Andres',
|
|
18
|
-
source: 'Google Kundenbevertung',
|
|
19
|
-
review: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam, aperiam autem, culpa doloribus eum nesciunt nihil nulla officia quo ratione velit, vitae voluptatem.'
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: Date.now().toString(),
|
|
23
|
-
image: 'http://placekitten.com/200/200',
|
|
24
|
-
name: 'First Last',
|
|
25
|
-
source: 'Kundenbewertung via Google',
|
|
26
|
-
review: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam, aperiam autem, culpa doloribus eum nesciunt nihil nulla officia quo ratione velit, vitae voluptatem.'
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: Date.now().toString(),
|
|
30
|
-
image: 'http://placekitten.com/200/200',
|
|
31
|
-
name: 'First Last',
|
|
32
|
-
source: 'Kundenbewertung via Google',
|
|
33
|
-
review: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam, aperiam autem, culpa doloribus eum nesciunt nihil nulla officia quo ratione velit, vitae voluptatem.'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: Date.now().toString(),
|
|
37
|
-
image: 'http://placekitten.com/200/200',
|
|
38
|
-
name: 'First Last',
|
|
39
|
-
source: 'Kundenbewertung via Google',
|
|
40
|
-
review: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam, aperiam autem, culpa doloribus eum nesciunt nihil nulla officia quo ratione velit, vitae voluptatem.'
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: Date.now().toString(),
|
|
44
|
-
image: 'http://placekitten.com/200/200',
|
|
45
|
-
name: 'First Last',
|
|
46
|
-
source: 'Kundenbewertung via Google',
|
|
47
|
-
review: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquam, aperiam autem, culpa doloribus eum nesciunt nihil nulla officia quo ratione velit, vitae voluptatem.'
|
|
48
|
-
}
|
|
49
|
-
];
|
|
50
|
-
|
|
51
|
-
const props = {
|
|
52
|
-
quotes,
|
|
53
|
-
className: styles.multiContainer,
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const singleQuote = {
|
|
57
|
-
quotes,
|
|
58
|
-
className: styles.singleContainer,
|
|
59
|
-
slidesToShow: 1
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
storiesOf('CustomerQuotesSlider', module)
|
|
63
|
-
.add('CustomerQuotesSlider', () => (
|
|
64
|
-
<>
|
|
65
|
-
<div style={{ width: '100%', maxWidth: '716px', backgroundColor: 'white' }}>
|
|
66
|
-
<CustomerQuotesSlider {...props} />
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<div style={{ width: '100%', maxWidth: '380px', marginTop: '50px', backgroundColor: 'white' }}>
|
|
70
|
-
<CustomerQuotesSlider {...singleQuote} />
|
|
71
|
-
</div>
|
|
72
|
-
</>
|
|
73
|
-
));
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import FormattedNumber from './FormattedNumber';
|
|
5
|
-
|
|
6
|
-
const container = {
|
|
7
|
-
textAlign: 'left'
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const item = {
|
|
11
|
-
margin: '5px 0',
|
|
12
|
-
width: '500px',
|
|
13
|
-
display: 'flex',
|
|
14
|
-
justifyContent: 'space-between'
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const numbers = {
|
|
18
|
-
display: 'inline-flex',
|
|
19
|
-
flexDirection: 'row'
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const simpleStories = [
|
|
23
|
-
{
|
|
24
|
-
title: 'simple number, rounded',
|
|
25
|
-
props: {
|
|
26
|
-
value: 33.25
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
title: 'simple number, formatted, not rounded (small)',
|
|
31
|
-
props: {
|
|
32
|
-
value: 33.25,
|
|
33
|
-
toRound: false
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
title: 'simple number, formatted, not rounded (big)',
|
|
38
|
-
props: {
|
|
39
|
-
value: 55476.36,
|
|
40
|
-
toRound: false
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
title: 'simple number',
|
|
45
|
-
props: {
|
|
46
|
-
value: 123
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
title: 'fixed after two digits',
|
|
51
|
-
props: {
|
|
52
|
-
value: 325.54
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
title: 'big number, formatted',
|
|
57
|
-
props: {
|
|
58
|
-
value: 65800000
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
];
|
|
62
|
-
|
|
63
|
-
const specialCases = [
|
|
64
|
-
{
|
|
65
|
-
title: 'without props',
|
|
66
|
-
props: {}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
title: 'return original but formatted',
|
|
70
|
-
props: {
|
|
71
|
-
value: 3.99,
|
|
72
|
-
numbersAfterDot: 2,
|
|
73
|
-
toRound: false
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
title: 'return original number',
|
|
78
|
-
props: {
|
|
79
|
-
value: 325.59,
|
|
80
|
-
disableFormatting: true
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
storiesOf('Formatted Number', module)
|
|
86
|
-
.add('default', () => (
|
|
87
|
-
<div style={container}>
|
|
88
|
-
<div>
|
|
89
|
-
<h4>Simple cases</h4>
|
|
90
|
-
{simpleStories.map(({ title, props }, index) => (
|
|
91
|
-
<div style={item} key={index}>
|
|
92
|
-
<span>{title}</span>
|
|
93
|
-
<div style={numbers}>
|
|
94
|
-
<i>{props.value} >>> </i>
|
|
95
|
-
<FormattedNumber { ...props } />
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
))}
|
|
99
|
-
</div>
|
|
100
|
-
<div>
|
|
101
|
-
<h4>Special cases</h4>
|
|
102
|
-
{specialCases.map(({ title, props }, index) => (
|
|
103
|
-
<div style={item} key={index}>
|
|
104
|
-
<span>{title}</span>
|
|
105
|
-
<div style={numbers}>
|
|
106
|
-
<i>{props.value} >>> </i>
|
|
107
|
-
<FormattedNumber { ...props } />
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
))}
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
));
|
|
114
|
-
|