feat(ui) - filters - fixes
This commit is contained in:
parent
1e6768e153
commit
7d3103071e
5 changed files with 14 additions and 6 deletions
|
|
@ -88,7 +88,7 @@ export default class DateRangeDropdown extends React.PureComponent {
|
|||
<Icon name="chevron-down" color="gray-dark" size="14" className={styles.dropdownIcon} />
|
||||
</div> : null
|
||||
}
|
||||
selection={!button}
|
||||
// selection={!button}
|
||||
name="sessionDateRange"
|
||||
direction={ direction }
|
||||
className={ button ? "" : "customDropdown" }
|
||||
|
|
@ -97,8 +97,9 @@ export default class DateRangeDropdown extends React.PureComponent {
|
|||
icon={ null }
|
||||
>
|
||||
<Dropdown.Menu>
|
||||
{ options.map(props =>
|
||||
{ options.map((props, i) =>
|
||||
<Dropdown.Item
|
||||
key={i}
|
||||
{...props}
|
||||
onClick={this.onItemClick}
|
||||
active={props.value === value }
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ function FilterList(props: Props) {
|
|||
</div>
|
||||
{filters.map((filter, filterIndex) => filter.isEvent ? (
|
||||
<FilterItem
|
||||
key={filterIndex}
|
||||
filterIndex={rowIndex++}
|
||||
filter={filter}
|
||||
onUpdate={(filter) => props.onUpdateFilter(filterIndex, filter)}
|
||||
|
|
@ -72,6 +73,7 @@ function FilterList(props: Props) {
|
|||
<div className="mb-2 text-sm color-gray-medium mr-auto">FILTERS</div>
|
||||
{filters.map((filter, filterIndex) => !filter.isEvent ? (
|
||||
<FilterItem
|
||||
key={filterIndex}
|
||||
isFilter={true}
|
||||
filterIndex={filterIndex}
|
||||
filter={filter}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,11 @@ function FilterValue(props: Props) {
|
|||
|
||||
const onAddValue = () => {
|
||||
const newValues = filter.value.concat("")
|
||||
props.onUpdate({ ...filter, value: newValues })
|
||||
try {
|
||||
props.onUpdate({ ...filter.toData(), value: newValues })
|
||||
} catch (e) {
|
||||
props.onUpdate({ ...filter, value: newValues })
|
||||
}
|
||||
}
|
||||
|
||||
const onRemoveValue = (valueIndex) => {
|
||||
|
|
@ -69,6 +73,7 @@ function FilterValue(props: Props) {
|
|||
case FilterType.MULTIPLE_DROPDOWN:
|
||||
return (
|
||||
<FilterValueDropdown
|
||||
search={true}
|
||||
multiple={true}
|
||||
value={value}
|
||||
filter={filter}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ const reduceThenFetchResource = actionCreator => (...args) => (dispatch, getStat
|
|||
dispatch(actionCreator(...args));
|
||||
const filter = getState().getIn([ 'search', 'instance']).toData();
|
||||
filter.filters = filter.filters.map(filterMap);
|
||||
filter.isNew = true // TODO remove this line
|
||||
|
||||
return isRoute(ERRORS_ROUTE, window.location.pathname)
|
||||
? dispatch(fetchErrorsList(filter))
|
||||
|
|
@ -124,7 +123,8 @@ export const applyFilter = reduceThenFetchResource((filter, fromUrl=false) => ({
|
|||
}));
|
||||
|
||||
export const applySavedSearch = (filter) => (dispatch, getState) => {
|
||||
dispatch(edit(filter ? filter.filter : new Filter({ filters: []})));
|
||||
console.log('applySavedSearch', filter);
|
||||
dispatch(edit({ filters: filter ? filter.filter.filters : [] }));
|
||||
return dispatch({
|
||||
type: APPLY_SAVED_SEARCH,
|
||||
filter,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export const filtersMap = {
|
|||
[FilterKey.REVID]: { key: FilterKey.REVID, type: FilterType.MULTIPLE, category: FilterCategory.GEAR, label: 'RevId', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/rev-id' },
|
||||
[FilterKey.REFERRER]: { key: FilterKey.REFERRER, type: FilterType.MULTIPLE, category: FilterCategory.RECORDING_ATTRIBUTES, label: 'Referrer', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/referrer' },
|
||||
[FilterKey.DURATION]: { key: FilterKey.DURATION, type: FilterType.DURATION, category: FilterCategory.RECORDING_ATTRIBUTES, label: 'Duration', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/duration' },
|
||||
[FilterKey.USER_COUNTRY]: { key: FilterKey.USER_COUNTRY, type: FilterType.DROPDOWN, category: FilterCategory.RECORDING_ATTRIBUTES, label: 'User Country', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/country', options: countryOptions },
|
||||
[FilterKey.USER_COUNTRY]: { key: FilterKey.USER_COUNTRY, type: FilterType.MULTIPLE_DROPDOWN, category: FilterCategory.RECORDING_ATTRIBUTES, label: 'User Country', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/country', options: countryOptions },
|
||||
[FilterKey.CONSOLE]: { key: FilterKey.CONSOLE, type: FilterType.MULTIPLE, category: FilterCategory.JAVASCRIPT, label: 'Console', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/console' },
|
||||
[FilterKey.USERID]: { key: FilterKey.USERID, type: FilterType.MULTIPLE, category: FilterCategory.USER, label: 'User Id', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/userid' },
|
||||
[FilterKey.USERANONYMOUSID]: { key: FilterKey.USERANONYMOUSID, type: FilterType.MULTIPLE, category: FilterCategory.USER, label: 'User AnonymousId', operator: 'is', operatorOptions: filterOptions.stringOperators, icon: 'filters/userid' },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue