From 1d5d5040105632b3841538884ffc6d0c4cda0f6f Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 13 Dec 2019 12:12:20 -0600 Subject: [PATCH 01/52] fix: disappearing filter bug --- src/components/ConnectedFilter/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ConnectedFilter/utils.js b/src/components/ConnectedFilter/utils.js index 8dce30bd..d64c78e3 100644 --- a/src/components/ConnectedFilter/utils.js +++ b/src/components/ConnectedFilter/utils.js @@ -45,6 +45,7 @@ export const getFilterSections = ( fields, fieldMapping, tabsOptions, initialTabsOptions, adminAppliedPreFilters, ) => { const sections = fields.map((field) => { + console.log('field: ', field); const overrideName = fieldMapping.find(entry => (entry.field === field)); const label = overrideName ? overrideName.name : capitalizeFirstLetter(field); @@ -65,7 +66,7 @@ export const getFilterSections = ( options: defaultOptions, }; }); - + console.log('returning from getFilterSections with ', sections); return sections; }; From 42adcdfb44fa95a0b413eae1dba9e4b07b88a606 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 13 Dec 2019 12:33:38 -0600 Subject: [PATCH 02/52] hay --- src/components/ConnectedFilter/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ConnectedFilter/utils.js b/src/components/ConnectedFilter/utils.js index d64c78e3..a9554bed 100644 --- a/src/components/ConnectedFilter/utils.js +++ b/src/components/ConnectedFilter/utils.js @@ -44,6 +44,7 @@ const capitalizeFirstLetter = (str) => { export const getFilterSections = ( fields, fieldMapping, tabsOptions, initialTabsOptions, adminAppliedPreFilters, ) => { + console.log('tabsOptions: ', tabsOptions); const sections = fields.map((field) => { console.log('field: ', field); const overrideName = fieldMapping.find(entry => (entry.field === field)); From dd2ca8bbf7bb2e20cc17e7a07b22fb0cf078a167 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 13 Dec 2019 13:26:37 -0600 Subject: [PATCH 03/52] hehe --- src/components/ConnectedFilter/index.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 5146e05a..405bbb13 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -69,6 +69,7 @@ class ConnectedFilter extends React.Component { */ getFilterTabs() { const processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); + console.log('processedTabsOptions: ', processedTabsOptions); if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( From b77dc462833503c5dce99209a0ed30f20ce4c513 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 13 Dec 2019 13:53:45 -0600 Subject: [PATCH 04/52] - --- src/components/ConnectedFilter/index.jsx | 1 + src/components/ConnectedFilter/utils.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 405bbb13..47fa2885 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -72,6 +72,7 @@ class ConnectedFilter extends React.Component { console.log('processedTabsOptions: ', processedTabsOptions); if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; + console.log('------------------'); const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( ({ }); const getSingleFilterOption = (histogramResult, initHistogramRes) => { + console.log('getSingleFilterOption: ', histogramResult); if (!histogramResult || !histogramResult.histogram) { throw new Error(`Error parsing field options ${JSON.stringify(histogramResult)}`); } @@ -33,6 +34,7 @@ const getSingleFilterOption = (histogramResult, initHistogramRes) => { count: item.count, accessible: item.accessible, })); + console.log("getSingleFilterOption textOptions: ", textOptions); return textOptions; }; @@ -44,9 +46,8 @@ const capitalizeFirstLetter = (str) => { export const getFilterSections = ( fields, fieldMapping, tabsOptions, initialTabsOptions, adminAppliedPreFilters, ) => { - console.log('tabsOptions: ', tabsOptions); + console.log('tabsOptions: ', tabsOptions.project_id.histogram); const sections = fields.map((field) => { - console.log('field: ', field); const overrideName = fieldMapping.find(entry => (entry.field === field)); const label = overrideName ? overrideName.name : capitalizeFirstLetter(field); @@ -67,7 +68,7 @@ export const getFilterSections = ( options: defaultOptions, }; }); - console.log('returning from getFilterSections with ', sections); + console.log('returning from getFilterSections with ', sections[0]); return sections; }; From 35da973387a53e44be2c72d953fbd1d8cc49af97 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 13 Dec 2019 14:41:52 -0600 Subject: [PATCH 05/52] hehe --- src/components/ConnectedFilter/index.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 47fa2885..98e01ae8 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -68,11 +68,13 @@ class ConnectedFilter extends React.Component { * component could do some pre-processing modification about filter. */ getFilterTabs() { + console.log('------------------'); + console.log('entering getFilterTabs with this.state.filter: ', this.state.filter); + console.log('inside getFilterTabs with receivedAggsData: ', this.state.receivedAggsData); const processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); - console.log('processedTabsOptions: ', processedTabsOptions); + console.log('processedTabsOptions: ', processedTabsOptions.project_id.histogram); if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; - console.log('------------------'); const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( )); + console.log('returning from getFilterTabs with this.state.filter: ', this.state.filter); return tabs; } From 8db7a743328ef45a84373402a7e4e00c8fb527cc Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 13 Dec 2019 14:46:59 -0600 Subject: [PATCH 06/52] ok --- src/components/ConnectedFilter/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 98e01ae8..d854abeb 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -72,7 +72,7 @@ class ConnectedFilter extends React.Component { console.log('entering getFilterTabs with this.state.filter: ', this.state.filter); console.log('inside getFilterTabs with receivedAggsData: ', this.state.receivedAggsData); const processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); - console.log('processedTabsOptions: ', processedTabsOptions.project_id.histogram); + console.log('processedTabsOptions: ', processedTabsOptions); if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( From 306112e0bb7b4df1cb64db9b1b22ef16cb50ca7c Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 18 Dec 2019 10:53:50 -0600 Subject: [PATCH 07/52] yeah --- src/components/ConnectedFilter/index.jsx | 1 + src/components/ConnectedFilter/utils.js | 8 ++++---- src/components/GuppyWrapper/index.jsx | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index d854abeb..ae96dfe3 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -135,6 +135,7 @@ class ConnectedFilter extends React.Component { if (this.props.onFilterChange) { this.props.onFilterChange(mergedFilterResults, this.state.accessibility); } + console.log('handleFilterChange - i want to set this.state.filter to ' , mergedFilterResults); } /** diff --git a/src/components/ConnectedFilter/utils.js b/src/components/ConnectedFilter/utils.js index 984c752b..09fc40aa 100644 --- a/src/components/ConnectedFilter/utils.js +++ b/src/components/ConnectedFilter/utils.js @@ -7,7 +7,7 @@ export const getFilterGroupConfig = filterConfig => ({ }); const getSingleFilterOption = (histogramResult, initHistogramRes) => { - console.log('getSingleFilterOption: ', histogramResult); + // console.log('getSingleFilterOption: ', histogramResult); if (!histogramResult || !histogramResult.histogram) { throw new Error(`Error parsing field options ${JSON.stringify(histogramResult)}`); } @@ -34,7 +34,7 @@ const getSingleFilterOption = (histogramResult, initHistogramRes) => { count: item.count, accessible: item.accessible, })); - console.log("getSingleFilterOption textOptions: ", textOptions); + // console.log("getSingleFilterOption textOptions: ", textOptions); return textOptions; }; @@ -46,7 +46,7 @@ const capitalizeFirstLetter = (str) => { export const getFilterSections = ( fields, fieldMapping, tabsOptions, initialTabsOptions, adminAppliedPreFilters, ) => { - console.log('tabsOptions: ', tabsOptions.project_id.histogram); + // console.log('tabsOptions: ', tabsOptions.project_id.histogram); const sections = fields.map((field) => { const overrideName = fieldMapping.find(entry => (entry.field === field)); const label = overrideName ? overrideName.name : capitalizeFirstLetter(field); @@ -68,7 +68,7 @@ export const getFilterSections = ( options: defaultOptions, }; }); - console.log('returning from getFilterSections with ', sections[0]); + // console.log('returning from getFilterSections with ', sections[0]); return sections; }; diff --git a/src/components/GuppyWrapper/index.jsx b/src/components/GuppyWrapper/index.jsx index 44c44f64..66e1e190 100644 --- a/src/components/GuppyWrapper/index.jsx +++ b/src/components/GuppyWrapper/index.jsx @@ -207,6 +207,7 @@ class GuppyWrapper extends React.Component { * This function uses current filter argument */ handleDownloadRawData(sort) { + console.log('inside handleDownloadRawData with this.state.filter: ', this.state.filter); return downloadDataFromGuppy( this.props.guppyConfig.path, this.props.guppyConfig.type, @@ -226,6 +227,7 @@ class GuppyWrapper extends React.Component { * This function uses current filter argument */ handleDownloadRawDataByFields({ fields, sort = [] }) { + console.log('inside handleDownloadRawDataByFields with this.state.filter: ', this.state.filter); let targetFields = fields; if (typeof fields === 'undefined') { targetFields = this.state.rawDataFields; @@ -285,6 +287,7 @@ class GuppyWrapper extends React.Component { } render() { + console.log('inside render with this.state.filter: ', this.state.filter); return ( { From 7d693af94f1ec1bb01d16fa416c72c8cb36428d8 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 18 Dec 2019 11:13:55 -0600 Subject: [PATCH 08/52] hay --- src/components/ConnectedFilter/index.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index ae96dfe3..910e8a03 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -32,6 +32,7 @@ class ConnectedFilter extends React.Component { accessibility: ENUM_ACCESSIBILITY.ALL, adminAppliedPreFilters: Object.assign({}, this.props.adminAppliedPreFilters), filter: Object.assign({}, this.props.adminAppliedPreFilters), + userFilter: Object.assign({}, this.props.adminAppliedPreFilters), }; this.filterGroupRef = React.createRef(); this.adminPreFiltersFrozen = JSON.stringify(this.props.adminAppliedPreFilters).slice(); @@ -135,7 +136,7 @@ class ConnectedFilter extends React.Component { if (this.props.onFilterChange) { this.props.onFilterChange(mergedFilterResults, this.state.accessibility); } - console.log('handleFilterChange - i want to set this.state.filter to ' , mergedFilterResults); + this.setState({ 'userFilter': mergedFilterResults }); } /** @@ -196,7 +197,7 @@ ConnectedFilter.propTypes = { ConnectedFilter.defaultProps = { onFilterChange: () => {}, onReceiveNewAggsData: () => {}, - hideZero: true, + hideZero: false, className: '', fieldMapping: [], tierAccessLimit: undefined, From 2103936e3df8b27b360a511ae9a60b84778b2d25 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 18 Dec 2019 11:49:01 -0600 Subject: [PATCH 09/52] whoa --- src/components/ConnectedFilter/index.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 910e8a03..7806d177 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -32,7 +32,7 @@ class ConnectedFilter extends React.Component { accessibility: ENUM_ACCESSIBILITY.ALL, adminAppliedPreFilters: Object.assign({}, this.props.adminAppliedPreFilters), filter: Object.assign({}, this.props.adminAppliedPreFilters), - userFilter: Object.assign({}, this.props.adminAppliedPreFilters), + initialTabsOptions: {}, }; this.filterGroupRef = React.createRef(); this.adminPreFiltersFrozen = JSON.stringify(this.props.adminAppliedPreFilters).slice(); @@ -74,6 +74,13 @@ class ConnectedFilter extends React.Component { console.log('inside getFilterTabs with receivedAggsData: ', this.state.receivedAggsData); const processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); console.log('processedTabsOptions: ', processedTabsOptions); + console.log('initialTabsOptions: ', this.state.initialTabsOptions); + if (Object.keys(this.state.initialTabsOptions).length == 0) { + this.setState({'initialTabsOptions' : processedTabsOptions}) + } + else { + processedTabsOptions = this.state.initialTabsOptions; + } if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( @@ -136,7 +143,6 @@ class ConnectedFilter extends React.Component { if (this.props.onFilterChange) { this.props.onFilterChange(mergedFilterResults, this.state.accessibility); } - this.setState({ 'userFilter': mergedFilterResults }); } /** From 040d36a071f5d085f703625024db2713bb7cda0d Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 18 Dec 2019 11:56:46 -0600 Subject: [PATCH 10/52] wow --- src/components/ConnectedFilter/index.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 7806d177..a8d74eaa 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -75,12 +75,12 @@ class ConnectedFilter extends React.Component { const processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); console.log('processedTabsOptions: ', processedTabsOptions); console.log('initialTabsOptions: ', this.state.initialTabsOptions); - if (Object.keys(this.state.initialTabsOptions).length == 0) { - this.setState({'initialTabsOptions' : processedTabsOptions}) - } - else { - processedTabsOptions = this.state.initialTabsOptions; - } + // if (Object.keys(this.state.initialTabsOptions).length == 0) { + // this.setState({'initialTabsOptions' : processedTabsOptions}) + // } + // else { + // processedTabsOptions = this.state.initialTabsOptions; + // } if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( From d1f09efcebe89a68a95c3f048161b85dbe4d26de Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 18 Dec 2019 13:40:22 -0600 Subject: [PATCH 11/52] hey --- src/components/ConnectedFilter/index.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index a8d74eaa..6d549f41 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -81,6 +81,7 @@ class ConnectedFilter extends React.Component { // else { // processedTabsOptions = this.state.initialTabsOptions; // } + processedTabsOptions = this.state.initialTabsOptions; if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( @@ -159,6 +160,7 @@ class ConnectedFilter extends React.Component { if (!filterTabs || filterTabs.length === 0) { return null; } + console.log('guppy render filterTabs: ', filterTabs); return ( Date: Wed, 18 Dec 2019 13:46:54 -0600 Subject: [PATCH 12/52] o --- src/components/ConnectedFilter/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 6d549f41..7600acdd 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -81,7 +81,7 @@ class ConnectedFilter extends React.Component { // else { // processedTabsOptions = this.state.initialTabsOptions; // } - processedTabsOptions = this.state.initialTabsOptions; + // processedTabsOptions = this.state.initialTabsOptions; if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( From 950a6ab215476a6766717f61594464d01db89651 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 18 Dec 2019 13:59:20 -0600 Subject: [PATCH 13/52] o --- src/components/ConnectedFilter/index.jsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 7600acdd..703de99f 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -25,6 +25,7 @@ class ConnectedFilter extends React.Component { ? _.union(filterConfigsFields, props.accessibleFieldCheckList) : filterConfigsFields; + this.initialTabsOptions = {}; this.state = { allFields, initialAggsData: {}, @@ -32,7 +33,6 @@ class ConnectedFilter extends React.Component { accessibility: ENUM_ACCESSIBILITY.ALL, adminAppliedPreFilters: Object.assign({}, this.props.adminAppliedPreFilters), filter: Object.assign({}, this.props.adminAppliedPreFilters), - initialTabsOptions: {}, }; this.filterGroupRef = React.createRef(); this.adminPreFiltersFrozen = JSON.stringify(this.props.adminAppliedPreFilters).slice(); @@ -72,16 +72,16 @@ class ConnectedFilter extends React.Component { console.log('------------------'); console.log('entering getFilterTabs with this.state.filter: ', this.state.filter); console.log('inside getFilterTabs with receivedAggsData: ', this.state.receivedAggsData); - const processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); + var processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); console.log('processedTabsOptions: ', processedTabsOptions); - console.log('initialTabsOptions: ', this.state.initialTabsOptions); - // if (Object.keys(this.state.initialTabsOptions).length == 0) { - // this.setState({'initialTabsOptions' : processedTabsOptions}) - // } - // else { - // processedTabsOptions = this.state.initialTabsOptions; - // } - // processedTabsOptions = this.state.initialTabsOptions; + console.log('initialTabsOptions: ', this.initialTabsOptions); + if (Object.keys(this.initialTabsOptions).length == 0) { + this.initialTabsOptions = processedTabsOptions; + } + else { + processedTabsOptions = this.initialTabsOptions; + } + // processedTabsOptions = this.initialTabsOptions; if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( From 5838ab5767c2a1344dcd26a9ee1a89856f241d4c Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 18 Dec 2019 14:11:51 -0600 Subject: [PATCH 14/52] o --- src/components/ConnectedFilter/index.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 703de99f..29796ab7 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -76,9 +76,11 @@ class ConnectedFilter extends React.Component { console.log('processedTabsOptions: ', processedTabsOptions); console.log('initialTabsOptions: ', this.initialTabsOptions); if (Object.keys(this.initialTabsOptions).length == 0) { + console.log('a; setting initialTabsOptions to ', processedTabsOptions); this.initialTabsOptions = processedTabsOptions; } else { + console.log('b; setting processedTabsOptions to ', initialTabsOptions); processedTabsOptions = this.initialTabsOptions; } // processedTabsOptions = this.initialTabsOptions; From e9374f936903f8b6e0defd62ecacb4842eba3b57 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 18 Dec 2019 14:17:54 -0600 Subject: [PATCH 15/52] o --- src/components/ConnectedFilter/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 29796ab7..3b986d2a 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -80,7 +80,7 @@ class ConnectedFilter extends React.Component { this.initialTabsOptions = processedTabsOptions; } else { - console.log('b; setting processedTabsOptions to ', initialTabsOptions); + console.log('b; setting processedTabsOptions to ', this.initialTabsOptions); processedTabsOptions = this.initialTabsOptions; } // processedTabsOptions = this.initialTabsOptions; From bf4a06526c68529ca3ab88c72f49b8f7e0a2cf3c Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 18 Dec 2019 15:37:27 -0600 Subject: [PATCH 16/52] o --- src/components/ConnectedFilter/index.jsx | 46 +++++++++++++++++++----- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 3b986d2a..37e181b2 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -61,6 +61,31 @@ class ConnectedFilter extends React.Component { }); } + /** + * This function updates the counts in the initial set of tab options calculated from unfiltered data. + * It is used to retain field options in the rendering even if those options have no histogram results. + */ + updateCountsInInitialTabsOptions(initialTabsOptions, processedTabsOptions) { + let updatedTabsOptions = JSON.parse(JSON.stringify(initialTabsOptions)); + + let initialFields = Object.keys(initialTabsOptions); + for (let i = 0; i < initialFields; i++) { + let fieldName = initialFields[i]; + let initialFieldOptions = initialTabsOptions[fieldName].histogram.map(x => x.key); + let processedFieldOptions = processedTabsOptions[fieldName].histogram.map(x => x.key); + for (let j = 0; j < initialFieldOptions.length; j++) { + let optionName = initialFieldOptions[j]; + if (processedFieldOptions.includes(optionName)) { + updatedFieldOptions[fieldName].histogram[j] = processedFieldOptions[fieldName].histogram[j]; + } else { + updatedFieldOptions[fieldName] = 0; + } + } + updatedTabsOptions[fieldName] = updatedFieldOptions; + } + return updatedTabsOptions; + } + /** * This function contains partial rendering logic for filter components. * It transfers aggregation data (`this.state.receivedAggsData`) to items inside filters. @@ -72,17 +97,22 @@ class ConnectedFilter extends React.Component { console.log('------------------'); console.log('entering getFilterTabs with this.state.filter: ', this.state.filter); console.log('inside getFilterTabs with receivedAggsData: ', this.state.receivedAggsData); - var processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); - console.log('processedTabsOptions: ', processedTabsOptions); + let updatedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); + console.log('updatedTabsOptions: ', updatedTabsOptions); console.log('initialTabsOptions: ', this.initialTabsOptions); if (Object.keys(this.initialTabsOptions).length == 0) { - console.log('a; setting initialTabsOptions to ', processedTabsOptions); - this.initialTabsOptions = processedTabsOptions; - } - else { - console.log('b; setting processedTabsOptions to ', this.initialTabsOptions); - processedTabsOptions = this.initialTabsOptions; + console.log('a; setting initialTabsOptions to ', updatedTabsOptions); + this.initialTabsOptions = updatedTabsOptions; } + + let processedTabsOptions = this.updateCountsInInitialTabsOptions( + this.initialTabsOptions, updatedTabsOptions + ); + + // else { + // console.log('b; setting processedTabsOptions to ', this.initialTabsOptions); + // processedTabsOptions = this.initialTabsOptions; + // } // processedTabsOptions = this.initialTabsOptions; if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; From f1c9102cdc2a9ca940993607329b96b6b7f051e3 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 09:29:41 -0600 Subject: [PATCH 17/52] oo --- src/components/ConnectedFilter/index.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 37e181b2..dba18c95 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -108,6 +108,7 @@ class ConnectedFilter extends React.Component { let processedTabsOptions = this.updateCountsInInitialTabsOptions( this.initialTabsOptions, updatedTabsOptions ); + console.log('reSULT OF MY FUnCTION: ', processedTabsOptions); // else { // console.log('b; setting processedTabsOptions to ', this.initialTabsOptions); From c5dad641650ef93528dbb510f9b69984b5c8c34a Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 13:54:33 -0600 Subject: [PATCH 18/52] wrote unit test got it passing --- src/components/ConnectedFilter/index.jsx | 29 ++-------------- src/components/Utils/filters.js | 35 +++++++++++++++++++ src/components/__tests__/filters.test.js | 44 +++++++++++++++++++++++- 3 files changed, 80 insertions(+), 28 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index dba18c95..e95d0483 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -14,7 +14,7 @@ import { askGuppyForAggregationData, getAllFieldsFromFilterConfigs, } from '../Utils/queries'; -import { mergeFilters } from '../Utils/filters'; +import { mergeFilters, updateCountsInInitialTabsOptions } from '../Utils/filters'; class ConnectedFilter extends React.Component { constructor(props) { @@ -61,31 +61,6 @@ class ConnectedFilter extends React.Component { }); } - /** - * This function updates the counts in the initial set of tab options calculated from unfiltered data. - * It is used to retain field options in the rendering even if those options have no histogram results. - */ - updateCountsInInitialTabsOptions(initialTabsOptions, processedTabsOptions) { - let updatedTabsOptions = JSON.parse(JSON.stringify(initialTabsOptions)); - - let initialFields = Object.keys(initialTabsOptions); - for (let i = 0; i < initialFields; i++) { - let fieldName = initialFields[i]; - let initialFieldOptions = initialTabsOptions[fieldName].histogram.map(x => x.key); - let processedFieldOptions = processedTabsOptions[fieldName].histogram.map(x => x.key); - for (let j = 0; j < initialFieldOptions.length; j++) { - let optionName = initialFieldOptions[j]; - if (processedFieldOptions.includes(optionName)) { - updatedFieldOptions[fieldName].histogram[j] = processedFieldOptions[fieldName].histogram[j]; - } else { - updatedFieldOptions[fieldName] = 0; - } - } - updatedTabsOptions[fieldName] = updatedFieldOptions; - } - return updatedTabsOptions; - } - /** * This function contains partial rendering logic for filter components. * It transfers aggregation data (`this.state.receivedAggsData`) to items inside filters. @@ -105,7 +80,7 @@ class ConnectedFilter extends React.Component { this.initialTabsOptions = updatedTabsOptions; } - let processedTabsOptions = this.updateCountsInInitialTabsOptions( + let processedTabsOptions = updateCountsInInitialTabsOptions( this.initialTabsOptions, updatedTabsOptions ); console.log('reSULT OF MY FUnCTION: ', processedTabsOptions); diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 3491b87b..86652585 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -31,3 +31,38 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { return filterAB; }; + +/** + * This function updates the counts in the initial set of tab options calculated from unfiltered data. + * It is used to retain field options in the rendering even if those options have no histogram results. + */ + export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTabsOptions) => { + let updatedTabsOptions = JSON.parse(JSON.stringify(initialTabsOptions)); + let initialFields = Object.keys(initialTabsOptions); + for (let i = 0; i < initialFields.length; i++) { + let fieldName = initialFields[i]; + let initialFieldOptions = initialTabsOptions[fieldName].histogram.map(x => x.key); + let processedFieldOptions = []; + if (processedTabsOptions.hasOwnProperty(fieldName)) { + processedFieldOptions = processedTabsOptions[fieldName].histogram.map(x => x.key); + } + + let updatedFieldOptions = JSON.parse(JSON.stringify(initialFieldOptions)); + for (let j = 0; j < initialFieldOptions.length; j++) { + let optionName = initialFieldOptions[j]; + let newCount; + if (processedFieldOptions.includes(optionName)) { + newCount = processedTabsOptions[fieldName].histogram.filter(x => x.key == optionName)[0].count; + } else { + newCount = 0; + } + for(let k = 0; k < updatedTabsOptions[fieldName].histogram.length; k++) { + let option = updatedTabsOptions[fieldName].histogram[k]; + if (option.key == optionName) { + updatedTabsOptions[fieldName].histogram[k].count = newCount; + } + } + } + } + return updatedTabsOptions; + }; \ No newline at end of file diff --git a/src/components/__tests__/filters.test.js b/src/components/__tests__/filters.test.js index 0083ddbd..d4688182 100644 --- a/src/components/__tests__/filters.test.js +++ b/src/components/__tests__/filters.test.js @@ -1,6 +1,6 @@ /* eslint-disable global-require,import/no-dynamic-require */ // Tests for Utils/filters.js -import { mergeFilters } from '../Utils/filters'; +import { mergeFilters, updateCountsInInitialTabsOptions } from '../Utils/filters'; describe('can merge simple selectedValue filters', () => { const userFilter = { data_format: { selectedValues: ['VCF'] } }; @@ -60,3 +60,45 @@ describe('will select user-applied filter for a given key if it is more exclusiv .toEqual(mergedFilterExpected); }); }); + + +describe('can update a small set of tabs with new counts', () => { + const initialTabsOptions = { + "annotated_sex": { 'histogram': [ + {key: "yellow", count: 137675}, + {key: "pink", count: 56270}, + {key: "orange", count: 107574} + ]}, + "extra_data": { 'histogram': [ + {key: "a", count: 2} + ]} + }; + + const processedTabsOptions = { + "annotated_sex": { 'histogram': [ + {key: "yellow", count: 1}, + {key: "orange", count: 107574} + ]}, + "extra_data": { 'histogram': [] } + }; + + const expectedUpdatedTabsOptions = { + "annotated_sex": { 'histogram': [ + {key: "yellow", count: 1}, + {key: "pink", count: 0}, + {key: "orange", count: 107574} + ]}, + "extra_data": { 'histogram': [ + {key: "a", count: 0} + ]} + }; + + const actualUpdatedTabsOptions = updateCountsInInitialTabsOptions( + initialTabsOptions, processedTabsOptions + ); + + test('merge filters', async () => { + expect(expectedUpdatedTabsOptions) + .toEqual(actualUpdatedTabsOptions); + }); +}); From f8a3ef5070f712f6aff99fec83fb3a6dbbe3bf48 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 14:01:25 -0600 Subject: [PATCH 19/52] - --- src/components/ConnectedFilter/index.jsx | 15 --------------- src/components/GuppyWrapper/index.jsx | 3 --- 2 files changed, 18 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index e95d0483..b1373869 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -69,27 +69,14 @@ class ConnectedFilter extends React.Component { * component could do some pre-processing modification about filter. */ getFilterTabs() { - console.log('------------------'); - console.log('entering getFilterTabs with this.state.filter: ', this.state.filter); - console.log('inside getFilterTabs with receivedAggsData: ', this.state.receivedAggsData); let updatedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); - console.log('updatedTabsOptions: ', updatedTabsOptions); - console.log('initialTabsOptions: ', this.initialTabsOptions); if (Object.keys(this.initialTabsOptions).length == 0) { - console.log('a; setting initialTabsOptions to ', updatedTabsOptions); this.initialTabsOptions = updatedTabsOptions; } let processedTabsOptions = updateCountsInInitialTabsOptions( this.initialTabsOptions, updatedTabsOptions ); - console.log('reSULT OF MY FUnCTION: ', processedTabsOptions); - - // else { - // console.log('b; setting processedTabsOptions to ', this.initialTabsOptions); - // processedTabsOptions = this.initialTabsOptions; - // } - // processedTabsOptions = this.initialTabsOptions; if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( @@ -104,7 +91,6 @@ class ConnectedFilter extends React.Component { disabledTooltipMessage={this.props.disabledTooltipMessage} /> )); - console.log('returning from getFilterTabs with this.state.filter: ', this.state.filter); return tabs; } @@ -168,7 +154,6 @@ class ConnectedFilter extends React.Component { if (!filterTabs || filterTabs.length === 0) { return null; } - console.log('guppy render filterTabs: ', filterTabs); return ( { From cd5c2f2c364ba954607f8cd3a846c69d6b04e12b Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 14:29:29 -0600 Subject: [PATCH 20/52] chore: eslint --- src/components/ConnectedFilter/index.jsx | 10 ++-- src/components/Utils/filters.js | 59 +++++++++++++----------- src/components/__tests__/filters.test.js | 58 +++++++++++++---------- 3 files changed, 70 insertions(+), 57 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index b1373869..57ce20b8 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -69,13 +69,13 @@ class ConnectedFilter extends React.Component { * component could do some pre-processing modification about filter. */ getFilterTabs() { - let updatedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); - if (Object.keys(this.initialTabsOptions).length == 0) { + const updatedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); + if (Object.keys(this.initialTabsOptions).length === 0) { this.initialTabsOptions = updatedTabsOptions; } - - let processedTabsOptions = updateCountsInInitialTabsOptions( - this.initialTabsOptions, updatedTabsOptions + + const processedTabsOptions = updateCountsInInitialTabsOptions( + this.initialTabsOptions, updatedTabsOptions, ); if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 86652585..19c94b9c 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -33,36 +33,39 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { }; /** - * This function updates the counts in the initial set of tab options calculated from unfiltered data. - * It is used to retain field options in the rendering even if those options have no histogram results. + * This function updates the counts in the initial set of tab options + * calculated from unfiltered data. + * It is used to retain field options in the rendering even if + * those options have no histogram results. */ - export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTabsOptions) => { - let updatedTabsOptions = JSON.parse(JSON.stringify(initialTabsOptions)); - let initialFields = Object.keys(initialTabsOptions); - for (let i = 0; i < initialFields.length; i++) { - let fieldName = initialFields[i]; - let initialFieldOptions = initialTabsOptions[fieldName].histogram.map(x => x.key); - let processedFieldOptions = []; - if (processedTabsOptions.hasOwnProperty(fieldName)) { - processedFieldOptions = processedTabsOptions[fieldName].histogram.map(x => x.key); +export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTabsOptions) => { + const updatedTabsOptions = JSON.parse(JSON.stringify(initialTabsOptions)); + const initialFields = Object.keys(initialTabsOptions); + for (let i = 0; i < initialFields.length; i += 1) { + const fieldName = initialFields[i]; + const initialFieldOptions = initialTabsOptions[fieldName].histogram.map(x => x.key); + let processedFieldOptions = []; + if (Object.prototype.hasOwnProperty.call(processedTabsOptions, fieldName)) { + processedFieldOptions = processedTabsOptions[fieldName].histogram.map(x => x.key); + } + + for (let j = 0; j < initialFieldOptions.length; j += 1) { + const optionName = initialFieldOptions[j]; + let newCount; + if (processedFieldOptions.includes(optionName)) { + newCount = processedTabsOptions[fieldName].histogram.filter( + x => x.key === optionName, + )[0].count; + } else { + newCount = 0; } - - let updatedFieldOptions = JSON.parse(JSON.stringify(initialFieldOptions)); - for (let j = 0; j < initialFieldOptions.length; j++) { - let optionName = initialFieldOptions[j]; - let newCount; - if (processedFieldOptions.includes(optionName)) { - newCount = processedTabsOptions[fieldName].histogram.filter(x => x.key == optionName)[0].count; - } else { - newCount = 0; - } - for(let k = 0; k < updatedTabsOptions[fieldName].histogram.length; k++) { - let option = updatedTabsOptions[fieldName].histogram[k]; - if (option.key == optionName) { - updatedTabsOptions[fieldName].histogram[k].count = newCount; - } + for (let k = 0; k < updatedTabsOptions[fieldName].histogram.length; k += 1) { + const option = updatedTabsOptions[fieldName].histogram[k]; + if (option.key === optionName) { + updatedTabsOptions[fieldName].histogram[k].count = newCount; } } } - return updatedTabsOptions; - }; \ No newline at end of file + } + return updatedTabsOptions; +}; diff --git a/src/components/__tests__/filters.test.js b/src/components/__tests__/filters.test.js index d4688182..0cb2e1b6 100644 --- a/src/components/__tests__/filters.test.js +++ b/src/components/__tests__/filters.test.js @@ -64,41 +64,51 @@ describe('will select user-applied filter for a given key if it is more exclusiv describe('can update a small set of tabs with new counts', () => { const initialTabsOptions = { - "annotated_sex": { 'histogram': [ - {key: "yellow", count: 137675}, - {key: "pink", count: 56270}, - {key: "orange", count: 107574} - ]}, - "extra_data": { 'histogram': [ - {key: "a", count: 2} - ]} + annotated_sex: { + histogram: [ + { key: 'yellow', count: 137675 }, + { key: 'pink', count: 56270 }, + { key: 'orange', count: 107574 }, + ], + }, + extra_data: { + histogram: [ + { key: 'a', count: 2 }, + ], + }, }; const processedTabsOptions = { - "annotated_sex": { 'histogram': [ - {key: "yellow", count: 1}, - {key: "orange", count: 107574} - ]}, - "extra_data": { 'histogram': [] } + annotated_sex: { + histogram: [ + { key: 'yellow', count: 1 }, + { key: 'orange', count: 107574 }, + ], + }, + extra_data: { histogram: [] }, }; const expectedUpdatedTabsOptions = { - "annotated_sex": { 'histogram': [ - {key: "yellow", count: 1}, - {key: "pink", count: 0}, - {key: "orange", count: 107574} - ]}, - "extra_data": { 'histogram': [ - {key: "a", count: 0} - ]} + annotated_sex: { + histogram: [ + { key: 'yellow', count: 1 }, + { key: 'pink', count: 0 }, + { key: 'orange', count: 107574 }, + ], + }, + extra_data: { + histogram: [ + { key: 'a', count: 0 }, + ], + }, }; - + const actualUpdatedTabsOptions = updateCountsInInitialTabsOptions( - initialTabsOptions, processedTabsOptions + initialTabsOptions, processedTabsOptions, ); test('merge filters', async () => { expect(expectedUpdatedTabsOptions) - .toEqual(actualUpdatedTabsOptions); + .toEqual(actualUpdatedTabsOptions); }); }); From 28b07bdfa0d831ce46f055129757a4e0a874ab19 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 14:31:41 -0600 Subject: [PATCH 21/52] - --- src/components/ConnectedFilter/utils.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/ConnectedFilter/utils.js b/src/components/ConnectedFilter/utils.js index 09fc40aa..731f9aec 100644 --- a/src/components/ConnectedFilter/utils.js +++ b/src/components/ConnectedFilter/utils.js @@ -46,7 +46,6 @@ const capitalizeFirstLetter = (str) => { export const getFilterSections = ( fields, fieldMapping, tabsOptions, initialTabsOptions, adminAppliedPreFilters, ) => { - // console.log('tabsOptions: ', tabsOptions.project_id.histogram); const sections = fields.map((field) => { const overrideName = fieldMapping.find(entry => (entry.field === field)); const label = overrideName ? overrideName.name : capitalizeFirstLetter(field); @@ -68,7 +67,6 @@ export const getFilterSections = ( options: defaultOptions, }; }); - // console.log('returning from getFilterSections with ', sections[0]); return sections; }; From 96802f40e65b37c4760740d88f6eda1d778f0931 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 14:32:27 -0600 Subject: [PATCH 22/52] - --- src/components/ConnectedFilter/utils.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/ConnectedFilter/utils.js b/src/components/ConnectedFilter/utils.js index 731f9aec..83c54b3b 100644 --- a/src/components/ConnectedFilter/utils.js +++ b/src/components/ConnectedFilter/utils.js @@ -7,7 +7,6 @@ export const getFilterGroupConfig = filterConfig => ({ }); const getSingleFilterOption = (histogramResult, initHistogramRes) => { - // console.log('getSingleFilterOption: ', histogramResult); if (!histogramResult || !histogramResult.histogram) { throw new Error(`Error parsing field options ${JSON.stringify(histogramResult)}`); } @@ -34,7 +33,6 @@ const getSingleFilterOption = (histogramResult, initHistogramRes) => { count: item.count, accessible: item.accessible, })); - // console.log("getSingleFilterOption textOptions: ", textOptions); return textOptions; }; From c2f18c630ccd1b31d40c1c6934eae1e1b2f186e5 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 14:34:31 -0600 Subject: [PATCH 23/52] hey --- src/components/__tests__/filters.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/__tests__/filters.test.js b/src/components/__tests__/filters.test.js index 0cb2e1b6..e366f605 100644 --- a/src/components/__tests__/filters.test.js +++ b/src/components/__tests__/filters.test.js @@ -107,7 +107,7 @@ describe('can update a small set of tabs with new counts', () => { initialTabsOptions, processedTabsOptions, ); - test('merge filters', async () => { + test('update tab counts', async () => { expect(expectedUpdatedTabsOptions) .toEqual(actualUpdatedTabsOptions); }); From 6ca5f08571aee164bbd467a88cb6ba32360ed353 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 15:04:05 -0600 Subject: [PATCH 24/52] revert this commit --- src/components/ConnectedFilter/index.jsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 57ce20b8..ccfbf472 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -69,14 +69,14 @@ class ConnectedFilter extends React.Component { * component could do some pre-processing modification about filter. */ getFilterTabs() { - const updatedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); - if (Object.keys(this.initialTabsOptions).length === 0) { - this.initialTabsOptions = updatedTabsOptions; - } + const processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); + // if (Object.keys(this.initialTabsOptions).length === 0) { + // this.initialTabsOptions = updatedTabsOptions; + // } - const processedTabsOptions = updateCountsInInitialTabsOptions( - this.initialTabsOptions, updatedTabsOptions, - ); + // const processedTabsOptions = updateCountsInInitialTabsOptions( + // this.initialTabsOptions, updatedTabsOptions, + // ); if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( From 8fac89559640ea6608610f4b7b519b89245d4a42 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 15:08:05 -0600 Subject: [PATCH 25/52] reverted that commit --- src/components/ConnectedFilter/index.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index ccfbf472..a985462e 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -69,14 +69,14 @@ class ConnectedFilter extends React.Component { * component could do some pre-processing modification about filter. */ getFilterTabs() { - const processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); - // if (Object.keys(this.initialTabsOptions).length === 0) { - // this.initialTabsOptions = updatedTabsOptions; - // } + const updatedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); + if (Object.keys(this.initialTabsOptions).length === 0) { + this.initialTabsOptions = updatedTabsOptions; + } - // const processedTabsOptions = updateCountsInInitialTabsOptions( - // this.initialTabsOptions, updatedTabsOptions, - // ); + const processedTabsOptions = updateCountsInInitialTabsOptions( + this.initialTabsOptions, updatedTabsOptions, + ); if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( @@ -198,7 +198,7 @@ ConnectedFilter.propTypes = { ConnectedFilter.defaultProps = { onFilterChange: () => {}, onReceiveNewAggsData: () => {}, - hideZero: false, + hideZero: true, className: '', fieldMapping: [], tierAccessLimit: undefined, From 04a568c1f7899cf72bff2efa48f3bf0745e41d82 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 20 Dec 2019 15:11:58 -0600 Subject: [PATCH 26/52] turns out hideZero is necessary --- src/components/ConnectedFilter/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index a985462e..57ce20b8 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -198,7 +198,7 @@ ConnectedFilter.propTypes = { ConnectedFilter.defaultProps = { onFilterChange: () => {}, onReceiveNewAggsData: () => {}, - hideZero: true, + hideZero: false, className: '', fieldMapping: [], tierAccessLimit: undefined, From 77459021685df5f0ffee6f2ed2310201576e62f3 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Thu, 2 Jan 2020 10:16:23 -0600 Subject: [PATCH 27/52] sorting tab options, added unit test --- src/components/ConnectedFilter/index.jsx | 7 +++- src/components/Utils/filters.js | 44 ++++++++++++++++++++ src/components/__tests__/filters.test.js | 52 +++++++++++++++++++++++- 3 files changed, 100 insertions(+), 3 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 57ce20b8..da2185b6 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -14,7 +14,7 @@ import { askGuppyForAggregationData, getAllFieldsFromFilterConfigs, } from '../Utils/queries'; -import { mergeFilters, updateCountsInInitialTabsOptions } from '../Utils/filters'; +import { mergeFilters, updateCountsInInitialTabsOptions, sortTabsOptions } from '../Utils/filters'; class ConnectedFilter extends React.Component { constructor(props) { @@ -74,9 +74,12 @@ class ConnectedFilter extends React.Component { this.initialTabsOptions = updatedTabsOptions; } - const processedTabsOptions = updateCountsInInitialTabsOptions( + let processedTabsOptions = updateCountsInInitialTabsOptions( this.initialTabsOptions, updatedTabsOptions, ); + + processedTabsOptions = sortTabsOptions(processedTabsOptions); + if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 19c94b9c..cbf4b3a8 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -69,3 +69,47 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa } return updatedTabsOptions; }; + +export const sortTabsOptions = (tabsOptions) => { + const fields = Object.keys(tabsOptions); + const sortedTabsOptions = {}; + for (let x = 0; x < fields.length; x += 1) { + let field = fields[x]; + + const optionsForThisField = tabsOptions[field].histogram; + + // Make { count -> [keys with this count] } dictionary + const countToKeys = {}; + for (let i = 0; i < optionsForThisField.length; i += 1) { + let keyName = optionsForThisField[i].key; + let count = optionsForThisField[i].count; + if (countToKeys.hasOwnProperty(count)) { + countToKeys[count].push(keyName); + } else { + countToKeys[count] = [ keyName ]; + } + } + + // Sort the keys in each count + const countKeys = Object.keys(countToKeys); + for (let j = 0; j < countKeys.length; j += 1) { + countToKeys[countKeys[j]].sort(); // Alphabetically ascending order + } + + // Sort the count-groups + countKeys.sort(); + countKeys.reverse(); // Numerically descending order + sortedTabsOptions[field] = {"histogram": [] } + for (let k = 0; k < countKeys.length; k += 1) { + let fieldsAtThisCount = countToKeys[countKeys[k]]; + for (let m = 0; m < fieldsAtThisCount.length; m += 1) { + let keyForCount = countToKeys[countKeys[k]][m]; + sortedTabsOptions[field].histogram.push({ + 'key': keyForCount, + 'count': parseInt(countKeys[k]) + }); + } + } + } + return sortedTabsOptions; +} \ No newline at end of file diff --git a/src/components/__tests__/filters.test.js b/src/components/__tests__/filters.test.js index e366f605..81bc7a5c 100644 --- a/src/components/__tests__/filters.test.js +++ b/src/components/__tests__/filters.test.js @@ -1,6 +1,6 @@ /* eslint-disable global-require,import/no-dynamic-require */ // Tests for Utils/filters.js -import { mergeFilters, updateCountsInInitialTabsOptions } from '../Utils/filters'; +import { mergeFilters, updateCountsInInitialTabsOptions, sortTabsOptions } from '../Utils/filters'; describe('can merge simple selectedValue filters', () => { const userFilter = { data_format: { selectedValues: ['VCF'] } }; @@ -112,3 +112,53 @@ describe('can update a small set of tabs with new counts', () => { .toEqual(actualUpdatedTabsOptions); }); }); + + +describe('can sort tabs options', () => { + const tabsOptionsOne = { + annotated_sex: { + histogram: [ + { key: 'yellow', count: 30 }, + { key: 'pink', count: 21 }, + { key: 'orange', count: 99 }, + { key: 'shiny', count: 0 }, + { key: 'green', count: 0 }, + { key: 'blue', count: 0 } + ], + }, + extra_data: { + histogram: [ + { key: 'a', count: 0 }, + { key: 'b', count: 0 }, + { key: 'c', count: 1 } + ], + }, + }; + + const expectedSort = { + annotated_sex: { + histogram: [ + { key: 'orange', count: 99 }, + { key: 'yellow', count: 30 }, + { key: 'pink', count: 21 }, + { key: 'blue', count: 0 }, + { key: 'green', count: 0 }, + { key: 'shiny', count: 0 } + ], + }, + extra_data: { + histogram: [ + { key: 'c', count: 1 }, + { key: 'a', count: 0 }, + { key: 'b', count: 0 }, + ], + }, + }; + + const actualSort = sortTabsOptions(tabsOptionsOne); + + test('test sorting tabs options', async () => { + expect(actualSort) + .toEqual(expectedSort); + }); +}); From 01cd5fd3210a48395c5cc24c699b9fc7d993fe0a Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Thu, 2 Jan 2020 10:31:03 -0600 Subject: [PATCH 28/52] testing --- src/components/ConnectedFilter/index.jsx | 5 +++-- src/components/__tests__/filters.test.js | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index da2185b6..bd9fde44 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -77,9 +77,10 @@ class ConnectedFilter extends React.Component { let processedTabsOptions = updateCountsInInitialTabsOptions( this.initialTabsOptions, updatedTabsOptions, ); - + processedTabsOptions = sortTabsOptions(processedTabsOptions); - + console.log('82: processedTabsOptions sorted', processedTabsOptions); + if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( diff --git a/src/components/__tests__/filters.test.js b/src/components/__tests__/filters.test.js index 81bc7a5c..23453d59 100644 --- a/src/components/__tests__/filters.test.js +++ b/src/components/__tests__/filters.test.js @@ -118,9 +118,9 @@ describe('can sort tabs options', () => { const tabsOptionsOne = { annotated_sex: { histogram: [ - { key: 'yellow', count: 30 }, + { key: 'orange', count: 30 }, { key: 'pink', count: 21 }, - { key: 'orange', count: 99 }, + { key: 'yellow', count: 99 }, { key: 'shiny', count: 0 }, { key: 'green', count: 0 }, { key: 'blue', count: 0 } @@ -138,8 +138,8 @@ describe('can sort tabs options', () => { const expectedSort = { annotated_sex: { histogram: [ - { key: 'orange', count: 99 }, - { key: 'yellow', count: 30 }, + { key: 'yellow', count: 99 }, + { key: 'orange', count: 30 }, { key: 'pink', count: 21 }, { key: 'blue', count: 0 }, { key: 'green', count: 0 }, From cfd6cddc3554c9ad26913cfc019e981ed08f49ab Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Thu, 2 Jan 2020 11:06:33 -0600 Subject: [PATCH 29/52] fixed sort problem --- src/components/ConnectedFilter/index.jsx | 3 +-- src/components/Utils/filters.js | 7 ++++++- src/components/__tests__/filters.test.js | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index bd9fde44..4de5ae0d 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -79,8 +79,7 @@ class ConnectedFilter extends React.Component { ); processedTabsOptions = sortTabsOptions(processedTabsOptions); - console.log('82: processedTabsOptions sorted', processedTabsOptions); - + if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; const { fieldMapping } = this.props; const tabs = this.props.filterConfig.tabs.map(({ fields }, index) => ( diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index cbf4b3a8..1bccb3f7 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -70,6 +70,10 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa return updatedTabsOptions; }; +function sortNumber(a, b) { + return a - b; +} + export const sortTabsOptions = (tabsOptions) => { const fields = Object.keys(tabsOptions); const sortedTabsOptions = {}; @@ -92,12 +96,13 @@ export const sortTabsOptions = (tabsOptions) => { // Sort the keys in each count const countKeys = Object.keys(countToKeys); + countKeys = countKeys.map(x => parseInt(x)); for (let j = 0; j < countKeys.length; j += 1) { countToKeys[countKeys[j]].sort(); // Alphabetically ascending order } // Sort the count-groups - countKeys.sort(); + countKeys.sort(sortNumber); countKeys.reverse(); // Numerically descending order sortedTabsOptions[field] = {"histogram": [] } for (let k = 0; k < countKeys.length; k += 1) { diff --git a/src/components/__tests__/filters.test.js b/src/components/__tests__/filters.test.js index 23453d59..2bfab8a0 100644 --- a/src/components/__tests__/filters.test.js +++ b/src/components/__tests__/filters.test.js @@ -121,6 +121,7 @@ describe('can sort tabs options', () => { { key: 'orange', count: 30 }, { key: 'pink', count: 21 }, { key: 'yellow', count: 99 }, + { key: 'zorp', count: 4162 }, { key: 'shiny', count: 0 }, { key: 'green', count: 0 }, { key: 'blue', count: 0 } @@ -138,6 +139,7 @@ describe('can sort tabs options', () => { const expectedSort = { annotated_sex: { histogram: [ + { key: 'zorp', count: 4162 }, { key: 'yellow', count: 99 }, { key: 'orange', count: 30 }, { key: 'pink', count: 21 }, From befca0dab063a8b356af00022722a2af1c143e9a Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Thu, 2 Jan 2020 14:24:44 -0600 Subject: [PATCH 30/52] package update --- package-lock.json | 130 +++++++++++++++++----------------------------- package.json | 2 +- 2 files changed, 48 insertions(+), 84 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6e3b1043..210f4bb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1241,9 +1241,8 @@ "dev": true }, "@gen3/ui-component": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/@gen3/ui-component/-/ui-component-0.3.11.tgz", - "integrity": "sha512-FAWcV5tQOEwfbol5froz4lJuNHn91hsq1C3FqkQt1/SKdRLwPHsBO8eBg3zIO1pE45lLdytWMaKjVNMJQKhG8Q==", + "version": "git://github.com/uc-cdis/gen3-ui-component.git#2a801f5a0637a7415caad44fb47a9cb153d23d7b", + "from": "git://github.com/uc-cdis/gen3-ui-component.git#fix/filter-state-bug", "requires": { "babel-loader": "^8.0.5", "postcss-loader": "^3.0.0", @@ -6665,22 +6664,22 @@ "integrity": "sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg==" }, "d3-format": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.1.tgz", - "integrity": "sha512-TUswGe6hfguUX1CtKxyG2nymO+1lyThbkS1ifLX0Sr+dOQtAD5gkrffpHnx+yHNKUZ0Bmg5T4AjUQwugPDrm0g==" + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.3.tgz", + "integrity": "sha512-mm/nE2Y9HgGyjP+rKIekeITVgBtX97o1nrvHCWX8F/yBYyevUTvu9vb5pUnKwrcSw7o7GuwMOWjS9gFDs4O+uQ==" }, "d3-interpolate": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.3.2.tgz", - "integrity": "sha512-NlNKGopqaz9qM1PXh9gBF1KSCVh+jSFErrSlD/4hybwoNX/gt1d8CDbDW+3i+5UOHhjC6s6nMvRxcuoMVNgL2w==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", + "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", "requires": { "d3-color": "1" } }, "d3-path": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.8.tgz", - "integrity": "sha512-J6EfUNwcMQ+aM5YPOB8ZbgAZu6wc82f/0WFxrxwV6Ll8wBwLaHLKCqQ5Imub02JriCVVdPjgI+6P3a4EWJCxAg==" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", + "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==" }, "d3-scale": { "version": "2.2.2", @@ -6696,9 +6695,9 @@ } }, "d3-shape": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.5.tgz", - "integrity": "sha512-VKazVR3phgD+MUCldapHD7P9kcrvPcexeX/PkMJmkUov4JM8IxsSg1DvbYoYich9AtdTsa5nNk2++ImPiDiSxg==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", + "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", "requires": { "d3-path": "1" } @@ -6709,9 +6708,9 @@ "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" }, "d3-time-format": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.2.1.tgz", - "integrity": "sha512-VA6WqORO1+H1SvSzgl2oT0z3niANh3opa8Cencpen1LFthw/bEX71R/DgjPlWw78J4UHmD0jCPP1W0HpwMkhjg==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.2.3.tgz", + "integrity": "sha512-RAHNnD8+XvC4Zc4d2A56Uw0yJoM7bsvOlJR33bclxq399Rak/b9bhvu/InjxdWhPtkgU53JJcleJTGkNRnN6IA==", "requires": { "d3-time": "1" } @@ -11814,11 +11813,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" - }, "lodash._reinterpolate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", @@ -11830,26 +11824,6 @@ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "requires": { - "lodash._getnative": "^3.0.0", - "lodash.isarguments": "^3.0.0", - "lodash.isarray": "^3.0.0" - } - }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -12066,9 +12040,9 @@ } }, "mdast-util-compact": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.3.tgz", - "integrity": "sha512-nRiU5GpNy62rZppDKbLwhhtw5DXoFMqw9UNZFmlPsNaQCZ//WLjGKUwWMdJrUH+Se7UvtO2gXtAMe0g/N+eI5w==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.4.tgz", + "integrity": "sha512-3YDMQHI5vRiS2uygEFYaqckibpJtKq5Sj2c8JioeOQBU6INpKbdWzfyLqFFnDwEcEnRFIdMsguzs5pC1Jp4Isg==", "requires": { "unist-util-visit": "^1.1.0" } @@ -13270,9 +13244,9 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", "requires": { "isarray": "0.0.1" }, @@ -14867,16 +14841,16 @@ } }, "rc-animate": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-2.10.1.tgz", - "integrity": "sha512-yfP3g5fNf8wB5eh85nim2IGrqNu5u7TKrrSh710+1vlUqZvnI2R5YHK99IBCQNgkLCAWjT0sHtkcYdynjly39w==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-2.10.2.tgz", + "integrity": "sha512-cE/A7piAzoWFSgUD69NmmMraqCeqVBa51UErod8NS3LUEqWfppSVagHfa0qHAlwPVPiIBg3emRONyny3eiH0Dg==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.6", "css-animation": "^1.3.2", "prop-types": "15.x", "raf": "^3.4.0", - "rc-util": "^4.8.0", + "rc-util": "^4.15.3", "react-lifecycles-compat": "^3.0.4" } }, @@ -14920,25 +14894,15 @@ } }, "rc-util": { - "version": "4.14.4", - "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.14.4.tgz", - "integrity": "sha512-GQgEn6ywJYZq1NEoZ6NZzeaE2U6mT6DhdqrtRV5IBNM3yTZZW8HRjIiMOpXOhTEUj10bnHnKWKZpC36RoNmS9Q==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.18.1.tgz", + "integrity": "sha512-3aRHG32ZvqBymtJUGoQnbZS+XANzO6XTiFEFAYI3BfuxESEazopAy0kBwcAI6BlLHsW1oLiy3ysE9uYwylh2ag==", "requires": { "add-dom-event-listener": "^1.1.0", "babel-runtime": "6.x", "prop-types": "^15.5.10", "react-lifecycles-compat": "^3.0.4", - "shallowequal": "^0.2.2" - }, - "dependencies": { - "shallowequal": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-0.2.2.tgz", - "integrity": "sha1-HjL9W8q2rWiKSBLLDMBO/HXHAU4=", - "requires": { - "lodash.keys": "^3.1.2" - } - } + "shallowequal": "^1.1.0" } }, "react": { @@ -19073,9 +19037,9 @@ } }, "unist-util-find-all-after": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-1.0.4.tgz", - "integrity": "sha512-CaxvMjTd+yF93BKLJvZnEfqdM7fgEACsIpQqz8vIj9CJnUb9VpyymFS3tg6TCtgrF7vfCJBF5jbT2Ox9CBRYRQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-1.0.5.tgz", + "integrity": "sha512-lWgIc3rrTMTlK1Y0hEuL+k+ApzFk78h+lsaa2gHf63Gp5Ww+mt11huDniuaoq1H+XMK2lIIjjPkncxXcDp3QDw==", "requires": { "unist-util-is": "^3.0.0" } @@ -19086,17 +19050,17 @@ "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==" }, "unist-util-remove-position": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.3.tgz", - "integrity": "sha512-CtszTlOjP2sBGYc2zcKA/CvNdTdEs3ozbiJ63IPBxh8iZg42SCCb8m04f8z2+V1aSk5a7BxbZKEdoDjadmBkWA==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz", + "integrity": "sha512-tLqd653ArxJIPnKII6LMZwH+mb5q+n/GtXQZo6S6csPRs5zB0u79Yw8ouR3wTw8wxvdJFhpP6Y7jorWdCgLO0A==", "requires": { "unist-util-visit": "^1.1.0" } }, "unist-util-stringify-position": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.1.tgz", - "integrity": "sha512-Zqlf6+FRI39Bah8Q6ZnNGrEHUhwJOkHde2MHVk96lLyftfJJckaPslKgzhVcviXj8KcE9UJM9F+a4JEiBUTYgA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.2.tgz", + "integrity": "sha512-nK5n8OGhZ7ZgUwoUbL8uiVRwAbZyzBsB/Ddrlbu6jwwubFza4oe15KlyEaLNMXQW1svOQq4xesUeqA85YrIUQA==", "requires": { "@types/unist": "^2.0.2" } @@ -19497,16 +19461,16 @@ } }, "vfile-location": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.5.tgz", - "integrity": "sha512-Pa1ey0OzYBkLPxPZI3d9E+S4BmvfVwNAAXrrqGbwTVXWaX2p9kM1zZ+n35UtVM06shmWKH4RPRN8KI80qE3wNQ==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.6.tgz", + "integrity": "sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA==" }, "vfile-message": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.1.tgz", - "integrity": "sha512-KtasSV+uVU7RWhUn4Lw+wW1Zl/nW8JWx7JCPps10Y9JRRIDeDXf8wfBLoOSsJLyo27DqMyAi54C6Jf/d6Kr2Bw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.2.tgz", + "integrity": "sha512-gNV2Y2fDvDOOqq8bEe7cF3DXU6QgV4uA9zMR2P8tix11l1r7zju3zry3wZ8sx+BEfuO6WQ7z2QzfWTvqHQiwsA==", "requires": { - "@types/unist": "^2.0.2", + "@types/unist": "^2.0.0", "unist-util-stringify-position": "^2.0.0" } }, diff --git a/package.json b/package.json index 0481d60c..551889e1 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "homepage": "https://github.com/uc-cdis/guppy#readme", "dependencies": { "@elastic/elasticsearch": "^7.0.0-rc.1", - "@gen3/ui-component": "0.3.11", + "@gen3/ui-component": "git://github.com/uc-cdis/gen3-ui-component.git#fix/filter-state-bug", "apollo-server": "^2.4.8", "apollo-server-express": "^2.4.8", "body-parser": "^1.18.3", From aeb264b0ed8c033270b1979eb291396baca7561a Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 3 Jan 2020 10:53:14 -0600 Subject: [PATCH 31/52] mak zero hiding configurable --- package-lock.json | 396 +++++++++++++++-------- src/components/ConnectedFilter/index.jsx | 18 +- 2 files changed, 274 insertions(+), 140 deletions(-) diff --git a/package-lock.json b/package-lock.json index 210f4bb5..df519e7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8791,25 +8791,29 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "optional": true, "requires": { @@ -8819,13 +8823,15 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": false, + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "optional": true, "requires": { @@ -8835,37 +8841,43 @@ }, "chownr": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "optional": true, "requires": { @@ -8874,25 +8886,29 @@ }, "deep-extend": { "version": "0.6.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, "requires": { @@ -8901,13 +8917,15 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, "requires": { @@ -8923,7 +8941,8 @@ }, "glob": { "version": "7.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "optional": true, "requires": { @@ -8937,13 +8956,15 @@ }, "has-unicode": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "bundled": true, + "resolved": false, + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "optional": true, "requires": { @@ -8952,7 +8973,8 @@ }, "ignore-walk": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, "requires": { @@ -8961,7 +8983,8 @@ }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, "requires": { @@ -8971,19 +8994,22 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true, "optional": true }, "ini": { "version": "1.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "optional": true, "requires": { @@ -8992,13 +9018,15 @@ }, "isarray": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "optional": true, "requires": { @@ -9007,13 +9035,15 @@ }, "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true, "optional": true }, "minipass": { "version": "2.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "dev": true, "optional": true, "requires": { @@ -9023,7 +9053,8 @@ }, "minizlib": { "version": "1.2.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "dev": true, "optional": true, "requires": { @@ -9032,7 +9063,8 @@ }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "optional": true, "requires": { @@ -9041,13 +9073,15 @@ }, "ms": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true, "optional": true }, "needle": { "version": "2.3.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "dev": true, "optional": true, "requires": { @@ -9058,7 +9092,8 @@ }, "node-pre-gyp": { "version": "0.12.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "dev": true, "optional": true, "requires": { @@ -9076,7 +9111,8 @@ }, "nopt": { "version": "4.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, "requires": { @@ -9086,13 +9122,15 @@ }, "npm-bundled": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "dev": true, "optional": true, "requires": { @@ -9102,7 +9140,8 @@ }, "npmlog": { "version": "4.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, "requires": { @@ -9114,19 +9153,22 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "optional": true, "requires": { @@ -9135,19 +9177,22 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, "requires": { @@ -9157,19 +9202,22 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.8", - "bundled": true, + "resolved": false, + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "optional": true, "requires": { @@ -9181,7 +9229,8 @@ "dependencies": { "minimist": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true } @@ -9189,7 +9238,8 @@ }, "readable-stream": { "version": "2.3.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, "requires": { @@ -9204,7 +9254,8 @@ }, "rimraf": { "version": "2.6.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "optional": true, "requires": { @@ -9213,43 +9264,50 @@ }, "safe-buffer": { "version": "5.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.7.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "optional": true, "requires": { @@ -9260,7 +9318,8 @@ }, "string_decoder": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, "requires": { @@ -9269,7 +9328,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "optional": true, "requires": { @@ -9278,13 +9338,15 @@ }, "strip-json-comments": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.8", - "bundled": true, + "resolved": false, + "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "dev": true, "optional": true, "requires": { @@ -9299,13 +9361,15 @@ }, "util-deprecate": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "optional": true, "requires": { @@ -9314,13 +9378,15 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true, "optional": true }, "yallist": { "version": "3.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", "dev": true, "optional": true } @@ -15495,19 +15561,23 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "bundled": true + "resolved": false, + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "aproba": { "version": "1.2.0", - "bundled": true + "resolved": false, + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, "are-we-there-yet": { "version": "1.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -15515,11 +15585,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": false, + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -15527,57 +15599,69 @@ }, "chownr": { "version": "1.1.1", - "bundled": true + "resolved": false, + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==" }, "code-point-at": { "version": "1.1.0", - "bundled": true + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "concat-map": { "version": "0.0.1", - "bundled": true + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "resolved": false, + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "core-util-is": { "version": "1.0.2", - "bundled": true + "resolved": false, + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "debug": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { "ms": "^2.1.1" } }, "deep-extend": { "version": "0.6.0", - "bundled": true + "resolved": false, + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, "delegates": { "version": "1.0.0", - "bundled": true + "resolved": false, + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" }, "detect-libc": { "version": "1.0.3", - "bundled": true + "resolved": false, + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" }, "fs-minipass": { "version": "1.2.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "requires": { "minipass": "^2.2.1" } }, "fs.realpath": { "version": "1.0.0", - "bundled": true + "resolved": false, + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "gauge": { "version": "2.7.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "requires": { "aproba": "^1.0.3", "console-control-strings": "^1.0.0", @@ -15591,7 +15675,8 @@ }, "glob": { "version": "7.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -15603,25 +15688,29 @@ }, "has-unicode": { "version": "2.0.1", - "bundled": true + "resolved": false, + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" }, "iconv-lite": { "version": "0.4.24", - "bundled": true, + "resolved": false, + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { "safer-buffer": ">= 2.1.2 < 3" } }, "ignore-walk": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "requires": { "minimatch": "^3.0.4" } }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "requires": { "once": "^1.3.0", "wrappy": "1" @@ -15629,37 +15718,44 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { "version": "1.3.5", - "bundled": true + "resolved": false, + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { "number-is-nan": "^1.0.0" } }, "isarray": { "version": "1.0.0", - "bundled": true + "resolved": false, + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "minipass": { "version": "2.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -15667,25 +15763,29 @@ }, "minizlib": { "version": "1.2.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "requires": { "minipass": "^2.2.1" } }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.1.1", - "bundled": true + "resolved": false, + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" }, "needle": { "version": "2.3.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "requires": { "debug": "^4.1.0", "iconv-lite": "^0.4.4", @@ -15694,7 +15794,8 @@ }, "node-pre-gyp": { "version": "0.12.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", @@ -15710,7 +15811,8 @@ }, "nopt": { "version": "4.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "requires": { "abbrev": "1", "osenv": "^0.1.4" @@ -15718,11 +15820,13 @@ }, "npm-bundled": { "version": "1.0.6", - "bundled": true + "resolved": false, + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" }, "npm-packlist": { "version": "1.4.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "requires": { "ignore-walk": "^3.0.1", "npm-bundled": "^1.0.1" @@ -15730,7 +15834,8 @@ }, "npmlog": { "version": "4.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "requires": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", @@ -15740,30 +15845,36 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "object-assign": { "version": "4.1.1", - "bundled": true + "resolved": false, + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { "wrappy": "1" } }, "os-homedir": { "version": "1.0.2", - "bundled": true + "resolved": false, + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" }, "os-tmpdir": { "version": "1.0.2", - "bundled": true + "resolved": false, + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, "osenv": { "version": "0.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "requires": { "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" @@ -15771,15 +15882,18 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true + "resolved": false, + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "process-nextick-args": { "version": "2.0.0", - "bundled": true + "resolved": false, + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "rc": { "version": "1.2.8", - "bundled": true, + "resolved": false, + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "requires": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -15789,13 +15903,15 @@ "dependencies": { "minimist": { "version": "1.2.0", - "bundled": true + "resolved": false, + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } }, "readable-stream": { "version": "2.3.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -15808,38 +15924,46 @@ }, "rimraf": { "version": "2.6.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "requires": { "glob": "^7.1.3" } }, "safe-buffer": { "version": "5.1.2", - "bundled": true + "resolved": false, + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safer-buffer": { "version": "2.1.2", - "bundled": true + "resolved": false, + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sax": { "version": "1.2.4", - "bundled": true + "resolved": false, + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "semver": { "version": "5.7.0", - "bundled": true + "resolved": false, + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" }, "set-blocking": { "version": "2.0.0", - "bundled": true + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "signal-exit": { "version": "3.0.2", - "bundled": true + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -15848,25 +15972,29 @@ }, "string_decoder": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { "safe-buffer": "~5.1.0" } }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { "ansi-regex": "^2.0.0" } }, "strip-json-comments": { "version": "2.0.1", - "bundled": true + "resolved": false, + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "tar": { "version": "4.4.8", - "bundled": true, + "resolved": false, + "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", @@ -15879,22 +16007,26 @@ }, "util-deprecate": { "version": "1.0.2", - "bundled": true + "resolved": false, + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "wide-align": { "version": "1.1.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "requires": { "string-width": "^1.0.2 || 2" } }, "wrappy": { "version": "1.0.2", - "bundled": true + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "yallist": { "version": "3.0.3", - "bundled": true + "resolved": false, + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" } } }, diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 4de5ae0d..015a6ccd 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -69,14 +69,16 @@ class ConnectedFilter extends React.Component { * component could do some pre-processing modification about filter. */ getFilterTabs() { - const updatedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); + let processedTabsOptions = this.props.onProcessFilterAggsData(this.state.receivedAggsData); if (Object.keys(this.initialTabsOptions).length === 0) { - this.initialTabsOptions = updatedTabsOptions; + this.initialTabsOptions = processedTabsOptions; } - let processedTabsOptions = updateCountsInInitialTabsOptions( - this.initialTabsOptions, updatedTabsOptions, - ); + if (!this.props.hideZeroCountFilterOptions) { + processedTabsOptions = updateCountsInInitialTabsOptions( + this.initialTabsOptions, updatedTabsOptions, + ); + } processedTabsOptions = sortTabsOptions(processedTabsOptions); @@ -164,7 +166,7 @@ class ConnectedFilter extends React.Component { tabs={filterTabs} filterConfig={this.props.filterConfig} onFilterChange={e => this.handleFilterChange(e)} - hideZero={this.props.hideZero} + hideZero={this.props.hideZeroCountFilterOptions} /> ); } @@ -183,7 +185,6 @@ ConnectedFilter.propTypes = { }).isRequired, onFilterChange: PropTypes.func, onReceiveNewAggsData: PropTypes.func, - hideZero: PropTypes.bool, className: PropTypes.string, fieldMapping: PropTypes.arrayOf(PropTypes.shape({ field: PropTypes.string, @@ -196,12 +197,12 @@ ConnectedFilter.propTypes = { lockedTooltipMessage: PropTypes.string, disabledTooltipMessage: PropTypes.string, accessibleFieldCheckList: PropTypes.arrayOf(PropTypes.string), + hideZeroCountFilterOptions: PropTypes.bool, }; ConnectedFilter.defaultProps = { onFilterChange: () => {}, onReceiveNewAggsData: () => {}, - hideZero: false, className: '', fieldMapping: [], tierAccessLimit: undefined, @@ -211,6 +212,7 @@ ConnectedFilter.defaultProps = { lockedTooltipMessage: '', disabledTooltipMessage: '', accessibleFieldCheckList: undefined, + hideZeroCountFilterOptions: false, }; export default ConnectedFilter; From 2564b8ab9c2592659fa8a8f0c838b8364428dc92 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Fri, 3 Jan 2020 11:02:34 -0600 Subject: [PATCH 32/52] mak zero hiding configurable --- src/components/ConnectedFilter/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 015a6ccd..f566cfa2 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -76,7 +76,7 @@ class ConnectedFilter extends React.Component { if (!this.props.hideZeroCountFilterOptions) { processedTabsOptions = updateCountsInInitialTabsOptions( - this.initialTabsOptions, updatedTabsOptions, + this.initialTabsOptions, processedTabsOptions ); } From 4ec8dd98d15a0dec5899f22f8a62fb51f06c34e5 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Mon, 27 Jan 2020 15:28:04 -0600 Subject: [PATCH 33/52] PR feedback in progress --- src/components/ConnectedFilter/index.jsx | 2 +- src/components/Utils/filters.js | 55 +++++++----------------- 2 files changed, 16 insertions(+), 41 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index f566cfa2..9052b5dc 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -76,7 +76,7 @@ class ConnectedFilter extends React.Component { if (!this.props.hideZeroCountFilterOptions) { processedTabsOptions = updateCountsInInitialTabsOptions( - this.initialTabsOptions, processedTabsOptions + this.initialTabsOptions, processedTabsOptions, this.state.filter ); } diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 1bccb3f7..77ca7abb 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -35,10 +35,10 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { /** * This function updates the counts in the initial set of tab options * calculated from unfiltered data. - * It is used to retain field options in the rendering even if - * those options have no histogram results. + * It is used to retain field options in the rendering if + * they are still checked but their counts are zero. */ -export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTabsOptions) => { +export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTabsOptions, filter) => { const updatedTabsOptions = JSON.parse(JSON.stringify(initialTabsOptions)); const initialFields = Object.keys(initialTabsOptions); for (let i = 0; i < initialFields.length; i += 1) { @@ -67,54 +67,29 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa } } } + + console.log("inside updateCountsInInitialTabsOptions with ", this.state.filter); + return updatedTabsOptions; }; -function sortNumber(a, b) { - return a - b; +function sortCountThenAlpha(a, b) { + if (a.count === b.count) { + return a.key < b.key ? -1 : 1; + } + return b.count - a.count; } export const sortTabsOptions = (tabsOptions) => { const fields = Object.keys(tabsOptions); - const sortedTabsOptions = {}; + const sortedTabsOptions = Object.assign({}, tabsOptions); for (let x = 0; x < fields.length; x += 1) { let field = fields[x]; - const optionsForThisField = tabsOptions[field].histogram; - - // Make { count -> [keys with this count] } dictionary - const countToKeys = {}; - for (let i = 0; i < optionsForThisField.length; i += 1) { - let keyName = optionsForThisField[i].key; - let count = optionsForThisField[i].count; - if (countToKeys.hasOwnProperty(count)) { - countToKeys[count].push(keyName); - } else { - countToKeys[count] = [ keyName ]; - } - } + const optionsForThisField = sortedTabsOptions[field].histogram; + optionsForThisField.sort(sortCountThenAlpha); + sortedTabsOptions[field].histogram = optionsForThisField; - // Sort the keys in each count - const countKeys = Object.keys(countToKeys); - countKeys = countKeys.map(x => parseInt(x)); - for (let j = 0; j < countKeys.length; j += 1) { - countToKeys[countKeys[j]].sort(); // Alphabetically ascending order } - - // Sort the count-groups - countKeys.sort(sortNumber); - countKeys.reverse(); // Numerically descending order - sortedTabsOptions[field] = {"histogram": [] } - for (let k = 0; k < countKeys.length; k += 1) { - let fieldsAtThisCount = countToKeys[countKeys[k]]; - for (let m = 0; m < fieldsAtThisCount.length; m += 1) { - let keyForCount = countToKeys[countKeys[k]][m]; - sortedTabsOptions[field].histogram.push({ - 'key': keyForCount, - 'count': parseInt(countKeys[k]) - }); - } - } - } return sortedTabsOptions; } \ No newline at end of file From fdb6ce36e4c48177132e281c93d33d4dcebd9dd4 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Mon, 27 Jan 2020 15:34:48 -0600 Subject: [PATCH 34/52] whoa --- src/components/Utils/filters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 77ca7abb..1b99761a 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -68,8 +68,8 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa } } - console.log("inside updateCountsInInitialTabsOptions with ", this.state.filter); - + console.log("inside updateCountsInInitialTabsOptions with ", filter); + return updatedTabsOptions; }; From aedcdffe858e9af4ddca26902a07849a2ced8f5c Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Tue, 28 Jan 2020 10:05:42 -0600 Subject: [PATCH 35/52] - --- src/components/ConnectedFilter/index.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 9052b5dc..9a02d84b 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -79,6 +79,7 @@ class ConnectedFilter extends React.Component { this.initialTabsOptions, processedTabsOptions, this.state.filter ); } + console.log('82 processedTabsOptions: ', processedTabsOptions); processedTabsOptions = sortTabsOptions(processedTabsOptions); From 65dfdedf14c7ee305fcbd9b2ee2e950c5f198202 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Tue, 28 Jan 2020 10:55:30 -0600 Subject: [PATCH 36/52] - --- src/components/ConnectedFilter/index.jsx | 10 +++++----- src/components/Utils/filters.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 9a02d84b..ff780bb0 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -33,6 +33,7 @@ class ConnectedFilter extends React.Component { accessibility: ENUM_ACCESSIBILITY.ALL, adminAppliedPreFilters: Object.assign({}, this.props.adminAppliedPreFilters), filter: Object.assign({}, this.props.adminAppliedPreFilters), + filtersApplied: {}, }; this.filterGroupRef = React.createRef(); this.adminPreFiltersFrozen = JSON.stringify(this.props.adminAppliedPreFilters).slice(); @@ -74,11 +75,9 @@ class ConnectedFilter extends React.Component { this.initialTabsOptions = processedTabsOptions; } - if (!this.props.hideZeroCountFilterOptions) { - processedTabsOptions = updateCountsInInitialTabsOptions( - this.initialTabsOptions, processedTabsOptions, this.state.filter - ); - } + processedTabsOptions = updateCountsInInitialTabsOptions( + this.initialTabsOptions, processedTabsOptions, this.state.filter + ); console.log('82 processedTabsOptions: ', processedTabsOptions); processedTabsOptions = sortTabsOptions(processedTabsOptions); @@ -127,6 +126,7 @@ class ConnectedFilter extends React.Component { handleFilterChange(filterResults) { this.setState({ adminAppliedPreFilters: JSON.parse(this.adminPreFiltersFrozen) }); const mergedFilterResults = mergeFilters(filterResults, this.state.adminAppliedPreFilters); + this.setState({filtersApplied: mergedFilterResults}); askGuppyForAggregationData( this.props.guppyConfig.path, this.props.guppyConfig.type, diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 1b99761a..43465dfc 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -68,7 +68,7 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa } } - console.log("inside updateCountsInInitialTabsOptions with ", filter); + console.log("inside updateCountsInInitialTabsOptions with ", filtersApplied); return updatedTabsOptions; }; From a2e07f750f274e07ee8a03eafa6628c58a301a60 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Tue, 28 Jan 2020 10:58:46 -0600 Subject: [PATCH 37/52] - --- src/components/Utils/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 43465dfc..826c4389 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -68,7 +68,7 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa } } - console.log("inside updateCountsInInitialTabsOptions with ", filtersApplied); + console.log("inside updateCountsInInitialTabsOptions with ", this.state.filtersApplied); return updatedTabsOptions; }; From 208ababb06239b62ebe0a5914e98f59247fc5924 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Tue, 28 Jan 2020 11:01:58 -0600 Subject: [PATCH 38/52] - --- src/components/ConnectedFilter/index.jsx | 2 +- src/components/Utils/filters.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index ff780bb0..f5998cf6 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -76,7 +76,7 @@ class ConnectedFilter extends React.Component { } processedTabsOptions = updateCountsInInitialTabsOptions( - this.initialTabsOptions, processedTabsOptions, this.state.filter + this.initialTabsOptions, processedTabsOptions, this.state.filtersApplied ); console.log('82 processedTabsOptions: ', processedTabsOptions); diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 826c4389..a0e87cef 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -38,7 +38,7 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { * It is used to retain field options in the rendering if * they are still checked but their counts are zero. */ -export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTabsOptions, filter) => { +export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTabsOptions, filtersApplied) => { const updatedTabsOptions = JSON.parse(JSON.stringify(initialTabsOptions)); const initialFields = Object.keys(initialTabsOptions); for (let i = 0; i < initialFields.length; i += 1) { @@ -68,7 +68,7 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa } } - console.log("inside updateCountsInInitialTabsOptions with ", this.state.filtersApplied); + console.log("inside updateCountsInInitialTabsOptions with ", filtersApplied); return updatedTabsOptions; }; From d286a02ac85612866d220b97d62c299534a8a475 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Tue, 28 Jan 2020 12:04:40 -0600 Subject: [PATCH 39/52] - --- src/components/Utils/filters.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index a0e87cef..e4cb5bd1 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -32,6 +32,20 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { return filterAB; }; +isFilterOptionToBeHidden = (option, filtersApplied, fieldName) => { + console.log('should it be hidden? ', option); + if (option.count > 0) { + return false; + } + try { + if (filtersApplied[fieldName].selectedValues.includes(option.key)) { + return false; + } + } catch(err) { + return true; + } +} + /** * This function updates the counts in the initial set of tab options * calculated from unfiltered data. @@ -63,12 +77,19 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa const option = updatedTabsOptions[fieldName].histogram[k]; if (option.key === optionName) { updatedTabsOptions[fieldName].histogram[k].count = newCount; + if (isFilterOptionToBeHidden(updatedTabsOptions[fieldName].histogram[k], filtersApplied)) { + console.log('removing ', updatedTabsOptions[fieldName].histogram[k]); + updatedTabsOptions[fieldName].histogram.splice(k, 1); + } } } } } - console.log("inside updateCountsInInitialTabsOptions with ", filtersApplied); + console.log("inside updateCountsInInitialTabsOptions with filtersApplied", filtersApplied); + + updatedTabsOptions.filter(option => isFilterOptionToBeHidden(option, filtersApplied)); + return updatedTabsOptions; }; From 9fc8e0cbdaab96f4046d7c842273d3d3b6872626 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Tue, 28 Jan 2020 12:23:24 -0600 Subject: [PATCH 40/52] - --- src/components/Utils/filters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index e4cb5bd1..08e95646 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -32,7 +32,7 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { return filterAB; }; -isFilterOptionToBeHidden = (option, filtersApplied, fieldName) => { +function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { console.log('should it be hidden? ', option); if (option.count > 0) { return false; From 0cffdf195ee2ca07dbc968c4d356ce3ec47cc101 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Tue, 28 Jan 2020 12:26:04 -0600 Subject: [PATCH 41/52] - --- src/components/Utils/filters.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 08e95646..25f445b7 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -86,11 +86,6 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa } } - console.log("inside updateCountsInInitialTabsOptions with filtersApplied", filtersApplied); - - updatedTabsOptions.filter(option => isFilterOptionToBeHidden(option, filtersApplied)); - - return updatedTabsOptions; }; From 32c8b362e134c40c9840fb0b5932d95f3acb05cd Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Tue, 28 Jan 2020 14:59:12 -0600 Subject: [PATCH 42/52] - --- src/components/Utils/filters.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 25f445b7..3b19c8ef 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -34,6 +34,7 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { console.log('should it be hidden? ', option); + console.log('selected values :', filtersApplied[fieldName].selectedValues); if (option.count > 0) { return false; } From 61c8516b49e0ab83a36fd9dd93aa5f323f3a2f72 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 29 Jan 2020 10:00:03 -0600 Subject: [PATCH 43/52] - --- src/components/Utils/filters.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 3b19c8ef..98f3910a 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -34,7 +34,8 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { console.log('should it be hidden? ', option); - console.log('selected values :', filtersApplied[fieldName].selectedValues); + console.log('filtersApplied :', filtersApplied); + console.log('filtersApplied[fieldName] :', filtersApplied[fieldName]); if (option.count > 0) { return false; } From 4d875cef72de247fb97cbb1df2c5ba4ae152375f Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 29 Jan 2020 10:07:05 -0600 Subject: [PATCH 44/52] - --- src/components/Utils/filters.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 98f3910a..b38434b2 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -35,6 +35,7 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { console.log('should it be hidden? ', option); console.log('filtersApplied :', filtersApplied); + console.log('fieldName: ', fieldName); console.log('filtersApplied[fieldName] :', filtersApplied[fieldName]); if (option.count > 0) { return false; @@ -79,7 +80,7 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa const option = updatedTabsOptions[fieldName].histogram[k]; if (option.key === optionName) { updatedTabsOptions[fieldName].histogram[k].count = newCount; - if (isFilterOptionToBeHidden(updatedTabsOptions[fieldName].histogram[k], filtersApplied)) { + if (isFilterOptionToBeHidden(updatedTabsOptions[fieldName].histogram[k], filtersApplied, fieldName)) { console.log('removing ', updatedTabsOptions[fieldName].histogram[k]); updatedTabsOptions[fieldName].histogram.splice(k, 1); } From 357a13619b69d324f4110a94d216cf46b48cd93e Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 29 Jan 2020 10:45:45 -0600 Subject: [PATCH 45/52] - --- src/components/Utils/filters.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index b38434b2..1750da5c 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -33,18 +33,30 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { }; function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { - console.log('should it be hidden? ', option); - console.log('filtersApplied :', filtersApplied); - console.log('fieldName: ', fieldName); - console.log('filtersApplied[fieldName] :', filtersApplied[fieldName]); + if (fieldName == 'project_id') { + console.log('should it be hidden? ', option); + console.log('filtersApplied :', filtersApplied); + console.log('fieldName: ', fieldName); + console.log('filtersApplied[fieldName] :', filtersApplied[fieldName]); + } + if (option.count > 0) { + if (fieldName == 'project_id') { + console.log('45 '); + } return false; } try { if (filtersApplied[fieldName].selectedValues.includes(option.key)) { + if (fieldName == 'project_id') { + console.log('51'); + } return false; } } catch(err) { + if (fieldName == 'project_id') { + console.log('58'); + } return true; } } @@ -81,7 +93,9 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa if (option.key === optionName) { updatedTabsOptions[fieldName].histogram[k].count = newCount; if (isFilterOptionToBeHidden(updatedTabsOptions[fieldName].histogram[k], filtersApplied, fieldName)) { - console.log('removing ', updatedTabsOptions[fieldName].histogram[k]); + if (fieldName == 'project_id') { + console.log('removing ', updatedTabsOptions[fieldName].histogram[k]); + } updatedTabsOptions[fieldName].histogram.splice(k, 1); } } From 90aedc15e31210a07fbf31de8d0cc3b3c65e2557 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 29 Jan 2020 10:54:57 -0600 Subject: [PATCH 46/52] - --- src/components/Utils/filters.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 1750da5c..e83c8d80 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -34,7 +34,7 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { if (fieldName == 'project_id') { - console.log('should it be hidden? ', option); + console.log('should it be hidden? ', option.key); console.log('filtersApplied :', filtersApplied); console.log('fieldName: ', fieldName); console.log('filtersApplied[fieldName] :', filtersApplied[fieldName]); @@ -46,19 +46,18 @@ function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { } return false; } - try { - if (filtersApplied[fieldName].selectedValues.includes(option.key)) { - if (fieldName == 'project_id') { - console.log('51'); - } - return false; - } - } catch(err) { - if (fieldName == 'project_id') { - console.log('58'); + + if (filtersApplied[fieldName] && filtersApplied[fieldName].selectedValues.includes(option.key)) { + if (fieldName == 'project_id') { + console.log('51'); } - return true; + return false; + } + + if (fieldName == 'project_id') { + console.log('58'); } + return true; } /** From a67274084d2691d11619bb9269e7c10bc2b109e9 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 29 Jan 2020 11:00:46 -0600 Subject: [PATCH 47/52] - --- src/components/Utils/filters.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index e83c8d80..8d2c0f1f 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -33,30 +33,14 @@ export const mergeFilters = (userFilter, adminAppliedPreFilter) => { }; function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { - if (fieldName == 'project_id') { - console.log('should it be hidden? ', option.key); - console.log('filtersApplied :', filtersApplied); - console.log('fieldName: ', fieldName); - console.log('filtersApplied[fieldName] :', filtersApplied[fieldName]); - } - if (option.count > 0) { - if (fieldName == 'project_id') { - console.log('45 '); - } return false; } if (filtersApplied[fieldName] && filtersApplied[fieldName].selectedValues.includes(option.key)) { - if (fieldName == 'project_id') { - console.log('51'); - } return false; } - if (fieldName == 'project_id') { - console.log('58'); - } return true; } @@ -92,9 +76,6 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa if (option.key === optionName) { updatedTabsOptions[fieldName].histogram[k].count = newCount; if (isFilterOptionToBeHidden(updatedTabsOptions[fieldName].histogram[k], filtersApplied, fieldName)) { - if (fieldName == 'project_id') { - console.log('removing ', updatedTabsOptions[fieldName].histogram[k]); - } updatedTabsOptions[fieldName].histogram.splice(k, 1); } } From 7a1522fc452ff1c1d1200d22e3fe28e45fec6ff0 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 29 Jan 2020 11:52:23 -0600 Subject: [PATCH 48/52] - --- src/components/ConnectedFilter/index.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index f5998cf6..0db14132 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -78,7 +78,6 @@ class ConnectedFilter extends React.Component { processedTabsOptions = updateCountsInInitialTabsOptions( this.initialTabsOptions, processedTabsOptions, this.state.filtersApplied ); - console.log('82 processedTabsOptions: ', processedTabsOptions); processedTabsOptions = sortTabsOptions(processedTabsOptions); From 4485590fdf9d9a615f4a9e4264c949d03b52642a Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 29 Jan 2020 12:06:41 -0600 Subject: [PATCH 49/52] eslint --- src/components/ConnectedFilter/index.jsx | 8 ++++---- src/components/Utils/filters.js | 21 ++++++++++++--------- src/components/__tests__/filters.test.js | 6 +++--- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 0db14132..829ab425 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -76,9 +76,9 @@ class ConnectedFilter extends React.Component { } processedTabsOptions = updateCountsInInitialTabsOptions( - this.initialTabsOptions, processedTabsOptions, this.state.filtersApplied + this.initialTabsOptions, processedTabsOptions, this.state.filtersApplied, ); - + processedTabsOptions = sortTabsOptions(processedTabsOptions); if (!processedTabsOptions || Object.keys(processedTabsOptions).length === 0) return null; @@ -124,8 +124,8 @@ class ConnectedFilter extends React.Component { */ handleFilterChange(filterResults) { this.setState({ adminAppliedPreFilters: JSON.parse(this.adminPreFiltersFrozen) }); - const mergedFilterResults = mergeFilters(filterResults, this.state.adminAppliedPreFilters); - this.setState({filtersApplied: mergedFilterResults}); + const mergedFilterResults = mergeFilters(filterResults, JSON.parse(this.adminPreFiltersFrozen)); + this.setState({ filtersApplied: mergedFilterResults }); askGuppyForAggregationData( this.props.guppyConfig.path, this.props.guppyConfig.type, diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 8d2c0f1f..b0530796 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -36,7 +36,7 @@ function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { if (option.count > 0) { return false; } - + if (filtersApplied[fieldName] && filtersApplied[fieldName].selectedValues.includes(option.key)) { return false; } @@ -50,7 +50,9 @@ function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { * It is used to retain field options in the rendering if * they are still checked but their counts are zero. */ -export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTabsOptions, filtersApplied) => { +export const updateCountsInInitialTabsOptions = ( + initialTabsOptions, processedTabsOptions, filtersApplied, +) => { const updatedTabsOptions = JSON.parse(JSON.stringify(initialTabsOptions)); const initialFields = Object.keys(initialTabsOptions); for (let i = 0; i < initialFields.length; i += 1) { @@ -75,7 +77,9 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa const option = updatedTabsOptions[fieldName].histogram[k]; if (option.key === optionName) { updatedTabsOptions[fieldName].histogram[k].count = newCount; - if (isFilterOptionToBeHidden(updatedTabsOptions[fieldName].histogram[k], filtersApplied, fieldName)) { + if (isFilterOptionToBeHidden( + updatedTabsOptions[fieldName].histogram[k], filtersApplied, fieldName, + )) { updatedTabsOptions[fieldName].histogram.splice(k, 1); } } @@ -89,20 +93,19 @@ export const updateCountsInInitialTabsOptions = (initialTabsOptions, processedTa function sortCountThenAlpha(a, b) { if (a.count === b.count) { return a.key < b.key ? -1 : 1; - } - return b.count - a.count; + } + return b.count - a.count; } export const sortTabsOptions = (tabsOptions) => { const fields = Object.keys(tabsOptions); const sortedTabsOptions = Object.assign({}, tabsOptions); for (let x = 0; x < fields.length; x += 1) { - let field = fields[x]; + const field = fields[x]; const optionsForThisField = sortedTabsOptions[field].histogram; optionsForThisField.sort(sortCountThenAlpha); sortedTabsOptions[field].histogram = optionsForThisField; - - } + } return sortedTabsOptions; -} \ No newline at end of file +}; diff --git a/src/components/__tests__/filters.test.js b/src/components/__tests__/filters.test.js index 2bfab8a0..7a747814 100644 --- a/src/components/__tests__/filters.test.js +++ b/src/components/__tests__/filters.test.js @@ -124,14 +124,14 @@ describe('can sort tabs options', () => { { key: 'zorp', count: 4162 }, { key: 'shiny', count: 0 }, { key: 'green', count: 0 }, - { key: 'blue', count: 0 } + { key: 'blue', count: 0 }, ], }, extra_data: { histogram: [ { key: 'a', count: 0 }, { key: 'b', count: 0 }, - { key: 'c', count: 1 } + { key: 'c', count: 1 }, ], }, }; @@ -145,7 +145,7 @@ describe('can sort tabs options', () => { { key: 'pink', count: 21 }, { key: 'blue', count: 0 }, { key: 'green', count: 0 }, - { key: 'shiny', count: 0 } + { key: 'shiny', count: 0 }, ], }, extra_data: { From 8af8a5a44fcd92a1369751c1b948ac26c9442b78 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 29 Jan 2020 12:35:52 -0600 Subject: [PATCH 50/52] tests passing --- src/components/Utils/filters.js | 4 +++- src/components/__tests__/filters.test.js | 16 +++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index b0530796..4ee52dad 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -37,7 +37,9 @@ function isFilterOptionToBeHidden(option, filtersApplied, fieldName) { return false; } - if (filtersApplied[fieldName] && filtersApplied[fieldName].selectedValues.includes(option.key)) { + if (typeof filtersApplied !== 'undefined' + && filtersApplied[fieldName] + && filtersApplied[fieldName].selectedValues.includes(option.key)) { return false; } diff --git a/src/components/__tests__/filters.test.js b/src/components/__tests__/filters.test.js index 7a747814..cd318ee6 100644 --- a/src/components/__tests__/filters.test.js +++ b/src/components/__tests__/filters.test.js @@ -68,6 +68,7 @@ describe('can update a small set of tabs with new counts', () => { histogram: [ { key: 'yellow', count: 137675 }, { key: 'pink', count: 56270 }, + { key: 'silver', count: 2020 }, { key: 'orange', count: 107574 }, ], }, @@ -88,28 +89,29 @@ describe('can update a small set of tabs with new counts', () => { extra_data: { histogram: [] }, }; + const filtersApplied = { annotated_sex: { selectedValues: ['silver'] } }; + + // Silver has a count of zero, but it is in the filter, so it should remain visible const expectedUpdatedTabsOptions = { annotated_sex: { histogram: [ { key: 'yellow', count: 1 }, - { key: 'pink', count: 0 }, + { key: 'silver', count: 0 }, { key: 'orange', count: 107574 }, ], }, extra_data: { - histogram: [ - { key: 'a', count: 0 }, - ], + histogram: [], }, }; const actualUpdatedTabsOptions = updateCountsInInitialTabsOptions( - initialTabsOptions, processedTabsOptions, + initialTabsOptions, processedTabsOptions, filtersApplied, ); test('update tab counts', async () => { - expect(expectedUpdatedTabsOptions) - .toEqual(actualUpdatedTabsOptions); + expect(actualUpdatedTabsOptions) + .toEqual(expectedUpdatedTabsOptions); }); }); From f6023b4064a2a5e4ec07491370f4960acbe51c15 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 5 Feb 2020 10:38:09 -0600 Subject: [PATCH 51/52] revert package --- package-lock.json | 526 +++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 216 insertions(+), 312 deletions(-) diff --git a/package-lock.json b/package-lock.json index df519e7e..6e3b1043 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1241,8 +1241,9 @@ "dev": true }, "@gen3/ui-component": { - "version": "git://github.com/uc-cdis/gen3-ui-component.git#2a801f5a0637a7415caad44fb47a9cb153d23d7b", - "from": "git://github.com/uc-cdis/gen3-ui-component.git#fix/filter-state-bug", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@gen3/ui-component/-/ui-component-0.3.11.tgz", + "integrity": "sha512-FAWcV5tQOEwfbol5froz4lJuNHn91hsq1C3FqkQt1/SKdRLwPHsBO8eBg3zIO1pE45lLdytWMaKjVNMJQKhG8Q==", "requires": { "babel-loader": "^8.0.5", "postcss-loader": "^3.0.0", @@ -6664,22 +6665,22 @@ "integrity": "sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg==" }, "d3-format": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.3.tgz", - "integrity": "sha512-mm/nE2Y9HgGyjP+rKIekeITVgBtX97o1nrvHCWX8F/yBYyevUTvu9vb5pUnKwrcSw7o7GuwMOWjS9gFDs4O+uQ==" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-1.4.1.tgz", + "integrity": "sha512-TUswGe6hfguUX1CtKxyG2nymO+1lyThbkS1ifLX0Sr+dOQtAD5gkrffpHnx+yHNKUZ0Bmg5T4AjUQwugPDrm0g==" }, "d3-interpolate": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz", - "integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.3.2.tgz", + "integrity": "sha512-NlNKGopqaz9qM1PXh9gBF1KSCVh+jSFErrSlD/4hybwoNX/gt1d8CDbDW+3i+5UOHhjC6s6nMvRxcuoMVNgL2w==", "requires": { "d3-color": "1" } }, "d3-path": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz", - "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==" + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.8.tgz", + "integrity": "sha512-J6EfUNwcMQ+aM5YPOB8ZbgAZu6wc82f/0WFxrxwV6Ll8wBwLaHLKCqQ5Imub02JriCVVdPjgI+6P3a4EWJCxAg==" }, "d3-scale": { "version": "2.2.2", @@ -6695,9 +6696,9 @@ } }, "d3-shape": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz", - "integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.5.tgz", + "integrity": "sha512-VKazVR3phgD+MUCldapHD7P9kcrvPcexeX/PkMJmkUov4JM8IxsSg1DvbYoYich9AtdTsa5nNk2++ImPiDiSxg==", "requires": { "d3-path": "1" } @@ -6708,9 +6709,9 @@ "integrity": "sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==" }, "d3-time-format": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.2.3.tgz", - "integrity": "sha512-RAHNnD8+XvC4Zc4d2A56Uw0yJoM7bsvOlJR33bclxq399Rak/b9bhvu/InjxdWhPtkgU53JJcleJTGkNRnN6IA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.2.1.tgz", + "integrity": "sha512-VA6WqORO1+H1SvSzgl2oT0z3niANh3opa8Cencpen1LFthw/bEX71R/DgjPlWw78J4UHmD0jCPP1W0HpwMkhjg==", "requires": { "d3-time": "1" } @@ -8791,29 +8792,25 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "bundled": true, "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "bundled": true, "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "resolved": false, - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "bundled": true, "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": false, - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8823,15 +8820,13 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "bundled": true, "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": false, - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8841,43 +8836,37 @@ }, "chownr": { "version": "1.1.1", - "resolved": false, - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "bundled": true, "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "bundled": true, "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": false, - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "bundled": true, "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": false, - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "bundled": true, "dev": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "bundled": true, "dev": true, "optional": true }, "debug": { "version": "4.1.1", - "resolved": false, - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8886,29 +8875,25 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": false, - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "bundled": true, "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "bundled": true, "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "bundled": true, "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": false, - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8917,15 +8902,13 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "bundled": true, "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": false, - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8941,8 +8924,7 @@ }, "glob": { "version": "7.1.3", - "resolved": false, - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8956,15 +8938,13 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "bundled": true, "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": false, - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8973,8 +8953,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": false, - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8983,8 +8962,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -8994,22 +8972,19 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "bundled": true, "dev": true, "optional": true }, "ini": { "version": "1.3.5", - "resolved": false, - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "bundled": true, "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9018,15 +8993,13 @@ }, "isarray": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "bundled": true, "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": false, - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9035,15 +9008,13 @@ }, "minimist": { "version": "0.0.8", - "resolved": false, - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "bundled": true, "dev": true, "optional": true }, "minipass": { "version": "2.3.5", - "resolved": false, - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9053,8 +9024,7 @@ }, "minizlib": { "version": "1.2.1", - "resolved": false, - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9063,8 +9033,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": false, - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9073,15 +9042,13 @@ }, "ms": { "version": "2.1.1", - "resolved": false, - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "bundled": true, "dev": true, "optional": true }, "needle": { "version": "2.3.0", - "resolved": false, - "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9092,8 +9059,7 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": false, - "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9111,8 +9077,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": false, - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9122,15 +9087,13 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": false, - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", + "bundled": true, "dev": true, "optional": true }, "npm-packlist": { "version": "1.4.1", - "resolved": false, - "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9140,8 +9103,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9153,22 +9115,19 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "bundled": true, "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": false, - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "bundled": true, "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": false, - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9177,22 +9136,19 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "bundled": true, "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "bundled": true, "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": false, - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9202,22 +9158,19 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "bundled": true, "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": false, - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "bundled": true, "dev": true, "optional": true }, "rc": { "version": "1.2.8", - "resolved": false, - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9229,8 +9182,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": false, - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "bundled": true, "dev": true, "optional": true } @@ -9238,8 +9190,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": false, - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9254,8 +9205,7 @@ }, "rimraf": { "version": "2.6.3", - "resolved": false, - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9264,50 +9214,43 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": false, - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "bundled": true, "dev": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": false, - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "bundled": true, "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": false, - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "bundled": true, "dev": true, "optional": true }, "semver": { "version": "5.7.0", - "resolved": false, - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "bundled": true, "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "bundled": true, "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "bundled": true, "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9318,8 +9261,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": false, - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9328,8 +9270,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": false, - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9338,15 +9279,13 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "bundled": true, "dev": true, "optional": true }, "tar": { "version": "4.4.8", - "resolved": false, - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9361,15 +9300,13 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "bundled": true, "dev": true, "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": false, - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "bundled": true, "dev": true, "optional": true, "requires": { @@ -9378,15 +9315,13 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "bundled": true, "dev": true, "optional": true }, "yallist": { "version": "3.0.3", - "resolved": false, - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "bundled": true, "dev": true, "optional": true } @@ -11879,6 +11814,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" + }, "lodash._reinterpolate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", @@ -11890,6 +11830,26 @@ "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "requires": { + "lodash._getnative": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" + } + }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -12106,9 +12066,9 @@ } }, "mdast-util-compact": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.4.tgz", - "integrity": "sha512-3YDMQHI5vRiS2uygEFYaqckibpJtKq5Sj2c8JioeOQBU6INpKbdWzfyLqFFnDwEcEnRFIdMsguzs5pC1Jp4Isg==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.3.tgz", + "integrity": "sha512-nRiU5GpNy62rZppDKbLwhhtw5DXoFMqw9UNZFmlPsNaQCZ//WLjGKUwWMdJrUH+Se7UvtO2gXtAMe0g/N+eI5w==", "requires": { "unist-util-visit": "^1.1.0" } @@ -13310,9 +13270,9 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" }, "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", "requires": { "isarray": "0.0.1" }, @@ -14907,16 +14867,16 @@ } }, "rc-animate": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-2.10.2.tgz", - "integrity": "sha512-cE/A7piAzoWFSgUD69NmmMraqCeqVBa51UErod8NS3LUEqWfppSVagHfa0qHAlwPVPiIBg3emRONyny3eiH0Dg==", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/rc-animate/-/rc-animate-2.10.1.tgz", + "integrity": "sha512-yfP3g5fNf8wB5eh85nim2IGrqNu5u7TKrrSh710+1vlUqZvnI2R5YHK99IBCQNgkLCAWjT0sHtkcYdynjly39w==", "requires": { "babel-runtime": "6.x", "classnames": "^2.2.6", "css-animation": "^1.3.2", "prop-types": "15.x", "raf": "^3.4.0", - "rc-util": "^4.15.3", + "rc-util": "^4.8.0", "react-lifecycles-compat": "^3.0.4" } }, @@ -14960,15 +14920,25 @@ } }, "rc-util": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.18.1.tgz", - "integrity": "sha512-3aRHG32ZvqBymtJUGoQnbZS+XANzO6XTiFEFAYI3BfuxESEazopAy0kBwcAI6BlLHsW1oLiy3ysE9uYwylh2ag==", + "version": "4.14.4", + "resolved": "https://registry.npmjs.org/rc-util/-/rc-util-4.14.4.tgz", + "integrity": "sha512-GQgEn6ywJYZq1NEoZ6NZzeaE2U6mT6DhdqrtRV5IBNM3yTZZW8HRjIiMOpXOhTEUj10bnHnKWKZpC36RoNmS9Q==", "requires": { "add-dom-event-listener": "^1.1.0", "babel-runtime": "6.x", "prop-types": "^15.5.10", "react-lifecycles-compat": "^3.0.4", - "shallowequal": "^1.1.0" + "shallowequal": "^0.2.2" + }, + "dependencies": { + "shallowequal": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-0.2.2.tgz", + "integrity": "sha1-HjL9W8q2rWiKSBLLDMBO/HXHAU4=", + "requires": { + "lodash.keys": "^3.1.2" + } + } } }, "react": { @@ -15561,23 +15531,19 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "bundled": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "bundled": true }, "aproba": { "version": "1.2.0", - "resolved": false, - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + "bundled": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": false, - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "bundled": true, "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -15585,13 +15551,11 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "bundled": true }, "brace-expansion": { "version": "1.1.11", - "resolved": false, - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "bundled": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -15599,69 +15563,57 @@ }, "chownr": { "version": "1.1.1", - "resolved": false, - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==" + "bundled": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "bundled": true }, "concat-map": { "version": "0.0.1", - "resolved": false, - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "bundled": true }, "console-control-strings": { "version": "1.1.0", - "resolved": false, - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + "bundled": true }, "core-util-is": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "bundled": true }, "debug": { "version": "4.1.1", - "resolved": false, - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "bundled": true, "requires": { "ms": "^2.1.1" } }, "deep-extend": { "version": "0.6.0", - "resolved": false, - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + "bundled": true }, "delegates": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" + "bundled": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" + "bundled": true }, "fs-minipass": { "version": "1.2.5", - "resolved": false, - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "bundled": true, "requires": { "minipass": "^2.2.1" } }, "fs.realpath": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "bundled": true }, "gauge": { "version": "2.7.4", - "resolved": false, - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "bundled": true, "requires": { "aproba": "^1.0.3", "console-control-strings": "^1.0.0", @@ -15675,8 +15627,7 @@ }, "glob": { "version": "7.1.3", - "resolved": false, - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "bundled": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -15688,29 +15639,25 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" + "bundled": true }, "iconv-lite": { "version": "0.4.24", - "resolved": false, - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "bundled": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" } }, "ignore-walk": { "version": "3.0.1", - "resolved": false, - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "bundled": true, "requires": { "minimatch": "^3.0.4" } }, "inflight": { "version": "1.0.6", - "resolved": false, - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "bundled": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -15718,44 +15665,37 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "bundled": true }, "ini": { "version": "1.3.5", - "resolved": false, - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "bundled": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, "requires": { "number-is-nan": "^1.0.0" } }, "isarray": { "version": "1.0.0", - "resolved": false, - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "bundled": true }, "minimatch": { "version": "3.0.4", - "resolved": false, - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "bundled": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "resolved": false, - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "bundled": true }, "minipass": { "version": "2.3.5", - "resolved": false, - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "bundled": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -15763,29 +15703,25 @@ }, "minizlib": { "version": "1.2.1", - "resolved": false, - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "bundled": true, "requires": { "minipass": "^2.2.1" } }, "mkdirp": { "version": "0.5.1", - "resolved": false, - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "bundled": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.1.1", - "resolved": false, - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "bundled": true }, "needle": { "version": "2.3.0", - "resolved": false, - "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", + "bundled": true, "requires": { "debug": "^4.1.0", "iconv-lite": "^0.4.4", @@ -15794,8 +15730,7 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": false, - "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", + "bundled": true, "requires": { "detect-libc": "^1.0.2", "mkdirp": "^0.5.1", @@ -15811,8 +15746,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": false, - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "bundled": true, "requires": { "abbrev": "1", "osenv": "^0.1.4" @@ -15820,13 +15754,11 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": false, - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" + "bundled": true }, "npm-packlist": { "version": "1.4.1", - "resolved": false, - "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", + "bundled": true, "requires": { "ignore-walk": "^3.0.1", "npm-bundled": "^1.0.1" @@ -15834,8 +15766,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "bundled": true, "requires": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", @@ -15845,36 +15776,30 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "bundled": true }, "object-assign": { "version": "4.1.1", - "resolved": false, - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "bundled": true }, "once": { "version": "1.4.0", - "resolved": false, - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, "requires": { "wrappy": "1" } }, "os-homedir": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + "bundled": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "bundled": true }, "osenv": { "version": "0.1.5", - "resolved": false, - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "bundled": true, "requires": { "os-homedir": "^1.0.0", "os-tmpdir": "^1.0.0" @@ -15882,18 +15807,15 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "bundled": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": false, - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "bundled": true }, "rc": { "version": "1.2.8", - "resolved": false, - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "bundled": true, "requires": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -15903,15 +15825,13 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": false, - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "bundled": true } } }, "readable-stream": { "version": "2.3.6", - "resolved": false, - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "bundled": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -15924,46 +15844,38 @@ }, "rimraf": { "version": "2.6.3", - "resolved": false, - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "bundled": true, "requires": { "glob": "^7.1.3" } }, "safe-buffer": { "version": "5.1.2", - "resolved": false, - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "bundled": true }, "safer-buffer": { "version": "2.1.2", - "resolved": false, - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "bundled": true }, "sax": { "version": "1.2.4", - "resolved": false, - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "bundled": true }, "semver": { "version": "5.7.0", - "resolved": false, - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "bundled": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "bundled": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + "bundled": true }, "string-width": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -15972,29 +15884,25 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": false, - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "bundled": true, "requires": { "safe-buffer": "~5.1.0" } }, "strip-ansi": { "version": "3.0.1", - "resolved": false, - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "bundled": true, "requires": { "ansi-regex": "^2.0.0" } }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + "bundled": true }, "tar": { "version": "4.4.8", - "resolved": false, - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "bundled": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", @@ -16007,26 +15915,22 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "bundled": true }, "wide-align": { "version": "1.1.3", - "resolved": false, - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "bundled": true, "requires": { "string-width": "^1.0.2 || 2" } }, "wrappy": { "version": "1.0.2", - "resolved": false, - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "bundled": true }, "yallist": { "version": "3.0.3", - "resolved": false, - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "bundled": true } } }, @@ -19169,9 +19073,9 @@ } }, "unist-util-find-all-after": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-1.0.5.tgz", - "integrity": "sha512-lWgIc3rrTMTlK1Y0hEuL+k+ApzFk78h+lsaa2gHf63Gp5Ww+mt11huDniuaoq1H+XMK2lIIjjPkncxXcDp3QDw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-1.0.4.tgz", + "integrity": "sha512-CaxvMjTd+yF93BKLJvZnEfqdM7fgEACsIpQqz8vIj9CJnUb9VpyymFS3tg6TCtgrF7vfCJBF5jbT2Ox9CBRYRQ==", "requires": { "unist-util-is": "^3.0.0" } @@ -19182,17 +19086,17 @@ "integrity": "sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==" }, "unist-util-remove-position": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.4.tgz", - "integrity": "sha512-tLqd653ArxJIPnKII6LMZwH+mb5q+n/GtXQZo6S6csPRs5zB0u79Yw8ouR3wTw8wxvdJFhpP6Y7jorWdCgLO0A==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.3.tgz", + "integrity": "sha512-CtszTlOjP2sBGYc2zcKA/CvNdTdEs3ozbiJ63IPBxh8iZg42SCCb8m04f8z2+V1aSk5a7BxbZKEdoDjadmBkWA==", "requires": { "unist-util-visit": "^1.1.0" } }, "unist-util-stringify-position": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.2.tgz", - "integrity": "sha512-nK5n8OGhZ7ZgUwoUbL8uiVRwAbZyzBsB/Ddrlbu6jwwubFza4oe15KlyEaLNMXQW1svOQq4xesUeqA85YrIUQA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.1.tgz", + "integrity": "sha512-Zqlf6+FRI39Bah8Q6ZnNGrEHUhwJOkHde2MHVk96lLyftfJJckaPslKgzhVcviXj8KcE9UJM9F+a4JEiBUTYgA==", "requires": { "@types/unist": "^2.0.2" } @@ -19593,16 +19497,16 @@ } }, "vfile-location": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.6.tgz", - "integrity": "sha512-sSFdyCP3G6Ka0CEmN83A2YCMKIieHx0EDaj5IDP4g1pa5ZJ4FJDvpO0WODLxo4LUX4oe52gmSCK7Jw4SBghqxA==" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.5.tgz", + "integrity": "sha512-Pa1ey0OzYBkLPxPZI3d9E+S4BmvfVwNAAXrrqGbwTVXWaX2p9kM1zZ+n35UtVM06shmWKH4RPRN8KI80qE3wNQ==" }, "vfile-message": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.2.tgz", - "integrity": "sha512-gNV2Y2fDvDOOqq8bEe7cF3DXU6QgV4uA9zMR2P8tix11l1r7zju3zry3wZ8sx+BEfuO6WQ7z2QzfWTvqHQiwsA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.1.tgz", + "integrity": "sha512-KtasSV+uVU7RWhUn4Lw+wW1Zl/nW8JWx7JCPps10Y9JRRIDeDXf8wfBLoOSsJLyo27DqMyAi54C6Jf/d6Kr2Bw==", "requires": { - "@types/unist": "^2.0.0", + "@types/unist": "^2.0.2", "unist-util-stringify-position": "^2.0.0" } }, diff --git a/package.json b/package.json index 551889e1..0481d60c 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "homepage": "https://github.com/uc-cdis/guppy#readme", "dependencies": { "@elastic/elasticsearch": "^7.0.0-rc.1", - "@gen3/ui-component": "git://github.com/uc-cdis/gen3-ui-component.git#fix/filter-state-bug", + "@gen3/ui-component": "0.3.11", "apollo-server": "^2.4.8", "apollo-server-express": "^2.4.8", "body-parser": "^1.18.3", From 71989c167e9a3de2d66e53d7518b64339d0b0b93 Mon Sep 17 00:00:00 2001 From: Zakir Gowani Date: Wed, 5 Feb 2020 14:50:29 -0600 Subject: [PATCH 52/52] PR feedback --- src/components/ConnectedFilter/index.jsx | 6 +++--- src/components/Utils/filters.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/ConnectedFilter/index.jsx b/src/components/ConnectedFilter/index.jsx index 829ab425..7903f3a6 100644 --- a/src/components/ConnectedFilter/index.jsx +++ b/src/components/ConnectedFilter/index.jsx @@ -166,7 +166,7 @@ class ConnectedFilter extends React.Component { tabs={filterTabs} filterConfig={this.props.filterConfig} onFilterChange={e => this.handleFilterChange(e)} - hideZero={this.props.hideZeroCountFilterOptions} + hideZero={this.props.hideZero} /> ); } @@ -197,7 +197,7 @@ ConnectedFilter.propTypes = { lockedTooltipMessage: PropTypes.string, disabledTooltipMessage: PropTypes.string, accessibleFieldCheckList: PropTypes.arrayOf(PropTypes.string), - hideZeroCountFilterOptions: PropTypes.bool, + hideZero: PropTypes.bool, }; ConnectedFilter.defaultProps = { @@ -212,7 +212,7 @@ ConnectedFilter.defaultProps = { lockedTooltipMessage: '', disabledTooltipMessage: '', accessibleFieldCheckList: undefined, - hideZeroCountFilterOptions: false, + hideZero: false, }; export default ConnectedFilter; diff --git a/src/components/Utils/filters.js b/src/components/Utils/filters.js index 4ee52dad..ae29c9dc 100644 --- a/src/components/Utils/filters.js +++ b/src/components/Utils/filters.js @@ -83,6 +83,7 @@ export const updateCountsInInitialTabsOptions = ( updatedTabsOptions[fieldName].histogram[k], filtersApplied, fieldName, )) { updatedTabsOptions[fieldName].histogram.splice(k, 1); + break; } } }