Skip to content

Commit 021fe32

Browse files
moved filtered events into a separate tab on the case report detail page
1 parent 3299b34 commit 021fe32

File tree

5 files changed

+58
-18
lines changed

5 files changed

+58
-18
lines changed

src/components/filteredEventModal/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
Avatar,
1515
Typography,
1616
Tabs,
17-
Input,
1817
} from "antd";
1918
import NotesModal from "../notesModal";
2019
import { withTranslation } from "react-i18next";

src/containers/detailView/index.js

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { withRouter } from "react-router-dom";
55
import { Skeleton, Affix, Tabs } from "antd";
66
import HeaderPanel from "../../components/headerPanel";
77
import SummaryTab from "../../tabs/summaryTab";
8+
import FilteredEventsTab from "../../tabs/filteredEventsTab";
89
import TracksTab from "../../tabs/tracksTab";
910
import Wrapper from "./index.style";
1011
import PopulationTab from "../../tabs/populationTab";
@@ -26,14 +27,16 @@ class DetailView extends Component {
2627
if (!pair) {
2728
return null;
2829
}
29-
const tabs = [
30-
<SummaryTab />,
31-
<TracksTab />,
32-
<PopulationTab />,
33-
<SageQcTab />,
34-
<BinQCTab />,
35-
<SignaturesTab />,
36-
];
30+
const tabs = {
31+
0: <SummaryTab />,
32+
1: <FilteredEventsTab />,
33+
2: <TracksTab />,
34+
3: <PopulationTab />,
35+
4: <SageQcTab />,
36+
5: <BinQCTab />,
37+
6: <SignaturesTab />,
38+
};
39+
let tabsOrder = [0, 1, 2, 3, 4, 5, 6];
3740
return (
3841
<Wrapper>
3942
<Skeleton active loading={loading}>
@@ -44,14 +47,14 @@ class DetailView extends Component {
4447
</Affix>
4548
<div className="ant-home-content-container">
4649
<Tabs
47-
defaultActiveKey="1"
48-
activeKey={tab.toString()}
49-
onChange={(tab) => this.handleTabChanged(tab)}
50-
items={tabs.map((Component, i) => ({
51-
key: (i + 1).toString(),
52-
label: t(`containers.detail-view.tabs.tab${i + 1}`),
53-
children: Component,
54-
}))}
50+
defaultActiveKey="1"
51+
activeKey={tab.toString()}
52+
onChange={(tab) => this.handleTabChanged(tab)}
53+
items={tabsOrder.map((key) => ({
54+
key: key.toString(),
55+
label: t(`containers.detail-view.tabs.tab${key}`),
56+
children: tabs[key],
57+
}))}
5558
/>
5659
</div>
5760
</Skeleton>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Component } from "react";
2+
import { withTranslation } from "react-i18next";
3+
import { connect } from "react-redux";
4+
import Wrapper from "./index.style";
5+
import FilteredEventsListPanel from "../../components/filteredEventsListPanel";
6+
7+
class FilteredEventsTab extends Component {
8+
render() {
9+
return (
10+
<Wrapper>
11+
<FilteredEventsListPanel />
12+
</Wrapper>
13+
);
14+
}
15+
}
16+
FilteredEventsTab.propTypes = {};
17+
FilteredEventsTab.defaultProps = {};
18+
const mapDispatchToProps = (dispatch) => ({});
19+
const mapStateToProps = (state) => ({});
20+
export default connect(
21+
mapStateToProps,
22+
mapDispatchToProps
23+
)(withTranslation("common")(FilteredEventsTab));
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import styled from "styled-components";
2+
3+
const Wrapper = styled.div`
4+
.ant-home-header-container {
5+
margin: 0px;
6+
background: white;
7+
border: 1px solid rgb(235, 237, 240);
8+
}
9+
.ant-home-content-container {
10+
margin: 24px;
11+
}
12+
`;
13+
14+
export default Wrapper;

src/translations/en/common.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@
373373
},
374374
"detail-view": {
375375
"tabs": {
376-
"tab1": "Overall",
376+
"tab0": "Overall",
377+
"tab1": "Filtered Events",
377378
"tab2": "Genome View",
378379
"tab3": "Population View",
379380
"tab4": "Variant QC",

0 commit comments

Comments
 (0)