New: UI Updates, Tag manager, More custom filters (#437)

* New: UI Updates, Tag manager, More custom filters

* fixup! Fix ScanFixture Unit Tests

* Fixed: Sentry Errors from UI don't have release, branch, environment

* Changed: Bump Mobile Detect for New Device Detection

* Fixed: Build on changes to package.json

* fixup! Add MetadataProfile filter option

* fixup! Tag Note, Blacklist, Manual Import

* fixup: Remove connectSection

* fixup: root folder comment
This commit is contained in:
Qstick 2018-08-07 20:57:15 -04:00 committed by GitHub
parent afa78b1d20
commit 6581b3a2c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
198 changed files with 3057 additions and 888 deletions

View file

@ -1,37 +1,7 @@
import _ from 'lodash';
import { createSelector } from 'reselect';
import findSelectedFilters from 'Utilities/Filter/findSelectedFilters';
import { filterTypes, sortDirections } from 'Helpers/Props';
const filterTypePredicates = {
[filterTypes.CONTAINS]: function(value, filterValue) {
return value.toLowerCase().contains(filterValue.toLowerCase());
},
[filterTypes.EQUAL]: function(value, filterValue) {
return value === filterValue;
},
[filterTypes.GREATER_THAN]: function(value, filterValue) {
return value > filterValue;
},
[filterTypes.GREATER_THAN_OR_EQUAL]: function(value, filterValue) {
return value >= filterValue;
},
[filterTypes.LESS_THAN]: function(value, filterValue) {
return value < filterValue;
},
[filterTypes.LESS_THAN_OR_EQUAL]: function(value, filterValue) {
return value <= filterValue;
},
[filterTypes.NOT_EQUAL]: function(value, filterValue) {
return value !== filterValue;
}
};
import { filterTypePredicates, filterTypes, sortDirections } from 'Helpers/Props';
function getSortClause(sortKey, sortDirection, sortPredicates) {
if (sortPredicates && sortPredicates.hasOwnProperty(sortKey)) {
@ -124,10 +94,10 @@ function sort(items, state) {
return _.orderBy(items, clauses, orders);
}
function createClientSideCollectionSelector() {
function createClientSideCollectionSelector(section, uiSection) {
return createSelector(
(state, { section }) => _.get(state, section),
(state, { uiSection }) => _.get(state, uiSection),
(state) => _.get(state, section),
(state) => _.get(state, uiSection),
(sectionState, uiSectionState = {}) => {
const state = Object.assign({}, sectionState, uiSectionState);
@ -137,7 +107,8 @@ function createClientSideCollectionSelector() {
return {
...sectionState,
...uiSectionState,
items: sorted
items: sorted,
totalItems: state.items.length
};
}
);