Skip to content

Commit b64b83a

Browse files
added patch for removing trailing whitespaces from the selector on the topbar
1 parent 85f47fa commit b64b83a

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

src/components/genesPanel/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ class GenesPanel extends Component {
8282
};
8383

8484
render() {
85-
const { t, genes, loading, domains, genesOptionsList } = this.props;
85+
const { t, genes, loading, loadingGenesData, domains, genesOptionsList } =
86+
this.props;
8687
let { visible } = this.state;
8788
return (
8889
<Wrapper>
@@ -106,6 +107,7 @@ class GenesPanel extends Component {
106107
allowClear
107108
showSearch
108109
mode="multiple"
110+
loading={loadingGenesData}
109111
style={{ width: 300 }}
110112
placeholder={t("components.genes-panel.locator")}
111113
onChange={this.handleGenesLocatorChange}
@@ -197,6 +199,7 @@ const mapStateToProps = (state) => ({
197199
genomeLength: state.Settings.genomeLength,
198200
selectedCoordinate: state.Settings.dataset?.reference,
199201
loading: state.Genes.loading,
202+
loadingGenesData: state.Genes.loadingGenesData,
200203
genesOptionsList: state.Genes.optionsList,
201204
});
202205
export default connect(

src/containers/topbar/topbar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ class Topbar extends Component {
7373
popupMatchSelectWidth={false}
7474
optionFilterProp="children"
7575
placeholder={t("topbar.browse-case-reports")}
76-
onSearch={(texts) => searchCaseReports({ texts })}
76+
onSearch={(texts) =>
77+
searchCaseReports({ texts: (texts || "").trim() })
78+
}
7779
filterOption={false}
7880
filterSort={false}
7981
notFoundContent={null}

src/redux/filteredEvents/saga.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,12 @@ function* fetchFilteredEvents(action) {
3737
const reportUrl = `${dataset.dataPath}${id}/report.html`;
3838
let reportSrc = null;
3939
try {
40+
// Check if file exists using HEAD request first
4041
yield call(axios.head, reportUrl, { cancelToken: getCancelToken() });
4142
reportSrc = reportUrl;
4243
} catch (e) {
43-
try {
44-
yield call(axios.get, reportUrl, { cancelToken: getCancelToken() });
45-
reportSrc = reportUrl;
46-
} catch (_) {
47-
reportSrc = null;
48-
}
44+
// If HEAD fails, treat as missing (do not attempt GET)
45+
reportSrc = null;
4946
}
5047

5148
yield put({

src/redux/genes/reducer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import actions from "./actions";
22

33
const initState = {
44
loading: false,
5+
loadingGenesData: false,
56
filename: "genes/hg19.arrow",
67
reference: "hg19",
78
higlassServerPath: "https://higlass.io",
@@ -83,7 +84,7 @@ export default function appReducer(state = initState, action) {
8384
genesWeight: [],
8485
titlesColorMap: {},
8586
error: null,
86-
loading: true,
87+
loadingGenesData: true,
8788
};
8889
case actions.FETCH_GENES_DATA_SUCCESS:
8990
return {
@@ -99,7 +100,7 @@ export default function appReducer(state = initState, action) {
99100
genesStrand: action.genesStrand,
100101
genesWeight: action.genesWeight,
101102
titlesColorMap: action.titlesColorMap,
102-
loading: false,
103+
loadingGenesData: false,
103104
};
104105
case actions.FETCH_GENES_DATA_FAILED:
105106
return {
@@ -116,7 +117,7 @@ export default function appReducer(state = initState, action) {
116117
genesWeight: [],
117118
titlesColorMap: {},
118119
error: action.error,
119-
loading: false,
120+
loadingGenesData: false,
120121
};
121122
default:
122123
return state;

0 commit comments

Comments
 (0)