From d3530ff0004d44a2c4e9140ff9cc7774b8bc38a4 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Fri, 10 Aug 2018 16:02:22 +0200 Subject: update main dependencies & fix autofixable eslint warnings (#601) --- .../src/main/js/app/components/AdminContainer.tsx | 7 +-- .../sonar-web/src/main/js/app/components/App.tsx | 5 +- .../main/js/app/components/ComponentContainer.tsx | 15 ++++-- .../main/js/app/components/GlobalFooterBranding.js | 3 +- .../js/app/components/GlobalMessagesContainer.js | 31 ----------- .../js/app/components/GlobalMessagesContainer.tsx | 34 ++++++++++++ .../src/main/js/app/components/MarkdownHelp.js | 32 ++++++++---- .../src/main/js/app/components/StartupModal.tsx | 11 ++-- .../embed-docs-modal/SuggestionsProvider.tsx | 2 +- .../__tests__/SuggestionsProvider-test.tsx | 6 +-- .../components/extensions/ExtensionContainer.tsx | 5 +- .../extensions/OrganizationPageExtension.tsx | 7 +-- .../extensions/ProjectAdminPageExtension.js | 5 +- .../components/nav/component/ComponentNavMenu.tsx | 60 +++++++++++----------- .../js/app/components/nav/global/GlobalNavMenu.tsx | 2 +- .../js/app/components/nav/global/GlobalNavPlus.tsx | 2 +- .../js/app/components/nav/settings/SettingsNav.tsx | 6 +-- .../js/app/components/search/SearchShowMore.js | 2 +- .../main/js/app/styles/components/boxed-group.css | 4 +- .../src/main/js/apps/about/components/AboutApp.js | 5 +- .../main/js/apps/about/components/AboutProjects.js | 2 +- .../main/js/apps/about/components/AboutScanners.js | 6 +-- .../js/apps/about/components/EntryIssueTypes.js | 12 ++--- .../main/js/apps/about/sonarcloud/AsAService.tsx | 4 +- .../js/apps/about/sonarcloud/BranchAnalysis.tsx | 7 +-- .../src/main/js/apps/about/sonarcloud/Footer.tsx | 9 ++-- .../src/main/js/apps/about/sonarcloud/Home.tsx | 8 +-- .../src/main/js/apps/about/sonarcloud/Pricing.tsx | 3 +- .../src/main/js/apps/about/sonarcloud/SQHome.tsx | 6 ++- .../apps/about/sonarcloud/SonarLintIntegration.tsx | 4 +- .../src/main/js/apps/account/components/Account.js | 2 +- .../src/main/js/apps/account/components/Nav.js | 10 ++-- .../main/js/apps/account/components/UserCard.js | 4 +- .../notifications/NotificationsContainer.tsx | 5 +- .../organizations/CreateOrganizationForm.tsx | 5 +- .../account/organizations/OrganizationCard.tsx | 2 +- .../account/organizations/UserOrganizations.tsx | 5 +- .../src/main/js/apps/account/profile/Profile.js | 4 +- .../apps/account/profile/UserExternalIdentity.js | 4 +- .../src/main/js/apps/account/profile/UserGroups.js | 2 +- .../js/apps/account/profile/UserScmAccounts.js | 2 +- .../__tests__/background-tasks-test.js | 10 ++-- .../components/BackgroundTasksApp.js | 5 +- .../background-tasks/components/ScannerContext.tsx | 2 +- .../background-tasks/components/Stacktrace.tsx | 2 +- .../components/__tests__/TaskDate-test.tsx | 4 +- .../components/__tests__/TaskDay-test.tsx | 4 +- .../src/main/js/apps/code/components/App.tsx | 2 +- .../src/main/js/apps/code/components/Search.tsx | 2 +- .../main/js/apps/coding-rules/components/App.tsx | 8 +-- .../components/CustomRuleFormModal.tsx | 11 ++-- .../apps/coding-rules/components/RuleDetails.tsx | 9 +++- .../component-measures/components/AppContainer.js | 5 +- .../component-measures/components/Breadcrumbs.js | 4 +- .../components/MeasureContent.js | 4 +- .../components/MeasureContentContainer.js | 2 +- .../components/MeasureFavoriteContainer.js | 5 +- .../components/MeasureViewSelect.js | 4 +- .../components/__tests__/Breadcrumb-test.js | 4 +- .../components/__tests__/MeasureViewSelect-test.js | 2 +- .../component-measures/drilldown/MeasureCell.js | 2 +- .../component-measures/drilldown/TreeMapView.js | 2 +- .../sidebar/FacetMeasureValue.js | 10 ++-- .../sonar-web/src/main/js/apps/explore/Explore.tsx | 8 +-- .../src/main/js/apps/groups/components/List.tsx | 2 +- .../__snapshots__/EditMembers-test.tsx.snap | 8 +-- .../sonar-web/src/main/js/apps/issues/actions.ts | 28 +++++----- .../js/apps/issues/components/AppContainer.tsx | 7 +-- .../issues/conciseIssuesList/ConciseIssueBox.tsx | 4 +- .../marketplace/components/PluginAvailable.tsx | 2 +- .../marketplace/components/PluginInstalled.tsx | 2 +- .../marketplace/components/PluginUpdateItem.tsx | 2 +- .../src/main/js/apps/marketplace/utils.ts | 21 ++++---- .../components/OrganizationDelete.tsx | 7 +-- .../organizations/components/OrganizationEdit.tsx | 5 +- .../components/OrganizationMembersContainer.tsx | 11 ++-- .../organizations/components/OrganizationPage.tsx | 7 +-- .../src/main/js/apps/overview/events/Analysis.tsx | 4 +- .../src/main/js/apps/overview/meta/MetaKey.tsx | 2 +- .../src/main/js/apps/overview/meta/MetaLinks.tsx | 4 +- .../js/apps/overview/meta/MetaOrganizationKey.tsx | 2 +- .../src/main/js/apps/overview/meta/MetaSize.tsx | 2 +- .../qualityGate/ApplicationQualityGate.tsx | 16 +++--- .../overview/qualityGate/QualityGateCondition.js | 6 +-- .../js/apps/permission-templates/components/App.js | 6 +-- .../apps/permission-templates/components/Home.js | 4 +- .../apps/permission-templates/components/List.js | 4 +- .../permission-templates/components/ListItem.js | 2 +- .../permission-templates/components/NameCell.js | 2 +- .../components/TemplateDetails.js | 2 +- .../components/TemplateHeader.js | 8 +-- .../components/__tests__/Defaults-test.js | 4 +- .../js/apps/permissions/project/components/App.js | 2 +- .../permissions/project/components/AppContainer.js | 5 +- .../src/main/js/apps/portfolio/components/App.tsx | 7 +-- .../js/apps/portfolio/components/MainRating.tsx | 2 +- .../apps/portfolio/components/ReleasabilityBox.tsx | 4 +- .../main/js/apps/portfolio/components/Report.tsx | 4 +- .../js/apps/portfolio/components/WorstProjects.tsx | 12 ++--- .../main/js/apps/project-admin/key/BulkUpdate.js | 17 +++--- .../src/main/js/apps/project-admin/key/Key.js | 17 +++--- .../src/main/js/apps/project-admin/links/Links.js | 13 +++-- .../projectActivity/components/GraphHistory.js | 6 +-- .../projectActivity/components/GraphsHistory.js | 2 +- .../components/GraphsLegendCustom.js | 2 +- .../components/GraphsTooltipsContent.js | 2 +- .../components/GraphsTooltipsContentCoverage.js | 8 +-- .../components/GraphsTooltipsContentDuplication.js | 4 +- .../components/GraphsTooltipsContentEvents.js | 2 +- .../components/GraphsTooltipsContentIssues.js | 2 +- .../apps/projectActivity/components/GraphsZoom.js | 2 +- .../components/ProjectActivityAnalysesList.js | 10 ++-- .../components/ProjectActivityApp.js | 6 +-- .../components/ProjectActivityPageFooter.js | 2 +- .../components/ProjectActivityPageHeader.js | 10 ++-- .../components/__tests__/GraphsLegendItem-test.tsx | 2 +- .../__tests__/ProjectActivityDateInput-test.js | 2 +- .../components/LongBranchesPattern.tsx | 2 +- .../main/js/apps/projectQualityProfiles/App.tsx | 2 +- .../js/apps/projectQualityProfiles/ProfileRow.tsx | 2 +- .../main/js/apps/projectQualityProfiles/Table.tsx | 4 +- .../components/FavoriteFilterContainer.tsx | 9 +++- .../__tests__/PerspectiveSelect-test.tsx | 2 +- .../js/apps/projects/create/CreateProjectPage.tsx | 29 ++++++----- .../apps/projects/create/ManualProjectCreate.tsx | 7 +-- .../src/main/js/apps/projects/create/utils.ts | 23 +++++---- .../js/apps/projects/filters/CoverageFilter.tsx | 20 ++++---- .../apps/projects/filters/DuplicationsFilter.tsx | 20 ++++---- .../src/main/js/apps/projects/filters/Filter.tsx | 2 +- .../main/js/apps/projects/filters/IssuesFilter.tsx | 22 ++++---- .../js/apps/projects/filters/LanguagesFilter.tsx | 24 ++++----- .../js/apps/projects/filters/NewCoverageFilter.tsx | 2 +- .../projects/filters/NewDuplicationsFilter.tsx | 2 +- .../js/apps/projects/filters/NewLinesFilter.tsx | 14 ++--- .../js/apps/projects/filters/QualityGateFilter.tsx | 12 ++--- .../main/js/apps/projects/filters/SizeFilter.tsx | 16 +++--- .../main/js/apps/projects/filters/TagsFilter.tsx | 24 ++++----- .../__tests__/SearchableFilterFooter-test.tsx | 4 +- .../projects/filters/__tests__/TagsFilter-test.tsx | 6 +-- .../sonar-web/src/main/js/apps/projects/utils.ts | 2 +- .../js/apps/projectsManagement/AppContainer.tsx | 5 +- .../apps/quality-gates/components/DetailsApp.tsx | 8 +-- .../apps/quality-profiles/changelog/Changelog.tsx | 2 +- .../compare/ComparisonContainer.tsx | 8 +-- .../quality-profiles/compare/ComparisonForm.tsx | 8 +-- .../quality-profiles/compare/ComparisonResults.tsx | 10 ++-- .../compare/__tests__/ComparisonForm-test.tsx | 4 +- .../compare/__tests__/ComparisonResults-test.tsx | 8 +-- .../quality-profiles/components/AppContainer.tsx | 5 +- .../components/ProfileNotFound.tsx | 2 +- .../sessions/components/EmailAlreadyExists.tsx | 6 +-- .../js/apps/sessions/components/LoginContainer.tsx | 7 +-- .../main/js/apps/sessions/components/Logout.tsx | 5 +- .../js/apps/sessions/components/UpdateLogin.tsx | 6 +-- .../src/main/js/apps/settings/components/App.js | 6 +-- .../js/apps/settings/components/AppContainer.js | 5 +- .../js/apps/settings/components/CategoriesList.js | 6 ++- .../settings/components/CategoryDefinitionsList.js | 5 +- .../main/js/apps/settings/components/Definition.js | 19 ++++--- .../settings/components/inputs/InputForBoolean.js | 2 +- .../components/inputs/InputForSingleSelectList.js | 6 +-- .../settings/components/inputs/InputForText.js | 4 +- .../settings/components/inputs/MultiValueInput.js | 4 +- .../settings/components/inputs/PrimitiveInput.js | 10 ++-- .../settings/components/inputs/PropertySetInput.js | 2 +- .../apps/settings/components/inputs/SimpleInput.js | 6 +-- .../components/inputs/__tests__/Input-test.js | 6 +-- .../inputs/__tests__/InputForBoolean-test.js | 6 +-- .../inputs/__tests__/InputForNumber-test.js | 2 +- .../__tests__/InputForSingleSelectList-test.js | 12 ++--- .../inputs/__tests__/InputForString-test.js | 2 +- .../inputs/__tests__/InputForText-test.js | 4 +- .../inputs/__tests__/MultiValueInput-test.js | 10 ++-- .../inputs/__tests__/SimpleInput-test.js | 12 ++--- .../js/apps/settings/encryption/EncryptionApp.js | 4 +- .../settings/encryption/EncryptionAppContainer.js | 15 +++--- .../js/apps/system/components/ClusterSysInfos.tsx | 4 +- .../main/js/apps/system/components/PageHeader.tsx | 2 +- .../components/__tests__/PageHeader-test.tsx | 4 +- .../system/components/info-items/HealthCard.tsx | 2 +- .../system/components/info-items/HealthItem.tsx | 2 +- .../info-items/__tests__/HealthItem-test.tsx | 2 +- .../info-items/__tests__/Section-test.tsx | 2 +- .../__snapshots__/SysInfoItem-test.tsx.snap | 2 +- .../system-upgrade/SystemUpgradeForm.tsx | 2 +- .../__tests__/SystemUpgradeItem-test.tsx | 2 +- server/sonar-web/src/main/js/apps/system/utils.ts | 17 +++--- .../apps/tutorials/onboarding/OnboardingPage.tsx | 5 +- .../projectOnboarding/ProjectOnboardingPage.tsx | 5 +- server/sonar-web/src/main/js/apps/users/Search.tsx | 2 +- .../sonar-web/src/main/js/apps/users/UsersApp.tsx | 6 +-- .../sonar-web/src/main/js/apps/users/UsersList.tsx | 2 +- .../main/js/apps/users/components/UserGroups.tsx | 4 +- .../main/js/apps/users/components/UserListItem.tsx | 4 +- .../apps/users/components/UserListItemIdentity.tsx | 4 +- .../js/apps/users/components/UserScmAccounts.tsx | 4 +- .../js/apps/users/components/UsersSelectSearch.tsx | 16 +++--- .../__tests__/UsersSelectSearch-test.tsx | 6 +-- server/sonar-web/src/main/js/apps/users/utils.ts | 17 +++--- .../src/main/js/apps/web-api/components/Action.tsx | 12 +++-- .../js/apps/web-api/components/ActionChangelog.tsx | 2 +- .../src/main/js/apps/web-api/components/Params.tsx | 2 +- server/sonar-web/src/main/js/apps/web-api/utils.ts | 25 +++++---- .../js/apps/webhooks/components/DeliveriesForm.tsx | 4 +- .../js/components/SourceViewer/SourceViewer.tsx | 7 +-- .../components/SourceViewer/SourceViewerBase.tsx | 22 ++++---- .../SourceViewer/components/CoveragePopup.tsx | 5 +- .../main/js/components/charts/AdvancedTimeline.js | 4 +- .../main/js/components/charts/ColorBoxLegend.tsx | 2 +- .../src/main/js/components/charts/Histogram.tsx | 12 ++--- .../js/components/charts/LanguageDistribution.tsx | 2 +- .../src/main/js/components/charts/ZoomTimeLine.js | 38 +++++++------- .../components/charts/__tests__/Histogram-test.tsx | 6 +-- .../src/main/js/components/common/MarkdownTips.tsx | 6 ++- .../js/components/common/OrganizationAvatar.tsx | 2 +- .../main/js/components/common/SelectListItem.js | 6 +-- .../common/__tests__/CodeSnippet-test.tsx | 4 +- .../components/common/__tests__/SelectList-test.js | 16 +++--- .../js/components/controls/FavoriteContainer.ts | 5 +- .../main/js/components/controls/HomePageSelect.tsx | 5 +- .../main/js/components/controls/RadioToggle.tsx | 8 +-- .../main/js/components/controls/ReloadButton.tsx | 4 +- .../js/components/controls/ScreenPositionFixer.tsx | 38 +++++++------- .../src/main/js/components/controls/Tooltip.tsx | 2 +- .../controls/__tests__/FavoriteBase-test.tsx | 2 +- .../controls/__tests__/RadioToggle-test.tsx | 2 +- .../__tests__/ScreenPositionFixer-test.tsx | 10 ++-- .../controls/__tests__/ValidationModal-test.tsx | 6 +-- .../js/components/docs/DocCollapsibleBlock.tsx | 2 +- .../DocCollapsibleBlock-test.tsx.snap | 4 +- .../components/icons-components/DropdownIcon.tsx | 2 +- .../main/js/components/icons-components/Icon.tsx | 2 +- .../components/__tests__/IssueMessage-test.js | 2 +- .../components/__tests__/IssueTitleBar-test.js | 4 +- .../js/components/issue/popups/ChangelogPopup.js | 4 +- .../js/components/preview-graph/PreviewGraph.js | 8 +-- .../main/js/components/shared/DrilldownLink.tsx | 2 +- .../src/main/js/components/workspace/Workspace.tsx | 14 ++--- server/sonar-web/src/main/js/helpers/cookies.ts | 20 ++++---- .../src/main/js/store/marketplace/actions.ts | 2 +- .../src/main/js/store/utils/configureStore.js | 5 +- .../src/main/js/store/withCurrentUser.tsx | 35 ------------- 242 files changed, 938 insertions(+), 805 deletions(-) delete mode 100644 server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.js create mode 100644 server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx delete mode 100644 server/sonar-web/src/main/js/store/withCurrentUser.tsx (limited to 'server/sonar-web/src') diff --git a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx index c6440c317e0..4a14a53d0d7 100644 --- a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx @@ -104,6 +104,7 @@ const mapDispatchToProps: DispatchToProps = { setAdminPages }; -export default connect(mapStateToProps, mapDispatchToProps)( - AdminContainer -); +export default connect( + mapStateToProps, + mapDispatchToProps +)(AdminContainer); diff --git a/server/sonar-web/src/main/js/app/components/App.tsx b/server/sonar-web/src/main/js/app/components/App.tsx index dca11f0b8eb..23211fbae33 100644 --- a/server/sonar-web/src/main/js/app/components/App.tsx +++ b/server/sonar-web/src/main/js/app/components/App.tsx @@ -100,4 +100,7 @@ const mapDispatchToProps = ({ fetchMyOrganizations } as any) as DispatchProps; -export default connect(mapStateToProps, mapDispatchToProps)(App); +export default connect( + mapStateToProps, + mapDispatchToProps +)(App); diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx index 176a21d06ac..00e376c5dfc 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -244,9 +244,15 @@ export class ComponentContainer extends React.PureComponent { return !task.branch && !task.pullRequest; }; - handleComponentChange = (changes: {}) => { + handleComponentChange = (changes: Partial) => { if (this.mounted) { - this.setState(state => ({ component: { ...state.component, ...changes } })); + this.setState(state => { + if (state.component) { + const newComponent: Component = { ...state.component, ...changes }; + return { component: newComponent }; + } + return null; + }); } }; @@ -309,4 +315,7 @@ export class ComponentContainer extends React.PureComponent { const mapDispatchToProps = { fetchOrganizations }; -export default connect(null, mapDispatchToProps)(ComponentContainer); +export default connect( + null, + mapDispatchToProps +)(ComponentContainer); diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooterBranding.js b/server/sonar-web/src/main/js/app/components/GlobalFooterBranding.js index 8ce14f4c343..8f1f47e880d 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalFooterBranding.js +++ b/server/sonar-web/src/main/js/app/components/GlobalFooterBranding.js @@ -30,7 +30,8 @@ export default function GlobalFooterBranding() { but is not an official version provided by{' '} SonarSource SA - . + + . ); } diff --git a/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.js b/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.js deleted file mode 100644 index f159a481b7b..00000000000 --- a/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.js +++ /dev/null @@ -1,31 +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 { connect } from 'react-redux'; -import GlobalMessages from '../../components/controls/GlobalMessages'; -import { getGlobalMessages } from '../../store/rootReducer'; -import { closeGlobalMessage } from '../../store/globalMessages/duck'; - -const mapStateToProps = state => ({ - messages: getGlobalMessages(state) -}); - -const mapDispatchToProps = { closeGlobalMessage }; - -export default connect(mapStateToProps, mapDispatchToProps)(GlobalMessages); diff --git a/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx b/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx new file mode 100644 index 00000000000..d8366702bc8 --- /dev/null +++ b/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx @@ -0,0 +1,34 @@ +/* + * 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 { connect } from 'react-redux'; +import GlobalMessages from '../../components/controls/GlobalMessages'; +import { getGlobalMessages } from '../../store/rootReducer'; +import { closeGlobalMessage } from '../../store/globalMessages/duck'; + +const mapStateToProps = (state: any) => ({ + messages: getGlobalMessages(state) +}); + +const mapDispatchToProps = { closeGlobalMessage }; + +export default connect( + mapStateToProps, + mapDispatchToProps +)(GlobalMessages); diff --git a/server/sonar-web/src/main/js/app/components/MarkdownHelp.js b/server/sonar-web/src/main/js/app/components/MarkdownHelp.js index 1a2c67397c7..f4b957da4f0 100644 --- a/server/sonar-web/src/main/js/app/components/MarkdownHelp.js +++ b/server/sonar-web/src/main/js/app/components/MarkdownHelp.js @@ -54,8 +54,8 @@ export default function MarkdownHelp() { - * first item
- * second item + * first item +
* second item
    @@ -66,7 +66,8 @@ export default function MarkdownHelp() { - 1. first item
    + 1. first item +
    1. second item @@ -102,11 +103,15 @@ export default function MarkdownHelp() { - ``
    - // code on multiple lines
    + `` + {/* eslint-disable-next-line react/jsx-no-comment-textnodes */} +
    + // code on multiple lines +
    {'public void foo() {'}
    -   {'// do some logic here'} +    + {'// do some logic here'}
    {'}'}
    @@ -120,15 +125,20 @@ export default function MarkdownHelp() { - Standard text
    - > Blockquoted text
    - > that spans multiple lines
    + Standard text +
    + > Blockquoted text +
    + > that spans multiple lines +

    Standard text

    - Blockquoted text
    - that spans multiple lines
    + Blockquoted text +
    + that spans multiple lines +
    diff --git a/server/sonar-web/src/main/js/app/components/StartupModal.tsx b/server/sonar-web/src/main/js/app/components/StartupModal.tsx index 7930a9b7f21..9383ec2539e 100644 --- a/server/sonar-web/src/main/js/app/components/StartupModal.tsx +++ b/server/sonar-web/src/main/js/app/components/StartupModal.tsx @@ -106,7 +106,7 @@ export class StartupModal extends React.PureComponent { this.props.skipOnboardingAction(); return { automatic: false, modal: undefined }; } - return undefined; + return null; }); }; @@ -115,7 +115,7 @@ export class StartupModal extends React.PureComponent { if (state.modal === ModalKey.license) { return { automatic: false, modal: undefined }; } - return undefined; + return null; }); }; @@ -223,6 +223,7 @@ const mapStateToProps = (state: any): StateProps => ({ const mapDispatchToProps: DispatchProps = { skipOnboardingAction }; -export default connect(mapStateToProps, mapDispatchToProps)( - StartupModal -); +export default connect( + mapStateToProps, + mapDispatchToProps +)(StartupModal); diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx b/server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx index 21cf0bd5bed..909c6a5d1d4 100644 --- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx +++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/SuggestionsProvider.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import * as PropTypes from 'prop-types'; // eslint-disable-next-line import/no-extraneous-dependencies -import suggestionsJson from 'Docs/EmbedDocsSuggestions.json'; +import * as suggestionsJson from 'Docs/EmbedDocsSuggestions.json'; import { SuggestionsContext } from './SuggestionsContext'; import { isSonarCloud } from '../../../helpers/system'; diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/SuggestionsProvider-test.tsx b/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/SuggestionsProvider-test.tsx index c7ca9442a89..2092c80a14d 100644 --- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/SuggestionsProvider-test.tsx +++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/SuggestionsProvider-test.tsx @@ -25,10 +25,8 @@ import { isSonarCloud } from '../../../../helpers/system'; jest.mock( 'Docs/EmbedDocsSuggestions.json', () => ({ - default: { - pageA: [{ link: '/foo', text: 'Foo' }, { link: '/bar', text: 'Bar', scope: 'sonarcloud' }], - pageB: [{ link: '/qux', text: 'Qux' }] - } + pageA: [{ link: '/foo', text: 'Foo' }, { link: '/bar', text: 'Bar', scope: 'sonarcloud' }], + pageB: [{ link: '/qux', text: 'Qux' }] }), { virtual: true } ); diff --git a/server/sonar-web/src/main/js/app/components/extensions/ExtensionContainer.tsx b/server/sonar-web/src/main/js/app/components/extensions/ExtensionContainer.tsx index e24cb825b9b..c3c56057669 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/ExtensionContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/ExtensionContainer.tsx @@ -28,4 +28,7 @@ const mapStateToProps = (state: any) => ({ const mapDispatchToProps = { onFail: addGlobalErrorMessage }; -export default connect(mapStateToProps, mapDispatchToProps)(Extension); +export default connect( + mapStateToProps, + mapDispatchToProps +)(Extension); diff --git a/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.tsx b/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.tsx index d5875a4f851..c38e996c2a3 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.tsx @@ -80,6 +80,7 @@ const mapStateToProps = (state: any, ownProps: OwnProps) => ({ const mapDispatchToProps = { fetchOrganization }; -export default connect(mapStateToProps, mapDispatchToProps)( - OrganizationPageExtension -); +export default connect( + mapStateToProps, + mapDispatchToProps +)(OrganizationPageExtension); diff --git a/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.js b/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.js index 1c584fc30ee..45c7a677a18 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.js +++ b/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.js @@ -54,4 +54,7 @@ function ProjectAdminPageExtension(props /*: Props */) { const mapDispatchToProps = { onFail: addGlobalErrorMessage }; -export default connect(null, mapDispatchToProps)(ProjectAdminPageExtension); +export default connect( + null, + mapDispatchToProps +)(ProjectAdminPageExtension); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx index 1accbd77863..31983bc3913 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx @@ -109,7 +109,7 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • - + {this.isPortfolio() || this.isApplication() ? translate('view_projects.page') : translate('code.page')} @@ -128,8 +128,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project/activity', query: this.getQuery() }}> {translate('project_activity.page')}
  • @@ -161,8 +161,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/component_measures', query: this.getQuery() }}> {translate('layout.measures')}
  • @@ -206,7 +206,7 @@ export default class ComponentNavMenu extends React.PureComponent { {({ onToggleClick, open }) => ( { tagName="li"> {({ onToggleClick, open }) => ( { return (
  • + activeClassName="active" + to={{ pathname: '/project/settings', query: this.getQuery() }}> {translate('project_settings.page')}
  • @@ -298,8 +298,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project/branches', query: { id: this.props.component.key } }}> {translate('project_branches.page')}
  • @@ -313,8 +313,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project/quality_profiles', query: { id: this.props.component.key } }}> {translate('project_quality_profiles.page')}
  • @@ -328,8 +328,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project/quality_gate', query: { id: this.props.component.key } }}> {translate('project_quality_gate.page')}
  • @@ -343,8 +343,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/custom_measures', query: { id: this.props.component.key } }}> {translate('custom_measures.page')}
  • @@ -358,8 +358,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project/links', query: { id: this.props.component.key } }}> {translate('project_links.page')}
  • @@ -373,8 +373,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project_roles', query: { id: this.props.component.key } }}> {translate('permissions.page')}
  • @@ -388,8 +388,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project/background_tasks', query: { id: this.props.component.key } }}> {translate('background_tasks.page')}
  • @@ -403,8 +403,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project/key', query: { id: this.props.component.key } }}> {translate('update_key.page')}
  • @@ -418,8 +418,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project/webhooks', query: { id: this.props.component.key } }}> {translate('webhooks.page')}
  • @@ -440,8 +440,8 @@ export default class ComponentNavMenu extends React.PureComponent { return (
  • + activeClassName="active" + to={{ pathname: '/project/deletion', query: { id: this.props.component.key } }}> {translate('deletion.page')}
  • @@ -481,7 +481,7 @@ export default class ComponentNavMenu extends React.PureComponent { tagName="li"> {({ onToggleClick, open }) => (
    { tagName="li"> {({ onToggleClick, open }) => ( { {({ onToggleClick, open }) => ( <> { tagName="li"> {({ onToggleClick, open }) => ( { tagName="li"> {({ onToggleClick, open }) => ( { tagName="li"> {({ onToggleClick, open }) => ( +
  • li { diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutApp.js b/server/sonar-web/src/main/js/apps/about/components/AboutApp.js index 5221f845d5d..c1d319015f1 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutApp.js +++ b/server/sonar-web/src/main/js/apps/about/components/AboutApp.js @@ -219,4 +219,7 @@ const mapStateToProps = state => ({ const mapDispatchToProps = { fetchAboutPageSettings }; -export default connect(mapStateToProps, mapDispatchToProps)(AboutApp); +export default connect( + mapStateToProps, + mapDispatchToProps +)(AboutApp); diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutProjects.js b/server/sonar-web/src/main/js/apps/about/components/AboutProjects.js index 2d3a26dd89b..ded5a77736f 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutProjects.js +++ b/server/sonar-web/src/main/js/apps/about/components/AboutProjects.js @@ -37,7 +37,7 @@ export default function AboutProjects({ count, loading } /*: Props */) { {!loading && (
    - + {formatMeasure(count, 'INT')}
    diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutScanners.js b/server/sonar-web/src/main/js/apps/about/components/AboutScanners.js index 9d79e0c4b0f..42ad663a7ad 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutScanners.js +++ b/server/sonar-web/src/main/js/apps/about/components/AboutScanners.js @@ -55,11 +55,11 @@ export default function AboutScanners() {

    {translate('about_page.scanners.text')}

    {scanners.map(scanner => ( - + {translate('about_page.scanners', ))} diff --git a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.js b/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.js index 31e5fb7a3c4..499df6ce3a2 100644 --- a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.js +++ b/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypes.js @@ -48,8 +48,8 @@ export default function EntryIssueTypes( + className="about-page-issue-type-link" + to={getIssuesUrl({ resolved: 'false', types: 'BUG', s: 'CREATION_DATE' })}> {formatMeasure(bugs, 'SHORT_INT')} @@ -63,12 +63,12 @@ export default function EntryIssueTypes( + })}> {formatMeasure(vulnerabilities, 'SHORT_INT')} @@ -82,8 +82,8 @@ export default function EntryIssueTypes( + className="about-page-issue-type-link" + to={getIssuesUrl({ resolved: 'false', types: 'CODE_SMELL', s: 'CREATION_DATE' })}> {formatMeasure(codeSmells, 'SHORT_INT')} diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx index 8c4938558db..fad4823c0e1 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx @@ -36,8 +36,8 @@ export default function AsAService() {

    As a Service

    - We fully operate the SonarQube base service,
    which is hosted in Frankfurt, - Germany. + We fully operate the SonarQube base service,
    + which is hosted in Frankfurt, Germany.

    - Branch analysis &
    pull request decoration + Branch analysis &
    + pull request decoration

    - SonarCloud comes with a built-in feature to automatically analyze
    project - branches and pull requests as soon as they get created. + SonarCloud comes with a built-in feature to automatically analyze
    + project branches and pull requests as soon as they get created.

    diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx index 01efb8943f4..5dd6848f767 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx @@ -137,14 +137,16 @@ export default function Footer() { rel="noopener noreferrer" target="_blank"> SonarSource SA - . All rights reserved. SonarCloud is a service operated by{' '} + + . All rights reserved. SonarCloud is a service operated by{' '} SonarSource - , the company that develops and promotes open source{' '} + + , the company that develops and promotes open source{' '} SonarLint - . + + .
    diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx index 629a1730dba..21f62fb4f5d 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx @@ -33,8 +33,8 @@ export default function Home() {

    Continuous Code Quality Online

    - Analyze the quality of your source code to detect bugs, vulnerabilities
    and code - smells throughout the development process. + Analyze the quality of your source code to detect bugs, vulnerabilities
    + and code smells throughout the development process.

      @@ -91,8 +91,8 @@ export default function Home() {

      Explore open source projects on SonarCloud

      - SonarCloud offers free analysis for open source projects.
      It is public and open - to anyone who wants to browse the service. + SonarCloud offers free analysis for open source projects.
      + It is public and open to anyone who wants to browse the service.

      diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx index 3943b5eced5..8340323d357 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx @@ -33,7 +33,8 @@ export default function Pricing() {

      Private Projects

      14 days free trial - From 10€/mo + From 10€ + /mo see prices diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx index 7d9067e3a0d..1b0bfe98092 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx @@ -52,12 +52,14 @@ function Jumbotron() {

      - Use SonarQube
      + Use SonarQube +
      as a Service

      {'—'} -
      Log in or sign up with +
      + Log in or sign up with
      SonarLint {' '} - to provide developers maximum insight
      in their IDEs on code quality and make - sure they do not introduce new issues. + to provide developers maximum insight
      + in their IDEs on code quality and make sure they do not introduce new issues.

      -
      diff --git a/server/sonar-web/src/main/js/apps/account/components/Nav.js b/server/sonar-web/src/main/js/apps/account/components/Nav.js index d08adb2e20b..8688985c311 100644 --- a/server/sonar-web/src/main/js/apps/account/components/Nav.js +++ b/server/sonar-web/src/main/js/apps/account/components/Nav.js @@ -34,30 +34,30 @@ export default function Nav({ customOrganizations } /*: Props */) {
      diff --git a/server/sonar-web/src/main/js/apps/account/profile/UserGroups.js b/server/sonar-web/src/main/js/apps/account/profile/UserGroups.js index c4816fb66cd..f81ba233119 100644 --- a/server/sonar-web/src/main/js/apps/account/profile/UserGroups.js +++ b/server/sonar-web/src/main/js/apps/account/profile/UserGroups.js @@ -34,7 +34,7 @@ export default class UserGroups extends React.PureComponent {

      {translate('my_profile.groups')}

        {groups.map(group => ( -
      • +
      • {group}
      • ))} diff --git a/server/sonar-web/src/main/js/apps/account/profile/UserScmAccounts.js b/server/sonar-web/src/main/js/apps/account/profile/UserScmAccounts.js index 324af5716a4..a306959eade 100644 --- a/server/sonar-web/src/main/js/apps/account/profile/UserScmAccounts.js +++ b/server/sonar-web/src/main/js/apps/account/profile/UserScmAccounts.js @@ -45,7 +45,7 @@ export default class UserScmAccounts extends React.PureComponent { )} {scmAccounts.map(scmAccount => ( -
      • +
      • {scmAccount}
      • ))} diff --git a/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js b/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js index 2e10882d6b8..f4f686fd287 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js @@ -81,21 +81,21 @@ describe('Stats', () => { describe('Pending', () => { it('should show zero pending', () => { const result = shallow( - + ); expect(result.find('.js-pending-count').text()).toContain('0'); }); it('should show 5 pending', () => { const result = shallow( - + ); expect(result.find('.js-pending-count').text()).toContain('5'); }); it('should not show cancel pending button', () => { const result = shallow( - + ); expect(result.find('.js-cancel-pending').length).toBe(0); }); @@ -104,9 +104,9 @@ describe('Stats', () => { const result = shallow( ); expect(result.find('.js-cancel-pending').length).toBe(1); @@ -117,9 +117,9 @@ describe('Stats', () => { const result = shallow( ); expect(spy).not.toBeCalled(); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js index 94090edd286..20329eafbaf 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js @@ -270,4 +270,7 @@ class BackgroundTasksApp extends React.PureComponent { const mapDispatchToProps = { fetchOrganizations }; -export default connect(null, mapDispatchToProps)(BackgroundTasksApp); +export default connect( + null, + mapDispatchToProps +)(BackgroundTasksApp); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx index 45f653857b0..7e66a3e007e 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/ScannerContext.tsx @@ -84,7 +84,7 @@ export default class ScannerContext extends React.PureComponent {
      diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx index 1ea9befbc89..21cdf7ec937 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Stacktrace.tsx @@ -100,7 +100,7 @@ export default class Stacktrace extends React.PureComponent {
      diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDate-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDate-test.tsx index 3892a59cd0a..9b11cc91891 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDate-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDate-test.tsx @@ -25,9 +25,9 @@ it('renders', () => { expect(shallow()).toMatchSnapshot(); expect(shallow()).toMatchSnapshot(); expect( - shallow() + shallow() ).toMatchSnapshot(); expect( - shallow() + shallow() ).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDay-test.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDay-test.tsx index 185dd6d8f34..9f03fb4348d 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDay-test.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/__tests__/TaskDay-test.tsx @@ -24,13 +24,13 @@ import TaskDay from '../TaskDay'; it('renders', () => { expect( shallow( - + ) ).toMatchSnapshot(); expect( shallow( - + ) ).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/apps/code/components/App.tsx b/server/sonar-web/src/main/js/apps/code/components/App.tsx index 56b2dcf6de5..f7a7354b0e6 100644 --- a/server/sonar-web/src/main/js/apps/code/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/App.tsx @@ -239,7 +239,7 @@ export default class App extends React.PureComponent { {sourceViewer === undefined && components !== undefined && ( - + )} {sourceViewer !== undefined && ( diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.tsx b/server/sonar-web/src/main/js/apps/code/components/Search.tsx index abeeacc511a..6315df5dcd3 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Search.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/Search.tsx @@ -176,7 +176,7 @@ export default class Search extends React.PureComponent { const isPortfolio = ['VW', 'SVW', 'APP'].includes(component.qualifier); return ( -