From b97502919665bb2820e8d2fb51400ff417d4a83c Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Tue, 30 Mar 2021 09:17:37 +0200 Subject: [PATCH] SONAR-14632 Update EE promo on Background Tasks page --- .../components/NoWorkersSupportPopup.tsx | 2 +- .../background-tasks/components/Workers.tsx | 6 ++++- .../__tests__/NoWorkersSupportPopup-test.tsx | 27 +++++++++++++++++++ .../NoWorkersSupportPopup-test.tsx.snap | 27 +++++++++++++++++++ .../__snapshots__/Workers-test.tsx.snap | 7 ++++- .../resources/org/sonar/l10n/core.properties | 4 +-- 6 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/NoWorkersSupportPopup-test.tsx create mode 100644 server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/NoWorkersSupportPopup-test.tsx.snap 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 68b0f1e89cb..8f6b72bd919 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 @@ -31,7 +31,7 @@ export default function NoWorkersSupportPopup() {

{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 98775f5bd48..cf586076bd1 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 @@ -22,8 +22,10 @@ import { EditButton } from 'sonar-ui-common/components/controls/buttons'; import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip'; import Tooltip from 'sonar-ui-common/components/controls/Tooltip'; import AlertWarnIcon from 'sonar-ui-common/components/icons/AlertWarnIcon'; +import PlusCircleIcon from 'sonar-ui-common/components/icons/PlusCircleIcon'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { getWorkers } from '../../../api/ce'; +import { colors } from '../../../app/theme'; import NoWorkersSupportPopup from './NoWorkersSupportPopup'; import WorkersForm from './WorkersForm'; @@ -130,7 +132,9 @@ export default class Workers extends React.PureComponent<{}, State> { )} {!loading && !canSetWorkerCount && ( - } /> + }> + + )} {formOpen && } diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/NoWorkersSupportPopup-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/NoWorkersSupportPopup-test.tsx new file mode 100644 index 00000000000..7e41b91de5c --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/NoWorkersSupportPopup-test.tsx @@ -0,0 +1,27 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 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 { shallow } from 'enzyme'; +import * as React from 'react'; +import NoWorkersSupportPopup from '../NoWorkersSupportPopup'; + +it('should render correctly', () => { + expect(shallow()).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/NoWorkersSupportPopup-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/NoWorkersSupportPopup-test.tsx.snap new file mode 100644 index 00000000000..eecf3cafaa0 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/NoWorkersSupportPopup-test.tsx.snap @@ -0,0 +1,27 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + +

+ + background_tasks.add_more_workers + +

+

+ background_tasks.add_more_workers.text +

+

+ + learn_more + +

+ +`; 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 a579c086680..503841e58e2 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 @@ -158,7 +158,12 @@ exports[`renders 4`] = ` } - /> + > + + `; 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 b7010c61c67..2db3d247d11 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2831,8 +2831,8 @@ background_tasks.number_of_workers=Number of Workers: background_tasks.number_of_workers.warning=Configuring additional workers without first vertically scaling your server could have negative performance impacts. background_tasks.change_number_of_workers=Edit CE Workers background_tasks.change_number_of_workers.hint=If your queue backs up behind the analysis reports from large projects, increasing the number of Compute Engine workers will allow you to take full advantage of having configured increased Compute Engine memory on a multi-core server (vertical scaling). -background_tasks.add_more_workers=Speed up your analysis by adding more Workers -background_tasks.add_more_workers.text=Increase the number of Compute Engine Workers with the Enterprise Edition. +background_tasks.add_more_workers=Speed up analysis with parallel processing +background_tasks.add_more_workers.text=Configure multiple workers for parallel processing of analysis reports in Enterprise Edition. background_tasks.search_by_task_or_component=Search by Task or Component background_tasks.failing_count=Count of projects where processing of most recent analysis report failed -- 2.39.5