From c87c2986e927c424c64fd8d7cdb01c6c3ff34b95 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 2 May 2018 17:41:34 +0200 Subject: [PATCH] SONAR-10611 use new help tooltips across the app (#203) --- .../tooltips/branches/no-branch-support.md | 7 ++ .../src/tooltips/branches/single-branch.md | 7 ++ .../util/pageobjects/QualityProfilePage.java | 4 +- .../embed-docs-modal/EmbedDocsPopup.tsx | 18 ++-- .../embed-docs-modal/EmbedDocsPopupHelper.tsx | 10 +- .../__tests__/EmbedDocsPopup-test.tsx | 13 ++- .../EmbedDocsPopup-test.tsx.snap | 5 +- .../nav/component/ComponentNavBranch.tsx | 42 +++----- .../component/ComponentNavBranchesMenu.tsx | 13 ++- .../nav/component/SingleBranchHelperPopup.tsx | 39 ------- .../__tests__/ComponentNavBranch-test.tsx | 4 +- .../ComponentNavBranch-test.tsx.snap | 24 +++-- .../ComponentNavBranchesMenu-test.tsx.snap | 30 +++--- .../NoBranchSupportPopup-test.tsx.snap | 25 ----- .../SingleBranchHelperPopup-test.tsx.snap | 24 ----- .../app/components/nav/global/GlobalNav.tsx | 1 + .../src/main/js/app/styles/init/icons.css | 6 -- .../src/main/js/app/utils/exposeLibraries.ts | 2 + .../components/NoWorkersSupportPopup.tsx | 36 +++---- .../background-tasks/components/Workers.tsx | 25 +---- .../__snapshots__/Workers-test.tsx.snap | 69 ++++++------ .../drilldown/BubbleChart.js | 11 +- .../js/apps/documentation/components/App.tsx | 7 +- .../documentation/styles.css} | 13 +-- .../issues/components/BulkChangeModal.tsx | 11 +- .../apps/overview/qualityGate/QualityGate.js | 17 ++- .../__snapshots__/QualityGate-test.js.snap | 19 ++-- .../components/ListHeader.js | 10 +- .../shared/components/PermissionHeader.tsx | 7 +- .../src/main/js/apps/permissions/styles.css | 2 +- .../apps/projectBranches/components/App.tsx | 13 ++- .../__tests__/__snapshots__/App-test.tsx.snap | 15 +-- .../js/apps/projects/visualizations/Risk.tsx | 11 +- .../visualizations/SimpleBubbleChart.tsx | 11 +- .../__snapshots__/Risk-test.tsx.snap | 17 ++- .../SimpleBubbleChart-test.tsx.snap | 16 ++- .../js/apps/projectsManagement/Search.tsx | 11 +- .../__snapshots__/Search-test.tsx.snap | 26 ++--- .../components/BuiltInQualityGateBadge.tsx | 16 ++- .../components/DetailsHeader.tsx | 8 +- .../js/apps/quality-gates/components/List.js | 2 +- .../components/BuiltInQualityProfileBadge.tsx | 9 +- .../details/ProfileInheritanceBox.tsx | 12 ++- .../details/ProfileRulesDeprecatedWarning.tsx | 11 +- .../ProfileRulesSonarWayComparison.tsx | 13 +-- ...rofileRulesDeprecatedWarning-test.tsx.snap | 15 +-- ...ofileRulesSonarWayComparison-test.tsx.snap | 16 +-- .../quality-profiles/home/ProfilesListRow.tsx | 20 ++-- .../sessions/components/OAuthProviders.css | 4 +- .../sessions/components/OAuthProviders.tsx | 10 +- .../OAuthProviders-test.tsx.snap | 13 +-- .../js/apps/web-api/components/Search.tsx | 25 ++--- .../__snapshots__/Search-test.tsx.snap | 24 ++--- .../apps/webhooks/components/PageHeader.tsx | 8 +- .../__snapshots__/PageHeader-test.tsx.snap | 10 +- .../js/components/common/BranchStatus.tsx | 13 ++- .../__snapshots__/BranchStatus-test.tsx.snap | 14 +-- .../controls/HelpTooltip.css} | 17 +-- .../controls/HelpTooltip.tsx} | 37 ++++--- .../src/main/js/components/controls/Popup.tsx | 73 ------------- .../main/js/components/controls/Tooltip.css | 100 ++++-------------- .../main/js/components/controls/Tooltip.tsx | 37 ++++++- .../controls/__tests__/Tooltip-test.tsx | 2 + .../__snapshots__/Tooltip-test.tsx.snap | 4 + .../src/main/js/components/docs/DocImg.tsx | 12 ++- .../main/js/components/docs/DocInclude.tsx | 3 +- .../src/main/js/components/docs/DocLink.tsx | 13 ++- .../main/js/components/docs/DocTooltip.tsx | 53 ++-------- .../docs/__tests__/DocTooltip-test.tsx | 9 -- .../__snapshots__/DocLink-test.tsx.snap | 15 ++- .../__snapshots__/DocTooltip-test.tsx.snap | 71 ++++--------- .../main/js/components/facet/FacetHeader.tsx | 15 +-- .../__snapshots__/FacetHeader-test.tsx.snap | 12 +-- .../components/icons-components/HelpIcon.tsx | 10 +- .../resources/org/sonar/l10n/core.properties | 10 +- 75 files changed, 539 insertions(+), 818 deletions(-) create mode 100644 server/sonar-docs/src/tooltips/branches/no-branch-support.md create mode 100644 server/sonar-docs/src/tooltips/branches/single-branch.md delete mode 100644 server/sonar-web/src/main/js/app/components/nav/component/SingleBranchHelperPopup.tsx delete mode 100644 server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/NoBranchSupportPopup-test.tsx.snap delete mode 100644 server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/SingleBranchHelperPopup-test.tsx.snap rename server/sonar-web/src/main/js/{app/components/nav/component/__tests__/NoBranchSupportPopup-test.tsx => apps/documentation/styles.css} (79%) rename server/sonar-web/src/main/js/{app/components/nav/component/__tests__/SingleBranchHelperPopup-test.tsx => components/controls/HelpTooltip.css} (79%) rename server/sonar-web/src/main/js/{app/components/nav/component/NoBranchSupportPopup.tsx => components/controls/HelpTooltip.tsx} (53%) delete mode 100644 server/sonar-web/src/main/js/components/controls/Popup.tsx diff --git a/server/sonar-docs/src/tooltips/branches/no-branch-support.md b/server/sonar-docs/src/tooltips/branches/no-branch-support.md new file mode 100644 index 00000000000..82854211584 --- /dev/null +++ b/server/sonar-docs/src/tooltips/branches/no-branch-support.md @@ -0,0 +1,7 @@ +**Get the most out of SonarQube with branches analysis** + +Analyze each branch of your project separately with the Developer Edition. + +--- + +[Learn More](https://redirect.sonarsource.com/editions/developer.html) diff --git a/server/sonar-docs/src/tooltips/branches/single-branch.md b/server/sonar-docs/src/tooltips/branches/single-branch.md new file mode 100644 index 00000000000..c4184a27de5 --- /dev/null +++ b/server/sonar-docs/src/tooltips/branches/single-branch.md @@ -0,0 +1,7 @@ +**Learn how to analyze branches in SonarQube** + +Quickly setup branch analysis and get separate insights for each of your branches and pull requests. + +--- + +[Branches Documentation](/branches/index) diff --git a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityProfilePage.java b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityProfilePage.java index 9dbb657f824..2184ce4a581 100644 --- a/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityProfilePage.java +++ b/server/sonar-qa-util/src/main/java/org/sonarqube/qa/util/pageobjects/QualityProfilePage.java @@ -30,13 +30,13 @@ public class QualityProfilePage { public QualityProfilePage shouldHaveMissingSonarWayRules(Integer nbRules) { Selenide.$(".quality-profile-rules-sonarway-missing") .shouldBe(Condition.visible) - .$("a").shouldHave(Condition.text(nbRules.toString())); + .shouldHave(Condition.text(nbRules.toString())); return this; } public RulesPage showMissingSonarWayRules() { Selenide.$(".quality-profile-rules-sonarway-missing") - .shouldBe(Condition.visible).$("a").click(); + .shouldBe(Condition.visible).$("[data-test=\"rules\"]").click(); return Selenide.page(RulesPage.class); } 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 ac864c7dea1..637a95e3fca 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,11 +21,13 @@ import * as React from 'react'; import * as PropTypes from 'prop-types'; import { Link } from 'react-router'; import { SuggestionLink } from './SuggestionsProvider'; +import { CurrentUser, isLoggedIn } from '../../types'; import BubblePopup, { BubblePopupPosition } from '../../../components/common/BubblePopup'; import { translate } from '../../../helpers/l10n'; import { getBaseUrl } from '../../../helpers/urls'; interface Props { + currentUser: CurrentUser; onClose: () => void; popupPosition?: BubblePopupPosition; suggestions: Array; @@ -93,6 +95,7 @@ export default class EmbedDocsPopup extends React.PureComponent { translate('embed_docs.contact_form') )} +
  • {this.renderTitle(translate('embed_docs.stay_connected'))}
  • {this.renderIconLink('https://about.sonarcloud.io/news/', 'sc-icon.svg', 'Product News')} @@ -107,11 +110,13 @@ export default class EmbedDocsPopup extends React.PureComponent { renderSonarQubeLinks() { return ( -
  • - - {translate('embed_docs.analyze_new_project')} - -
  • + {isLoggedIn(this.props.currentUser) && ( +
  • + + {translate('embed_docs.analyze_new_project')} + +
  • + )}
  • {this.renderTitle(translate('embed_docs.get_support'))}
  • @@ -128,6 +133,7 @@ export default class EmbedDocsPopup extends React.PureComponent { 'Stack Overflow' )}
  • +
  • {this.renderTitle(translate('embed_docs.stay_connected'))}
  • {this.renderIconLink('https://blog.sonarsource.com/', 'sq-icon.svg', 'Product News')} @@ -148,7 +154,7 @@ export default class EmbedDocsPopup extends React.PureComponent { {this.renderSuggestions()}
  • - {translate('embed_docs.documentation_index')} + {translate('embed_docs.documentation')}
  • diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopupHelper.tsx b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopupHelper.tsx index aca948c6aa9..29b58e4e6e3 100644 --- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopupHelper.tsx +++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/EmbedDocsPopupHelper.tsx @@ -20,12 +20,14 @@ import * as React from 'react'; import EmbedDocsPopup from './EmbedDocsPopup'; import { SuggestionLink } from './SuggestionsProvider'; +import { CurrentUser } from '../../types'; import BubblePopupHelper from '../../../components/common/BubblePopupHelper'; import HelpIcon from '../../../components/icons-components/HelpIcon'; import Tooltip from '../../../components/controls/Tooltip'; import { translate } from '../../../helpers/l10n'; interface Props { + currentUser: CurrentUser; showTooltip: boolean; suggestions: Array; tooltip: boolean; @@ -79,7 +81,13 @@ export default class EmbedDocsPopupHelper extends React.PureComponent} + popup={ + + } position="bottomleft" togglePopup={this.setHelpDisplay}> { const context = {}; - const wrapper = shallow(, { - context - }); + const wrapper = shallow( + , + { + context + } + ); wrapper.update(); expect(wrapper).toMatchSnapshot(); }); 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 8867991dcc5..b1af003796f 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 @@ -48,7 +48,7 @@ exports[`should display suggestion links 1`] = ` style={Object {}} to="/documentation" > - embed_docs.documentation_index + embed_docs.documentation
  • @@ -110,6 +110,9 @@ exports[`should display suggestion links 1`] = ` Stack Overflow
  • +
  • diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx index 5569d2a7844..890e4d5f29e 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranch.tsx @@ -22,8 +22,7 @@ import * as classNames from 'classnames'; import * as PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import ComponentNavBranchesMenu from './ComponentNavBranchesMenu'; -import SingleBranchHelperPopup from './SingleBranchHelperPopup'; -import NoBranchSupportPopup from './NoBranchSupportPopup'; +import DocTooltip from '../../../../components/docs/DocTooltip'; import { BranchLike, Component } from '../../../types'; import * as theme from '../../../theme'; import BranchIcon from '../../../../components/icons-components/BranchIcon'; @@ -35,7 +34,7 @@ import { } from '../../../../helpers/branches'; import { translate } from '../../../../helpers/l10n'; import PlusCircleIcon from '../../../../components/icons-components/PlusCircleIcon'; -import Popup from '../../../../components/controls/Popup'; +import HelpTooltip from '../../../../components/controls/HelpTooltip'; import Tooltip from '../../../../components/controls/Tooltip'; interface Props { @@ -110,10 +109,11 @@ export default class ComponentNavBranch extends React.PureComponent - {translate('branches.orphan_branch')} - - - + {translate('branches.orphan_branch')} + ) : ( @@ -138,26 +138,6 @@ export default class ComponentNavBranch extends React.PureComponent ( - }> - {({ onClick }) => ( - - - - )} - - ); - - renderNoBranchSupportPopup = () => ( - }> - {({ onClick }) => ( - - - - )} - - ); - render() { const { branchLikes, currentBranchLike } = this.props; @@ -176,7 +156,9 @@ export default class ComponentNavBranch extends React.PureComponent {displayName} - {this.renderNoBranchSupportPopup()} + + + ); } @@ -186,7 +168,9 @@ export default class ComponentNavBranch extends React.PureComponent {displayName} - {this.renderSingleBranchPopup()} + + + ); } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx index 4f2849bdfd8..10f4b1ba885 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavBranchesMenu.tsx @@ -34,7 +34,7 @@ import { import { translate } from '../../../../helpers/l10n'; import { getBranchLikeUrl } from '../../../../helpers/urls'; import SearchBox from '../../../../components/controls/SearchBox'; -import Tooltip from '../../../../components/controls/Tooltip'; +import HelpTooltip from '../../../../components/controls/HelpTooltip'; interface Props { branchLikes: BranchLike[]; @@ -196,10 +196,13 @@ export default class ComponentNavBranchesMenu extends React.PureComponent} {showOrphanHeader && (
  • - {translate('branches.orphan_branches')} - - - +
    + {translate('branches.orphan_branches')} +
    +
  • )} {showPullRequestHeader && ( diff --git a/server/sonar-web/src/main/js/app/components/nav/component/SingleBranchHelperPopup.tsx b/server/sonar-web/src/main/js/app/components/nav/component/SingleBranchHelperPopup.tsx deleted file mode 100644 index b569b999505..00000000000 --- a/server/sonar-web/src/main/js/app/components/nav/component/SingleBranchHelperPopup.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 { translate } from '../../../../helpers/l10n'; - -export default function SingleBranchHelperPopup() { - return ( - <> -
    {translate('branches.learn_how_to_analyze')}
    -

    - {translate('branches.learn_how_to_analyze.text')} -

    - - {translate('about_page.read_documentation')} - - - ); -} diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBranch-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBranch-test.tsx index 2c2651988af..8ea67da8b97 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBranch-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavBranch-test.tsx @@ -114,7 +114,7 @@ it('renders single branch popup', () => { />, { context: { branchesEnabled: true } } ); - expect(wrapper.find('Popup')).toMatchSnapshot(); + expect(wrapper.find('DocTooltip')).toMatchSnapshot(); }); it('renders no branch support popup', () => { @@ -127,7 +127,7 @@ it('renders no branch support popup', () => { />, { context: { branchesEnabled: false } } ); - expect(wrapper.find('Popup')).toMatchSnapshot(); + expect(wrapper.find('DocTooltip')).toMatchSnapshot(); }); it('renders nothing on SonarCloud without branch support', () => { diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranch-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranch-test.tsx.snap index c3042574729..dc23c7b4368 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranch-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranch-test.tsx.snap @@ -36,9 +36,15 @@ exports[`renders main branch 1`] = ` `; exports[`renders no branch support popup 1`] = ` -} -/> + + + `; exports[`renders pull request 1`] = ` @@ -150,7 +156,13 @@ exports[`renders short-living branch 1`] = ` `; exports[`renders single branch popup 1`] = ` -} -/> + + + `; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenu-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenu-test.tsx.snap index a8c10d0f990..c104c23e7d3 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenu-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenu-test.tsx.snap @@ -80,14 +80,15 @@ exports[`renders list 1`] = `
  • - branches.orphan_branches - - - + branches.orphan_branches + +
  • - branches.orphan_branches - - - + branches.orphan_branches + + -
    - branches.no_support.header -
    -

    - branches.no_support.header.text -

    -

    - - learn_more - -

    - -`; diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/SingleBranchHelperPopup-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/SingleBranchHelperPopup-test.tsx.snap deleted file mode 100644 index a27c56302eb..00000000000 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/SingleBranchHelperPopup-test.tsx.snap +++ /dev/null @@ -1,24 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`renders 1`] = ` - -
    - branches.learn_how_to_analyze -
    -

    - branches.learn_how_to_analyze.text -

    - - about_page.read_documentation - -
    -`; diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx index b91c43abb47..866edfae805 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx @@ -101,6 +101,7 @@ class GlobalNav extends React.PureComponent {
  • .icon-radio { } } -.icon-help:before { - content: '\f059'; - color: var(--blue); - font-size: var(--bigFontSize); -} - .icon-close:before { content: '\f00d'; font-size: var(--bigFontSize); diff --git a/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts b/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts index 798f70d69d2..b07d8c1f53b 100644 --- a/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts +++ b/server/sonar-web/src/main/js/app/utils/exposeLibraries.ts @@ -32,6 +32,7 @@ import LicenseEditionSet from '../../apps/marketplace/components/LicenseEditionS import HomePageSelect from '../../components/controls/HomePageSelect'; import ListFooter from '../../components/controls/ListFooter'; import Modal from '../../components/controls/Modal'; +import HelpTooltip from '../../components/controls/HelpTooltip'; import SearchBox from '../../components/controls/SearchBox'; import Select from '../../components/controls/Select'; import Tooltip from '../../components/controls/Tooltip'; @@ -60,6 +61,7 @@ const exposeLibraries = () => { DuplicationsRating, EditButton, FavoriteContainer, + HelpTooltip, HomePageSelect, Level, LicenseEditionSet, diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/NoWorkersSupportPopup.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/NoWorkersSupportPopup.tsx index c6e327896fc..b1f851e0d36 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/NoWorkersSupportPopup.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/NoWorkersSupportPopup.tsx @@ -18,27 +18,25 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import BubblePopup from '../../../components/common/BubblePopup'; import { translate } from '../../../helpers/l10n'; -interface Props { - popupPosition?: any; -} - -export default function NoWorkersSupportPopup(props: Props) { +export default function NoWorkersSupportPopup() { return ( - -
    -
    {translate('background_tasks.add_more_workers')}
    -

    - {translate('background_tasks.add_more_workers.text')} -

    -

    - - {translate('learn_more')} - -

    -
    -
    + <> +

    + {translate('background_tasks.add_more_workers')} +

    +

    + {translate('background_tasks.add_more_workers.text')} +

    +

    + + {translate('learn_more')} + +

    + ); } diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx index 1039418df33..5f448358cfa 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx @@ -21,10 +21,8 @@ import * as React from 'react'; import WorkersForm from './WorkersForm'; import NoWorkersSupportPopup from './NoWorkersSupportPopup'; import AlertWarnIcon from '../../../components/icons-components/AlertWarnIcon'; -import BubblePopupHelper from '../../../components/common/BubblePopupHelper'; -import HelpIcon from '../../../components/icons-components/HelpIcon'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; import Tooltip from '../../../components/controls/Tooltip'; -import * as theme from '../../../app/theme'; import { getWorkers } from '../../../api/ce'; import { translate } from '../../../helpers/l10n'; import { EditButton } from '../../../components/ui/buttons'; @@ -103,15 +101,12 @@ export default class Workers extends React.PureComponent<{}, State> { const { canSetWorkerCount, formOpen, loading, workerCount } = this.state; return ( -
    +
    {!loading && workerCount > 1 && ( - - + + )} @@ -138,17 +133,7 @@ export default class Workers extends React.PureComponent<{}, State> { {!loading && !canSetWorkerCount && ( - - - - - } - position="bottomright" - togglePopup={this.toggleNoSupportPopup} - /> - + } /> )} {formOpen && } diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Workers-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Workers-test.tsx.snap index 48dea3cb94d..a579c086680 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Workers-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Workers-test.tsx.snap @@ -1,7 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`opens form 1`] = ` -
    +
    @@ -24,7 +26,9 @@ exports[`opens form 1`] = ` `; exports[`opens form 2`] = ` -
    +
    @@ -51,7 +55,9 @@ exports[`opens form 2`] = ` `; exports[`renders 1`] = ` -
    +
    @@ -64,7 +70,9 @@ exports[`renders 1`] = ` `; exports[`renders 2`] = ` -
    +
    @@ -87,13 +95,16 @@ exports[`renders 2`] = ` `; exports[`renders 3`] = ` -
    +
    - + @@ -120,13 +131,16 @@ exports[`renders 3`] = ` `; exports[`renders 4`] = ` -
    +
    - + @@ -141,31 +155,17 @@ exports[`renders 4`] = ` 2 - - - - - } - position="bottomright" - togglePopup={[Function]} - /> - + overlay={} + />
    `; exports[`updates worker count 1`] = ` -
    +
    @@ -192,13 +192,16 @@ exports[`updates worker count 1`] = ` `; exports[`updates worker count 2`] = ` -
    +
    - + diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.js b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.js index dad5a4ec0e2..9031eacd7af 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.js +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.js @@ -22,8 +22,7 @@ import React from 'react'; import EmptyResult from './EmptyResult'; import OriginalBubbleChart from '../../../components/charts/BubbleChart'; import ColorRatingsLegend from '../../../components/charts/ColorRatingsLegend'; -import Tooltip from '../../../components/controls/Tooltip'; -import HelpIcon from '../../../components/icons-components/HelpIcon'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; import { formatMeasure, isDiffMetric } from '../../../helpers/measures'; import { getLocalizedMetricDomain, @@ -170,12 +169,8 @@ export default class BubbleChart extends React.PureComponent { return (
    - {title} - - - - - + {title} + diff --git a/server/sonar-web/src/main/js/apps/documentation/components/App.tsx b/server/sonar-web/src/main/js/apps/documentation/components/App.tsx index 90b0bfb46ea..c623b78944d 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/App.tsx @@ -27,6 +27,7 @@ import ScreenPositionHelper from '../../../components/common/ScreenPositionHelpe import DocMarkdownBlock from '../../../components/docs/DocMarkdownBlock'; import DeferredSpinner from '../../../components/common/DeferredSpinner'; import { translate } from '../../../helpers/l10n'; +import '../styles.css'; interface Props { params: { splat?: string }; @@ -87,7 +88,7 @@ export default class App extends React.PureComponent { return (
    @@ -122,7 +123,9 @@ export default class App extends React.PureComponent {
    -
    {this.renderContent()}
    +
    + {this.renderContent()} +
    ); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/NoBranchSupportPopup-test.tsx b/server/sonar-web/src/main/js/apps/documentation/styles.css similarity index 79% rename from server/sonar-web/src/main/js/app/components/nav/component/__tests__/NoBranchSupportPopup-test.tsx rename to server/sonar-web/src/main/js/apps/documentation/styles.css index 14c49cc4c5a..089f3e36189 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/NoBranchSupportPopup-test.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/styles.css @@ -17,10 +17,11 @@ * 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 { shallow } from 'enzyme'; -import NoBranchSupportPopup from '../NoBranchSupportPopup'; +.documentation-layout-inner { + max-width: 740px; +} -it('renders', () => { - expect(shallow()).toMatchSnapshot(); -}); +.documentation-content > h1 { + margin-bottom: calc(4 * var(--gridSize)); + font-size: 20px; +} diff --git a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx index a58ead1f8c7..3bec8113a96 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.tsx @@ -28,7 +28,7 @@ import SearchSelect from '../../../components/controls/SearchSelect'; import Checkbox from '../../../components/controls/Checkbox'; import Modal from '../../../components/controls/Modal'; import Select from '../../../components/controls/Select'; -import Tooltip from '../../../components/controls/Tooltip'; +import HelpTooltip from '../../../components/controls/HelpTooltip'; import SeverityHelper from '../../../components/shared/SeverityHelper'; import Avatar from '../../../components/ui/Avatar'; import { SubmitButton } from '../../../components/ui/buttons'; @@ -457,10 +457,11 @@ export default class BulkChangeModal extends React.PureComponent { return (