From: Stas Vilchik Date: Thu, 11 Jan 2018 10:46:20 +0000 (+0100) Subject: SONAR-10239 Stop using "External link" icon X-Git-Tag: 7.0-RC1~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1a2666353d24be549e2dbabc33cfed5fe2155732;p=sonarqube.git SONAR-10239 Stop using "External link" icon --- diff --git a/server/sonar-web/src/main/js/apps/code/components/Component.tsx b/server/sonar-web/src/main/js/apps/code/components/Component.tsx index f4198dcc060..98bd83e638b 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Component.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/Component.tsx @@ -21,7 +21,7 @@ import * as classNames from 'classnames'; import * as React from 'react'; import ComponentName from './ComponentName'; import ComponentMeasure from './ComponentMeasure'; -import ComponentDetach from './ComponentDetach'; +import ComponentLink from './ComponentLink'; import ComponentPin from './ComponentPin'; import { Component as IComponent } from '../types'; @@ -90,7 +90,7 @@ export default class Component extends React.PureComponent { componentAction = ; break; default: - componentAction = ; + componentAction = ; } } diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentDetach.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentDetach.tsx deleted file mode 100644 index 0a237c54bb8..00000000000 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentDetach.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 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 { Link } from 'react-router'; -import { translate } from '../../../helpers/l10n'; -import { Component } from '../types'; - -interface Props { - branch?: string; - component: Component; -} - -export default function ComponentDetach({ component, branch }: Props) { - return ( - - ); -} diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentLink.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentLink.tsx new file mode 100644 index 00000000000..3074d6c74d6 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentLink.tsx @@ -0,0 +1,41 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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 { Link } from 'react-router'; +import { Component } from '../types'; +import LinkIcon from '../../../components/icons-components/LinkIcon'; +import { translate } from '../../../helpers/l10n'; +import { getProjectUrl } from '../../../helpers/urls'; + +interface Props { + branch?: string; + component: Component; +} + +export default function ComponentLink({ component, branch }: Props) { + return ( + + + + ); +} diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.js b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.js index 38d25a48286..033a8bcf66b 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.js +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.js @@ -19,6 +19,8 @@ */ // @flow import React from 'react'; +import { Link } from 'react-router'; +import LinkIcon from '../../../components/icons-components/LinkIcon'; import QualifierIcon from '../../../components/icons-components/QualifierIcon'; import { splitPath } from '../../../helpers/path'; import { getPathUrlAsString, getProjectUrl } from '../../../helpers/urls'; @@ -50,8 +52,7 @@ export default class ComponentCell extends React.PureComponent { if (['DIR', 'FIL', 'UTS'].includes(component.qualifier)) { const parts = splitPath(component.path); - head = parts.head; - tail = parts.tail; + ({ head, tail } = parts); } return ( @@ -77,15 +78,15 @@ export default class ComponentCell extends React.PureComponent { {this.renderInner()} ) : ( - + id={'component-measures-component-link-' + component.key} + to={getProjectUrl(component.refKey, branch)}> - + {this.renderInner()} - + )} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.js b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.js index 53c2f4c2313..253f8db02ac 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.js +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerHeader.js @@ -19,6 +19,7 @@ */ // @flow import React from 'react'; +import { Link } from 'react-router'; import QualifierIcon from '../shared/QualifierIcon'; import FavoriteContainer from '../controls/FavoriteContainer'; import { getPathUrlAsString, getProjectUrl, getComponentIssuesUrl } from '../../helpers/urls'; @@ -179,19 +180,14 @@ export default class SourceViewerHeader extends React.PureComponent {
- - {measures.issues != null ? formatMeasure(measures.issues, 'SHORT_INT') : 0}{' '} - - + + {measures.issues != null ? formatMeasure(measures.issues, 'SHORT_INT') : 0} + {translate('metric.violations.name')} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/styles.css b/server/sonar-web/src/main/js/components/SourceViewer/styles.css index 1387bb7333c..2c98827855f 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/styles.css +++ b/server/sonar-web/src/main/js/components/SourceViewer/styles.css @@ -327,17 +327,7 @@ display: block; line-height: 18px; color: var(--baseFontColor); - font-size: 18px; - font-weight: 300; -} - -.source-viewer-header-external-link { - border-bottom: none; -} - -.source-viewer-header-external-link i { - position: relative; - top: -4px; + font-size: var(--bigFontSize); } .source-viewer-header-actions {