]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-17386 handle issues on deleted files
authorJeremy Davis <jeremy.davis@sonarsource.com>
Wed, 23 Nov 2022 14:47:44 +0000 (22:47 +0800)
committersonartech <sonartech@sonarsource.com>
Thu, 24 Nov 2022 20:02:50 +0000 (20:02 +0000)
19 files changed:
server/sonar-web/src/main/js/api/mocks/IssuesServiceMock.ts
server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesList-test.tsx.snap
server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/IssuesSourceViewer-test.tsx.snap
server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ListItem-test.tsx.snap
server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssueBox-test.tsx.snap
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/ComponentSourceSnippetGroupViewer-test.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/CrossComponentSourceViewer-test.tsx
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/__tests__/__snapshots__/CrossComponentSourceViewer-test.tsx.snap
server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewer-test.tsx.snap
server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineIssueList-test.tsx.snap
server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/IssueView-test.tsx.snap
server/sonar-web/src/main/js/components/issue/__tests__/__snapshots__/issue-test.tsx.snap
server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueActionsBar-test.tsx.snap
server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTitleBar-test.tsx.snap
server/sonar-web/src/main/js/helpers/testMocks.ts
server/sonar-web/src/main/js/types/issues.ts
server/sonar-web/src/main/js/types/types.ts

index 2d7b4b48f3ff6af05996911542c8732564cc374c..177f06606da8823daaa1d43727cffc033b66ab95 100644 (file)
@@ -74,10 +74,24 @@ function mockReferenceComponent(override?: Partial<ReferencedComponent>) {
     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<SnippetsByComponent>;
@@ -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),
index 0d8e30396335610fac0c52970b4a7c81a701769d..cc25475825394dee89afac0ea8a3ca10b19504f6 100644 (file)
@@ -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",
index 7e70e9836930c40915aeca701278d2bee9131130..bb4189f7f046095504e303d5c2591969781474ed 100644 (file)
@@ -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",
index c56504a36a7510cac88e07f1dad0ff40df4ba103..66912b6ce0fec83212edec3b12c7f638fbbb1c47 100644 (file)
@@ -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",
index bce2e4edbabb2bdc636b78e872519a579f9f4cdd..d1fc86dd0053a10f609d81c0702b838b42492e22 100644 (file)
@@ -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",
index 2630d4b1adddf76221b06ea5d87dcf09708ae576..f1b755af3323c9448a1230a551b2c204137f66c2 100644 (file)
@@ -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
         <IssueSourceViewerHeader
           branchLike={branchLike}
           className={issueIsClosed && !issueIsFileLevel ? 'null-spacer-bottom' : ''}
-          expandable={!fullyShown && isFile(snippetGroup.component.q)}
+          expandable={isExpandable(snippets, snippetGroup)}
           loading={loading}
           onExpand={this.expandComponent}
           sourceViewerFile={snippetGroup.component}
@@ -338,7 +326,11 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone
             lastSnippetOfLastGroup={lastSnippetGroup && index === snippets.length - 1}
             loadDuplications={this.loadDuplications}
             locations={this.props.locations}
-            locationsByLine={includeIssueLocation ? locations : {}}
+            locationsByLine={getLocationsByLine(
+              issue,
+              snippetGroup,
+              isLastOccurenceOfPrimaryComponent
+            )}
             onLocationSelect={this.props.onLocationSelect}
             renderDuplicationPopup={this.renderDuplicationPopup}
             snippet={snippet}
@@ -348,3 +340,28 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone
     );
   }
 }
+
+function getLocationsByLine(
+  issue: TypeIssue,
+  snippetGroup: SnippetGroup,
+  isLastOccurenceOfPrimaryComponent: boolean
+) {
+  const isFlow = issue.secondaryLocations.length === 0;
+  const includeIssueLocation = isFlow ? isLastOccurenceOfPrimaryComponent : true;
+
+  return includeIssueLocation &&
+    issue.component === snippetGroup.component.key &&
+    issue.textRange !== undefined
+    ? locationsByLine([issue])
+    : {};
+}
+
+function isExpandable(snippets: Snippet[], snippetGroup: SnippetGroup) {
+  const fullyShown =
+    snippets.length === 1 &&
+    snippetGroup.component.measures &&
+    snippets[0].end - snippets[0].start ===
+      parseInt(snippetGroup.component.measures.lines || '', 10);
+
+  return !fullyShown && isFile(snippetGroup.component.q);
+}
index dc3d78c0026b6721f3f6d170d41e7c292dfdd049..d0ce1590f81c25fa0740817a1e8eaadfc19d1e69 100644 (file)
@@ -127,7 +127,8 @@ export default class CrossComponentSourceViewer extends React.PureComponent<Prop
         issue.status === IssueStatus.Closed ? {} : await getIssueFlowSnippets(issue.key);
       if (components[issue.component] === undefined) {
         const issueComponent = await getComponentForSourceViewer({
-          component: issue.component,
+          // If the issue's component doesn't exist anymore (typically a deleted file), use the project
+          component: issue.componentEnabled ? issue.component : issue.project,
           ...getBranchLikeQuery(branchLike),
         });
         components[issue.component] = { component: issueComponent, sources: [] };
index 089f87488357d887d75277ebdcb40e02d7155e21..457fc4d9a466aa9988f955562c047d87230a370f 100644 (file)
@@ -151,15 +151,17 @@ it('should render file-level issue correctly', () => {
 });
 
 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,
index c5735a79fb3ae05e0aee52127f0237bf7df346f4..2e36f4a15f1136a1d850a29c21c06db4bf29706a 100644 (file)
@@ -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 () => {
index 38a4c317e8d6b4e476549146abb77ce8aad4b9b3..e1f66aa36690637ffc2e712044527c97b5f84791 100644 (file)
@@ -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",
index a9b7f2b3143e95bba90457d92f7538df6d3aa3e7..48d95c2940d8387be652b8d35f62904330ed250a 100644 (file)
@@ -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",
index b86ed52063c8459efae3cabda9f8e7d7108402e8..57a9ee6c5a30782d7eb64d0ccac8ea6b6264c657 100644 (file)
@@ -18,6 +18,7 @@ exports[`should render issues 1`] = `
       Object {
         "actions": Array [],
         "component": "main.js",
+        "componentEnabled": true,
         "componentLongName": "main.js",
         "componentQualifier": "FIL",
         "componentUuid": "foo1234",
index 35f36ffc66e7b1c50e357a05517318e384309915..a1962128727e70567126753c6170b383c2f00fc7 100644 (file)
@@ -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",
index 3b2f7d3baba47d4a37c7de39e44018298ed6845c..73747956ec9999a755385408261ee462d66b38dc 100644 (file)
@@ -22,6 +22,7 @@ exports[`should render issues correctly 1`] = `
         },
       ],
       "component": "main.js",
+      "componentEnabled": true,
       "componentLongName": "main.js",
       "componentQualifier": "FIL",
       "componentUuid": "foo1234",
index 03560f28c24356f65bdbc8e0fef45d932ae3bd69..5bb47ecddb6266d2a6cc42e90601709c4c64ae68 100644 (file)
@@ -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",
index 4cf04e124e1a3b29bbc70a5c5a2d9e4a4670f4b1..276b4627114e2782a16b16faff2992d8f391398e 100644 (file)
@@ -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",
index 561580776b42920f1c073629ec0afeed23965dda..a38b03e8d5c1630463f24601150da8cd4dfc4d8e 100644 (file)
@@ -318,6 +318,7 @@ export function mockIssue(withLocations = false, overrides: Partial<Issue> = {})
   const issue: Issue = {
     actions: [],
     component: 'main.js',
+    componentEnabled: true,
     componentLongName: 'main.js',
     componentQualifier: 'FIL',
     componentUuid: 'foo1234',
index 0e8c55bdb00c49461d76a4e9474e9cf433095ac6..e4b1bbf331229574b06907274ed48487e0d6e9bc 100644 (file)
@@ -110,6 +110,8 @@ export interface ReferencedComponent {
   key: string;
   name: string;
   path?: string;
+  enabled?: boolean;
+  longName?: string;
   uuid: string;
 }
 
index 0d28be640f8927098ebdb22b457d087e229620b6..e62a646955fdff99dfa881bd22b30ddbac91c57b 100644 (file)
@@ -238,6 +238,7 @@ export interface Issue {
   branch?: string;
   comments?: IssueComment[];
   component: string;
+  componentEnabled?: boolean;
   componentLongName: string;
   componentQualifier: string;
   componentUuid: string;