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

[Editor] use a new redux action! #4435

Closed
jasonLaster opened this issue Oct 19, 2017 · 2 comments
Closed

[Editor] use a new redux action! #4435

jasonLaster opened this issue Oct 19, 2017 · 2 comments

Comments

@jasonLaster
Copy link
Contributor

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)
     };
@sukrosono
Copy link

Hi, how i can remove label available? i know i can claim, but it will assign to me. Seems she so excited and forgot to claim this on.

@nyrosmith
Copy link
Contributor

@brutalcrozt I corrected the labels.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants