From: Jeremy Davis Date: Wed, 23 Nov 2022 14:47:44 +0000 (+0800) Subject: SONAR-17386 handle issues on deleted files X-Git-Tag: 9.8.0.63668~89 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=328840a47701c59977549ed01ce8adec11633a40;p=sonarqube.git SONAR-17386 handle issues on deleted files --- diff --git a/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts b/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts index 2d7b4b48f3f..177f06606da 100644 --- a/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts +++ b/server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts @@ -74,10 +74,24 @@ function mockReferenceComponent(override?: Partial) { key: 'component1', name: 'Component1', uuid: 'id1', + enabled: true, ...override, }; } +function generateReferenceComponentsForIssues(issueData: IssueData[]) { + return issueData + .reduce((componentKeys, response) => { + const componentKey = response.issue.component; + if (!componentKeys.includes(componentKey)) { + return [...componentKeys, componentKey]; + } + + return componentKeys; + }, [] as string[]) + .map((key) => mockReferenceComponent({ key, enabled: true })); +} + interface IssueData { issue: RawIssue; snippets: Dict; @@ -483,7 +497,7 @@ export default class IssuesServiceMock { }; }); return this.reply({ - components: [mockReferenceComponent()], + components: generateReferenceComponentsForIssues(this.list), effortTotal: 199629, facets, issues: this.list.map((line) => line.issue), diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesList-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesList-test.tsx.snap index 0d8e3039633..cc254758253 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesList-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesList-test.tsx.snap @@ -16,6 +16,7 @@ exports[`should render correctly 2`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -57,6 +58,7 @@ exports[`should render correctly 2`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -94,6 +96,7 @@ exports[`should render correctly 2`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesSourceViewer-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesSourceViewer-test.tsx.snap index 7e70e983693..bb4189f7f04 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesSourceViewer-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesSourceViewer-test.tsx.snap @@ -22,6 +22,7 @@ exports[`should render CrossComponentSourceViewer correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -96,6 +97,7 @@ exports[`should render CrossComponentSourceViewer correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -245,6 +247,7 @@ exports[`should render SourceViewer correctly: all secondary locations on same l Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -328,6 +331,7 @@ exports[`should render SourceViewer correctly: all secondary locations on same l Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -477,6 +481,7 @@ exports[`should render SourceViewer correctly: default 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -509,6 +514,7 @@ exports[`should render SourceViewer correctly: default 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -566,6 +572,7 @@ exports[`should render SourceViewer correctly: single secondary location 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -631,6 +638,7 @@ exports[`should render SourceViewer correctly: single secondary location 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ListItem-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ListItem-test.tsx.snap index c56504a36a7..66912b6ce0f 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ListItem-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ListItem-test.tsx.snap @@ -34,6 +34,7 @@ exports[`should render correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -77,6 +78,7 @@ exports[`should render correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssueBox-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssueBox-test.tsx.snap index bce2e4edbab..d1fc86dd005 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssueBox-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssueBox-test.tsx.snap @@ -25,6 +25,7 @@ exports[`should render correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -83,6 +84,7 @@ exports[`should render correctly 2`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx index 2630d4b1add..f1b755af332 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx @@ -254,27 +254,15 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone const { branchLike, isLastOccurenceOfPrimaryComponent, issue, lastSnippetGroup, snippetGroup } = this.props; const { additionalLines, loading, snippets } = this.state; - const locations = - issue.component === snippetGroup.component.key && issue.textRange !== undefined - ? locationsByLine([issue]) - : {}; - - const fullyShown = - snippets.length === 1 && - snippetGroup.component.measures && - snippets[0].end - snippets[0].start === - parseInt(snippetGroup.component.measures.lines || '', 10); const snippetLines = linesForSnippets(snippets, { ...snippetGroup.sources, ...additionalLines, }); - const isFlow = issue.secondaryLocations.length === 0; - const includeIssueLocation = isFlow ? isLastOccurenceOfPrimaryComponent : true; - const issueIsClosed = issue.status === IssueStatus.Closed; - const issueIsFileLevel = issue.componentQualifier === ComponentQualifier.File; + const issueIsFileLevel = + issue.componentQualifier === ComponentQualifier.File && issue.componentEnabled; const closedIssueMessageKey = issueIsFileLevel ? 'issue.closed.file_level' : 'issue.closed.project_level'; @@ -301,7 +289,7 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone { }); it.each([ - ['file-level', ComponentQualifier.File, 'issue.closed.file_level'], - ['project-level', ComponentQualifier.Project, 'issue.closed.project_level'], + ['file-level', ComponentQualifier.File, true, 'issue.closed.file_level'], + ['file-level', ComponentQualifier.File, false, 'issue.closed.project_level'], + ['project-level', ComponentQualifier.Project, false, 'issue.closed.project_level'], ])( 'should render a closed %s issue correctly', - async (_level, componentQualifier, expectedLabel) => { + async (_level, componentQualifier, componentEnabled, expectedLabel) => { // issue with secondary locations and no primary location const issue = mockIssue(true, { component: 'project:main.js', componentQualifier, + componentEnabled, flows: [], textRange: undefined, status: IssueStatus.Closed, diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/CrossComponentSourceViewer-test.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/CrossComponentSourceViewer-test.tsx index c5735a79fb3..2e36f4a15f1 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/CrossComponentSourceViewer-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/CrossComponentSourceViewer-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { getDuplications } from '../../../../api/components'; +import { getComponentForSourceViewer, getDuplications } from '../../../../api/components'; import { getIssueFlowSnippets } from '../../../../api/issues'; import { mockSnippetsByComponent, @@ -75,11 +75,17 @@ it('Should fetch data', async () => { expect(getIssueFlowSnippets).toHaveBeenCalledWith('foo'); }); -it('Should handle a closed issue', async () => { - const wrapper = shallowRender({ issue: mockIssue(true, { status: IssueStatus.Closed }) }); +it.each([ + ['on a deleted file', false, { component: 'myproject' }], + ['', true, { component: 'main.js' }], +])('Should handle a closed issue %s', async (_, componentEnabled, expected) => { + const wrapper = shallowRender({ + issue: mockIssue(true, { componentEnabled, status: IssueStatus.Closed }), + }); wrapper.instance().fetchIssueFlowSnippets(); await waitAndUpdate(wrapper); expect(getIssueFlowSnippets).not.toHaveBeenCalled(); + expect(getComponentForSourceViewer).toHaveBeenCalledWith(expect.objectContaining(expected)); }); it('Should handle no access rights', async () => { diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/CrossComponentSourceViewer-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/CrossComponentSourceViewer-test.tsx.snap index 38a4c317e8d..e1f66aa3669 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/CrossComponentSourceViewer-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/CrossComponentSourceViewer-test.tsx.snap @@ -41,6 +41,7 @@ exports[`should render correctly 2`] = ` Object { "actions": Array [], "component": "project:main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -198,6 +199,7 @@ exports[`should render correctly: no component found 1`] = ` Object { "actions": Array [], "component": "test.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -326,6 +328,7 @@ exports[`should render correctly: no component found 1`] = ` Object { "actions": Array [], "component": "test.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewer-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewer-test.tsx.snap index a9b7f2b3143..48d95c2940d 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewer-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewer-test.tsx.snap @@ -78,6 +78,7 @@ exports[`should render correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -112,6 +113,7 @@ exports[`should render correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineIssueList-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineIssueList-test.tsx.snap index b86ed52063c..57a9ee6c5a3 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineIssueList-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineIssueList-test.tsx.snap @@ -18,6 +18,7 @@ exports[`should render issues 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/IssueView-test.tsx.snap b/server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/IssueView-test.tsx.snap index 35f36ffc66e..a1962128727 100644 --- a/server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/IssueView-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/IssueView-test.tsx.snap @@ -12,6 +12,7 @@ exports[`should render hotspots correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -47,6 +48,7 @@ exports[`should render hotspots correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -107,6 +109,7 @@ exports[`should render issues correctly 1`] = ` }, ], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -156,6 +159,7 @@ exports[`should render issues correctly 1`] = ` }, ], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/issue-test.tsx.snap b/server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/issue-test.tsx.snap index 3b2f7d3baba..73747956ec9 100644 --- a/server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/issue-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/issue-test.tsx.snap @@ -22,6 +22,7 @@ exports[`should render issues correctly 1`] = ` }, ], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueActionsBar-test.tsx.snap b/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueActionsBar-test.tsx.snap index 03560f28c24..5bb47ecddb6 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueActionsBar-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueActionsBar-test.tsx.snap @@ -19,6 +19,7 @@ exports[`should render commentable correctly 1`] = ` "comment", ], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -62,6 +63,7 @@ exports[`should render commentable correctly 1`] = ` "comment", ], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -105,6 +107,7 @@ exports[`should render commentable correctly 1`] = ` "comment", ], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -148,6 +151,7 @@ exports[`should render commentable correctly 1`] = ` "comment", ], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -203,6 +207,7 @@ exports[`should render commentable correctly 1`] = ` "comment", ], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -255,6 +260,7 @@ exports[`should render effort correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -297,6 +303,7 @@ exports[`should render effort correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -339,6 +346,7 @@ exports[`should render effort correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -381,6 +389,7 @@ exports[`should render effort correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -436,6 +445,7 @@ exports[`should render effort correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -489,6 +499,7 @@ exports[`should render issue correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -530,6 +541,7 @@ exports[`should render issue correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -571,6 +583,7 @@ exports[`should render issue correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -612,6 +625,7 @@ exports[`should render issue correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -657,6 +671,7 @@ exports[`should render issue correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -709,6 +724,7 @@ exports[`should render security hotspot correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -750,6 +766,7 @@ exports[`should render security hotspot correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -791,6 +808,7 @@ exports[`should render security hotspot correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -836,6 +854,7 @@ exports[`should render security hotspot correctly 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTitleBar-test.tsx.snap b/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTitleBar-test.tsx.snap index 4cf04e124e1..276b4627114 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTitleBar-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTitleBar-test.tsx.snap @@ -25,6 +25,7 @@ exports[`should render correctly: default 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -115,6 +116,7 @@ exports[`should render correctly: with filter 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -184,6 +186,7 @@ exports[`should render correctly: with filter 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -245,6 +248,7 @@ exports[`should render correctly: with multi locations 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", @@ -413,6 +417,7 @@ exports[`should render correctly: with multi locations and link 1`] = ` Object { "actions": Array [], "component": "main.js", + "componentEnabled": true, "componentLongName": "main.js", "componentQualifier": "FIL", "componentUuid": "foo1234", diff --git a/server/sonar-web/src/main/js/helpers/testMocks.ts b/server/sonar-web/src/main/js/helpers/testMocks.ts index 561580776b4..a38b03e8d5c 100644 --- a/server/sonar-web/src/main/js/helpers/testMocks.ts +++ b/server/sonar-web/src/main/js/helpers/testMocks.ts @@ -318,6 +318,7 @@ export function mockIssue(withLocations = false, overrides: Partial = {}) const issue: Issue = { actions: [], component: 'main.js', + componentEnabled: true, componentLongName: 'main.js', componentQualifier: 'FIL', componentUuid: 'foo1234', diff --git a/server/sonar-web/src/main/js/types/issues.ts b/server/sonar-web/src/main/js/types/issues.ts index 0e8c55bdb00..e4b1bbf3312 100644 --- a/server/sonar-web/src/main/js/types/issues.ts +++ b/server/sonar-web/src/main/js/types/issues.ts @@ -110,6 +110,8 @@ export interface ReferencedComponent { key: string; name: string; path?: string; + enabled?: boolean; + longName?: string; uuid: string; } diff --git a/server/sonar-web/src/main/js/types/types.ts b/server/sonar-web/src/main/js/types/types.ts index 0d28be640f8..e62a646955f 100644 --- a/server/sonar-web/src/main/js/types/types.ts +++ b/server/sonar-web/src/main/js/types/types.ts @@ -238,6 +238,7 @@ export interface Issue { branch?: string; comments?: IssueComment[]; component: string; + componentEnabled?: boolean; componentLongName: string; componentQualifier: string; componentUuid: string;