From e4ef72e885308b113d89a7826d1b300c093134cf Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 25 Oct 2017 16:53:22 +0200 Subject: update web dependencies (#2752) --- .../main/js/app/components/ComponentContainer.tsx | 16 +- .../js/app/components/GlobalFooterContainer.js | 31 -- .../js/app/components/GlobalFooterContainer.tsx | 30 ++ .../main/js/app/components/extensions/Extension.js | 14 +- .../components/extensions/ExtensionContainer.tsx | 31 ++ .../extensions/GlobalAdminPageExtension.js | 4 +- .../components/extensions/GlobalPageExtension.js | 4 +- .../extensions/OrganizationPageExtension.js | 4 +- .../extensions/ProjectAdminPageExtension.js | 4 +- .../components/extensions/ProjectPageExtension.tsx | 4 +- .../src/main/js/app/components/help/GlobalHelp.js | 3 +- .../__snapshots__/GlobalHelp-test.js.snap | 10 +- .../nav/component/ComponentNavBreadcrumbs.js | 10 +- .../components/nav/component/ComponentNavMenu.tsx | 8 +- .../ComponentNavBranchesMenu-test.tsx.snap | 13 + .../ComponentNavBranchesMenuItem-test.tsx.snap | 3 + .../ComponentNavBreadcrumbs-test.js.snap | 8 +- .../__snapshots__/ComponentNavMenu-test.tsx.snap | 72 +++-- .../__snapshots__/ComponentNavMeta-test.tsx.snap | 12 +- .../__snapshots__/GlobalNavMenu-test.js.snap | 4 +- .../__snapshots__/GlobalNavUser-test.js.snap | 12 +- .../nav/settings/SettingsEditionsNotif.tsx | 14 +- .../__snapshots__/SettingsNav-test.tsx.snap | 4 +- .../src/main/js/app/components/search/Search.js | 58 ++-- .../__snapshots__/SearchResult-test.js.snap | 29 +- .../__snapshots__/SearchResults-test.js.snap | 45 ++- .../js/app/styles/components/search-navigator.css | 12 +- .../src/main/js/apps/about/components/AboutApp.js | 12 +- .../__snapshots__/GlobalNotifications-test.js.snap | 2 + .../__snapshots__/Notifications-test.js.snap | 1 + .../__snapshots__/NotificationsList-test.js.snap | 24 +- .../ProjectNotifications-test.js.snap | 3 + .../__tests__/__snapshots__/Projects-test.js.snap | 8 + .../src/main/js/apps/account/profile/Profile.js | 10 +- .../background-tasks/components/ScannerContext.tsx | 2 +- .../background-tasks/components/Stacktrace.tsx | 2 +- .../background-tasks/components/TaskActions.tsx | 22 +- .../background-tasks/components/TaskComponent.tsx | 10 +- .../apps/background-tasks/components/Workers.tsx | 46 +-- .../background-tasks/components/WorkersForm.tsx | 4 +- .../components/__tests__/TaskActions-test.tsx | 4 +- .../__snapshots__/ScannerContext-test.tsx.snap | 2 + .../__snapshots__/Stacktrace-test.tsx.snap | 2 + .../__snapshots__/TaskActions-test.tsx.snap | 4 - .../__snapshots__/WorkersForm-test.tsx.snap | 10 + .../src/main/js/apps/code/components/App.tsx | 26 +- .../js/apps/component-measures/components/App.js | 28 +- .../components/MeasureContent.js | 38 +-- .../component-measures/components/MeasureHeader.js | 38 +-- .../components/MeasureOverview.js | 12 +- .../__tests__/__snapshots__/App-test.js.snap | 1 + .../__snapshots__/MeasureViewSelect-test.js.snap | 15 +- .../apps/component-measures/drilldown/FilesView.js | 14 +- .../component-measures/drilldown/TreeMapView.js | 2 +- .../__snapshots__/DomainFacet-test.js.snap | 10 + .../__tests__/__snapshots__/Sidebar-test.js.snap | 2 + .../src/main/js/apps/issues/components/App.js | 10 +- .../issues/components/ComponentBreadcrumbs.tsx | 18 +- .../ConciseIssueLocations-test.js.snap | 5 + .../__snapshots__/ConciseIssuesList-test.js.snap | 2 + .../__snapshots__/AssigneeFacet-test.js.snap | 6 + .../__snapshots__/EditionBoxes-test.tsx.snap | 6 +- .../__snapshots__/PendingActions-test.tsx.snap | 4 +- .../marketplace/components/LicenseEditionForm.tsx | 10 +- .../apps/marketplace/components/PluginActions.tsx | 64 ++-- .../components/UninstallEditionForm.tsx | 2 +- .../__snapshots__/LicenseEditionForm-test.tsx.snap | 2 + .../__snapshots__/PluginLicense-test.tsx.snap | 4 +- .../UninstallEditionForm-test.tsx.snap | 2 + .../__snapshots__/MembersList-test.js.snap | 2 + .../__snapshots__/OrganizationDelete-test.js.snap | 7 + .../__snapshots__/OrganizationEdit-test.js.snap | 3 + .../__snapshots__/OrganizationMembers-test.js.snap | 2 + .../__snapshots__/OrganizationPage-test.js.snap | 1 + .../__snapshots__/AddMemberForm-test.js.snap | 2 + .../ManageMemberGroupsForm-test.js.snap | 5 + .../__snapshots__/RemoveMemberForm-test.js.snap | 2 + .../ApplicationLeakPeriodLegend-test.js.snap | 8 +- .../__tests__/__snapshots__/Analysis-test.js.snap | 2 + .../meta/__tests__/MetaTagsSelector-test.js | 2 +- .../overview/qualityGate/QualityGateCondition.js | 10 +- .../ApplicationQualityGate-test.js.snap | 2 + .../ApplicationQualityGateProject-test.js.snap | 3 + .../js/apps/permissions/project/components/App.js | 6 +- .../permissions/shared/components/SearchForm.js | 14 +- .../src/main/js/apps/portfolio/components/App.tsx | 16 +- .../apps/portfolio/components/ReleasabilityBox.tsx | 26 +- .../js/apps/portfolio/components/WorstProjects.tsx | 8 +- .../__tests__/__snapshots__/Effort-test.tsx.snap | 48 +-- .../__snapshots__/RatingFreshness-test.tsx.snap | 4 +- .../__snapshots__/WorstProjects-test.tsx.snap | 12 +- .../projectActivity/components/GraphHistory.js | 26 +- .../projectActivity/components/GraphsTooltips.js | 6 +- .../components/ProjectActivityAnalysis.js | 2 +- .../__snapshots__/GraphHistory-test.js.snap | 2 + .../__snapshots__/GraphsHistory-test.js.snap | 3 + .../__snapshots__/GraphsLegendCustom-test.js.snap | 3 + .../__snapshots__/GraphsLegendStatic-test.js.snap | 2 + .../__snapshots__/GraphsTooltips-test.js.snap | 6 + .../GraphsTooltipsContent-test.js.snap | 1 + .../GraphsTooltipsContentEvents-test.js.snap | 2 + .../GraphsTooltipsContentIssues-test.js.snap | 2 + .../ProjectActivityAnalysesList-test.js.snap | 27 +- .../__snapshots__/ProjectActivityApp-test.js.snap | 1 + .../ProjectActivityPageHeader-test.js.snap | 3 + .../components/forms/AddGraphMetric.js | 20 +- .../components/DeleteBranchModal.tsx | 2 +- .../projectBranches/components/LeakPeriodForm.tsx | 2 +- .../components/LongBranchesPatternForm.tsx | 2 +- .../components/RenameBranchModal.tsx | 2 +- .../projectBranches/components/SettingForm.tsx | 28 +- .../__tests__/__snapshots__/App-test.tsx.snap | 7 +- .../__snapshots__/DeleteBranchModal-test.tsx.snap | 4 + .../LongBranchesPatternForm-test.tsx.snap | 2 + .../__snapshots__/RenameBranchModal-test.tsx.snap | 6 + .../src/main/js/apps/projectQualityGate/Form.tsx | 2 +- .../__tests__/__snapshots__/Form-test.tsx.snap | 3 + .../js/apps/projectQualityProfiles/ProfileRow.tsx | 2 +- .../__snapshots__/ProfileRow-test.tsx.snap | 3 + .../__tests__/__snapshots__/Table-test.tsx.snap | 2 + .../apps/projects/components/PerspectiveSelect.tsx | 2 +- .../apps/projects/components/ProjectCardLeak.tsx | 42 +-- .../js/apps/projects/components/ProjectsList.tsx | 22 +- .../projects/components/ProjectsSortingSelect.tsx | 2 +- .../components/__tests__/PageSidebar-test.tsx | 2 +- .../__snapshots__/AllProjects-test.tsx.snap | 2 + .../__snapshots__/PageSidebar-test.tsx.snap | 16 +- .../__snapshots__/PerspectiveSelect-test.tsx.snap | 6 + .../ProjectCardLanguages-test.tsx.snap | 32 +- .../__snapshots__/ProjectsList-test.tsx.snap | 2 + .../ProjectsSortingSelect-test.tsx.snap | 9 + .../main/js/apps/projects/filters/IssuesFilter.tsx | 2 +- .../projects/filters/SearchableFilterFooter.tsx | 2 +- .../__tests__/__snapshots__/Filter-test.tsx.snap | 21 ++ .../__snapshots__/LanguagesFilter-test.tsx.snap | 3 + .../__snapshots__/TagsFilter-test.tsx.snap | 3 + .../projectsManagement/BulkApplyTemplateModal.tsx | 36 +-- .../projectsManagement/ChangeVisibilityForm.tsx | 2 +- .../apps/projectsManagement/CreateProjectForm.tsx | 2 +- .../js/apps/projectsManagement/DeleteModal.tsx | 16 +- .../src/main/js/apps/projectsManagement/Search.tsx | 2 +- .../BulkApplyTemplateModal-test.tsx.snap | 28 ++ .../ChangeVisibilityForm-test.tsx.snap | 12 + .../__snapshots__/CreateProjectForm-test.tsx.snap | 30 +- .../__snapshots__/DeleteModal-test.tsx.snap | 8 + .../__tests__/__snapshots__/Projects-test.tsx.snap | 2 + .../__tests__/__snapshots__/Search-test.tsx.snap | 3 + .../apps/quality-gates/components/DetailsHeader.js | 8 +- .../changelog/ChangelogContainer.tsx | 6 +- .../quality-profiles/changelog/ParameterChange.tsx | 11 +- .../compare/ComparisonContainer.tsx | 30 +- .../quality-profiles/compare/ComparisonForm.tsx | 2 +- .../components/CopyProfileForm.tsx | 2 +- .../components/DeleteProfileForm.tsx | 2 +- .../quality-profiles/components/ProfileActions.tsx | 54 ++-- .../components/RenameProfileForm.tsx | 2 +- .../quality-profiles/details/ChangeParentForm.tsx | 12 +- .../details/ChangeProjectsForm.tsx | 2 +- .../quality-profiles/details/ProfileDetails.tsx | 11 +- .../details/ProfileInheritance.tsx | 18 +- .../details/ProfilePermissionsForm.tsx | 2 +- .../details/ProfilePermissionsFormSelect.tsx | 2 +- .../quality-profiles/details/ProfileProjects.tsx | 16 +- .../apps/quality-profiles/details/ProfileRules.tsx | 34 +- .../__snapshots__/ProfilePermissions-test.tsx.snap | 2 + .../ProfilePermissionsForm-test.tsx.snap | 12 + .../ProfilePermissionsFormSelect-test.tsx.snap | 3 + .../__snapshots__/ProfileRules-test.tsx.snap | 4 + .../quality-profiles/home/CreateProfileForm.tsx | 4 +- .../apps/quality-profiles/home/EvolutionRules.tsx | 22 +- .../js/apps/quality-profiles/home/ProfilesList.tsx | 31 +- .../quality-profiles/home/RestoreProfileForm.tsx | 38 +-- .../components/__tests__/LoginForm-test.tsx | 14 +- .../main/js/apps/settings/components/Definition.js | 32 +- .../js/apps/settings/encryption/EncryptionApp.js | 12 +- .../apps/system/components/ChangeLogLevelForm.tsx | 2 +- .../__snapshots__/ChangeLogLevelForm-test.tsx.snap | 10 + .../__snapshots__/ClusterSysInfos-test.tsx.snap | 2 + .../__snapshots__/StandaloneSysInfos-test.tsx.snap | 3 + .../__snapshots__/HealthCard-test.tsx.snap | 2 + .../__snapshots__/HealthItem-test.tsx.snap | 3 + .../__tests__/__snapshots__/Section-test.tsx.snap | 16 +- .../__snapshots__/SysInfoItem-test.tsx.snap | 358 +++++++++++---------- .../system-upgrade/SystemUpgradeForm.tsx | 2 +- .../system-upgrade/SystemUpgradeIntermediate.tsx | 8 +- .../__snapshots__/SystemUpgradeForm-test.tsx.snap | 4 + .../SystemUpgradeIntermediate-test.tsx.snap | 2 + .../__snapshots__/SystemUpgradeItem-test.tsx.snap | 2 +- server/sonar-web/src/main/js/apps/system/utils.ts | 18 +- .../apps/tutorials/onboarding/OrganizationStep.js | 14 +- .../__snapshots__/Onboarding-test.js.snap | 5 + .../__tests__/__snapshots__/Command-test.js.snap | 4 +- .../__snapshots__/JavaGradle-test.js.snap | 8 +- .../users/components/UsersSelectSearchValue.js | 14 +- .../__snapshots__/UsersSelectSearch-test.js.snap | 6 + .../src/main/js/apps/web-api/components/Action.tsx | 16 +- .../src/main/js/apps/web-api/components/Params.tsx | 22 +- .../__snapshots__/ActionChangelog-test.tsx.snap | 2 + .../__tests__/__snapshots__/Domain-test.tsx.snap | 5 + .../__tests__/__snapshots__/Menu-test.tsx.snap | 9 + .../__tests__/__snapshots__/Params-test.tsx.snap | 12 +- .../js/components/SourceViewer/components/Line.js | 14 +- .../components/SourceViewer/components/LineCode.js | 26 +- .../__tests__/__snapshots__/LineCode-test.js.snap | 4 + .../LineDuplicationBlock-test.js.snap | 2 + .../__snapshots__/LineIssuesList-test.js.snap | 2 + .../__snapshots__/BubbleChart-test.js.snap | 6 + .../__snapshots__/Histogram-test.tsx.snap | 51 ++- .../src/main/js/components/common/RestartForm.tsx | 5 +- .../__snapshots__/MultiSelect-test.js.snap | 10 + .../__snapshots__/SelectList-test.js.snap | 6 + .../src/main/js/components/controls/DateInput.tsx | 5 +- .../main/js/components/controls/SearchSelect.js | 8 +- .../main/js/components/controls/SimpleModal.tsx | 2 +- .../__snapshots__/RadioToggle-test.tsx.snap | 16 +- .../__snapshots__/SearchSelect-test.js.snap | 3 + .../__snapshots__/SimpleModal-test.tsx.snap | 8 + .../src/main/js/components/issue/IssueView.js | 24 +- .../components/issue/popups/SimilarIssuesPopup.js | 8 +- .../__snapshots__/ChangelogPopup-test.js.snap | 5 +- .../__snapshots__/SetSeverityPopup-test.js.snap | 5 + .../__snapshots__/SetTransitionPopup-test.js.snap | 4 + .../__snapshots__/SetTypePopup-test.js.snap | 3 + .../js/components/preview-graph/PreviewGraph.js | 26 +- .../PreviewGraphTooltips-test.js.snap | 3 + server/sonar-web/src/main/js/helpers/urls.ts | 2 +- .../src/main/js/store/utils/configureStore.js | 2 +- 227 files changed, 1736 insertions(+), 1066 deletions(-) delete mode 100644 server/sonar-web/src/main/js/app/components/GlobalFooterContainer.js create mode 100644 server/sonar-web/src/main/js/app/components/GlobalFooterContainer.tsx create mode 100644 server/sonar-web/src/main/js/app/components/extensions/ExtensionContainer.tsx (limited to 'server/sonar-web/src/main') 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 b1b2ac07fad..f790ab376fe 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -144,14 +144,14 @@ export class ComponentContainer extends React.PureComponent { return (
{component && - !['FIL', 'UTS'].includes(component.qualifier) && ( - - )} + !['FIL', 'UTS'].includes(component.qualifier) && ( + + )} {loading ? (
diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooterContainer.js b/server/sonar-web/src/main/js/app/components/GlobalFooterContainer.js deleted file mode 100644 index 8d68f322369..00000000000 --- a/server/sonar-web/src/main/js/app/components/GlobalFooterContainer.js +++ /dev/null @@ -1,31 +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 { connect } from 'react-redux'; -import { getAppState, getGlobalSettingValue } from '../../store/rootReducer'; -import GlobalFooter from './GlobalFooter'; - -const mapStateToProps = state => ({ - sonarqubeVersion: getAppState(state).version, - productionDatabase: getAppState(state).productionDatabase, - onSonarCloud: getGlobalSettingValue(state, 'sonar.sonarcloud.enabled') -}); - -export default connect(mapStateToProps)(GlobalFooter); diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooterContainer.tsx b/server/sonar-web/src/main/js/app/components/GlobalFooterContainer.tsx new file mode 100644 index 00000000000..e9b31253cdd --- /dev/null +++ b/server/sonar-web/src/main/js/app/components/GlobalFooterContainer.tsx @@ -0,0 +1,30 @@ +/* + * 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 { connect } from 'react-redux'; +import { getAppState, getGlobalSettingValue } from '../../store/rootReducer'; +import GlobalFooter from './GlobalFooter'; + +const mapStateToProps = (state: any) => ({ + sonarqubeVersion: getAppState(state).version, + productionDatabase: getAppState(state).productionDatabase, + onSonarCloud: getGlobalSettingValue(state, 'sonar.sonarcloud.enabled') +}); + +export default connect(mapStateToProps)(GlobalFooter); diff --git a/server/sonar-web/src/main/js/app/components/extensions/Extension.js b/server/sonar-web/src/main/js/app/components/extensions/Extension.js index d7657b83365..f1bfbf9756a 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/Extension.js +++ b/server/sonar-web/src/main/js/app/components/extensions/Extension.js @@ -93,8 +93,10 @@ class Extension extends React.PureComponent { } stopExtension() { - this.stop && this.stop(); - this.stop = null; + if (this.stop) { + this.stop(); + this.stop = null; + } } render() { @@ -107,10 +109,4 @@ class Extension extends React.PureComponent { } } -const mapStateToProps = state => ({ - currentUser: getCurrentUser(state) -}); - -const mapDispatchToProps = { onFail: addGlobalErrorMessage }; - -export default connect(mapStateToProps, mapDispatchToProps)(injectIntl(withRouter(Extension))); +export default injectIntl(withRouter(Extension)); 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 new file mode 100644 index 00000000000..6e72ebb376d --- /dev/null +++ b/server/sonar-web/src/main/js/app/components/extensions/ExtensionContainer.tsx @@ -0,0 +1,31 @@ +/* + * 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 { connect } from 'react-redux'; +import { getCurrentUser } from '../../../store/rootReducer'; +import { addGlobalErrorMessage } from '../../../store/globalMessages/duck'; +import Extension from './Extension'; + +const mapStateToProps = (state: any) => ({ + currentUser: getCurrentUser(state) +}); + +const mapDispatchToProps = { onFail: addGlobalErrorMessage }; + +export default connect(mapStateToProps, mapDispatchToProps)(Extension); diff --git a/server/sonar-web/src/main/js/app/components/extensions/GlobalAdminPageExtension.js b/server/sonar-web/src/main/js/app/components/extensions/GlobalAdminPageExtension.js index eff718d6168..ea9b2191b02 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/GlobalAdminPageExtension.js +++ b/server/sonar-web/src/main/js/app/components/extensions/GlobalAdminPageExtension.js @@ -20,7 +20,7 @@ // @flow import React from 'react'; import { connect } from 'react-redux'; -import Extension from './Extension'; +import ExtensionContainer from './ExtensionContainer'; import ExtensionNotFound from './ExtensionNotFound'; import { getAppState } from '../../../store/rootReducer'; @@ -37,7 +37,7 @@ type Props = { function GlobalAdminPageExtension(props /*: Props */) { const { extensionKey, pluginKey } = props.params; const extension = props.adminPages.find(p => p.key === `${pluginKey}/${extensionKey}`); - return extension ? : ; + return extension ? : ; } const mapStateToProps = state => ({ diff --git a/server/sonar-web/src/main/js/app/components/extensions/GlobalPageExtension.js b/server/sonar-web/src/main/js/app/components/extensions/GlobalPageExtension.js index 5d82eae4917..acc4d25948c 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/GlobalPageExtension.js +++ b/server/sonar-web/src/main/js/app/components/extensions/GlobalPageExtension.js @@ -20,7 +20,7 @@ // @flow import React from 'react'; import { connect } from 'react-redux'; -import Extension from './Extension'; +import ExtensionContainer from './ExtensionContainer'; import ExtensionNotFound from './ExtensionNotFound'; import { getAppState } from '../../../store/rootReducer'; @@ -37,7 +37,7 @@ type Props = { function GlobalPageExtension(props /*: Props */) { const { extensionKey, pluginKey } = props.params; const extension = props.globalPages.find(p => p.key === `${pluginKey}/${extensionKey}`); - return extension ? : ; + return extension ? : ; } const mapStateToProps = state => ({ diff --git a/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.js b/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.js index e5d38f46800..9236726d428 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.js +++ b/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.js @@ -20,7 +20,7 @@ // @flow import React from 'react'; import { connect } from 'react-redux'; -import Extension from './Extension'; +import ExtensionContainer from './ExtensionContainer'; import ExtensionNotFound from './ExtensionNotFound'; import { getOrganizationByKey } from '../../../store/rootReducer'; import { fetchOrganization } from '../../../apps/organizations/actions'; @@ -55,7 +55,7 @@ class OrganizationPageExtension extends React.PureComponent { const extension = pages.find(p => p.key === `${pluginKey}/${extensionKey}`); return extension ? ( - p.key === `${pluginKey}/${extensionKey}`); return extension ? ( - + ) : ( ); diff --git a/server/sonar-web/src/main/js/app/components/extensions/ProjectPageExtension.tsx b/server/sonar-web/src/main/js/app/components/extensions/ProjectPageExtension.tsx index dc23ec8df22..4c76b21a7e7 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/ProjectPageExtension.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/ProjectPageExtension.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Extension from './Extension'; +import ExtensionContainer from './ExtensionContainer'; import ExtensionNotFound from './ExtensionNotFound'; import { Component } from '../../types'; @@ -38,7 +38,7 @@ export default function ProjectPageExtension(props: Props) { component.extensions && component.extensions.find(p => p.key === `${pluginKey}/${extensionKey}`); return extension ? ( - + ) : ( ); diff --git a/server/sonar-web/src/main/js/app/components/help/GlobalHelp.js b/server/sonar-web/src/main/js/app/components/help/GlobalHelp.js index 9df12c7801c..43f4616f8b8 100644 --- a/server/sonar-web/src/main/js/app/components/help/GlobalHelp.js +++ b/server/sonar-web/src/main/js/app/components/help/GlobalHelp.js @@ -90,7 +90,8 @@ export default class GlobalHelp extends React.PureComponent {
    {(this.props.currentUser.isLoggedIn ? ['shortcuts', 'tutorials', 'links'] - : ['shortcuts', 'links']).map(this.renderMenuItem)} + : ['shortcuts', 'links'] + ).map(this.renderMenuItem)}
); diff --git a/server/sonar-web/src/main/js/app/components/help/__tests__/__snapshots__/GlobalHelp-test.js.snap b/server/sonar-web/src/main/js/app/components/help/__tests__/__snapshots__/GlobalHelp-test.js.snap index e9a2ed0ec03..5aaa41aa5f8 100644 --- a/server/sonar-web/src/main/js/app/components/help/__tests__/__snapshots__/GlobalHelp-test.js.snap +++ b/server/sonar-web/src/main/js/app/components/help/__tests__/__snapshots__/GlobalHelp-test.js.snap @@ -12,7 +12,9 @@ exports[`does not show tutorials for anonymous 1`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} >
-
  • +
  • -
  • +
  • {!displayOrganization && - index === 0 && ( - - - - )} + index === 0 && ( + + + + )} { } }} activeClassName="active"> - {this.isPortfolio() || this.isApplication() ? ( - translate('view_projects.page') - ) : ( - translate('code.page') - )} + {this.isPortfolio() || this.isApplication() + ? translate('view_projects.page') + : translate('code.page')}
  • ); 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 d7e28b0846b..7a01722ba4c 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 @@ -39,14 +39,17 @@ exports[`renders list 1`] = ` "key": "component", } } + key="master" onSelect={[Function]} selected={true} />
  • branches.orphan_branches @@ -101,11 +105,13 @@ exports[`renders list 1`] = ` "key": "component", } } + key="foo" onSelect={[Function]} selected={false} />
  • branches.orphan_branches @@ -213,11 +223,13 @@ exports[`searches 1`] = ` "key": "component", } } + key="foobar" onSelect={[Function]} selected={true} />
  • diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenuItem-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenuItem-test.tsx.snap index 1f6d81e9883..ceba812e99c 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenuItem-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavBranchesMenuItem-test.tsx.snap @@ -2,6 +2,7 @@ exports[`renders main branch 1`] = `
  • - + @@ -74,7 +76,9 @@ exports[`should render organization 1`] = ` className="slash-separator" /> - + -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • -
  • +
  • diff --git a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNavMenu-test.js.snap b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNavMenu-test.js.snap index c72f7259205..673cc003e3c 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNavMenu-test.js.snap +++ b/server/sonar-web/src/main/js/app/components/nav/global/__tests__/__snapshots__/GlobalNavMenu-test.js.snap @@ -159,7 +159,9 @@ exports[`should work with extensions 1`] = `
      -
    • +
    • -
    • +
    • -
    • +
    • -
    • +
    • - {edition ? ( - translateWithParameters( - 'marketplace.status_x.' + editionStatus.installationStatus, - edition.name - ) - ) : ( - translate('marketplace.status', editionStatus.installationStatus) - )} + {edition + ? translateWithParameters( + 'marketplace.status_x.' + editionStatus.installationStatus, + edition.name + ) + : translate('marketplace.status', editionStatus.installationStatus)} {!preventRestart && (
    • -
    • +
    • 0 && ( -
      (this.node = node)}> - -
      -
      - - {translate('recently_browsed')} -
      -
      s' - ) - }} + Object.keys(this.state.results).length > 0 && ( +
      (this.node = node)}> + +
      +
      + + {translate('recently_browsed')} +
      +
      s' + ) + }} + /> +
      -
      - )} + )}
    • ); } diff --git a/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResult-test.js.snap b/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResult-test.js.snap index a99f95bc210..57349cfbdf5 100644 --- a/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResult-test.js.snap +++ b/server/sonar-web/src/main/js/app/components/search/__tests__/__snapshots__/SearchResult-test.js.snap @@ -1,7 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders favorite 1`] = ` -
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • qualifiers.TRK
    • - + foo - + bar
    • qualifiers.BRC
    • - + qwe - + qux
    @@ -46,38 +58,53 @@ exports[`renders different components and dividers between them 1`] = ` >
  • qualifiers.TRK
  • - + foo - + bar
  • qualifiers.BRC
  • - + qwe - + qux
  • qualifiers.FIL
  • - + zux diff --git a/server/sonar-web/src/main/js/app/styles/components/search-navigator.css b/server/sonar-web/src/main/js/app/styles/components/search-navigator.css index b89d2bab0ce..8f9294c9b77 100644 --- a/server/sonar-web/src/main/js/app/styles/components/search-navigator.css +++ b/server/sonar-web/src/main/js/app/styles/components/search-navigator.css @@ -188,7 +188,11 @@ a.search-navigator-facet:focus .facet-stat { bottom: 0; right: 100%; width: 10px; - background-image: linear-gradient(to right, rgba(243, 243, 243, 0), var(--barBackgroundColor) 75%); + background-image: linear-gradient( + to right, + rgba(243, 243, 243, 0), + var(--barBackgroundColor) 75% + ); } .search-navigator-facet .facet-toggle { @@ -766,7 +770,11 @@ a.search-navigator-facet:focus .facet-stat { bottom: 0; right: 100%; width: 10px; - background-image: linear-gradient(to right, rgba(243, 243, 243, 0), var(--barBackgroundColor) 75%); + background-image: linear-gradient( + to right, + rgba(243, 243, 243, 0), + var(--barBackgroundColor) 75% + ); } .search-navigator-header-pagination { 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 cc3556ca910..267d0fc7cf1 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 @@ -156,12 +156,12 @@ class AboutApp extends React.PureComponent {
    {customText != null && - customText.value && ( -
    - )} + customText.value && ( +
    + )} diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/GlobalNotifications-test.js.snap b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/GlobalNotifications-test.js.snap index 2135246ecb6..4a7d7d10c5a 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/GlobalNotifications-test.js.snap +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/GlobalNotifications-test.js.snap @@ -15,6 +15,7 @@ exports[`should match snapshot 1`] = `

    notification.channel.channel1 @@ -22,6 +23,7 @@ exports[`should match snapshot 1`] = `

    notification.channel.channel2 diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.js.snap b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.js.snap index 978e4038e91..8541cc01be7 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.js.snap +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Notifications-test.js.snap @@ -5,6 +5,7 @@ exports[`should match snapshot 1`] = ` className="account-body account-container" > diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/NotificationsList-test.js.snap b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/NotificationsList-test.js.snap index 3ca417ef0a0..13a18bff3c7 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/NotificationsList-test.js.snap +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/NotificationsList-test.js.snap @@ -2,12 +2,15 @@ exports[`renders project-specific labels 1`] = ` - + notification.dispatcher.type1.project - + notification.dispatcher.type2.project - + notification.dispatcher.type1 - + notification.dispatcher.type2 @@ -34,6 +35,7 @@ exports[`should match snapshot 1`] = `

    notification.channel.channel1 @@ -41,6 +43,7 @@ exports[`should match snapshot 1`] = `

    notification.channel.channel2 diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Projects-test.js.snap b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Projects-test.js.snap index 0a6bbf5f267..ed54ae19c4d 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Projects-test.js.snap +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/__snapshots__/Projects-test.js.snap @@ -8,6 +8,7 @@ exports[`should render projects 1`] = ` my_profile.per_project_notifications.title

    {!user.local && - user.externalProvider !== 'sonarqube' && ( -
    - -
    - )} + user.externalProvider !== 'sonarqube' && ( +
    + +
    + )} {!!user.email && (
    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 c5fa551f142..1e01f0ce5a2 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 @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import { getTask } from '../../../api/ce'; import { translate } from '../../../helpers/l10n'; import { Task } from '../types'; 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 7156099b54c..56c5a82e0da 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 @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import { getTask } from '../../../api/ce'; import { translate } from '../../../helpers/l10n'; import { Task } from '../types'; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskActions.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskActions.tsx index 285e7a4d50f..d6510541fc2 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskActions.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskActions.tsx @@ -86,17 +86,17 @@ export default class TaskActions extends React.PureComponent {
    {secondaryMeasure && - secondaryMeasure.metric.key === 'ncloc_language_distribution' && ( -
    - -
    - )} + secondaryMeasure.metric.key === 'ncloc_language_distribution' && ( +
    + +
    + )} {secondaryMeasure && - secondaryMeasure.metric.key === 'function_complexity_distribution' && ( -
    - -
    - )} + secondaryMeasure.metric.key === 'function_complexity_distribution' && ( +
    + +
    + )} {secondaryMeasure && - secondaryMeasure.metric.key === 'file_complexity_distribution' && ( -
    - -
    - )} + secondaryMeasure.metric.key === 'file_complexity_distribution' && ( +
    + +
    + )}

    ); } diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.js b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.js index 91d5cf8d669..8dd310c8a10 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureOverview.js @@ -152,12 +152,12 @@ export default class MeasureOverview extends React.PureComponent { rootComponent={rootComponent} /> {component.key !== rootComponent.key && - isLoggedIn && ( - - )} + isLoggedIn && ( + + )} diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureViewSelect-test.js.snap b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureViewSelect-test.js.snap index 7ab0276dde2..c007678dbab 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureViewSelect-test.js.snap +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureViewSelect-test.js.snap @@ -12,6 +12,7 @@ exports[`should display correctly with treemap option 1`] = ` clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + closeOnSelect={true} deleteRemoves={true} delimiter="," disabled={false} @@ -32,6 +33,8 @@ exports[`should display correctly with treemap option 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} + onSelectResetsInput={true} + openOnClick={true} optionComponent={[Function]} options={ Array [ @@ -39,30 +42,30 @@ exports[`should display correctly with treemap option 1`] = ` "icon": , "label":
    component_measures.tab.list -
    , +
    , "value": "list", }, Object { "icon": , "label":
    component_measures.tab.tree -
    , +
    , "value": "tree", }, Object { "icon": , "label":
    component_measures.tab.treemap -
    , +
    , "value": "treemap", }, ] diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.js b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.js index 1d7be5e5b3b..702dd80038e 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.js +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.js @@ -131,13 +131,13 @@ export default class ListView extends React.PureComponent { selectedComponent={this.props.selectedKey} /> {this.props.paging && - this.props.components.length > 0 && ( - - )} + this.props.components.length > 0 && ( + + )} ); } diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.js b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.js index b836d061c7d..875f750d7db 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.js +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.js @@ -202,7 +202,7 @@ export default class TreeMapView extends React.PureComponent {
  • {this.renderLegend()}
  • - + {({ width }) => ( {paging != null && - paging.total > 0 && ( - - )} + paging.total > 0 && ( + + )} ); } diff --git a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx index b086fb5a125..22332785306 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/ComponentBreadcrumbs.tsx @@ -61,15 +61,15 @@ export default function ComponentBreadcrumbs({ branch, component, issue, organiz )} {displaySubProject && - issue.subProject !== undefined && - issue.subProjectName !== undefined && ( - - - {limitComponentName(issue.subProjectName)} - - - - )} + issue.subProject !== undefined && + issue.subProjectName !== undefined && ( + + + {limitComponentName(issue.subProjectName)} + + + + )} {collapsePath(issue.componentLongName)} diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssueLocations-test.js.snap b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssueLocations-test.js.snap index b66e4a8d097..f9973b06e0c 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssueLocations-test.js.snap +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssueLocations-test.js.snap @@ -6,6 +6,7 @@ exports[`should render one flow 1`] = ` > @@ -18,6 +19,7 @@ exports[`should render secondary locations 1`] = ` > @@ -29,16 +31,19 @@ exports[`should render several flows 1`] = ` > diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssuesList-test.js.snap b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssuesList-test.js.snap index 1c8a20f3792..b6bc2b99242 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssuesList-test.js.snap +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/__snapshots__/ConciseIssuesList-test.js.snap @@ -8,6 +8,7 @@ exports[`should render 1`] = ` "key": "foo", } } + key="foo" previousIssue={null} scroll={[Function]} selected={false} @@ -18,6 +19,7 @@ exports[`should render 1`] = ` "key": "bar", } } + key="bar" previousIssue={ Object { "key": "foo", diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/AssigneeFacet-test.js.snap b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/AssigneeFacet-test.js.snap index d6d4ef6ac7b..d384037257b 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/AssigneeFacet-test.js.snap +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/AssigneeFacet-test.js.snap @@ -23,6 +23,7 @@ exports[`should render 1`] = ` active={false} disabled={false} halfWidth={false} + key="foo" name={ + > SonarSource.com - , + , } } /> @@ -56,6 +56,7 @@ exports[`should display the edition boxes correctly 2`] = ` } } isDowngrade={true} + key="comunity" onInstall={[Function]} onUninstall={[Function]} /> @@ -80,6 +81,7 @@ exports[`should display the edition boxes correctly 2`] = ` } } isDowngrade={false} + key="developer" onInstall={[Function]} onUninstall={[Function]} /> diff --git a/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/PendingActions-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/PendingActions-test.tsx.snap index b30e1e22d36..7e8801a1e0c 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/PendingActions-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/PendingActions-test.tsx.snap @@ -21,7 +21,7 @@ exports[`should display pending actions 1`] = ` Object { "nb": 2 - , + , } } /> @@ -34,7 +34,7 @@ exports[`should display pending actions 1`] = ` Object { "nb": 1 - , + , } } /> diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx index abab7c84ed4..ee86ac11596 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/LicenseEditionForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import LicenseEditionSet from './LicenseEditionSet'; import { Edition, EditionStatus, applyLicense } from '../../../api/marketplace'; import { translate, translateWithParameters } from '../../../helpers/l10n'; @@ -108,11 +108,9 @@ export default class LicenseEditionForm extends React.PureComponent} {status && ( )} diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx index 501631edadc..df898dbdbeb 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx @@ -91,19 +91,19 @@ export default class PluginActions extends React.PureComponent {

    )} {isPluginInstalled(plugin) && - plugin.updates && - plugin.updates.length > 0 && ( -
    - {plugin.updates.map((update, idx) => ( - - ))} -
    - )} + plugin.updates && + plugin.updates.length > 0 && ( +
    + {plugin.updates.map((update, idx) => ( + + ))} +
    + )} ); } @@ -119,25 +119,25 @@ export default class PluginActions extends React.PureComponent { return (
    {isPluginAvailable(plugin) && - plugin.termsAndConditionsUrl && ( -

    - - - - - {translate('marketplace.terms_and_conditions')} - -

    - )} + plugin.termsAndConditionsUrl && ( +

    + + + + + {translate('marketplace.terms_and_conditions')} + +

    + )} {loading && } {isPluginInstalled(plugin) && (
    diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx index 37b76edc83e..1af1ee86295 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/UninstallEditionForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import { Edition, EditionStatus, uninstallEdition } from '../../../api/marketplace'; import { translate, translateWithParameters } from '../../../helpers/l10n'; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/LicenseEditionForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/LicenseEditionForm-test.tsx.snap index 9e07155c292..bd4aa78eb6a 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/LicenseEditionForm-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/LicenseEditionForm-test.tsx.snap @@ -42,7 +42,9 @@ exports[`should display correctly 1`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} >
    + > SonarSource license - , + , } } /> diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/UninstallEditionForm-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/UninstallEditionForm-test.tsx.snap index 507f7e4fe73..05cefbe37c2 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/UninstallEditionForm-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/UninstallEditionForm-test.tsx.snap @@ -12,7 +12,9 @@ exports[`should display correctly 1`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} >
    @@ -39,6 +40,7 @@ exports[`smoke test 2`] = ` className="page page-limited" > @@ -75,7 +77,9 @@ exports[`smoke test 2`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} >
    @@ -158,7 +163,9 @@ exports[`smoke test 3`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} >
    @@ -137,6 +138,7 @@ exports[`smoke test 2`] = ` className="page page-limited" > @@ -284,6 +286,7 @@ exports[`smoke test 3`] = ` className="page page-limited" > diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap index 17ab36b7540..9a13da1aa21 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationMembers-test.js.snap @@ -5,6 +5,7 @@ exports[`should not render actions for non admin 1`] = ` className="page page-limited" > @@ -55,6 +56,7 @@ exports[`should render actions for admin 1`] = ` className="page page-limited" > diff --git a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.js.snap index f63164ef1e0..350cc9b5d80 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/__tests__/__snapshots__/OrganizationPage-test.js.snap @@ -16,6 +16,7 @@ exports[`smoke test 2`] = `
    diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/AddMemberForm-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/AddMemberForm-test.js.snap index b00ff229314..96d42f26097 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/AddMemberForm-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/AddMemberForm-test.js.snap @@ -24,7 +24,9 @@ exports[`should render and open the modal 2`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} >
    diff --git a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/RemoveMemberForm-test.js.snap b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/RemoveMemberForm-test.js.snap index 5b298e526ba..b1b8bdb072d 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/RemoveMemberForm-test.js.snap +++ b/server/sonar-web/src/main/js/apps/organizations/components/forms/__tests__/__snapshots__/RemoveMemberForm-test.js.snap @@ -39,7 +39,9 @@ exports[`should render and open the modal 2`] = ` overlayClassName="modal-overlay" parentSelector={[Function]} portalClassName="ReactModalPortal" + shouldCloseOnEsc={true} shouldCloseOnOverlayClick={true} + shouldFocusAfterRender={true} >
    -
  • +
  • Foo :
  • -
  • +
  • Bar :
  • diff --git a/server/sonar-web/src/main/js/apps/overview/meta/__tests__/MetaTagsSelector-test.js b/server/sonar-web/src/main/js/apps/overview/meta/__tests__/MetaTagsSelector-test.js index bc22697f5f3..fc0fe817dc1 100644 --- a/server/sonar-web/src/main/js/apps/overview/meta/__tests__/MetaTagsSelector-test.js +++ b/server/sonar-web/src/main/js/apps/overview/meta/__tests__/MetaTagsSelector-test.js @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* eslint-disable import/order, import/first */ -import * as React from 'react'; +import React from 'react'; import { mount, shallow } from 'enzyme'; import MetaTagsSelector from '../MetaTagsSelector'; diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.js b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.js index d88d0e76e97..bc49256f055 100644 --- a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.js +++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.js @@ -155,11 +155,11 @@ export default class QualityGateCondition extends React.PureComponent { {metric.name}
    {!isDiff && - condition.period != null && ( -
    - {translate('quality_gates.conditions.leak')} -
    - )} + condition.period != null && ( +
    + {translate('quality_gates.conditions.leak')} +
    + )}
    {operator} {formatMeasure(threshold, metric.type)}
    diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/__snapshots__/ApplicationQualityGate-test.js.snap b/server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/__snapshots__/ApplicationQualityGate-test.js.snap index 326b9ecefb1..5a7f39cf4d9 100644 --- a/server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/__snapshots__/ApplicationQualityGate-test.js.snap +++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/__snapshots__/ApplicationQualityGate-test.js.snap @@ -34,6 +34,7 @@ exports[`renders 2`] = ` id="overview-quality-gate-conditions-list" >
  • {this.props.component.qualifier === 'TRK' && - !canTurnToPrivate && ( - - )} + !canTurnToPrivate && ( + + )} {this.state.disclaimer && ( {query.length > 0 && - query.length < 3 && ( -
    -
    {translateWithParameters('select2.tooShort', 3)}
    -
    -
    - )} + query.length < 3 && ( +
    +
    + {translateWithParameters('select2.tooShort', 3)} +
    +
    +
    + )}
    ); diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx index 7d3efb507bf..993345e2319 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/App.tsx @@ -152,13 +152,13 @@ export default class App extends React.PureComponent {
    {subComponents !== undefined && - totalSubComponents !== undefined && ( - - )} + totalSubComponents !== undefined && ( + + )}
  • ); } @@ -178,7 +178,7 @@ export default class App extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx index e71c0aed894..798e7b16dd2 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/ReleasabilityBox.tsx @@ -50,19 +50,19 @@ export default function ReleasabilityBox({ component, measures }: Props) { {effort && - Number(effort) > 0 && ( -
    - - - {' '} - {Number(effort) === 1 ? 'project' : 'projects'} - - {' '} - {translate('metric.level.ERROR')} -
    - )} + Number(effort) > 0 && ( +
    + + + {' '} + {Number(effort) === 1 ? 'project' : 'projects'} + + {' '} + {translate('metric.level.ERROR')} +
    + )} ); } diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx b/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx index 421eea14c96..ae676759a5a 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx +++ b/server/sonar-web/src/main/js/apps/portfolio/components/WorstProjects.tsx @@ -79,11 +79,9 @@ export default function WorstProjects({ component, subComponents, total }: Props {component.name} - {component.qualifier === 'TRK' ? ( - renderCell(component.measures, 'alert_status', 'LEVEL') - ) : ( - renderCell(component.measures, 'releasability_rating', 'RATING') - )} + {component.qualifier === 'TRK' + ? renderCell(component.measures, 'alert_status', 'LEVEL') + : renderCell(component.measures, 'releasability_rating', 'RATING')} {renderCell(component.measures, 'reliability_rating', 'RATING')} {renderCell(component.measures, 'security_rating', 'RATING')} {renderCell(component.measures, 'sqale_rating', 'RATING')} diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/Effort-test.tsx.snap b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/Effort-test.tsx.snap index 79fce89982d..989531cad1e 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/Effort-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/Effort-test.tsx.snap @@ -13,36 +13,36 @@ exports[`renders 1`] = ` onlyActiveOnIndex={false} style={Object {}} to={ - Object { - "pathname": "/component_measures", - "query": Object { - "branch": undefined, - "id": "foo", - "metric": "security_rating", - }, - } + Object { + "pathname": "/component_measures", + "query": Object { + "branch": undefined, + "id": "foo", + "metric": "security_rating", + }, + } } - > + > - - - projects_ + + + projects_ - , + , "rating": , + />, } } /> diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/RatingFreshness-test.tsx.snap b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/RatingFreshness-test.tsx.snap index ca9124758dc..7e0c44f1ca4 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/RatingFreshness-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/RatingFreshness-test.tsx.snap @@ -11,11 +11,11 @@ exports[`renders 1`] = ` Object { "date": , + />, "rating": , + />, } } /> diff --git a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/WorstProjects-test.tsx.snap b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/WorstProjects-test.tsx.snap index 1eaa2c0bdb9..c36279d6709 100644 --- a/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/WorstProjects-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/WorstProjects-test.tsx.snap @@ -41,7 +41,9 @@ exports[`renders 1`] = ` - + - + - + {selectedDate != null && - tooltipXPos != null && ( - - )} + tooltipXPos != null && ( + + )} )}
    diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js index 69065f1b708..2aa4137cc1d 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphsTooltips.js @@ -117,9 +117,9 @@ export default class GraphsTooltips extends React.PureComponent { /> )} {events && - events.length > 0 && ( - - )} + events.length > 0 && ( + + )} diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.js b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.js index 88bf5483c11..517e60cc26f 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.js @@ -105,7 +105,7 @@ export default class ProjectActivityAnalysis extends React.PureComponent { )} {(canAddVersion || canAddEvent) && - canDeleteAnalyses &&
  • } + canDeleteAnalyses &&
  • } {canDeleteAnalyses && (
  • diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsHistory-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsHistory-test.js.snap index fb809d1f599..b7de2ea3cfe 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsHistory-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsHistory-test.js.snap @@ -35,6 +35,7 @@ exports[`should correctly render a graph 1`] = ` graphEndDate={null} graphStartDate={null} isCustom={false} + key="0" leakPeriodDate="2017-05-16T13:50:02+0200" measuresHistory={Array []} removeCustomMetric={[Function]} @@ -79,6 +80,7 @@ exports[`should correctly render multiple graphs 1`] = ` graphEndDate={null} graphStartDate={null} isCustom={false} + key="0" leakPeriodDate="2017-05-16T13:50:02+0200" measuresHistory={Array []} removeCustomMetric={[Function]} @@ -116,6 +118,7 @@ exports[`should correctly render multiple graphs 1`] = ` graphEndDate={null} graphStartDate={null} isCustom={false} + key="1" leakPeriodDate="2017-05-16T13:50:02+0200" measuresHistory={Array []} removeCustomMetric={[Function]} diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsLegendCustom-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsLegendCustom-test.js.snap index cd8ec0cc2f4..b50a253ae4c 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsLegendCustom-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsLegendCustom-test.js.snap @@ -6,6 +6,7 @@ exports[`should render correctly the list of series 1`] = ` > diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsLegendStatic-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsLegendStatic-test.js.snap index 47cc682d03f..c8d7df8f28a 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsLegendStatic-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/GraphsLegendStatic-test.js.snap @@ -6,12 +6,14 @@ exports[`should render correctly the list of series 1`] = ` > -
  • +
  • @@ -32,6 +34,7 @@ exports[`should correctly filter analyses by category 1`] = `
  • @@ -86,7 +90,9 @@ exports[`should correctly filter analyses by date range 1`] = ` } } > -
  • +
  • @@ -108,6 +114,7 @@ exports[`should correctly filter analyses by date range 1`] = `
  • @@ -162,7 +170,9 @@ exports[`should render correctly 1`] = ` } } > -
  • +
  • @@ -184,6 +194,7 @@ exports[`should render correctly 1`] = `
  • @@ -237,6 +249,7 @@ exports[`should render correctly 1`] = ` deleteAnalysis={[Function]} deleteEvent={[Function]} isFirst={false} + key="A2" selected={false} updateSelectedDate={[Function]} /> @@ -244,7 +257,9 @@ exports[`should render correctly 1`] = `
  • -
  • +
  • @@ -266,6 +281,7 @@ exports[`should render correctly 1`] = `
  • @@ -313,6 +330,7 @@ exports[`should render correctly 1`] = `
  • diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap index 0e51a64862b..71e18479081 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityApp-test.js.snap @@ -6,6 +6,7 @@ exports[`should render correctly 1`] = ` id="project-activity" > diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityPageHeader-test.js.snap b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityPageHeader-test.js.snap index 1112cfa4ea8..12ff75c5342 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityPageHeader-test.js.snap +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/__tests__/__snapshots__/ProjectActivityPageHeader-test.js.snap @@ -15,6 +15,7 @@ exports[`should render correctly the list of series 1`] = ` clearRenderer={[Function]} clearValueText="Clear value" clearable={true} + closeOnSelect={true} deleteRemoves={true} delimiter="," disabled={false} @@ -35,6 +36,8 @@ exports[`should render correctly the list of series 1`] = ` onBlurResetsInput={true} onChange={[Function]} onCloseResetsInput={true} + onSelectResetsInput={true} + openOnClick={true} optionComponent={[Function]} options={ Array [ diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddGraphMetric.js b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddGraphMetric.js index ece4bdad6d7..bf9c646b599 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddGraphMetric.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/forms/AddGraphMetric.js @@ -128,17 +128,15 @@ export default class AddGraphMetric extends React.PureComponent { value={this.state.selectedMetric} /> - {metricsTypeFilter != null && metricsTypeFilter.length > 0 ? ( - translateWithParameters( - 'project_activity.graphs.custom.type_x_message', - metricsTypeFilter - .map(type => translate('metric.type', type)) - .sort() - .join(', ') - ) - ) : ( - translate('project_activity.graphs.custom.add_metric_info') - )} + {metricsTypeFilter != null && metricsTypeFilter.length > 0 + ? translateWithParameters( + 'project_activity.graphs.custom.type_x_message', + metricsTypeFilter + .map(type => translate('metric.type', type)) + .sort() + .join(', ') + ) + : translate('project_activity.graphs.custom.add_metric_info')}
    diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx index 66d14ed260f..5b8e9cb8c7f 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/DeleteBranchModal.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import { deleteBranch } from '../../../api/branches'; import { Branch } from '../../../app/types'; import { translate, translateWithParameters } from '../../../helpers/l10n'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx index 26d0c82f668..ac05eabcc07 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/LeakPeriodForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import SettingForm from './SettingForm'; import { translate } from '../../../helpers/l10n'; import { getValues, SettingValue } from '../../../api/settings'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPatternForm.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPatternForm.tsx index c773b3c737f..8a683b25529 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPatternForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/LongBranchesPatternForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import SettingForm from './SettingForm'; import { translate } from '../../../helpers/l10n'; import { SettingValue } from '../../../api/settings'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx index 02bd8572c9c..52a381eb90c 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/RenameBranchModal.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import { renameBranch } from '../../../api/branches'; import { Branch } from '../../../app/types'; import { translate } from '../../../helpers/l10n'; diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx index 41e8c9d439e..ba43512af0a 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/SettingForm.tsx @@ -118,24 +118,24 @@ export default class SettingForm extends React.PureComponent {
    {translate('settings._default')}
    )} {!setting.inherited && - setting.parentValue && ( -
    - {translateWithParameters('settings.default_x', setting.parentValue)} -
    - )} + setting.parentValue && ( +
    + {translateWithParameters('settings.default_x', setting.parentValue)} +
    + )}
  • diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx index 49674ef4d46..da5b8b61732 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesList.tsx @@ -71,6 +71,17 @@ export default class ProfilesList extends React.PureComponent { ); } + renderLanguage = (languageKey: string, profiles: Profile[] | undefined) => { + return ( +
    + + {profiles !== undefined && this.renderHeader(languageKey, profiles.length)} + {profiles !== undefined && this.renderProfiles(profiles)} +
    +
    + ); + }; + render() { const { profiles, languages } = this.props; const { language } = this.props.location.query; @@ -80,9 +91,7 @@ export default class ProfilesList extends React.PureComponent { profile => profile.language ); - const profilesToShow: { [language: string]: Profile[] } = language - ? pick(profilesIndex, language) - : profilesIndex; + const profilesToShow = language ? pick(profilesIndex, language) : profilesIndex; const languagesToShow = sortBy(Object.keys(profilesToShow)); @@ -98,19 +107,9 @@ export default class ProfilesList extends React.PureComponent {
    {translate('no_results')}
    )} - {languagesToShow.map(languageKey => ( -
    - - {profilesToShow[languageKey] != null && - this.renderHeader(languageKey, profilesToShow[languageKey].length)} - - - {profilesToShow[languageKey] != null && - this.renderProfiles(profilesToShow[languageKey])} - -
    -
    - ))} + {languagesToShow.map(languageKey => + this.renderLanguage(languageKey, profilesToShow[languageKey]) + )} ); } diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx index 021f5951af8..b63924e5a28 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/RestoreProfileForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import { restoreQualityProfile } from '../../../api/quality-profiles'; import { translate, translateWithParameters } from '../../../helpers/l10n'; @@ -102,23 +102,25 @@ export default class RestoreProfileForm extends React.PureComponent
    - {profile != null && ruleSuccesses != null ? ruleFailures ? ( -
    - {translateWithParameters( - 'quality_profiles.restore_profile.warning', - profile.name, - ruleSuccesses, - ruleFailures - )} -
    - ) : ( -
    - {translateWithParameters( - 'quality_profiles.restore_profile.success', - profile.name, - ruleSuccesses - )} -
    + {profile != null && ruleSuccesses != null ? ( + ruleFailures ? ( +
    + {translateWithParameters( + 'quality_profiles.restore_profile.warning', + profile.name, + ruleSuccesses, + ruleFailures + )} +
    + ) : ( +
    + {translateWithParameters( + 'quality_profiles.restore_profile.success', + profile.name, + ruleSuccesses + )} +
    + ) ) : (
    {!this.props.loading && - !this.props.secretKeyAvailable && ( - - )} + !this.props.secretKeyAvailable && ( + + )} {this.props.secretKeyAvailable && (

    diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthItem-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthItem-test.tsx.snap index 81f4aa9ba6a..6b224445797 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthItem-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/HealthItem-test.tsx.snap @@ -28,6 +28,7 @@ exports[`should render correctly 1`] = ` className="spacer-right" health="RED" healthCause="foo" + key="0" /> - + @@ -50,7 +52,9 @@ exports[`should render correctly 1`] = ` id="foo" > - + @@ -73,7 +77,9 @@ exports[`should render correctly 1`] = ` /> - + @@ -96,7 +102,9 @@ exports[`should render correctly 1`] = ` /> - + diff --git a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/SysInfoItem-test.tsx.snap b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/SysInfoItem-test.tsx.snap index b02b9854bdf..86c9310e1d7 100644 --- a/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/SysInfoItem-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/system/components/info-items/__tests__/__snapshots__/SysInfoItem-test.tsx.snap @@ -4,192 +4,206 @@ exports[`should render object correctly 1`] = ` Array [ + > - - - + + + + + + + + + + + +
    +
    + foo + + + + Far + + +
    + bar + + + + - foo - - - - Far - - - - - - - + - - - - + + - + b + + - - + + b + + + + + +
    - +
    - bar - - - + a + + - - - - - - - - - - - -
    - a - - - - 1 - - -
    - b - - - - b - - -
    - -
    -
    - baz - - + 1 + + +
    + - - - - ; - - - - -
    +
    +
    +
    + baz + + + + + + + ; + + + + +
    -
    , + , + > - - - - - - - - - - + + + + + + + + + +
    - a - - - - 1 - - -
    - b - - - - b - - -
    + a + + + + 1 + + +
    + b + + + + b + + +
    -
    , + , ] `; diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx index 0c508a86706..d69ff53c19b 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeForm.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import SystemUpgradeItem from './SystemUpgradeItem'; import { SystemUpgrade } from '../../../../api/system'; import { translate } from '../../../../helpers/l10n'; diff --git a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx index ccafec8a1aa..01d546ecdb1 100644 --- a/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx +++ b/server/sonar-web/src/main/js/apps/system/components/system-upgrade/SystemUpgradeIntermediate.tsx @@ -54,11 +54,9 @@ export default class SystemUpgradeIntermediate extends React.PureComponent - {showMore ? ( - translate('system.hide_intermediate_versions') - ) : ( - translate('system.show_intermediate_versions') - )} + {showMore + ? translate('system.hide_intermediate_versions') + : translate('system.show_intermediate_versions')}
    SonarQube 5.6.7 - , + , } } /> diff --git a/server/sonar-web/src/main/js/apps/system/utils.ts b/server/sonar-web/src/main/js/apps/system/utils.ts index 7d6ccca5a0d..613dccb9a93 100644 --- a/server/sonar-web/src/main/js/apps/system/utils.ts +++ b/server/sonar-web/src/main/js/apps/system/utils.ts @@ -54,7 +54,7 @@ export function ignoreInfoFields(sysInfoObject: SysValueObject): SysValueObject 'Name', PLUGINS_FIELD, SETTINGS_FIELD - ]); + ]) as SysValueObject; } export function getHealth(sysInfoObject: SysValueObject): HealthType { @@ -130,21 +130,21 @@ function getSystemData(sysInfoData: SysInfo): SysValueObject { export function getClusterMainCardSection(sysInfoData: ClusterSysInfo): SysValueObject { return { ...getSystemData(sysInfoData), - ...omit(sysInfoData, [ + ...(omit(sysInfoData, [ 'Application Nodes', PLUGINS_FIELD, 'Search Nodes', SETTINGS_FIELD, 'Statistics', 'System' - ]) + ]) as SysValueObject) }; } export function getStandaloneMainSections(sysInfoData: SysInfo): SysValueObject { return { ...getSystemData(sysInfoData), - ...omitBy( + ...(omitBy( sysInfoData, (value, key) => value == null || @@ -152,15 +152,17 @@ export function getStandaloneMainSections(sysInfoData: SysInfo): SysValueObject key.startsWith('Compute Engine') || key.startsWith('Search') || key.startsWith('Web') - ) + ) as SysValueObject) }; } export function getStandaloneSecondarySections(sysInfoData: SysInfo): SysInfoSection { return { - Web: pickBy(sysInfoData, (_, key) => key.startsWith('Web')), - 'Compute Engine': pickBy(sysInfoData, (_, key) => key.startsWith('Compute Engine')), - 'Search Engine': pickBy(sysInfoData, (_, key) => key.startsWith('Search')) + Web: pickBy(sysInfoData, (_, key) => key.startsWith('Web')) as SysValueObject, + 'Compute Engine': pickBy(sysInfoData, (_, key) => + key.startsWith('Compute Engine') + ) as SysValueObject, + 'Search Engine': pickBy(sysInfoData, (_, key) => key.startsWith('Search')) as SysValueObject }; } diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OrganizationStep.js b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OrganizationStep.js index 116b4c7d8c4..c890c3d9b38 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OrganizationStep.js +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OrganizationStep.js @@ -229,13 +229,13 @@ export default class OrganizationStep extends React.PureComponent { )} {this.getSelectedOrganization() != null && - !this.state.loading && ( -
    - -
    - )} + !this.state.loading && ( +
    + +
    + )}
    ); }; diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/Onboarding-test.js.snap b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/Onboarding-test.js.snap index 55409e86250..9c24b5b42a4 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/Onboarding-test.js.snap +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/__tests__/__snapshots__/Onboarding-test.js.snap @@ -5,6 +5,7 @@ exports[`guides for on-premise 1`] = ` className="modal-container" >
         foo
    -    bar
    +bar
       
    diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaGradle-test.js.snap b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaGradle-test.js.snap index 559864e0d90..9361ccc33a3 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaGradle-test.js.snap +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/commands/__tests__/__snapshots__/JavaGradle-test.js.snap @@ -17,8 +17,8 @@ exports[`renders correctly 1`] = ` />

    {user && - user.login && ( -

    - - {this.props.children} - {user.login} -
    - )} + user.login && ( +
    + + {this.props.children} + {user.login} +
    + )}
    ); } diff --git a/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UsersSelectSearch-test.js.snap b/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UsersSelectSearch-test.js.snap index 483f49d3ea0..900354c4376 100644 --- a/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UsersSelectSearch-test.js.snap +++ b/server/sonar-web/src/main/js/apps/users/components/__tests__/__snapshots__/UsersSelectSearch-test.js.snap @@ -12,6 +12,7 @@ exports[`should render correctly 1`] = ` clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + closeOnSelect={true} deleteRemoves={true} delimiter="," disabled={false} @@ -33,6 +34,8 @@ exports[`should render correctly 1`] = ` onChange={[Function]} onCloseResetsInput={true} onInputChange={[Function]} + onSelectResetsInput={true} + openOnClick={true} optionComponent={[Function]} options={Array []} pageSize={5} @@ -81,6 +84,7 @@ exports[`should render correctly 3`] = ` clearRenderer={[Function]} clearValueText="Clear value" clearable={false} + closeOnSelect={true} deleteRemoves={true} delimiter="," disabled={false} @@ -102,6 +106,8 @@ exports[`should render correctly 3`] = ` onChange={[Function]} onCloseResetsInput={true} onInputChange={[Function]} + onSelectResetsInput={true} + openOnClick={true} optionComponent={[Function]} options={ Array [ diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Action.tsx b/server/sonar-web/src/main/js/apps/web-api/components/Action.tsx index 06bce67949d..f0b5eed39e6 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Action.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/Action.tsx @@ -169,16 +169,16 @@ export default class Action extends React.PureComponent { {this.renderTabs()} {showParams && - action.params && ( - - )} + action.params && ( + + )} {showResponse && - action.hasResponseExample && } + action.hasResponseExample && } {showChangelog && }
    diff --git a/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx b/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx index 9f32210fc63..4dbacf06bd0 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/Params.tsx @@ -55,19 +55,19 @@ export default function Params({ params, showDeprecated, showInternal }: Props) )} {showDeprecated && - param.deprecatedKey && ( -
    - {param.deprecatedKey} -
    - )} + param.deprecatedKey && ( +
    + {param.deprecatedKey} +
    + )} {showDeprecated && - param.deprecatedKey && - param.deprecatedKeySince && ( -
    - -
    - )} + param.deprecatedKey && + param.deprecatedKeySince && ( +
    + +
    + )}
    {param.required ? 'required' : 'optional'} diff --git a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/ActionChangelog-test.tsx.snap b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/ActionChangelog-test.tsx.snap index 8c3eb7ace6d..b86b69c795d 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/ActionChangelog-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/ActionChangelog-test.tsx.snap @@ -6,6 +6,7 @@ exports[`should render 1`] = ` >
  • @@ -117,6 +118,7 @@ exports[`should also render actions with a description matching the query 1`] = "path": "api", } } + key="api/baz" showDeprecated={false} showInternal={false} /> @@ -233,6 +235,7 @@ exports[`should render deprecated actions 1`] = ` "path": "api", } } + key="api/foo" showDeprecated={true} showInternal={false} /> @@ -293,6 +296,7 @@ exports[`should render internal actions 1`] = ` "path": "api", } } + key="api/foo" showDeprecated={false} showInternal={true} /> @@ -361,6 +365,7 @@ exports[`should render only actions matching the query 1`] = ` "path": "api", } } + key="api/foo" showDeprecated={false} showInternal={false} /> diff --git a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/Menu-test.tsx.snap b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/Menu-test.tsx.snap index 34329aa2fbf..87783ec3cf9 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/Menu-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/web-api/components/__tests__/__snapshots__/Menu-test.tsx.snap @@ -9,6 +9,7 @@ exports[`should also render domains with an actions description matching the que > - + - +
    - + ); } diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineCode-test.js.snap b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineCode-test.js.snap index 9f6da3b0b4b..2cfc320db91 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineCode-test.js.snap +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineCode-test.js.snap @@ -11,21 +11,25 @@ exports[`render code 1`] = `
           
             class
           
           
              
           
           
             Foo
           
           
              {
           
    diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineDuplicationBlock-test.js.snap b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineDuplicationBlock-test.js.snap
    index 96f320c4382..c8a4ee23981 100644
    --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineDuplicationBlock-test.js.snap
    +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineDuplicationBlock-test.js.snap
    @@ -9,6 +9,7 @@ exports[`render duplicated line 1`] = `
         className="source-meta source-line-duplications-extra source-line-duplicated"
         data-index={1}
         data-line-number={3}
    +    key="1"
         onClick={[Function]}
         role="button"
         tabIndex="0"
    @@ -25,6 +26,7 @@ exports[`render not duplicated line 1`] = `
       className="source-meta source-line-duplications-extra"
       data-index={1}
       data-line-number={3}
    +  key="1"
     >
       
    - + - + - + - + - + - + - + - + - + - + @@ -249,7 +270,9 @@ exports[`renders with yValues, yTicks and yTooltips 1`] = ` a - + @@ -281,7 +305,9 @@ exports[`renders with yValues, yTicks and yTooltips 1`] = ` b - + diff --git a/server/sonar-web/src/main/js/components/common/RestartForm.tsx b/server/sonar-web/src/main/js/components/common/RestartForm.tsx index 98f4301ef39..ea72ec34478 100644 --- a/server/sonar-web/src/main/js/components/common/RestartForm.tsx +++ b/server/sonar-web/src/main/js/components/common/RestartForm.tsx @@ -19,7 +19,7 @@ */ import * as React from 'react'; import * as classNames from 'classnames'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; import { restartAndWait } from '../../api/system'; import { translate } from '../../helpers/l10n'; @@ -59,8 +59,7 @@ export default class RestartForm extends React.PureComponent { contentLabel={header} className="modal" overlayClassName="modal-overlay" - onRequestClose={this.props.onClose} - shouldCloseOnOverlayClick={!restarting}> + onRequestClose={restarting ? undefined : this.props.onClose}>

    {header}

    diff --git a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/MultiSelect-test.js.snap b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/MultiSelect-test.js.snap index e9a5eca76b5..2fa03425675 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/MultiSelect-test.js.snap +++ b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/MultiSelect-test.js.snap @@ -59,6 +59,7 @@ exports[`should render multiselect with selected elements 2`] = ` active={false} custom={false} element="bar" + key="bar" onHover={[Function]} onSelectChange={[Function]} selected={true} @@ -67,6 +68,7 @@ exports[`should render multiselect with selected elements 2`] = ` active={false} custom={false} element="foo" + key="foo" onHover={[Function]} onSelectChange={[Function]} selected={false} @@ -75,6 +77,7 @@ exports[`should render multiselect with selected elements 2`] = ` active={false} custom={false} element="baz" + key="baz" onHover={[Function]} onSelectChange={[Function]} selected={false} @@ -113,6 +116,7 @@ exports[`should render multiselect with selected elements 3`] = ` active={false} custom={false} element="bar" + key="bar" onHover={[Function]} onSelectChange={[Function]} selected={true} @@ -121,6 +125,7 @@ exports[`should render multiselect with selected elements 3`] = ` active={false} custom={false} element="foo" + key="foo" onHover={[Function]} onSelectChange={[Function]} selected={false} @@ -129,6 +134,7 @@ exports[`should render multiselect with selected elements 3`] = ` active={true} custom={false} element="baz" + key="baz" onHover={[Function]} onSelectChange={[Function]} selected={false} @@ -167,6 +173,7 @@ exports[`should render multiselect with selected elements 4`] = ` active={false} custom={false} element="bar" + key="bar" onHover={[Function]} onSelectChange={[Function]} selected={true} @@ -175,6 +182,7 @@ exports[`should render multiselect with selected elements 4`] = ` active={false} custom={false} element="foo" + key="foo" onHover={[Function]} onSelectChange={[Function]} selected={false} @@ -183,6 +191,7 @@ exports[`should render multiselect with selected elements 4`] = ` active={true} custom={false} element="baz" + key="baz" onHover={[Function]} onSelectChange={[Function]} selected={false} @@ -191,6 +200,7 @@ exports[`should render multiselect with selected elements 4`] = ` active={false} custom={true} element="test" + key="test" onHover={[Function]} onSelectChange={[Function]} selected={false} diff --git a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/SelectList-test.js.snap b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/SelectList-test.js.snap index 29ae52e453a..c1c91a2ba8e 100644 --- a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/SelectList-test.js.snap +++ b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/SelectList-test.js.snap @@ -33,6 +33,7 @@ exports[`should render correctly with children 1`] = ` @@ -44,6 +45,7 @@ exports[`should render correctly with children 1`] = ` @@ -55,6 +57,7 @@ exports[`should render correctly with children 1`] = ` @@ -73,18 +76,21 @@ exports[`should render correctly without children 1`] = ` diff --git a/server/sonar-web/src/main/js/components/controls/DateInput.tsx b/server/sonar-web/src/main/js/components/controls/DateInput.tsx index 265643354e6..1bb65c64457 100644 --- a/server/sonar-web/src/main/js/components/controls/DateInput.tsx +++ b/server/sonar-web/src/main/js/components/controls/DateInput.tsx @@ -87,7 +87,10 @@ export default class DateInput extends React.PureComponent { } render() { - const inputProps = pick(this.props, ['placeholder', 'name']); + const inputProps: { name?: string; placeholder?: string } = pick(this.props, [ + 'placeholder', + 'name' + ]); return ( diff --git a/server/sonar-web/src/main/js/components/controls/SearchSelect.js b/server/sonar-web/src/main/js/components/controls/SearchSelect.js index 39ca6539c59..496f039ca82 100644 --- a/server/sonar-web/src/main/js/components/controls/SearchSelect.js +++ b/server/sonar-web/src/main/js/components/controls/SearchSelect.js @@ -117,11 +117,9 @@ export default class SearchSelect extends React.PureComponent { filterOption={this.handleFilterOption} isLoading={this.state.loading} noResultsText={ - this.state.query.length < this.props.minimumQueryLength ? ( - translateWithParameters('select2.tooShort', this.props.minimumQueryLength) - ) : ( - translate('select2.noMatches') - ) + this.state.query.length < this.props.minimumQueryLength + ? translateWithParameters('select2.tooShort', this.props.minimumQueryLength) + : translate('select2.noMatches') } onBlur={this.props.resetOnBlur ? this.handleBlur : undefined} onChange={this.handleChange} diff --git a/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx b/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx index 825ace80a34..057fdf5b323 100644 --- a/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx +++ b/server/sonar-web/src/main/js/components/controls/SimpleModal.tsx @@ -18,7 +18,7 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import Modal from 'react-modal'; +import * as Modal from 'react-modal'; export interface ChildrenProps { onCloseClick: (event: React.SyntheticEvent) => void; diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioToggle-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioToggle-test.tsx.snap index c0aa0d1ab89..d9c8fa8d1f9 100644 --- a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioToggle-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/RadioToggle-test.tsx.snap @@ -4,7 +4,9 @@ exports[`accepts advanced options fields 1`] = `
    - + diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetSeverityPopup-test.js.snap b/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetSeverityPopup-test.js.snap index 8d0995dce23..bc4c8e02c7f 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetSeverityPopup-test.js.snap +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetSeverityPopup-test.js.snap @@ -19,6 +19,7 @@ exports[`should render tags popup correctly 1`] = ` > issue.transition.confirm issue.transition.resolve issue.transition.falsepositive issue.transition.wontfix diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetTypePopup-test.js.snap b/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetTypePopup-test.js.snap index fb727840075..6313549adb2 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetTypePopup-test.js.snap +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetTypePopup-test.js.snap @@ -17,6 +17,7 @@ exports[`should render tags popup correctly 1`] = ` > {selectedDate != null && - tooltipXPos != null && - tooltipIdx != null && ( - - )} + tooltipXPos != null && + tooltipIdx != null && ( + + )} )} diff --git a/server/sonar-web/src/main/js/components/preview-graph/__tests__/__snapshots__/PreviewGraphTooltips-test.js.snap b/server/sonar-web/src/main/js/components/preview-graph/__tests__/__snapshots__/PreviewGraphTooltips-test.js.snap index 64d9d39a3e4..bd558730f26 100644 --- a/server/sonar-web/src/main/js/components/preview-graph/__tests__/__snapshots__/PreviewGraphTooltips-test.js.snap +++ b/server/sonar-web/src/main/js/components/preview-graph/__tests__/__snapshots__/PreviewGraphTooltips-test.js.snap @@ -27,16 +27,19 @@ exports[`should render correctly 1`] = ` > f); -- cgit v1.2.3
    - )} + !this.props.displayAllIssues && ( + + )} (this.codeNode = node)}>{renderedTokens} {showIssues && - issues.length > 0 && ( - - )} + issues.length > 0 && ( + + )}
    @@ -53,6 +55,7 @@ exports[`should render the changelog popup correctly 1`] = ` "oldValue": "CRITICAL", } } + key="severity" />