From: Mathieu Suen Date: Thu, 6 Oct 2022 15:31:28 +0000 (+0200) Subject: SONAR-17285 Fix order of data and execution flow in issue page X-Git-Tag: 9.7.0.61563~87 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a0cc4b0b773fe299cdf685d3a667010088d4b429;p=sonarqube.git SONAR-17285 Fix order of data and execution flow in issue page --- diff --git a/server/sonar-web/src/main/js/app/styles/components/boxed-group.css b/server/sonar-web/src/main/js/app/styles/components/boxed-group.css index ac963312e42..48185189427 100644 --- a/server/sonar-web/src/main/js/app/styles/components/boxed-group.css +++ b/server/sonar-web/src/main/js/app/styles/components/boxed-group.css @@ -130,4 +130,5 @@ vertical-align: middle; font-weight: bold; transition: color 0.3s ease; + text-align: left; } diff --git a/server/sonar-web/src/main/js/components/locations/FlowsList.tsx b/server/sonar-web/src/main/js/components/locations/FlowsList.tsx index 6e2600da40d..40646365fb8 100644 --- a/server/sonar-web/src/main/js/components/locations/FlowsList.tsx +++ b/server/sonar-web/src/main/js/components/locations/FlowsList.tsx @@ -25,6 +25,10 @@ import { Flow, FlowType } from '../../types/types'; import BoxedGroupAccordion from '../controls/BoxedGroupAccordion'; import SingleFileLocationNavigator from './SingleFileLocationNavigator'; +const FLOW_ORDER_MAP = { + [FlowType.DATA]: 0, + [FlowType.EXECUTION]: 1 +}; export interface Props { flows: Flow[]; selectedLocationIndex?: number; @@ -36,6 +40,8 @@ export interface Props { export default function FlowsList(props: Props) { const { flows, selectedLocationIndex, selectedFlowIndex } = props; + flows.sort((f1, f2) => FLOW_ORDER_MAP[f1.type] - FLOW_ORDER_MAP[f2.type]); + return (
{flows.map((flow, index) => {