diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-02-08 12:19:05 +0100 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2018-02-20 10:06:52 +0100 |
commit | fff2b9bcc5e0668dfc36a8a34000aac0ae9c10e7 (patch) | |
tree | 41b6b137ab2e1b39ccc617ce121cf738f981807a /server/sonar-web | |
parent | 152588a68d439f3b48b448c56b83e592259dea52 (diff) | |
download | sonarqube-fff2b9bcc5e0668dfc36a8a34000aac0ae9c10e7.tar.gz sonarqube-fff2b9bcc5e0668dfc36a8a34000aac0ae9c10e7.zip |
SONAR-10411 use link name from l10n bundle for provided links
Diffstat (limited to 'server/sonar-web')
3 files changed, 9 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaLink.tsx b/server/sonar-web/src/main/js/apps/overview/meta/MetaLink.tsx index 04c7ae09745..e4c9a697009 100644 --- a/server/sonar-web/src/main/js/apps/overview/meta/MetaLink.tsx +++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaLink.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { isProvided } from '../../project-admin/links/utils'; +import { isProvided, getLinkName } from '../../project-admin/links/utils'; import BugTrackerIcon from '../../../components/ui/BugTrackerIcon'; import { ProjectLink } from '../../../api/projectLinks'; @@ -30,7 +30,7 @@ export default function MetaLink({ link }: Props) { return ( <li> <a className="link-with-icon" href={link.url} rel="nofollow" target="_blank"> - <MetaLinkIcon link={link} /> {link.name} + <MetaLinkIcon link={link} /> {getLinkName(link)} </a> </li> ); diff --git a/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.js b/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.js index 9c36959c021..3124fb9c8af 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.js +++ b/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.js @@ -19,7 +19,7 @@ */ import React from 'react'; import PropTypes from 'prop-types'; -import { isProvided } from './utils'; +import { isProvided, getLinkName } from './utils'; import { translate } from '../../../helpers/l10n'; import BugTrackerIcon from '../../../components/ui/BugTrackerIcon'; @@ -57,7 +57,7 @@ export default class LinkRow extends React.PureComponent { {this.renderIcon(`icon-${link.type}`)} <div className="display-inline-block text-top"> <div> - <span className="js-name">{link.name}</span> + <span className="js-name">{getLinkName(link)}</span> </div> <div className="note little-spacer-top"> <span className="js-type">{`sonar.links.${link.type}`}</span> diff --git a/server/sonar-web/src/main/js/apps/project-admin/links/utils.js b/server/sonar-web/src/main/js/apps/project-admin/links/utils.js index bfd19ca8da7..06539348fef 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/links/utils.js +++ b/server/sonar-web/src/main/js/apps/project-admin/links/utils.js @@ -18,6 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { partition, sortBy } from 'lodash'; +import { translate } from '../../../helpers/l10n'; const PROVIDED_TYPES = ['homepage', 'ci', 'issue', 'scm', 'scm_dev']; @@ -32,3 +33,7 @@ export function orderLinks(links) { ...sortBy(unknown, link => link.name.toLowerCase()) ]; } + +export function getLinkName(link) { + return isProvided(link) ? translate('project_links', link.type) : link.name; +} |