From: Stas Vilchik Date: Fri, 1 Sep 2017 09:18:28 +0000 (+0200) Subject: SONAR-9702 display branches on background tasks page X-Git-Tag: 6.6-RC1~380^2~22 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a314c0cd2862cefdc5fb9aacf0612a5560b0f32a;p=sonarqube.git SONAR-9702 display branches on background tasks page --- diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx index 07bb92df540..c6839478f78 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskComponent.tsx @@ -20,9 +20,10 @@ import * as React from 'react'; import { Link } from 'react-router'; import TaskType from './TaskType'; +import { Task } from '../types'; import QualifierIcon from '../../../components/shared/QualifierIcon'; import Organization from '../../../components/shared/Organization'; -import { Task } from '../types'; +import { getProjectUrl } from '../../../helpers/urls'; interface Props { task: Task; @@ -50,8 +51,14 @@ export default function TaskComponent({ task }: Props) { {task.organization && } {task.componentName && - + {task.componentName} + + {task.branch && + + / + {task.branch} + } } diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx index 5769bdb868a..456abbdf210 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskType.tsx @@ -27,7 +27,7 @@ interface Props { export default function TaskType({ incremental, type }: Props) { return ( - + {'['} {translate('background_task.type', type)} {incremental && ` - ${translate('incremental')}`} diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskComponent-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskComponent-test.tsx index 5f12acf8f48..cd1f525b649 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskComponent-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskComponent-test.tsx @@ -34,4 +34,5 @@ it('renders', () => { }; expect(shallow()).toMatchSnapshot(); expect(shallow()).toMatchSnapshot(); + expect(shallow()).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDate-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDate-test.tsx index 7e37c8dbfa6..2237b4c5f46 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDate-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDate-test.tsx @@ -23,7 +23,11 @@ import TaskDate from '../TaskDate'; it('renders', () => { expect(shallow()).toMatchSnapshot(); - expect(shallow()).toMatchSnapshot(); - expect(shallow()).toMatchSnapshot(); - expect(shallow()).toMatchSnapshot(); + expect(shallow()).toMatchSnapshot(); + expect( + shallow() + ).toMatchSnapshot(); + expect( + shallow() + ).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDay-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDay-test.tsx index 2413a5689a0..baa478c38e2 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDay-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDay-test.tsx @@ -23,10 +23,14 @@ import TaskDay from '../TaskDay'; it('renders', () => { expect( - shallow() + shallow( + + ) ).toMatchSnapshot(); expect( - shallow() + shallow( + + ) ).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskComponent-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskComponent-test.tsx.snap index b8fec515315..93a63cdafd4 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskComponent-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskComponent-test.tsx.snap @@ -13,12 +13,14 @@ exports[`renders 1`] = ` organizationKey="org" /> `; + +exports[`renders 3`] = ` + + + + + + + foo + + + / + + feature + + + + +`; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskDate-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskDate-test.tsx.snap index 2222e541e98..7a5dbb2dc43 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskDate-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskDate-test.tsx.snap @@ -11,7 +11,7 @@ exports[`renders 2`] = ` className="thin nowrap text-right" > @@ -22,7 +22,7 @@ exports[`renders 3`] = ` className="thin nowrap text-right" > @@ -38,7 +38,7 @@ exports[`renders 4`] = ` (+4d) diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskDay-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskDay-test.tsx.snap index 7fccb036da2..9a34276c640 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskDay-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskDay-test.tsx.snap @@ -5,7 +5,7 @@ exports[`renders 1`] = ` className="thin nowrap text-right" > diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap index 649856a4680..df6e0ffa00b 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/TaskType-test.tsx.snap @@ -2,7 +2,7 @@ exports[`renders 1`] = ` [ background_task.type.REPORT @@ -12,7 +12,7 @@ exports[`renders 1`] = ` exports[`renders 2`] = ` [ background_task.type.REPORT diff --git a/server/sonar-web/src/main/js/apps/background-tasks/types.ts b/server/sonar-web/src/main/js/apps/background-tasks/types.ts index b0e1003be03..a149d2f7d2e 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/types.ts +++ b/server/sonar-web/src/main/js/apps/background-tasks/types.ts @@ -19,6 +19,8 @@ */ export interface Task { + branch?: string; + branchType?: string; componentKey?: string; componentName?: string; componentQualifier?: string;