Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

[Editor] use a new redux action! #4435

Description

@jasonLaster

We now have a new file search redux action API, which means we can cleanup the Editor a bit :)

diff --git a/src/components/Editor/index.js b/src/components/Editor/index.js
index 7184a3b..89d5093 100644
--- a/src/components/Editor/index.js
+++ b/src/components/Editor/index.js
@@ -277,12 +277,7 @@ class Editor extends PureComponent {
   };
 
   onSearchAgain = (_, e) => {
-    const { query, searchModifiers } = this.props;
-    const { editor: { codeMirror } } = this.state.editor;
-    const ctx = { ed: this.state.editor, cm: codeMirror };
-
-    const direction = e.shiftKey ? "prev" : "next";
-    traverseResults(e, ctx, query, direction, searchModifiers.toJS());
+    this.props.traverseResults(e.shiftKey, this.state.editor);
   };
 
   openMenu(event) {
@@ -559,8 +554,6 @@ Editor.propTypes = {
   jumpToMappedLocation: PropTypes.func,
   coverageOn: PropTypes.bool,
   selectedFrame: PropTypes.object,
-  searchModifiers: PropTypes.object,
-  query: PropTypes.string,
   horizontal: PropTypes.bool,
   startPanelSize: PropTypes.number,
   endPanelSize: PropTypes.number,
@@ -568,7 +561,8 @@ Editor.propTypes = {
   openConditionalPanel: PropTypes.func,
   closeConditionalPanel: PropTypes.func,
   continueToHere: PropTypes.func,
-  setContextMenu: PropTypes.func
+  setContextMenu: PropTypes.func,
+  traverseResults: PropTypes.func
 };
 
 Editor.contextTypes = {
@@ -585,8 +579,6 @@ export default connect(
       searchOn: getActiveSearch(state) === "file",
       hitCount: getHitCountForSource(state, sourceId),
       selectedFrame: getSelectedFrame(state),
-      query: getFileSearchQuery(state),
-      modifiers: getFileSearchModifiers(state),
       coverageOn: getCoverageEnabled(state),
       conditionalPanelLine: getConditionalPanelLine(state)
     };

Metadata

Metadata

Assignees

Type

No type

Fields

Priority

None yet

Jira

None yet

Severity

None yet

Estimate

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions