Skip to content

Commit

Permalink
Merge pull request #123 from CBIIT/dev-1.1.0
Browse files Browse the repository at this point in the history
Merge dev branch for INS-481 and INS-474
  • Loading branch information
n2iw authored Dec 9, 2022
2 parents bc59417 + 0ce8bd5 commit aebb2d0
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 158 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.

5 changes: 2 additions & 3 deletions src/bento/caseDetailData.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ export const tabContainers = [
},
},
{
dataField: 'nih_percentile',
header: 'NIH Percentile',
dataField: 'publish_date',
header: 'Publish Date',
sort: 'asc',
display: true,
headerStyles: {
Expand Down Expand Up @@ -573,7 +573,6 @@ query publicationOverViewByProject(
publish_date,
citation_count,
relative_citation_ratio,
nih_percentile,
doi,
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/bento/dashboardTabData.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ export const tabContainers = [
},
},
{
dataField: 'nih_percentile',
header: 'NIH Percentile',
dataField: 'publish_date',
header: 'Publish Date',
sort: 'asc',
display: true,
headerStyles: {
Expand Down Expand Up @@ -909,7 +909,6 @@ query publicationOverView(
publish_date,
citation_count,
relative_citation_ratio,
nih_percentile,
doi,
queried_project_ids
}
Expand Down
10 changes: 4 additions & 6 deletions src/bento/tableDownloadCSV.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ query publicationOverView(
publish_date,
citation_count,
relative_citation_ratio,
nih_percentile,
doi,
queried_project_ids
}
Expand All @@ -190,7 +189,7 @@ export const customPublicationsTabDownloadCSV = {
'authors',
'citation_count',
'relative_citation_ratio',
'nih_percentile',
'publish_date',
],
header: [
'PubMed ID',
Expand All @@ -199,7 +198,7 @@ export const customPublicationsTabDownloadCSV = {
'Authors',
'Citation Count',
'Relative Citation Ratio',
'NIH Percentile',
'Publish Date',
],
query: GET_PUBLICATIONS_TAB,
apiVariable: 'publicationOverView',
Expand Down Expand Up @@ -389,7 +388,6 @@ query publicationOverViewByProject(
publish_date,
citation_count,
relative_citation_ratio,
nih_percentile,
doi,
}
}
Expand All @@ -402,15 +400,15 @@ export const customCaseDetailPublicationsTabDownloadCSV = {
'authors',
'citation_count',
'relative_citation_ratio',
'nih_percentile',
'publish_date',
],
header: [
'PubMed ID',
'Title',
'Authors',
'Citation Count',
'Relative Citation Ratio',
'NIH Percentile',
'Publish Date',
],
query: GET_CASE_DETAIL_PUBLICATIONS_TAB,
apiVariable: 'publicationOverViewByProject',
Expand Down
3 changes: 3 additions & 0 deletions src/components/Footer/FooterView.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ const INSFooter = () => {
<Footer classes={styles} data={footerUpdatedData} />
<div>
<div className="beVersion">
Software Version: v1.1.0
<br />
<br />
Site Data Update (Projects, Publications, Patents): 09/26/2022
<br />
<br />
Expand Down
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 aebb2d0

Please sign in to comment.