Skip to content

Commit

Permalink
Merge pull request #118 from CBIIT/INS-434
Browse files Browse the repository at this point in the history
Ins 434
  • Loading branch information
n2iw authored Dec 8, 2022
2 parents 712e4cb + 3742f25 commit 0ce8bd5
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 146 deletions.
15 changes: 0 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/Layout/LayoutView.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Layout = ({ classes, isSidebarOpened }) => (
>
<Route component={ScrollToTop} />
<Switch>
<Route exact path="/INS/" component={Home} />
<Route exact path="/INS" component={Home} />
<Route exact path="/" component={Home} />
<Route exact path="/home" component={Home} />
<Route path="/explore" component={Dashboard} />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Tab/Tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const TabItems = ({
currentTab,
orientation,
}) => {
function getTabLalbel(title, image, index) {
function getTabLabel(title, image, index) {
return (
<TabLabel
title={title}
Expand All @@ -26,7 +26,7 @@ const TabItems = ({
<Tab
index={tab.index}
label={
getTabLalbel(tab.label, tab.icon, tab.index)
getTabLabel(tab.label, tab.icon, tab.index)
}
key={index}
disableRipple
Expand Down
8 changes: 0 additions & 8 deletions src/pages/caseDetail/caseDetailState.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ function readyCaseDetail() {
};
}

export function fetchAllDataForCaseDetailDataTable() {
return (dispatch, getState) => Promise.resolve();
}

export function AsyncFetchAllDataForCaseDetailDataTable() {
return async (dispatch, getState) => Promise.resolve();
}

export function fetchDataForCaseDetailDataTable() {
return (dispatch, getState) => dispatch(readyCaseDetail());
}
Expand Down
8 changes: 2 additions & 6 deletions src/pages/caseDetail/caseDetailTabController.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const caseDetailTabController = ({ projectID, classes }) => {
return `${tabIndex[currentTab].primaryColor}`;
}

function getTabLalbel(title, count) {
function getTabLabel(title, count) {
const tabObj = tabIndex[currentTab];

if (!tabObj || !tabObj.title) {
Expand All @@ -89,7 +89,7 @@ const caseDetailTabController = ({ projectID, classes }) => {
key={index}
id={tab.id}
label={
getTabLalbel(tab.title, caseDetailStats[dataRoot][tab.count]
getTabLabel(tab.title, caseDetailStats[dataRoot][tab.count]
? caseDetailStats[dataRoot][tab.count] : 0)
}
/>
Expand All @@ -102,11 +102,7 @@ const caseDetailTabController = ({ projectID, classes }) => {
options={getOptions(container, classes)}
data={caseDetail[container.dataField] ? caseDetail[container.dataField] : 'undefined'}
customColumn={container}
buttonText={container.buttonText}
tableID={container.tableID}
saveButtonDefaultStyle={container.saveButtonDefaultStyle}
ActiveSaveButtonDefaultStyle={container.ActiveSaveButtonDefaultStyle}
DeactiveSaveButtonDefaultStyle={container.DeactiveSaveButtonDefaultStyle}
// eslint-disable-next-line jsx-a11y/tabindex-no-positive
tabIndex={container.tabIndex}
externalLinkIcon={externalLinkIcon}
Expand Down
1 change: 0 additions & 1 deletion src/pages/caseDetail/caseDetailTabView.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const TabView = ({
classes,
data,
customColumn,
primaryKeyIndex = 0,
tableID,
externalLinkIcon,
options,
Expand Down
1 change: 0 additions & 1 deletion src/pages/caseDetail/caseDetailView.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
withStyles,
} from '@material-ui/core';
import _ from 'lodash';
import { useDispatch } from 'react-redux';
import StatsView from '../../components/Stats/StatsView';
import { Typography } from '../../components/Wrappers/Wrappers';
import icon from '../../assets/icons/Cases.Icon.svg';
Expand Down
110 changes: 0 additions & 110 deletions src/pages/caseDetail/store/caseDetailReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
/* eslint-disable arrow-body-style */
/* eslint-disable react/destructuring-assignment */
import _ from 'lodash';
import {
customSort,
transformAPIDataIntoCheckBoxData,
} from 'bento-components';
import store from '../../../store';
import client from '../../../utils/graphqlClient';

Expand All @@ -17,7 +13,6 @@ import {
GET_DATASETS_OVERVIEW_QUERY,
GET_CLINICAL_TRIALS_OVERVIEW_QUERY,
GET_PATENTS_OVERVIEW_QUERY,
// caseIDField,
} from '../../../bento/caseDetailData';

const storeKey = 'caseDetailTab';
Expand Down Expand Up @@ -153,37 +148,8 @@ export function setCaseDetailTableLoading() {
store.dispatch({ type: 'SET_CASE_DETAIL_TABLE_LOADING' });
}

/**
* Reducer for sorting checkboxes.
*
* @return distpatcher
*/

export function sortSection(groupName, sortBy) {
store.dispatch({
type: 'SORT_SINGLE_GROUP_CHECKBOX',
payload: {
groupName,
sortBy,
},
});
}

export function sortAll() {
store.dispatch({
type: 'SORT_ALL_GROUP_CHECKBOX_CASE_DETAIL',
});
}

export const getCaseDetail = () => getState();

export function setSearchCriteria(payload) {
store.dispatch({
type: 'SET_SEARCH_CRITERIA',
payload,
});
}

// reducers
const reducers = {
CASE_DETAIL_TAB_QUERY_ERR: (state, item) => ({
Expand Down Expand Up @@ -216,17 +182,11 @@ const reducers = {
},
}
),
SET_SEARCH_CRITERIA: (state, item) => ({
...state,
searchCriteria: item,
}),
REQUEST_CASE_DETAIL_TAB: (state) => ({ ...state, isLoading: true }),
SET_SIDEBAR_LOADING: (state) => ({ ...state, setSideBarLoading: true }),
SET_CASE_DETAIL_TABLE_LOADING: (state) => ({ ...state, isCaseDetailTableLoading: true }),
RECEIVE_CASE_DETAIL_TAB: (state, rawItem) => {
const item = rawItem;
const filter = { project_id: item.data.projectDetail.project_id };
// fetchDataForCaseDetailTab(tabIndex[0].title, allFilters(), null, null, null, null, null);
return item.data
? {
...state.caseDetail,
Expand All @@ -243,76 +203,6 @@ const reducers = {
data: item.data,
} : { ...state };
},
CLEAR_SECTION_SORT: (state, item) => {
const { sortByList = {} } = state;
const { groupName } = item;
// eslint-disable-next-line
sortByList[groupName] ? delete sortByList[groupName] : null;

return { ...state, sortByList };
},
SET_SAMPLE_SELECTION: (state, item) => (
{
...state,
dataSampleSelected: item,
}
),

CLEAR_TABLE_SELECTION: (state) => ({
...state,
dataSampleSelected: {
selectedRowInfo: [],
selectedRowIndex: [],
},
dataFileSelected: {
selectedRowInfo: [],
selectedRowIndex: [],
},
dataClinicalTrialSelected: {
selectedRowInfo: [],
selectedRowIndex: [],
},
dataPatentSelected: {
selectedRowInfo: [],
selectedRowIndex: [],
},
}),
RESET_ALL: (state) => ({
...state,
autoCompleteSelection: {
subject_ids: [],
sample_ids: [],
file_ids: [],
},
bulkUpload: {
subject_ids: [],
sample_ids: [],
file_ids: [],
},
allActiveFilters: {},
}),
RESET_ALL_EXCEPT_BULK_UPLOAD: (state) => ({
...state,
autoCompleteSelection: {
subject_ids: [],
sample_ids: [],
file_ids: [],
},
allActiveFilters: {},
}),
ADD_AUTOCOMPLETE_DATA: (state, { type, value }) => ({
...state,
autoCompleteSelection: {
...state.autoCompleteSelection,
[`${type}_ids`]: value,
},
}),
ADD_BULKSEARCHDATA: (state, { type, value }) => ({
...state,
bulkUpload: {
[`${type}_ids`]: value,
},
}),
};

// INJECT-REDUCERS INTO REDUX STORE
Expand Down
4 changes: 2 additions & 2 deletions src/pages/dashboardTab/components/tabController.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const tabController = (classes) => {
return `${tabIndex[currentTab].primaryColor}`;
}

function getTabLalbel(title, count) {
function getTabLabel(title, count) {
const tabObj = tabIndex[currentTab];
// NOTE: refactor white color to theme's white color.
const primaryColor = (tabObj.title === title) ? tabIndex[currentTab].selectedColor : undefined;
Expand Down Expand Up @@ -194,7 +194,7 @@ const tabController = (classes) => {
key={index}
id={tab.id}
label={
getTabLalbel(tab.title, dashboardStats[tab.count] ? dashboardStats[tab.count] : 0)
getTabLabel(tab.title, dashboardStats[tab.count] ? dashboardStats[tab.count] : 0)
}
/>
));
Expand Down

0 comments on commit 0ce8bd5

Please sign in to comment.