Bug 1520957 - [release 119] remove unused code project-text-search (#7675). r=dwalsh
☠☠ backed out by ef836f7dfc08 ☠ ☠
authorAnshul <malikanshul29@gmail.com>
Fri, 18 Jan 2019 12:05:29 -0500
changeset 511656 862c4fc3b6abcf5094a00993f17331f04383bba0
parent 511655 86defe96c1bbc5142c11a650107efea59ed33c3f
child 511657 6371d4b4ff1ec1d79446f3c05898903a17ff41f7
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdwalsh
bugs1520957
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1520957 - [release 119] remove unused code project-text-search (#7675). r=dwalsh
devtools/client/debugger/new/src/actions/project-text-search.js
devtools/client/debugger/new/src/actions/tests/project-text-search.spec.js
devtools/client/debugger/new/src/actions/types/index.js
devtools/client/debugger/new/src/reducers/project-text-search.js
--- a/devtools/client/debugger/new/src/actions/project-text-search.js
+++ b/devtools/client/debugger/new/src/actions/project-text-search.js
@@ -25,20 +25,16 @@ import type { SearchOperation } from "..
 export function addSearchQuery(query: string): Action {
   return { type: "ADD_QUERY", query };
 }
 
 export function addOngoingSearch(ongoingSearch: SearchOperation): Action {
   return { type: "ADD_ONGOING_SEARCH", ongoingSearch };
 }
 
-export function clearSearchQuery(): Action {
-  return { type: "CLEAR_QUERY" };
-}
-
 export function addSearchResult(
   sourceId: string,
   filepath: string,
   matches: Object[]
 ): Action {
   return {
     type: "ADD_SEARCH_RESULT",
     result: { sourceId, filepath, matches }
--- a/devtools/client/debugger/new/src/actions/tests/project-text-search.spec.js
+++ b/devtools/client/debugger/new/src/actions/tests/project-text-search.spec.js
@@ -56,29 +56,16 @@ describe("project text search", () => {
     const { dispatch, getState } = createStore();
     const mockQuery = "foo";
 
     dispatch(actions.addSearchQuery(mockQuery));
 
     expect(getTextSearchQuery(getState())).toEqual(mockQuery);
   });
 
-  it("should remove the  project text search query", () => {
-    const { dispatch, getState } = createStore();
-    const mockQuery = "foo";
-
-    dispatch(actions.addSearchQuery(mockQuery));
-    expect(getTextSearchQuery(getState())).toEqual(mockQuery);
-    dispatch(actions.updateSearchStatus("DONE"));
-    dispatch(actions.clearSearchQuery());
-    expect(getTextSearchQuery(getState())).toEqual("");
-    const status = getTextSearchStatus(getState());
-    expect(status).toEqual("INITIAL");
-  });
-
   it("should search all the loaded sources based on the query", async () => {
     const { dispatch, getState } = createStore(threadClient);
     const mockQuery = "foo";
     const source1 = makeSource("foo1");
     const source2 = makeSource("foo2");
 
     await dispatch(actions.newSource(source1));
     await dispatch(actions.newSource(source2));
--- a/devtools/client/debugger/new/src/actions/types/index.js
+++ b/devtools/client/debugger/new/src/actions/types/index.js
@@ -106,17 +106,16 @@ export type SourceTreeAction =
   | {| +type: "SET_FOCUSED_SOURCE_ITEM", item: FocusItem |};
 
 export type ProjectTextSearchAction =
   | {| +type: "ADD_QUERY", +query: string |}
   | {|
       +type: "ADD_SEARCH_RESULT",
       +result: ProjectTextSearchResult
     |}
-  | {| +type: "CLEAR_QUERY" |}
   | {| +type: "UPDATE_STATUS", +status: string |}
   | {| +type: "CLEAR_SEARCH_RESULTS" |}
   | {| +type: "ADD_ONGOING_SEARCH", +ongoingSearch: SearchOperation |}
   | {| +type: "CLEAR_SEARCH" |};
 
 export type FileTextSearchModifier =
   | "caseSensitive"
   | "wholeWord"
--- a/devtools/client/debugger/new/src/reducers/project-text-search.js
+++ b/devtools/client/debugger/new/src/reducers/project-text-search.js
@@ -55,23 +55,16 @@ export function initialProjectTextSearch
 function update(
   state: ProjectTextSearchState = initialProjectTextSearchState(),
   action: Action
 ): ProjectTextSearchState {
   switch (action.type) {
     case "ADD_QUERY":
       return { ...state, query: action.query };
 
-    case "CLEAR_QUERY":
-      return {
-        ...state,
-        query: "",
-        status: statusType.initial
-      };
-
     case "ADD_SEARCH_RESULT":
       const results = state.results;
       if (action.result.matches.length === 0) {
         return state;
       }
 
       const result = {
         type: "RESULT",