Bug 1520957 - [release 119] remove unused code project-text-search (#7675). r=dwalsh
☠☠ backed out by 27034f1841e9 ☠ ☠
authorAnshul <malikanshul29@gmail.com>
Fri, 18 Jan 2019 09:36:08 -0500
changeset 511644 75ccbec47ddca6296febaa9edc7858c68e1b0892
parent 511643 51491b0bf8a8686e9b05399173ea75c629dbde01
child 511645 7f05dbce0192f31647bea0c9c10618e983b80331
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",