diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2023-02-02 09:45:59 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-02-02 20:03:40 +0000 |
commit | 833514259b44443a29f0359298d7f6a7b808c174 (patch) | |
tree | e97d2b44773fadef3045a5d5991a5bd680f1ca3d /server/sonar-web | |
parent | 609d2d03d1624a3bf162e6c2d56f6374ce4d438e (diff) | |
download | sonarqube-833514259b44443a29f0359298d7f6a7b808c174.tar.gz sonarqube-833514259b44443a29f0359298d7f6a7b808c174.zip |
SONAR-18329 [1109516] Page <title> does not identify purpose of page
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx b/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx index 53bc79a18e1..b7dbcdd5bc9 100644 --- a/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/CodeApp.tsx @@ -35,7 +35,7 @@ import { isPullRequest } from '../../../helpers/branch-like'; import { translate } from '../../../helpers/l10n'; import { CodeScope, getCodeUrl, getProjectUrl } from '../../../helpers/urls'; import { BranchLike } from '../../../types/branch-like'; -import { ComponentQualifier, isPortfolioLike } from '../../../types/component'; +import { ComponentQualifier, isApplication, isPortfolioLike } from '../../../types/component'; import { Breadcrumb, Component, ComponentMeasure, Dict, Issue, Metric } from '../../../types/types'; import { addComponent, addComponentBreadcrumbs, clearBucket } from '../bucket'; import '../code.css'; @@ -282,15 +282,12 @@ export class CodeApp extends React.Component<Props, State> { ); const metrics = metricKeys.map((metric) => this.props.metrics[metric]); - const defaultTitle = - baseComponent && - [ - ComponentQualifier.Application, - ComponentQualifier.Portfolio, - ComponentQualifier.SubPortfolio, - ].includes(baseComponent.qualifier as ComponentQualifier) - ? translate('projects.page') - : translate('code.page'); + let defaultTitle = translate('code.page'); + if (isApplication(baseComponent?.qualifier)) { + defaultTitle = translate('projects.page'); + } else if (isPortfolioLike(baseComponent?.qualifier)) { + defaultTitle = translate('portfolio_breakdown.page'); + } const isPortfolio = isPortfolioLike(qualifier); |