mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Add a prop type for filter config
This commit is contained in:
parent
ae2db17152
commit
3dec9983d4
4 changed files with 20 additions and 17 deletions
|
|
@ -9,6 +9,7 @@ import { omit } from 'lodash';
|
|||
import { SelectSingleFilter, SelectMultipleFilter } from '../../components';
|
||||
import routeConfiguration from '../../routeConfiguration';
|
||||
import { createResourceLocatorString } from '../../util/routes';
|
||||
import { propTypes } from '../../util/types';
|
||||
import css from './SearchFilters.css';
|
||||
|
||||
// Dropdown container can have a positional offset (in pixels)
|
||||
|
|
@ -166,8 +167,8 @@ SearchFiltersComponent.propTypes = {
|
|||
resultsCount: number,
|
||||
searchingInProgress: bool,
|
||||
onManageDisableScrolling: func.isRequired,
|
||||
categoriesFilter: object,
|
||||
amenitiesFilter: object,
|
||||
categoriesFilter: propTypes.filterConfig,
|
||||
amenitiesFilter: propTypes.filterConfig,
|
||||
isSearchFiltersPanelOpen: bool,
|
||||
toggleSearchFiltersPanel: func,
|
||||
searchFiltersPanelSelectedCount: number,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import {
|
|||
SelectSingleFilterPlain,
|
||||
SelectMultipleFilterPlain,
|
||||
} from '../../components';
|
||||
import { propTypes } from '../../util/types';
|
||||
import css from './SearchFiltersMobile.css';
|
||||
|
||||
class SearchFiltersMobileComponent extends Component {
|
||||
|
|
@ -248,8 +249,8 @@ SearchFiltersMobileComponent.propTypes = {
|
|||
onCloseModal: func.isRequired,
|
||||
selectedFiltersCount: number,
|
||||
filterParamNames: array,
|
||||
categoriesFilter: object,
|
||||
amenitiesFilter: object,
|
||||
categoriesFilter: propTypes.filterConfig,
|
||||
amenitiesFilter: propTypes.filterConfig,
|
||||
|
||||
// from injectIntl
|
||||
intl: intlShape.isRequired,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import { array, bool, func, number, object, objectOf, shape, string } from 'prop-types';
|
||||
import { array, bool, func, number, object, objectOf, string } from 'prop-types';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import classNames from 'classnames';
|
||||
import { merge } from 'lodash';
|
||||
|
|
@ -166,18 +166,8 @@ MainPanel.propTypes = {
|
|||
pagination: propTypes.pagination,
|
||||
searchParamsForPagination: object,
|
||||
showAsModalMaxWidth: number.isRequired,
|
||||
primaryFilters: objectOf(
|
||||
shape({
|
||||
paramName: string.isRequired,
|
||||
options: array.isRequired,
|
||||
})
|
||||
),
|
||||
secondaryFilters: objectOf(
|
||||
shape({
|
||||
paramName: string.isRequired,
|
||||
options: array.isRequired,
|
||||
})
|
||||
),
|
||||
primaryFilters: objectOf(propTypes.filterConfig),
|
||||
secondaryFilters: objectOf(propTypes.filterConfig),
|
||||
};
|
||||
|
||||
export default MainPanel;
|
||||
|
|
|
|||
|
|
@ -409,6 +409,17 @@ propTypes.pagination = shape({
|
|||
totalPages: number.isRequired,
|
||||
});
|
||||
|
||||
// Search filter definition
|
||||
propTypes.filterConfig = shape({
|
||||
paramName: string.isRequired,
|
||||
options: arrayOf(
|
||||
shape({
|
||||
key: oneOfType([string, bool, number]).isRequired,
|
||||
label: string.isRequired,
|
||||
})
|
||||
).isRequired,
|
||||
});
|
||||
|
||||
export const ERROR_CODE_TRANSACTION_LISTING_NOT_FOUND = 'transaction-listing-not-found';
|
||||
export const ERROR_CODE_TRANSACTION_INVALID_TRANSITION = 'transaction-invalid-transition';
|
||||
export const ERROR_CODE_TRANSACTION_ALREADY_REVIEWED_BY_CUSTOMER =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue