From: Stas Vilchik Date: Mon, 30 Apr 2018 13:36:28 +0000 (+0200) Subject: SONAR-10612 replace .icon-detach with DetachIcon X-Git-Tag: 7.5~1269 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=023441a00e30133e63502195bdf8d0ded3ec52e5;p=sonarqube.git SONAR-10612 replace .icon-detach with DetachIcon --- diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx index d81f6bf8806..9a886fb4508 100644 --- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx +++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopup.tsx @@ -21,7 +21,9 @@ import * as React from 'react'; import * as PropTypes from 'prop-types'; import { Link } from 'react-router'; import { SuggestionLink } from './SuggestionsProvider'; +import * as theme from '../../../app/theme'; import BubblePopup, { BubblePopupPosition } from '../../../components/common/BubblePopup'; +import DetachIcon from '../../../components/icons-components/DetachIcon'; import { translate } from '../../../helpers/l10n'; import { getBaseUrl } from '../../../helpers/urls'; @@ -56,9 +58,10 @@ export default class EmbedDocsPopup extends React.PureComponent { {this.renderTitle(translate('embed_docs.suggestion'))} {this.props.suggestions.map((suggestion, index) => (
  • - - {suggestion.text} - + + {suggestion.text} + +
  • ))}
  • @@ -147,8 +150,9 @@ export default class EmbedDocsPopup extends React.PureComponent {
      {this.renderSuggestions()}
    • - - {translate('embed_docs.documentation_index')} + + {translate('embed_docs.documentation_index')} +
    • {this.context.onSonarCloud && this.renderSonarCloudLinks()} diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap b/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap index e6405633094..082ef152ac5 100644 --- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/__snapshots__/EmbedDocsPopup-test.tsx.snap @@ -16,30 +16,38 @@ exports[`should display suggestion links 1`] = `
    • - foo - - - +
    • - bar - - - +
    • embed_docs.documentation_index - -
    • diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx index bb998f285ae..6b52b5eefbf 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx @@ -32,6 +32,7 @@ import DateTimeFormatter from '../../../../components/intl/DateTimeFormatter'; import Favorite from '../../../../components/controls/Favorite'; import HomePageSelect from '../../../../components/controls/HomePageSelect'; import Tooltip from '../../../../components/controls/Tooltip'; +import DetachIcon from '../../../../components/icons-components/DetachIcon'; import { isShortLivingBranch, isLongLivingBranch, @@ -89,9 +90,13 @@ export function ComponentNavMeta({ branchLike, component, currentUser }: Props)
      {isPullRequest(branchLike) && branchLike.url !== undefined && ( - + {translate('branches.see_the_pr')} - + )} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMeta-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMeta-test.tsx.snap index 42db3b6595b..144ce956ea4 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMeta-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMeta-test.tsx.snap @@ -41,14 +41,15 @@ exports[`renders meta for pull request 1`] = ` className="navbar-context-meta-secondary" > branches.see_the_pr - .icon-radio { font-size: var(--bigFontSize); } -.icon-detach:before { - content: '\f08e'; - font-size: var(--mediumFontSize); -} - .icon-chevron-left:before { content: '\f104'; font-size: var(--mediumFontSize); 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 d909bc0faff..4996bae73c0 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 @@ -20,6 +20,7 @@ import * as React from 'react'; import { isProvided, getLinkName } from '../../project-admin/links/utils'; import { ProjectLink } from '../../../app/types'; +import DetachIcon from '../../../components/icons-components/DetachIcon'; import BugTrackerIcon from '../../../components/ui/BugTrackerIcon'; interface Props { @@ -41,9 +42,5 @@ function MetaLinkIcon({ link }: Props) { return ; } - return isProvided(link) ? ( - - ) : ( - - ); + return isProvided(link) ? : ; } diff --git a/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.tsx b/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.tsx index 74ea4df05ee..0bd5d10cbd1 100644 --- a/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.tsx +++ b/server/sonar-web/src/main/js/apps/project-admin/links/LinkRow.tsx @@ -21,6 +21,7 @@ import * as React from 'react'; import { isProvided, getLinkName } from './utils'; import { ProjectLink } from '../../../app/types'; import ConfirmButton from '../../../components/controls/ConfirmButton'; +import DetachIcon from '../../../components/icons-components/DetachIcon'; import BugTrackerIcon from '../../../components/ui/BugTrackerIcon'; import { Button } from '../../../components/ui/buttons'; import { translate, translateWithParameters } from '../../../helpers/l10n'; @@ -70,7 +71,7 @@ export default class LinkRow extends React.PureComponent { return (
      - {this.renderIcon('icon-detach')} +
      {link.name}
      diff --git a/server/sonar-web/src/main/js/components/icons-components/DetachIcon.tsx b/server/sonar-web/src/main/js/components/icons-components/DetachIcon.tsx new file mode 100644 index 00000000000..d7b08269119 --- /dev/null +++ b/server/sonar-web/src/main/js/components/icons-components/DetachIcon.tsx @@ -0,0 +1,39 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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 { IconProps } from './types'; + +export default function DetachIcon({ className, fill = 'currentColor', size = 16 }: IconProps) { + return ( + + ; + + ); +}