From: Stas Vilchik Date: Wed, 11 Oct 2017 14:18:48 +0000 (+0200) Subject: SONAR-9867 Add button promoting governance on background tasks page X-Git-Tag: 6.7-RC1~294 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fed59c4f4663f6dfad64d2742712d53c090ea4b3;p=sonarqube.git SONAR-9867 Add button promoting governance on background tasks page --- diff --git a/server/sonar-web/src/main/js/api/ce.ts b/server/sonar-web/src/main/js/api/ce.ts index a61b0e2051b..33be5602977 100644 --- a/server/sonar-web/src/main/js/api/ce.ts +++ b/server/sonar-web/src/main/js/api/ce.ts @@ -81,7 +81,7 @@ export function getTypes(): Promise { return getJSON('/api/ce/task_types').then(r => r.taskTypes); } -export function getWorkers(): Promise<{ canSetWorkerCount: boolean; value: number } | Response> { +export function getWorkers(): Promise<{ canSetWorkerCount: boolean; value: number }> { return getJSON('/api/ce/worker_count').catch(throwGlobalError); } diff --git a/server/sonar-web/src/main/js/app/components/nav/component/NoBranchSupportPopup.tsx b/server/sonar-web/src/main/js/app/components/nav/component/NoBranchSupportPopup.tsx index 70cfb0edb28..35ac2dbcdd4 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/NoBranchSupportPopup.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/NoBranchSupportPopup.tsx @@ -33,7 +33,7 @@ export default function NoBranchSupportPopup(props: Props) {

{translate('branches.no_support.header.text')}

- {translate('branches.learn_more')} + {translate('learn_more')} - branches.learn_more + learn_more -

{translate('background_tasks.page')}

- {!props.component && ( -
- -
- )} -

{translate('background_tasks.page.description')}

- - ); -} diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Header.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Header.tsx new file mode 100644 index 00000000000..c92de39cfba --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Header.tsx @@ -0,0 +1,40 @@ +/* + * 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 Workers from './Workers'; +import { translate } from '../../../helpers/l10n'; + +interface Props { + component?: any; +} + +export default function Header(props: Props) { + return ( +
+

{translate('background_tasks.page')}

+ {!props.component && ( +
+ +
+ )} +

{translate('background_tasks.page.description')}

+
+ ); +} 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 new file mode 100644 index 00000000000..c6e18f5c8a3 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/NoWorkersSupportPopup.tsx @@ -0,0 +1,44 @@ +/* + * SonarQube + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact 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 BubblePopup from '../../../components/common/BubblePopup'; +import { translate } from '../../../helpers/l10n'; + +interface Props { + popupPosition?: any; +} + +export default function NoWorkersSupportPopup(props: Props) { + return ( + +
+
{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.js b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.js deleted file mode 100644 index 670cca4450b..00000000000 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.js +++ /dev/null @@ -1,108 +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. - */ -// @flow -import React from 'react'; -import WorkersForm from './WorkersForm'; -import Tooltip from '../../../components/controls/Tooltip'; -import { getWorkers } from '../../../api/ce'; -import { translate } from '../../../helpers/l10n'; - -/*:: -type State = { - canSetWorkerCount: boolean, - formOpen: boolean, - loading: boolean, - workerCount: number -}; -*/ - -export default class Workers extends React.PureComponent { - /*:: mounted: boolean; */ - state /*: State */ = { - canSetWorkerCount: false, - formOpen: false, - loading: true, - workerCount: 1 - }; - - componentDidMount() { - this.mounted = true; - this.loadWorkers(); - } - - componentWillUnmount() { - this.mounted = false; - } - - loadWorkers = () => { - this.setState({ loading: true }); - getWorkers().then(({ canSetWorkerCount, value }) => { - if (this.mounted) { - this.setState({ - canSetWorkerCount, - loading: false, - workerCount: value - }); - } - }); - }; - - closeForm = (newWorkerCount /*: ?number */) => - newWorkerCount - ? this.setState({ formOpen: false, workerCount: newWorkerCount }) - : this.setState({ formOpen: false }); - - handleChangeClick = (event /*: Event */) => { - event.preventDefault(); - this.setState({ formOpen: true }); - }; - - render() { - const { canSetWorkerCount, formOpen, loading, workerCount } = this.state; - - return ( -
- {!loading && - workerCount > 1 && ( - - - - )} - - {translate('background_tasks.number_of_workers')} - - {loading ? ( - - ) : ( - {workerCount} - )} - - {!loading && - canSetWorkerCount && ( - - - - )} - - {formOpen && } -
- ); - } -} 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 new file mode 100644 index 00000000000..9c51b4a9c10 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Workers.tsx @@ -0,0 +1,139 @@ +/* + * 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 WorkersForm from './WorkersForm'; +import NoWorkersSupportPopup from './NoWorkersSupportPopup'; +import Tooltip from '../../../components/controls/Tooltip'; +import { getWorkers } from '../../../api/ce'; +import { translate } from '../../../helpers/l10n'; +import HelpIcon from '../../../components/icons-components/HelpIcon'; +import BubblePopupHelper from '../../../components/common/BubblePopupHelper'; + +interface State { + canSetWorkerCount: boolean; + formOpen: boolean; + loading: boolean; + noSupportPopup: boolean; + workerCount: number; +} + +export default class Workers extends React.PureComponent<{}, State> { + mounted: boolean; + state: State = { + canSetWorkerCount: false, + formOpen: false, + loading: true, + noSupportPopup: false, + workerCount: 1 + }; + + componentDidMount() { + this.mounted = true; + this.loadWorkers(); + } + + componentWillUnmount() { + this.mounted = false; + } + + loadWorkers = () => { + this.setState({ loading: true }); + getWorkers().then(({ canSetWorkerCount, value }) => { + if (this.mounted) { + this.setState({ + canSetWorkerCount, + loading: false, + workerCount: value + }); + } + }); + }; + + closeForm = (newWorkerCount?: number) => + newWorkerCount + ? this.setState({ formOpen: false, workerCount: newWorkerCount }) + : this.setState({ formOpen: false }); + + handleChangeClick = (event: React.SyntheticEvent) => { + event.preventDefault(); + this.setState({ formOpen: true }); + }; + + handleHelpClick = (event: React.SyntheticEvent) => { + event.preventDefault(); + event.stopPropagation(); + this.toggleNoSupportPopup(); + }; + + toggleNoSupportPopup = (show?: boolean) => { + if (show != undefined) { + this.setState({ noSupportPopup: show }); + } else { + this.setState(state => ({ noSupportPopup: !state.noSupportPopup })); + } + }; + + render() { + const { canSetWorkerCount, formOpen, loading, workerCount } = this.state; + + return ( +
+ {!loading && + workerCount > 1 && ( + + + + )} + + {translate('background_tasks.number_of_workers')} + + {loading ? ( + + ) : ( + {workerCount} + )} + + {!loading && + canSetWorkerCount && ( + + + + )} + + {!loading && + !canSetWorkerCount && ( + + + + + } + togglePopup={this.toggleNoSupportPopup} + /> + + )} + + {formOpen && } +
+ ); + } +} diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.js b/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.js deleted file mode 100644 index ded18f7c6c8..00000000000 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/WorkersForm.js +++ /dev/null @@ -1,130 +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. - */ -// @flow -import React from 'react'; -import Modal from 'react-modal'; -import Select from 'react-select'; -import { times } from 'lodash'; -import { setWorkerCount } from '../../../api/ce'; -import { translate } from '../../../helpers/l10n'; - -const MAX_WORKERS = 10; - -/*:: -type Props = { - onClose: (newWorkerCount?: number) => void, - workerCount: number -}; -*/ - -/*:: -type State = { - newWorkerCount: number, - submitting: boolean -}; -*/ - -export default class WorkersForm extends React.PureComponent { - /*:: mounted: boolean; */ - /*:: props: Props; */ - /*:: state: State; */ - - constructor(props /*: Props */) { - super(props); - this.state = { - newWorkerCount: props.workerCount, - submitting: false - }; - } - - componentDidMount() { - this.mounted = true; - } - - componentWillUnmount() { - this.mounted = false; - } - - handleClose = () => this.props.onClose(); - - handleWorkerCountChange = (option /*: { value: number } */) => - this.setState({ newWorkerCount: option.value }); - - handleSubmit = (event /*: Event */) => { - event.preventDefault(); - this.setState({ submitting: true }); - const { newWorkerCount } = this.state; - setWorkerCount(newWorkerCount).then( - () => { - if (this.mounted) { - this.props.onClose(newWorkerCount); - } - }, - () => { - if (this.mounted) { - this.setState({ submitting: false }); - } - } - ); - }; - - render() { - const options = times(MAX_WORKERS).map((_, i) => ({ label: i + 1, value: i + 1 })); - - return ( - -
-

{translate('background_tasks.change_number_of_workers')}

-
-
-
- +
+ {translate('background_tasks.change_number_of_workers.hint')} +
+
+
+
+ {this.state.submitting && } + + +
+
+ +
+ ); + } +} diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.js b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.js deleted file mode 100644 index 5ad06439c4a..00000000000 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.js +++ /dev/null @@ -1,72 +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. - */ -// @flow -import React from 'react'; -import { shallow } from 'enzyme'; -import Workers from '../Workers'; -import { click } from '../../../../helpers/testUtils'; - -it('renders', () => { - const wrapper = shallow(); - expect(wrapper).toMatchSnapshot(); - - wrapper.setState({ - canSetWorkerCount: true, - loading: false, - workerCount: 1 - }); - expect(wrapper).toMatchSnapshot(); - - wrapper.setState({ canSetWorkerCount: false }); - expect(wrapper).toMatchSnapshot(); - - wrapper.setState({ workerCount: 2 }); - expect(wrapper).toMatchSnapshot(); -}); - -it('opens form', () => { - const wrapper = shallow(); - - wrapper.setState({ - canSetWorkerCount: true, - loading: false, - workerCount: 1 - }); - expect(wrapper).toMatchSnapshot(); - - click(wrapper.find('.icon-edit')); - expect(wrapper).toMatchSnapshot(); -}); - -it('updates worker count', () => { - const wrapper = shallow(); - - wrapper.setState({ - canSetWorkerCount: true, - formOpen: true, - loading: false, - workerCount: 1 - }); - expect(wrapper).toMatchSnapshot(); - - wrapper.find('WorkersForm').prop('onClose')(7); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); -}); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.tsx new file mode 100644 index 00000000000..953e79d282a --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/Workers-test.tsx @@ -0,0 +1,71 @@ +/* + * 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 { shallow } from 'enzyme'; +import Workers from '../Workers'; +import { click } from '../../../../helpers/testUtils'; + +it('renders', () => { + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + + wrapper.setState({ + canSetWorkerCount: true, + loading: false, + workerCount: 1 + }); + expect(wrapper).toMatchSnapshot(); + + wrapper.setState({ workerCount: 2 }); + expect(wrapper).toMatchSnapshot(); + + wrapper.setState({ canSetWorkerCount: false }); + expect(wrapper).toMatchSnapshot(); +}); + +it('opens form', () => { + const wrapper = shallow(); + + wrapper.setState({ + canSetWorkerCount: true, + loading: false, + workerCount: 1 + }); + expect(wrapper).toMatchSnapshot(); + + click(wrapper.find('.icon-edit')); + expect(wrapper).toMatchSnapshot(); +}); + +it('updates worker count', () => { + const wrapper = shallow(); + + wrapper.setState({ + canSetWorkerCount: true, + formOpen: true, + loading: false, + workerCount: 1 + }); + expect(wrapper).toMatchSnapshot(); + + wrapper.find('WorkersForm').prop('onClose')(7); + wrapper.update(); + expect(wrapper).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.js b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.js deleted file mode 100644 index f821ba6fb32..00000000000 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.js +++ /dev/null @@ -1,52 +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. - */ -// @flow -import React from 'react'; -import { shallow } from 'enzyme'; -import WorkersForm from '../WorkersForm'; -import { submit, doAsync } from '../../../../helpers/testUtils'; - -jest.mock('../../../../api/ce', () => ({ - setWorkerCount: () => Promise.resolve() -})); - -it('changes select', () => { - const wrapper = shallow(); - expect(wrapper).toMatchSnapshot(); - - wrapper.find('Select').prop('onChange')({ value: 7 }); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); -}); - -it('returns new worker count', () => { - const onClose = jest.fn(); - const wrapper = shallow(); - // $FlowFixMe - wrapper.instance().mounted = true; - wrapper.find('Select').prop('onChange')({ value: 7 }); - - wrapper.update(); - submit(wrapper.find('form')); - - return doAsync(() => { - expect(onClose).toBeCalled(); - }); -}); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.tsx new file mode 100644 index 00000000000..813eff21896 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/WorkersForm-test.tsx @@ -0,0 +1,49 @@ +/* + * 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. + */ +jest.mock('../../../../api/ce', () => ({ + setWorkerCount: () => Promise.resolve() +})); + +import * as React from 'react'; +import { shallow } from 'enzyme'; +import WorkersForm from '../WorkersForm'; +import { submit } from '../../../../helpers/testUtils'; + +it('changes select', () => { + const wrapper = shallow(); + expect(wrapper).toMatchSnapshot(); + + wrapper.find('Select').prop('onChange')({ value: 7 }); + wrapper.update(); + expect(wrapper).toMatchSnapshot(); +}); + +it('returns new worker count', async () => { + const onClose = jest.fn(); + const wrapper = shallow(); + (wrapper.instance() as WorkersForm).mounted = true; + wrapper.find('Select').prop('onChange')({ value: 7 }); + + wrapper.update(); + submit(wrapper.find('form')); + + await new Promise(setImmediate); + expect(onClose).toBeCalled(); +}); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Workers-test.js.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Workers-test.js.snap deleted file mode 100644 index 0a54eb44972..00000000000 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Workers-test.js.snap +++ /dev/null @@ -1,161 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`opens form 1`] = ` -
- background_tasks.number_of_workers - - 1 - - - - -
-`; - -exports[`opens form 2`] = ` - -`; - -exports[`renders 1`] = ` -
- background_tasks.number_of_workers - -
-`; - -exports[`renders 2`] = ` -
-`; - -exports[`renders 3`] = ` -
- background_tasks.number_of_workers - - 1 - -
-`; - -exports[`renders 4`] = ` -
- - - - background_tasks.number_of_workers - - 2 - -
-`; - -exports[`updates worker count 1`] = ` -
-`; - -exports[`updates worker count 2`] = ` - -`; 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 new file mode 100644 index 00000000000..d9d6b6fe2f2 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/Workers-test.tsx.snap @@ -0,0 +1,199 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`opens form 1`] = ` + +`; + +exports[`opens form 2`] = ` + +`; + +exports[`renders 1`] = ` +
+ background_tasks.number_of_workers + +
+`; + +exports[`renders 2`] = ` +
+`; + +exports[`renders 3`] = ` + +`; + +exports[`renders 4`] = ` +
+ + + + background_tasks.number_of_workers + + 2 + + + + + + } + position="bottomright" + togglePopup={[Function]} + /> + +
+`; + +exports[`updates worker count 1`] = ` +
+ background_tasks.number_of_workers + + 1 + + + + + +
+`; + +exports[`updates worker count 2`] = ` + +`; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.js.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.js.snap deleted file mode 100644 index 4bf13d5848f..00000000000 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.js.snap +++ /dev/null @@ -1,287 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`changes select 1`] = ` - -
-

- background_tasks.change_number_of_workers -

-
-
-
- -
- background_tasks.change_number_of_workers.hint -
-
-
-
- - -
-
-
-
-`; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.tsx.snap new file mode 100644 index 00000000000..8ff615ea5e0 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/__snapshots__/WorkersForm-test.tsx.snap @@ -0,0 +1,287 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`changes select 1`] = ` + +
+

+ background_tasks.change_number_of_workers +

+
+
+
+ +
+ background_tasks.change_number_of_workers.hint +
+
+ +
+
+`; diff --git a/server/sonar-web/src/main/less/components/bubble-popup.less b/server/sonar-web/src/main/less/components/bubble-popup.less index 25c7072b530..04dd6fb7d93 100644 --- a/server/sonar-web/src/main/less/components/bubble-popup.less +++ b/server/sonar-web/src/main/less/components/bubble-popup.less @@ -90,13 +90,11 @@ .bubble-popup-bottom-right { .bubble-popup-bottom; margin-left: 0; - margin-right: -@popupArrowSize; + margin-right: -16px; .bubble-popup-arrow { left: auto; right: 15px; - border-right-width: 0; - border-left-color: barBorderColor; } } 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 0e3f376dfb6..ecd566e2aa7 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -76,6 +76,7 @@ issues=Issues inheritance=Inheritance key=Key language=Language +learn_more=Learn More library=Library line_number=Line Number links=Links @@ -2211,7 +2212,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_with_governance=Add more with Governance +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 Governance product. Available in our commercial editions. 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 @@ -2580,7 +2582,6 @@ branches.set_leak_period=Set Leak Period branches.last_analysis_date=Last Analysis Date branches.no_support.header=Get the most out of SonarQube with branches analysis branches.no_support.header.text=Analyze each branch of your project separately with our Developer Pack. -branches.learn_more=Learn More branches.buy_developer_pack=Buy Developer Pack