Bug 1520957 - [release 119] remove unused code project-text-search (#7675). r=dwalsh
☠☠ backed out by 5b1c54cbac38 ☠ ☠
authorAnshul <malikanshul29@gmail.com>
Fri, 18 Jan 2019 12:05:29 -0500
changeset 514553 ffde784e1ece22ecfc64a4e3adef857ed3d7c2cb
parent 514552 6bf766fe8789d81acb843265eb5888d336506079
child 514554 f33a4bd9b1b7f5ec9675c67841fd103440271428
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [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",