]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-16488 Clean sub-project code from the UI
authorMathieu Suen <mathieu.suen@sonarsource.com>
Tue, 14 Jun 2022 08:16:44 +0000 (10:16 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 15 Jun 2022 20:03:03 +0000 (20:03 +0000)
33 files changed:
server/sonar-web/src/main/js/app/components/search/SearchResult.tsx
server/sonar-web/src/main/js/app/components/search/__tests__/Search-test.tsx
server/sonar-web/src/main/js/app/components/search/__tests__/SearchResult-test.tsx
server/sonar-web/src/main/js/app/components/search/__tests__/SearchResults-test.tsx
server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResult-test.tsx.snap
server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResults-test.tsx.snap
server/sonar-web/src/main/js/app/components/search/utils.ts
server/sonar-web/src/main/js/apps/code/components/Search.tsx
server/sonar-web/src/main/js/apps/code/components/__tests__/Search-test.tsx
server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx
server/sonar-web/src/main/js/apps/issues/components/__tests__/ComponentBreadcrumbs-test.tsx
server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap
server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/Sidebar-test.tsx
server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/Sidebar-test.tsx.snap
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx
server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx
server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx
server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap
server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx
server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap
server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx
server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx
server/sonar-web/src/main/js/components/issue/popups/__tests__/SimilarIssuesPopup-test.tsx
server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SimilarIssuesPopup-test.tsx.snap
server/sonar-web/src/main/js/helpers/issues.ts
server/sonar-web/src/main/js/types/__tests__/__snapshots__/component-test.ts.snap
server/sonar-web/src/main/js/types/component.ts
server/sonar-web/src/main/js/types/issues.ts
server/sonar-web/src/main/js/types/security-hotspots.ts
server/sonar-web/src/main/js/types/types.ts
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index a34ee40cfd3d0e44f38665b8cae0e37890d3c439..183fd66509eb45e393b4e3645d943ff98662243d 100644 (file)
@@ -19,7 +19,6 @@
  */
 import * as React from 'react';
 import { Link } from 'react-router';
-import { ComponentQualifier } from '../../../../js/types/component';
 import Tooltip from '../../../components/controls/Tooltip';
 import ClockIcon from '../../../components/icons/ClockIcon';
 import FavoriteIcon from '../../../components/icons/FavoriteIcon';
@@ -83,10 +82,7 @@ export default class SearchResult extends React.PureComponent<Props, State> {
   };
 
   renderProject = (component: ComponentResult) => {
-    if (
-      ComponentQualifier.SubProject !== (component.qualifier as ComponentQualifier) ||
-      component.project == null
-    ) {
+    if (component.project == null) {
       return null;
     }
 
index 8b10c19f072bedec8d08d2fea1675d3d37670b38..13935091084f3026441e1121b0acfa9fe118e3db 100644 (file)
@@ -28,20 +28,16 @@ import { Search } from '../Search';
 it('selects results', () => {
   const form = shallowRender();
   form.setState({
-    more: { TRK: 15, BRC: 0 },
+    more: { TRK: 15 },
     open: true,
     results: {
-      TRK: [component('foo'), component('bar')],
-      BRC: [component('qwe', ComponentQualifier.SubProject)]
+      TRK: [component('foo'), component('bar')]
     },
     selected: 'foo'
   });
   expect(form.state().selected).toBe('foo');
   next(form, 'bar');
   next(form, 'qualifier###TRK');
-  next(form, 'qwe');
-  next(form, 'qwe');
-  prev(form, 'qualifier###TRK');
   prev(form, 'bar');
   select(form, 'foo');
   prev(form, 'foo');
index 1a8509c28a585bd1314440c8131bb85b59004662..060dff960bf8f6026f2b068c18a6a0b9f81b32ed 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { shallow } from 'enzyme';
 import * as React from 'react';
+import { ComponentQualifier } from '../../../../types/component';
 import SearchResult from '../SearchResult';
 
 beforeAll(() => {
@@ -75,7 +76,7 @@ it('renders projects', () => {
     isRecentlyBrowsed: true,
     key: 'qwe',
     name: 'qwe',
-    qualifier: 'BRC',
+    qualifier: ComponentQualifier.Project,
     project: 'foo'
   };
   const wrapper = shallowRender({ component });
index 91d82635707bba561a66dce5eaa08a48ae91f9c8..54a177c1ff7baf009fc806c2152d6e01ecc8594d 100644 (file)
@@ -33,7 +33,6 @@ it('renders different components and dividers between them', () => {
         renderResult={component => <span key={component.key}>{component.name}</span>}
         results={{
           TRK: [component('foo'), component('bar')],
-          BRC: [component('qwe', 'BRC'), component('qux', 'BRC')],
           FIL: [component('zux', 'FIL')]
         }}
       />
@@ -46,14 +45,13 @@ it('renders "Show More" link', () => {
     shallow(
       <SearchResults
         allowMore={true}
-        more={{ TRK: 175, BRC: 0 }}
+        more={{ TRK: 175 }}
         onMoreClick={jest.fn()}
         onSelect={jest.fn()}
         renderNoResults={() => <div />}
         renderResult={component => <span key={component.key}>{component.name}</span>}
         results={{
-          TRK: [component('foo'), component('bar')],
-          BRC: [component('qwe', 'BRC'), component('qux', 'BRC')]
+          TRK: [component('foo'), component('bar')]
         }}
       />
     )
index e67b6cdc0c80fb022f0d136aa8e6d04a4dbc5b07..d8f8d4dcb7e0ef34674c76ba9abfa68e1f78c8b5 100644 (file)
@@ -137,7 +137,7 @@ exports[`renders projects 1`] = `
           />
           <QualifierIcon
             className="little-spacer-right"
-            qualifier="BRC"
+            qualifier="TRK"
           />
         </span>
         <span
index c841881abf70151e6c9b155a38c77bcf734ff2b5..54e23479104db9cf27d4d86312b6688cffe3a2c3 100644 (file)
@@ -28,26 +28,6 @@ exports[`renders "Show More" link 1`] = `
     qualifier="TRK"
     selected={false}
   />
-  <li
-    className="divider"
-    key="divider-BRC"
-  />
-  <li
-    className="menu-header"
-    key="header-BRC"
-  >
-    qualifiers.BRC
-  </li>
-  <span
-    key="qwe"
-  >
-    qwe
-  </span>
-  <span
-    key="qux"
-  >
-    qux
-  </span>
 </ul>
 `;
 
@@ -86,26 +66,6 @@ exports[`renders different components and dividers between them 1`] = `
   >
     bar
   </span>
-  <li
-    className="divider"
-    key="divider-BRC"
-  />
-  <li
-    className="menu-header"
-    key="header-BRC"
-  >
-    qualifiers.BRC
-  </li>
-  <span
-    key="qwe"
-  >
-    qwe
-  </span>
-  <span
-    key="qux"
-  >
-    qux
-  </span>
 </ul>
 `;
 
index 5b1890f300188ffe8aa0838b7915e740613d8f52..968463ba2890995d8bb71447b7bbb0248f61633a 100644 (file)
@@ -25,8 +25,7 @@ const ORDER = [
   ComponentQualifier.Portfolio,
   ComponentQualifier.SubPortfolio,
   ComponentQualifier.Application,
-  ComponentQualifier.Project,
-  ComponentQualifier.SubProject
+  ComponentQualifier.Project
 ];
 
 export function sortQualifiers(qualifiers: string[]) {
index f896094ac1e23207b21787ae17d75d2e985b9389..d4b5c14b8e599536620728bf88dad034ba7c6c8c 100644 (file)
@@ -96,7 +96,7 @@ export class Search extends React.PureComponent<Props, State> {
       });
 
       const isPortfolio = ['VW', 'SVW', 'APP'].includes(component.qualifier);
-      const qualifiers = isPortfolio ? 'SVW,TRK' : 'BRC,UTS,FIL';
+      const qualifiers = isPortfolio ? 'SVW,TRK' : 'UTS,FIL';
 
       getTree({
         component: component.key,
index 5586be4b890150d3fcf285ec6a05eec8961abbac..69e243d3ca9a1219c42bba3c573d62fd1d600602 100644 (file)
@@ -63,7 +63,7 @@ it('should search correct query on mount', async () => {
   expect(getTree).toHaveBeenCalledWith({
     component: 'my-project',
     q: 'bar',
-    qualifiers: 'BRC,UTS,FIL',
+    qualifiers: 'UTS,FIL',
     s: 'qualifier,name'
   });
   expect(onSearchResults).toHaveBeenCalledWith([
@@ -94,7 +94,7 @@ it('should handle search correctly', async () => {
   expect(getTree).toHaveBeenCalledWith({
     component: 'my-project',
     q: 'foo',
-    qualifiers: 'BRC,UTS,FIL',
+    qualifiers: 'UTS,FIL',
     s: 'qualifier,name'
   });
 
index d54d90660f9cb2226659667720994dc7bbd6e90c..12391f0f991dd86d4269add7bef314ce403efa47 100644 (file)
@@ -41,16 +41,10 @@ export default function ComponentBreadcrumbs({
 }: Props) {
   const displayProject =
     !component ||
-    ![
-      ComponentQualifier.Project,
-      ComponentQualifier.SubProject,
-      ComponentQualifier.Directory
-    ].includes(component.qualifier as ComponentQualifier);
-  const displaySubProject =
-    !component ||
-    ![ComponentQualifier.SubProject, ComponentQualifier.Directory].includes(
+    ![ComponentQualifier.Project, ComponentQualifier.Directory].includes(
       component.qualifier as ComponentQualifier
     );
+
   const displayBranchInformation = isView(component?.qualifier);
 
   const selectedLocation = getSelectedLocation(issue, selectedFlowIndex, selectedLocationIndex);
@@ -86,13 +80,6 @@ export default function ComponentBreadcrumbs({
         </span>
       )}
 
-      {displaySubProject && issue.subProject !== undefined && issue.subProjectName !== undefined && (
-        <span title={issue.subProjectName}>
-          {limitComponentName(issue.subProjectName)}
-          <span className="slash-separator" />
-        </span>
-      )}
-
       <span title={componentName}>{collapsePath(componentName || '')}</span>
     </div>
   );
index 0d04d97634a87f915f4e7328808e508b8f7ea22f..f037f698591446c0aad235a96ba84340c69adab7 100644 (file)
@@ -57,8 +57,3 @@ it('renders issues properly for views', () => {
     )
   ).toMatchSnapshot('with branch information');
 });
-
-it('renders with sub-project', () => {
-  const issue = { ...baseIssue, subProject: 'sub-proj', subProjectName: 'sub-proj-name' };
-  expect(shallow(<ComponentBreadcrumbs component={undefined} issue={issue} />)).toMatchSnapshot();
-});
index ef659d7fbc9b71071307cc8a5036a9c1975455ee..7b2700d83e6b369611c520ba669346ee4c9805fc 100644 (file)
@@ -85,36 +85,3 @@ exports[`renders issues properly for views: with branch information 1`] = `
   </span>
 </div>
 `;
-
-exports[`renders with sub-project 1`] = `
-<div
-  aria-label="issues.on_file_x.proj-name, comp-name"
-  className="component-name text-ellipsis"
->
-  <QualifierIcon
-    className="spacer-right"
-    qualifier="FIL"
-  />
-  <span
-    title="proj-name - test-branch"
-  >
-    proj-name
-    <span
-      className="slash-separator"
-    />
-  </span>
-  <span
-    title="sub-proj-name"
-  >
-    sub-proj-name
-    <span
-      className="slash-separator"
-    />
-  </span>
-  <span
-    title="comp-name"
-  >
-    comp-name
-  </span>
-</div>
-`;
index 916e17efba173d09f6fd29b430b87034027cf5c2..8e6c345e8680dc74bbe70365c8f52c6e8946917f 100644 (file)
@@ -22,8 +22,8 @@ import { flatten } from 'lodash';
 import * as React from 'react';
 import { mockComponent } from '../../../../helpers/mocks/component';
 import { mockAppState } from '../../../../helpers/testMocks';
-import { GlobalSettingKeys } from '../../../../types/settings';
 import { ComponentQualifier } from '../../../../types/component';
+import { GlobalSettingKeys } from '../../../../types/settings';
 import { Query } from '../../utils';
 import { Sidebar } from '../Sidebar';
 
@@ -39,7 +39,6 @@ it.each([
   [ComponentQualifier.Application],
   [ComponentQualifier.Portfolio],
   [ComponentQualifier.SubPortfolio],
-  [ComponentQualifier.SubProject],
   [ComponentQualifier.Directory],
   [ComponentQualifier.Developper]
 ])('should render facets for %p', qualifier => {
index cd84f4811067c217ffe099245bffd3083d02cee6..e15890e007898153e6ae640ffb578c69f5dfb258 100644 (file)
@@ -34,25 +34,6 @@ Array [
 ]
 `;
 
-exports[`should render facets for "BRC" 1`] = `
-Array [
-  "TypeFacet",
-  "SeverityFacet",
-  "ScopeFacet",
-  "ResolutionFacet",
-  "StatusFacet",
-  "StandardFacet",
-  "injectIntl(CreationDateFacet)",
-  "withLanguagesContext(LanguageFacet)",
-  "RuleFacet",
-  "TagFacet",
-  "DirectoryFacet",
-  "FileFacet",
-  "AssigneeFacet",
-  "AuthorFacet",
-]
-`;
-
 exports[`should render facets for "DEV" 1`] = `
 Array [
   "TypeFacet",
index 221e1a84839f8b07e9eac363ed15ab9793d87f39..569775ece001eb3df626617413604258dd20c4de 100644 (file)
@@ -114,16 +114,7 @@ export default class SourceViewerHeader extends React.PureComponent<Props, State
 
   render() {
     const { showMeasures } = this.props;
-    const {
-      key,
-      measures,
-      path,
-      project,
-      projectName,
-      q,
-      subProject,
-      subProjectName
-    } = this.props.sourceViewerFile;
+    const { key, measures, path, project, projectName, q } = this.props.sourceViewerFile;
     const unitTestsOrLines = q === ComponentQualifier.TestFile ? 'tests' : 'lines';
     const workspace = false;
     const query = new URLSearchParams(
@@ -144,12 +135,6 @@ export default class SourceViewerHeader extends React.PureComponent<Props, State
               </a>
             </div>
 
-            {subProject !== undefined && (
-              <div className="component-name-parent">
-                <QualifierIcon qualifier="BRC" /> <span>{subProjectName}</span>
-              </div>
-            )}
-
             <div className="component-name-path">
               <QualifierIcon qualifier={q} /> <span>{collapsedDirFromPath(path)}</span>
               <span className="component-name-file">{fileFromPath(path)}</span>
index 6ae845568eb5ec6c78406bdb5aac23022751783a..38ebd8cbce509483584b55d27674bf8f9cc23f2b 100644 (file)
@@ -54,7 +54,7 @@ export default function SourceViewerHeaderSlim(props: Props) {
     onExpand,
     sourceViewerFile
   } = props;
-  const { measures, path, project, projectName, q, subProject, subProjectName } = sourceViewerFile;
+  const { measures, path, project, projectName, q } = sourceViewerFile;
 
   const projectNameLabel = (
     <>
@@ -81,13 +81,6 @@ export default function SourceViewerHeaderSlim(props: Props) {
           </div>
         )}
 
-        {subProject !== undefined && (
-          <>
-            <QualifierIcon qualifier={ComponentQualifier.SubProject} />{' '}
-            <span className="spacer-right">{subProjectName}</span>
-          </>
-        )}
-
         {!isProjectRoot && (
           <>
             <div className="spacer-right">
index 86113ca61a2f271901bb504302ff4b88f9b2ec48..e9b49afdd410e14026325268a656d2f1c2e243ac 100644 (file)
@@ -37,17 +37,6 @@ it('should render correctly', () => {
   ).toMatchSnapshot('project root');
 });
 
-it('should render correctly for subproject', () => {
-  expect(
-    shallowRender({
-      sourceViewerFile: mockSourceViewerFile('foo/bar.ts', 'my-project', {
-        subProject: 'foo',
-        subProjectName: 'Foo'
-      })
-    })
-  ).toMatchSnapshot();
-});
-
 function shallowRender(props: Partial<Props> = {}) {
   return shallow(
     <SourceViewerHeaderSlim
index d25353697d64f09d61696363358a0c686a6f3e42..1a2badc509e2af7c27b39eda09f531f866a64d7c 100644 (file)
@@ -85,100 +85,6 @@ exports[`should render correctly 1`] = `
 </div>
 `;
 
-exports[`should render correctly for subproject 1`] = `
-<div
-  className="source-viewer-header-slim display-flex-row display-flex-space-between"
->
-  <div
-    className="display-flex-center flex-1"
-  >
-    <div
-      className="spacer-right"
-    >
-      <a
-        className="link-with-icon"
-        href="/dashboard?id=my-project"
-      >
-        <QualifierIcon
-          qualifier="TRK"
-        />
-         
-        <span>
-          MyProject
-        </span>
-      </a>
-    </div>
-    <QualifierIcon
-      qualifier="BRC"
-    />
-     
-    <span
-      className="spacer-right"
-    >
-      Foo
-    </span>
-    <div
-      className="spacer-right"
-    >
-      <QualifierIcon
-        qualifier="FIL"
-      />
-       
-      <span>
-        foo/
-      </span>
-      <span
-        className="component-name-file"
-      >
-        bar.ts
-      </span>
-    </div>
-    <div
-      className="spacer-right"
-    >
-      <ClipboardIconButton
-        className="button-link link-no-underline"
-        copyValue="foo/bar.ts"
-      />
-    </div>
-  </div>
-  <div
-    className="flex-0 big-spacer-left"
-  >
-    <Link
-      onlyActiveOnIndex={false}
-      style={Object {}}
-      to={
-        Object {
-          "pathname": "/project/issues",
-          "query": Object {
-            "files": "foo/bar.ts",
-            "id": "my-project",
-            "resolved": "false",
-          },
-        }
-      }
-    >
-      source_viewer.view_all_issues
-    </Link>
-  </div>
-  <DeferredSpinner
-    className="little-spacer-right"
-  >
-    <div
-      className="flex-0 big-spacer-left"
-    >
-      <ButtonIcon
-        className="js-actions"
-        onClick={[MockFunction]}
-      >
-        <ExpandSnippetIcon />
-      </ButtonIcon>
-    </div>
-  </DeferredSpinner>
-</div>
-`;
-
 exports[`should render correctly: no link to project 1`] = `
 <div
   className="source-viewer-header-slim display-flex-row display-flex-space-between"
index 598088ec5421228e7dd395d949807836be6ca0f6..cb0778b2fefe9f225ed2925f7376c041759ed21c 100644 (file)
@@ -45,11 +45,8 @@ export default class DuplicationPopup extends React.PureComponent<Props> {
     return !isPullRequest(branchLike);
   }
 
-  isDifferentComponent = (
-    a: { project: string; subProject?: string },
-    b: { project: string; subProject?: string }
-  ) => {
-    return Boolean(a && b && (a.project !== b.project || a.subProject !== b.subProject));
+  isDifferentComponent = (a: { project: string }, b: { project: string }) => {
+    return Boolean(a && b && a.project !== b.project);
   };
 
   handleFileClick = (event: React.MouseEvent<HTMLAnchorElement>) => {
@@ -98,7 +95,6 @@ export default class DuplicationPopup extends React.PureComponent<Props> {
     duplications = sortBy(
       duplications,
       d => d.file.projectName !== sourceViewerFile.projectName,
-      d => d.file.subProjectName !== sourceViewerFile.subProjectName,
       d => d.file.key !== sourceViewerFile.key
     );
 
@@ -118,20 +114,12 @@ export default class DuplicationPopup extends React.PureComponent<Props> {
               <div className="spacer-top text-ellipsis" key={duplication.file.key}>
                 <div className="component-name">
                   {this.isDifferentComponent(duplication.file, this.props.sourceViewerFile) && (
-                    <>
-                      <div className="component-name-parent">
-                        <QualifierIcon className="little-spacer-right" qualifier="TRK" />
-                        <Link to={getProjectUrl(duplication.file.project)}>
-                          {duplication.file.projectName}
-                        </Link>
-                      </div>
-                      {duplication.file.subProject && duplication.file.subProjectName && (
-                        <div className="component-name-parent">
-                          <QualifierIcon className="little-spacer-right" qualifier="BRC" />
-                          {duplication.file.subProjectName}
-                        </div>
-                      )}
-                    </>
+                    <div className="component-name-parent">
+                      <QualifierIcon className="little-spacer-right" qualifier="TRK" />
+                      <Link to={getProjectUrl(duplication.file.project)}>
+                        {duplication.file.projectName}
+                      </Link>
+                    </div>
                   )}
 
                   {duplication.file.key !== this.props.sourceViewerFile.key && (
index 81c48868fbc0e7427c0d4595370e6f2325dfc7c7..3456b9b357778c99c31c88c097be60d1ace0814d 100644 (file)
@@ -379,13 +379,6 @@ export default class MeasuresOverlay extends React.PureComponent<Props, State> {
               <Link to={getBranchLikeUrl(sourceViewerFile.project, branchLike)}>
                 {sourceViewerFile.projectName}
               </Link>
-
-              {sourceViewerFile.subProject && (
-                <>
-                  <QualifierIcon className="big-spacer-left little-spacer-right" qualifier="BRC" />
-                  {sourceViewerFile.subProjectName}
-                </>
-              )}
             </div>
 
             <div className="display-flex-center little-spacer-top">
index f506a276f0bc1ffbae7c40da6a783f0f2029d7bc..caf553c4d9fc960f0516701f70c1ec7d5a7081e4 100644 (file)
@@ -148,8 +148,6 @@ const sourceViewerFile: SourceViewerFile = {
   project: 'project-key',
   projectName: 'Project Name',
   q: ComponentQualifier.File,
-  subProject: 'sub-project-key',
-  subProjectName: 'Sub-Project Name',
   uuid: 'abcd123'
 };
 
index 8943a81bd7ea73b6c01a5b610d28134c5fbe2d7e..eaa091a84afd21f71e1ec735b2c71881fb449472 100644 (file)
@@ -39,11 +39,6 @@ exports[`should render source file 1`] = `
         >
           Project Name
         </Link>
-        <QualifierIcon
-          className="big-spacer-left little-spacer-right"
-          qualifier="BRC"
-        />
-        Sub-Project Name
       </div>
       <div
         className="display-flex-center little-spacer-top"
@@ -613,11 +608,6 @@ exports[`should render source file 2`] = `
         >
           Project Name
         </Link>
-        <QualifierIcon
-          className="big-spacer-left little-spacer-right"
-          qualifier="BRC"
-        />
-        Sub-Project Name
       </div>
       <div
         className="display-flex-center little-spacer-top"
@@ -1770,11 +1760,6 @@ exports[`should render test file 1`] = `
         >
           Project Name
         </Link>
-        <QualifierIcon
-          className="big-spacer-left little-spacer-right"
-          qualifier="BRC"
-        />
-        Sub-Project Name
       </div>
       <div
         className="display-flex-center little-spacer-top"
index 092db41f94236e77b38c504a07765576a6f2cce3..57cef682ed514c537199796921fbf1ca43077cae 100644 (file)
@@ -25,20 +25,13 @@ import Icon, { IconProps } from './Icon';
 
 const qualifierIcons: Dict<(props: IconProps) => React.ReactElement> = {
   app: ApplicationIcon,
-  brc: SubProjectIcon,
   dev: DeveloperIcon,
   dir: DirectoryIcon,
   fil: FileIcon,
   svw: SubPortfolioIcon,
   trk: ProjectIcon,
   uts: UnitTestIcon,
-  vw: PortfolioIcon,
-
-  // deprecated:
-  cla: UnitTestIcon,
-  dev_prj: ProjectIcon,
-  lib: LibraryIcon,
-  pac: DirectoryIcon
+  vw: PortfolioIcon
 };
 
 interface QualifierIconProps {
@@ -104,17 +97,6 @@ function FileIcon({ fill, ariaLabel, ...iconProps }: IconProps) {
   );
 }
 
-function LibraryIcon({ fill, ariaLabel, ...iconProps }: IconProps) {
-  return (
-    <Icon {...iconProps} ariaLabel={ariaLabel}>
-      <path
-        d="M1 13h4V3H1v10zm3-1H2v-2h2v2zM2 4h2v4H2V4zm4 9h4V3H6v10zm3-1H7v-2h2v2zM7 4h2v4H7V4zm4 9h4V3h-4v10zm3-1h-2v-2h2v2zm-2-8h2v4h-2V4z"
-        style={{ fill: fill || colors.blue }}
-      />
-    </Icon>
-  );
-}
-
 function PortfolioIcon({ fill, ariaLabel, ...iconProps }: IconProps) {
   return (
     <Icon {...iconProps} ariaLabel={ariaLabel}>
@@ -148,17 +130,6 @@ function SubPortfolioIcon({ fill, ariaLabel, ...iconProps }: IconProps) {
   );
 }
 
-function SubProjectIcon({ fill, ariaLabel, ...iconProps }: IconProps) {
-  return (
-    <Icon {...iconProps} ariaLabel={ariaLabel}>
-      <path
-        d="M8 9V8h6v1h1v1h1v6H6v-6h1V9h1zm7 2H7v4h8v-4zm-1-7v3h-1V5H1v7h4v1H0V4h14zm-1-2v1.5h-1V3H2v.5H1V2h12zm-1-2v1.5h-1V1H3v.5H2V0h10z"
-        style={{ fill: fill || colors.blue }}
-      />
-    </Icon>
-  );
-}
-
 function UnitTestIcon({ fill, ariaLabel, ...iconProps }: IconProps) {
   return (
     <Icon {...iconProps} ariaLabel={ariaLabel}>
index f2d70ac448eae56170eb24249310e9c452f7a843..c789003c65ec09b88e97bddc0984e36df26c4145 100644 (file)
@@ -53,7 +53,6 @@ export default class SimilarIssuesPopup extends React.PureComponent<Props> {
       'rule',
       ...(issue.tags || []).map(tag => `tag###${tag}`),
       'project',
-      issue.subProject ? 'module' : undefined,
       'file'
     ].filter(item => item) as string[];
 
@@ -131,13 +130,6 @@ export default class SimilarIssuesPopup extends React.PureComponent<Props> {
             {issue.projectName}
           </SelectListItem>
 
-          {issue.subProject != null && (
-            <SelectListItem item="module">
-              <QualifierIcon className="little-spacer-right" qualifier="BRC" />
-              {issue.subProjectName}
-            </SelectListItem>
-          )}
-
           <SelectListItem item="file">
             <QualifierIcon className="little-spacer-right" qualifier={issue.componentQualifier} />
             {fileFromPath(issue.componentLongName)}
index a8e4d1b993d041b1d52051acd3c737cdcfa3a0be..4a6d09a474d9a833c9c5a1b91be7339fc4fa784a 100644 (file)
@@ -51,7 +51,7 @@ it('should filter properly', () => {
 function shallowRender(props: Partial<SimilarIssuesPopup['props']> = {}) {
   return shallow(
     <SimilarIssuesPopup
-      issue={mockIssue(false, { subProject: 'foo', subProjectName: 'Foo', tags: ['test-tag'] })}
+      issue={mockIssue(false, { tags: ['test-tag'] })}
       onFilter={jest.fn()}
       {...props}
     />
index aabffd0885eba1e67fb3386c45c3b4e8885e6901..9710488692ce2787a95345ae34e0aa0c2883a1ca 100644 (file)
@@ -24,7 +24,6 @@ exports[`should render correctly 1`] = `
         "rule",
         "tag###test-tag",
         "project",
-        "module",
         "file",
       ]
     }
@@ -99,15 +98,6 @@ exports[`should render correctly 1`] = `
       />
       Foo
     </SelectListItem>
-    <SelectListItem
-      item="module"
-    >
-      <QualifierIcon
-        className="little-spacer-right"
-        qualifier="BRC"
-      />
-      Foo
-    </SelectListItem>
     <SelectListItem
       item="file"
     >
index 8cbf77dfcaac3f38526ab5650d79a2c6e5b1655e..1e72f660c58a225b05276cf74e80ad76a4c0f564 100644 (file)
@@ -142,7 +142,6 @@ export function parseIssueFromResponse(
     ...issue,
     ...injectRelational(issue, components, 'component', 'key'),
     ...injectRelational(issue, components, 'project', 'key'),
-    ...injectRelational(issue, components, 'subProject', 'key'),
     ...injectRelational(issue, rules, 'rule', 'key'),
     ...injectRelational(issue, users, 'assignee', 'login'),
     ...injectCommentsRelational(issue, users),
index 6711bdb59feda305bd3b4b18705d6929a47cbd2f..c940d2fd048446fa5ccb8942756e4a4b89fc4cbe 100644 (file)
@@ -3,7 +3,6 @@
 exports[`[Function isApplication] should work properly 1`] = `
 Object {
   "APP": true,
-  "BRC": false,
   "DEV": false,
   "DIR": false,
   "FIL": false,
@@ -17,7 +16,6 @@ Object {
 exports[`[Function isFile] should work properly 1`] = `
 Object {
   "APP": false,
-  "BRC": false,
   "DEV": false,
   "DIR": false,
   "FIL": true,
@@ -31,7 +29,6 @@ Object {
 exports[`[Function isPortfolioLike] should work properly 1`] = `
 Object {
   "APP": false,
-  "BRC": false,
   "DEV": false,
   "DIR": false,
   "FIL": false,
@@ -45,7 +42,6 @@ Object {
 exports[`[Function isProject] should work properly 1`] = `
 Object {
   "APP": false,
-  "BRC": false,
   "DEV": false,
   "DIR": false,
   "FIL": false,
@@ -59,7 +55,6 @@ Object {
 exports[`[Function isView] should work properly 1`] = `
 Object {
   "APP": true,
-  "BRC": false,
   "DEV": false,
   "DIR": false,
   "FIL": false,
index 13909fbd410325cf4bcbf537c930cf0304835f2c..020a455fb94e211d7b37a611ce0d9889b1d1551a 100644 (file)
@@ -32,7 +32,6 @@ export enum ComponentQualifier {
   Portfolio = 'VW',
   Project = 'TRK',
   SubPortfolio = 'SVW',
-  SubProject = 'BRC',
   TestFile = 'UTS'
 }
 
index 360e4e153121eaa47dd74de20f446bc90bc6f57a..ea82a595d9fff84a2bb7663a95c984063d5acb97 100644 (file)
@@ -58,7 +58,6 @@ export interface RawIssue {
   message?: string;
   severity: string;
   status: string;
-  subProject?: string;
   textRange?: TextRange;
   type: IssueType;
 }
index 96553ddc991e5ecf034032af6985d2c8b54f9d38..6e436f13ca95107ecc661b55bdc574b6c2f2547d 100644 (file)
@@ -71,7 +71,6 @@ export interface RawHotspot {
   rule: string;
   securityCategory: string;
   status: HotspotStatus;
-  subProject?: string;
   updateDate: string;
   vulnerabilityProbability: RiskExposure;
   flows?: Array<{
index 5691a852d8f9fd90d47bfd3481e55b475ceb69a8..8f65eb38a200a6ec5f4bfa051593514ed044189d 100644 (file)
@@ -214,8 +214,6 @@ export interface DuplicatedFile {
   name: string;
   project: string;
   projectName: string;
-  subProject?: string;
-  subProjectName?: string;
 }
 
 export type ExpandDirection = 'up' | 'down';
@@ -291,8 +289,6 @@ export interface Issue {
   secondaryLocations: FlowLocation[];
   severity: string;
   status: string;
-  subProject?: string;
-  subProjectName?: string;
   tags?: string[];
   textRange?: TextRange;
   transitions: string[];
@@ -681,8 +677,6 @@ export interface SourceViewerFile {
   project: string;
   projectName: string;
   q: ComponentQualifier;
-  subProject?: string;
-  subProjectName?: string;
   uuid: string;
 }
 
index bc867f692ee9e295002df3461d438f105b9dbd7a..53c59d89003feebde398aadd318a5e82f37f01ba 100644 (file)
@@ -385,7 +385,6 @@ alm.gitlab.short=GitLab
 #------------------------------------------------------------------------------
 
 qualifier.TRK=Project
-qualifier.BRC=Sub-project
 qualifier.DIR=Directory
 qualifier.PAC=Package
 qualifier.VW=Portfolio
@@ -402,7 +401,6 @@ qualifier.configuration.SVW=Portfolio Configuration
 qualifier.configuration.APP=Application Configuration
 
 qualifiers.TRK=Projects
-qualifiers.BRC=Sub-projects
 qualifiers.DIR=Directories
 qualifiers.PAC=Packages
 qualifiers.VW=Portfolios