From 3c858d79218344eccc264dc97dcf13aa571d813b Mon Sep 17 00:00:00 2001 From: Philippe Perrin Date: Mon, 30 Dec 2019 09:55:15 +0100 Subject: [PATCH] Fix formatting issues due to the new version of prettier --- .../src/components/SearchEntryResult.tsx | 5 ++++- server/sonar-docs/src/templates/page.tsx | 4 +--- server/sonar-web/src/main/js/api/ce.ts | 5 ++++- server/sonar-web/src/main/js/api/components.ts | 5 ++++- .../main/js/app/components/AdminContainer.tsx | 10 +++++----- .../src/main/js/app/components/App.tsx | 5 +---- .../js/app/components/ComponentContainer.tsx | 7 +------ .../app/components/GlobalMessagesContainer.tsx | 5 +---- .../main/js/app/components/StartupModal.tsx | 15 ++++++++------- .../a11y/__tests__/A11ySkipLinks-test.tsx | 5 ++++- .../__tests__/SuggestionsProvider-test.tsx | 5 ++++- .../js/app/components/extensions/Extension.tsx | 9 +-------- .../extensions/OrganizationPageExtension.tsx | 5 +---- .../extensions/ProjectAdminPageExtension.tsx | 5 +---- .../__tests__/ComponentNavMenu-test.tsx | 10 ++++++++-- .../js/app/components/nav/global/GlobalNav.tsx | 5 +---- .../__tests__/NotificationsSidebar-test.tsx | 5 ++++- server/sonar-web/src/main/js/app/index.ts | 5 ++++- .../main/js/apps/about/components/AboutApp.tsx | 5 +---- .../notifications/SonarCloudNotifications.tsx | 5 +---- .../__tests__/ProjectModal-test.tsx | 5 ++++- .../notifications/__tests__/Projects-test.tsx | 10 ++++++++-- .../organizations/UserOrganizations.tsx | 5 +---- .../components/BackgroundTasksApp.tsx | 5 +---- .../components/__tests__/Component-test.tsx | 5 ++++- .../components/BulkChangeModal.tsx | 8 +++++--- .../js/apps/coding-rules/components/Facet.tsx | 6 +++++- .../coding-rules/components/RuleDetails.tsx | 4 +++- .../coding-rules/components/RuleListItem.tsx | 5 ++++- .../__tests__/RuleDetailsIssues-test.tsx | 10 ++++++++-- .../apps/component-measures/components/App.tsx | 7 +------ .../components/__tests__/Breadcrumbs-test.tsx | 12 +++++------- .../create/organization/CreateOrganization.tsx | 9 +-------- .../__tests__/AutoOrganizationCreate-test.tsx | 5 ++++- .../__tests__/CreateOrganization-test.tsx | 7 ++++--- .../ManualOrganizationCreate-test.tsx | 5 ++++- .../project/CreateProjectPageSonarCloud.tsx | 7 +------ .../components/SearchResultEntry.tsx | 5 ++++- .../components/__tests__/App-test.tsx | 12 +++++------- .../__tests__/SearchResults-test.tsx | 13 +++++++++++-- .../src/main/js/apps/issues/components/App.tsx | 7 +------ .../__tests__/ConciseIssueLocations-test.tsx | 6 +++++- .../main/js/apps/issues/sidebar/TypeFacet.tsx | 5 +---- .../apps/organizationMembers/MembersList.tsx | 6 +++++- .../organizationMembers/MembersPageHeader.tsx | 4 +++- .../organizationMembers/SyncMemberForm.tsx | 5 +---- .../components/OrganizationDelete.tsx | 7 +------ .../components/OrganizationEdit.tsx | 5 +---- .../components/OrganizationPage.tsx | 5 +---- .../navigation/OrganizationNavigationMeta.tsx | 4 +++- .../apps/overview/components/OverviewApp.tsx | 5 +---- .../components/__tests__/Timeline-test.tsx | 14 ++++++++++++-- .../main/VulnerabilitiesAndHotspots.tsx | 4 +++- .../main/js/apps/overview/meta/MetaTags.tsx | 5 ++++- .../apps/overview/pullRequests/ReviewApp.tsx | 13 +++++++------ .../qualityGate/ApplicationQualityGate.tsx | 4 +++- .../apps/overview/qualityGate/QualityGate.tsx | 4 +++- .../src/main/js/apps/overview/utils.ts | 6 +++--- .../project/components/AppContainer.ts | 5 +---- .../shared/components/GroupHolder.tsx | 7 ++++--- .../shared/components/UserHolder.tsx | 7 ++++--- .../main/js/apps/portfolio/components/App.tsx | 5 +---- .../src/main/js/apps/projectActivity/utils.ts | 8 ++++---- .../__tests__/BranchLikeTabs-test.tsx | 2 +- .../apps/projectLinks/__tests__/App-test.tsx | 10 ++++------ .../main/js/apps/projectQualityGate/Header.tsx | 4 +++- .../js/apps/projectQualityProfiles/Header.tsx | 4 +++- .../js/apps/projects/__tests__/utils-test.ts | 18 +++++++++++------- .../components/__tests__/ProjectsList-test.tsx | 5 ++++- .../src/main/js/apps/projects/utils.ts | 5 ++++- .../apps/projectsManagement/AppContainer.tsx | 5 +---- .../__tests__/BulkApplyTemplateModal-test.tsx | 10 ++++++++-- .../components/BuiltInQualityGateBadge.tsx | 4 +++- .../quality-gates/components/Conditions.tsx | 4 +++- .../apps/quality-gates/components/Details.tsx | 5 +---- .../components/DetailsContent.tsx | 4 +++- .../quality-gates/components/DetailsHeader.tsx | 5 ++++- .../components/BuiltInQualityProfileBadge.tsx | 4 +++- .../details/ProfilePermissionsForm.tsx | 10 +++++++--- .../quality-profiles/details/ProfileRules.tsx | 14 +++++++++++--- .../quality-profiles/home/ProfilesList.tsx | 4 +++- .../quality-profiles/home/ProfilesListRow.tsx | 4 +++- .../home/__tests__/ProfilesListHeader-test.tsx | 5 ++++- .../sessions/components/LoginContainer.tsx | 5 +---- .../js/apps/sessions/components/Logout.tsx | 5 +---- .../apps/settings/components/AppContainer.tsx | 5 +---- .../components/CategoryDefinitionsList.tsx | 5 +---- .../js/apps/settings/components/Definition.tsx | 5 +---- .../components/inputs/PrimitiveInput.tsx | 2 +- .../main/js/apps/settings/store/definitions.ts | 5 +++-- .../JavaMavenTravisSonarCloud.tsx | 4 +--- .../tutorials/onboarding/OnboardingPage.tsx | 5 +---- .../components/MeasuresOverlay.tsx | 5 +++-- .../__tests__/LineIssuesList-test.tsx | 5 ++++- .../helpers/__tests__/issueLocations-test.ts | 6 +++--- .../common/PrivacyBadgeContainer.tsx | 8 ++++++-- .../js/components/controls/HomePageSelect.tsx | 5 +---- .../js/components/facet/ListStyleFacet.tsx | 6 +++++- .../components/hoc/withUserOrganizations.tsx | 5 +---- .../ui/__tests__/CoverageRating-test.tsx | 5 ++++- .../workspace/WorkspaceComponentViewer.tsx | 5 +---- .../workspace/__tests__/WorkspaceNav-test.tsx | 5 ++++- .../main/js/helpers/__tests__/issues-test.ts | 5 ++++- .../src/main/js/helpers/branch-like.ts | 5 ++++- .../sonar-web/src/main/js/helpers/testMocks.ts | 5 ++++- .../js/store/__tests__/organizations-test.ts | 10 ++++++++-- .../sonar-web/src/main/js/store/rootActions.ts | 10 ++++++++-- server/sonar-web/src/main/js/store/users.ts | 7 ++++--- .../src/main/js/store/utils/configureStore.ts | 5 +---- server/sonar-web/src/main/js/types/types.d.ts | 2 +- 110 files changed, 375 insertions(+), 307 deletions(-) diff --git a/server/sonar-docs/src/components/SearchEntryResult.tsx b/server/sonar-docs/src/components/SearchEntryResult.tsx index 98eddb8b48b..b1fa4727014 100644 --- a/server/sonar-docs/src/components/SearchEntryResult.tsx +++ b/server/sonar-docs/src/components/SearchEntryResult.tsx @@ -82,7 +82,10 @@ export function SearchResultText({ result }: ResultProps) { } if (tokens.length === 0 && textHighlights && textHighlights.length > 0) { - tokens = highlightMarks(text, textHighlights.map(h => ({ from: h[0], to: h[0] + h[1] }))); + tokens = highlightMarks( + text, + textHighlights.map(h => ({ from: h[0], to: h[0] + h[1] })) + ); } if (tokens.length) { diff --git a/server/sonar-docs/src/templates/page.tsx b/server/sonar-docs/src/templates/page.tsx index ac170eac2f9..0166f5f96d7 100644 --- a/server/sonar-docs/src/templates/page.tsx +++ b/server/sonar-docs/src/templates/page.tsx @@ -170,9 +170,7 @@ function removeExtraHeadings(content: string, headings: MarkdownHeading[]) { .filter( heading => content.indexOf( - `

${ - heading.value - }

` + `

${heading.value}

` ) < 0 ) .filter(heading => !heading.value || !heading.value.match(/Table of content/i)) diff --git a/server/sonar-web/src/main/js/api/ce.ts b/server/sonar-web/src/main/js/api/ce.ts index 2b08d5ebf99..76a2c52c22a 100644 --- a/server/sonar-web/src/main/js/api/ce.ts +++ b/server/sonar-web/src/main/js/api/ce.ts @@ -56,7 +56,10 @@ export function getTask(id: string, additionalFields?: string[]): Promise { - return post('/api/ce/cancel', { id }).then(() => getTask(id), () => getTask(id)); + return post('/api/ce/cancel', { id }).then( + () => getTask(id), + () => getTask(id) + ); } export function cancelAllTasks(): Promise { diff --git a/server/sonar-web/src/main/js/api/components.ts b/server/sonar-web/src/main/js/api/components.ts index 32b7933674e..4dcda51db9f 100644 --- a/server/sonar-web/src/main/js/api/components.ts +++ b/server/sonar-web/src/main/js/api/components.ts @@ -172,7 +172,10 @@ export function getComponentData(data: { component: string } & BranchParameters) export function doesComponentExists( data: { component: string } & BranchParameters ): Promise { - return getComponentData(data).then(({ component }) => component !== undefined, () => false); + return getComponentData(data).then( + ({ component }) => component !== undefined, + () => false + ); } export function getComponentShow(data: { component: string } & BranchParameters): Promise { diff --git a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx index e529fb06b02..38472339abf 100644 --- a/server/sonar-web/src/main/js/app/components/AdminContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/AdminContainer.tsx @@ -64,7 +64,10 @@ export class AdminContainer extends React.PureComponent { } fetchNavigationSettings = () => { - getSettingsNavigation().then(r => this.props.setAdminPages(r.extensions), () => {}); + getSettingsNavigation().then( + r => this.props.setAdminPages(r.extensions), + () => {} + ); }; fetchPendingPlugins = () => { @@ -145,7 +148,4 @@ const mapStateToProps = (state: Store) => ({ appState: getAppState(state) }); const mapDispatchToProps = { setAdminPages }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(AdminContainer); +export default connect(mapStateToProps, mapDispatchToProps)(AdminContainer); diff --git a/server/sonar-web/src/main/js/app/components/App.tsx b/server/sonar-web/src/main/js/app/components/App.tsx index 01724e4bb25..762fafe814b 100644 --- a/server/sonar-web/src/main/js/app/components/App.tsx +++ b/server/sonar-web/src/main/js/app/components/App.tsx @@ -124,7 +124,4 @@ const mapDispatchToProps = ({ fetchMyOrganizations } as any) as DispatchProps; -export default connect( - mapStateToProps, - mapDispatchToProps -)(App); +export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx index 7e645c6d434..71b1e848d52 100644 --- a/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/ComponentContainer.tsx @@ -354,9 +354,4 @@ export class ComponentContainer extends React.PureComponent { const mapDispatchToProps = { fetchOrganization, registerBranchStatus, requireAuthorization }; -export default withRouter( - connect( - null, - mapDispatchToProps - )(ComponentContainer) -); +export default withRouter(connect(null, mapDispatchToProps)(ComponentContainer)); diff --git a/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx b/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx index 582c97fe46f..474b4170d13 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalMessagesContainer.tsx @@ -28,7 +28,4 @@ const mapStateToProps = (state: Store) => ({ const mapDispatchToProps = { closeGlobalMessage }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(GlobalMessages); +export default connect(mapStateToProps, mapDispatchToProps)(GlobalMessages); diff --git a/server/sonar-web/src/main/js/app/components/StartupModal.tsx b/server/sonar-web/src/main/js/app/components/StartupModal.tsx index a8386549ec7..ef72317f94b 100644 --- a/server/sonar-web/src/main/js/app/components/StartupModal.tsx +++ b/server/sonar-web/src/main/js/app/components/StartupModal.tsx @@ -137,9 +137,13 @@ export class StartupModal extends React.PureComponent { if ( isSonarCloud() && this.props.currentUser.showOnboardingTutorial && - !['/about', '/documentation', '/onboarding', '/projects/create', '/create-organization'].some( - path => this.props.location.pathname.startsWith(path) - ) + ![ + '/about', + '/documentation', + '/onboarding', + '/projects/create', + '/create-organization' + ].some(path => this.props.location.pathname.startsWith(path)) ) { this.openOnboarding(); } @@ -170,7 +174,4 @@ const mapStateToProps = (state: Store): StateProps => ({ const mapDispatchToProps: DispatchProps = { skipOnboarding }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(withRouter(StartupModal)); +export default connect(mapStateToProps, mapDispatchToProps)(withRouter(StartupModal)); diff --git a/server/sonar-web/src/main/js/app/components/a11y/__tests__/A11ySkipLinks-test.tsx b/server/sonar-web/src/main/js/app/components/a11y/__tests__/A11ySkipLinks-test.tsx index 4ddc712961e..9d4f0351ec3 100644 --- a/server/sonar-web/src/main/js/app/components/a11y/__tests__/A11ySkipLinks-test.tsx +++ b/server/sonar-web/src/main/js/app/components/a11y/__tests__/A11ySkipLinks-test.tsx @@ -25,7 +25,10 @@ jest.mock('../A11yContext', () => ({ A11yContext: { Consumer: ({ children }: any) => { return children({ - links: [{ key: 'link1', label: 'Label 1' }, { key: 'link2', label: 'Label 2' }] + links: [ + { key: 'link1', label: 'Label 1' }, + { key: 'link2', label: 'Label 2' } + ] }); } } diff --git a/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/SuggestionsProvider-test.tsx b/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/SuggestionsProvider-test.tsx index 0ffd5f6c396..74fb95e0333 100644 --- a/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/SuggestionsProvider-test.tsx +++ b/server/sonar-web/src/main/js/app/components/embed-docs-modal/__tests__/SuggestionsProvider-test.tsx @@ -26,7 +26,10 @@ jest.mock( 'Docs/EmbedDocsSuggestions.json', () => ({ default: { - pageA: [{ link: '/foo', text: 'Foo' }, { link: '/bar', text: 'Bar', scope: 'sonarcloud' }], + pageA: [ + { link: '/foo', text: 'Foo' }, + { link: '/bar', text: 'Bar', scope: 'sonarcloud' } + ], pageB: [{ link: '/qux', text: 'Qux' }] } }), diff --git a/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx b/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx index 6c2896f4479..bf485facb95 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/Extension.tsx @@ -118,11 +118,4 @@ export class Extension extends React.PureComponent { const mapStateToProps = (state: Store) => ({ currentUser: getCurrentUser(state) }); const mapDispatchToProps = { onFail: addGlobalErrorMessage }; -export default injectIntl( - withRouter( - connect( - mapStateToProps, - mapDispatchToProps - )(Extension) - ) -); +export default injectIntl(withRouter(connect(mapStateToProps, mapDispatchToProps)(Extension))); diff --git a/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.tsx b/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.tsx index ec75dc3128e..91f8b3d6491 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/OrganizationPageExtension.tsx @@ -80,7 +80,4 @@ const mapStateToProps = (state: Store, ownProps: OwnProps) => ({ const mapDispatchToProps = { fetchOrganization }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(OrganizationPageExtension); +export default connect(mapStateToProps, mapDispatchToProps)(OrganizationPageExtension); diff --git a/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.tsx b/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.tsx index cc7a1a588da..323c45e2b3f 100644 --- a/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.tsx +++ b/server/sonar-web/src/main/js/app/components/extensions/ProjectAdminPageExtension.tsx @@ -45,7 +45,4 @@ function ProjectAdminPageExtension(props: Props) { const mapDispatchToProps = { onFail: addGlobalErrorMessage }; -export default connect( - null, - mapDispatchToProps -)(ProjectAdminPageExtension); +export default connect(null, mapDispatchToProps)(ProjectAdminPageExtension); diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMenu-test.tsx b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMenu-test.tsx index b328a4543a1..65ccaf5c12b 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMenu-test.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/ComponentNavMenu-test.tsx @@ -54,7 +54,10 @@ it('should work with multiple extensions', () => { ...baseComponent, configuration: { showSettings: true, - extensions: [{ key: 'foo', name: 'Foo' }, { key: 'bar', name: 'Bar' }] + extensions: [ + { key: 'foo', name: 'Foo' }, + { key: 'bar', name: 'Bar' } + ] }, extensions: [ { key: 'component-foo', name: 'ComponentFoo' }, @@ -77,7 +80,10 @@ it('should render correctly for security extensions', () => { ...baseComponent, configuration: { showSettings: true, - extensions: [{ key: 'securityreport/foo', name: 'Foo' }, { key: 'bar', name: 'Bar' }] + extensions: [ + { key: 'securityreport/foo', name: 'Foo' }, + { key: 'bar', name: 'Bar' } + ] }, extensions: [ { key: 'securityreport/foo', name: 'ComponentFoo' }, diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx index 05f043e52a4..4f63c9288e9 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.tsx @@ -241,7 +241,4 @@ const mapDispatchToProps = { setCurrentUserSetting }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(GlobalNav); +export default connect(mapStateToProps, mapDispatchToProps)(GlobalNav); diff --git a/server/sonar-web/src/main/js/app/components/notifications/__tests__/NotificationsSidebar-test.tsx b/server/sonar-web/src/main/js/app/components/notifications/__tests__/NotificationsSidebar-test.tsx index 7bbfab01fba..bf4656ca632 100644 --- a/server/sonar-web/src/main/js/app/components/notifications/__tests__/NotificationsSidebar-test.tsx +++ b/server/sonar-web/src/main/js/app/components/notifications/__tests__/NotificationsSidebar-test.tsx @@ -33,7 +33,10 @@ const news: Props['news'] = [ publicationDate: '2018-04-06', features: [ { - categories: [{ color: '#ff0000', name: 'Java' }, { color: '#00ff00', name: 'Rules' }], + categories: [ + { color: '#ff0000', name: 'Java' }, + { color: '#00ff00', name: 'Rules' } + ], description: '10 new Java rules' }, { diff --git a/server/sonar-web/src/main/js/app/index.ts b/server/sonar-web/src/main/js/app/index.ts index 804f41067c1..12f37993ff7 100644 --- a/server/sonar-web/src/main/js/app/index.ts +++ b/server/sonar-web/src/main/js/app/index.ts @@ -76,7 +76,10 @@ function setLanguage(lang: string) { const langToLoad = lang || DEFAULT_LANGUAGE; // No need to load english (default) bundle, it's coming with react-intl if (langToLoad !== DEFAULT_LANGUAGE) { - return loadLocaleData(langToLoad).then(() => langToLoad, () => DEFAULT_LANGUAGE); + return loadLocaleData(langToLoad).then( + () => langToLoad, + () => DEFAULT_LANGUAGE + ); } else { return DEFAULT_LANGUAGE; } diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx b/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx index f404aff339c..e07f2486190 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx +++ b/server/sonar-web/src/main/js/apps/about/components/AboutApp.tsx @@ -201,7 +201,4 @@ const mapStateToProps = (state: Store) => { const mapDispatchToProps = { fetchAboutPageSettings } as any; -export default connect( - mapStateToProps, - mapDispatchToProps -)(AboutApp); +export default connect(mapStateToProps, mapDispatchToProps)(AboutApp); diff --git a/server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx b/server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx index 3a821eb9b0b..26409ff4213 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/SonarCloudNotifications.tsx @@ -81,7 +81,4 @@ const mapDispatchToProps = { setCurrentUserSetting }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(SonarCloudNotifications); +export default connect(mapStateToProps, mapDispatchToProps)(SonarCloudNotifications); diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/ProjectModal-test.tsx b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/ProjectModal-test.tsx index 26931f215e7..96405555efe 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/ProjectModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/ProjectModal-test.tsx @@ -30,7 +30,10 @@ jest.mock('../../../../api/components', () => ({ results: [ { q: 'TRK', - items: [{ key: 'foo', name: 'Foo' }, { key: 'bar', name: 'Bar' }] + items: [ + { key: 'foo', name: 'Foo' }, + { key: 'bar', name: 'Bar' } + ] }, // this file should be ignored { q: 'FIL', items: [{ key: 'foo:file.js', name: 'file.js' }] } diff --git a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/Projects-test.tsx b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/Projects-test.tsx index 8f33ad36d40..3be66c43b12 100644 --- a/server/sonar-web/src/main/js/apps/account/notifications/__tests__/Projects-test.tsx +++ b/server/sonar-web/src/main/js/apps/account/notifications/__tests__/Projects-test.tsx @@ -27,7 +27,10 @@ jest.mock('../../../../api/components', () => ({ results: [ { q: 'TRK', - items: [{ key: 'foo', name: 'Foo' }, { key: 'bar', name: 'Bar' }] + items: [ + { key: 'foo', name: 'Foo' }, + { key: 'bar', name: 'Bar' } + ] }, // this file should be ignored { q: 'FIL', items: [{ key: 'foo:file.js', name: 'file.js' }] } @@ -44,7 +47,10 @@ const extraProps = { channel: 'channel1', type: 'type2' }; -const projects = [{ ...projectFoo, ...extraProps }, { ...projectBar, ...extraProps }]; +const projects = [ + { ...projectFoo, ...extraProps }, + { ...projectBar, ...extraProps } +]; it('should render projects', () => { const wrapper = shallowRender({ diff --git a/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx b/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx index 1000ef6981d..535d9edccc8 100644 --- a/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx +++ b/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.tsx @@ -110,7 +110,4 @@ const mapDispatchToProps = { fetchIfAnyoneCanCreateOrganizations: fetchIfAnyoneCanCreateOrganizations as any } as DispatchProps; -export default connect( - mapStateToProps, - mapDispatchToProps -)(UserOrganizations); +export default connect(mapStateToProps, mapDispatchToProps)(UserOrganizations); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx index ade93950644..23f2b3c78dd 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.tsx @@ -260,7 +260,4 @@ export class BackgroundTasksApp extends React.PureComponent { const mapDispatchToProps = { fetchOrganizations }; -export default connect( - null, - mapDispatchToProps -)(BackgroundTasksApp); +export default connect(null, mapDispatchToProps)(BackgroundTasksApp); diff --git a/server/sonar-web/src/main/js/apps/code/components/__tests__/Component-test.tsx b/server/sonar-web/src/main/js/apps/code/components/__tests__/Component-test.tsx index daddfa001b7..84d7b634a39 100644 --- a/server/sonar-web/src/main/js/apps/code/components/__tests__/Component-test.tsx +++ b/server/sonar-web/src/main/js/apps/code/components/__tests__/Component-test.tsx @@ -36,7 +36,10 @@ function shallowRender(props: Partial = {}) { component={mockComponentMeasure(false, { key: 'bar', name: 'Bar', - measures: [{ metric: 'bugs', value: '12' }, { metric: 'vulnerabilities', value: '1' }] + measures: [ + { metric: 'bugs', value: '12' }, + { metric: 'vulnerabilities', value: '1' } + ] })} metrics={[mockMetric({ key: 'bugs' }), mockMetric({ key: 'vulnerabilities' })]} rootComponent={mockComponentMeasure()} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx index 23b8724aaab..288c42c1b93 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/BulkChangeModal.tsx @@ -118,9 +118,11 @@ export default class BulkChangeModal extends React.PureComponent { for (const profile of profiles) { looper = looper.then(() => - method({ ...data, organization: this.props.organization, targetKey: profile }).then( - response => this.processResponse(profile, response) - ) + method({ + ...data, + organization: this.props.organization, + targetKey: profile + }).then(response => this.processResponse(profile, response)) ); } return looper; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx index 66144310426..4c81701d7d8 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/Facet.tsx @@ -99,7 +99,11 @@ export default class Facet extends React.PureComponent { const items = this.props.options || (stats && - sortBy(Object.keys(stats), key => -stats[key], key => renderTextName(key).toLowerCase())); + sortBy( + Object.keys(stats), + key => -stats[key], + key => renderTextName(key).toLowerCase() + )); return ( { )} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx index dfa86f63668..af8d9f833d2 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx @@ -56,7 +56,10 @@ export default class RuleListItem extends React.PureComponent { organization: this.props.organization, rule: this.props.rule.key }; - deactivateRule(data).then(() => this.props.onDeactivate(data.key, data.rule), () => {}); + deactivateRule(data).then( + () => this.props.onDeactivate(data.key, data.rule), + () => {} + ); } }; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsIssues-test.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsIssues-test.tsx index 20fcbb5f74a..b36aab6e8b8 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsIssues-test.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/__tests__/RuleDetailsIssues-test.tsx @@ -25,9 +25,15 @@ import { RuleDetailsIssues } from '../RuleDetailsIssues'; jest.mock('../../../../api/issues', () => ({ getFacet: jest.fn().mockResolvedValue({ - facet: [{ count: 13, val: 'sample-key' }, { count: 5, val: 'example-key' }], + facet: [ + { count: 13, val: 'sample-key' }, + { count: 5, val: 'example-key' } + ], response: { - components: [{ key: 'sample-key', name: 'Sample' }, { key: 'example-key', name: 'Example' }], + components: [ + { key: 'sample-key', name: 'Sample' }, + { key: 'example-key', name: 'Example' } + ], paging: { total: 18 } } }) diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx index 6bb6b79c662..fd3702c6d97 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/App.tsx @@ -342,9 +342,4 @@ export class App extends React.PureComponent { const mapDispatchToProps = { fetchBranchStatus: fetchBranchStatus as any }; -export default withRouter( - connect( - null, - mapDispatchToProps - )(App) -); +export default withRouter(connect(null, mapDispatchToProps)(App)); diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/Breadcrumbs-test.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/Breadcrumbs-test.tsx index 3d907df00ad..33abf501171 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/Breadcrumbs-test.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/Breadcrumbs-test.tsx @@ -24,13 +24,11 @@ import { getBreadcrumbs } from '../../../../api/components'; import Breadcrumbs from '../Breadcrumbs'; jest.mock('../../../../api/components', () => ({ - getBreadcrumbs: jest - .fn() - .mockResolvedValue([ - { key: 'anc1', name: 'Ancestor1' }, - { key: 'anc2', name: 'Ancestor2' }, - { key: 'bar', name: 'Bar' } - ]) + getBreadcrumbs: jest.fn().mockResolvedValue([ + { key: 'anc1', name: 'Ancestor1' }, + { key: 'anc2', name: 'Ancestor2' }, + { key: 'bar', name: 'Bar' } + ]) })); const componentFoo = { diff --git a/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx b/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx index 01562f9704a..dccf0488189 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/CreateOrganization.tsx @@ -453,12 +453,5 @@ const mapDispatchToProps = { }; export default whenLoggedIn( - withUserOrganizations( - withRouter( - connect( - null, - mapDispatchToProps - )(CreateOrganization) - ) - ) + withUserOrganizations(withRouter(connect(null, mapDispatchToProps)(CreateOrganization))) ); diff --git a/server/sonar-web/src/main/js/apps/create/organization/__tests__/AutoOrganizationCreate-test.tsx b/server/sonar-web/src/main/js/apps/create/organization/__tests__/AutoOrganizationCreate-test.tsx index f0233955a5e..9cc32402a55 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/__tests__/AutoOrganizationCreate-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/__tests__/AutoOrganizationCreate-test.tsx @@ -117,7 +117,10 @@ function shallowRender(props: Partial = {}) { onOrgCreated={jest.fn()} onUpgradeFail={jest.fn()} step={Step.OrganizationDetails} - subscriptionPlans={[{ maxNcloc: 100000, price: 10 }, { maxNcloc: 250000, price: 75 }]} + subscriptionPlans={[ + { maxNcloc: 100000, price: 10 }, + { maxNcloc: 250000, price: 75 } + ]} unboundOrganizations={[]} {...props} /> diff --git a/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx b/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx index 4c880e28218..8f7ae0cc6c7 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/__tests__/CreateOrganization-test.tsx @@ -42,9 +42,10 @@ import { import { CreateOrganization } from '../CreateOrganization'; jest.mock('../../../../api/billing', () => ({ - getSubscriptionPlans: jest - .fn() - .mockResolvedValue([{ maxNcloc: 100000, price: 10 }, { maxNcloc: 250000, price: 75 }]) + getSubscriptionPlans: jest.fn().mockResolvedValue([ + { maxNcloc: 100000, price: 10 }, + { maxNcloc: 250000, price: 75 } + ]) })); jest.mock('../../../../api/alm-integration', () => ({ diff --git a/server/sonar-web/src/main/js/apps/create/organization/__tests__/ManualOrganizationCreate-test.tsx b/server/sonar-web/src/main/js/apps/create/organization/__tests__/ManualOrganizationCreate-test.tsx index ef8a172ccc9..1dfd8d054af 100644 --- a/server/sonar-web/src/main/js/apps/create/organization/__tests__/ManualOrganizationCreate-test.tsx +++ b/server/sonar-web/src/main/js/apps/create/organization/__tests__/ManualOrganizationCreate-test.tsx @@ -49,7 +49,10 @@ function shallowRender(props: Partial = {}) { onDone={jest.fn()} onUpgradeFail={jest.fn()} step={Step.OrganizationDetails} - subscriptionPlans={[{ maxNcloc: 100000, price: 10 }, { maxNcloc: 250000, price: 75 }]} + subscriptionPlans={[ + { maxNcloc: 100000, price: 10 }, + { maxNcloc: 250000, price: 75 } + ]} {...props} /> ); diff --git a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarCloud.tsx b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarCloud.tsx index ac23b515e8b..c68bea05414 100644 --- a/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarCloud.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/CreateProjectPageSonarCloud.tsx @@ -180,10 +180,5 @@ export class CreateProjectPageSonarCloud extends React.PureComponent< const mapDispatchToProps = { skipOnboarding }; export default whenLoggedIn( - withUserOrganizations( - connect( - null, - mapDispatchToProps - )(CreateProjectPageSonarCloud) - ) + withUserOrganizations(connect(null, mapDispatchToProps)(CreateProjectPageSonarCloud)) ); diff --git a/server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx b/server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx index 37a4ba37c4a..97862383494 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/SearchResultEntry.tsx @@ -96,7 +96,10 @@ export function SearchResultText({ result }: { result: SearchResult }) { } if (tokens.length === 0 && textHighlights && textHighlights.length > 0) { - tokens = highlightMarks(text, textHighlights.map(h => ({ from: h[0], to: h[0] + h[1] }))); + tokens = highlightMarks( + text, + textHighlights.map(h => ({ from: h[0], to: h[0] + h[1] })) + ); } if (tokens.length) { diff --git a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/App-test.tsx index da36befcd1b..7fceb240516 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/App-test.tsx @@ -116,13 +116,11 @@ jest.mock('../../pages', () => { }); jest.mock('../../../../api/plugins', () => ({ - getInstalledPlugins: jest - .fn() - .mockResolvedValue([ - { key: 'csharp', documentationPath: 'static/documentation.md' }, - { key: 'vbnet', documentationPath: 'Sstatic/documentation.md' }, - { key: 'vbnett', documentationPath: undefined } - ]) + getInstalledPlugins: jest.fn().mockResolvedValue([ + { key: 'csharp', documentationPath: 'static/documentation.md' }, + { key: 'vbnet', documentationPath: 'Sstatic/documentation.md' }, + { key: 'vbnett', documentationPath: undefined } + ]) })); beforeEach(() => { diff --git a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/SearchResults-test.tsx b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/SearchResults-test.tsx index 13d2ee0ef2e..7c86dbbf296 100644 --- a/server/sonar-web/src/main/js/apps/documentation/components/__tests__/SearchResults-test.tsx +++ b/server/sonar-web/src/main/js/apps/documentation/components/__tests__/SearchResults-test.tsx @@ -32,7 +32,10 @@ jest.mock('lunr', () => ({ simply: { title: { position: [[19, 5]] }, text: { - position: [[15, 6], [28, 4]], + position: [ + [15, 6], + [28, 4] + ], tokenContext: ['is simply dummy', 'simply dummy text'] } } @@ -45,7 +48,13 @@ jest.mock('lunr', () => ({ metadata: { simply: { title: { position: [[23, 4]] }, - text: { position: [[111, 6], [118, 4]], tokenContext: ['keywords simply text'] } + text: { + position: [ + [111, 6], + [118, 4] + ], + tokenContext: ['keywords simply text'] + } } } } diff --git a/server/sonar-web/src/main/js/apps/issues/components/App.tsx b/server/sonar-web/src/main/js/apps/issues/components/App.tsx index 51a16d0d3c4..4c5adfe7848 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/App.tsx @@ -1185,9 +1185,4 @@ export class App extends React.PureComponent { const mapDispatchToProps = { fetchBranchStatus: fetchBranchStatus as any }; -export default withRouter( - connect( - null, - mapDispatchToProps - )(App) -); +export default withRouter(connect(null, mapDispatchToProps)(App)); diff --git a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssueLocations-test.tsx b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssueLocations-test.tsx index 6cc8b07c1b1..e6699d2ac62 100644 --- a/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssueLocations-test.tsx +++ b/server/sonar-web/src/main/js/apps/issues/conciseIssuesList/__tests__/ConciseIssueLocations-test.tsx @@ -51,7 +51,11 @@ it('should render one flow', () => { it('should render several flows', () => { const issue = { - flows: [[loc, loc, loc], [loc, loc], [loc, loc, loc]], + flows: [ + [loc, loc, loc], + [loc, loc], + [loc, loc, loc] + ], secondaryLocations: [] }; expect( diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx index abd4ad6c546..730a35a37a5 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/TypeFacet.tsx @@ -182,7 +182,4 @@ const mapDispatchToProps = { setCurrentUserSetting }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(TypeFacet); +export default connect(mapStateToProps, mapDispatchToProps)(TypeFacet); diff --git a/server/sonar-web/src/main/js/apps/organizationMembers/MembersList.tsx b/server/sonar-web/src/main/js/apps/organizationMembers/MembersList.tsx index f20de765cb2..43041f70706 100644 --- a/server/sonar-web/src/main/js/apps/organizationMembers/MembersList.tsx +++ b/server/sonar-web/src/main/js/apps/organizationMembers/MembersList.tsx @@ -43,7 +43,11 @@ export default class MembersList extends React.PureComponent { return
{translate('no_results')}
; } - const sortedMembers = sortBy(members, member => member.name, member => member.login); + const sortedMembers = sortBy( + members, + member => member.name, + member => member.login + ); return (
diff --git a/server/sonar-web/src/main/js/apps/organizationMembers/MembersPageHeader.tsx b/server/sonar-web/src/main/js/apps/organizationMembers/MembersPageHeader.tsx index 0b6978e4590..7da1dc00afe 100644 --- a/server/sonar-web/src/main/js/apps/organizationMembers/MembersPageHeader.tsx +++ b/server/sonar-web/src/main/js/apps/organizationMembers/MembersPageHeader.tsx @@ -72,7 +72,9 @@ export default function MembersPageHeader(props: Props) { /> )} diff --git a/server/sonar-web/src/main/js/apps/organizationMembers/SyncMemberForm.tsx b/server/sonar-web/src/main/js/apps/organizationMembers/SyncMemberForm.tsx index beca324f264..0058848e0e7 100644 --- a/server/sonar-web/src/main/js/apps/organizationMembers/SyncMemberForm.tsx +++ b/server/sonar-web/src/main/js/apps/organizationMembers/SyncMemberForm.tsx @@ -173,7 +173,4 @@ export class SyncMemberForm extends React.PureComponent { const mapDispatchToProps = { fetchOrganization }; -export default connect( - null, - mapDispatchToProps -)(SyncMemberForm); +export default connect(null, mapDispatchToProps)(SyncMemberForm); diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationDelete.tsx b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationDelete.tsx index 97ae9e70640..9c0f0e35612 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationDelete.tsx +++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationDelete.tsx @@ -163,9 +163,4 @@ export class OrganizationDelete extends React.PureComponent { const mapDispatchToProps: DispatchToProps = { deleteOrganization: deleteOrganization as any }; -export default withRouter( - connect( - null, - mapDispatchToProps - )(OrganizationDelete) -); +export default withRouter(connect(null, mapDispatchToProps)(OrganizationDelete)); diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx index 993f14040b9..1acfae24c84 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx +++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationEdit.tsx @@ -220,7 +220,4 @@ export class OrganizationEdit extends React.PureComponent { const mapDispatchToProps = { updateOrganization: updateOrganization as any }; -export default connect( - null, - mapDispatchToProps -)(whenLoggedIn(OrganizationEdit)); +export default connect(null, mapDispatchToProps)(whenLoggedIn(OrganizationEdit)); diff --git a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationPage.tsx b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationPage.tsx index 9422be09cd4..a45f72f1bc5 100644 --- a/server/sonar-web/src/main/js/apps/organizations/components/OrganizationPage.tsx +++ b/server/sonar-web/src/main/js/apps/organizations/components/OrganizationPage.tsx @@ -119,7 +119,4 @@ const mapStateToProps = (state: Store, ownProps: OwnProps) => ({ const mapDispatchToProps = { fetchOrganization: fetchOrganization as any }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(OrganizationPage); +export default connect(mapStateToProps, mapDispatchToProps)(OrganizationPage); diff --git a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigationMeta.tsx b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigationMeta.tsx index 893fae2e9f9..b1b2b447103 100644 --- a/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigationMeta.tsx +++ b/server/sonar-web/src/main/js/apps/organizations/navigation/OrganizationNavigationMeta.tsx @@ -52,7 +52,9 @@ export default function OrganizationNavigationMeta({ hasPrivateAccess(currentUser, organization, userOrganizations) && ( + doc={import( + /* webpackMode: "eager" */ 'Docs/tooltips/organizations/subscription-paid-plan.md' + )}>
{translate('organization.paid_plan.badge')}
)} diff --git a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx index 6237377b2a8..c1ffe7d11ca 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/OverviewApp.tsx @@ -338,7 +338,4 @@ const mapDispatchToProps = { fetchMetrics }; const mapStateToProps = (state: Store) => ({ metrics: getMetrics(state) }); -export default connect( - mapStateToProps, - mapDispatchToProps -)(OverviewApp); +export default connect(mapStateToProps, mapDispatchToProps)(OverviewApp); diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/Timeline-test.tsx b/server/sonar-web/src/main/js/apps/overview/components/__tests__/Timeline-test.tsx index d8bafc64a8a..b4657cb2a94 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/Timeline-test.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/Timeline-test.tsx @@ -43,10 +43,20 @@ it('should have a correct domain with strings or numbers', () => { const wrapper = shallow(); expect(wrapper.find('LineChart').prop('domain')).toEqual([0, 360]); - wrapper.setProps({ history: [{ date, value: '360.33' }, { date, value: '39.54' }] }); + wrapper.setProps({ + history: [ + { date, value: '360.33' }, + { date, value: '39.54' } + ] + }); expect(wrapper.find('LineChart').prop('domain')).toEqual([0, 360.33]); - wrapper.setProps({ history: [{ date, value: 360 }, { date, value: 39 }] }); + wrapper.setProps({ + history: [ + { date, value: 360 }, + { date, value: 39 } + ] + }); expect(wrapper.find('LineChart').prop('domain')).toEqual([0, 360]); }); diff --git a/server/sonar-web/src/main/js/apps/overview/main/VulnerabilitiesAndHotspots.tsx b/server/sonar-web/src/main/js/apps/overview/main/VulnerabilitiesAndHotspots.tsx index a8c89f7ff13..d573f8438c6 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/VulnerabilitiesAndHotspots.tsx +++ b/server/sonar-web/src/main/js/apps/overview/main/VulnerabilitiesAndHotspots.tsx @@ -98,7 +98,9 @@ export class VulnerabiltiesAndHotspots extends React.PureComponent {this.props.renderHistoryLink('security_hotspots')} diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx b/server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx index 65f5902873c..daabdb36ee0 100644 --- a/server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx +++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaTags.tsx @@ -50,7 +50,10 @@ export default class MetaTags extends React.PureComponent { setProjectTags({ project: this.props.component.key, tags: values.join(',') - }).then(() => this.props.onComponentChange({ tags: values }), () => {}); + }).then( + () => this.props.onComponentChange({ tags: values }), + () => {} + ); }; render() { diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/ReviewApp.tsx b/server/sonar-web/src/main/js/apps/overview/pullRequests/ReviewApp.tsx index c84f09aa15e..5eecd8b1964 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/ReviewApp.tsx +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/ReviewApp.tsx @@ -143,7 +143,9 @@ export class ReviewApp extends React.PureComponent { {translate('overview.quality_gate')} @@ -181,7 +183,9 @@ export class ReviewApp extends React.PureComponent { branchLike={branchLike} className="overview-domain-measure-value" component={component} - docTooltip={import(/* webpackMode: "eager" */ 'Docs/tooltips/metrics/security-hotspots.md')} + docTooltip={import( + /* webpackMode: "eager" */ 'Docs/tooltips/metrics/security-hotspots.md' + )} measures={measures} type="SECURITY_HOTSPOT" /> @@ -236,7 +240,4 @@ const mapStateToProps = (state: Store, { branchLike, component }: OwnProps) => { const mapDispatchToProps = { fetchBranchStatus: fetchBranchStatus as any }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(ReviewApp); +export default connect(mapStateToProps, mapDispatchToProps)(ReviewApp); diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx b/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx index 7293f91b062..4ea8cd6fc49 100644 --- a/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx +++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/ApplicationQualityGate.tsx @@ -94,7 +94,9 @@ export default class ApplicationQualityGate extends React.PureComponent} {status != null && } {status === 'WARN' && ( diff --git a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGate.tsx b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGate.tsx index bfc0d0b2e02..c86f69a16f4 100644 --- a/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGate.tsx +++ b/server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGate.tsx @@ -57,7 +57,9 @@ export default function QualityGate({ branchLike, component, measures }: Props)

{translate('overview.quality_gate')}

{level && } {level === 'WARN' && ( diff --git a/server/sonar-web/src/main/js/apps/overview/utils.ts b/server/sonar-web/src/main/js/apps/overview/utils.ts index 961971c18f4..f07c3f1768c 100644 --- a/server/sonar-web/src/main/js/apps/overview/utils.ts +++ b/server/sonar-web/src/main/js/apps/overview/utils.ts @@ -166,9 +166,9 @@ export function getThreshold(measures: T.MeasureEnhanced[], metricKey: string): const condition = conditions.find(c => c.metric === metricKey); if (condition) { - return parseFloat((condition.level === 'ERROR' - ? condition.error - : condition.warning) as string); + return parseFloat( + (condition.level === 'ERROR' ? condition.error : condition.warning) as string + ); } } return undefined; diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/AppContainer.ts b/server/sonar-web/src/main/js/apps/permissions/project/components/AppContainer.ts index 4a35db43f3e..ed56f9fec33 100644 --- a/server/sonar-web/src/main/js/apps/permissions/project/components/AppContainer.ts +++ b/server/sonar-web/src/main/js/apps/permissions/project/components/AppContainer.ts @@ -34,7 +34,4 @@ const mapStateToProps = (state: Store, { component }: OwnProps) => ({ const mapDispatchToProps = { fetchOrganization }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(App); +export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.tsx index a9c8de8cd17..a8afd45e505 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/GroupHolder.tsx @@ -55,9 +55,10 @@ export default class GroupHolder extends React.PureComponent { handleCheck = (_checked: boolean, permission?: string) => { if (permission !== undefined) { this.setState(state => ({ loading: [...state.loading, permission] })); - this.props - .onToggle(this.props.group, permission) - .then(() => this.stopLoading(permission), () => this.stopLoading(permission)); + this.props.onToggle(this.props.group, permission).then( + () => this.stopLoading(permission), + () => this.stopLoading(permission) + ); } }; diff --git a/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.tsx b/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.tsx index dd00ea3f832..bed22058c00 100644 --- a/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.tsx +++ b/server/sonar-web/src/main/js/apps/permissions/shared/components/UserHolder.tsx @@ -57,9 +57,10 @@ export default class UserHolder extends React.PureComponent { handleCheck = (_checked: boolean, permission?: string) => { if (permission !== undefined) { this.setState(state => ({ loading: [...state.loading, permission] })); - this.props - .onToggle(this.props.user, permission) - .then(() => this.stopLoading(permission), () => this.stopLoading(permission)); + this.props.onToggle(this.props.user, permission).then( + () => this.stopLoading(permission), + () => this.stopLoading(permission) + ); } }; 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 410b0c0d4d6..ad9076bf6f1 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 @@ -226,7 +226,4 @@ const mapStateToProps = (state: Store): StateToProps => ({ metrics: getMetrics(state) }); -export default connect( - mapStateToProps, - mapDispatchToProps -)(App); +export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/server/sonar-web/src/main/js/apps/projectActivity/utils.ts b/server/sonar-web/src/main/js/apps/projectActivity/utils.ts index 82dd6bdd1bc..90cdb201834 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/utils.ts +++ b/server/sonar-web/src/main/js/apps/projectActivity/utils.ts @@ -180,10 +180,10 @@ export function generateSeries( } export function splitSeriesInGraphs(series: Serie[], maxGraph: number, maxSeries: number) { - return flatMap(groupBy(series, serie => serie.type), type => chunk(type, maxSeries)).slice( - 0, - maxGraph - ); + return flatMap( + groupBy(series, serie => serie.type), + type => chunk(type, maxSeries) + ).slice(0, maxGraph); } export function getSeriesMetricType(series: Serie[]) { diff --git a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx index 805017d88d0..4a4b917cf7b 100644 --- a/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectBranches/components/__tests__/BranchLikeTabs-test.tsx @@ -38,7 +38,7 @@ it('should render all tabs correctly', () => { expect(wrapper.state().currentTab).toBe(Tabs.Branch); expect(wrapper).toMatchSnapshot(); - const onSelect = wrapper.find(BoxedTabs).prop('onSelect') as ((currentTab: Tabs) => void); + const onSelect = wrapper.find(BoxedTabs).prop('onSelect') as (currentTab: Tabs) => void; onSelect(Tabs.PullRequest); expect(wrapper.state().currentTab).toBe(Tabs.PullRequest); diff --git a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx index 64230d1b54f..e2e0e5e0020 100644 --- a/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectLinks/__tests__/App-test.tsx @@ -25,12 +25,10 @@ import App from '../App'; // import { getProjectLinks, createLink, deleteLink } from '../../api/projectLinks'; jest.mock('../../../api/projectLinks', () => ({ - getProjectLinks: jest - .fn() - .mockResolvedValue([ - { id: '1', type: 'homepage', url: 'http://example.com' }, - { id: '2', name: 'foo', type: 'foo', url: 'http://example.com/foo' } - ]), + getProjectLinks: jest.fn().mockResolvedValue([ + { id: '1', type: 'homepage', url: 'http://example.com' }, + { id: '2', name: 'foo', type: 'foo', url: 'http://example.com/foo' } + ]), createLink: jest .fn() .mockResolvedValue({ id: '3', name: 'bar', type: 'bar', url: 'http://example.com/bar' }), diff --git a/server/sonar-web/src/main/js/apps/projectQualityGate/Header.tsx b/server/sonar-web/src/main/js/apps/projectQualityGate/Header.tsx index ef39e9b100e..48441cf0549 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityGate/Header.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityGate/Header.tsx @@ -28,7 +28,9 @@ export default function Header() {

{translate('project_quality_gate.page')}

{translate('project_quality_gate.page.description')}
diff --git a/server/sonar-web/src/main/js/apps/projectQualityProfiles/Header.tsx b/server/sonar-web/src/main/js/apps/projectQualityProfiles/Header.tsx index 1f8368b6a32..fb6ebce51eb 100644 --- a/server/sonar-web/src/main/js/apps/projectQualityProfiles/Header.tsx +++ b/server/sonar-web/src/main/js/apps/projectQualityProfiles/Header.tsx @@ -28,7 +28,9 @@ export default function Header() {

{translate('project_quality_profiles.page')}

diff --git a/server/sonar-web/src/main/js/apps/projects/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/projects/__tests__/utils-test.ts index 11d00c65698..6f129e19fed 100644 --- a/server/sonar-web/src/main/js/apps/projects/__tests__/utils-test.ts +++ b/server/sonar-web/src/main/js/apps/projects/__tests__/utils-test.ts @@ -26,12 +26,10 @@ jest.mock('../../../api/components', () => ({ })); jest.mock('../../../api/measures', () => ({ - getMeasuresForProjects: jest - .fn() - .mockResolvedValue([ - { component: 'foo', metric: 'new_coverage', periods: [{ index: 1, value: '10' }] }, - { component: 'bar', metric: 'languages', value: '20' } - ]) + getMeasuresForProjects: jest.fn().mockResolvedValue([ + { component: 'foo', metric: 'new_coverage', periods: [{ index: 1, value: '10' }] }, + { component: 'bar', metric: 'languages', value: '20' } + ]) })); jest.mock('../../../api/organizations', () => ({ @@ -118,7 +116,13 @@ describe('fetchProjects', () => { components, facets: [ { property: 'new_coverage', values: [{ val: 'NO_DATA', count: 0 }] }, - { property: 'languages', values: [{ val: 'css', count: 10 }, { val: 'js', count: 2 }] } + { + property: 'languages', + values: [ + { val: 'css', count: 10 }, + { val: 'js', count: 2 } + ] + } ], paging: { total: 2 } }); diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsList-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsList-test.tsx index f2b289c0ae2..160b343c4bf 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsList-test.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsList-test.tsx @@ -39,7 +39,10 @@ function shallowRender(props?: any) { isFavorite={false} isFiltered={false} organization={undefined} - projects={[{ key: 'foo', name: 'Foo' }, { key: 'bar', name: 'Bar' }]} + projects={[ + { key: 'foo', name: 'Foo' }, + { key: 'bar', name: 'Bar' } + ]} {...props} /> ); diff --git a/server/sonar-web/src/main/js/apps/projects/utils.ts b/server/sonar-web/src/main/js/apps/projects/utils.ts index 846fa23aceb..80290cb7eda 100644 --- a/server/sonar-web/src/main/js/apps/projects/utils.ts +++ b/server/sonar-web/src/main/js/apps/projects/utils.ts @@ -74,7 +74,10 @@ export const SORTING_SWITCH: T.Dict = { new_lines: 'size' }; -export const VIEWS = [{ value: 'overall', label: 'overall' }, { value: 'leak', label: 'new_code' }]; +export const VIEWS = [ + { value: 'overall', label: 'overall' }, + { value: 'leak', label: 'new_code' } +]; export const VISUALIZATIONS = [ 'risk', diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/AppContainer.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/AppContainer.tsx index 059abe09b68..205b7f21d7f 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/AppContainer.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/AppContainer.tsx @@ -106,7 +106,4 @@ const mapDispatchToProps = (dispatch: Function) => ({ dispatch(onVisibilityChange(organization, visibility)) }); -export default connect( - mapStateToProps, - mapDispatchToProps -)(AppContainer); +export default connect(mapStateToProps, mapDispatchToProps)(AppContainer); diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx index fa322c647cc..5c6dc5a98b2 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/__tests__/BulkApplyTemplateModal-test.tsx @@ -51,7 +51,10 @@ it('bulk applies template to all results', async () => { wrapper.setState({ loading: false, permissionTemplate: 'foo', - permissionTemplates: [{ id: 'foo', name: 'Foo' }, { id: 'bar', name: 'Bar' }] + permissionTemplates: [ + { id: 'foo', name: 'Foo' }, + { id: 'bar', name: 'Bar' } + ] }); expect(wrapper).toMatchSnapshot(); @@ -78,7 +81,10 @@ it('bulk applies template to selected results', async () => { wrapper.setState({ loading: false, permissionTemplate: 'foo', - permissionTemplates: [{ id: 'foo', name: 'Foo' }, { id: 'bar', name: 'Bar' }] + permissionTemplates: [ + { id: 'foo', name: 'Foo' }, + { id: 'bar', name: 'Bar' } + ] }); expect(wrapper).toMatchSnapshot(); diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx index 9acb218d71c..9ad8042eaf0 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx @@ -29,7 +29,9 @@ interface Props { export default function BuiltInQualityGateBadge({ className }: Props) { return ( + doc={import( + /* webpackMode: "eager" */ 'Docs/tooltips/quality-gates/built-in-quality-gate.md' + )}>
{translate('quality_gates.built_in')}
); diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx index bb12fa3b403..a56963b5fe7 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.tsx @@ -158,7 +158,9 @@ export class Conditions extends React.PureComponent {

{translate('quality_gates.conditions')}

diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx index e2f2dff4fa9..d397331263d 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Details.tsx @@ -169,7 +169,4 @@ const mapStateToProps = (state: Store): StateToProps => ({ metrics: getMetrics(state) }); -export default connect( - mapStateToProps, - mapDispatchToProps -)(Details); +export default connect(mapStateToProps, mapDispatchToProps)(Details); diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx index bf13d082f92..c6e95495a9b 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsContent.tsx @@ -57,7 +57,9 @@ export default class DetailsContent extends React.PureComponent {

{translate('quality_gates.projects')}

{isDefault ? ( diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx index 4d61edff81b..88f59a46d5c 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx @@ -38,7 +38,10 @@ interface Props { export default class DetailsHeader extends React.PureComponent { handleActionRefresh = () => { const { refreshItem, refreshList } = this.props; - return Promise.all([refreshItem(), refreshList()]).then(() => {}, () => {}); + return Promise.all([refreshItem(), refreshList()]).then( + () => {}, + () => {} + ); }; handleSetAsDefaultClick = () => { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx index 58afabbc5ab..45498dcec7c 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/components/BuiltInQualityProfileBadge.tsx @@ -37,7 +37,9 @@ export default function BuiltInQualityProfileBadge({ className, tooltip = true } if (tooltip) { return ( + doc={import( + /* webpackMode: "eager" */ 'Docs/tooltips/quality-profiles/built-in-quality-profile.md' + )}> {badge} ); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx index 2043f825c8f..2a05242e2fd 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfilePermissionsForm.tsx @@ -100,9 +100,13 @@ export default class ProfilePermissionsForm extends React.PureComponent [...usersResponse.users, ...groupsResponse.groups] - ); + return Promise.all([ + searchUsers(parameters), + searchGroups(parameters) + ]).then(([usersResponse, groupsResponse]) => [ + ...usersResponse.users, + ...groupsResponse.groups + ]); }; handleValueChange = (selected: T.UserSelected | Group) => { diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx index da067067b1d..ac97a69c436 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/details/ProfileRules.tsx @@ -57,8 +57,14 @@ export default class ProfileRules extends React.PureComponent { state: State = { activatedTotal: null, - activatedByType: keyBy(TYPES.map(t => ({ val: t, count: null })), 'val'), - allByType: keyBy(TYPES.map(t => ({ val: t, count: null })), 'val'), + activatedByType: keyBy( + TYPES.map(t => ({ val: t, count: null })), + 'val' + ), + allByType: keyBy( + TYPES.map(t => ({ val: t, count: null })), + 'val' + ), compareToSonarWay: null, total: null }; @@ -192,7 +198,9 @@ export default class ProfileRules extends React.PureComponent { {actions.copy && profile.isBuiltIn && (
+ doc={import( + /* webpackMode: "eager" */ 'Docs/tooltips/quality-profiles/activate-rules-in-built-in-profile.md' + )}> 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 93bd415bd08..1016aef78cf 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 @@ -66,7 +66,9 @@ export default class ProfilesList extends React.PureComponent { {translate('quality_profiles.list.projects')}
diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx index 85aa99aeed8..fbabe10e52a 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx @@ -60,7 +60,9 @@ export default class ProfilesListRow extends React.PureComponent { if (profile.isDefault) { return ( + doc={import( + /* webpackMode: "eager" */ 'Docs/tooltips/quality-profiles/default-quality-profile.md' + )}> {translate('default')} ); diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/ProfilesListHeader-test.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/ProfilesListHeader-test.tsx index 4cb21177735..42dca0e1888 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/ProfilesListHeader-test.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/__tests__/ProfilesListHeader-test.tsx @@ -30,7 +30,10 @@ it('should render correctly', () => { function shallowRender(props: Partial = {}) { return shallow( { const mapStateToProps = null; const mapDispatchToProps = { doLogin: doLogin as any }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(LoginContainer); +export default connect(mapStateToProps, mapDispatchToProps)(LoginContainer); diff --git a/server/sonar-web/src/main/js/apps/sessions/components/Logout.tsx b/server/sonar-web/src/main/js/apps/sessions/components/Logout.tsx index 0bba08201fe..ec0f9dc6de8 100644 --- a/server/sonar-web/src/main/js/apps/sessions/components/Logout.tsx +++ b/server/sonar-web/src/main/js/apps/sessions/components/Logout.tsx @@ -54,7 +54,4 @@ const mapStateToProps = () => ({}); const mapDispatchToProps = { doLogout }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(Logout as any); +export default connect(mapStateToProps, mapDispatchToProps)(Logout as any); diff --git a/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx b/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx index df745050276..a5f1ee9048f 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/AppContainer.tsx @@ -131,7 +131,4 @@ const mapStateToProps = (state: Store) => ({ const mapDispatchToProps = { fetchSettings: fetchSettings as any }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(App); +export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/server/sonar-web/src/main/js/apps/settings/components/CategoryDefinitionsList.tsx b/server/sonar-web/src/main/js/apps/settings/components/CategoryDefinitionsList.tsx index 245f94a3773..3f8d2ab942b 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/CategoryDefinitionsList.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/CategoryDefinitionsList.tsx @@ -37,7 +37,4 @@ const mapStateToProps = (state: Store, ownProps: Props) => ({ const mapDispatchToProps = { fetchValues }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(SubCategoryDefinitionsList); +export default connect(mapStateToProps, mapDispatchToProps)(SubCategoryDefinitionsList); diff --git a/server/sonar-web/src/main/js/apps/settings/components/Definition.tsx b/server/sonar-web/src/main/js/apps/settings/components/Definition.tsx index 7ef74e4e6cf..bcb26dc8868 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/Definition.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/Definition.tsx @@ -218,7 +218,4 @@ const mapDispatchToProps = { saveValue: saveValue as any }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(Definition); +export default connect(mapStateToProps, mapDispatchToProps)(Definition); diff --git a/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.tsx b/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.tsx index d7f3fb47110..82d8bfb9639 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/inputs/PrimitiveInput.tsx @@ -32,7 +32,7 @@ import InputForString from './InputForString'; import InputForText from './InputForText'; const typeMapping: { - [type in T.SettingType]?: React.ComponentType + [type in T.SettingType]?: React.ComponentType; } = { STRING: InputForString, TEXT: InputForText, diff --git a/server/sonar-web/src/main/js/apps/settings/store/definitions.ts b/server/sonar-web/src/main/js/apps/settings/store/definitions.ts index 4eccf0d7a9a..5567dfa2d9c 100644 --- a/server/sonar-web/src/main/js/apps/settings/store/definitions.ts +++ b/server/sonar-web/src/main/js/apps/settings/store/definitions.ts @@ -55,8 +55,9 @@ export function getDefinitionsForCategory(state: State, category: string) { } export function getAllCategories(state: State) { - return uniqBy(getAllDefinitions(state).map(definition => definition.category), category => - category.toLowerCase() + return uniqBy( + getAllDefinitions(state).map(definition => definition.category), + category => category.toLowerCase() ); } diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/commands/TravisSonarCloud/JavaMavenTravisSonarCloud.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/commands/TravisSonarCloud/JavaMavenTravisSonarCloud.tsx index be9ebce10ab..16a69d2b69b 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/components/commands/TravisSonarCloud/JavaMavenTravisSonarCloud.tsx +++ b/server/sonar-web/src/main/js/apps/tutorials/components/commands/TravisSonarCloud/JavaMavenTravisSonarCloud.tsx @@ -40,9 +40,7 @@ script:
{`script: # the following command line builds the project, runs the tests with coverage and then execute the SonarCloud analysis - - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=${ - props.projectKey - }`} + - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=${props.projectKey}`} ); diff --git a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx index d0bfa1633b1..688917b7563 100644 --- a/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx +++ b/server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingPage.tsx @@ -51,7 +51,4 @@ export class OnboardingPage extends React.PureComponent { const mapDispatchToProps = { skipOnboarding }; -export default connect( - null, - mapDispatchToProps -)(OnboardingPage); +export default connect(null, mapDispatchToProps)(OnboardingPage); diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx index ea2dac3fa06..696282f9c37 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/MeasuresOverlay.tsx @@ -331,8 +331,9 @@ export default class MeasuresOverlay extends React.PureComponent {
{domain}
- {sortBy(measures.filter(measure => measure.value !== undefined), measure => - getLocalizedMetricName(measure.metric) + {sortBy( + measures.filter(measure => measure.value !== undefined), + measure => getLocalizedMetricName(measure.metric) ).map(measure => this.renderMeasure(measure))} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineIssuesList-test.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineIssuesList-test.tsx index 39bacd64833..040b4a93e75 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineIssuesList-test.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/LineIssuesList-test.tsx @@ -47,7 +47,10 @@ const issueBase: T.Issue = { }; it('render issues list', () => { - const issues: T.Issue[] = [{ ...issueBase, key: 'foo' }, { ...issueBase, key: 'bar' }]; + const issues: T.Issue[] = [ + { ...issueBase, key: 'foo' }, + { ...issueBase, key: 'bar' } + ]; const onIssueClick = jest.fn(); const wrapper = shallow( { { from: 0, line: 8, to: 56 } ] ); - expect(getLinearLocations({ startLine: 6, startOffset: 0, endLine: 6, endOffset: 42 })).toEqual( - [{ from: 0, line: 6, to: 42 }] - ); + expect( + getLinearLocations({ startLine: 6, startOffset: 0, endLine: 6, endOffset: 42 }) + ).toEqual([{ from: 0, line: 6, to: 42 }]); }); }); diff --git a/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx b/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx index 670f7044634..7091f769752 100644 --- a/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx +++ b/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx @@ -122,9 +122,13 @@ function getDoc(visibility: T.Visibility, icon: JSX.Element | null, organization doc = import(/* webpackMode: "eager" */ 'Docs/tooltips/project/visibility-private.md'); } else if (icon) { if (actions.admin) { - doc = import(/* webpackMode: "eager" */ 'Docs/tooltips/project/visibility-public-paid-org-admin.md'); + doc = import( + /* webpackMode: "eager" */ 'Docs/tooltips/project/visibility-public-paid-org-admin.md' + ); } else { - doc = import(/* webpackMode: "eager" */ 'Docs/tooltips/project/visibility-public-paid-org.md'); + doc = import( + /* webpackMode: "eager" */ 'Docs/tooltips/project/visibility-public-paid-org.md' + ); } } else if (actions.admin) { doc = import(/* webpackMode: "eager" */ 'Docs/tooltips/project/visibility-public-admin.md'); diff --git a/server/sonar-web/src/main/js/components/controls/HomePageSelect.tsx b/server/sonar-web/src/main/js/components/controls/HomePageSelect.tsx index 1f39256ad80..f3f2a08149e 100644 --- a/server/sonar-web/src/main/js/components/controls/HomePageSelect.tsx +++ b/server/sonar-web/src/main/js/components/controls/HomePageSelect.tsx @@ -84,10 +84,7 @@ const mapStateToProps = (state: Store): StateProps => ({ const mapDispatchToProps: DispatchProps = { setHomePage }; -export default connect( - mapStateToProps, - mapDispatchToProps -)(HomePageSelect); +export default connect(mapStateToProps, mapDispatchToProps)(HomePageSelect); function isSameHomePage(a: T.HomePage, b: T.HomePage) { return ( diff --git a/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx b/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx index f4c8a089d39..e13aa005e49 100644 --- a/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx +++ b/server/sonar-web/src/main/js/components/facet/ListStyleFacet.tsx @@ -246,7 +246,11 @@ export default class ListStyleFacet extends React.Component, State -stats[key], key => this.props.getFacetItemText(key)); + : sortBy( + Object.keys(stats), + key => -stats[key], + key => this.props.getFacetItemText(key) + ); const limitedList = this.state.showFullList ? sortedItems diff --git a/server/sonar-web/src/main/js/components/hoc/withUserOrganizations.tsx b/server/sonar-web/src/main/js/components/hoc/withUserOrganizations.tsx index 0e16f6f83ef..d863b21a2cf 100644 --- a/server/sonar-web/src/main/js/components/hoc/withUserOrganizations.tsx +++ b/server/sonar-web/src/main/js/components/hoc/withUserOrganizations.tsx @@ -49,8 +49,5 @@ export function withUserOrganizations

( return { userOrganizations: getMyOrganizations(state) }; } - return connect( - mapStateToProps, - mapDispatchToProps - )(Wrapper); + return connect(mapStateToProps, mapDispatchToProps)(Wrapper); } diff --git a/server/sonar-web/src/main/js/components/ui/__tests__/CoverageRating-test.tsx b/server/sonar-web/src/main/js/components/ui/__tests__/CoverageRating-test.tsx index 0626ce97b73..828274aad2a 100644 --- a/server/sonar-web/src/main/js/components/ui/__tests__/CoverageRating-test.tsx +++ b/server/sonar-web/src/main/js/components/ui/__tests__/CoverageRating-test.tsx @@ -30,7 +30,10 @@ it('should render with muted style', () => { shallowRender({ muted: true }) .find('DonutChart') .prop('data') - ).toEqual([{ fill: '#b4b4b4', value: 25 }, { fill: '#f3f3f3', value: 75 }]); + ).toEqual([ + { fill: '#b4b4b4', value: 25 }, + { fill: '#f3f3f3', value: 75 } + ]); }); it('should render with small size', () => { diff --git a/server/sonar-web/src/main/js/components/workspace/WorkspaceComponentViewer.tsx b/server/sonar-web/src/main/js/components/workspace/WorkspaceComponentViewer.tsx index 62dc83c67f0..0164c435179 100644 --- a/server/sonar-web/src/main/js/components/workspace/WorkspaceComponentViewer.tsx +++ b/server/sonar-web/src/main/js/components/workspace/WorkspaceComponentViewer.tsx @@ -138,7 +138,4 @@ export class WorkspaceComponentViewer extends React.PureComponent { const mapDispatchToProps = { fetchBranchStatus: fetchBranchStatus as any }; -export default connect( - null, - mapDispatchToProps -)(WorkspaceComponentViewer); +export default connect(null, mapDispatchToProps)(WorkspaceComponentViewer); diff --git a/server/sonar-web/src/main/js/components/workspace/__tests__/WorkspaceNav-test.tsx b/server/sonar-web/src/main/js/components/workspace/__tests__/WorkspaceNav-test.tsx index a4654cf7a8e..e5effc38dda 100644 --- a/server/sonar-web/src/main/js/components/workspace/__tests__/WorkspaceNav-test.tsx +++ b/server/sonar-web/src/main/js/components/workspace/__tests__/WorkspaceNav-test.tsx @@ -34,7 +34,10 @@ it('should not render open rule', () => { }); function shallowRender(props?: Partial) { - const components = [{ branchLike: undefined, key: 'foo' }, { branchLike: undefined, key: 'bar' }]; + const components = [ + { branchLike: undefined, key: 'foo' }, + { branchLike: undefined, key: 'bar' } + ]; const rules = [{ key: 'qux', organization: 'org' }]; return shallow( { } ] } as any; - const components = [{ key: 'foo', name: 'src/foo.js' }, { key: 'bar', name: 'src/bar.js' }]; + const components = [ + { key: 'foo', name: 'src/foo.js' }, + { key: 'bar', name: 'src/bar.js' } + ]; expect(parseIssueFromResponse(issue, components).secondaryLocations).toEqual([ { component: 'bar', diff --git a/server/sonar-web/src/main/js/helpers/branch-like.ts b/server/sonar-web/src/main/js/helpers/branch-like.ts index 31da280cf59..80d7d93ff49 100644 --- a/server/sonar-web/src/main/js/helpers/branch-like.ts +++ b/server/sonar-web/src/main/js/helpers/branch-like.ts @@ -94,7 +94,10 @@ export function isSameBranchLike(a: BranchLike | undefined, b: BranchLike | unde export function getBrancheLikesAsTree(branchLikes: BranchLike[]): BranchLikeTree { const mainBranch = branchLikes.find(isMainBranch); - const branches = orderBy(branchLikes.filter(isBranch).filter(b => !isMainBranch(b)), b => b.name); + const branches = orderBy( + branchLikes.filter(isBranch).filter(b => !isMainBranch(b)), + b => b.name + ); const pullRequests = orderBy(branchLikes.filter(isPullRequest), b => b.key); const parentlessPullRequests = pullRequests.filter( pr => !pr.isOrphan && ![mainBranch, ...branches].find(b => !!b && b.name === pr.base) diff --git a/server/sonar-web/src/main/js/helpers/testMocks.ts b/server/sonar-web/src/main/js/helpers/testMocks.ts index 72821d2b85c..1952315df76 100644 --- a/server/sonar-web/src/main/js/helpers/testMocks.ts +++ b/server/sonar-web/src/main/js/helpers/testMocks.ts @@ -429,7 +429,10 @@ export function mockIssue(withLocations = false, overrides: Partial = { const loc = mockFlowLocation; if (withLocations) { - issue.flows = [[loc(), loc(), loc()], [loc(), loc()]]; + issue.flows = [ + [loc(), loc(), loc()], + [loc(), loc()] + ]; issue.secondaryLocations = [loc(), loc()]; } diff --git a/server/sonar-web/src/main/js/store/__tests__/organizations-test.ts b/server/sonar-web/src/main/js/store/__tests__/organizations-test.ts index 0fc3bef90f3..7f7171c2100 100644 --- a/server/sonar-web/src/main/js/store/__tests__/organizations-test.ts +++ b/server/sonar-web/src/main/js/store/__tests__/organizations-test.ts @@ -41,7 +41,10 @@ describe('Reducer', () => { it('should receive organizations', () => { const state1 = reducer( state0, - receiveOrganizations([{ key: 'foo', name: 'Foo' }, { key: 'bar', name: 'Bar' }]) + receiveOrganizations([ + { key: 'foo', name: 'Foo' }, + { key: 'bar', name: 'Bar' } + ]) ); expect(state1).toMatchSnapshot(); @@ -52,7 +55,10 @@ describe('Reducer', () => { it('should receive my organizations', () => { const state1 = reducer( state0, - receiveMyOrganizations([{ key: 'foo', name: 'Foo' }, { key: 'bar', name: 'Bar' }]) + receiveMyOrganizations([ + { key: 'foo', name: 'Foo' }, + { key: 'bar', name: 'Bar' } + ]) ); expect(state1).toMatchSnapshot(); }); diff --git a/server/sonar-web/src/main/js/store/rootActions.ts b/server/sonar-web/src/main/js/store/rootActions.ts index 1d18796935f..490d78f47a1 100644 --- a/server/sonar-web/src/main/js/store/rootActions.ts +++ b/server/sonar-web/src/main/js/store/rootActions.ts @@ -36,13 +36,19 @@ import { receiveOrganizations } from './organizations'; export function fetchLanguages() { return (dispatch: Dispatch) => { - getLanguages().then(languages => dispatch(receiveLanguages(languages)), () => {}); + getLanguages().then( + languages => dispatch(receiveLanguages(languages)), + () => {} + ); }; } export function fetchMetrics() { return (dispatch: Dispatch) => { - getAllMetrics().then(metrics => dispatch(receiveMetrics(metrics)), () => {}); + getAllMetrics().then( + metrics => dispatch(receiveMetrics(metrics)), + () => {} + ); }; } diff --git a/server/sonar-web/src/main/js/store/users.ts b/server/sonar-web/src/main/js/store/users.ts index d03d6390ea7..df95d3bce26 100644 --- a/server/sonar-web/src/main/js/store/users.ts +++ b/server/sonar-web/src/main/js/store/users.ts @@ -52,9 +52,10 @@ function skipOnboardingAction() { export function skipOnboarding() { return (dispatch: Dispatch) => - api - .skipOnboarding() - .then(() => dispatch(skipOnboardingAction()), () => dispatch(skipOnboardingAction())); + api.skipOnboarding().then( + () => dispatch(skipOnboardingAction()), + () => dispatch(skipOnboardingAction()) + ); } function setHomePageAction(homepage: T.HomePage) { diff --git a/server/sonar-web/src/main/js/store/utils/configureStore.ts b/server/sonar-web/src/main/js/store/utils/configureStore.ts index c3442937514..ea76c382c6d 100644 --- a/server/sonar-web/src/main/js/store/utils/configureStore.ts +++ b/server/sonar-web/src/main/js/store/utils/configureStore.ts @@ -34,10 +34,7 @@ if (process.env.NODE_ENV === 'development') { composed.push(__REDUX_DEVTOOLS_EXTENSION__ ? __REDUX_DEVTOOLS_EXTENSION__() : (f: Function) => f); } -const finalCreateStore = compose( - applyMiddleware(...middlewares), - ...composed -)(createStore); +const finalCreateStore = compose(applyMiddleware(...middlewares), ...composed)(createStore); export default function configureStore(rootReducer: RootReducer, initialState?: State) { return finalCreateStore(rootReducer, initialState); diff --git a/server/sonar-web/src/main/js/types/types.d.ts b/server/sonar-web/src/main/js/types/types.d.ts index 38c972c182d..eda51607279 100644 --- a/server/sonar-web/src/main/js/types/types.d.ts +++ b/server/sonar-web/src/main/js/types/types.d.ts @@ -850,7 +850,7 @@ declare namespace T { } export type Standards = { - [key in StandardType]: T.Dict<{ title: string; description?: string }> + [key in StandardType]: T.Dict<{ title: string; description?: string }>; }; export type StandardType = 'owaspTop10' | 'sansTop25' | 'cwe' | 'sonarsourceSecurity'; -- 2.39.5

{translate('quality_profiles.list.rules')}