diff options
author | Mathieu Suen <mathieu.suen@sonarsource.com> | 2022-06-14 10:16:44 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-06-15 20:03:03 +0000 |
commit | 2a7127370736396d0f912d58ff5d6df5ed30bd07 (patch) | |
tree | faa30dfa7bd5ab22cb6b9d73e835c42c1c3401a9 /server/sonar-web | |
parent | b252bea18bbbf44452c05b1e569d530f369dede6 (diff) | |
download | sonarqube-2a7127370736396d0f912d58ff5d6df5ed30bd07.tar.gz sonarqube-2a7127370736396d0f912d58ff5d6df5ed30bd07.zip |
SONAR-16488 Clean sub-project code from the UI
Diffstat (limited to 'server/sonar-web')
32 files changed, 27 insertions, 373 deletions
diff --git a/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx b/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx index a34ee40cfd3..183fd66509e 100644 --- a/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx +++ b/server/sonar-web/src/main/js/app/components/search/SearchResult.tsx @@ -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; } diff --git a/server/sonar-web/src/main/js/app/components/search/__tests__/Search-test.tsx b/server/sonar-web/src/main/js/app/components/search/__tests__/Search-test.tsx index 8b10c19f072..13935091084 100644 --- a/server/sonar-web/src/main/js/app/components/search/__tests__/Search-test.tsx +++ b/server/sonar-web/src/main/js/app/components/search/__tests__/Search-test.tsx @@ -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'); diff --git a/server/sonar-web/src/main/js/app/components/search/__tests__/SearchResult-test.tsx b/server/sonar-web/src/main/js/app/components/search/__tests__/SearchResult-test.tsx index 1a8509c28a5..060dff960bf 100644 --- a/server/sonar-web/src/main/js/app/components/search/__tests__/SearchResult-test.tsx +++ b/server/sonar-web/src/main/js/app/components/search/__tests__/SearchResult-test.tsx @@ -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 }); diff --git a/server/sonar-web/src/main/js/app/components/search/__tests__/SearchResults-test.tsx b/server/sonar-web/src/main/js/app/components/search/__tests__/SearchResults-test.tsx index 91d82635707..54a177c1ff7 100644 --- a/server/sonar-web/src/main/js/app/components/search/__tests__/SearchResults-test.tsx +++ b/server/sonar-web/src/main/js/app/components/search/__tests__/SearchResults-test.tsx @@ -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')] }} /> ) diff --git a/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResult-test.tsx.snap b/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResult-test.tsx.snap index e67b6cdc0c8..d8f8d4dcb7e 100644 --- a/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResult-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResult-test.tsx.snap @@ -137,7 +137,7 @@ exports[`renders projects 1`] = ` /> <QualifierIcon className="little-spacer-right" - qualifier="BRC" + qualifier="TRK" /> </span> <span diff --git a/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResults-test.tsx.snap b/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResults-test.tsx.snap index c841881abf7..54e23479104 100644 --- a/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResults-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResults-test.tsx.snap @@ -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> `; diff --git a/server/sonar-web/src/main/js/app/components/search/utils.ts b/server/sonar-web/src/main/js/app/components/search/utils.ts index 5b1890f3001..968463ba289 100644 --- a/server/sonar-web/src/main/js/app/components/search/utils.ts +++ b/server/sonar-web/src/main/js/app/components/search/utils.ts @@ -25,8 +25,7 @@ const ORDER = [ ComponentQualifier.Portfolio, ComponentQualifier.SubPortfolio, ComponentQualifier.Application, - ComponentQualifier.Project, - ComponentQualifier.SubProject + ComponentQualifier.Project ]; export function sortQualifiers(qualifiers: string[]) { diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.tsx b/server/sonar-web/src/main/js/apps/code/components/Search.tsx index f896094ac1e..d4b5c14b8e5 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Search.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/Search.tsx @@ -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, diff --git a/server/sonar-web/src/main/js/apps/code/components/__tests__/Search-test.tsx b/server/sonar-web/src/main/js/apps/code/components/__tests__/Search-test.tsx index 5586be4b890..69e243d3ca9 100644 --- a/server/sonar-web/src/main/js/apps/code/components/__tests__/Search-test.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/__tests__/Search-test.tsx @@ -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' }); diff --git a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx index d54d90660f9..12391f0f991 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx @@ -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> ); diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/ComponentBreadcrumbs-test.tsx b/server/sonar-web/src/main/js/apps/issues/components/__tests__/ComponentBreadcrumbs-test.tsx index 0d04d97634a..f037f698591 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/ComponentBreadcrumbs-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/ComponentBreadcrumbs-test.tsx @@ -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(); -}); diff --git a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap index ef659d7fbc9..7b2700d83e6 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/components/__tests__/__snapshots__/ComponentBreadcrumbs-test.tsx.snap @@ -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> -`; diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/Sidebar-test.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/Sidebar-test.tsx index 916e17efba1..8e6c345e868 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/Sidebar-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/Sidebar-test.tsx @@ -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 => { diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/Sidebar-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/Sidebar-test.tsx.snap index cd84f481106..e15890e0078 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/Sidebar-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/Sidebar-test.tsx.snap @@ -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", diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx index 221e1a84839..569775ece00 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.tsx @@ -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> diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx index 6ae845568eb..38ebd8cbce5 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeaderSlim.tsx @@ -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"> diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx index 86113ca61a2..e9b49afdd41 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/SourceViewerHeaderSlim-test.tsx @@ -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 diff --git a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap index d25353697d6..1a2badc509e 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/SourceViewer/__tests__/__snapshots__/SourceViewerHeaderSlim-test.tsx.snap @@ -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" diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx index 598088ec542..cb0778b2fef 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/DuplicationPopup.tsx @@ -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 && ( diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx index 81c48868fbc..3456b9b3577 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx @@ -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"> diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx index f506a276f0b..caf553c4d9f 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/MeasuresOverlay-test.tsx @@ -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' }; diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap index 8943a81bd7e..eaa091a84af 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/MeasuresOverlay-test.tsx.snap @@ -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" diff --git a/server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx b/server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx index 092db41f942..57cef682ed5 100644 --- a/server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx +++ b/server/sonar-web/src/main/js/components/icons/QualifierIcon.tsx @@ -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}> diff --git a/server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx index f2d70ac448e..c789003c65e 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/SimilarIssuesPopup.tsx @@ -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)} diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/SimilarIssuesPopup-test.tsx b/server/sonar-web/src/main/js/components/issue/popups/__tests__/SimilarIssuesPopup-test.tsx index a8e4d1b993d..4a6d09a474d 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/SimilarIssuesPopup-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/SimilarIssuesPopup-test.tsx @@ -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} /> diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SimilarIssuesPopup-test.tsx.snap b/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SimilarIssuesPopup-test.tsx.snap index aabffd0885e..9710488692c 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SimilarIssuesPopup-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SimilarIssuesPopup-test.tsx.snap @@ -24,7 +24,6 @@ exports[`should render correctly 1`] = ` "rule", "tag###test-tag", "project", - "module", "file", ] } @@ -100,15 +99,6 @@ exports[`should render correctly 1`] = ` Foo </SelectListItem> <SelectListItem - item="module" - > - <QualifierIcon - className="little-spacer-right" - qualifier="BRC" - /> - Foo - </SelectListItem> - <SelectListItem item="file" > <QualifierIcon diff --git a/server/sonar-web/src/main/js/helpers/issues.ts b/server/sonar-web/src/main/js/helpers/issues.ts index 8cbf77dfcaa..1e72f660c58 100644 --- a/server/sonar-web/src/main/js/helpers/issues.ts +++ b/server/sonar-web/src/main/js/helpers/issues.ts @@ -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), diff --git a/server/sonar-web/src/main/js/types/__tests__/__snapshots__/component-test.ts.snap b/server/sonar-web/src/main/js/types/__tests__/__snapshots__/component-test.ts.snap index 6711bdb59fe..c940d2fd048 100644 --- a/server/sonar-web/src/main/js/types/__tests__/__snapshots__/component-test.ts.snap +++ b/server/sonar-web/src/main/js/types/__tests__/__snapshots__/component-test.ts.snap @@ -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, diff --git a/server/sonar-web/src/main/js/types/component.ts b/server/sonar-web/src/main/js/types/component.ts index 13909fbd410..020a455fb94 100644 --- a/server/sonar-web/src/main/js/types/component.ts +++ b/server/sonar-web/src/main/js/types/component.ts @@ -32,7 +32,6 @@ export enum ComponentQualifier { Portfolio = 'VW', Project = 'TRK', SubPortfolio = 'SVW', - SubProject = 'BRC', TestFile = 'UTS' } diff --git a/server/sonar-web/src/main/js/types/issues.ts b/server/sonar-web/src/main/js/types/issues.ts index 360e4e15312..ea82a595d9f 100644 --- a/server/sonar-web/src/main/js/types/issues.ts +++ b/server/sonar-web/src/main/js/types/issues.ts @@ -58,7 +58,6 @@ export interface RawIssue { message?: string; severity: string; status: string; - subProject?: string; textRange?: TextRange; type: IssueType; } diff --git a/server/sonar-web/src/main/js/types/security-hotspots.ts b/server/sonar-web/src/main/js/types/security-hotspots.ts index 96553ddc991..6e436f13ca9 100644 --- a/server/sonar-web/src/main/js/types/security-hotspots.ts +++ b/server/sonar-web/src/main/js/types/security-hotspots.ts @@ -71,7 +71,6 @@ export interface RawHotspot { rule: string; securityCategory: string; status: HotspotStatus; - subProject?: string; updateDate: string; vulnerabilityProbability: RiskExposure; flows?: Array<{ diff --git a/server/sonar-web/src/main/js/types/types.ts b/server/sonar-web/src/main/js/types/types.ts index 5691a852d8f..8f65eb38a20 100644 --- a/server/sonar-web/src/main/js/types/types.ts +++ b/server/sonar-web/src/main/js/types/types.ts @@ -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; } |