From a98392c5e20c4699ff869c54d2288298f2129a40 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Tue, 3 Oct 2023 11:28:41 +0200 Subject: [PATCH] [NO JIRA] Delete unused components --- .../components/CreateProjectPageHeader.tsx | 37 -- .../branches/SecurityHotspotsReviewed.tsx | 60 --- .../components/MeasuresOverlay.tsx | 439 ------------------ .../components/MeasuresOverlayMeasure.tsx | 60 --- .../main/js/components/charts/BarChart.css | 28 -- .../main/js/components/charts/BarChart.tsx | 178 ------- .../main/js/components/charts/LineChart.tsx | 211 --------- .../DocumentationLink.tsx} | 14 +- .../js/components/common/LocationIndex.css | 71 --- .../js/components/common/LocationIndex.tsx | 48 -- .../js/components/common/MeasuresLink.css | 26 -- .../js/components/common/MeasuresLink.tsx | 48 -- .../js/components/controls/BackButton.tsx | 72 --- .../js/components/controls/ReloadButton.tsx | 60 --- .../main/js/components/icons/ArrowIcon.tsx | 50 -- .../main/js/components/icons/BubblesIcon.tsx | 32 -- .../js/components/icons/ChevronLeftIcon.tsx | 32 -- .../js/components/icons/ChevronUpIcon.tsx | 32 -- .../main/js/components/icons/ChevronsIcon.tsx | 33 -- .../main/js/components/icons/ClockIcon.tsx | 34 -- .../src/main/js/components/icons/CogIcon.tsx | 32 -- .../js/components/icons/ExpandSnippetIcon.tsx | 48 -- .../main/js/components/icons/FilterIcon.tsx | 32 -- .../src/main/js/components/icons/HomeIcon.tsx | 41 -- .../js/components/icons/LightBulbIcon.tsx | 32 -- .../src/main/js/components/icons/ListIcon.tsx | 32 -- .../components/icons/LongLivingBranchIcon.tsx | 35 -- .../js/components/icons/NotificationIcon.tsx | 51 -- .../src/main/js/components/icons/PinIcon.tsx | 32 -- .../src/main/js/components/icons/PlusIcon.tsx | 29 -- .../main/js/components/icons/RocketIcon.tsx | 32 -- .../js/components/icons/RuleScopeIcon.tsx | 32 -- .../icons/ShortLivingBranchIcon.tsx | 35 -- .../main/js/components/icons/SortAscIcon.tsx | 32 -- .../main/js/components/icons/SortDescIcon.tsx | 32 -- .../js/components/icons/TestStatusIcon.tsx | 83 ---- .../src/main/js/components/icons/TreeIcon.tsx | 32 -- .../main/js/components/icons/TreemapIcon.tsx | 32 -- .../main/js/components/icons/VisibleIcon.tsx | 32 -- .../issue/components/IssueChangelog.tsx | 75 --- .../issue/components/IssueCommentLine.tsx | 151 ------ .../issue/popups/ChangelogPopup.tsx | 121 ----- .../issue/popups/CommentDeletePopup.tsx | 41 -- .../components/issue/popups/CommentTile.tsx | 120 ----- .../locations/CrossFileLocationNavigator.css | 98 ---- .../locations/CrossFileLocationNavigator.tsx | 207 --------- .../js/components/locations/LocationsList.tsx | 71 --- .../tutorials/components/AllSetStep.tsx | 48 -- .../tutorials/components/FinishButton.tsx | 37 -- .../main/js/components/ui/AutoEllipsis.tsx | 88 ---- .../src/main/js/components/ui/NewsBox.css | 31 -- .../src/main/js/components/ui/NewsBox.tsx | 50 -- .../main/js/components/ui/PlaceholderBar.css | 25 - .../src/main/js/components/ui/SizeRating.css | 36 -- .../src/main/js/components/ui/SizeRating.tsx | 57 --- .../components/ui/update-center/MetaData.css | 101 ---- .../components/ui/update-center/MetaData.tsx | 121 ----- .../ui/update-center/MetaDataVersion.tsx | 99 ---- .../ui/update-center/MetaDataVersions.tsx | 85 ---- .../mocks/update-center-metadata.ts | 57 --- .../update-center/update-center-metadata.ts | 48 -- .../upgrade/__tests__/SystemUpgrade-test.tsx | 6 +- server/sonar-web/src/main/js/types/actions.ts | 22 - 63 files changed, 9 insertions(+), 4057 deletions(-) delete mode 100644 server/sonar-web/src/main/js/apps/create/project/components/CreateProjectPageHeader.tsx delete mode 100644 server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx delete mode 100644 server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx delete mode 100644 server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlayMeasure.tsx delete mode 100644 server/sonar-web/src/main/js/components/charts/BarChart.css delete mode 100644 server/sonar-web/src/main/js/components/charts/BarChart.tsx delete mode 100644 server/sonar-web/src/main/js/components/charts/LineChart.tsx rename server/sonar-web/src/main/js/components/{ui/PlaceholderBar.tsx => common/DocumentationLink.tsx} (69%) delete mode 100644 server/sonar-web/src/main/js/components/common/LocationIndex.css delete mode 100644 server/sonar-web/src/main/js/components/common/LocationIndex.tsx delete mode 100644 server/sonar-web/src/main/js/components/common/MeasuresLink.css delete mode 100644 server/sonar-web/src/main/js/components/common/MeasuresLink.tsx delete mode 100644 server/sonar-web/src/main/js/components/controls/BackButton.tsx delete mode 100644 server/sonar-web/src/main/js/components/controls/ReloadButton.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/ArrowIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/BubblesIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/ChevronLeftIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/ChevronUpIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/ChevronsIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/ClockIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/CogIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/ExpandSnippetIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/FilterIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/HomeIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/LightBulbIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/ListIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/LongLivingBranchIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/NotificationIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/PinIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/PlusIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/RocketIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/RuleScopeIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/ShortLivingBranchIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/SortAscIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/SortDescIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/TestStatusIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/TreeIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/TreemapIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/icons/VisibleIcon.tsx delete mode 100644 server/sonar-web/src/main/js/components/issue/components/IssueChangelog.tsx delete mode 100644 server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.tsx delete mode 100644 server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.tsx delete mode 100644 server/sonar-web/src/main/js/components/issue/popups/CommentDeletePopup.tsx delete mode 100644 server/sonar-web/src/main/js/components/issue/popups/CommentTile.tsx delete mode 100644 server/sonar-web/src/main/js/components/locations/CrossFileLocationNavigator.css delete mode 100644 server/sonar-web/src/main/js/components/locations/CrossFileLocationNavigator.tsx delete mode 100644 server/sonar-web/src/main/js/components/locations/LocationsList.tsx delete mode 100644 server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx delete mode 100644 server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx delete mode 100644 server/sonar-web/src/main/js/components/ui/AutoEllipsis.tsx delete mode 100644 server/sonar-web/src/main/js/components/ui/NewsBox.css delete mode 100644 server/sonar-web/src/main/js/components/ui/NewsBox.tsx delete mode 100644 server/sonar-web/src/main/js/components/ui/PlaceholderBar.css delete mode 100644 server/sonar-web/src/main/js/components/ui/SizeRating.css delete mode 100644 server/sonar-web/src/main/js/components/ui/SizeRating.tsx delete mode 100644 server/sonar-web/src/main/js/components/ui/update-center/MetaData.css delete mode 100644 server/sonar-web/src/main/js/components/ui/update-center/MetaData.tsx delete mode 100644 server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersion.tsx delete mode 100644 server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersions.tsx delete mode 100644 server/sonar-web/src/main/js/components/ui/update-center/mocks/update-center-metadata.ts delete mode 100644 server/sonar-web/src/main/js/components/ui/update-center/update-center-metadata.ts delete mode 100644 server/sonar-web/src/main/js/types/actions.ts diff --git a/server/sonar-web/src/main/js/apps/create/project/components/CreateProjectPageHeader.tsx b/server/sonar-web/src/main/js/apps/create/project/components/CreateProjectPageHeader.tsx deleted file mode 100644 index f5d4517ff10..00000000000 --- a/server/sonar-web/src/main/js/apps/create/project/components/CreateProjectPageHeader.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; - -export interface CreateProjectPageHeaderProps { - additionalActions?: React.ReactNode; - title: React.ReactNode; -} - -export default function CreateProjectPageHeader(props: CreateProjectPageHeaderProps) { - const { additionalActions, title } = props; - - return ( -
-

{title}

- - {additionalActions} -
- ); -} diff --git a/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx b/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx deleted file mode 100644 index 3f49dc44761..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/branches/SecurityHotspotsReviewed.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { getLeakValue } from '../../../components/measure/utils'; -import CoverageRating from '../../../components/ui/CoverageRating'; -import { translate } from '../../../helpers/l10n'; -import { findMeasure, formatMeasure } from '../../../helpers/measures'; -import { MetricKey } from '../../../types/metrics'; -import { MeasureEnhanced } from '../../../types/types'; - -export interface SecurityHotspotsReviewedProps { - measures: MeasureEnhanced[]; - useDiffMetric?: boolean; -} - -export default function SecurityHotspotsReviewed(props: SecurityHotspotsReviewedProps) { - const { measures, useDiffMetric = false } = props; - const metric = useDiffMetric - ? MetricKey.new_security_hotspots_reviewed - : MetricKey.security_hotspots_reviewed; - const measure = findMeasure(measures, metric); - - let value; - if (measure) { - value = useDiffMetric ? getLeakValue(measure) : measure.value; - } - - return ( - <> - {value === undefined ? ( - - ) : ( - <> - - {formatMeasure(value, 'PERCENT')} - - )} - - {translate('overview.measures.security_hotspots_reviewed')} - - - ); -} 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 deleted file mode 100644 index d3f489c5010..00000000000 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx +++ /dev/null @@ -1,439 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { groupBy, keyBy, sortBy } from 'lodash'; -import * as React from 'react'; -import { getFacets } from '../../../api/issues'; -import { getMeasures } from '../../../api/measures'; -import { getAllMetrics } from '../../../api/metrics'; -import Link from '../../../components/common/Link'; -import Modal from '../../../components/controls/Modal'; -import { ResetButtonLink } from '../../../components/controls/buttons'; -import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; -import QualifierIcon from '../../../components/icons/QualifierIcon'; -import TagsIcon from '../../../components/icons/TagsIcon'; -import DuplicationsRating from '../../../components/ui/DuplicationsRating'; -import { getBranchLikeQuery } from '../../../helpers/branch-like'; -import { ISSUE_TYPES, SEVERITIES } from '../../../helpers/constants'; -import { getLocalizedMetricName, translate } from '../../../helpers/l10n'; -import { - enhanceMeasuresWithMetrics, - formatMeasure, - getDisplayMetrics, -} from '../../../helpers/measures'; -import { getBranchLikeUrl } from '../../../helpers/urls'; -import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier } from '../../../types/component'; -import { FacetName, IssueSeverity, IssueType as IssueTypeEnum } from '../../../types/issues'; -import { MetricType } from '../../../types/metrics'; -import { FacetValue, IssueType, MeasureEnhanced, SourceViewerFile } from '../../../types/types'; -import Measure from '../../measure/Measure'; -import SeverityHelper from '../../shared/SeverityHelper'; -import CoverageRating from '../../ui/CoverageRating'; -import MeasuresOverlayMeasure from './MeasuresOverlayMeasure'; - -interface Props { - branchLike: BranchLike | undefined; - onClose: () => void; - sourceViewerFile: SourceViewerFile; -} - -interface Measures { - [metricKey: string]: MeasureEnhanced; -} - -interface State { - loading: boolean; - measures: Measures; - severitiesFacet?: FacetValue[]; - showAllMeasures: boolean; - tagsFacet?: FacetValue[]; - typesFacet?: FacetValue[]; -} - -export default class MeasuresOverlay extends React.PureComponent { - mounted = false; - state: State = { loading: true, measures: {}, showAllMeasures: false }; - - componentDidMount() { - this.mounted = true; - this.fetchData(); - } - - componentWillUnmount() { - this.mounted = false; - } - - fetchData = () => { - Promise.all([this.fetchMeasures(), this.fetchIssues()]).then( - ([measures, facets]) => { - if (this.mounted) { - this.setState({ loading: false, measures, ...facets }); - } - }, - () => { - if (this.mounted) { - this.setState({ loading: false }); - } - }, - ); - }; - - fetchMeasures = () => { - return getAllMetrics().then((metrics) => { - const metricKeys = getDisplayMetrics(metrics).map((metric) => metric.key); - - // eslint-disable-next-line promise/no-nesting - return getMeasures({ - component: this.props.sourceViewerFile.key, - metricKeys: metricKeys.join(), - ...getBranchLikeQuery(this.props.branchLike), - }).then((measures) => { - const withMetrics = enhanceMeasuresWithMetrics(measures, metrics).filter( - (measure) => measure.metric, - ); - return keyBy(withMetrics, (measure) => measure.metric.key); - }); - }); - }; - - fetchIssues = () => { - return getFacets( - { - componentKeys: this.props.sourceViewerFile.key, - resolved: 'false', - ...getBranchLikeQuery(this.props.branchLike), - }, - [FacetName.Types, FacetName.Severities, FacetName.Tags], - ).then(({ facets }) => { - const severitiesFacet = facets.find((f) => f.property === 'severities'); - const tagsFacet = facets.find((f) => f.property === 'tags'); - const typesFacet = facets.find((f) => f.property === 'types'); - return { - severitiesFacet: severitiesFacet?.values, - tagsFacet: tagsFacet?.values, - typesFacet: typesFacet && (typesFacet.values as FacetValue[]), - }; - }); - }; - - handleAllMeasuresClick = (event: React.SyntheticEvent) => { - event.preventDefault(); - event.currentTarget.blur(); - this.setState({ showAllMeasures: true }); - }; - - renderMeasure = (measure: MeasureEnhanced | undefined) => { - return measure ? : null; - }; - - renderLines = () => { - const { measures } = this.state; - - return ( -
-
-
- {this.renderMeasure(measures.lines)} - {this.renderMeasure(measures.ncloc)} - {this.renderMeasure(measures.comment_lines)} - {this.renderMeasure(measures.comment_lines_density)} -
- -
- {this.renderMeasure(measures.cognitive_complexity)} - {this.renderMeasure(measures.complexity)} - {this.renderMeasure(measures.function_complexity)} -
-
-
- ); - }; - - renderBigMeasure = (measure: MeasureEnhanced | undefined) => { - return measure ? ( -
- - - - {getLocalizedMetricName(measure.metric, true)} -
- ) : null; - }; - - renderIssues = () => { - const { measures, severitiesFacet, tagsFacet, typesFacet } = this.state; - return ( -
-
-
- {this.renderBigMeasure(measures.violations)} - {this.renderBigMeasure(measures.sqale_index)} -
- {measures.violations && !!measures.violations.value && ( - <> - {typesFacet && ( -
- {sortBy(typesFacet, (f) => ISSUE_TYPES.indexOf(f.val as IssueTypeEnum)).map( - (f) => ( -
- - - {translate('issue.type', f.val)} - - - {formatMeasure(f.count, MetricType.ShortInteger)} - -
- ), - )} -
- )} - {severitiesFacet && ( -
- {sortBy(severitiesFacet, (f) => SEVERITIES.indexOf(f.val as IssueSeverity)).map( - (f) => ( -
- - - - - {formatMeasure(f.count, MetricType.ShortInteger)} - -
- ), - )} -
- )} - {tagsFacet && ( -
- {tagsFacet.map((f) => ( -
- - - {f.val} - - - {formatMeasure(f.count, MetricType.ShortInteger)} - -
- ))} -
- )} - - )} -
-
- ); - }; - - renderCoverage = () => { - const { coverage } = this.state.measures; - if (!coverage) { - return null; - } - return ( -
-
-
-
- -
-
- - - - {getLocalizedMetricName(coverage.metric)} -
-
- -
- {this.renderMeasure(this.state.measures.uncovered_lines)} - {this.renderMeasure(this.state.measures.lines_to_cover)} - {this.renderMeasure(this.state.measures.uncovered_conditions)} - {this.renderMeasure(this.state.measures.conditions_to_cover)} -
-
-
- ); - }; - - renderDuplications = () => { - const { duplicated_lines_density: duplications } = this.state.measures; - if (!duplications) { - return null; - } - return ( -
-
-
-
- -
-
- - - - - {getLocalizedMetricName(duplications.metric, true)} - -
-
- -
- {this.renderMeasure(this.state.measures.duplicated_blocks)} - {this.renderMeasure(this.state.measures.duplicated_lines)} -
-
-
- ); - }; - - renderTests = () => { - const { measures } = this.state; - return ( -
-
-
-
- {this.renderMeasure(measures.tests)} - {this.renderMeasure(measures.test_success_density)} - {this.renderMeasure(measures.test_failures)} - {this.renderMeasure(measures.test_errors)} - {this.renderMeasure(measures.skipped_tests)} - {this.renderMeasure(measures.test_execution_time)} -
-
-
-
- ); - }; - - renderDomain = (domain: string, measures: MeasureEnhanced[]) => { - return ( -
-
-
- {translate('metric_domain', domain)} -
- {sortBy( - measures.filter((measure) => measure.value !== undefined), - (measure) => getLocalizedMetricName(measure.metric), - ).map((measure) => this.renderMeasure(measure))} -
-
- ); - }; - - renderAllMeasures = () => { - const domains = groupBy(Object.values(this.state.measures), (measure) => measure.metric.domain); - const domainKeys = Object.keys(domains); - const odd = domainKeys.filter((_, index) => index % 2 === 1); - const even = domainKeys.filter((_, index) => index % 2 === 0); - return ( -
-
- {odd.map((domain) => this.renderDomain(domain, domains[domain]))} -
-
- {even.map((domain) => this.renderDomain(domain, domains[domain]))} -
-
- ); - }; - - render() { - const { branchLike, sourceViewerFile } = this.props; - const { loading } = this.state; - - const header = translate('component_viewer.file_measures'); - return ( - -
-

{header}

-
-
-
-
- - - {sourceViewerFile.projectName} - -
- -
- - {sourceViewerFile.path} -
-
- - {loading ? ( - - ) : ( - <> - {sourceViewerFile.q === ComponentQualifier.TestFile ? ( - this.renderTests() - ) : ( -
- {this.renderLines()} - {this.renderIssues()} - {this.renderCoverage()} - {this.renderDuplications()} -
- )} - - )} - -
- {this.state.showAllMeasures ? ( - this.renderAllMeasures() - ) : ( - - {translate('component_viewer.show_all_measures')} - - )} -
-
- -
- {translate('close')} -
-
- ); - } -} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlayMeasure.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlayMeasure.tsx deleted file mode 100644 index 55aac3df130..00000000000 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlayMeasure.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; -import { getLocalizedMetricName } from '../../../helpers/l10n'; -import { isMetricKey, MetricKey } from '../../../types/metrics'; -import { Metric } from '../../../types/types'; -import Measure from '../../measure/Measure'; - -export interface MeasureWithMetric { - metric: Metric; - value?: string; -} - -interface Props { - measure: MeasureWithMetric; -} - -export default function MeasuresOverlayMeasure({ measure }: Props) { - return ( -
- - {isMetricKey(measure.metric.key) && - [MetricKey.bugs, MetricKey.vulnerabilities, MetricKey.code_smells].includes( - measure.metric.key, - ) && } - {getLocalizedMetricName(measure.metric)} - - - - -
- ); -} diff --git a/server/sonar-web/src/main/js/components/charts/BarChart.css b/server/sonar-web/src/main/js/components/charts/BarChart.css deleted file mode 100644 index 9d34dfb041a..00000000000 --- a/server/sonar-web/src/main/js/components/charts/BarChart.css +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.bar-chart-bar { - fill: var(--blue); -} - -.bar-chart-tick { - fill: var(--secondFontColor); - font-size: var(--smallFontSize); - text-anchor: middle; -} diff --git a/server/sonar-web/src/main/js/components/charts/BarChart.tsx b/server/sonar-web/src/main/js/components/charts/BarChart.tsx deleted file mode 100644 index b071a6e1555..00000000000 --- a/server/sonar-web/src/main/js/components/charts/BarChart.tsx +++ /dev/null @@ -1,178 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { max } from 'd3-array'; -import { scaleBand, ScaleBand, scaleLinear, ScaleLinear } from 'd3-scale'; -import * as React from 'react'; -import Tooltip from '../controls/Tooltip'; -import './BarChart.css'; - -interface DataPoint { - tooltip?: React.ReactNode; - description: string; - x: number; - y: number; -} - -interface Props { - barsWidth: number; - data: Array; - height: number; - onBarClick?: (point: DataPoint & T) => void; - padding?: [number, number, number, number]; - width: number; - xTicks?: string[]; - xValues?: string[]; -} - -export default class BarChart extends React.PureComponent> { - handleClick = (point: DataPoint & T) => { - if (this.props.onBarClick) { - this.props.onBarClick(point); - } - }; - - renderXTicks = (xScale: ScaleBand, yScale: ScaleLinear) => { - const { data, xTicks = [] } = this.props; - - if (!xTicks.length) { - return null; - } - - const ticks = xTicks.map((tick, index) => { - const point = data[index]; - const x = Math.round((xScale(point.x) as number) + xScale.bandwidth() / 2); - const y = yScale.range()[0]; - const d = data[index]; - const text = ( - this.handleClick(point)} - style={{ cursor: this.props.onBarClick ? 'pointer' : 'default' }} - x={x} - y={y} - > - {tick} - - ); - return ( - // eslint-disable-next-line react/no-array-index-key - - {text} - - ); - }); - return {ticks}; - }; - - renderXValues = (xScale: ScaleBand, yScale: ScaleLinear) => { - const { data, xValues = [] } = this.props; - - if (!xValues.length) { - return null; - } - - const ticks = xValues.map((value, index) => { - const point = data[index]; - const x = Math.round((xScale(point.x) as number) + xScale.bandwidth() / 2); - const y = yScale(point.y); - const text = ( - this.handleClick(point)} - style={{ cursor: this.props.onBarClick ? 'pointer' : 'default' }} - x={x} - y={y} - > - {value} - - ); - return ( - // eslint-disable-next-line react/no-array-index-key - - {text} - - ); - }); - return {ticks}; - }; - - renderBars = (xScale: ScaleBand, yScale: ScaleLinear) => { - const bars = this.props.data.map((point, index) => { - const x = Math.round(xScale(point.x) as number); - const maxY = yScale.range()[0]; - const y = Math.round(yScale(point.y)) - /* minimum bar height */ 1; - const height = maxY - y; - const rect = ( - this.handleClick(point)} - style={{ cursor: this.props.onBarClick ? 'pointer' : 'default' }} - width={this.props.barsWidth} - x={x} - y={y} - /> - ); - return ( - // eslint-disable-next-line react/no-array-index-key - - {rect} - - ); - }); - return {bars}; - }; - - render() { - const { barsWidth, data, width, height, padding = [10, 10, 10, 10] } = this.props; - - const availableWidth = width - padding[1] - padding[3]; - const availableHeight = height - padding[0] - padding[2]; - - const innerPadding = (availableWidth - barsWidth * data.length) / (data.length - 1); - const relativeInnerPadding = innerPadding / (innerPadding + barsWidth); - - const maxY = max(data, (d) => d.y) as number; - const xScale = scaleBand() - .domain(data.map((d) => d.x)) - .range([0, availableWidth]) - .paddingInner(relativeInnerPadding); - const yScale = scaleLinear().domain([0, maxY]).range([availableHeight, 0]); - - return ( - - - {this.renderXTicks(xScale, yScale)} - {this.renderXValues(xScale, yScale)} - {this.renderBars(xScale, yScale)} - - - ); - } -} diff --git a/server/sonar-web/src/main/js/components/charts/LineChart.tsx b/server/sonar-web/src/main/js/components/charts/LineChart.tsx deleted file mode 100644 index ea43ab7256b..00000000000 --- a/server/sonar-web/src/main/js/components/charts/LineChart.tsx +++ /dev/null @@ -1,211 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import { extent, max } from 'd3-array'; -import { ScaleLinear, scaleLinear } from 'd3-scale'; -import { curveBasis, area as d3Area, line as d3Line } from 'd3-shape'; -import * as React from 'react'; -import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer'; -import './LineChart.css'; - -interface DataPoint { - x: number; - y?: number; -} - -interface Props { - backdropConstraints?: [number, number]; - data: DataPoint[]; - displayBackdrop?: boolean; - displayPoints?: boolean; - displayVerticalGrid?: boolean; - domain?: [number, number]; - height: number; - padding?: [number, number, number, number]; - width?: number; - xTicks?: {}[]; - xValues?: {}[]; -} - -export default class LineChart extends React.PureComponent { - renderBackdrop(xScale: ScaleLinear, yScale: ScaleLinear) { - const { displayBackdrop = true } = this.props; - - if (!displayBackdrop) { - return null; - } - - const area = d3Area() - .x((d) => xScale(d.x)) - .y0(yScale.range()[0]) - .y1((d) => yScale(d.y || 0)) - .defined((d) => d.y != null) - .curve(curveBasis); - - let { data } = this.props; - - if (this.props.backdropConstraints) { - const c = this.props.backdropConstraints; - data = data.filter((d) => c[0] <= d.x && d.x <= c[1]); - } - - return ; - } - - renderPoints(xScale: ScaleLinear, yScale: ScaleLinear) { - const { displayPoints = true } = this.props; - - if (!displayPoints) { - return null; - } - - const points = this.props.data - .filter((point) => point.y != null) - .map((point, index) => { - const x = xScale(point.x); - const y = yScale(point.y || 0); - - // eslint-disable-next-line react/no-array-index-key - return ; - }); - - return {points}; - } - - renderVerticalGrid(xScale: ScaleLinear, yScale: ScaleLinear) { - const { displayVerticalGrid = true } = this.props; - - if (!displayVerticalGrid) { - return null; - } - - const lines = this.props.data.map((point, index) => { - const x = xScale(point.x); - const y1 = yScale.range()[0]; - const y2 = yScale(point.y || 0); - - // eslint-disable-next-line react/no-array-index-key - return ; - }); - - return {lines}; - } - - renderXTicks(xScale: ScaleLinear, yScale: ScaleLinear) { - const { xTicks = [] } = this.props; - - if (!xTicks.length) { - return null; - } - - const ticks = xTicks.map((tick, index) => { - const point = this.props.data[index]; - const x = xScale(point.x); - const y = yScale.range()[0]; - - return ( - // eslint-disable-next-line react/no-array-index-key - - {tick} - - ); - }); - - return {ticks}; - } - - renderXValues(xScale: ScaleLinear, yScale: ScaleLinear) { - const { xValues = [] } = this.props; - - if (!xValues.length) { - return null; - } - - const ticks = xValues.map((value, index) => { - const point = this.props.data[index]; - const x = xScale(point.x); - const y = yScale(point.y || 0); - - return ( - // eslint-disable-next-line react/no-array-index-key - - {value} - - ); - }); - - return {ticks}; - } - - renderLine(xScale: ScaleLinear, yScale: ScaleLinear) { - const p = d3Line() - .x((d) => xScale(d.x)) - .y((d) => yScale(d.y || 0)) - .defined((d) => d.y != null) - .curve(curveBasis); - - return ; - } - - renderChart = (width: number) => { - const { height, padding = [10, 10, 10, 10] } = this.props; - - if (!width || !height) { - return
; - } - - const availableWidth = width - padding[1] - padding[3]; - const availableHeight = height - padding[0] - padding[2]; - - const xScale = scaleLinear() - .domain(extent(this.props.data, (d) => d.x) as [number, number]) - .range([0, availableWidth]); - - const yScale = scaleLinear().range([availableHeight, 0]); - - if (this.props.domain) { - yScale.domain(this.props.domain); - } else { - const maxY = max(this.props.data, (d) => d.y) as number; - yScale.domain([0, maxY]); - } - - return ( - - - {this.renderVerticalGrid(xScale, yScale)} - {this.renderBackdrop(xScale, yScale)} - {this.renderLine(xScale, yScale)} - {this.renderPoints(xScale, yScale)} - {this.renderXTicks(xScale, yScale)} - {this.renderXValues(xScale, yScale)} - - - ); - }; - - render() { - return this.props.width !== undefined ? ( - this.renderChart(this.props.width) - ) : ( - {(size) => this.renderChart(size.width)} - ); - } -} diff --git a/server/sonar-web/src/main/js/components/ui/PlaceholderBar.tsx b/server/sonar-web/src/main/js/components/common/DocumentationLink.tsx similarity index 69% rename from server/sonar-web/src/main/js/components/ui/PlaceholderBar.tsx rename to server/sonar-web/src/main/js/components/common/DocumentationLink.tsx index 6d68735a0d5..ae066847439 100644 --- a/server/sonar-web/src/main/js/components/ui/PlaceholderBar.tsx +++ b/server/sonar-web/src/main/js/components/common/DocumentationLink.tsx @@ -17,15 +17,13 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { Link, LinkProps } from 'design-system'; import * as React from 'react'; -import './PlaceholderBar.css'; +import { useDocUrl } from '../../helpers/docs'; -interface Props { - color?: string; - width: number; - height?: number; -} +type Props = Omit & { to: string; innerRef?: React.Ref }; -export default function PlaceholderBar({ color, width, height }: Props) { - return ; +export default function DocumentationLink({ to, innerRef, ...props }: Props) { + const toStatic = useDocUrl(to); + return ; } diff --git a/server/sonar-web/src/main/js/components/common/LocationIndex.css b/server/sonar-web/src/main/js/components/common/LocationIndex.css deleted file mode 100644 index c587a86ecd7..00000000000 --- a/server/sonar-web/src/main/js/components/common/LocationIndex.css +++ /dev/null @@ -1,71 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.location-index { - position: relative; - display: inline-block; - vertical-align: top; - line-height: 16px; - padding-left: 6px; - padding-right: 6px; - border-radius: 2px; - background-color: var(--conciseIssueRed); - color: #fff; - font-family: var(--baseFontFamily); - font-size: var(--smallFontSize); - transition: background-color 0.3s ease; - user-select: none; -} - -.selected > .location-index, -.location-index.selected { - background-color: var(--conciseIssueRedSelected); -} - -.location-index.muted { - background-color: var(--gray80); -} - -.location-index.is-leading:first-child { - margin-left: 0; -} - -.location-index[tabindex] { - cursor: pointer; -} - -.location-index[tabindex]:hover, -a:hover > .location-index { - background-color: var(--conciseIssueRedSelected); -} - -.location-index[tabindex]:focus { - outline: none; -} - -.source-line-code-inner .location-index { - line-height: 16px; - margin: 1px; - margin-left: 4px; - margin-right: 4px; -} - -.source-line-code-inner .location-index + .location-index { - margin-left: 0; -} diff --git a/server/sonar-web/src/main/js/components/common/LocationIndex.tsx b/server/sonar-web/src/main/js/components/common/LocationIndex.tsx deleted file mode 100644 index 8a45c64927a..00000000000 --- a/server/sonar-web/src/main/js/components/common/LocationIndex.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import './LocationIndex.css'; - -interface Props { - children?: React.ReactNode; - leading?: boolean; - onClick?: () => void; - selected?: boolean; - [x: string]: any; -} - -export default function LocationIndex(props: Props) { - const { children, leading, onClick, selected, ...other } = props; - const clickAttributes = onClick ? { onClick, role: 'button', tabIndex: 0 } : {}; - // put {...others} because Tooltip sets some event handlers - return ( -
- {children} -
- ); -} diff --git a/server/sonar-web/src/main/js/components/common/MeasuresLink.css b/server/sonar-web/src/main/js/components/common/MeasuresLink.css deleted file mode 100644 index bb55c689024..00000000000 --- a/server/sonar-web/src/main/js/components/common/MeasuresLink.css +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.measures-link { - border: none; -} - -.measures-link > span { - border-bottom: 1px solid var(--lightBlue); -} diff --git a/server/sonar-web/src/main/js/components/common/MeasuresLink.tsx b/server/sonar-web/src/main/js/components/common/MeasuresLink.tsx deleted file mode 100644 index 0879a7bc30d..00000000000 --- a/server/sonar-web/src/main/js/components/common/MeasuresLink.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import MeasuresIcon from '../../components/icons/MeasuresIcon'; -import { translate } from '../../helpers/l10n'; -import { getComponentDrilldownUrl } from '../../helpers/urls'; -import { BranchLike } from '../../types/branch-like'; -import Link from './Link'; -import './MeasuresLink.css'; - -export interface MeasuresLinkProps { - branchLike?: BranchLike; - className?: string; - component: string; - label?: string; - metric: string; -} - -export default function MeasuresLink(props: MeasuresLinkProps) { - const { branchLike, className, component, label, metric } = props; - return ( - - - {label || translate('portfolio.measures_link')} - - ); -} diff --git a/server/sonar-web/src/main/js/components/controls/BackButton.tsx b/server/sonar-web/src/main/js/components/controls/BackButton.tsx deleted file mode 100644 index f12e2b88895..00000000000 --- a/server/sonar-web/src/main/js/components/controls/BackButton.tsx +++ /dev/null @@ -1,72 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import { colors } from '../../app/theme'; -import { translate } from '../../helpers/l10n'; -import Tooltip from './Tooltip'; - -interface Props { - className?: string; - disabled?: boolean; - onClick: () => void; - tooltip?: string; -} - -export default class BackButton extends React.PureComponent { - handleClick = (event: React.SyntheticEvent) => { - event.preventDefault(); - event.currentTarget.blur(); - if (!this.props.disabled) { - this.props.onClick(); - } - }; - - renderIcon = () => { - const { tooltip = translate('issues.return_to_list') } = this.props; - return ( - - - - ); - }; - - render() { - const { tooltip = translate('issues.return_to_list') } = this.props; - return ( - - - {this.renderIcon()} - - - ); - } -} diff --git a/server/sonar-web/src/main/js/components/controls/ReloadButton.tsx b/server/sonar-web/src/main/js/components/controls/ReloadButton.tsx deleted file mode 100644 index 06f525bfc2d..00000000000 --- a/server/sonar-web/src/main/js/components/controls/ReloadButton.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import { colors } from '../../app/theme'; -import { translate } from '../../helpers/l10n'; -import Tooltip from './Tooltip'; - -interface Props { - className?: string; - tooltip?: string; - onClick: () => void; -} - -export default class ReloadButton extends React.PureComponent { - handleClick = (event: React.SyntheticEvent) => { - event.preventDefault(); - event.currentTarget.blur(); - this.props.onClick(); - }; - - render() { - const { tooltip = translate('reload') } = this.props; - return ( - - - { - - - - } - - - ); - } -} diff --git a/server/sonar-web/src/main/js/components/icons/ArrowIcon.tsx b/server/sonar-web/src/main/js/components/icons/ArrowIcon.tsx deleted file mode 100644 index a6bf1765b26..00000000000 --- a/server/sonar-web/src/main/js/components/icons/ArrowIcon.tsx +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -interface Props extends IconProps { - animated?: boolean; - inverseDirection?: boolean; -} - -export default function ArrowIcon({ - animated = false, - fill = 'currentColor', - inverseDirection = false, - ...iconProps -}: Props) { - const style: React.CSSProperties = {}; - if (inverseDirection) { - style.transform = 'scaleX(-1)'; - } - - if (animated) { - style.transition = 'transform 0.2s'; - } - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/BubblesIcon.tsx b/server/sonar-web/src/main/js/components/icons/BubblesIcon.tsx deleted file mode 100644 index bcfbd56a0c5..00000000000 --- a/server/sonar-web/src/main/js/components/icons/BubblesIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function BubblesIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/ChevronLeftIcon.tsx b/server/sonar-web/src/main/js/components/icons/ChevronLeftIcon.tsx deleted file mode 100644 index a3c91d52e1d..00000000000 --- a/server/sonar-web/src/main/js/components/icons/ChevronLeftIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function ChevronLeftIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/ChevronUpIcon.tsx b/server/sonar-web/src/main/js/components/icons/ChevronUpIcon.tsx deleted file mode 100644 index c05860ddcdd..00000000000 --- a/server/sonar-web/src/main/js/components/icons/ChevronUpIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function ChevronUpIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/ChevronsIcon.tsx b/server/sonar-web/src/main/js/components/icons/ChevronsIcon.tsx deleted file mode 100644 index ef1cf56d222..00000000000 --- a/server/sonar-web/src/main/js/components/icons/ChevronsIcon.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function ChevronsIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/ClockIcon.tsx b/server/sonar-web/src/main/js/components/icons/ClockIcon.tsx deleted file mode 100644 index 2ccf1de2d7f..00000000000 --- a/server/sonar-web/src/main/js/components/icons/ClockIcon.tsx +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import { colors } from '../../app/theme'; -import Icon, { IconProps } from './Icon'; - -export default function ClockIcon({ className, ...iconProps }: IconProps) { - return ( - - - - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/CogIcon.tsx b/server/sonar-web/src/main/js/components/icons/CogIcon.tsx deleted file mode 100644 index e39dd0baca2..00000000000 --- a/server/sonar-web/src/main/js/components/icons/CogIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function CogIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/ExpandSnippetIcon.tsx b/server/sonar-web/src/main/js/components/icons/ExpandSnippetIcon.tsx deleted file mode 100644 index 0cb2417e610..00000000000 --- a/server/sonar-web/src/main/js/components/icons/ExpandSnippetIcon.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function ExpandSnippetIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - - - - - - - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/FilterIcon.tsx b/server/sonar-web/src/main/js/components/icons/FilterIcon.tsx deleted file mode 100644 index c9c0f5b8ad7..00000000000 --- a/server/sonar-web/src/main/js/components/icons/FilterIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function FilterIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/HomeIcon.tsx b/server/sonar-web/src/main/js/components/icons/HomeIcon.tsx deleted file mode 100644 index baea536ecc7..00000000000 --- a/server/sonar-web/src/main/js/components/icons/HomeIcon.tsx +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import { colors } from '../../app/theme'; -import Icon, { IconProps } from './Icon'; - -interface Props extends IconProps { - filled?: boolean; -} - -export default function HomeIcon({ className, fill, filled = false, ...iconProps }: Props) { - return ( - - - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/LightBulbIcon.tsx b/server/sonar-web/src/main/js/components/icons/LightBulbIcon.tsx deleted file mode 100644 index 706c1ec8d6b..00000000000 --- a/server/sonar-web/src/main/js/components/icons/LightBulbIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function LightBulbIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/ListIcon.tsx b/server/sonar-web/src/main/js/components/icons/ListIcon.tsx deleted file mode 100644 index b5960fa1cb6..00000000000 --- a/server/sonar-web/src/main/js/components/icons/ListIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function ListIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/LongLivingBranchIcon.tsx b/server/sonar-web/src/main/js/components/icons/LongLivingBranchIcon.tsx deleted file mode 100644 index b134eca5455..00000000000 --- a/server/sonar-web/src/main/js/components/icons/LongLivingBranchIcon.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { colors } from '../../app/theme'; -import Icon, { IconProps } from './Icon'; - -export default function LongLivingBranchIcon({ fill, ...iconProps }: IconProps) { - return ( - - - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/NotificationIcon.tsx b/server/sonar-web/src/main/js/components/icons/NotificationIcon.tsx deleted file mode 100644 index 515a495a1a6..00000000000 --- a/server/sonar-web/src/main/js/components/icons/NotificationIcon.tsx +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { colors } from '../../app/theme'; -import Icon, { IconProps } from './Icon'; - -interface Props extends IconProps { - hasUnread?: boolean; -} - -export default function NotificationIcon({ - fill = 'currentColor', - hasUnread, - ...iconProps -}: Props) { - return ( - - {hasUnread ? ( - <> - - - - ) : ( - - )} - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/PinIcon.tsx b/server/sonar-web/src/main/js/components/icons/PinIcon.tsx deleted file mode 100644 index ff642f52ec3..00000000000 --- a/server/sonar-web/src/main/js/components/icons/PinIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function PinIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/PlusIcon.tsx b/server/sonar-web/src/main/js/components/icons/PlusIcon.tsx deleted file mode 100644 index fb371996e77..00000000000 --- a/server/sonar-web/src/main/js/components/icons/PlusIcon.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function PlusIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/RocketIcon.tsx b/server/sonar-web/src/main/js/components/icons/RocketIcon.tsx deleted file mode 100644 index 977ceaf3e85..00000000000 --- a/server/sonar-web/src/main/js/components/icons/RocketIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function RocketIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/RuleScopeIcon.tsx b/server/sonar-web/src/main/js/components/icons/RuleScopeIcon.tsx deleted file mode 100644 index 7199e10c427..00000000000 --- a/server/sonar-web/src/main/js/components/icons/RuleScopeIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function RuleScopeIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/ShortLivingBranchIcon.tsx b/server/sonar-web/src/main/js/components/icons/ShortLivingBranchIcon.tsx deleted file mode 100644 index 4d3a2c344fa..00000000000 --- a/server/sonar-web/src/main/js/components/icons/ShortLivingBranchIcon.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { colors } from '../../app/theme'; -import Icon, { IconProps } from './Icon'; - -export default function ShortLivingBranchIcon({ fill, ...iconProps }: IconProps) { - return ( - - - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/SortAscIcon.tsx b/server/sonar-web/src/main/js/components/icons/SortAscIcon.tsx deleted file mode 100644 index cfd08d04f33..00000000000 --- a/server/sonar-web/src/main/js/components/icons/SortAscIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function SortAscIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/SortDescIcon.tsx b/server/sonar-web/src/main/js/components/icons/SortDescIcon.tsx deleted file mode 100644 index 996798eca35..00000000000 --- a/server/sonar-web/src/main/js/components/icons/SortDescIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function SortDescIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/TestStatusIcon.tsx b/server/sonar-web/src/main/js/components/icons/TestStatusIcon.tsx deleted file mode 100644 index 47a3f154610..00000000000 --- a/server/sonar-web/src/main/js/components/icons/TestStatusIcon.tsx +++ /dev/null @@ -1,83 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { colors } from '../../app/theme'; -import { Dict } from '../../types/types'; -import Icon, { IconProps } from './Icon'; - -interface Props extends IconProps { - status: string; -} - -const statusIcons: Dict<(props: IconProps) => React.ReactElement> = { - ok: OkTestStatusIcon, - failure: FailureTestStatusIcon, - error: ErrorTestStatusIcon, - skipped: SkippedTestStatusIcon, -}; - -export default function TestStatusIcon({ status, ...iconProps }: Props) { - const DesiredStatusIcon = statusIcons[status.toLowerCase()]; - return DesiredStatusIcon ? : null; -} - -function OkTestStatusIcon(iconProps: IconProps) { - return ( - - - - ); -} - -function FailureTestStatusIcon(iconProps: IconProps) { - return ( - - - - ); -} - -function ErrorTestStatusIcon(iconProps: IconProps) { - return ( - - - - ); -} - -function SkippedTestStatusIcon(iconProps: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/TreeIcon.tsx b/server/sonar-web/src/main/js/components/icons/TreeIcon.tsx deleted file mode 100644 index 29c91424937..00000000000 --- a/server/sonar-web/src/main/js/components/icons/TreeIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function TreeIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/TreemapIcon.tsx b/server/sonar-web/src/main/js/components/icons/TreemapIcon.tsx deleted file mode 100644 index bedb05ccfee..00000000000 --- a/server/sonar-web/src/main/js/components/icons/TreemapIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function TreemapIcon({ fill = 'currentColor', size = 14, ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/icons/VisibleIcon.tsx b/server/sonar-web/src/main/js/components/icons/VisibleIcon.tsx deleted file mode 100644 index f93784158ee..00000000000 --- a/server/sonar-web/src/main/js/components/icons/VisibleIcon.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Icon, { IconProps } from './Icon'; - -export default function VisibleIcon({ fill = 'currentColor', ...iconProps }: IconProps) { - return ( - - - - ); -} diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.tsx deleted file mode 100644 index 1b129c2c250..00000000000 --- a/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.tsx +++ /dev/null @@ -1,75 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { injectIntl, WrappedComponentProps } from 'react-intl'; -import { ButtonLink } from '../../../components/controls/buttons'; -import Toggler from '../../../components/controls/Toggler'; -import DropdownIcon from '../../../components/icons/DropdownIcon'; -import { translateWithParameters } from '../../../helpers/l10n'; -import { Issue } from '../../../types/types'; -import { formatterOption } from '../../intl/DateFormatter'; -import DateFromNow from '../../intl/DateFromNow'; -import ChangelogPopup from '../popups/ChangelogPopup'; - -export interface IssueChangelogProps extends WrappedComponentProps { - isOpen: boolean; - issue: Pick; - creationDate: string; - togglePopup: (popup: string, show?: boolean) => void; -} - -function IssueChangelog(props: IssueChangelogProps) { - const { - isOpen, - issue, - creationDate, - intl: { formatDate }, - } = props; - return ( -
- { - props.togglePopup('changelog', false); - }} - open={isOpen} - overlay={} - > - { - props.togglePopup('changelog'); - }} - > - - - - - - -
- ); -} - -export default injectIntl(IssueChangelog); diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.tsx deleted file mode 100644 index fe45b5aa9b8..00000000000 --- a/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.tsx +++ /dev/null @@ -1,151 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import Toggler from '../../../components/controls/Toggler'; -import { DeleteButton, EditButton } from '../../../components/controls/buttons'; -import { PopupPlacement } from '../../../components/ui/popups'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { sanitizeUserInput } from '../../../helpers/sanitize'; -import { IssueComment } from '../../../types/types'; -import DateFromNow from '../../intl/DateFromNow'; -import LegacyAvatar from '../../ui/LegacyAvatar'; -import CommentDeletePopup from '../popups/CommentDeletePopup'; -import CommentPopup from '../popups/CommentPopup'; - -interface Props { - comment: IssueComment; - onDelete: (comment: string) => void; - onEdit: (comment: string, text: string) => void; -} - -interface State { - openPopup: string; -} - -export default class IssueCommentLine extends React.PureComponent { - state: State = { - openPopup: '', - }; - - handleEdit = (text: string) => { - this.props.onEdit(this.props.comment.key, text); - this.toggleEditPopup(false); - }; - - handleDelete = () => { - this.props.onDelete(this.props.comment.key); - this.toggleDeletePopup(false); - }; - - togglePopup = (popupName: string, force?: boolean) => { - this.setState((prevState) => { - if (prevState.openPopup !== popupName && force !== false) { - return { openPopup: popupName }; - } else if (prevState.openPopup === popupName && force !== true) { - return { openPopup: '' }; - } - return prevState; - }); - }; - - toggleDeletePopup = (force?: boolean) => { - this.togglePopup('delete', force); - }; - - toggleEditPopup = (force?: boolean) => { - this.togglePopup('edit', force); - }; - - closePopups = () => { - this.setState({ openPopup: '' }); - }; - - render() { - const { comment } = this.props; - const author = comment.authorName || comment.author; - const displayName = - comment.authorActive === false && author - ? translateWithParameters('user.x_deleted', author) - : author; - return ( -
  • -
    - - {displayName} -
    -
    -
    - {translate('issue.comment.posted_on')} - -
    -
    - {comment.updatable && ( -
    - - } - > - - -
    - )} - {comment.updatable && ( -
    - } - > - - -
    - )} -
    -
  • - ); - } -} diff --git a/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.tsx deleted file mode 100644 index 37e937cf285..00000000000 --- a/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.tsx +++ /dev/null @@ -1,121 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { getIssueChangelog } from '../../../api/issues'; -import { DropdownOverlay } from '../../../components/controls/Dropdown'; -import { PopupPlacement } from '../../../components/ui/popups'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { Issue, IssueChangelog } from '../../../types/types'; -import DateTimeFormatter from '../../intl/DateTimeFormatter'; -import LegacyAvatar from '../../ui/LegacyAvatar'; -import IssueChangelogDiff from '../components/IssueChangelogDiff'; - -interface Props { - issue: Pick; -} - -interface State { - changelog: IssueChangelog[]; -} - -export default class ChangelogPopup extends React.PureComponent { - mounted = false; - state: State = { changelog: [] }; - - componentDidMount() { - this.mounted = true; - this.loadChangelog(); - } - - componentWillUnmount() { - this.mounted = false; - } - - loadChangelog() { - getIssueChangelog(this.props.issue.key).then( - ({ changelog }) => { - if (this.mounted) { - this.setState({ changelog }); - } - }, - () => {}, - ); - } - - render() { - const { issue } = this.props; - const { author } = issue; - return ( - -
    - - - - - - - - {this.state.changelog.map((item, idx) => { - const userName = item.userName || item.user || item.externalUser; - - return ( - - - - - ); - })} - -
    - - - {author ? `${translate('created_by')} ${author}` : translate('created')} -
    - - -
    - {userName && ( - <> - - {item.isUserActive || item.externalUser - ? userName - : translateWithParameters('user.x_deleted', userName)} - - )} - {item.webhookSource && - translateWithParameters( - 'issue.changelog.webhook_source', - item.webhookSource, - )} -
    - {item.diffs.map((diff) => ( - - ))} -
    -
    -
    - ); - } -} diff --git a/server/sonar-web/src/main/js/components/issue/popups/CommentDeletePopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/CommentDeletePopup.tsx deleted file mode 100644 index d4683ba7567..00000000000 --- a/server/sonar-web/src/main/js/components/issue/popups/CommentDeletePopup.tsx +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { Button } from '../../../components/controls/buttons'; -import { DropdownOverlay } from '../../../components/controls/Dropdown'; -import { PopupPlacement } from '../../../components/ui/popups'; -import { translate } from '../../../helpers/l10n'; - -interface Props { - onDelete: () => void; -} - -export default function CommentDeletePopup({ onDelete }: Props) { - return ( - -
    -
    {translate('issue.comment.delete_confirm_message')}
    - -
    -
    - ); -} diff --git a/server/sonar-web/src/main/js/components/issue/popups/CommentTile.tsx b/server/sonar-web/src/main/js/components/issue/popups/CommentTile.tsx deleted file mode 100644 index e6823b0f6a4..00000000000 --- a/server/sonar-web/src/main/js/components/issue/popups/CommentTile.tsx +++ /dev/null @@ -1,120 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { sanitizeUserInput } from '../../../helpers/sanitize'; -import { IssueComment } from '../../../types/types'; -import { DeleteButton, EditButton } from '../../controls/buttons'; -import DateTimeFormatter from '../../intl/DateTimeFormatter'; -import LegacyAvatar from '../../ui/LegacyAvatar'; -import CommentForm from './CommentForm'; - -interface CommentTileProps { - comment: IssueComment; - handleDelete: (commentKey: string) => void; - onEdit: (comment: string, text: string) => void; -} - -interface CommentTileState { - showEditArea: boolean; -} - -export default class CommentTile extends React.PureComponent { - state = { - showEditArea: false, - }; - - handleEditClick = () => { - const { showEditArea } = this.state; - this.setState({ showEditArea: !showEditArea }); - }; - - handleSaveClick = (editedComment: string) => { - const { comment } = this.props; - this.props.onEdit(comment.key, editedComment); - this.setState({ showEditArea: false }); - }; - - handleCancelClick = () => { - this.setState({ showEditArea: false }); - }; - - render() { - const { comment } = this.props; - const { showEditArea } = this.state; - const author = comment.authorName ?? comment.author; - const displayName = - comment.authorActive === false && author - ? translateWithParameters('user.x_deleted', author) - : author; - return ( -
    -
    -
    - - {displayName} -
    - - - -
    -
    - {!showEditArea && ( -
    - )} - {showEditArea && ( -
    - -
    - )} - {comment.updatable && ( -
    - - { - this.props.handleDelete(comment.key); - }} - /> -
    - )} -
    -
    - ); - } -} diff --git a/server/sonar-web/src/main/js/components/locations/CrossFileLocationNavigator.css b/server/sonar-web/src/main/js/components/locations/CrossFileLocationNavigator.css deleted file mode 100644 index a02d8b8d1cd..00000000000 --- a/server/sonar-web/src/main/js/components/locations/CrossFileLocationNavigator.css +++ /dev/null @@ -1,98 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.locations-navigator-file { - position: relative; -} - -.locations-navigator-file + .locations-navigator-file { - margin-top: calc(1.5 * var(--gridSize)); -} - -.locations-navigator-file:not(:last-child)::before { - position: absolute; - display: block; - width: 0; - top: 13px; - bottom: calc(-2 * var(--gridSize)); - left: 4px; - border-left: 1px dotted var(--conciseIssueRed); - content: ''; -} - -.location-file-locations { - padding-left: calc(2 * var(--gridSize)); -} - -.location-file { - height: calc(2 * var(--gridSize)); - padding-bottom: calc(0.5 * var(--gridSize)); - font-size: var(--smallFontSize); - font-weight: bold; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.location-file-circle, -.location-file-circle-multiple, -.location-file-circle-multiple::before, -.location-file-circle-multiple::after { - position: relative; - top: 1px; - display: inline-block; - width: calc(1px + var(--gridSize)); - height: calc(1px + var(--gridSize)); - border: 1px solid var(--conciseIssueRed); - border-radius: 100%; - box-sizing: border-box; - background-color: var(--issueBgColor); -} - -.location-file-circle-multiple { - top: -2px; -} - -.location-file-circle-multiple::before { - position: absolute; - z-index: calc(5 + var(--normalZIndex)); - top: 2px; - left: -1px; - content: ''; -} - -.location-file-circle-multiple::after { - position: absolute; - z-index: calc(5 + var(--aboveNormalZIndex)); - top: 5px; - left: -1px; - content: ''; -} - -.location-file-more { - border-color: rgba(209, 133, 130, 0.2); - color: rgb(209, 133, 130) !important; - font-style: italic; - font-weight: normal; -} - -.location-file-more:hover, -.location-file-more:focus { - border-color: rgba(209, 133, 130, 0.6); -} diff --git a/server/sonar-web/src/main/js/components/locations/CrossFileLocationNavigator.tsx b/server/sonar-web/src/main/js/components/locations/CrossFileLocationNavigator.tsx deleted file mode 100644 index 1a751736e5e..00000000000 --- a/server/sonar-web/src/main/js/components/locations/CrossFileLocationNavigator.tsx +++ /dev/null @@ -1,207 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { translateWithParameters } from '../../helpers/l10n'; -import { collapsePath } from '../../helpers/path'; -import { MessageFormatting } from '../../types/issues'; -import { FlowLocation } from '../../types/types'; -import './CrossFileLocationNavigator.css'; -import SingleFileLocationNavigator from './SingleFileLocationNavigator'; - -interface Props { - locations: FlowLocation[]; - onLocationSelect: (index: number) => void; - selectedLocationIndex: number | undefined; -} - -interface State { - collapsed: boolean; -} - -interface LocationGroup { - component: string | undefined; - componentName: string | undefined; - firstLocationIndex: number; - locations: FlowLocation[]; -} - -const MAX_PATH_LENGTH = 15; - -export default class CrossFileLocationNavigator extends React.PureComponent { - state: State = { collapsed: true }; - - componentDidUpdate() { - const { locations, selectedLocationIndex } = this.props; - if ( - selectedLocationIndex && - selectedLocationIndex > 0 && - locations !== undefined && - selectedLocationIndex < locations.length - 1 && - this.state.collapsed - ) { - this.setState({ collapsed: false }); - } - } - - handleMoreLocationsClick = (event: React.MouseEvent) => { - event.preventDefault(); - event.currentTarget.blur(); - this.setState({ collapsed: false }); - }; - - groupByFile = (locations: FlowLocation[]) => { - const groups: LocationGroup[] = []; - - let currentLocations: FlowLocation[] = []; - let currentComponent: string | undefined; - let currentComponentName: string | undefined; - let currentFirstLocationIndex = 0; - - for (let index = 0; index < locations.length; index++) { - const location = locations[index]; - if (location.component === currentComponent) { - currentLocations.push(location); - } else { - if (currentLocations.length > 0) { - groups.push({ - component: currentComponent, - componentName: currentComponentName, - firstLocationIndex: currentFirstLocationIndex, - locations: currentLocations, - }); - } - currentLocations = [location]; - currentComponent = location.component; - currentComponentName = location.componentName; - currentFirstLocationIndex = index; - } - } - - if (currentLocations.length > 0) { - groups.push({ - component: currentComponent, - componentName: currentComponentName, - firstLocationIndex: currentFirstLocationIndex, - locations: currentLocations, - }); - } - - return groups; - }; - - renderLocation = ( - index: number, - message: string | undefined, - messageFormattings: MessageFormatting[] | undefined, - ) => { - return ( - - ); - }; - - renderGroup = ( - group: LocationGroup, - groupIndex: number, - { onlyFirst = false, onlyLast = false } = {}, - ) => { - const { firstLocationIndex } = group; - const lastLocationIndex = group.locations.length - 1; - return ( -
    -
    - - {collapsePath(group.componentName || '', MAX_PATH_LENGTH)} -
    - {group.locations.length > 0 && ( -
    - {onlyFirst && - this.renderLocation( - firstLocationIndex, - group.locations[0].msg, - group.locations[0].msgFormattings, - )} - - {onlyLast && - this.renderLocation( - firstLocationIndex + lastLocationIndex, - group.locations[lastLocationIndex].msg, - group.locations[lastLocationIndex].msgFormattings, - )} - - {!onlyFirst && - !onlyLast && - group.locations.map((location, index) => - this.renderLocation( - firstLocationIndex + index, - location.msg, - location.msgFormattings, - ), - )} -
    - )} -
    - ); - }; - - render() { - const { locations } = this.props; - const groups = this.groupByFile(locations); - // below: fold the location list when there are >3 locations - const MIN_LOCATION_LENGTH = 3; - - if (locations.length > MIN_LOCATION_LENGTH && groups.length > 1 && this.state.collapsed) { - // the top and bottom locations are always displayed - const nbLocationsAlwaysDisplayed = 2; - - const firstGroup = groups[0]; - const lastGroup = groups[groups.length - 1]; - - return ( -
    - {this.renderGroup(firstGroup, 0, { onlyFirst: true })} - - {this.renderGroup(lastGroup, groups.length - 1, { onlyLast: true })} -
    - ); - } - return ( -
    - {groups.map((group, groupIndex) => this.renderGroup(group, groupIndex))} -
    - ); - } -} diff --git a/server/sonar-web/src/main/js/components/locations/LocationsList.tsx b/server/sonar-web/src/main/js/components/locations/LocationsList.tsx deleted file mode 100644 index 919d5b04c31..00000000000 --- a/server/sonar-web/src/main/js/components/locations/LocationsList.tsx +++ /dev/null @@ -1,71 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { uniq } from 'lodash'; -import * as React from 'react'; -import { FlowLocation } from '../../types/types'; -import CrossFileLocationNavigator from './CrossFileLocationNavigator'; -import SingleFileLocationNavigator from './SingleFileLocationNavigator'; - -interface Props { - componentKey: string; - locations: FlowLocation[]; - onLocationSelect: (index: number) => void; - selectedLocationIndex?: number; - showCrossFile?: boolean; -} - -export default class LocationsList extends React.PureComponent { - render() { - const { locations, componentKey, selectedLocationIndex, showCrossFile = true } = this.props; - - const locationComponents = [componentKey, ...locations.map((location) => location.component)]; - const isCrossFile = uniq(locationComponents).length > 1; - - if (!locations || locations.length === 0) { - return null; - } - - if (isCrossFile && showCrossFile) { - return ( - - ); - } - return ( -
      - {locations.map((location, index) => ( - // eslint-disable-next-line react/no-array-index-key -
    • - -
    • - ))} -
    - ); - } -} diff --git a/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx b/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx deleted file mode 100644 index bfc87a3601e..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/components/AllSetStep.tsx +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { translate } from '../../../helpers/l10n'; -import { AlmKeys } from '../../../types/alm-settings'; -import AllSet from './AllSet'; -import Step from './Step'; - -export interface AllSetStepProps { - alm: AlmKeys; - open: boolean; - stepNumber: number; - willRefreshAutomatically?: boolean; -} - -export default function AllSetStep(props: AllSetStepProps) { - const { alm, open, stepNumber, willRefreshAutomatically } = props; - return ( - ( -
    - -
    - )} - stepNumber={stepNumber} - stepTitle={translate('onboarding.tutorial.ci_outro.all_set.title')} - /> - ); -} diff --git a/server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx b/server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx deleted file mode 100644 index f2514537450..00000000000 --- a/server/sonar-web/src/main/js/components/tutorials/components/FinishButton.tsx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { rawSizes } from '../../../app/theme'; -import { Button } from '../../../components/controls/buttons'; -import ChevronRightIcon from '../../../components/icons/ChevronRightIcon'; -import { translate } from '../../../helpers/l10n'; - -export interface FinishButtonProps { - onClick: () => void; -} - -export default function FinishButton(props: FinishButtonProps) { - return ( - - ); -} diff --git a/server/sonar-web/src/main/js/components/ui/AutoEllipsis.tsx b/server/sonar-web/src/main/js/components/ui/AutoEllipsis.tsx deleted file mode 100644 index 5125c510908..00000000000 --- a/server/sonar-web/src/main/js/components/ui/AutoEllipsis.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; - -type EllipsisPredicate = ( - node: HTMLElement, - props: Omit, -) => boolean; - -interface AutoEllipsisProps { - customShouldEllipsis?: EllipsisPredicate; - maxHeight?: number; - maxWidth?: number; - useParent?: boolean; -} - -interface Props extends AutoEllipsisProps { - children: React.ReactElement; -} - -/* - * This component allows to automatically add the .text-ellipsis class on it's children if this one - * might overflow the max width/height passed as props. - * If one of maxHeight or maxWidth is not specified, they will be ignored in the conditions to add the ellipsis class. - * If useParent is true, then the parent size will be used instead of the undefined maxHeight/maxWidth - */ -export default function AutoEllipsis(props: Props) { - const { children, ...autoEllipsisProps } = props; - const [autoEllispis, ref] = useAutoEllipsis(autoEllipsisProps); - - return React.cloneElement(children, { - className: classNames(children.props.className, { 'text-ellipsis': autoEllispis }), - ref, - }); -} - -export function useAutoEllipsis(props: AutoEllipsisProps): [boolean, (node: HTMLElement) => void] { - const [autoEllipsis, setAutoEllipsis] = React.useState(false); - - // useCallback instead of useRef to be able to compute if the flag is needed as soon as the ref is attached - // useRef doesn't accept a callback to notify us that the current ref value was attached, - // see https://reactjs.org/docs/hooks-faq.html#how-can-i-measure-a-dom-node for more info on this. - const ref = React.useCallback( - (node: HTMLElement) => { - if (!autoEllipsis && node) { - const shouldEllipsis = props.customShouldEllipsis ?? defaultShouldEllipsis; - setAutoEllipsis(shouldEllipsis(node, props)); - } - }, - // We don't want to apply this effect when ellipsis state change, only this effect can change it - // eslint-disable-next-line react-hooks/exhaustive-deps - [props.customShouldEllipsis, props.maxHeight, props.maxWidth, props.useParent], - ); - - return [autoEllipsis, ref]; -} - -export const defaultShouldEllipsis: EllipsisPredicate = ( - node, - { useParent = true, maxWidth, maxHeight }, -) => { - if (node.parentElement && useParent) { - maxWidth = maxWidth ?? node.parentElement.clientWidth; - maxHeight = maxHeight ?? node.parentElement.clientHeight; - } - return ( - (maxWidth !== undefined && node.clientWidth > maxWidth) || - (maxHeight !== undefined && node.clientHeight > maxHeight) - ); -}; diff --git a/server/sonar-web/src/main/js/components/ui/NewsBox.css b/server/sonar-web/src/main/js/components/ui/NewsBox.css deleted file mode 100644 index 6f45e483dad..00000000000 --- a/server/sonar-web/src/main/js/components/ui/NewsBox.css +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.news-box { - border: 1px solid var(--alertBorderInfo); - border-radius: 2px; - background-color: var(--veryLightBlue); - padding: var(--gridSize); -} - -.news-box-header { - display: flex; - align-items: center; - justify-content: space-between; -} diff --git a/server/sonar-web/src/main/js/components/ui/NewsBox.tsx b/server/sonar-web/src/main/js/components/ui/NewsBox.tsx deleted file mode 100644 index 7f3bfa8fcf5..00000000000 --- a/server/sonar-web/src/main/js/components/ui/NewsBox.tsx +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import { translate } from '../../helpers/l10n'; -import { ClearButton } from '../controls/buttons'; -import './NewsBox.css'; - -export interface Props { - children: React.ReactNode; - className?: string; - onClose: () => void; - title: string; -} - -export default function NewsBox({ children, className, onClose, title }: Props) { - return ( -
    -
    -
    - {translate('new')} - {title} -
    - -
    -
    {children}
    -
    - ); -} diff --git a/server/sonar-web/src/main/js/components/ui/PlaceholderBar.css b/server/sonar-web/src/main/js/components/ui/PlaceholderBar.css deleted file mode 100644 index 4c38c8af997..00000000000 --- a/server/sonar-web/src/main/js/components/ui/PlaceholderBar.css +++ /dev/null @@ -1,25 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.placeholder-bar { - display: inline-block; - vertical-align: middle; - height: 8px; - background-color: currentColor; -} diff --git a/server/sonar-web/src/main/js/components/ui/SizeRating.css b/server/sonar-web/src/main/js/components/ui/SizeRating.css deleted file mode 100644 index be4203383f9..00000000000 --- a/server/sonar-web/src/main/js/components/ui/SizeRating.css +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.size-rating { - display: inline-block; - vertical-align: top; - width: var(--controlHeight); - height: var(--controlHeight); - line-height: var(--controlHeight); - border-radius: var(--controlHeight); - background-color: var(--sizeRatingBackground); - color: #fff; - font-size: var(--smallFontSize); - font-weight: bold; - text-align: center; -} - -.size-rating-muted { - background-color: var(--gray71); -} diff --git a/server/sonar-web/src/main/js/components/ui/SizeRating.tsx b/server/sonar-web/src/main/js/components/ui/SizeRating.tsx deleted file mode 100644 index 8cedbb1deee..00000000000 --- a/server/sonar-web/src/main/js/components/ui/SizeRating.tsx +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import { inRange } from 'lodash'; -import * as React from 'react'; -import './SizeRating.css'; - -export interface Props { - muted?: boolean; - value: number | null | undefined; -} - -export default function SizeRating({ muted = false, value }: Props) { - if (value == null) { - return
     
    ; - } - - let letter; - if (inRange(value, 0, 1000)) { - letter = 'XS'; - } else if (inRange(value, 1000, 10000)) { - letter = 'S'; - } else if (inRange(value, 10000, 100000)) { - letter = 'M'; - } else if (inRange(value, 100000, 500000)) { - letter = 'L'; - } else if (value >= 500000) { - letter = 'XL'; - } - - const className = classNames('size-rating', { - 'size-rating-muted': muted, - }); - - return ( - - ); -} diff --git a/server/sonar-web/src/main/js/components/ui/update-center/MetaData.css b/server/sonar-web/src/main/js/components/ui/update-center/MetaData.css deleted file mode 100644 index aafadaeadb0..00000000000 --- a/server/sonar-web/src/main/js/components/ui/update-center/MetaData.css +++ /dev/null @@ -1,101 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -.update-center-meta-data { - margin: 16px 0; - padding: 16px 16px 8px 16px; - background: #f9f9fb; - border: 1px solid #e6e6e6; - border-radius: 3px; -} - -.update-center-meta-data a svg { - margin-right: 8px; -} - -.update-center-meta-data-header { - border-bottom: 1px solid #cfd3d7; - padding-bottom: 16px; -} - -.update-center-meta-data-header, -.update-center-meta-data-version-release-info, -.update-center-meta-data-version-links { - display: flex; -} - -.update-center-meta-data-header > * + *, -.update-center-meta-data-version-release-info > * + * { - margin-left: 16px; -} - -.update-center-meta-data-header > * + * { - padding-left: 16px; - border-left: 1px solid #cfd3d7; -} - -.update-center-meta-data-versions { - margin-top: 16px; -} - -.update-center-meta-data-versions-show-more { - font-size: 14px; - float: right; - color: #51575a; - border-color: #7b8184; - border-width: 0 0 1px 0; - padding-left: 0; - padding-right: 0; - background: transparent; - cursor: pointer; -} - -.update-center-meta-data-versions-show-more:hover { - color: #2d3032; - border-color: #2d3032; -} - -.update-center-meta-data-version { - margin-bottom: 16px; -} - -.update-center-meta-data-version + .update-center-meta-data-version { - padding-top: 8px; - border-top: 1px dashed #cfd3d7; -} - -.update-center-meta-data-version-version { - font-weight: bold; - font-size: 18px; -} - -.update-center-meta-data-version-release-info { - margin-top: 8px; - font-style: italic; -} - -.update-center-meta-data-version-release-description { - margin-top: 8px; -} - -.update-center-meta-data-version-download > a, -.update-center-meta-data-version-release-notes > a { - display: inline-block; - margin: 8px 16px 0 0; -} diff --git a/server/sonar-web/src/main/js/components/ui/update-center/MetaData.tsx b/server/sonar-web/src/main/js/components/ui/update-center/MetaData.tsx deleted file mode 100644 index 7fd03c236bf..00000000000 --- a/server/sonar-web/src/main/js/components/ui/update-center/MetaData.tsx +++ /dev/null @@ -1,121 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import { isSuccessStatus } from '../../../helpers/request'; -import './MetaData.css'; -import MetaDataVersions from './MetaDataVersions'; -import { MetaDataInformation } from './update-center-metadata'; - -interface Props { - updateCenterKey?: string; -} - -interface State { - data?: MetaDataInformation; -} - -export default class MetaData extends React.Component { - mounted = false; - state: State = {}; - - componentDidMount() { - this.mounted = true; - this.fetchData(); - } - - componentDidUpdate(prevProps: Props) { - if (prevProps.updateCenterKey !== this.props.updateCenterKey) { - this.fetchData(); - } - } - - componentWillUnmount() { - this.mounted = false; - } - - fetchData() { - const { updateCenterKey } = this.props; - - if (updateCenterKey) { - window - .fetch(`https://update.sonarsource.org/${updateCenterKey}.json`) - .then((response: Response) => { - if (isSuccessStatus(response.status)) { - return response.json(); - } - return Promise.reject(response); - }) - .then((data) => { - if (this.mounted) { - this.setState({ data }); - } - }) - .catch(() => { - if (this.mounted) { - this.setState({ data: undefined }); - } - }); - } else { - this.setState({ data: undefined }); - } - } - - render() { - const { data } = this.state; - - if (!data) { - return null; - } - - const { isSonarSourceCommercial, issueTrackerURL, license, organization, versions } = data; - - let vendor; - if (organization) { - vendor = organization.name; - if (organization.url) { - vendor = ( - - {vendor} - - ); - } - } - - return ( -
    -
    - {vendor && By {vendor}} - {license && {license}} - {issueTrackerURL && ( - - - Issue Tracker - - - )} - {isSonarSourceCommercial && ( - Supported by SonarSource - )} -
    - {versions && versions.length > 0 && } -
    - ); - } -} diff --git a/server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersion.tsx b/server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersion.tsx deleted file mode 100644 index ea4159f0b66..00000000000 --- a/server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersion.tsx +++ /dev/null @@ -1,99 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import classNames from 'classnames'; -import * as React from 'react'; -import { AdvancedDownloadUrl, MetaDataVersionInformation } from './update-center-metadata'; - -export interface MetaDataVersionProps { - versionInformation: MetaDataVersionInformation; -} - -export default function MetaDataVersion(props: MetaDataVersionProps) { - const { - versionInformation: { - archived, - changeLogUrl, - compatibility, - date, - description, - downloadURL, - version, - }, - } = props; - - const fallbackLabel = 'Download'; - - const advancedDownloadUrls = isAdvancedDownloadUrlArray(downloadURL) - ? downloadURL.map((url) => ({ ...url, label: url.label || fallbackLabel })) - : [{ label: fallbackLabel, url: downloadURL }]; - - return ( -
    -
    {version}
    - -
    - {date && } - - {compatibility && ( - {compatibility} - )} -
    - - {description && ( -
    {description}
    - )} - - {(advancedDownloadUrls.length > 0 || changeLogUrl) && ( -
    - {advancedDownloadUrls.length > 0 && - advancedDownloadUrls.map( - (advancedDownloadUrl, i) => - advancedDownloadUrl.url && ( - // eslint-disable-next-line react/no-array-index-key - - - {advancedDownloadUrl.label} - - - ), - )} - - {changeLogUrl && ( - - - Release notes - - - )} -
    - )} -
    - ); -} - -function isAdvancedDownloadUrlArray( - downloadUrl: string | AdvancedDownloadUrl[] | undefined, -): downloadUrl is AdvancedDownloadUrl[] { - return !!downloadUrl && typeof downloadUrl !== 'string'; -} diff --git a/server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersions.tsx b/server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersions.tsx deleted file mode 100644 index 3d7c4a5c099..00000000000 --- a/server/sonar-web/src/main/js/components/ui/update-center/MetaDataVersions.tsx +++ /dev/null @@ -1,85 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import * as React from 'react'; -import MetaDataVersion from './MetaDataVersion'; -import { MetaDataVersionInformation } from './update-center-metadata'; - -interface Props { - versions: MetaDataVersionInformation[]; -} - -interface State { - collapsed: boolean; -} - -export default class MetaDataVersions extends React.Component { - state: State = { - collapsed: true, - }; - - componentDidUpdate(prevProps: Props) { - if (prevProps.versions !== this.props.versions) { - this.setState({ collapsed: true }); - } - } - - handleClick = (event: React.SyntheticEvent) => { - event.preventDefault(); - event.currentTarget.blur(); - this.setState(({ collapsed }) => ({ collapsed: !collapsed })); - }; - - render() { - const { versions } = this.props; - const { collapsed } = this.state; - - const archivedVersions = versions.filter((version) => version.archived); - const currentVersions = versions.filter((version) => !version.archived); - - return ( -
    - {archivedVersions.length > 0 && ( - - )} - - {currentVersions.map((versionInformation) => ( - - ))} - - {!collapsed && - archivedVersions.map((archivedVersionInformation) => ( - - ))} -
    - ); - } -} diff --git a/server/sonar-web/src/main/js/components/ui/update-center/mocks/update-center-metadata.ts b/server/sonar-web/src/main/js/components/ui/update-center/mocks/update-center-metadata.ts deleted file mode 100644 index fe3f07a904a..00000000000 --- a/server/sonar-web/src/main/js/components/ui/update-center/mocks/update-center-metadata.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import { MetaDataInformation, MetaDataVersionInformation } from '../update-center-metadata'; - -export function mockMetaDataVersionInformation( - overrides?: Partial, -): MetaDataVersionInformation { - return { - version: '5.13', - date: '2019-05-31', - compatibility: '6.7', - archived: false, - downloadURL: 'https://example.com/sonar-java-plugin-5.13.0.18197.jar', - changeLogUrl: 'https://example.com/sonar-java-plugin/release', - ...overrides, - }; -} - -export function mockMetaDataInformation( - overrides?: Partial, -): MetaDataInformation { - return { - name: 'SonarJava', - key: 'java', - isSonarSourceCommercial: true, - organization: { - name: 'SonarSource', - url: 'http://www.sonarsource.com/', - }, - category: 'Languages', - license: 'SonarSource', - issueTrackerURL: 'https://jira.sonarsource.com/browse/SONARJAVA', - sourcesURL: 'https://github.com/SonarSource/sonar-java', - versions: [ - mockMetaDataVersionInformation({ version: '2.0' }), - mockMetaDataVersionInformation({ version: '1.0', archived: true }), - ], - ...overrides, - }; -} diff --git a/server/sonar-web/src/main/js/components/ui/update-center/update-center-metadata.ts b/server/sonar-web/src/main/js/components/ui/update-center/update-center-metadata.ts deleted file mode 100644 index 5d60da5aca1..00000000000 --- a/server/sonar-web/src/main/js/components/ui/update-center/update-center-metadata.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -export interface MetaDataInformation { - category?: string; - isSonarSourceCommercial?: boolean; - issueTrackerURL?: string; - key?: string; - license?: string; - name: string; - organization?: { - name: string; - url?: string; - }; - sourcesURL?: string; - versions?: MetaDataVersionInformation[]; -} - -export interface MetaDataVersionInformation { - archived?: boolean; - changeLogUrl?: string; - compatibility?: string; - date?: string; - description?: string; - downloadURL?: string | AdvancedDownloadUrl[]; - version: string; -} - -export interface AdvancedDownloadUrl { - label?: string; - url: string; -} diff --git a/server/sonar-web/src/main/js/components/upgrade/__tests__/SystemUpgrade-test.tsx b/server/sonar-web/src/main/js/components/upgrade/__tests__/SystemUpgrade-test.tsx index ded6a2667fe..cd2fb9bfb11 100644 --- a/server/sonar-web/src/main/js/components/upgrade/__tests__/SystemUpgrade-test.tsx +++ b/server/sonar-web/src/main/js/components/upgrade/__tests__/SystemUpgrade-test.tsx @@ -26,7 +26,7 @@ import SystemUpgradeButton from '../SystemUpgradeButton'; import { UpdateUseCase } from '../utils'; const ui = { - toggleButton: byRole('button', { name: 'learn_more' }), + learnMoreButton: byRole('button', { name: 'learn_more' }), header: byRole('heading', { name: 'system.system_upgrade' }), downloadLink: byRole('link', { name: /system.see_sonarqube_downloads/ }), @@ -41,7 +41,7 @@ it('should render properly', async () => { renderSystemUpgradeButton(); - await user.click(ui.toggleButton.get()); + await user.click(ui.learnMoreButton.get()); expect(ui.header.get()).toBeInTheDocument(); expect(ui.ltsVersionHeader.get()).toBeInTheDocument(); @@ -60,7 +60,7 @@ it('should render properly for new patch', async () => { '9.9', ); - await user.click(ui.toggleButton.get()); + await user.click(ui.learnMoreButton.get()); expect(ui.header.get()).toBeInTheDocument(); expect(ui.newPatchWarning.get()).toBeInTheDocument(); diff --git a/server/sonar-web/src/main/js/types/actions.ts b/server/sonar-web/src/main/js/types/actions.ts deleted file mode 100644 index 1e51878fe33..00000000000 --- a/server/sonar-web/src/main/js/types/actions.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -type ActionCreator = (...args: any[]) => { type: string }; - -export type ActionType = Omit, 'type'> & { type: T }; -- 2.39.5