diff options
author | stanislavh <stanislav.honcharov@sonarsource.com> | 2023-02-03 14:27:05 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-02-06 20:02:53 +0000 |
commit | f4164d805b1a46ded76c05c4687ae187c951880e (patch) | |
tree | 3991c92517b6feb471f6c612aad6d57874911dda | |
parent | a514d3cd1692c97ff29c5aa48366d957cfdbb9b8 (diff) | |
download | sonarqube-f4164d805b1a46ded76c05c4687ae187c951880e.tar.gz sonarqube-f4164d805b1a46ded76c05c4687ae187c951880e.zip |
SONAR-18054 Page title does not identify purpose of this page
3 files changed, 11 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/__tests__/CodingRules-it.ts b/server/sonar-web/src/main/js/apps/coding-rules/__tests__/CodingRules-it.ts index ce418a36649..0827c6109bf 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/__tests__/CodingRules-it.ts +++ b/server/sonar-web/src/main/js/apps/coding-rules/__tests__/CodingRules-it.ts @@ -69,6 +69,7 @@ it('should show open rule with default description section', async () => { expect( await screen.findByRole('heading', { level: 3, name: 'Awsome java rule' }) ).toBeInTheDocument(); + expect(document.title).toEqual('coding_rule.page.Java.Awsome java rule'); expect(screen.getByText('Why')).toBeInTheDocument(); expect(screen.getByText('Because')).toBeInTheDocument(); }); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx index 66e7210d3b2..db284a398d9 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/App.tsx @@ -34,7 +34,7 @@ import BackIcon from '../../../components/icons/BackIcon'; import '../../../components/search-navigator.css'; import { isInput, isShortcut } from '../../../helpers/keyboardEventHelpers'; import { KeyboardKeys } from '../../../helpers/keycodes'; -import { translate } from '../../../helpers/l10n'; +import { translate, translateWithParameters } from '../../../helpers/l10n'; import { addSideBarClass, addWhitePageClass, @@ -562,7 +562,14 @@ export class App extends React.PureComponent<Props, State> { return ( <> <Suggestions suggestions="coding_rules" /> - <Helmet defer={false} title={translate('coding_rules.page')}> + <Helmet + defer={false} + title={ + openRule + ? translateWithParameters('coding_rule.page', openRule.langName, openRule.name) + : translate('coding_rules.page') + } + > <meta content="noindex" name="robots" /> </Helmet> <div className="layout-page" id="coding-rules-page"> diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index b153374a68a..2f89fb5dc42 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -573,6 +573,7 @@ visibility.private.description.long=Only members of the organization will be abl #------------------------------------------------------------------------------ coding_rules.page=Rules +coding_rule.page={0} rule: {1} global_permissions.page=Global Permissions global_permissions.page.description=Grant and revoke permissions to make changes at the global level. These permissions include editing Quality Profiles, executing analysis, and performing global system administration. roles.page=Project Permissions |