From bc5292680b65f10051a7370dd06c7aa29660c93b Mon Sep 17 00:00:00 2001 From: Ajay Doddapaneni Date: Wed, 30 Dec 2020 10:38:52 -0500 Subject: [PATCH 1/4] Fixing the filtering actions and counts --- src/bento/dashboardData.js | 36 +- src/bento/dashboardTabData.js | 428 +++++++++++++----- .../SideBar/SideBarComponents/FacetFilters.js | 12 +- .../dashboardTab/store/dashboardReducer.js | 27 +- 4 files changed, 376 insertions(+), 127 deletions(-) diff --git a/src/bento/dashboardData.js b/src/bento/dashboardData.js index 2852b869b..554d04b7f 100644 --- a/src/bento/dashboardData.js +++ b/src/bento/dashboardData.js @@ -4,65 +4,68 @@ import gql from 'graphql-tag'; // A maximum of 12 facetSearchData are allowed export const facetSearchData = [ { - label: 'Program', field: 'group', api: 'subjectCountByProgram', datafield: 'programs', section: 'Filter By Cases', show: true, + label: 'Program', field: 'group', api: 'subjectCountByProgram', apiForFiltering: 'filterSubjectCountByProgram', datafield: 'programs', section: 'Filter By Cases', show: true, }, { - label: 'Arm', field: 'group', api: 'subjectCountByStudy', datafield: 'studies', section: 'Filter By Cases', show: true, + label: 'Arm', field: 'group', api: 'subjectCountByStudy', apiForFiltering: 'filterSubjectCountByStudy', datafield: 'studies', section: 'Filter By Cases', show: true, }, { - label: 'Diagnosis', field: 'group', api: 'subjectCountByDiagnoses', datafield: 'diagnoses', section: 'Filter By Cases', show: true, + label: 'Diagnosis', field: 'group', api: 'subjectCountByDiagnoses', apiForFiltering: 'filterSubjectCountByDiagnoses', datafield: 'diagnoses', section: 'Filter By Cases', show: true, }, { - label: 'Recurrence Score', field: 'group', api: 'subjectCountByRecurrenceScore', datafield: 'rc_scores', section: 'Filter By Cases', show: true, + label: 'Recurrence Score', field: 'group', api: 'subjectCountByRecurrenceScore', apiForFiltering: 'filterSubjectCountByRecurrenceScore', datafield: 'rc_scores', section: 'Filter By Cases', show: true, }, { - label: 'Tumor Size', field: 'group', api: 'subjectCountByTumorSize', datafield: 'tumor_sizes', section: 'Filter By Cases', show: true, + label: 'Tumor Size', field: 'group', api: 'subjectCountByTumorSize', apiForFiltering: 'filterSubjectCountByTumorSize', datafield: 'tumor_sizes', section: 'Filter By Cases', show: true, }, { - label: 'Chemotherapy', field: 'group', api: 'subjectCountByChemotherapyRegimen', datafield: 'chemo_regimen', section: 'Filter By Cases', show: true, + label: 'Chemotherapy', field: 'group', api: 'subjectCountByChemotherapyRegimen', apiForFiltering: 'filterSubjectCountByChemotherapyRegimen', datafield: 'chemo_regimen', section: 'Filter By Cases', show: true, }, { - label: 'Tumor Grade', field: 'group', api: 'subjectCountByTumorGrade', datafield: 'tumor_grades', section: 'Filter By Cases', show: true, + label: 'Tumor Grade', field: 'group', api: 'subjectCountByTumorGrade', apiForFiltering: 'filterSubjectCountByTumorGrade', datafield: 'tumor_grades', section: 'Filter By Cases', show: true, }, { - label: 'ER Status', field: 'group', api: 'subjectCountByErStatus', datafield: 'er_status', section: 'Filter By Cases', show: true, + label: 'ER Status', field: 'group', api: 'subjectCountByErStatus', apiForFiltering: 'filterSubjectCountByErStatus', datafield: 'er_status', section: 'Filter By Cases', show: true, }, { - label: 'PR Status', field: 'group', api: 'subjectCountByPrStatus', datafield: 'pr_status', section: 'Filter By Cases', show: true, + label: 'PR Status', field: 'group', api: 'subjectCountByPrStatus', apiForFiltering: 'filterSubjectCountByPrStatus', datafield: 'pr_status', section: 'Filter By Cases', show: true, }, { - label: 'Endocrine Therapy', field: 'group', api: 'subjectCountByEndocrineTherapy', datafield: 'endo_therapies', section: 'Filter By Cases', show: true, + label: 'Endocrine Therapy', field: 'group', api: 'subjectCountByEndocrineTherapy', apiForFiltering: 'filterSubjectCountByEndocrineTherapy', datafield: 'endo_therapies', section: 'Filter By Cases', show: true, }, { - label: 'Menopause Status', field: 'group', api: 'subjectCountByMenopauseStatus', datafield: 'meno_status', section: 'Filter By Cases', show: true, + label: 'Menopause Status', field: 'group', api: 'subjectCountByMenopauseStatus', apiForFiltering: 'filterSubjectCountByMenopauseStatus', datafield: 'meno_status', section: 'Filter By Cases', show: true, }, { - label: 'Tissue Type', field: 'group', api: 'subjectCountByTissueType', datafield: 'tissue_type', section: 'Filter By Samples', show: true, + label: 'Tissue Type', field: 'group', api: 'subjectCountByTissueType', apiForFiltering: 'filterSubjectCountByTissueType', datafield: 'tissue_type', section: 'Filter By Samples', show: true, }, { - label: 'Tissue Composition', field: 'group', api: 'subjectCountByTissueComposition', datafield: 'composition', section: 'Filter By Samples', show: true, + label: 'Tissue Composition', field: 'group', api: 'subjectCountByTissueComposition', apiForFiltering: 'filterSubjectCountByTissueComposition', datafield: 'composition', section: 'Filter By Samples', show: true, }, { - label: 'File Association', field: 'group', api: 'subjectCountByFileAssociation', datafield: 'association', section: 'Filter By Files', show: true, + label: 'File Association', field: 'group', api: 'subjectCountByFileAssociation', apiForFiltering: 'filterSubjectCountByFileAssociation', datafield: 'association', section: 'Filter By Files', show: true, }, { - label: 'File Type', field: 'group', api: 'subjectCountByFileType', datafield: 'file_type', section: 'Filter By Files', show: true, + label: 'File Type', field: 'group', api: 'subjectCountByFileType', apiForFiltering: 'filterSubjectCountByFileType', datafield: 'file_type', section: 'Filter By Files', show: true, }, ]; // --------------- Dashboard Sidebar Sections styling -------------- -export const facetSectionStyling = { +export const facetSectionVariables = { 'Filter By Cases': { color: '#10A075', height: '5px', + labelAfterCount: 'cases', }, 'Filter By Samples': { color: '#10BEFF', height: '5px', + labelAfterCount: 'samples', }, 'Filter By Files': { color: '#E636E4', height: '5px', + labelAfterCount: 'files', }, }; @@ -307,7 +310,6 @@ subjectCountByTissueType{ // --------------- Dashboard Query configuration -------------- export const GET_DASHBOARD_TABLE_DATA_QUERY = gql`{ - subjectOverViewPaged(first: 1000000) { subject_id program_id diff --git a/src/bento/dashboardTabData.js b/src/bento/dashboardTabData.js index bbbfe03e2..e35c96d01 100644 --- a/src/bento/dashboardTabData.js +++ b/src/bento/dashboardTabData.js @@ -485,7 +485,6 @@ export const DASHBOARD_QUERY = gql`{ size } } - subjectOverViewPaged(first: 10) { subject_id program_id @@ -541,82 +540,6 @@ fileOverview(first: 10) { export const FILTER_GROUP_QUERY = gql` query groupCounts($subject_ids: [String]){ - subjectCountByProgram(subject_ids: $subject_ids) { - group - subjects - } - subjectCountByStudy(subject_ids: $subject_ids) { - group - subjects - } - subjectCountByDiagnoses (subject_ids: $subject_ids){ - group - subjects - } - subjectCountByRecurrenceScore (subject_ids: $subject_ids){ - group - subjects - } - subjectCountByTumorSize(subject_ids: $subject_ids) { - group - subjects - } - subjectCountByChemotherapyRegimen(subject_ids: $subject_ids) { - group - subjects - } - subjectCountByEndocrineTherapy (subject_ids: $subject_ids){ - group - subjects - } - subjectCountByTumorGrade(subject_ids: $subject_ids){ - group - subjects - } - subjectCountByErStatus(subject_ids: $subject_ids){ - group - subjects - } - subjectCountByPrStatus(subject_ids: $subject_ids){ - group - subjects - } - subjectCountByMenopauseStatus(subject_ids: $subject_ids){ - group - subjects - } - subjectCountByFileType (subject_ids: $subject_ids){ - group - subjects - } - subjectCountByFileAssociation(subject_ids: $subject_ids) { - group - subjects - } - subjectCountByTissueComposition(subject_ids: $subject_ids) { - group - subjects - } - subjectCountByTissueType(subject_ids: $subject_ids) { - group - subjects - } - subjectCountByFileType (subject_ids: $subject_ids){ - group - subjects -} -subjectCountByFileAssociation(subject_ids: $subject_ids) { - group - subjects -} -subjectCountByTissueComposition(subject_ids: $subject_ids) { - group - subjects -} -subjectCountByTissueType(subject_ids: $subject_ids) { - group - subjects -} armsByPrograms(subject_ids: $subject_ids) { program caseSize @@ -626,6 +549,26 @@ subjectCountByTissueType(subject_ids: $subject_ids) { size } } + subjectCountByDiagnoses (subject_ids: $subject_ids){ + group + subjects +} +subjectCountByRecurrenceScore (subject_ids: $subject_ids){ + group + subjects +} +subjectCountByTumorSize(subject_ids: $subject_ids) { + group + subjects +} +subjectCountByChemotherapyRegimen(subject_ids: $subject_ids) { + group + subjects +} +subjectCountByEndocrineTherapy (subject_ids: $subject_ids){ + group + subjects +} } `; @@ -646,7 +589,7 @@ query search ( $tissue_type: [String], $composition: [String], $association: [String], - $file_type: [String] + $file_type: [String]=[] $first: Int ){ searchSubjects ( @@ -676,11 +619,11 @@ query search ( subjectIds firstPage { subject_id - program program_id - study_acronym - study_short_description study_info + samples + program + study_acronym diagnosis recurrence_score tumor_size @@ -692,30 +635,317 @@ query search ( menopause_status age_at_index survival_time - survival_time_unit - files { - file_id + lab_procedures + files{ file_id - file_description - file_format - file_location - file_name - file_size - file_status - file_type - md5sum } - lab_procedures - samples } } -} -`; + filterSubjectCountByProgram ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByStudy ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByDiagnoses ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByRecurrenceScore ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByTumorSize ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByTumorGrade ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByErStatus ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByPrStatus ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByChemotherapyRegimen ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByEndocrineTherapy ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByMenopauseStatus ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByTissueType ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByTissueComposition ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByFileAssociation ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } + filterSubjectCountByFileType ( + programs: $programs, + studies: $studies, + diagnoses: $diagnoses, + rc_scores: $rc_scores, + tumor_sizes: $tumor_sizes, + chemo_regimen: $chemo_regimen, + tumor_grades: $tumor_grades, + er_status: $er_status, + pr_status: $pr_status, + endo_therapies: $endo_therapies, + meno_status: $meno_status, + tissue_type: $tissue_type, + composition: $composition, + association: $association, + file_type: $file_type + ) { + group + subjects + } +}`; // --------------- GraphQL query - Retrieve files tab details -------------- export const GET_FILES_OVERVIEW_QUERY = gql` query fileOverview($subject_ids: [String], $offset: Int = 0, $first: Int = 10, $order_by:String ="file_name"){ - fileOverview(subject_ids: $subject_ids, offset: $offset,first: $first, order_by: $order_by) { file_id file_name @@ -782,7 +1012,6 @@ export const GET_CASES_OVERVIEW_QUERY = gql` lab_procedures } } - `; export const GET_ALL_FILEIDS_FOR_SELECT_ALL = gql` @@ -793,11 +1022,9 @@ export const GET_ALL_FILEIDS_FOR_SELECT_ALL = gql` } } } - `; export const GET_FILES_OVERVIEW_DESC_QUERY = gql` query fileOverviewDesc($subject_ids: [String], $offset: Int = 0, $first: Int = 10, $order_by:String ="file_name"){ - fileOverviewDesc(subject_ids: $subject_ids, offset: $offset,first: $first, order_by: $order_by) { file_id file_name @@ -864,5 +1091,4 @@ export const GET_CASES_OVERVIEW_DESC_QUERY = gql` lab_procedures } } - `; diff --git a/src/components/SideBar/SideBarComponents/FacetFilters.js b/src/components/SideBar/SideBarComponents/FacetFilters.js index 5a8939857..643f006f0 100644 --- a/src/components/SideBar/SideBarComponents/FacetFilters.js +++ b/src/components/SideBar/SideBarComponents/FacetFilters.js @@ -18,7 +18,7 @@ import { as ArrowDropDownIcon, } from '@material-ui/icons'; import { toggleCheckBox, setSideBarToLoading, setDashboardTableLoading } from '../../../pages/dashboardTab/store/dashboardReducer'; -import { facetSectionStyling, facetSearchData } from '../../../bento/dashboardData'; +import { facetSectionVariables, facetSearchData } from '../../../bento/dashboardData'; const CustomExpansionPanelSummary = withStyles({ root: { @@ -141,11 +141,11 @@ const FacetPanel = ({ classes }) => { { />
{`${checkboxItem.name}`} - +   {`(${checkboxItem.subjects})`} diff --git a/src/pages/dashboardTab/store/dashboardReducer.js b/src/pages/dashboardTab/store/dashboardReducer.js index f956875ec..9cac7079c 100644 --- a/src/pages/dashboardTab/store/dashboardReducer.js +++ b/src/pages/dashboardTab/store/dashboardReducer.js @@ -1,7 +1,6 @@ import _ from 'lodash'; import { customCheckBox, - updateCheckBox, getFilters, filterData, getCheckBoxData, @@ -10,6 +9,7 @@ import { getDonutDataFromDashboardData, setSelectedFilterValues, transformInitialDataForSunburst, + transformAPIDataIntoCheckBoxData, } from 'bento-components'; import { globalStatsData as statsCount } from '../../../bento/globalStatsData'; import { widgetsData, facetSearchData } from '../../../bento/dashboardData'; @@ -406,6 +406,27 @@ export function setDashboardTableLoading() { store.dispatch({ type: 'SET_DASHBOARDTABLE_LOADING' }); } +/** + * updateFilteredAPIDataIntoCheckBoxData works for first time init Checkbox, +that function transforms the data which returns from API into a another format +so it contains more information and easy for front-end to show it correctly. + * * @param {object} currentGroupCount + * * @param {object} willUpdateGroupCount + * * @param {object} currentCheckboxSelection + * @return {json} + */ +export function updateFilteredAPIDataIntoCheckBoxData(data, facetSearchDataFromConfig) { + return ( + facetSearchDataFromConfig.map((mapping) => ({ + groupName: mapping.label, + checkboxItems: transformAPIDataIntoCheckBoxData(data[mapping.apiForFiltering], mapping.field), + datafield: mapping.datafield, + show: mapping.show, + section: mapping.section, + })) + ); +} + export const getDashboard = () => getState(); // reducers @@ -425,8 +446,8 @@ const reducers = { isDashboardTableLoading: false, }), TOGGGLE_CHECKBOX_WITH_API: (state, item) => { - const updatedCheckboxData1 = updateCheckBox( - state.checkbox.data, item.groups.data, item.filter[0], facetSearchData, + const updatedCheckboxData1 = updateFilteredAPIDataIntoCheckBoxData( + item.data, facetSearchData, ); const checkboxData1 = setSelectedFilterValues(updatedCheckboxData1, item.allFilters); fetchDataForDashboardTab(state.currentActiveTab, item.data.searchSubjects.subjectIds); From 44ee2b119e56f1c12844d6d23f15ef44aef45d02 Mon Sep 17 00:00:00 2001 From: Ajay Doddapaneni Date: Wed, 30 Dec 2020 11:05:05 -0500 Subject: [PATCH 2/4] removing unsed variables --- src/bento/dashboardData.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/bento/dashboardData.js b/src/bento/dashboardData.js index 554d04b7f..c7c750c1f 100644 --- a/src/bento/dashboardData.js +++ b/src/bento/dashboardData.js @@ -55,17 +55,14 @@ export const facetSectionVariables = { 'Filter By Cases': { color: '#10A075', height: '5px', - labelAfterCount: 'cases', }, 'Filter By Samples': { color: '#10BEFF', height: '5px', - labelAfterCount: 'samples', }, 'Filter By Files': { color: '#E636E4', height: '5px', - labelAfterCount: 'files', }, }; From 5e6f06646d6e83fd24be226187d2acb2d3673011 Mon Sep 17 00:00:00 2001 From: Ajay Doddapaneni Date: Wed, 6 Jan 2021 09:08:02 -0500 Subject: [PATCH 3/4] removing tissue type from samples tab --- src/bento/dashboardTabData.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/bento/dashboardTabData.js b/src/bento/dashboardTabData.js index e35c96d01..60f079fde 100644 --- a/src/bento/dashboardTabData.js +++ b/src/bento/dashboardTabData.js @@ -200,12 +200,6 @@ export const tabContainers = [ sort: 'asc', display: true, }, - { - dataField: 'tumor_size', - header: 'Tumor Size (cm)', - sort: 'asc', - display: true, - }, { dataField: 'tissue_composition', header: 'Tissue Composition', From a52e1650419c956399518af33389f93f2fe4709e Mon Sep 17 00:00:00 2001 From: Ajay Doddapaneni Date: Fri, 8 Jan 2021 10:44:39 -0500 Subject: [PATCH 4/4] fixing cart number issue on page refresh --- src/components/NavBar/NavBarContainer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/NavBar/NavBarContainer.js b/src/components/NavBar/NavBarContainer.js index 1e31d9504..174240c7b 100755 --- a/src/components/NavBar/NavBarContainer.js +++ b/src/components/NavBar/NavBarContainer.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux'; import { withRouter } from 'react-router-dom'; import NavBarView from './NavBarView'; import { toggleSidebar } from '../Layout/LayoutState'; +import { initCart } from '../../pages/fileCentricCart/store/cart'; export default compose( withRouter, @@ -14,6 +15,9 @@ export default compose( { toggleSidebar }, ), lifecycle({ + componentDidMount() { + initCart(); + }, shouldComponentUpdate({ location: nextLocation }) { const pathName = this.props.location.pathname; return (