From: Stas Vilchik Date: Fri, 12 Oct 2018 08:26:15 +0000 (+0200) Subject: SONAR-11313 enable locations navigator when selecting a flow X-Git-Tag: 7.5~298 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f9bb435740391633129ceee0732c531942e48115;p=sonarqube.git SONAR-11313 enable locations navigator when selecting a flow --- diff --git a/server/sonar-web/src/main/js/apps/issues/__tests__/actions-test.ts b/server/sonar-web/src/main/js/apps/issues/__tests__/actions-test.ts new file mode 100644 index 00000000000..26e8f0a6d07 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/issues/__tests__/actions-test.ts @@ -0,0 +1,28 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { selectFlow } from '../actions'; + +it('should select flow and enable locations navigator', () => { + expect(selectFlow(5)()).toEqual({ + locationsNavigator: true, + selectedFlowIndex: 5, + selectedLocationIndex: 0 + }); +}); diff --git a/server/sonar-web/src/main/js/apps/issues/actions.ts b/server/sonar-web/src/main/js/apps/issues/actions.ts index 76da57eb2fe..443a9b01c66 100644 --- a/server/sonar-web/src/main/js/apps/issues/actions.ts +++ b/server/sonar-web/src/main/js/apps/issues/actions.ts @@ -100,7 +100,7 @@ export function selectPreviousLocation(state: State) { export function selectFlow(nextIndex?: number) { return () => { - return { selectedFlowIndex: nextIndex, selectedLocationIndex: 0 }; + return { locationsNavigator: true, selectedFlowIndex: nextIndex, selectedLocationIndex: 0 }; }; }