Skip to content

Commit d938365

Browse files
committed
removed duplicate backlink redux action
1 parent ccae9ed commit d938365

6 files changed

Lines changed: 4 additions & 40 deletions

File tree

vis/js/actions/index.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export const NOT_QUEUED_IN_ANIMATION = [
2020
"ZOOM_OUT",
2121
"SELECT_PAPER",
2222
"DESELECT_PAPER",
23-
"DESELECT_PAPER_BACKLINK",
2423
"FILE_CLICKED",
2524
"SEARCH",
2625
"FILTER",
@@ -118,10 +117,6 @@ export const showPreview = (paper) => ({ type: "SHOW_PREVIEW", paper });
118117

119118
export const hidePreview = () => ({ type: "HIDE_PREVIEW" });
120119

121-
export const deselectPaperBacklink = () => ({
122-
type: "DESELECT_PAPER_BACKLINK",
123-
});
124-
125120
export const updateDimensions = (chart, list) => ({
126121
type: "RESIZE",
127122
listHeight: list.height,

vis/js/reducers/selectedPaper.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const selectedPaper = (state = null, action) => {
88
case "ZOOM_OUT":
99
case "SCALE":
1010
case "DESELECT_PAPER":
11-
case "DESELECT_PAPER_BACKLINK":
1211
return null;
1312
case "ZOOM_IN": {
1413
if (!action.selectedPaperData) {

vis/js/utils/eventhandlers.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
showPreview,
66
selectPaper,
77
deselectPaper,
8-
deselectPaperBacklink,
98
stopAnimation,
109
hoverBubble,
1110
hoverPaper,
@@ -38,7 +37,7 @@ export const mapDispatchToListEntriesProps = (dispatch) => ({
3837
)
3938
),
4039
handleDeselectPaper: () => dispatch(deselectPaper()),
41-
handleBacklinkClick: () => dispatch(deselectPaperBacklink()),
40+
handleBacklinkClick: () => dispatch(deselectPaper()),
4241
});
4342

4443
/**

vis/js/utils/title.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export const handleTitleAction = (action, defaultTitle, state) => {
2121
document.title = getSelectPaperTitle(action.paper, defaultTitle);
2222
return;
2323
case "DESELECT_PAPER":
24-
case "DESELECT_PAPER_BACKLINK":
2524
document.title = getDeselectPaperTitle(defaultTitle, state);
2625
return;
2726
default:

vis/test/component/list.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
zoomIn,
1818
selectPaper,
1919
highlightArea,
20-
deselectPaperBacklink,
2120
showPreview,
2221
deselectPaper,
2322
} from "../../js/actions";
@@ -1071,7 +1070,7 @@ describe("List entries component", () => {
10711070

10721071
it("triggers a correct backlink click action in linkedcat (zoomed)", () => {
10731072
const PAPER = linkedcatData.find((p) => p.safe_id === "AC15093982");
1074-
const EXPECTED_PAYLOAD = deselectPaperBacklink();
1073+
const EXPECTED_PAYLOAD = deselectPaper();
10751074
const storeObject = setup(
10761075
{ list: [PAPER] },
10771076
{ show: true },

vis/test/store/selectedPaper.test.js

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import {
2-
zoomOut,
3-
selectPaper,
4-
deselectPaper,
5-
deselectPaperBacklink,
6-
} from "../../js/actions";
1+
import { zoomOut, selectPaper, deselectPaper } from "../../js/actions";
72

83
import selectedPaperReducer from "../../js/reducers/selectedPaper";
94

@@ -14,7 +9,7 @@ describe("list state", () => {
149
id: "some-id",
1510
safe_id: "some-safe-id",
1611
title: "some title",
17-
}
12+
};
1813
const EXPECTED_ACTION = {
1914
type: "SELECT_PAPER",
2015
safeId: PAPER.safe_id,
@@ -29,13 +24,6 @@ describe("list state", () => {
2924
};
3025
expect(deselectPaper()).toEqual(EXPECTED_ACTION);
3126
});
32-
33-
it("should create a deselect paper backlink action", () => {
34-
const EXPECTED_ACTION = {
35-
type: "DESELECT_PAPER_BACKLINK",
36-
};
37-
expect(deselectPaperBacklink()).toEqual(EXPECTED_ACTION);
38-
});
3927
});
4028

4129
describe("reducers", () => {
@@ -77,21 +65,6 @@ describe("list state", () => {
7765
expect(result).toEqual(EXPECTED_STATE);
7866
});
7967

80-
it("should deselect the paper (from backlink)", () => {
81-
const PAPER = {
82-
safe_id: "some-id",
83-
};
84-
85-
const INITIAL_STATE = {
86-
safeId: PAPER.safe_id,
87-
};
88-
const EXPECTED_STATE = null;
89-
90-
const result = selectedPaperReducer(INITIAL_STATE, deselectPaperBacklink());
91-
92-
expect(result).toEqual(EXPECTED_STATE);
93-
});
94-
9568
it("should deselect the paper (on zoom out)", () => {
9669
const PAPER = {
9770
safe_id: "some-id",

0 commit comments

Comments
 (0)