From f7acdaa385ab02e0aec72bd835b6273525334c41 Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Fri, 28 Feb 2020 15:56:47 -0800 Subject: [PATCH] chore(lint): Apply `arrow-body-style` `as-needed` fixes (#17262) --- .../app/actionCreators/serviceIncidents.jsx | 4 +- .../static/sentry/app/actionCreators/tags.jsx | 8 +- src/sentry/static/sentry/app/api.tsx | 20 +- .../sentry/app/components/actions/ignore.jsx | 146 +++++++------- .../sentry/app/components/actions/resolve.tsx | 40 ++-- .../app/components/assigneeSelector.tsx | 98 +++++----- .../app/components/assistant/guideAnchor.jsx | 4 +- .../sentry/app/components/autoComplete.jsx | 10 +- .../app/components/avatar/avatarList.tsx | 22 +-- .../app/components/avatar/projectList.tsx | 20 +- .../sentry/app/components/avatarCropper.tsx | 17 +- .../static/sentry/app/components/barChart.jsx | 4 +- .../sentry/app/components/charts/barChart.jsx | 8 +- .../components/charts/components/legend.jsx | 4 +- .../app/components/charts/lineChart.jsx | 8 +- .../components/charts/percentageAreaChart.jsx | 7 +- .../sentry/app/components/charts/pieChart.jsx | 11 +- .../app/components/charts/tableChart.jsx | 76 ++++---- .../app/components/charts/worldMapChart.jsx | 8 +- .../components/dropdownAutoCompleteMenu.jsx | 25 ++- .../components/eventOrGroupExtraDetails.jsx | 18 +- .../components/events/contexts/user/user.tsx | 4 +- .../sentry/app/components/events/errors.jsx | 10 +- .../components/events/eventAttachments.tsx | 52 +++-- .../app/components/events/eventCause.jsx | 6 +- .../app/components/events/eventMessage.tsx | 24 ++- .../sentry/app/components/events/eventRow.jsx | 12 +- .../app/components/events/groupingInfo.jsx | 10 +- .../components/events/interfaces/assembly.tsx | 56 +++--- .../events/interfaces/breadcrumbs.jsx | 87 ++++----- .../events/interfaces/exception.jsx | 4 +- .../events/interfaces/exceptionContent.jsx | 68 ++++--- .../frameRegisters/frameRegistersValue.tsx | 4 +- .../events/interfaces/imageForBar.tsx | 24 ++- .../components/events/interfaces/request.jsx | 5 +- .../interfaces/spans/cursorGuideHandler.tsx | 4 +- .../spans/dividerHandlerManager.tsx | 12 +- .../events/interfaces/spans/dragManager.tsx | 36 ++-- .../events/interfaces/spans/header.tsx | 184 +++++++++--------- .../events/interfaces/spans/spanBar.tsx | 58 +++--- .../events/interfaces/spans/spanDetail.tsx | 18 +- .../events/interfaces/spans/spanGroup.tsx | 8 +- .../events/interfaces/spans/traceView.tsx | 62 +++--- .../events/interfaces/spans/utils.tsx | 39 ++-- .../events/interfaces/stacktraceContent.jsx | 7 +- .../events/interfaces/threads/threads.jsx | 37 ++-- .../app/components/events/sdkUpdates.jsx | 34 ++-- .../components/eventsTable/eventsTable.jsx | 30 ++- .../components/eventsTable/eventsTableRow.jsx | 24 ++- .../forms/multipleCheckboxField.jsx | 30 ++- .../components/forms/selectAsyncControl.jsx | 5 +- .../app/components/forms/selectAsyncField.jsx | 5 +- .../components/forms/selectControlLegacy.jsx | 4 +- .../app/components/gridEditable/index.tsx | 12 +- .../components/group/externalIssueForm.tsx | 5 +- .../components/group/externalIssuesList.tsx | 20 +- .../app/components/group/participants.jsx | 12 +- .../group/sentryAppExternalIssueForm.tsx | 16 +- .../sentry/app/components/group/times.tsx | 46 +++-- .../sentry/app/components/inactivePlugins.jsx | 30 ++- .../sentry/app/components/indicators.jsx | 12 +- .../app/components/internalStatChart.jsx | 4 +- .../sentry/app/components/issueLink.jsx | 14 +- .../sentry/app/components/issueList.jsx | 20 +- .../modals/sentryAppPublishRequestModal.tsx | 8 +- .../static/sentry/app/components/mutedBox.jsx | 28 ++- .../globalSelectionHeader/getParams.tsx | 8 +- .../globalSelectionHeader/index.jsx | 10 +- .../multipleSelectorSubmitRow.tsx | 16 +- .../timeRangeSelector/dateRange/index.jsx | 5 +- .../dateRange/relativeSelector.jsx | 30 ++- .../sentry/app/components/platformList.jsx | 5 +- .../sentry/app/components/pluginList.tsx | 20 +- .../sentry/app/components/previewFeature.tsx | 16 +- .../sentry/app/components/projectSelector.jsx | 8 +- .../projects/missingProjectMembership.jsx | 12 +- .../sentry/app/components/resolutionBox.jsx | 18 +- .../sentry/app/components/resultGrid.jsx | 127 ++++++------ .../static/sentry/app/components/scoreBar.jsx | 6 +- .../sentry/app/components/search/index.jsx | 8 +- .../app/components/selectMembers/index.tsx | 101 +++++----- .../app/components/sidebar/broadcasts.jsx | 22 +-- .../sentry/app/components/sidebar/help.jsx | 58 +++--- .../sidebar/sidebarDropdown/index.jsx | 170 ++++++++-------- .../sidebarDropdown/switchOrganization.jsx | 114 ++++++----- .../app/components/sidebar/sidebarItem.jsx | 4 +- .../app/components/smartSearchBar/index.jsx | 5 +- .../smartSearchBar/searchDropdown.jsx | 20 +- .../sentry/app/components/splitDiff.jsx | 24 +-- .../sentry/app/components/stackedBarChart.jsx | 13 +- .../app/components/stream/groupChart.jsx | 4 +- .../components/stream/processingIssueList.jsx | 20 +- .../app/components/u2f/u2finterface.jsx | 4 +- .../static/sentry/app/components/version.tsx | 32 ++- .../app/data/forms/projectGeneralSettings.jsx | 25 +-- .../app/data/forms/sentryApplication.tsx | 4 +- .../app/plugins/components/issueActions.jsx | 12 +- .../app/plugins/components/settings.jsx | 8 +- .../plugins/jira/components/issueActions.jsx | 4 +- .../app/plugins/jira/components/settings.jsx | 18 +- .../sessionstack/components/settings.jsx | 12 +- .../app/stores/globalSelectionStore.jsx | 22 +-- .../sentry/app/stores/groupingStore.jsx | 39 ++-- .../static/sentry/app/stores/guideStore.jsx | 14 +- .../static/sentry/app/stores/hookStore.tsx | 4 +- .../sentry/app/stores/indicatorStore.jsx | 4 +- .../static/sentry/app/stores/tagStore.jsx | 4 +- src/sentry/static/sentry/app/styles/text.tsx | 118 ++++++----- src/sentry/static/sentry/app/utils.tsx | 7 +- .../app/utils/__mocks__/localStorage.tsx | 4 +- .../sentry/app/utils/consolidatedScopes.tsx | 4 +- .../sentry/app/utils/getStacktraceBody.jsx | 4 +- src/sentry/static/sentry/app/utils/guid.tsx | 5 +- .../sentry/app/utils/highlightFuseMatches.jsx | 5 +- .../sentry/app/utils/integrationUtil.tsx | 5 +- .../static/sentry/app/utils/streamManager.jsx | 4 +- .../sentry/app/views/admin/adminLayout.jsx | 4 +- .../app/views/admin/adminOrganizations.jsx | 20 +- .../views/admin/adminOverview/apiChart.jsx | 4 +- .../views/admin/adminOverview/eventChart.jsx | 10 +- .../sentry/app/views/admin/adminProjects.jsx | 24 ++- .../sentry/app/views/admin/adminQueue.jsx | 24 ++- .../sentry/app/views/admin/adminUsers.jsx | 24 ++- .../details/activity/activityPlaceholder.tsx | 24 ++- .../sentry/app/views/alerts/details/chart.tsx | 10 +- .../sentry/app/views/discover/analytics.tsx | 12 +- .../sentry/app/views/discover/index.tsx | 4 +- .../app/views/discover/result/table.tsx | 6 +- .../app/views/discover/result/utils.tsx | 44 ++--- .../discover/result/visualizationsToggle.tsx | 30 ++- .../views/discover/sidebar/queryFields.tsx | 14 +- .../sentry/app/views/events/eventsChart.jsx | 60 +++--- .../sentry/app/views/events/searchBar.jsx | 4 +- .../static/sentry/app/views/eventsV2/data.tsx | 37 ++-- .../app/views/eventsV2/eventDetails/index.tsx | 5 +- .../views/eventsV2/eventDetails/lineGraph.tsx | 8 +- .../eventDetails/transaction/opsBreakdown.tsx | 12 +- .../sentry/app/views/eventsV2/eventView.tsx | 86 ++++---- .../sentry/app/views/eventsV2/miniGraph.tsx | 28 ++- .../sentry/app/views/eventsV2/queryList.tsx | 66 +++---- .../sentry/app/views/eventsV2/table/index.tsx | 16 +- .../eventsV2/table/tableModalEditColumn.tsx | 30 ++- .../app/views/eventsV2/table/tableView.tsx | 70 ++++--- .../sentry/app/views/eventsV2/utils.tsx | 8 +- .../sentry/app/views/issueList/actions.jsx | 10 +- .../sentry/app/views/issueList/sidebar.jsx | 22 +-- .../app/views/issueList/sortOptions.jsx | 20 +- .../sentry/app/views/issueList/tagFilter.jsx | 10 +- .../app/views/monitors/monitorCheckIns.tsx | 26 ++- .../sentry/app/views/monitors/monitorForm.jsx | 4 +- .../sentry/app/views/monitors/monitors.jsx | 32 ++- .../organizationActivity/activityFeed.jsx | 20 +- .../groupEventAttachments.tsx | 8 +- .../groupEventAttachmentsTable.tsx | 30 ++- .../groupEventAttachmentsTableRow.tsx | 80 ++++---- .../groupEventAttachments/index.tsx | 20 +- .../groupMerged/mergedList.jsx | 12 +- .../groupSimilar/similarList.jsx | 16 +- .../groupUserFeedback.jsx | 18 +- .../SplitInstallationIdModal.tsx | 5 +- .../abstractIntegrationDetailedView.tsx | 14 +- .../views/organizationIntegrations/index.tsx | 11 +- .../integrationListDirectory.tsx | 11 +- .../integrationRepos.tsx | 40 ++-- .../integrationRow.tsx | 6 +- .../app/views/organizationStats/index.jsx | 12 +- .../app/views/projectsDashboard/deploys.jsx | 8 +- .../app/views/projectsDashboard/index.jsx | 12 +- .../app/views/projectsDashboard/newIssues.jsx | 24 +-- .../releases/detail/commitAuthorStats.jsx | 4 +- .../views/releases/detail/groupListHeader.jsx | 50 +++-- .../app/views/releases/detail/index.jsx | 18 +- .../releases/detail/releaseArtifacts.jsx | 104 +++++----- .../views/releases/detail/releaseCommits.jsx | 38 ++-- .../views/releases/detail/releaseOverview.jsx | 34 ++-- .../app/views/releases/list/progressBar.jsx | 12 +- .../views/releases/list/releaseLanding.tsx | 4 +- .../app/views/releases/list/releaseList.jsx | 74 ++++--- .../views/releases/list/releaseListHeader.jsx | 24 ++- .../app/views/releasesV2/list/index.tsx | 8 +- .../app/views/releasesV2/list/releaseCard.tsx | 138 +++++++------ .../app/views/releasesV2/list/usersChart.tsx | 4 +- .../static/sentry/app/views/routeNotFound.tsx | 4 +- .../account/accountAuthorizations.jsx | 16 +- .../views/settings/account/accountClose.jsx | 5 +- .../views/settings/account/accountEmails.jsx | 20 +- .../account/accountNotificationFineTuning.jsx | 100 +++++----- .../accountSecuritySessionHistory.jsx | 6 +- .../account/accountSettingsNavigation.tsx | 6 +- .../account/apiApplications/details.tsx | 24 ++- .../account/apiApplications/index.tsx | 18 +- .../app/views/settings/account/apiTokens.jsx | 16 +- .../forms/controls/multipleCheckbox.jsx | 30 ++- .../components/forms/controls/radioGroup.tsx | 62 +++--- .../settings/components/forms/inputField.jsx | 8 +- .../components/forms/returnButton.jsx | 20 +- .../settings/components/forms/selectField.jsx | 18 +- .../settingsBreadcrumb/breadcrumbDropdown.jsx | 28 ++- .../views/settings/components/teamSelect.jsx | 26 ++- .../organizationAuditLog/auditLogList.jsx | 60 +++--- .../resourceSubscriptions.tsx | 6 +- .../sentryApplicationDashboard/requestLog.tsx | 5 +- .../sentryApplicationDetails.tsx | 92 +++++---- .../sentryApplicationRow/index.tsx | 12 +- .../sentryApplicationRow/installButtons.tsx | 22 +-- .../inviteMember/index.jsx | 5 +- .../organizationMembersList.tsx | 40 ++-- .../projectStatsGraph.jsx | 6 +- .../organizationRateLimits.jsx | 16 +- .../addRepositoryLink.jsx | 22 +-- .../organizationRepositories.tsx | 22 +-- .../organizationTeams/allTeamsList.jsx | 22 +-- .../organizationTeams/teamMembers.jsx | 62 +++--- .../organizationTeams/teamProjects.jsx | 16 +- .../settings/project/projectEnvironments.jsx | 24 ++- .../projectFilters/groupTombstones.jsx | 16 +- .../projectFilters/projectFiltersChart.jsx | 39 ++-- .../project/projectKeys/list/index.tsx | 50 ++--- .../project/projectOwnership/modal.jsx | 5 +- .../project/projectOwnership/selectOwners.jsx | 113 +++++------ .../project/projectProcessingIssues.jsx | 50 +++-- .../settings/project/projectServiceHooks.jsx | 20 +- .../views/settings/project/projectTeams.jsx | 18 +- .../issueEditor/ruleNodeList.tsx | 22 +-- .../views/settings/projectAlerts/ruleRow.tsx | 24 +-- .../settings/projectAlerts/ruleRowNew.tsx | 48 +++-- .../views/settings/projectGeneralSettings.jsx | 4 +- .../projectPlugins/projectPlugins.jsx | 8 +- tests/js/setup.js | 8 +- .../components/activity/note/input.spec.jsx | 5 +- .../activity/note/inputWithStorage.spec.jsx | 8 +- tests/js/spec/components/avatar.spec.jsx | 12 +- .../js/spec/components/dropdownMenu.spec.jsx | 156 +++++++-------- .../components/events/meta/annotated.spec.jsx | 5 +- .../group/externalIssueForm.spec.jsx | 24 ++- .../group/sentryAppExternalIssueForm.spec.jsx | 4 +- tests/js/spec/components/hook.spec.jsx | 36 ++-- .../globalSelectionHeader.spec.jsx | 10 +- .../timeRangeSelector/dateRange.spec.jsx | 36 ++-- .../spec/stores/globalSelectionStore.spec.jsx | 10 +- tests/js/spec/views/events/events.spec.jsx | 8 +- .../views/events/utils/eventsRequest.spec.jsx | 8 +- .../js/spec/views/eventsV2/eventView.spec.jsx | 26 +-- tests/js/spec/views/eventsV2/results.spec.jsx | 8 +- tests/js/spec/views/eventsV2/tags.spec.jsx | 4 +- .../groupEventDetails.spec.jsx | 5 +- .../integrationDetailedView.spec.jsx | 8 +- .../integrationListDirectory.spec.jsx | 14 +- .../pluginDetailedView.spec.js | 8 +- .../sentryAppDetailedView.spec.jsx | 8 +- tests/js/spec/views/projectFilters.spec.jsx | 13 +- .../views/projectsDashboard/index.spec.jsx | 24 ++- .../permissionSelection.spec.jsx | 4 +- .../organizationMemberDetail.spec.jsx | 8 +- 254 files changed, 2848 insertions(+), 3489 deletions(-) diff --git a/src/sentry/static/sentry/app/actionCreators/serviceIncidents.jsx b/src/sentry/static/sentry/app/actionCreators/serviceIncidents.jsx index 9ece4603e21f72..de9d42ea637f3d 100644 --- a/src/sentry/static/sentry/app/actionCreators/serviceIncidents.jsx +++ b/src/sentry/static/sentry/app/actionCreators/serviceIncidents.jsx @@ -14,9 +14,7 @@ function getIncidentsFromIncidentResponse(incidents) { } log.push({ name: item.name, - updates: item.incident_updates.map(update => { - return update.body; - }), + updates: item.incident_updates.map(update => update.body), url: item.shortlink, status: item.status, }); diff --git a/src/sentry/static/sentry/app/actionCreators/tags.jsx b/src/sentry/static/sentry/app/actionCreators/tags.jsx index 8dae2cfe89f4a5..b7dbe1696d30d4 100644 --- a/src/sentry/static/sentry/app/actionCreators/tags.jsx +++ b/src/sentry/static/sentry/app/actionCreators/tags.jsx @@ -83,9 +83,7 @@ export function loadOrganizationTags(api, orgId, selection) { method: 'GET', query, }) - .then(tags => { - return [...BUILTIN_TAGS, ...tags]; - }); + .then(tags => [...BUILTIN_TAGS, ...tags]); promise.then( results => { @@ -117,9 +115,7 @@ export function fetchOrganizationTags(api, orgId, projectIds = null) { method: 'GET', query, }) - .then(tags => { - return [...BUILTIN_TAGS, ...tags]; - }); + .then(tags => [...BUILTIN_TAGS, ...tags]); promise.then(tagFetchSuccess, TagActions.loadTagsError); return promise; diff --git a/src/sentry/static/sentry/app/api.tsx b/src/sentry/static/sentry/app/api.tsx index 39f4a066a6b595..f805fb12f54f1f 100644 --- a/src/sentry/static/sentry/app/api.tsx +++ b/src/sentry/static/sentry/app/api.tsx @@ -192,8 +192,8 @@ export class Client { openSudo({ superuser: code === SUPERUSER_REQUIRED, sudo: code === SUDO_REQUIRED, - retryRequest: () => { - return this.requestPromise(path, requestOptions) + retryRequest: () => + this.requestPromise(path, requestOptions) .then(data => { if (typeof requestOptions.success !== 'function') { return; @@ -206,8 +206,7 @@ export class Client { return; } requestOptions.error(err); - }); - }, + }), onClose: () => { if (typeof requestOptions.error !== 'function') { return; @@ -335,13 +334,12 @@ export class Client { errorThrown ); }, - complete: (jqXHR: JQueryXHR, textStatus: string) => { - return this.wrapCallback<[JQueryXHR, string]>( + complete: (jqXHR: JQueryXHR, textStatus: string) => + this.wrapCallback<[JQueryXHR, string]>( id, options.complete, true - )(jqXHR, textStatus); - }, + )(jqXHR, textStatus), }) ); @@ -392,9 +390,9 @@ export class Client { } _chain(...funcs: Array<((...args: Args) => any) | undefined>) { - const filteredFuncs = funcs.filter((f): f is (...args: Args) => any => { - return typeof f === 'function'; - }); + const filteredFuncs = funcs.filter( + (f): f is (...args: Args) => any => typeof f === 'function' + ); return (...args: Args): void => { filteredFuncs.forEach(func => { func.apply(funcs, args); diff --git a/src/sentry/static/sentry/app/components/actions/ignore.jsx b/src/sentry/static/sentry/app/components/actions/ignore.jsx index 496d0907e87a2e..43e5fa87b9f480 100644 --- a/src/sentry/static/sentry/app/components/actions/ignore.jsx +++ b/src/sentry/static/sentry/app/components/actions/ignore.jsx @@ -151,18 +151,16 @@ export default class IgnoreActions extends React.Component { isNestedDropdown alwaysRenderMenu > - {this.getIgnoreDurations().map(duration => { - return ( - - this.onIgnore({ignoreDuration: duration})} - > - - - - ); - })} + {this.getIgnoreDurations().map(duration => ( + + this.onIgnore({ignoreDuration: duration})} + > + + + + ))} this.setState({modal: 'duration'})}>{t('Custom')} @@ -176,44 +174,40 @@ export default class IgnoreActions extends React.Component { isNestedDropdown alwaysRenderMenu > - {this.getIgnoreCounts().map(count => { - return ( -
  • - - + {this.getIgnoreCounts().map(count => ( +
  • + + + this.onIgnore({ignoreCount: count})} + > + {t('from now')} + + + {this.getIgnoreWindows().map(([hours, label]) => ( + this.onIgnore({ignoreCount: count})} + onAction={() => + this.onIgnore({ + ignoreCount: count, + ignoreWindow: hours, + }) + } > - {t('from now')} + {label} - {this.getIgnoreWindows().map(([hours, label]) => { - return ( - - - this.onIgnore({ - ignoreCount: count, - ignoreWindow: hours, - }) - } - > - {label} - - - ); - })} - -
  • - ); - })} + ))} + + + ))} this.setState({modal: 'count'})}>{t('Custom')} @@ -227,44 +221,40 @@ export default class IgnoreActions extends React.Component { isNestedDropdown alwaysRenderMenu > - {this.getIgnoreCounts().map(count => { - return ( -
  • - - + {this.getIgnoreCounts().map(count => ( +
  • + + + this.onIgnore({ignoreUserCount: count})} + > + {t('from now')} + + + {this.getIgnoreWindows().map(([hours, label]) => ( + this.onIgnore({ignoreUserCount: count})} + onAction={() => + this.onIgnore({ + ignoreUserCount: count, + ignoreUserWindow: hours, + }) + } > - {t('from now')} + {label} - {this.getIgnoreWindows().map(([hours, label]) => { - return ( - - - this.onIgnore({ - ignoreUserCount: count, - ignoreUserWindow: hours, - }) - } - > - {label} - - - ); - })} - -
  • - ); - })} + ))} + + + ))} this.setState({modal: 'users'})}>{t('Custom')} diff --git a/src/sentry/static/sentry/app/components/actions/resolve.tsx b/src/sentry/static/sentry/app/components/actions/resolve.tsx index a5d84d766e4d14..210d1b68e85f79 100644 --- a/src/sentry/static/sentry/app/components/actions/resolve.tsx +++ b/src/sentry/static/sentry/app/components/actions/resolve.tsx @@ -181,17 +181,15 @@ class ResolveActions extends React.Component { { - return ( - hasRelease && - onUpdate({ - status: ResolutionStatus.RESOLVED, - statusDetails: { - inNextRelease: true, - }, - }) - ); - }} + onAction={() => + hasRelease && + onUpdate({ + status: ResolutionStatus.RESOLVED, + statusDetails: { + inNextRelease: true, + }, + }) + } > {t('The next release')} @@ -200,17 +198,15 @@ class ResolveActions extends React.Component { { - return ( - hasRelease && - onUpdate({ - status: ResolutionStatus.RESOLVED, - statusDetails: { - inRelease: latestRelease ? latestRelease.version : 'latest', - }, - }) - ); - }} + onAction={() => + hasRelease && + onUpdate({ + status: ResolutionStatus.RESOLVED, + statusDetails: { + inRelease: latestRelease ? latestRelease.version : 'latest', + }, + }) + } > {latestRelease ? t( diff --git a/src/sentry/static/sentry/app/components/assigneeSelector.tsx b/src/sentry/static/sentry/app/components/assigneeSelector.tsx index 49d9572ed1b492..0d77d64470d03f 100644 --- a/src/sentry/static/sentry/app/components/assigneeSelector.tsx +++ b/src/sentry/static/sentry/app/components/assigneeSelector.tsx @@ -180,51 +180,47 @@ const AssigneeSelectorComponent = createReactClass({ const {size} = this.props; const members = putSessionUserFirst(this.memberList()); - return members.map(member => { - return { - value: {type: 'member', assignee: member}, - searchKey: `${member.email} ${member.name}`, - label: ({inputValue}) => ( - - - - - - - ), - }; - }); + return members.map(member => ({ + value: {type: 'member', assignee: member}, + searchKey: `${member.email} ${member.name}`, + label: ({inputValue}) => ( + + + + + + + ), + })); }, renderNewTeamNodes() { const {size} = this.props; - return this.assignableTeams().map(({id, display, team}) => { - return { - value: {type: 'team', assignee: team}, - searchKey: team.slug, - label: ({inputValue}) => ( - - - - - - - ), - }; - }); + return this.assignableTeams().map(({id, display, team}) => ({ + value: {type: 'team', assignee: team}, + searchKey: team.slug, + label: ({inputValue}) => ( + + + + + + + ), + })); }, renderNewDropdownItems() { @@ -295,18 +291,16 @@ const AssigneeSelectorComponent = createReactClass({ } > - {({getActorProps}) => { - return ( - - {assignedTo ? ( - - ) : ( - - )} - - - ); - }} + {({getActorProps}) => ( + + {assignedTo ? ( + + ) : ( + + )} + + + )} )} diff --git a/src/sentry/static/sentry/app/components/assistant/guideAnchor.jsx b/src/sentry/static/sentry/app/components/assistant/guideAnchor.jsx index 45a16ca87cbfee..c2b9c2e237f197 100644 --- a/src/sentry/static/sentry/app/components/assistant/guideAnchor.jsx +++ b/src/sentry/static/sentry/app/components/assistant/guideAnchor.jsx @@ -75,9 +75,7 @@ const GuideAnchor = createReactClass({ interpolate(template, variables) { const regex = /\${([^{]+)}/g; - return template.replace(regex, (_match, g1) => { - return variables[g1.trim()]; - }); + return template.replace(regex, (_match, g1) => variables[g1.trim()]); }, /* Terminology: diff --git a/src/sentry/static/sentry/app/components/autoComplete.jsx b/src/sentry/static/sentry/app/components/autoComplete.jsx index 6d1ac6dc05fca8..dd1f35c1aa963b 100644 --- a/src/sentry/static/sentry/app/components/autoComplete.jsx +++ b/src/sentry/static/sentry/app/components/autoComplete.jsx @@ -275,12 +275,10 @@ class AutoComplete extends React.Component { return; } - this.setState(state => { - return { - isOpen: false, - inputValue: resetInputOnClose ? '' : state.inputValue, - }; - }); + this.setState(state => ({ + isOpen: false, + inputValue: resetInputOnClose ? '' : state.inputValue, + })); }; getInputProps = inputProps => ({ diff --git a/src/sentry/static/sentry/app/components/avatar/avatarList.tsx b/src/sentry/static/sentry/app/components/avatar/avatarList.tsx index 331f90ed7b40b3..5a4a204b5f705f 100644 --- a/src/sentry/static/sentry/app/components/avatar/avatarList.tsx +++ b/src/sentry/static/sentry/app/components/avatar/avatarList.tsx @@ -65,18 +65,16 @@ export default class AvatarList extends React.Component { )} - {visibleUsers.map(user => { - return ( - - ); - })} + {visibleUsers.map(user => ( + + ))} ); } diff --git a/src/sentry/static/sentry/app/components/avatar/projectList.tsx b/src/sentry/static/sentry/app/components/avatar/projectList.tsx index cf9d305e335554..848fd19ecd0118 100644 --- a/src/sentry/static/sentry/app/components/avatar/projectList.tsx +++ b/src/sentry/static/sentry/app/components/avatar/projectList.tsx @@ -31,17 +31,15 @@ const ProjectList = ({projects, maxVisibleProjects = 5, avatarSize = 20}: Props) )} - {visibleProjects.map(project => { - return ( - - ); - })} + {visibleProjects.map(project => ( + + ))} ); }; diff --git a/src/sentry/static/sentry/app/components/avatarCropper.tsx b/src/sentry/static/sentry/app/components/avatarCropper.tsx index e69ea48f1f0fde..1e960b1f8d3c18 100644 --- a/src/sentry/static/sentry/app/components/avatarCropper.tsx +++ b/src/sentry/static/sentry/app/components/avatarCropper.tsx @@ -194,21 +194,14 @@ class AvatarCropper extends React.Component { // Normalize diff across dimensions so that negative diffs are always making // the cropper smaller and positive ones are making the cropper larger - getDiffNW = (yDiff: number, xDiff: number) => { - return (yDiff - yDiff * 2 + (xDiff - xDiff * 2)) / 2; - }; + getDiffNW = (yDiff: number, xDiff: number) => + (yDiff - yDiff * 2 + (xDiff - xDiff * 2)) / 2; - getDiffNE = (yDiff: number, xDiff: number) => { - return (yDiff - yDiff * 2 + xDiff) / 2; - }; + getDiffNE = (yDiff: number, xDiff: number) => (yDiff - yDiff * 2 + xDiff) / 2; - getDiffSW = (yDiff: number, xDiff: number) => { - return (yDiff + (xDiff - xDiff * 2)) / 2; - }; + getDiffSW = (yDiff: number, xDiff: number) => (yDiff + (xDiff - xDiff * 2)) / 2; - getDiffSE = (yDiff: number, xDiff: number) => { - return (yDiff + xDiff) / 2; - }; + getDiffSE = (yDiff: number, xDiff: number) => (yDiff + xDiff) / 2; getNewDimensions = (container: HTMLDivElement, yDiff: number, xDiff: number) => { const {resizeDimensions: oldDimensions, resizeDirection} = this.state; diff --git a/src/sentry/static/sentry/app/components/barChart.jsx b/src/sentry/static/sentry/app/components/barChart.jsx index 92a4e6a4fb3453..694e199befb41b 100644 --- a/src/sentry/static/sentry/app/components/barChart.jsx +++ b/src/sentry/static/sentry/app/components/barChart.jsx @@ -30,9 +30,7 @@ class BarChart extends React.Component { }; render() { - const points = this.props.points.map(point => { - return {x: point.x, y: [point.y]}; - }); + const points = this.props.points.map(point => ({x: point.x, y: [point.y]})); const props = Object.assign({}, this.props, {points}); return ; } diff --git a/src/sentry/static/sentry/app/components/charts/barChart.jsx b/src/sentry/static/sentry/app/components/charts/barChart.jsx index 5db6136f89d9dd..cf14458da8e5b7 100644 --- a/src/sentry/static/sentry/app/components/charts/barChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/barChart.jsx @@ -15,13 +15,13 @@ export default class BarChart extends React.Component { { - return BarSeries({ + series={series.map((s, i) => + BarSeries({ name: s.seriesName, stack: stacked ? 'stack1' : null, data: s.data.map(({value, name}) => [name, value]), - }); - })} + }) + )} /> ); } diff --git a/src/sentry/static/sentry/app/components/charts/components/legend.jsx b/src/sentry/static/sentry/app/components/charts/components/legend.jsx index 7ce3527866ba77..fb72cb3d8768b1 100644 --- a/src/sentry/static/sentry/app/components/charts/components/legend.jsx +++ b/src/sentry/static/sentry/app/components/charts/components/legend.jsx @@ -3,9 +3,7 @@ import 'echarts/lib/component/legendScroll'; import {truncationFormatter} from '../utils'; export default function Legend({truncate, ...props} = {}) { - const formatter = value => { - return truncationFormatter(value, truncate); - }; + const formatter = value => truncationFormatter(value, truncate); return { show: true, diff --git a/src/sentry/static/sentry/app/components/charts/lineChart.jsx b/src/sentry/static/sentry/app/components/charts/lineChart.jsx index 9929660e0b2fb5..6c0eca24aecf3b 100644 --- a/src/sentry/static/sentry/app/components/charts/lineChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/lineChart.jsx @@ -16,14 +16,14 @@ export default class LineChart extends React.Component { return ( { - return LineSeries({ + series={series.map(({seriesName, data, dataArray, ...options}) => + LineSeries({ ...seriesOptions, ...options, name: seriesName, data: dataArray || data.map(({value, name}) => [name, value]), - }); - })} + }) + )} /> ); } diff --git a/src/sentry/static/sentry/app/components/charts/percentageAreaChart.jsx b/src/sentry/static/sentry/app/components/charts/percentageAreaChart.jsx index fd3ddc897f8c50..5927f864ae87a6 100644 --- a/src/sentry/static/sentry/app/components/charts/percentageAreaChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/percentageAreaChart.jsx @@ -33,9 +33,10 @@ export default class PercentageAreaChart extends React.Component { const {series, getDataItemName, getValue} = this.props; const totalsArray = series.length - ? series[0].data.map(({name}, i) => { - return [name, series.reduce((sum, {data}) => sum + data[i].value, 0)]; - }) + ? series[0].data.map(({name}, i) => [ + name, + series.reduce((sum, {data}) => sum + data[i].value, 0), + ]) : []; const totals = new Map(totalsArray); return [ diff --git a/src/sentry/static/sentry/app/components/charts/pieChart.jsx b/src/sentry/static/sentry/app/components/charts/pieChart.jsx index 75b302565037e7..df4a844652db7f 100644 --- a/src/sentry/static/sentry/app/components/charts/pieChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/pieChart.jsx @@ -146,13 +146,12 @@ class PieChart extends React.Component { left: 10, top: 10, bottom: 10, - formatter: name => { - return `${name} ${ + formatter: name => + `${name} ${ typeof seriesPercentages[name] !== 'undefined' ? `(${seriesPercentages[name]}%)` : '' - }`; - }, + }`, }), }} series={[ @@ -162,9 +161,7 @@ class PieChart extends React.Component { avoidLabelOverlap: false, label: { normal: { - formatter: ({name, percent, dataIndex}) => { - return `${name}\n${percent}%`; - }, + formatter: ({name, percent, dataIndex}) => `${name}\n${percent}%`, show: false, position: 'center', }, diff --git a/src/sentry/static/sentry/app/components/charts/tableChart.jsx b/src/sentry/static/sentry/app/components/charts/tableChart.jsx index 8847ccebe58fb6..78334e172d8adb 100644 --- a/src/sentry/static/sentry/app/components/charts/tableChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/tableChart.jsx @@ -121,54 +121,52 @@ export const TableChart = styled( rowTotalWidth, widths, ...props - }) => { - return ( - + }) => ( + + {items && + items.slice(0, dataStartIndex).map((rowHeaderValue, columnIndex) => + renderCell({ + isTableHeader, + isHeader: true, + value: rowHeaderValue, + columnIndex, + rowIndex, + width: + columnIndex < widths.length + ? widths[columnIndex] + : showRowTotal + ? rowTotalWidth + : null, + showRowTotal, + ...props, + }) + )} + + {items && - items.slice(0, dataStartIndex).map((rowHeaderValue, columnIndex) => - renderCell({ + items.slice(dataStartIndex).map((rowDataValue, columnIndex) => { + const index = columnIndex + dataStartIndex; + const renderCellProps = { isTableHeader, - isHeader: true, - value: rowHeaderValue, - columnIndex, + value: rowDataValue, + columnIndex: index, rowIndex, width: - columnIndex < widths.length - ? widths[columnIndex] + index < widths.length + ? widths[index] : showRowTotal ? rowTotalWidth : null, + justify: 'right', showRowTotal, ...props, - }) - )} - - - {items && - items.slice(dataStartIndex).map((rowDataValue, columnIndex) => { - const index = columnIndex + dataStartIndex; - const renderCellProps = { - isTableHeader, - value: rowDataValue, - columnIndex: index, - rowIndex, - width: - index < widths.length - ? widths[index] - : showRowTotal - ? rowTotalWidth - : null, - justify: 'right', - showRowTotal, - ...props, - }; - - return renderCell(renderCellProps); - })} - - - ); - }; + }; + + return renderCell(renderCellProps); + })} + + + ); // Default renderer for ALL cells const defaultRenderCell = p => { diff --git a/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx b/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx index 02546cc8adaa10..ec1903ba131a77 100644 --- a/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx @@ -44,8 +44,8 @@ export default class WorldMapChart extends React.Component { } const {series, seriesOptions, ...props} = this.props; - const processedSeries = series.map(({seriesName, data, ...options}) => { - return MapSeries({ + const processedSeries = series.map(({seriesName, data, ...options}) => + MapSeries({ ...seriesOptions, ...options, mapType: 'world', @@ -69,8 +69,8 @@ export default class WorldMapChart extends React.Component { }, }, data, - }); - }); + }) + ); // TODO(billy): // For absolute values, we want min/max to based on min/max of series diff --git a/src/sentry/static/sentry/app/components/dropdownAutoCompleteMenu.jsx b/src/sentry/static/sentry/app/components/dropdownAutoCompleteMenu.jsx index 478b8c731c81fe..1b235152170416 100644 --- a/src/sentry/static/sentry/app/components/dropdownAutoCompleteMenu.jsx +++ b/src/sentry/static/sentry/app/components/dropdownAutoCompleteMenu.jsx @@ -185,22 +185,19 @@ class DropdownAutoCompleteMenu extends React.Component { }; filterItems = (items, inputValue) => - items.filter(item => { - return ( + items.filter( + item => (item.searchKey || `${item.value} ${item.label}`) .toLowerCase() .indexOf(inputValue.toLowerCase()) > -1 - ); - }); + ); filterGroupedItems = (groups, inputValue) => groups - .map(group => { - return { - ...group, - items: this.filterItems(group.items, inputValue), - }; - }) + .map(group => ({ + ...group, + items: this.filterItems(group.items, inputValue), + })) .filter(group => group.items.length > 0); autoCompleteFilter = (items, inputValue) => { @@ -257,11 +254,11 @@ class DropdownAutoCompleteMenu extends React.Component { height={this.getHeight(items)} onScroll={onScroll} rowCount={items.length} - rowHeight={({index}) => { - return items[index].groupLabel && virtualizedLabelHeight + rowHeight={({index}) => + items[index].groupLabel && virtualizedLabelHeight ? virtualizedLabelHeight - : virtualizedHeight; - }} + : virtualizedHeight + } rowRenderer={({key, index, style}) => { const item = items[index]; return this.renderRow({ diff --git a/src/sentry/static/sentry/app/components/eventOrGroupExtraDetails.jsx b/src/sentry/static/sentry/app/components/eventOrGroupExtraDetails.jsx index e06072378332f5..f507a067980460 100644 --- a/src/sentry/static/sentry/app/components/eventOrGroupExtraDetails.jsx +++ b/src/sentry/static/sentry/app/components/eventOrGroupExtraDetails.jsx @@ -86,16 +86,14 @@ class EventOrGroupExtraDetails extends React.Component { )} {annotations && - annotations.map((annotation, key) => { - return ( - - ); - })} + annotations.map((annotation, key) => ( + + ))} {showAssignee && assignedTo && (
    {tct('Assigned to [name]', {name: assignedTo.name})}
    diff --git a/src/sentry/static/sentry/app/components/events/contexts/user/user.tsx b/src/sentry/static/sentry/app/components/events/contexts/user/user.tsx index 3f17364b5eefc7..c02b43232df306 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/user/user.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/user/user.tsx @@ -32,9 +32,7 @@ const User = ({data}: Props) => { return null; } - const getKeyValueData = (val: object) => { - return Object.keys(val).map(key => [key, val[key]]); - }; + const getKeyValueData = (val: object) => Object.keys(val).map(key => [key, val[key]]); return (
    diff --git a/src/sentry/static/sentry/app/components/events/errors.jsx b/src/sentry/static/sentry/app/components/events/errors.jsx index 72089720e55f1d..d1312946e1260f 100644 --- a/src/sentry/static/sentry/app/components/events/errors.jsx +++ b/src/sentry/static/sentry/app/components/events/errors.jsx @@ -33,9 +33,7 @@ class EventErrors extends React.Component { this.setState({isOpen: !this.state.isOpen}); }; - uniqueErrors = errors => { - return uniqWith(errors, isEqual); - }; + uniqueErrors = errors => uniqWith(errors, isEqual); render() { const eventErrors = this.props.event.errors; @@ -63,9 +61,9 @@ class EventErrors extends React.Component { data-test-id="event-error-details" style={{display: isOpen ? 'block' : 'none'}} > - {errors.map((error, errorIdx) => { - return ; - })} + {errors.map((error, errorIdx) => ( + + ))} ); diff --git a/src/sentry/static/sentry/app/components/events/eventAttachments.tsx b/src/sentry/static/sentry/app/components/events/eventAttachments.tsx index da81cc4ad73ca4..fe8855a532581d 100644 --- a/src/sentry/static/sentry/app/components/events/eventAttachments.tsx +++ b/src/sentry/static/sentry/app/components/events/eventAttachments.tsx @@ -82,13 +82,11 @@ class EventAttachments extends React.Component { } handleDelete = async (deletedAttachmentId: string) => { - this.setState(prevState => { - return { - attachmentList: prevState.attachmentList.filter( - attachment => attachment.id !== deletedAttachmentId - ), - }; - }); + this.setState(prevState => ({ + attachmentList: prevState.attachmentList.filter( + attachment => attachment.id !== deletedAttachmentId + ), + })); }; render() { @@ -103,27 +101,25 @@ class EventAttachments extends React.Component { - {attachmentList.map(attachment => { - return ( - - {attachment.name} - - - {url => ( - - )} - - - ); - })} + {attachmentList.map(attachment => ( + + {attachment.name} + + + {url => ( + + )} + + + ))} diff --git a/src/sentry/static/sentry/app/components/events/eventCause.jsx b/src/sentry/static/sentry/app/components/events/eventCause.jsx index e657974e67d9c1..60087571c6e165 100644 --- a/src/sentry/static/sentry/app/components/events/eventCause.jsx +++ b/src/sentry/static/sentry/app/components/events/eventCause.jsx @@ -115,9 +115,9 @@ class EventCause extends React.Component { )} - {commits.slice(0, expanded ? 100 : 1).map(commit => { - return ; - })} + {commits.slice(0, expanded ? 100 : 1).map(commit => ( + + ))} ); diff --git a/src/sentry/static/sentry/app/components/events/eventMessage.tsx b/src/sentry/static/sentry/app/components/events/eventMessage.tsx index 8446db4746d9c9..3556d1a08daaa3 100644 --- a/src/sentry/static/sentry/app/components/events/eventMessage.tsx +++ b/src/sentry/static/sentry/app/components/events/eventMessage.tsx @@ -21,19 +21,17 @@ const EventMessage = ({ levelIndicatorSize, message, annotations, -}: Props) => { - return ( -
    - {level && ( - - {level} - - )} - {message && {message}} - {annotations} -
    - ); -}; +}: Props) => ( +
    + {level && ( + + {level} + + )} + {message && {message}} + {annotations} +
    +); EventMessage.propTypes = { level: PropTypes.oneOf(['error', 'fatal', 'info', 'warning', 'sample']), diff --git a/src/sentry/static/sentry/app/components/events/eventRow.jsx b/src/sentry/static/sentry/app/components/events/eventRow.jsx index 19e96a6feac7e7..9937e64a890f4b 100644 --- a/src/sentry/static/sentry/app/components/events/eventRow.jsx +++ b/src/sentry/static/sentry/app/components/events/eventRow.jsx @@ -48,13 +48,11 @@ class EventRow extends React.Component { {event.title || event.message} - {tagList.map(tag => { - return ( - - {tag[0]} = {tag[1]}{' '} - - ); - })} + {tagList.map(tag => ( + + {tag[0]} = {tag[1]}{' '} + + ))} diff --git a/src/sentry/static/sentry/app/components/events/groupingInfo.jsx b/src/sentry/static/sentry/app/components/events/groupingInfo.jsx index d7d13a077ef8e8..8b976e07b9a448 100644 --- a/src/sentry/static/sentry/app/components/events/groupingInfo.jsx +++ b/src/sentry/static/sentry/app/components/events/groupingInfo.jsx @@ -256,12 +256,10 @@ class GroupingConfigSelect extends AsyncComponent { selectedItem={configId} items={this.state.data .filter(item => !item.hidden || item.id === eventConfigId) - .map(item => { - return { - value: item.id, - label: renderIdLabel(item.id), - }; - })} + .map(item => ({ + value: item.id, + label: renderIdLabel(item.id), + }))} > {({isOpen}) => ( diff --git a/src/sentry/static/sentry/app/components/events/interfaces/assembly.tsx b/src/sentry/static/sentry/app/components/events/interfaces/assembly.tsx index 269db96459ece3..3c13dc6f9d5cef 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/assembly.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/assembly.tsx @@ -16,36 +16,34 @@ interface Props { filePath: string | null; } -const Assembly = ({name, version, culture, publicKeyToken, filePath}: Props) => { - return ( - - - - Assembly: - {name || '-'} - - - {t('Version')}: - {version || '-'} - - - {t('Culture')}: - {culture || '-'} - - - PublicKeyToken: - {publicKeyToken || '-'} - +const Assembly = ({name, version, culture, publicKeyToken, filePath}: Props) => ( + + + + Assembly: + {name || '-'} + + + {t('Version')}: + {version || '-'} + + + {t('Culture')}: + {culture || '-'} + + + PublicKeyToken: + {publicKeyToken || '-'} + - {filePath && ( - - {t('Path')}: - {filePath} - - )} - - ); -}; + {filePath && ( + + {t('Path')}: + {filePath} + + )} + +); // TODO(ts): we should be able to delete these after disabling react/prop-types rule in tsx functional components Assembly.propTypes = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs.jsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs.jsx index 14215b96d97486..c3b63aea2db5e5 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs.jsx @@ -65,27 +65,22 @@ class BreadcrumbsInterface extends React.Component { }); }; - renderBreadcrumbs = crumbs => { + renderBreadcrumbs = crumbs => // reverse array to get consistent idx between collapsed/expanded state // (indexes begin and increment from last breadcrumb) - return crumbs + crumbs .reverse() - .map((item, idx) => { - return ; - }) + .map((item, idx) => ) .reverse(); // un-reverse rendered result - }; - renderNoMatch = () => { - return ( -
  • -

    - {' '} - {t('Sorry, no breadcrumbs match your search query.')} -

    -
  • - ); - }; + renderNoMatch = () => ( +
  • +

    + {' '} + {t('Sorry, no breadcrumbs match your search query.')} +

    +
  • + ); getVirtualCrumb = () => { const evt = this.props.event; @@ -130,15 +125,15 @@ class BreadcrumbsInterface extends React.Component { }); }; - filterCrumbs = (crumbs, queryValue) => { - return crumbs.filter(item => { - // return true if any of category, message, or level contain queryValue - return !!['category', 'message', 'level'].find(prop => { - const propValue = (item[prop] || '').toLowerCase(); - return propValue.includes(queryValue); - }); - }); - }; + filterCrumbs = (crumbs, queryValue) => + crumbs.filter( + item => + // return true if any of category, message, or level contain queryValue + !!['category', 'message', 'level'].find(prop => { + const propValue = (item[prop] || '').toLowerCase(); + return propValue.includes(queryValue); + }) + ); clearSearch = () => { this.setState({ @@ -147,28 +142,26 @@ class BreadcrumbsInterface extends React.Component { }); }; - getSearchField = () => { - return ( -
    - - - {this.state.queryValue && ( -
    - - - -
    - )} -
    - ); - }; + getSearchField = () => ( +
    + + + {this.state.queryValue && ( +
    + + + +
    + )} +
    + ); render() { const evt = this.props.event; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/exception.jsx b/src/sentry/static/sentry/app/components/events/interfaces/exception.jsx index 5a209309bec6e2..caf92fd17cefb6 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/exception.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/exception.jsx @@ -30,9 +30,7 @@ class ExceptionInterface extends React.Component { }; } - eventHasThreads = () => { - return !!this.props.event.entries.find(x => x.type === 'threads'); - }; + eventHasThreads = () => !!this.props.event.entries.find(x => x.type === 'threads'); render() { const {projectId, event, data, hideGuide, type} = this.props; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/exceptionContent.jsx b/src/sentry/static/sentry/app/components/events/interfaces/exceptionContent.jsx index faa50b9076d15f..cebe8045919a33 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/exceptionContent.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/exceptionContent.jsx @@ -19,43 +19,41 @@ class ExceptionContent extends React.Component { render() { const {newestFirst, event, view: stackView, platform, values} = this.props; - const children = values.map((exc, excIdx) => { - return ( -
    -
    - {exc.type} -
    + const children = values.map((exc, excIdx) => ( +
    +
    + {exc.type} +
    - - {value => ( -
    -                {value}
    -              
    - )} -
    - - {exc.mechanism && ( - - )} - {defined(exc.stacktrace) && ( - + + {value => ( +
    +              {value}
    +            
    )} -
    - ); - }); + + + {exc.mechanism && ( + + )} + {defined(exc.stacktrace) && ( + + )} +
    + )); if (newestFirst) { children.reverse(); } diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegistersValue.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegistersValue.tsx index b9c61b9ece498a..c3959cdac67906 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegistersValue.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegistersValue.tsx @@ -26,9 +26,7 @@ class frameRegistersValue extends React.Component { this.setState(state => ({view: (state.view + 1) % REGISTER_VIEWS.length})); }; - tooltipTitle = () => { - return REGISTER_VIEWS[this.state.view]; - }; + tooltipTitle = () => REGISTER_VIEWS[this.state.view]; formatValue = () => { const value = this.props.value; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/imageForBar.tsx b/src/sentry/static/sentry/app/components/events/interfaces/imageForBar.tsx index c1f857420f17ff..7d0195873a7a6b 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/imageForBar.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/imageForBar.tsx @@ -12,19 +12,17 @@ type Props = { onShowAllImages: () => void; }; -const ImageForBar = ({frame, onShowAllImages}: Props) => { - return ( - - - {t('Image for: ')} - - - - {t('Show all images')} - - - ); -}; +const ImageForBar = ({frame, onShowAllImages}: Props) => ( + + + {t('Image for: ')} + + + + {t('Show all images')} + + +); ImageForBar.propTypes = { frame: PropTypes.object.isRequired, diff --git a/src/sentry/static/sentry/app/components/events/interfaces/request.jsx b/src/sentry/static/sentry/app/components/events/interfaces/request.jsx index 427d837fc3db70..9a6ebe786d28bd 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/request.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/request.jsx @@ -32,12 +32,11 @@ class RequestInterface extends React.Component { }; } - isPartial = () => { + isPartial = () => // We assume we only have a partial interface is we're missing // an HTTP method. This means we don't have enough information // to reliably construct a full HTTP request. - return !this.props.data.method || !this.props.data.url; - }; + !this.props.data.method || !this.props.data.url; toggleView = value => { this.setState({ diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/cursorGuideHandler.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/cursorGuideHandler.tsx index 6d67f666bf761d..9a4d5184d4b62a 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/cursorGuideHandler.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/cursorGuideHandler.tsx @@ -45,9 +45,7 @@ export class Provider extends React.Component { traceViewMouseLeft: void 0, }; - hasInteractiveLayer = (): boolean => { - return !!this.props.interactiveLayerRef.current; - }; + hasInteractiveLayer = (): boolean => !!this.props.interactiveLayerRef.current; displayCursorGuide = (mousePageX: number) => { if (!this.hasInteractiveLayer()) { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/dividerHandlerManager.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/dividerHandlerManager.tsx index e18c0c36b65c06..7cd0ce74721a27 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/dividerHandlerManager.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/dividerHandlerManager.tsx @@ -38,12 +38,8 @@ const DividerManagerContext = React.createContext {}, setHover: () => {}, - addDividerLineRef: () => { - return React.createRef(); - }, - addGhostDividerLineRef: () => { - return React.createRef(); - }, + addDividerLineRef: () => React.createRef(), + addGhostDividerLineRef: () => React.createRef(), }); type PropType = { @@ -65,9 +61,7 @@ export class Provider extends React.Component { dividerLineRefs: Array> = []; ghostDividerLineRefs: Array> = []; - hasInteractiveLayer = (): boolean => { - return !!this.props.interactiveLayerRef.current; - }; + hasInteractiveLayer = (): boolean => !!this.props.interactiveLayerRef.current; addDividerLineRef = () => { const ref = React.createRef(); diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/dragManager.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/dragManager.tsx index cfc7501851a32b..6825ba806126bd 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/dragManager.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/dragManager.tsx @@ -94,9 +94,7 @@ class DragManager extends React.Component { previousUserSelect: UserSelectValues | null = null; - hasInteractiveLayer = (): boolean => { - return !!this.props.interactiveLayerRef.current; - }; + hasInteractiveLayer = (): boolean => !!this.props.interactiveLayerRef.current; onDragStart = (viewHandle: ViewHandleType) => ( event: React.MouseEvent @@ -203,27 +201,23 @@ class DragManager extends React.Component { switch (this.state.currentDraggingHandle) { case ViewHandleType.Left: { - this.setState(state => { - return { - isDragging: false, - currentDraggingHandle: void 0, - - // commit leftHandlePosition to be viewWindowStart - viewWindowStart: state.leftHandlePosition, - }; - }); + this.setState(state => ({ + isDragging: false, + currentDraggingHandle: void 0, + + // commit leftHandlePosition to be viewWindowStart + viewWindowStart: state.leftHandlePosition, + })); return; } case ViewHandleType.Right: { - this.setState(state => { - return { - isDragging: false, - currentDraggingHandle: void 0, - - // commit rightHandlePosition to be viewWindowEnd - viewWindowEnd: state.rightHandlePosition, - }; - }); + this.setState(state => ({ + isDragging: false, + currentDraggingHandle: void 0, + + // commit rightHandlePosition to be viewWindowEnd + viewWindowEnd: state.rightHandlePosition, + })); return; } default: { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx index 6004d5025dfadd..7ae07ea7652cd3 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx @@ -117,20 +117,18 @@ class TraceViewHeader extends React.Component { ); }; - renderFog = (dragProps: DragManagerChildrenProps) => { - return ( - - - - - ); - }; + renderFog = (dragProps: DragManagerChildrenProps) => ( + + + + + ); renderDurationGuide = ({ showCursorGuide, @@ -272,58 +270,56 @@ class TraceViewHeader extends React.Component { - {({displayCursorGuide, hideCursorGuide, mouseLeft, showCursorGuide}) => { - return ( -
    { - displayCursorGuide(event.pageX); - }} - onMouseLeave={() => { - hideCursorGuide(); - }} - onMouseMove={event => { - displayCursorGuide(event.pageX); - }} - onMouseDown={event => { - const target = event.target; - - if ( - target instanceof Element && - target.getAttribute && - target.getAttribute('data-ignore') - ) { - // ignore this event if we need to - return; - } - - this.props.dragProps.onWindowSelectionDragStart(event); - }} - > - - {this.renderFog(this.props.dragProps)} - {this.renderCursorGuide({ - showCursorGuide, - mouseLeft, - cursorGuideHeight: MINIMAP_HEIGHT, - })} - {this.renderViewHandles(this.props.dragProps)} - {this.renderWindowSelection(this.props.dragProps)} - - {this.renderTimeAxis({ + {({displayCursorGuide, hideCursorGuide, mouseLeft, showCursorGuide}) => ( +
    { + displayCursorGuide(event.pageX); + }} + onMouseLeave={() => { + hideCursorGuide(); + }} + onMouseMove={event => { + displayCursorGuide(event.pageX); + }} + onMouseDown={event => { + const target = event.target; + + if ( + target instanceof Element && + target.getAttribute && + target.getAttribute('data-ignore') + ) { + // ignore this event if we need to + return; + } + + this.props.dragProps.onWindowSelectionDragStart(event); + }} + > + + {this.renderFog(this.props.dragProps)} + {this.renderCursorGuide({ showCursorGuide, mouseLeft, + cursorGuideHeight: MINIMAP_HEIGHT, })} -
    - ); - }} + {this.renderViewHandles(this.props.dragProps)} + {this.renderWindowSelection(this.props.dragProps)} + + {this.renderTimeAxis({ + showCursorGuide, + mouseLeft, + })} +
    + )}
    ); @@ -648,40 +644,38 @@ const Handle = ({ left: number; onMouseDown: (event: React.MouseEvent) => void; isDragging: boolean; -}) => { - return ( - ( + + - - - - - - ); -}; + + + +); const WindowSelection = styled('div')` position: absolute; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx index 0c083edf7c19f3..4239456268b213 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx @@ -212,11 +212,9 @@ class SpanBar extends React.Component { _mounted: boolean = false; toggleDisplayDetail = () => { - this.setState(state => { - return { - showDetail: !state.showDetail, - }; - }); + this.setState(state => ({ + showDetail: !state.showDetail, + })); }; renderDetail = ({isVisible}: {isVisible: boolean}) => { @@ -576,31 +574,29 @@ class SpanBar extends React.Component { } }; - renderCursorGuide = () => { - return ( - - {({ - showCursorGuide, - traceViewMouseLeft, - }: { - showCursorGuide: boolean; - traceViewMouseLeft: number | undefined; - }) => { - if (!showCursorGuide || !traceViewMouseLeft) { - return null; - } + renderCursorGuide = () => ( + + {({ + showCursorGuide, + traceViewMouseLeft, + }: { + showCursorGuide: boolean; + traceViewMouseLeft: number | undefined; + }) => { + if (!showCursorGuide || !traceViewMouseLeft) { + return null; + } - return ( - - ); - }} - - ); - }; + return ( + + ); + }} + + ); renderDivider = ( dividerHandlerChildrenProps: DividerHandlerManager.DividerHandlerManagerChildrenProps @@ -752,9 +748,7 @@ class SpanBar extends React.Component { {( dividerHandlerChildrenProps: DividerHandlerManager.DividerHandlerManagerChildrenProps - ) => { - return this.renderHeader(dividerHandlerChildrenProps); - }} + ) => this.renderHeader(dividerHandlerChildrenProps)} {this.renderDetail({isVisible: isSpanVisible})} diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx index 3690fff28162b2..87f4e54be74a3b 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx @@ -245,13 +245,11 @@ class SpanDetail extends React.Component { {String(!!span.same_process_as_parent)} - {map(get(span, 'data', {}), (value, key) => { - return ( - - {JSON.stringify(value, null, 4) || ''} - - ); - })} + {map(get(span, 'data', {}), (value, key) => ( + + {JSON.stringify(value, null, 4) || ''} + + ))} @@ -321,9 +319,9 @@ const Tags = ({span}: {span: RawSpanType}) => { Tags - {keys.map((key, index) => { - return ; - })} + {keys.map((key, index) => ( + + ))} diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanGroup.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanGroup.tsx index f0c5436ed55c82..279dd57bd29a42 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanGroup.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanGroup.tsx @@ -34,11 +34,9 @@ class SpanGroup extends React.Component { }; toggleSpanTree = () => { - this.setState(state => { - return { - showSpanTree: !state.showSpanTree, - }; - }); + this.setState(state => ({ + showSpanTree: !state.showSpanTree, + })); }; renderSpanChildren = () => { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx index c7153f9e296db9..09fa9595c90ab3 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx @@ -114,12 +114,8 @@ class TraceView extends React.PureComponent { ]); const basicValues: string[] = Object.values(pickedSpan) - .filter(value => { - return !!value; - }) - .map(value => { - return String(value); - }); + .filter(value => !!value) + .map(value => String(value)); indexed.push(...basicValues); @@ -140,9 +136,9 @@ class TraceView extends React.PureComponent { let dataValues: string[] = []; if (data) { dataKeys = Object.keys(data); - dataValues = Object.values(data).map(value => { - return JSON.stringify(value, null, 4) || ''; - }); + dataValues = Object.values(data).map( + value => JSON.stringify(value, null, 4) || '' + ); } return { @@ -185,15 +181,13 @@ class TraceView extends React.PureComponent { }); } - renderHeader = (dragProps: DragManagerChildrenProps, parsedTrace: ParsedTraceType) => { - return ( - - ); - }; + renderHeader = (dragProps: DragManagerChildrenProps, parsedTrace: ParsedTraceType) => ( + + ); render() { const {event} = this.props; @@ -211,24 +205,22 @@ class TraceView extends React.PureComponent { return ( - {(dragProps: DragManagerChildrenProps) => { - return ( - ( + + {this.renderHeader(dragProps, parsedTrace)} + - {this.renderHeader(dragProps, parsedTrace)} - - - ); - }} + dragProps={dragProps} + filterSpans={this.state.filterSpans} + orgId={orgId} + /> + + )} ); } diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx index 1f44a3116c6ff9..6880946ac6bddb 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx @@ -43,23 +43,19 @@ export const rectOfContent = (element: Element): Rect => { }; }; -export const rectOfViewport = (): Rect => { - return { - x: window.pageXOffset, - y: window.pageYOffset, - width: window.document.documentElement.clientWidth, - height: window.document.documentElement.clientHeight, - }; -}; - -export const rectRelativeTo = (rect: Rect, pos = {x: 0, y: 0}): Rect => { - return { - x: rect.x - pos.x, - y: rect.y - pos.y, - width: rect.width, - height: rect.height, - }; -}; +export const rectOfViewport = (): Rect => ({ + x: window.pageXOffset, + y: window.pageYOffset, + width: window.document.documentElement.clientWidth, + height: window.document.documentElement.clientHeight, +}); + +export const rectRelativeTo = (rect: Rect, pos = {x: 0, y: 0}): Rect => ({ + x: rect.x - pos.x, + y: rect.y - pos.y, + width: rect.width, + height: rect.height, +}); export const rectOfElement = (element: HTMLElement): Rect => { const {x, y} = getOffsetOfElement(element); @@ -81,13 +77,10 @@ export const clamp = (value: number, min: number, max: number): number => { return value; }; -export const isValidSpanID = (maybeSpanID: any) => { - return isString(maybeSpanID) && maybeSpanID.length > 0; -}; +export const isValidSpanID = (maybeSpanID: any) => + isString(maybeSpanID) && maybeSpanID.length > 0; -export const toPercent = (value: number) => { - return `${(value * 100).toFixed(3)}%`; -}; +export const toPercent = (value: number) => `${(value * 100).toFixed(3)}%`; export type SpanBoundsType = {startTimestamp: number; endTimestamp: number}; export type SpanGeneratedBoundsType = diff --git a/src/sentry/static/sentry/app/components/events/interfaces/stacktraceContent.jsx b/src/sentry/static/sentry/app/components/events/interfaces/stacktraceContent.jsx index 99019263089b32..01b8720c1c8a1b 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/stacktraceContent.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/stacktraceContent.jsx @@ -39,11 +39,8 @@ export default class StacktraceContent extends React.Component { return
  • {text}
  • ; }; - frameIsVisible = (frame, nextFrame) => { - return ( - this.props.includeSystemFrames || frame.inApp || (nextFrame && nextFrame.inApp) - ); - }; + frameIsVisible = (frame, nextFrame) => + this.props.includeSystemFrames || frame.inApp || (nextFrame && nextFrame.inApp); findImageForAddress(address) { const images = get( diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threads.jsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threads.jsx index 5b4350387bced6..c9ea00e03e9bfc 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threads.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threads.jsx @@ -43,21 +43,19 @@ class Thread extends React.Component { stacktrace: PropTypes.object, }; - renderMissingStacktrace = () => { - return ( -
    -
      -
    • -
      - - {this.props.data.crashed ? 'Thread Crashed' : 'No or unknown stacktrace'} - -
      -
    • -
    -
    - ); - }; + renderMissingStacktrace = () => ( +
    +
      +
    • +
      + + {this.props.data.crashed ? 'Thread Crashed' : 'No or unknown stacktrace'} + +
      +
    • +
    +
    + ); hasMissingStacktrace = () => { const {exception, stacktrace} = this.props; @@ -142,17 +140,14 @@ class ThreadsInterface extends React.Component { }); }; - getStacktrace = () => { - return getThreadStacktrace( + getStacktrace = () => + getThreadStacktrace( this.state.activeThread, this.props.event, this.state.stackType !== 'original' ); - }; - getException = () => { - return getThreadException(this.state.activeThread, this.props.event); - }; + getException = () => getThreadException(this.state.activeThread, this.props.event); onSelectNewThread = thread => { let newStackView = this.state.stackView; diff --git a/src/sentry/static/sentry/app/components/events/sdkUpdates.jsx b/src/sentry/static/sentry/app/components/events/sdkUpdates.jsx index 1a070f028db29f..96a0744131d45b 100644 --- a/src/sentry/static/sentry/app/components/events/sdkUpdates.jsx +++ b/src/sentry/static/sentry/app/components/events/sdkUpdates.jsx @@ -96,13 +96,11 @@ class EventSdkUpdateSuggestion extends React.Component { {title} {t(' so you can')} - {suggestion.enables.map((suggestion2, i) => { - return ( -
  • - -
  • - ); - })} + {suggestion.enables.map((suggestion2, i) => ( +
  • + +
  • + ))}
    ); @@ -120,18 +118,16 @@ class EventSdkUpdates extends React.Component { return ( - {data.map(suggestion => { - return ( - - {t('We recommend you ')} - - - ); - })} + {data.map(suggestion => ( + + {t('We recommend you ')} + + + ))} ); } diff --git a/src/sentry/static/sentry/app/components/eventsTable/eventsTable.jsx b/src/sentry/static/sentry/app/components/eventsTable/eventsTable.jsx index 9772e3407b4b33..a07b9fea1bb07a 100644 --- a/src/sentry/static/sentry/app/components/eventsTable/eventsTable.jsx +++ b/src/sentry/static/sentry/app/components/eventsTable/eventsTable.jsx @@ -26,25 +26,23 @@ class EventsTable extends React.Component { {t('ID')} {hasUser && {t('User')}} - {tagList.map(tag => { - return {tag.name}; - })} + {tagList.map(tag => ( + {tag.name} + ))} - {events.map(event => { - return ( - - ); - })} + {events.map(event => ( + + ))} ); diff --git a/src/sentry/static/sentry/app/components/eventsTable/eventsTableRow.jsx b/src/sentry/static/sentry/app/components/eventsTable/eventsTableRow.jsx index 8a5f8ef59e7894..6aacab9e038895 100644 --- a/src/sentry/static/sentry/app/components/eventsTable/eventsTableRow.jsx +++ b/src/sentry/static/sentry/app/components/eventsTable/eventsTableRow.jsx @@ -85,19 +85,17 @@ class EventsTableRow extends React.Component { )} - {tagList.map(tag => { - return ( - -
    - {tag.key === 'device' ? ( - - ) : ( - tagMap[tag.key] - )} -
    - - ); - })} + {tagList.map(tag => ( + +
    + {tag.key === 'device' ? ( + + ) : ( + tagMap[tag.key] + )} +
    + + ))} ); } diff --git a/src/sentry/static/sentry/app/components/forms/multipleCheckboxField.jsx b/src/sentry/static/sentry/app/components/forms/multipleCheckboxField.jsx index 67798b8bf224c1..d47ea5773d2a8b 100644 --- a/src/sentry/static/sentry/app/components/forms/multipleCheckboxField.jsx +++ b/src/sentry/static/sentry/app/components/forms/multipleCheckboxField.jsx @@ -77,22 +77,20 @@ export default class MultipleCheckboxField extends FormField {
    - {choices.map(([value, choiceLabel]) => { - return ( - - ); - })} + {choices.map(([value, choiceLabel]) => ( + + ))}
    ); diff --git a/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx b/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx index e0eab022d81028..e4aee2b4438b42 100644 --- a/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx +++ b/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx @@ -72,8 +72,8 @@ class SelectAsyncControl extends React.Component { ); }, 250); - handleLoadOptions = () => { - return new Promise((resolve, reject) => { + handleLoadOptions = () => + new Promise((resolve, reject) => { this.doQuery((err, result) => { if (err) { reject(err); @@ -100,7 +100,6 @@ class SelectAsyncControl extends React.Component { console.error(err); } ); - }; handleInputChange = query => { this.setState({query}); diff --git a/src/sentry/static/sentry/app/components/forms/selectAsyncField.jsx b/src/sentry/static/sentry/app/components/forms/selectAsyncField.jsx index 0a0fe717279a41..a66bbadcb83e3a 100644 --- a/src/sentry/static/sentry/app/components/forms/selectAsyncField.jsx +++ b/src/sentry/static/sentry/app/components/forms/selectAsyncField.jsx @@ -41,10 +41,9 @@ class SelectAsyncField extends SelectField { return (results && results.map(({id, text}) => ({value: id, label: text}))) || []; }; - onQuery = query => { + onQuery = query => // Used by legacy integrations - return {autocomplete_query: query, autocomplete_field: this.props.name}; - }; + ({autocomplete_query: query, autocomplete_field: this.props.name}); getField() { // Callers should be able to override all props except onChange diff --git a/src/sentry/static/sentry/app/components/forms/selectControlLegacy.jsx b/src/sentry/static/sentry/app/components/forms/selectControlLegacy.jsx index 63379188540452..3119706995419e 100644 --- a/src/sentry/static/sentry/app/components/forms/selectControlLegacy.jsx +++ b/src/sentry/static/sentry/app/components/forms/selectControlLegacy.jsx @@ -43,9 +43,7 @@ class SelectControlLegacy extends React.Component { height: 36, }; - renderArrow = () => { - return ; - }; + renderArrow = () => ; render() { const {async, creatable, options, choices, clearable, noMenu, ...props} = this.props; diff --git a/src/sentry/static/sentry/app/components/gridEditable/index.tsx b/src/sentry/static/sentry/app/components/gridEditable/index.tsx index 9b9ddb71d1f607..d119538fdbed86 100644 --- a/src/sentry/static/sentry/app/components/gridEditable/index.tsx +++ b/src/sentry/static/sentry/app/components/gridEditable/index.tsx @@ -418,9 +418,9 @@ class GridEditable< return ( {prependColumns && - prependColumns.map((item, i) => { - return {item}; - })} + prependColumns.map((item, i) => ( + {item} + ))} {/* Note that this.onResizeMouseDown assumes GridResizer is nested 2 levels under GridHeadCell */ columnOrder.map((column, i) => ( @@ -481,9 +481,9 @@ class GridEditable< return ( {prependColumns && - prependColumns.map((item, i) => { - return {item}; - })} + prependColumns.map((item, i) => ( + {item} + ))} {columnOrder.map((col, i) => ( {grid.renderBodyCell ? grid.renderBodyCell(col, dataRow) : dataRow[col.key]} diff --git a/src/sentry/static/sentry/app/components/group/externalIssueForm.tsx b/src/sentry/static/sentry/app/components/group/externalIssueForm.tsx index 593a23a496a749..431f868c554e7e 100644 --- a/src/sentry/static/sentry/app/components/group/externalIssueForm.tsx +++ b/src/sentry/static/sentry/app/components/group/externalIssueForm.tsx @@ -121,8 +121,8 @@ class ExternalIssueForm extends AsyncComponent { } }; - getOptions = (field: IssueConfigField, input: string) => { - return new Promise((resolve, reject) => { + getOptions = (field: IssueConfigField, input: string) => + new Promise((resolve, reject) => { if (!input) { const options = (field.choices || []).map(([value, label]) => ({value, label})); return resolve({options}); @@ -135,7 +135,6 @@ class ExternalIssueForm extends AsyncComponent { } }); }); - }; debouncedOptionLoad = debounce( async ( diff --git a/src/sentry/static/sentry/app/components/group/externalIssuesList.tsx b/src/sentry/static/sentry/app/components/group/externalIssuesList.tsx index 0f8d066e0ed929..50a0437494555f 100644 --- a/src/sentry/static/sentry/app/components/group/externalIssuesList.tsx +++ b/src/sentry/static/sentry/app/components/group/externalIssuesList.tsx @@ -174,11 +174,9 @@ class ExternalIssueList extends AsyncComponent { const {group, project} = this.props; return group.pluginIssues && group.pluginIssues.length - ? group.pluginIssues.map((plugin, i) => { - return ( - - ); - }) + ? group.pluginIssues.map((plugin, i) => ( + + )) : null; } @@ -186,13 +184,11 @@ class ExternalIssueList extends AsyncComponent { const {group} = this.props; return group.pluginActions && group.pluginActions.length - ? group.pluginActions.map((plugin, i) => { - return ( - - {plugin[0]} - - ); - }) + ? group.pluginActions.map((plugin, i) => ( + + {plugin[0]} + + )) : null; } diff --git a/src/sentry/static/sentry/app/components/group/participants.jsx b/src/sentry/static/sentry/app/components/group/participants.jsx index 39fa818707ad18..8a38062e23565f 100644 --- a/src/sentry/static/sentry/app/components/group/participants.jsx +++ b/src/sentry/static/sentry/app/components/group/participants.jsx @@ -14,13 +14,11 @@ const GroupParticipants = props => {
      - {participants.map(user => { - return ( -
    • - -
    • - ); - })} + {participants.map(user => ( +
    • + +
    • + ))}
    ); diff --git a/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx b/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx index 50a967b597abe4..cdc0a33374bc5d 100644 --- a/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx +++ b/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx @@ -50,11 +50,10 @@ export class SentryAppExternalIssueForm extends React.Component { addErrorMessage(t('Unable to %s %s issue.', action, appName)); }; - getOptions = (field: Field, input: string) => { - return new Promise(resolve => { + getOptions = (field: Field, input: string) => + new Promise(resolve => { this.debouncedOptionLoad(field, input, resolve); }); - }; debouncedOptionLoad = debounce( // debounce is used to prevent making a request for every input change and @@ -80,8 +79,8 @@ export class SentryAppExternalIssueForm extends React.Component { {trailing: true} ); - fieldProps = field => { - return field.uri + fieldProps = field => + field.uri ? { loadOptions: (input: string) => this.getOptions(field, input), async: true, @@ -92,7 +91,6 @@ export class SentryAppExternalIssueForm extends React.Component { autoload: false, } : {}; - }; getStacktrace() { const evt = this.props.event; @@ -161,9 +159,9 @@ export class SentryAppExternalIssueForm extends React.Component { onSubmitSuccess={this.onSubmitSuccess} onSubmitError={this.onSubmitError} > - {metaFields.map(field => { - return ; - })} + {metaFields.map(field => ( + + ))} {requiredFields.map(field => { field = Object.assign({}, field, { diff --git a/src/sentry/static/sentry/app/components/group/times.tsx b/src/sentry/static/sentry/app/components/group/times.tsx index 1e366e619cfa87..e39e08b1c40346 100644 --- a/src/sentry/static/sentry/app/components/group/times.tsx +++ b/src/sentry/static/sentry/app/components/group/times.tsx @@ -19,30 +19,28 @@ type Props = { firstSeen: string; }; -const Times = ({lastSeen, firstSeen}: Props) => { - return ( - -
    - {lastSeen && ( - - - - - )} - {firstSeen && lastSeen && ( -  â€”  - )} - {firstSeen && ( - - )} -
    -
    - ); -}; +const Times = ({lastSeen, firstSeen}: Props) => ( + +
    + {lastSeen && ( + + + + + )} + {firstSeen && lastSeen && ( +  â€”  + )} + {firstSeen && ( + + )} +
    +
    +); Times.propTypes = { lastSeen: PropTypes.string, firstSeen: PropTypes.string, diff --git a/src/sentry/static/sentry/app/components/inactivePlugins.jsx b/src/sentry/static/sentry/app/components/inactivePlugins.jsx index ed7ed065550992..86f5041a3be040 100644 --- a/src/sentry/static/sentry/app/components/inactivePlugins.jsx +++ b/src/sentry/static/sentry/app/components/inactivePlugins.jsx @@ -14,9 +14,7 @@ class InactivePlugins extends React.Component { onEnablePlugin: PropTypes.func.isRequired, }; - enablePlugin = plugin => { - return this.props.onEnablePlugin(plugin, true); - }; + enablePlugin = plugin => this.props.onEnablePlugin(plugin, true); render() { const plugins = this.props.plugins; @@ -29,20 +27,18 @@ class InactivePlugins extends React.Component { - {plugins.map(plugin => { - return ( - - - - ); - })} + {plugins.map(plugin => ( + + + + ))} diff --git a/src/sentry/static/sentry/app/components/indicators.jsx b/src/sentry/static/sentry/app/components/indicators.jsx index 458d6d04333978..209a276f4885ad 100644 --- a/src/sentry/static/sentry/app/components/indicators.jsx +++ b/src/sentry/static/sentry/app/components/indicators.jsx @@ -43,19 +43,13 @@ class Indicators extends React.Component { return ( - {items.map((indicator, i) => { + {items.map((indicator, i) => ( // We purposefully use `i` as key here because of transitions // Toasts can now queue up, so when we change from [firstToast] -> [secondToast], // we don't want to animate `firstToast` out and `secondToast` in, rather we want // to replace `firstToast` with `secondToast` - return ( - - ); - })} + + ))} ); } diff --git a/src/sentry/static/sentry/app/components/internalStatChart.jsx b/src/sentry/static/sentry/app/components/internalStatChart.jsx index 6c8a02cdc0d311..dfd0f626919437 100644 --- a/src/sentry/static/sentry/app/components/internalStatChart.jsx +++ b/src/sentry/static/sentry/app/components/internalStatChart.jsx @@ -64,9 +64,7 @@ class InternalStatChart extends React.Component { } getChartPoints() { - return this.state.data.map(([x, y]) => { - return {x, y}; - }); + return this.state.data.map(([x, y]) => ({x, y})); } render() { diff --git a/src/sentry/static/sentry/app/components/issueLink.jsx b/src/sentry/static/sentry/app/components/issueLink.jsx index 70a652eb67128f..3df0f100f08a47 100644 --- a/src/sentry/static/sentry/app/components/issueLink.jsx +++ b/src/sentry/static/sentry/app/components/issueLink.jsx @@ -75,14 +75,12 @@ export default class IssueLink extends React.Component { )} - {issue.annotations.map((annotation, i) => { - return ( - - ); - })} + {issue.annotations.map((annotation, i) => ( + + ))} } /> diff --git a/src/sentry/static/sentry/app/components/issueList.jsx b/src/sentry/static/sentry/app/components/issueList.jsx index eab5dccd225aeb..83caad6a6a579e 100644 --- a/src/sentry/static/sentry/app/components/issueList.jsx +++ b/src/sentry/static/sentry/app/components/issueList.jsx @@ -113,17 +113,15 @@ const IssueList = createReactClass({ body = ( - {this.state.data.map(issue => { - return ( - - ); - })} + {this.state.data.map(issue => ( + + ))} ); diff --git a/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx b/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx index c8591d6ec9a953..1e4f2b5f34bfc6 100644 --- a/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx @@ -46,13 +46,13 @@ class PublishRequestFormModel extends FormModel { getTransformedData() { const data = this.getData(); //map object to list of questions - const questionnaire = Array.from(this.fieldDescriptor.values()).map(field => { + const questionnaire = Array.from(this.fieldDescriptor.values()).map(field => //we read the meta for the question that has a react node for the label - return { + ({ question: field.meta || field.label, answer: data[field.name], - }; - }); + }) + ); return {questionnaire}; } } diff --git a/src/sentry/static/sentry/app/components/mutedBox.jsx b/src/sentry/static/sentry/app/components/mutedBox.jsx index 0eb2f65315790b..b47eabe2e2eb5f 100644 --- a/src/sentry/static/sentry/app/components/mutedBox.jsx +++ b/src/sentry/static/sentry/app/components/mutedBox.jsx @@ -51,19 +51,17 @@ export default class MutedBox extends React.PureComponent { return t('This issue has been ignored'); }; - render = () => { - return ( - - - - - {this.renderReason()} —  - {t( - 'You will not be notified of any changes and it will not show up by default in feeds.' - )} - - - - ); - }; + render = () => ( + + + + + {this.renderReason()} —  + {t( + 'You will not be notified of any changes and it will not show up by default in feeds.' + )} + + + + ); } diff --git a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/getParams.tsx b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/getParams.tsx index 08f1516af65c74..b3354d6080d26c 100644 --- a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/getParams.tsx +++ b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/getParams.tsx @@ -55,9 +55,7 @@ const getDateTimeString = ( return undefined; } - const result = maybe.find(needle => { - return moment.utc(needle).isValid(); - }); + const result = maybe.find(needle => moment.utc(needle).isValid()); return normalizeDateTimeString(result); } @@ -78,9 +76,7 @@ const getUtcValue = (maybe: string | string[] | undefined | null): string | unde return undefined; } - return maybe.find(needle => { - return !!parseUtcValue(needle); - }); + return maybe.find(needle => !!parseUtcValue(needle)); } maybe = parseUtcValue(maybe); diff --git a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.jsx b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.jsx index 415bf6d88fcfea..008ba5e9f6e046 100644 --- a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.jsx +++ b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.jsx @@ -334,9 +334,8 @@ class GlobalSelectionHeader extends React.Component { this.updateStoreIfChange(prevProps, this.props); } - hasMultipleProjectSelection = () => { - return new Set(this.props.organization.features).has('global-views'); - }; + hasMultipleProjectSelection = () => + new Set(this.props.organization.features).has('global-views'); /** * If user does not have access to `global-views` (e.g. multi project select), then @@ -510,11 +509,10 @@ class GlobalSelectionHeader extends React.Component { return [memberProjects, []]; }; - getFirstProject = () => { - return flatten(this.getProjects()) + getFirstProject = () => + flatten(this.getProjects()) .map(getProjectIdFromProject) .slice(0, 1); - }; getBackButton = () => { const {organization, location} = this.props; diff --git a/src/sentry/static/sentry/app/components/organizations/multipleSelectorSubmitRow.tsx b/src/sentry/static/sentry/app/components/organizations/multipleSelectorSubmitRow.tsx index 6968eacc51dbdc..f09ba5dd8d6d21 100644 --- a/src/sentry/static/sentry/app/components/organizations/multipleSelectorSubmitRow.tsx +++ b/src/sentry/static/sentry/app/components/organizations/multipleSelectorSubmitRow.tsx @@ -11,15 +11,13 @@ type Props = { onSubmit: () => void; }; -const MultipleSelectorSubmitRow = ({onSubmit}: Props) => { - return ( - - - {t('Apply')} - - - ); -}; +const MultipleSelectorSubmitRow = ({onSubmit}: Props) => ( + + + {t('Apply')} + + +); MultipleSelectorSubmitRow.propTypes = { onSubmit: PropTypes.func.isRequired, diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx index b37109c63614ee..46d3ad454d69d1 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx @@ -84,11 +84,10 @@ class DateRange extends React.Component { router: PropTypes.object, }; - static getTimeStringFromDate = date => { - return moment(date) + static getTimeStringFromDate = date => + moment(date) .local() .format('HH:mm'); - }; handleSelectDateRange = ({selection}) => { const {onChange} = this.props; diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.jsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.jsx index aadd4bd3ccc349..47a4d1092794ae 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.jsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.jsx @@ -5,23 +5,19 @@ import {DEFAULT_RELATIVE_PERIODS} from 'app/constants'; import SelectorItem from './selectorItem'; -const RelativeSelector = ({onClick, selected, relativePeriods}) => { - return ( - - {Object.entries(relativePeriods || DEFAULT_RELATIVE_PERIODS).map( - ([value, label]) => ( - - ) - )} - - ); -}; +const RelativeSelector = ({onClick, selected, relativePeriods}) => ( + + {Object.entries(relativePeriods || DEFAULT_RELATIVE_PERIODS).map(([value, label]) => ( + + ))} + +); RelativeSelector.propTypes = { onClick: PropTypes.func, diff --git a/src/sentry/static/sentry/app/components/platformList.jsx b/src/sentry/static/sentry/app/components/platformList.jsx index 6e04ac928a3d38..ef18dab4523b20 100644 --- a/src/sentry/static/sentry/app/components/platformList.jsx +++ b/src/sentry/static/sentry/app/components/platformList.jsx @@ -36,12 +36,11 @@ class PlatformList extends React.Component { return ; }; - getIcons = platforms => { - return platforms + getIcons = platforms => + platforms .slice() .reverse() .map(this.getIcon); - }; render() { const {platforms, max, size, direction, consistentWidth, className} = this.props; diff --git a/src/sentry/static/sentry/app/components/pluginList.tsx b/src/sentry/static/sentry/app/components/pluginList.tsx index 185b5723977af8..6bc64469346ff8 100644 --- a/src/sentry/static/sentry/app/components/pluginList.tsx +++ b/src/sentry/static/sentry/app/components/pluginList.tsx @@ -58,17 +58,15 @@ const PluginList = ({
    {pluginList .filter(p => p.enabled) - .map(data => { - return ( - - ); - })} + .map(data => ( + + ))} !p.enabled && !p.isHidden)} diff --git a/src/sentry/static/sentry/app/components/previewFeature.tsx b/src/sentry/static/sentry/app/components/previewFeature.tsx index b5c0b877f404ac..866bfb002f05ee 100644 --- a/src/sentry/static/sentry/app/components/previewFeature.tsx +++ b/src/sentry/static/sentry/app/components/previewFeature.tsx @@ -8,15 +8,13 @@ type Props = { type?: AlertProps['type']; }; -const PreviewFeature = ({type = 'info'}: Props) => { - return ( - - {t( - 'This feature is a preview and may change in the future. Thanks for being an early adopter!' - )} - - ); -}; +const PreviewFeature = ({type = 'info'}: Props) => ( + + {t( + 'This feature is a preview and may change in the future. Thanks for being an early adopter!' + )} + +); PreviewFeature.propTypes = { type: PropTypes.oneOf(['success', 'error', 'warning', 'info']), diff --git a/src/sentry/static/sentry/app/components/projectSelector.jsx b/src/sentry/static/sentry/app/components/projectSelector.jsx index 99404fd31ea0a5..69e7d0f024e5db 100644 --- a/src/sentry/static/sentry/app/components/projectSelector.jsx +++ b/src/sentry/static/sentry/app/components/projectSelector.jsx @@ -124,9 +124,7 @@ class ProjectSelector extends React.Component { if (multiProjects) { return [ - sortArray(multiProjects, project => { - return [!project.isBookmarked, project.name]; - }), + sortArray(multiProjects, project => [!project.isBookmarked, project.name]), nonMemberProjects || [], ]; } @@ -140,9 +138,7 @@ class ProjectSelector extends React.Component { : unfilteredProjects.filter(project => project.isMember); return [ - sortArray(filteredProjects, project => { - return [!project.isBookmarked, project.name]; - }), + sortArray(filteredProjects, project => [!project.isBookmarked, project.name]), [], ]; } diff --git a/src/sentry/static/sentry/app/components/projects/missingProjectMembership.jsx b/src/sentry/static/sentry/app/components/projects/missingProjectMembership.jsx index aac6f76dc75147..f7f3a64426dae7 100644 --- a/src/sentry/static/sentry/app/components/projects/missingProjectMembership.jsx +++ b/src/sentry/static/sentry/app/components/projects/missingProjectMembership.jsx @@ -104,13 +104,11 @@ class MissingProjectMembership extends React.Component { ); } - return teams.map(team => { - return ( -

    - #{team.slug}: {this.renderJoinTeam(team, features)} -

    - ); - }); + return teams.map(team => ( +

    + #{team.slug}: {this.renderJoinTeam(team, features)} +

    + )); } render() { diff --git a/src/sentry/static/sentry/app/components/resolutionBox.jsx b/src/sentry/static/sentry/app/components/resolutionBox.jsx index 2a5dbb63c8cd10..6bc51bd4a9e0a7 100644 --- a/src/sentry/static/sentry/app/components/resolutionBox.jsx +++ b/src/sentry/static/sentry/app/components/resolutionBox.jsx @@ -63,14 +63,12 @@ export default class ResolutionBox extends React.Component { return t('This issue has been marked as resolved.'); }; - render = () => { - return ( - - - - {this.renderReason()} - - - ); - }; + render = () => ( + + + + {this.renderReason()} + + + ); } diff --git a/src/sentry/static/sentry/app/components/resultGrid.jsx b/src/sentry/static/sentry/app/components/resultGrid.jsx index 7acf91be7a66a7..cddfb1059fe1d2 100644 --- a/src/sentry/static/sentry/app/components/resultGrid.jsx +++ b/src/sentry/static/sentry/app/components/resultGrid.jsx @@ -19,9 +19,9 @@ class Filter extends React.Component { }; getCurrentLabel = () => { - const selected = this.props.options.filter(item => { - return item[0] === (this.props.value || ''); - })[0]; + const selected = this.props.options.filter( + item => item[0] === (this.props.value || '') + )[0]; if (selected) { return this.props.name + ': ' + selected[1]; } @@ -46,29 +46,27 @@ class Filter extends React.Component { ); }; - getSelector = () => { - return ( - - {this.getDefaultItem()} - {this.props.options.map(item => { - const filterQuery = {}; - filterQuery[this.props.queryKey] = item[0]; - filterQuery.cursor = ''; - const query = $.extend({}, this.props.location.query, filterQuery); - return ( - - {item[1]} - - ); - })} - - ); - }; + getSelector = () => ( + + {this.getDefaultItem()} + {this.props.options.map(item => { + const filterQuery = {}; + filterQuery[this.props.queryKey] = item[0]; + filterQuery.cursor = ''; + const query = $.extend({}, this.props.location.query, filterQuery); + return ( + + {item[1]} + + ); + })} + + ); render() { return ( @@ -91,34 +89,29 @@ class SortBy extends React.Component { value: PropTypes.any, }; - getCurrentSortLabel = () => { - return this.props.options.filter(item => { - return item[0] === this.props.value; - })[0][1]; - }; + getCurrentSortLabel = () => + this.props.options.filter(item => item[0] === this.props.value)[0][1]; - getSortBySelector = () => { - return ( - - {this.props.options.map(item => { - const query = $.extend({}, this.props.location.query, { - sortBy: item[0], - cursor: '', - }); - return ( - - {item[1]} - - ); - })} - - ); - }; + getSortBySelector = () => ( + + {this.props.options.map(item => { + const query = $.extend({}, this.props.location.query, { + sortBy: item[0], + cursor: '', + }); + return ( + + {item[1]} + + ); + })} + + ); render() { if (this.props.options.length === 0) { @@ -309,9 +302,9 @@ const ResultGrid = createReactClass({ }, renderResults() { - return this.state.rows.map(row => { - return {this.props.columnsForRow(row)}; - }); + return this.state.rows.map(row => ( + {this.props.columnsForRow(row)} + )); }, render() { @@ -346,18 +339,16 @@ const ResultGrid = createReactClass({ path={this.props.path} location={this.props.location} /> - {Object.keys(filters).map(filterKey => { - return ( - - ); - })} + {Object.keys(filters).map(filterKey => ( + + ))}
    diff --git a/src/sentry/static/sentry/app/components/scoreBar.jsx b/src/sentry/static/sentry/app/components/scoreBar.jsx index c52b8af70457a1..d3c3b750827973 100644 --- a/src/sentry/static/sentry/app/components/scoreBar.jsx +++ b/src/sentry/static/sentry/app/components/scoreBar.jsx @@ -40,9 +40,9 @@ class ScoreBar extends React.Component { return (
    - {[...Array(scoreInBounds)].map((j, i) => { - return ; - })} + {[...Array(scoreInBounds)].map((j, i) => ( + + ))} {[...Array(maxScore - scoreInBounds)].map((j, i) => ( ))} diff --git a/src/sentry/static/sentry/app/components/search/index.jsx b/src/sentry/static/sentry/app/components/search/index.jsx index 98b2a550741269..59e574a59c6609 100644 --- a/src/sentry/static/sentry/app/components/search/index.jsx +++ b/src/sentry/static/sentry/app/components/search/index.jsx @@ -222,14 +222,14 @@ class Search extends React.Component { )} {!isLoading && - results.slice(0, maxResults).map((resultObj, index) => { - return this.renderItem({ + results.slice(0, maxResults).map((resultObj, index) => + this.renderItem({ resultObj, index, highlightedIndex, getItemProps, - }); - })} + }) + )} {!isLoading && !hasAnyResults && ( {t('No results found')} )} diff --git a/src/sentry/static/sentry/app/components/selectMembers/index.tsx b/src/sentry/static/sentry/app/components/selectMembers/index.tsx index cb16cf66ac82b7..b3dcd7f0560966 100644 --- a/src/sentry/static/sentry/app/components/selectMembers/index.tsx +++ b/src/sentry/static/sentry/app/components/selectMembers/index.tsx @@ -102,52 +102,46 @@ class SelectMembers extends React.Component { this.closeSelectMenu(); }); - renderUserBadge = (user: User) => { - return ; - }; - - createMentionableUser = (user: User) => { - return { - value: user.id, - label: this.renderUserBadge(user), - searchKey: getSearchKeyForUser(user), - actor: { - type: 'user', - id: user.id, - name: user.name, - }, - }; - }; + renderUserBadge = (user: User) => ( + + ); + + createMentionableUser = (user: User) => ({ + value: user.id, + label: this.renderUserBadge(user), + searchKey: getSearchKeyForUser(user), + actor: { + type: 'user', + id: user.id, + name: user.name, + }, + }); - createUnmentionableUser = ({user}) => { - return { - ...this.createMentionableUser(user), - disabled: true, - label: ( - - - {this.renderUserBadge(user)} - - - ), - }; - }; + createUnmentionableUser = ({user}) => ({ + ...this.createMentionableUser(user), + disabled: true, + label: ( + + + {this.renderUserBadge(user)} + + + ), + }); - createMentionableTeam = (team: Team): MentionableTeam => { - return { - value: team.id, - label: , - searchKey: `#${team.slug}`, - actor: { - type: 'team', - id: team.id, - name: team.slug, - }, - }; - }; + createMentionableTeam = (team: Team): MentionableTeam => ({ + value: team.id, + label: , + searchKey: `#${team.slug}`, + actor: { + type: 'team', + id: team.id, + name: team.slug, + }, + }); createUnmentionableTeam = (team: Team): UnmentionableTeam => { const {organization} = this.props; @@ -311,15 +305,16 @@ class SelectMembers extends React.Component { } }); }) - .then(members => { - // Be careful here as we actually want the `users` object, otherwise it means user - // has not registered for sentry yet, but has been invited - return (members - ? (members as Member[]) - .filter(({user}) => user && usersInProjectById.indexOf(user.id) === -1) - .map(this.createUnmentionableUser) - : []) as UnmentionableUser[]; - }) + .then( + members => + // Be careful here as we actually want the `users` object, otherwise it means user + // has not registered for sentry yet, but has been invited + (members + ? (members as Member[]) + .filter(({user}) => user && usersInProjectById.indexOf(user.id) === -1) + .map(this.createUnmentionableUser) + : []) as UnmentionableUser[] + ) .then((members: UnmentionableUser[]) => { const options = [...usersInProject, ...members]; this.setState({options}); diff --git a/src/sentry/static/sentry/app/components/sidebar/broadcasts.jsx b/src/sentry/static/sentry/app/components/sidebar/broadcasts.jsx index d35c0be1eee930..275dc308853b59 100644 --- a/src/sentry/static/sentry/app/components/sidebar/broadcasts.jsx +++ b/src/sentry/static/sentry/app/components/sidebar/broadcasts.jsx @@ -160,18 +160,16 @@ class Broadcasts extends React.Component { {t('No recent updates from the Sentry team.')} ) : ( - broadcasts.map(item => { - return ( - - ); - }) + broadcasts.map(item => ( + + )) )} )} diff --git a/src/sentry/static/sentry/app/components/sidebar/help.jsx b/src/sentry/static/sentry/app/components/sidebar/help.jsx index e2dc4daa97a804..393fab290f6460 100644 --- a/src/sentry/static/sentry/app/components/sidebar/help.jsx +++ b/src/sentry/static/sentry/app/components/sidebar/help.jsx @@ -32,37 +32,35 @@ class SidebarHelp extends React.Component { render() { return ( - {({isOpen, getActorProps, getMenuProps}) => { - return ( - - - } - label={t('Help')} - id="help" - /> - + {({isOpen, getActorProps, getMenuProps}) => ( + + + } + label={t('Help')} + id="help" + /> + - {isOpen && ( - - - - {t('Search Docs and FAQs')} - - - {t('Community Discussions')} - - - {t('Service Status')} - - - )} - - ); - }} + {isOpen && ( + + + + {t('Search Docs and FAQs')} + + + {t('Community Discussions')} + + + {t('Service Status')} + + + )} + + )} ); } diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/index.jsx b/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/index.jsx index ab14575db7ad17..882394bb03e4b0 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/index.jsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/index.jsx @@ -73,95 +73,93 @@ const SidebarDropdown = withApi( return ( - {({isOpen, getRootProps, getActorProps, getMenuProps}) => { - return ( - - - {avatar} - {!collapsed && orientation !== 'top' && ( - - - {hasOrganization ? org.name : user.name}{' '} - - - - {hasOrganization ? user.name : user.email} - - + {({isOpen, getRootProps, getActorProps, getMenuProps}) => ( + + + {avatar} + {!collapsed && orientation !== 'top' && ( + + + {hasOrganization ? org.name : user.name}{' '} + + + + {hasOrganization ? user.name : user.email} + + + )} + + + {isOpen && ( + + {hasOrganization && ( + + + {hasOrgRead && ( + + {t('Organization settings')} + + )} + {hasMemberRead && ( + + {t('Members')} + + )} + + {hasTeamRead && ( + + {t('Teams')} + + )} + + + + {!config.singleOrganization && ( + + + + )} + + + )} - - - {isOpen && ( - - {hasOrganization && ( - - - {hasOrgRead && ( - - {t('Organization settings')} - - )} - {hasMemberRead && ( - - {t('Members')} - - )} - {hasTeamRead && ( - - {t('Teams')} - + {!!user && ( + + + + + +
    + + {t('User settings')} + + + {t('API keys')} + + {user.isSuperuser && ( + {t('Admin')} )} - - - - {!config.singleOrganization && ( - - - - )} - - - - )} - - {!!user && ( - - - - - -
    - - {t('User settings')} - - - {t('API keys')} - - {user.isSuperuser && ( - {t('Admin')} - )} - - {t('Sign out')} - -
    -
    - )} - - )} - - ); - }} + + {t('Sign out')} + +
    +
    + )} +
    + )} +
    + )}
    ); } diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/switchOrganization.jsx b/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/switchOrganization.jsx index 80da6a90ac8737..4b1380ab1ea8c8 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/switchOrganization.jsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/switchOrganization.jsx @@ -28,65 +28,63 @@ class SwitchOrganization extends React.Component { return ( - {({isOpen, getMenuProps, getActorProps}) => { - return ( - - { - // This overwrites `DropdownMenu.getActorProps.onClick` which normally handles clicks on actor - // to toggle visibility of menu. Instead, do nothing because it is nested and we only want it - // to appear when hovered on. Will also stop menu from closing when clicked on (which seems to be common - // behavior); - - // Stop propagation so that dropdown menu doesn't close here - e.stopPropagation(); - }} + {({isOpen, getMenuProps, getActorProps}) => ( + + { + // This overwrites `DropdownMenu.getActorProps.onClick` which normally handles clicks on actor + // to toggle visibility of menu. Instead, do nothing because it is nested and we only want it + // to appear when hovered on. Will also stop menu from closing when clicked on (which seems to be common + // behavior); + + // Stop propagation so that dropdown menu doesn't close here + e.stopPropagation(); + }} + > + {t('Switch organization')} + + + + + + + {isOpen && ( + - {t('Switch organization')} - - - - - - - {isOpen && ( - - - {organizations.map(organization => { - const url = `/organizations/${organization.slug}/`; - - return ( - - - - ); - })} - - {hasOrganizations && canCreateOrganization && ( - - )} - {canCreateOrganization && ( - - - - {t('Create a new organization')} - - - )} - - )} - - ); - }} + + {organizations.map(organization => { + const url = `/organizations/${organization.slug}/`; + + return ( + + + + ); + })} + + {hasOrganizations && canCreateOrganization && ( + + )} + {canCreateOrganization && ( + + + + {t('Create a new organization')} + + + )} + + )} + + )} ); } diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarItem.jsx b/src/sentry/static/sentry/app/components/sidebar/sidebarItem.jsx index c3f4e3f18ba3f2..75cfefd1e8b2c0 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarItem.jsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarItem.jsx @@ -15,9 +15,7 @@ import TextOverflow from '../textOverflow'; const LabelHook = HookOrDefault({ hookName: 'sidebar:item-label', - defaultComponent: ({children}) => { - return {children}; - }, + defaultComponent: ({children}) => {children}, }); class SidebarItem extends React.Component { diff --git a/src/sentry/static/sentry/app/components/smartSearchBar/index.jsx b/src/sentry/static/sentry/app/components/smartSearchBar/index.jsx index f5663812682c35..f2bed3604d39af 100644 --- a/src/sentry/static/sentry/app/components/smartSearchBar/index.jsx +++ b/src/sentry/static/sentry/app/components/smartSearchBar/index.jsx @@ -200,9 +200,8 @@ class SmartSearchBar extends React.Component { * * e.g. ["is:unassigned", "browser:\"Chrome 33.0\"", "assigned"] */ - static getQueryTerms = (query, cursor) => { - return query.slice(0, cursor).match(/\S+:"[^"]*"?|\S+/g); - }; + static getQueryTerms = (query, cursor) => + query.slice(0, cursor).match(/\S+:"[^"]*"?|\S+/g); static defaultProps = { defaultQuery: '', diff --git a/src/sentry/static/sentry/app/components/smartSearchBar/searchDropdown.jsx b/src/sentry/static/sentry/app/components/smartSearchBar/searchDropdown.jsx index 9dd64779a2f574..fe0f03d78e035b 100644 --- a/src/sentry/static/sentry/app/components/smartSearchBar/searchDropdown.jsx +++ b/src/sentry/static/sentry/app/components/smartSearchBar/searchDropdown.jsx @@ -48,17 +48,15 @@ class SearchDropdown extends React.PureComponent { ); }; - renderHeaderItem = item => { - return ( - - - - {item.title && item.title} - {item.desc && {item.desc}} - - - ); - }; + renderHeaderItem = item => ( + + + + {item.title && item.title} + {item.desc && {item.desc}} + + + ); renderItem = item => ( {line .filter(result => !result.added) - .map((result, i) => { - return ( - - {result.value} - - ); - })} + .map((result, i) => ( + + {result.value} + + ))} @@ -67,13 +65,11 @@ class SplitDiff extends React.Component { {line .filter(result => !result.removed) - .map((result, i) => { - return ( - - {result.value} - - ); - })} + .map((result, i) => ( + + {result.value} + + ))} diff --git a/src/sentry/static/sentry/app/components/stackedBarChart.jsx b/src/sentry/static/sentry/app/components/stackedBarChart.jsx index f1d10adc38721f..896901084da705 100644 --- a/src/sentry/static/sentry/app/components/stackedBarChart.jsx +++ b/src/sentry/static/sentry/app/components/stackedBarChart.jsx @@ -106,12 +106,11 @@ class StackedBarChart extends React.Component { return !isEqual(this.props, nextProps); } - getInterval = series => { + getInterval = series => // TODO(dcramer): not guaranteed correct - return series.length && series[0].data.length > 1 + series.length && series[0].data.length > 1 ? series[0].data[1].x - series[0].data[0].x : null; - }; pointsToSeries = points => { const series = []; @@ -353,13 +352,9 @@ class StackedBarChart extends React.Component { const p = pointIndex[k]; return {x: p.x, y: p.y}; }) - .sort((a, b) => { - return a.x - b.x; - }); + .sort((a, b) => a.x - b.x); - markers.sort((a, b) => { - return a.x - b.x; - }); + markers.sort((a, b) => a.x - b.x); const children = []; const markerChildren = []; diff --git a/src/sentry/static/sentry/app/components/stream/groupChart.jsx b/src/sentry/static/sentry/app/components/stream/groupChart.jsx index cfce1ef7140d77..2f4d2463e402f7 100644 --- a/src/sentry/static/sentry/app/components/stream/groupChart.jsx +++ b/src/sentry/static/sentry/app/components/stream/groupChart.jsx @@ -31,9 +31,7 @@ class GroupChart extends React.Component { return null; } const {height} = this.props; - const chartData = stats.map(point => { - return {x: point[0], y: point[1]}; - }); + const chartData = stats.map(point => ({x: point[0], y: point[1]})); return ( diff --git a/src/sentry/static/sentry/app/components/stream/processingIssueList.jsx b/src/sentry/static/sentry/app/components/stream/processingIssueList.jsx index 77927e515fb5d9..c0d9f56bcb7e7f 100644 --- a/src/sentry/static/sentry/app/components/stream/processingIssueList.jsx +++ b/src/sentry/static/sentry/app/components/stream/processingIssueList.jsx @@ -67,17 +67,15 @@ class ProcessingIssueList extends React.Component { return ( - {issues.map((p, idx) => { - return ( - - ); - })} + {issues.map((p, idx) => ( + + ))} ); } diff --git a/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx b/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx index 3fd867b7f7ca35..3fc8ab88488407 100644 --- a/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx +++ b/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx @@ -157,9 +157,7 @@ class U2fInterface extends React.Component { ); }; - canTryAgain = () => { - return this.state.deviceFailure !== 'BAD_APPID'; - }; + canTryAgain = () => this.state.deviceFailure !== 'BAD_APPID'; renderFailure = () => { const {deviceFailure} = this.state; diff --git a/src/sentry/static/sentry/app/components/version.tsx b/src/sentry/static/sentry/app/components/version.tsx index 45596daa234981..08503bbad30720 100644 --- a/src/sentry/static/sentry/app/components/version.tsx +++ b/src/sentry/static/sentry/app/components/version.tsx @@ -103,23 +103,21 @@ const Version = ({ ); }; - const renderTooltipContent = () => { - return ( - { - e.stopPropagation(); - }} - > - {version} - - - - - - - - ); - }; + const renderTooltipContent = () => ( + { + e.stopPropagation(); + }} + > + {version} + + + + + + + + ); return ( ); }, - choices: ({groupingConfigs}) => { - return groupingConfigs.map(({id, hidden}) => { - return [ - id.toString(), - , - ]; - }); - }, + choices: ({groupingConfigs}) => + groupingConfigs.map(({id, hidden}) => [ + id.toString(), + , + ]), help: t('Sets the grouping algorithm to be used for new events.'), visible: ({features}) => features.has('set-grouping-config'), }, @@ -175,12 +172,8 @@ export const fields = { ); }, - choices: ({groupingEnhancementBases}) => { - return groupingEnhancementBases.map(({id}) => [ - id.toString(), - {id}, - ]); - }, + choices: ({groupingEnhancementBases}) => + groupingEnhancementBases.map(({id}) => [id.toString(), {id}]), help: t('The built-in base version of grouping enhancements.'), visible: ({features}) => features.has('set-grouping-config'), }, diff --git a/src/sentry/static/sentry/app/data/forms/sentryApplication.tsx b/src/sentry/static/sentry/app/data/forms/sentryApplication.tsx index de0b6a66f0e6c4..efa3c1f7af5aeb 100644 --- a/src/sentry/static/sentry/app/data/forms/sentryApplication.tsx +++ b/src/sentry/static/sentry/app/data/forms/sentryApplication.tsx @@ -68,9 +68,7 @@ const getPublicFormFields = (): Field[] => [ label: 'Schema', autosize: true, help: 'Schema for your UI components', - getValue: (val: string) => { - return val === '' ? {} : JSON.parse(val); - }, + getValue: (val: string) => (val === '' ? {} : JSON.parse(val)), setValue: (val: string) => { const schema = JSON.stringify(val, null, 2); if (schema === '{}') { diff --git a/src/sentry/static/sentry/app/plugins/components/issueActions.jsx b/src/sentry/static/sentry/app/plugins/components/issueActions.jsx index f2bd552d693c23..ebaee7d75fbab0 100644 --- a/src/sentry/static/sentry/app/plugins/components/issueActions.jsx +++ b/src/sentry/static/sentry/app/plugins/components/issueActions.jsx @@ -440,13 +440,11 @@ class IssueActions extends PluginComponentBase {

    The following settings must be configured:

      - {error.required_auth_settings.map((setting, i) => { - return ( -
    • - {setting} -
    • - ); - })} + {error.required_auth_settings.map((setting, i) => ( +
    • + {setting} +
    • + ))}
    ) : ( diff --git a/src/sentry/static/sentry/app/plugins/components/settings.jsx b/src/sentry/static/sentry/app/plugins/components/settings.jsx index 0ad6f909306efb..34695b825d41ec 100644 --- a/src/sentry/static/sentry/app/plugins/components/settings.jsx +++ b/src/sentry/static/sentry/app/plugins/components/settings.jsx @@ -203,15 +203,15 @@ class PluginSettings extends PluginComponentBase { )} - {this.state.fieldList.map(f => { - return this.renderField({ + {this.state.fieldList.map(f => + this.renderField({ key: f.name, config: f, formData: this.state.formData, formErrors: this.state.errors, onChange: this.changeField.bind(this, f.name), - }); - })} + }) + )} ); diff --git a/src/sentry/static/sentry/app/plugins/jira/components/issueActions.jsx b/src/sentry/static/sentry/app/plugins/jira/components/issueActions.jsx index a7066810ba23c3..9d1a6370e46c27 100644 --- a/src/sentry/static/sentry/app/plugins/jira/components/issueActions.jsx +++ b/src/sentry/static/sentry/app/plugins/jira/components/issueActions.jsx @@ -88,9 +88,7 @@ class IssueActions extends DefaultIssuePlugin.DefaultIssueActions { ); }; - const isRequired = f => { - return f.required !== null ? f.required : true; - }; + const isRequired = f => (f.required !== null ? f.required : true); const fields = this.state.createFieldList; const requiredFields = fields.filter(f => isRequired(f)).map(f => renderField(f)); diff --git a/src/sentry/static/sentry/app/plugins/jira/components/settings.jsx b/src/sentry/static/sentry/app/plugins/jira/components/settings.jsx index 25989a2517145e..9a5ba11e07c216 100644 --- a/src/sentry/static/sentry/app/plugins/jira/components/settings.jsx +++ b/src/sentry/static/sentry/app/plugins/jira/components/settings.jsx @@ -142,15 +142,13 @@ class Settings extends BasePlugin.DefaultSettings { let onSubmit; let submitLabel; if (this.state.editing) { - fields = this.state.fieldList.filter(f => { - return this.PAGE_FIELD_LIST[this.state.page].includes(f.name); - }); + fields = this.state.fieldList.filter(f => + this.PAGE_FIELD_LIST[this.state.page].includes(f.name) + ); onSubmit = this.onSubmit; submitLabel = this.isLastPage() ? 'Finish' : 'Save and Continue'; } else { - fields = this.state.fieldList.map(f => { - return Object.assign({}, f, {readonly: true}); - }); + fields = this.state.fieldList.map(f => Object.assign({}, f, {readonly: true})); onSubmit = this.startEditing; submitLabel = 'Edit'; } @@ -178,14 +176,14 @@ class Settings extends BasePlugin.DefaultSettings { )} - {fields.map(f => { - return this.renderField({ + {fields.map(f => + this.renderField({ config: f, formData: this.state.formData, formErrors: this.state.errors, onChange: this.changeField.bind(this, f.name), - }); - })} + }) + )} ); } diff --git a/src/sentry/static/sentry/app/plugins/sessionstack/components/settings.jsx b/src/sentry/static/sentry/app/plugins/sessionstack/components/settings.jsx index a8d319a42148c0..22063c0e583114 100644 --- a/src/sentry/static/sentry/app/plugins/sessionstack/components/settings.jsx +++ b/src/sentry/static/sentry/app/plugins/sessionstack/components/settings.jsx @@ -16,20 +16,18 @@ class Settings extends BasePlugin.DefaultSettings { } renderFields(fields) { - return fields.map(f => { - return this.renderField({ + return fields.map(f => + this.renderField({ config: f, formData: this.state.formData, formErrors: this.state.errors, onChange: this.changeField.bind(this, f.name), - }); - }); + }) + ); } filterFields(fields, fieldNames) { - return fields.filter(field => { - return fieldNames.includes(field.name); - }); + return fields.filter(field => fieldNames.includes(field.name)); } toggleOnPremisesConfiguration() { diff --git a/src/sentry/static/sentry/app/stores/globalSelectionStore.jsx b/src/sentry/static/sentry/app/stores/globalSelectionStore.jsx index e6089dd6ebd9fe..52238054d74f65 100644 --- a/src/sentry/static/sentry/app/stores/globalSelectionStore.jsx +++ b/src/sentry/static/sentry/app/stores/globalSelectionStore.jsx @@ -16,18 +16,16 @@ import localStorage from 'app/utils/localStorage'; const DEFAULT_PARAMS = getParams({}); -const getDefaultSelection = () => { - return { - projects: [], - environments: [], - datetime: { - [DATE_TIME.START]: DEFAULT_PARAMS.start || null, - [DATE_TIME.END]: DEFAULT_PARAMS.end || null, - [DATE_TIME.PERIOD]: DEFAULT_PARAMS.statsPeriod || null, - [DATE_TIME.UTC]: DEFAULT_PARAMS.utc || null, - }, - }; -}; +const getDefaultSelection = () => ({ + projects: [], + environments: [], + datetime: { + [DATE_TIME.START]: DEFAULT_PARAMS.start || null, + [DATE_TIME.END]: DEFAULT_PARAMS.end || null, + [DATE_TIME.PERIOD]: DEFAULT_PARAMS.statsPeriod || null, + [DATE_TIME.UTC]: DEFAULT_PARAMS.utc || null, + }, +}); const getProjectsByIds = async (organization, projectIds, api) => { const query = {}; diff --git a/src/sentry/static/sentry/app/stores/groupingStore.jsx b/src/sentry/static/sentry/app/stores/groupingStore.jsx index 57a8a723411b8a..e2b8a8f09538f5 100644 --- a/src/sentry/static/sentry/app/stores/groupingStore.jsx +++ b/src/sentry/static/sentry/app/stores/groupingStore.jsx @@ -87,25 +87,26 @@ const GroupingStore = Reflux.createStore({ this.init(); this.triggerFetchState(); - const promises = requests.map(({endpoint, queryParams, dataKey}) => { - return new Promise((resolve, reject) => { - api.request(endpoint, { - method: 'GET', - data: queryParams, - success: (data, _, jqXHR) => { - resolve({ - dataKey, - data, - links: jqXHR.getResponseHeader('Link'), - }); - }, - error: err => { - const error = (err.responseJSON && err.responseJSON.detail) || true; - reject(error); - }, - }); - }); - }); + const promises = requests.map( + ({endpoint, queryParams, dataKey}) => + new Promise((resolve, reject) => { + api.request(endpoint, { + method: 'GET', + data: queryParams, + success: (data, _, jqXHR) => { + resolve({ + dataKey, + data, + links: jqXHR.getResponseHeader('Link'), + }); + }, + error: err => { + const error = (err.responseJSON && err.responseJSON.detail) || true; + reject(error); + }, + }); + }) + ); const responseProcessors = { merged: item => { diff --git a/src/sentry/static/sentry/app/stores/guideStore.jsx b/src/sentry/static/sentry/app/stores/guideStore.jsx index bac775e5888176..704fdba866e4d9 100644 --- a/src/sentry/static/sentry/app/stores/guideStore.jsx +++ b/src/sentry/static/sentry/app/stores/guideStore.jsx @@ -77,9 +77,9 @@ const GuideStore = Reflux.createStore({ onCloseGuide() { const {currentGuide} = this.state; this.state.guides[ - Object.keys(this.state.guides).find(key => { - return this.state.guides[key].id === currentGuide.id; - }) + Object.keys(this.state.guides).find( + key => this.state.guides[key].id === currentGuide.id + ) ].seen = true; // Don't continue to force show if the user dismissed the guide. this.state.forceShow = false; @@ -136,11 +136,11 @@ const GuideStore = Reflux.createStore({ // sort() so that we pick a guide deterministically every time this function is called. let guideKeys = Object.keys(this.state.guides) .sort() - .filter(key => { - return this.state.guides[key].required_targets.every( + .filter(key => + this.state.guides[key].required_targets.every( t => availableTargets.indexOf(t) >= 0 - ); - }); + ) + ); if (!this.state.forceShow) { const user = ConfigStore.get('user'); diff --git a/src/sentry/static/sentry/app/stores/hookStore.tsx b/src/sentry/static/sentry/app/stores/hookStore.tsx index 4c71330eaaccc2..4e4d3ffa3776b5 100644 --- a/src/sentry/static/sentry/app/stores/hookStore.tsx +++ b/src/sentry/static/sentry/app/stores/hookStore.tsx @@ -94,9 +94,7 @@ const hookStoreConfig: Reflux.StoreDefinition & HookStoreInterface = { if (isUndefined(this.hooks[hookName])) { return; } - this.hooks[hookName] = this.hooks[hookName]!.filter(cb => { - return cb !== callback; - }); + this.hooks[hookName] = this.hooks[hookName]!.filter(cb => cb !== callback); this.trigger(hookName, this.hooks[hookName]); }, diff --git a/src/sentry/static/sentry/app/stores/indicatorStore.jsx b/src/sentry/static/sentry/app/stores/indicatorStore.jsx index d17918c1a3d1dc..8a25a83088c439 100644 --- a/src/sentry/static/sentry/app/stores/indicatorStore.jsx +++ b/src/sentry/static/sentry/app/stores/indicatorStore.jsx @@ -86,9 +86,7 @@ const IndicatorStore = Reflux.createStore({ return; } - this.items = this.items.filter(item => { - return item !== indicator; - }); + this.items = this.items.filter(item => item !== indicator); if (indicator.clearId) { window.clearTimeout(indicator.options.clearId); diff --git a/src/sentry/static/sentry/app/stores/tagStore.jsx b/src/sentry/static/sentry/app/stores/tagStore.jsx index 54fb64ee90de69..9f0550883d9606 100644 --- a/src/sentry/static/sentry/app/stores/tagStore.jsx +++ b/src/sentry/static/sentry/app/stores/tagStore.jsx @@ -16,9 +16,7 @@ const getUsername = ({isManaged, username, email}) => { } }; -const getMemberListStoreUsernames = () => { - return MemberListStore.getAll().map(getUsername); -}; +const getMemberListStoreUsernames = () => MemberListStore.getAll().map(getUsername); const TagStore = Reflux.createStore({ listenables: TagActions, diff --git a/src/sentry/static/sentry/app/styles/text.tsx b/src/sentry/static/sentry/app/styles/text.tsx index 2c00077bd52c65..f105691f9b551a 100644 --- a/src/sentry/static/sentry/app/styles/text.tsx +++ b/src/sentry/static/sentry/app/styles/text.tsx @@ -1,74 +1,72 @@ import {css} from '@emotion/core'; -const textStyles = () => { - return css` - /* stylelint-disable no-descending-specificity */ - h1, - h2, - h3, - h4, - h5, - h6, - p, - ul, - ol, - table, - dl, - blockquote, - form, - pre, - .auto-select-text, - .section, - [class^='highlight-'] { - margin-bottom: 20px; +const textStyles = () => css` + /* stylelint-disable no-descending-specificity */ + h1, + h2, + h3, + h4, + h5, + h6, + p, + ul, + ol, + table, + dl, + blockquote, + form, + pre, + .auto-select-text, + .section, + [class^='highlight-'] { + margin-bottom: 20px; - &:last-child { - margin-bottom: 0; - } + &:last-child { + margin-bottom: 0; } + } - h1, - h2, - h3, - h4, - h5, - h6 { - line-height: 1.2; - } + h1, + h2, + h3, + h4, + h5, + h6 { + line-height: 1.2; + } - p, - ul, - ol, - blockquote { - line-height: 1.5; - } + p, + ul, + ol, + blockquote { + line-height: 1.5; + } - h1 { - font-size: 2em; - } + h1 { + font-size: 2em; + } - h2 { - font-size: 1.75em; - } + h2 { + font-size: 1.75em; + } - h3 { - font-size: 1.5em; - } + h3 { + font-size: 1.5em; + } - h4 { - font-size: 1.25em; - } + h4 { + font-size: 1.25em; + } - h5 { - font-size: 1em; - } + h5 { + font-size: 1em; + } - pre { - word-break: break-all; - white-space: pre-wrap; - } - /* stylelint-enable */ - `; -}; + pre { + word-break: break-all; + white-space: pre-wrap; + } + /* stylelint-enable */ +`; export default textStyles; diff --git a/src/sentry/static/sentry/app/utils.tsx b/src/sentry/static/sentry/app/utils.tsx index b688488155b75d..338e7345a83fc5 100644 --- a/src/sentry/static/sentry/app/utils.tsx +++ b/src/sentry/static/sentry/app/utils.tsx @@ -144,9 +144,10 @@ export function percent(value: number, totalValue: number): number { } export function toTitleCase(str: string): string { - return str.replace(/\w\S*/g, txt => { - return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); - }); + return str.replace( + /\w\S*/g, + txt => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase() + ); } export function formatBytes(bytes: number): string { diff --git a/src/sentry/static/sentry/app/utils/__mocks__/localStorage.tsx b/src/sentry/static/sentry/app/utils/__mocks__/localStorage.tsx index a50ff823870d29..3305988b683823 100644 --- a/src/sentry/static/sentry/app/utils/__mocks__/localStorage.tsx +++ b/src/sentry/static/sentry/app/utils/__mocks__/localStorage.tsx @@ -1,9 +1,7 @@ const localStorageMock = function() { let store = {}; return { - getItem: jest.fn(key => { - return store[key]; - }), + getItem: jest.fn(key => store[key]), setItem: jest.fn((key, value) => { store[key] = value.toString(); }), diff --git a/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx b/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx index 97d101f466970a..0310b44343a277 100644 --- a/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx +++ b/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx @@ -44,9 +44,7 @@ const permissionLevel = (scope: string): number => { return PERMISSION_LEVELS[permission]; }; -const compareScopes = (a: string, b: string) => { - return permissionLevel(a) - permissionLevel(b); -}; +const compareScopes = (a: string, b: string) => permissionLevel(a) - permissionLevel(b); /** * Return the most permissive scope for each resource. diff --git a/src/sentry/static/sentry/app/utils/getStacktraceBody.jsx b/src/sentry/static/sentry/app/utils/getStacktraceBody.jsx index b34bfede732860..82d5514fcc4013 100644 --- a/src/sentry/static/sentry/app/utils/getStacktraceBody.jsx +++ b/src/sentry/static/sentry/app/utils/getStacktraceBody.jsx @@ -27,7 +27,5 @@ export default function getStacktraceBody(event) { return exc.data.values .filter(value => !!value.stacktrace) .map(value => rawStacktraceContent(value.stacktrace, event.platform, value)) - .reduce((acc, value) => { - return acc.concat(value); - }, []); + .reduce((acc, value) => acc.concat(value), []); } diff --git a/src/sentry/static/sentry/app/utils/guid.tsx b/src/sentry/static/sentry/app/utils/guid.tsx index 0a87ce8cf75fb5..84d1b7263d636c 100644 --- a/src/sentry/static/sentry/app/utils/guid.tsx +++ b/src/sentry/static/sentry/app/utils/guid.tsx @@ -1,8 +1,7 @@ export function uniqueId(): string { - const s4 = (): string => { - return Math.floor((1 + Math.random()) * 0x10000) + const s4 = (): string => + Math.floor((1 + Math.random()) * 0x10000) .toString(16) .substring(1); - }; return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); } diff --git a/src/sentry/static/sentry/app/utils/highlightFuseMatches.jsx b/src/sentry/static/sentry/app/utils/highlightFuseMatches.jsx index a752c5d99578ca..373810d89c3b27 100644 --- a/src/sentry/static/sentry/app/utils/highlightFuseMatches.jsx +++ b/src/sentry/static/sentry/app/utils/highlightFuseMatches.jsx @@ -65,8 +65,8 @@ const getFuseMatches = ({value, indices}) => { /** * Given a match object from fuse.js, returns an array of components with "highlighted" (bold) substrings. */ -const highlightFuseMatches = (matchObj, Marker = 'mark') => { - return getFuseMatches(matchObj).map(({highlight, text}, index) => { +const highlightFuseMatches = (matchObj, Marker = 'mark') => + getFuseMatches(matchObj).map(({highlight, text}, index) => { if (!text) { return null; } @@ -76,7 +76,6 @@ const highlightFuseMatches = (matchObj, Marker = 'mark') => { return {text}; }); -}; export {getFuseMatches}; export default highlightFuseMatches; diff --git a/src/sentry/static/sentry/app/utils/integrationUtil.tsx b/src/sentry/static/sentry/app/utils/integrationUtil.tsx index 56e42d91c6ce94..4fc70fc409e55a 100644 --- a/src/sentry/static/sentry/app/utils/integrationUtil.tsx +++ b/src/sentry/static/sentry/app/utils/integrationUtil.tsx @@ -25,9 +25,8 @@ export const clearAnalyticsSession = () => { window.sessionStorage.removeItem(INTEGRATIONS_ANALYTICS_SESSION_KEY); }; -export const getAnalyticsSessionId = () => { - return window.sessionStorage.getItem(INTEGRATIONS_ANALYTICS_SESSION_KEY); -}; +export const getAnalyticsSessionId = () => + window.sessionStorage.getItem(INTEGRATIONS_ANALYTICS_SESSION_KEY); export const isIntegrationDirectoryActive = () => localStorage.getItem(USE_INTEGRATION_DIRECTORY) === '1'; diff --git a/src/sentry/static/sentry/app/utils/streamManager.jsx b/src/sentry/static/sentry/app/utils/streamManager.jsx index 93b98b56d6d1c6..102fcc633da295 100644 --- a/src/sentry/static/sentry/app/utils/streamManager.jsx +++ b/src/sentry/static/sentry/app/utils/streamManager.jsx @@ -41,9 +41,7 @@ class StreamManager { return this.store .getAllItems() .slice() - .sort((a, b) => { - return this.idList.indexOf(a.id) - this.idList.indexOf(b.id); - }); + .sort((a, b) => this.idList.indexOf(a.id) - this.idList.indexOf(b.id)); } unshift(items = []) { diff --git a/src/sentry/static/sentry/app/views/admin/adminLayout.jsx b/src/sentry/static/sentry/app/views/admin/adminLayout.jsx index eeead60ef95e03..cccae54bd63bc5 100644 --- a/src/sentry/static/sentry/app/views/admin/adminLayout.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminLayout.jsx @@ -6,9 +6,7 @@ import ListLink from 'app/components/links/listLink'; import Sidebar from 'app/components/sidebar'; export default class AdminLayout extends React.Component { - getTitle = () => { - return 'Sentry Admin'; - }; + getTitle = () => 'Sentry Admin'; render() { return ( diff --git a/src/sentry/static/sentry/app/views/admin/adminOrganizations.jsx b/src/sentry/static/sentry/app/views/admin/adminOrganizations.jsx index 275058842c457e..43c6823e1688d7 100644 --- a/src/sentry/static/sentry/app/views/admin/adminOrganizations.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminOrganizations.jsx @@ -6,17 +6,15 @@ import ResultGrid from 'app/components/resultGrid'; import {t} from 'app/locale'; class AdminOrganizations extends React.Component { - getRow = row => { - return [ - , - ]; - }; + getRow = row => [ + , + ]; render() { const columns = []; diff --git a/src/sentry/static/sentry/app/views/admin/adminOverview/apiChart.jsx b/src/sentry/static/sentry/app/views/admin/adminOverview/apiChart.jsx index 2126aa9d8208cd..f182c26244c304 100644 --- a/src/sentry/static/sentry/app/views/admin/adminOverview/apiChart.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminOverview/apiChart.jsx @@ -86,9 +86,7 @@ const ApiChart = createReactClass({ }, processRawSeries(series) { - return series.map(item => { - return {x: item[0], y: item[1]}; - }); + return series.map(item => ({x: item[0], y: item[1]})); }, getChartSeries() { diff --git a/src/sentry/static/sentry/app/views/admin/adminOverview/eventChart.jsx b/src/sentry/static/sentry/app/views/admin/adminOverview/eventChart.jsx index c7728088e59086..946e6092afc347 100644 --- a/src/sentry/static/sentry/app/views/admin/adminOverview/eventChart.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminOverview/eventChart.jsx @@ -110,13 +110,11 @@ const EventChart = createReactClass({ avgRate: parseInt(aReceived[0] / aReceived[1] / 60, 10), }, stats: { - rejected: Object.keys(sRejected).map(ts => { - return {x: ts, y: sRejected[ts] || null}; - }), - accepted: Object.keys(sReceived).map(ts => { + rejected: Object.keys(sRejected).map(ts => ({x: ts, y: sRejected[ts] || null})), + accepted: Object.keys(sReceived).map(ts => // total number of events accepted (received - rejected) - return {x: ts, y: sReceived[ts] - sRejected[ts]}; - }), + ({x: ts, y: sReceived[ts] - sRejected[ts]}) + ), }, loading: false, }); diff --git a/src/sentry/static/sentry/app/views/admin/adminProjects.jsx b/src/sentry/static/sentry/app/views/admin/adminProjects.jsx index ecb0f7b12d4c1f..7696ded1c3a38c 100644 --- a/src/sentry/static/sentry/app/views/admin/adminProjects.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminProjects.jsx @@ -10,19 +10,17 @@ export const prettyDate = function(x) { }; class AdminProjects extends React.Component { - getRow = row => { - return [ - , - , - , - ]; - }; + getRow = row => [ + , + , + , + ]; render() { const columns = [ diff --git a/src/sentry/static/sentry/app/views/admin/adminQueue.jsx b/src/sentry/static/sentry/app/views/admin/adminQueue.jsx index 43b1b79bb1035b..af48d139f39c94 100644 --- a/src/sentry/static/sentry/app/views/admin/adminQueue.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminQueue.jsx @@ -46,19 +46,17 @@ export default class AdminQueue extends AsyncView { return (
    - {['1h', '1d', '1w'].map(r => { - return ( - this.changeWindow(r)} - key={r} - > - {r} - - ); - })} + {['1h', '1d', '1w'].map(r => ( + this.changeWindow(r)} + key={r} + > + {r} + + ))}

    Queue Overview

    diff --git a/src/sentry/static/sentry/app/views/admin/adminUsers.jsx b/src/sentry/static/sentry/app/views/admin/adminUsers.jsx index cc2a2fe392844b..98355cb4cbcc8f 100644 --- a/src/sentry/static/sentry/app/views/admin/adminUsers.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminUsers.jsx @@ -11,19 +11,17 @@ export const prettyDate = function(x) { }; class AdminUsers extends React.Component { - getRow = row => { - return [ -
    , - , - , - ]; - }; + getRow = row => [ + , + , + , + ]; render() { const columns = [ diff --git a/src/sentry/static/sentry/app/views/alerts/details/activity/activityPlaceholder.tsx b/src/sentry/static/sentry/app/views/alerts/details/activity/activityPlaceholder.tsx index 2f7d22a4b66a08..73a0888e70f802 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/activity/activityPlaceholder.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/activity/activityPlaceholder.tsx @@ -5,19 +5,17 @@ import ActivityItem from 'app/components/activity/item'; import space from 'app/styles/space'; import theme from 'app/utils/theme'; -const ActivityPlaceholder = () => { - return ( - - {() => } - - ); -}; +const ActivityPlaceholder = () => ( + + {() => } + +); const Placeholder = styled('div')` padding: ${space(4)}; diff --git a/src/sentry/static/sentry/app/views/alerts/details/chart.tsx b/src/sentry/static/sentry/app/views/alerts/details/chart.tsx index ce3d662af4b12e..8256cc85e2e491 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/chart.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/chart.tsx @@ -48,12 +48,10 @@ export default class Chart extends React.PureComponent { render() { const {aggregation, data, detected, closed} = this.props; - const chartData = data.map(([ts, val]) => { - return [ - ts * 1000, - val.length ? val.reduce((acc, {count} = {count: 0}) => acc + count, 0) : 0, - ]; - }); + const chartData = data.map(([ts, val]) => [ + ts * 1000, + val.length ? val.reduce((acc, {count} = {count: 0}) => acc + count, 0) : 0, + ]); const detectedTs = detected && moment.utc(detected).unix(); const closedTs = closed && moment.utc(closed).unix(); diff --git a/src/sentry/static/sentry/app/views/discover/analytics.tsx b/src/sentry/static/sentry/app/views/discover/analytics.tsx index 6215f4add2271d..1ec8998ac7ca58 100644 --- a/src/sentry/static/sentry/app/views/discover/analytics.tsx +++ b/src/sentry/static/sentry/app/views/discover/analytics.tsx @@ -26,13 +26,11 @@ export function trackQuery(organization: Organization, query: Query) { data.conditions = query.conditions && - query.conditions.map(condition => { - return [ - condition[0], - condition[1], - typeof condition[2] === 'string' ? '[REDACTED]' : condition[2], - ]; - }); + query.conditions.map(condition => [ + condition[0], + condition[1], + typeof condition[2] === 'string' ? '[REDACTED]' : condition[2], + ]); analytics('discover.query', data); } diff --git a/src/sentry/static/sentry/app/views/discover/index.tsx b/src/sentry/static/sentry/app/views/discover/index.tsx index 133aea398294cf..3e29168bb4e634 100644 --- a/src/sentry/static/sentry/app/views/discover/index.tsx +++ b/src/sentry/static/sentry/app/views/discover/index.tsx @@ -132,9 +132,7 @@ class DiscoverContainer extends React.Component { private queryBuilder: any; - loadTags = () => { - return this.queryBuilder.load(); - }; + loadTags = () => this.queryBuilder.load(); setGlobalSelectionDate(query: ReturnType | null) { if (query) { diff --git a/src/sentry/static/sentry/app/views/discover/result/table.tsx b/src/sentry/static/sentry/app/views/discover/result/table.tsx index 0e4ff1f6db9104..42ad1e45391b2c 100644 --- a/src/sentry/static/sentry/app/views/discover/result/table.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/table.tsx @@ -191,9 +191,9 @@ class ResultTable extends React.Component { } const row = data[rowIndex - 1]; // -1 offset due to header row - const colWidths = columnsToCheck.map(col => { - return this.measureText(getDisplayText(row[col]), false); - }); + const colWidths = columnsToCheck.map(col => + this.measureText(getDisplayText(row[col]), false) + ); const maxColWidth = Math.max(...colWidths, 0); // Number of rows to be rendered based on text content divided by cell width diff --git a/src/sentry/static/sentry/app/views/discover/result/utils.tsx b/src/sentry/static/sentry/app/views/discover/result/utils.tsx index 6fe4250c79a1df..e862c6b74fd89a 100644 --- a/src/sentry/static/sentry/app/views/discover/result/utils.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/utils.tsx @@ -21,18 +21,14 @@ const CHART_KEY = '__CHART_KEY__'; export function getChartData(data: any[], query: any) { const {fields} = query; - return query.aggregations.map((aggregation: Aggregation) => { - return { - seriesName: aggregation[2], - animation: false, - data: data.map(res => { - return { - value: res[aggregation[2]], - name: fields.map((field: string) => `${field} ${res[field]}`).join(' '), - }; - }), - }; - }); + return query.aggregations.map((aggregation: Aggregation) => ({ + seriesName: aggregation[2], + animation: false, + data: data.map(res => ({ + value: res[aggregation[2]], + name: fields.map((field: string) => `${field} ${res[field]}`).join(' '), + })), + })); } /** @@ -133,12 +129,10 @@ export function getChartDataByDay(rawData: any[], query: Query, options: any = { }); // Format for echarts - return Object.entries(seriesHash).map(([seriesName, series]) => { - return { - seriesName, - data: series, - }; - }); + return Object.entries(seriesHash).map(([seriesName, series]) => ({ + seriesName, + data: series, + })); } /** @@ -193,12 +187,10 @@ function getEmptySeriesHash(seriesSet: any, dates: number[]): any { } function getEmptySeries(dates: number[]) { - return dates.map(date => { - return { - value: 0, - name: date, - }; - }); + return dates.map(date => ({ + value: 0, + name: date, + })); } // Get the top series ranked by latest time / largest aggregate @@ -362,9 +354,7 @@ export function downloadAsCsv(result: SnubaResult) { const csvContent = Papa.unparse({ fields: headings, - data: data.map(row => { - return headings.map(col => disableMacros(row[col])); - }), + data: data.map(row => headings.map(col => disableMacros(row[col]))), }); // Need to also manually replace # since encodeURI skips them diff --git a/src/sentry/static/sentry/app/views/discover/result/visualizationsToggle.tsx b/src/sentry/static/sentry/app/views/discover/result/visualizationsToggle.tsx index 899ee072742545..9325b06000b2e6 100644 --- a/src/sentry/static/sentry/app/views/discover/result/visualizationsToggle.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/visualizationsToggle.tsx @@ -24,18 +24,16 @@ type Props = { }; class VisualizationsToggle extends React.Component { - getMenuItem = (opt: Option) => { - return ( - - {opt.name} - - ); - }; + getMenuItem = (opt: Option) => ( + + {opt.name} + + ); getButtonItems = (opt: Option) => { const active = opt.id === this.props.visualization; @@ -63,15 +61,11 @@ class VisualizationsToggle extends React.Component { return ( - {options.map(opt => { - return this.getButtonItems(opt); - })} + {options.map(opt => this.getButtonItems(opt))} - {options.map(opt => { - return this.getMenuItem(opt); - })} + {options.map(opt => this.getMenuItem(opt))} {this.getDownloadCsvButton()} diff --git a/src/sentry/static/sentry/app/views/discover/sidebar/queryFields.tsx b/src/sentry/static/sentry/app/views/discover/sidebar/queryFields.tsx index 29b4e0961a5417..17dcd6ba9541bf 100644 --- a/src/sentry/static/sentry/app/views/discover/sidebar/queryFields.tsx +++ b/src/sentry/static/sentry/app/views/discover/sidebar/queryFields.tsx @@ -49,14 +49,12 @@ export default class QueryFields extends React.Component { return {text}; }; - optionRenderer = ({label, isTag}: ReactSelectOption) => { - return ( - - ); - }; + optionRenderer = ({label, isTag}: ReactSelectOption) => ( + + ); render() { const { diff --git a/src/sentry/static/sentry/app/views/events/eventsChart.jsx b/src/sentry/static/sentry/app/views/events/eventsChart.jsx index 71a0c1b4724ae8..43aa655dcc4715 100644 --- a/src/sentry/static/sentry/app/views/events/eventsChart.jsx +++ b/src/sentry/static/sentry/app/views/events/eventsChart.jsx @@ -238,39 +238,37 @@ class EventsChart extends React.Component { includePrevious={includePrevious} yAxis={yAxis} > - {({loading, reloading, errored, timeseriesData, previousTimeseriesData}) => { - return ( - - {({releaseSeries}) => { - if (errored) { - return ( - - - - ); - } - + {({loading, reloading, errored, timeseriesData, previousTimeseriesData}) => ( + + {({releaseSeries}) => { + if (errored) { return ( - - - - - - + + + ); - }} - - ); - }} + } + + return ( + + + + + + + ); + }} + + )} )} diff --git a/src/sentry/static/sentry/app/views/events/searchBar.jsx b/src/sentry/static/sentry/app/views/events/searchBar.jsx index 9a3136ee84c490..856b840626869b 100644 --- a/src/sentry/static/sentry/app/views/events/searchBar.jsx +++ b/src/sentry/static/sentry/app/views/events/searchBar.jsx @@ -77,9 +77,7 @@ class SearchBar extends React.PureComponent { /** * Prepare query string (e.g. strip special characters like negation operator) */ - prepareQuery = query => { - return query.replace(SEARCH_SPECIAL_CHARS_REGEXP, ''); - }; + prepareQuery = query => query.replace(SEARCH_SPECIAL_CHARS_REGEXP, ''); render() { return ( diff --git a/src/sentry/static/sentry/app/views/eventsV2/data.tsx b/src/sentry/static/sentry/app/views/eventsV2/data.tsx index 6d7cfe76976a01..16203a4407ee5d 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/data.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/data.tsx @@ -279,29 +279,24 @@ export const SPECIAL_FIELDS: SpecialFields = { }, last_seen: { sortField: 'last_seen', - renderFunc: data => { - return ( - - {data.last_seen - ? getDynamicText({ - value: , - fixed: 'time', - }) - : emptyValue} - - ); - }, + renderFunc: data => ( + + {data.last_seen + ? getDynamicText({ + value: , + fixed: 'time', + }) + : emptyValue} + + ), }, release: { sortField: 'release', - renderFunc: data => { - return ( - data.release && ( - - - - ) - ); - }, + renderFunc: data => + data.release && ( + + + + ), }, }; diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/index.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/index.tsx index 8021f883829932..795222fb107180 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/index.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/index.tsx @@ -44,11 +44,10 @@ class EventDetails extends React.Component { return EventView.fromLocation(location); }; - getDocumentTitle = (name: string | undefined): Array => { - return typeof name === 'string' && String(name).trim().length > 0 + getDocumentTitle = (name: string | undefined): Array => + typeof name === 'string' && String(name).trim().length > 0 ? [String(name).trim(), t('Discover')] : [t('Discover')]; - }; render() { const {organization, location, params} = this.props; diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/lineGraph.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/lineGraph.tsx index f3d8eb849fa442..13a9baa187fe49 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/lineGraph.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/lineGraph.tsx @@ -51,9 +51,7 @@ const getCurrentEventMarker = (currentEvent: Event) => { }, }, tooltip: { - formatter: () => { - return `
    ${getFormattedDate(eventTime, 'MMM D, YYYY LT')}
    `; - }, + formatter: () => `
    ${getFormattedDate(eventTime, 'MMM D, YYYY LT')}
    `, }, label: { show: false, @@ -198,9 +196,7 @@ const LineGraph = (props: LineGraphProps) => { }; const tooltip = { - formatAxisLabel: value => { - return getFormattedDate(value, 'lll', {local: !isUtc}); - }, + formatAxisLabel: value => getFormattedDate(value, 'lll', {local: !isUtc}), }; const queryString = eventView.getQuery(location.query.query); diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/transaction/opsBreakdown.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/transaction/opsBreakdown.tsx index ab533d7b73c78d..806ce1fa67c62a 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/transaction/opsBreakdown.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/transaction/opsBreakdown.tsx @@ -117,13 +117,11 @@ class OpsBreakdown extends React.Component { {} ); - const ops = Object.keys(aggregateByOp).map(opName => { - return { - name: opName, - percentage: aggregateByOp[opName].totalDuration / cumulativeDuration, - totalDuration: aggregateByOp[opName].totalDuration, - }; - }); + const ops = Object.keys(aggregateByOp).map(opName => ({ + name: opName, + percentage: aggregateByOp[opName].totalDuration / cumulativeDuration, + totalDuration: aggregateByOp[opName].totalDuration, + })); ops.sort((firstOp, secondOp) => { // sort in descending order based on total duration diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventView.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventView.tsx index 1816f211fe30da..77abc1909e2dda 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventView.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventView.tsx @@ -43,12 +43,10 @@ export type Sort = { field: string; }; -const reverseSort = (sort: Sort): Sort => { - return { - kind: sort.kind === 'desc' ? 'asc' : 'desc', - field: sort.field, - }; -}; +const reverseSort = (sort: Sort): Sort => ({ + kind: sort.kind === 'desc' ? 'asc' : 'desc', + field: sort.field, +}); export type Field = { field: string; @@ -205,9 +203,8 @@ const encodeSort = (sort: Sort): string => { } }; -const encodeSorts = (sorts: Readonly>): Array => { - return sorts.map(encodeSort); -}; +const encodeSorts = (sorts: Readonly>): Array => + sorts.map(encodeSort); const collectQueryStringByKey = (query: Query, key: string): Array => { const needle = query[key]; @@ -298,16 +295,10 @@ class EventView { // only include sort keys that are included in the fields const sortKeys = fields - .map(field => { - return getSortKeyFromField(field, undefined); - }) - .filter((sortKey): sortKey is string => { - return !!sortKey; - }); - - const sort = sorts.find(currentSort => { - return sortKeys.includes(currentSort.field); - }); + .map(field => getSortKeyFromField(field, undefined)) + .filter((sortKey): sortKey is string => !!sortKey); + + const sort = sorts.find(currentSort => sortKeys.includes(currentSort.field)); sorts = sort ? [sort] : []; @@ -637,9 +628,9 @@ class EventView { // if the updated column is one of the sorted columns, we may need to remove // it from the list of sorts - const needleSortIndex = this.sorts.findIndex(sort => { - return isSortEqualToField(sort, columnToBeUpdated, tableMeta); - }); + const needleSortIndex = this.sorts.findIndex(sort => + isSortEqualToField(sort, columnToBeUpdated, tableMeta) + ); if (needleSortIndex >= 0) { const needleSort = this.sorts[needleSortIndex]; @@ -684,9 +675,9 @@ class EventView { newEventView.sorts = [sort]; } else { - const sortableFieldIndex = newEventView.fields.findIndex(currentField => { - return isFieldSortable(currentField, tableMeta); - }); + const sortableFieldIndex = newEventView.fields.findIndex(currentField => + isFieldSortable(currentField, tableMeta) + ); if (sortableFieldIndex >= 0) { const fieldToBeSorted = newEventView.fields[sortableFieldIndex]; const sort = fieldToSort(fieldToBeSorted, tableMeta)!; @@ -724,9 +715,9 @@ class EventView { // if the deleted column is one of the sorted columns, we need to remove // it from the list of sorts const columnToBeDeleted = this.fields[columnIndex]; - const needleSortIndex = this.sorts.findIndex(sort => { - return isSortEqualToField(sort, columnToBeDeleted, tableMeta); - }); + const needleSortIndex = this.sorts.findIndex(sort => + isSortEqualToField(sort, columnToBeDeleted, tableMeta) + ); if (needleSortIndex >= 0) { const needleSort = this.sorts[needleSortIndex]; @@ -748,9 +739,9 @@ class EventView { if (newEventView.sorts.length <= 0 && newEventView.fields.length > 0) { // establish a default sort by finding the first sortable field - const sortableFieldIndex = newEventView.fields.findIndex(field => { - return isFieldSortable(field, tableMeta); - }); + const sortableFieldIndex = newEventView.fields.findIndex(field => + isFieldSortable(field, tableMeta) + ); if (sortableFieldIndex >= 0) { const fieldToBeSorted = newEventView.fields[sortableFieldIndex]; @@ -780,12 +771,13 @@ class EventView { } getSorts(): TableColumnSort[] { - return this.sorts.map(sort => { - return { - key: sort.field, - order: sort.kind, - } as TableColumnSort; - }); + return this.sorts.map( + sort => + ({ + key: sort.field, + order: sort.kind, + } as TableColumnSort) + ); } // returns query input for the search @@ -878,9 +870,7 @@ class EventView { } isFieldSorted(field: Field, tableMeta: MetaType): Sort | undefined { - const needle = this.sorts.find(sort => { - return isSortEqualToField(sort, field, tableMeta); - }); + const needle = this.sorts.find(sort => isSortEqualToField(sort, field, tableMeta)); return needle; } @@ -891,9 +881,9 @@ class EventView { return this; } - const needleIndex = this.sorts.findIndex(sort => { - return isSortEqualToField(sort, field, tableMeta); - }); + const needleIndex = this.sorts.findIndex(sort => + isSortEqualToField(sort, field, tableMeta) + ); if (needleIndex >= 0) { const newEventView = this.clone(); @@ -927,9 +917,7 @@ class EventView { .filter( (field: Field) => ['last_seen', 'latest_event'].includes(field.field) === false ) - .map((field: Field) => { - return {label: field.field, value: field.field}; - }) + .map((field: Field) => ({label: field.field, value: field.field})) .concat(CHART_AXIS_OPTIONS), 'value' ); @@ -947,9 +935,9 @@ class EventView { } // ensure current selected yAxis is one of the items in yAxisOptions - const result = yAxisOptions.findIndex((option: SelectValue) => { - return option.value === yAxis; - }); + const result = yAxisOptions.findIndex( + (option: SelectValue) => option.value === yAxis + ); if (result >= 0) { return yAxis; diff --git a/src/sentry/static/sentry/app/views/eventsV2/miniGraph.tsx b/src/sentry/static/sentry/app/views/eventsV2/miniGraph.tsx index a4936a7c773676..601a25bc2d81da 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/miniGraph.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/miniGraph.tsx @@ -101,18 +101,16 @@ class MiniGraph extends React.Component { ); } - const data = (timeseriesData || []).map(series => { - return { - ...series, - areaStyle: { - opacity: 0.4, - }, - lineStyle: { - opacity: 0, - }, - smooth: true, - }; - }); + const data = (timeseriesData || []).map(series => ({ + ...series, + areaStyle: { + opacity: 0.4, + }, + lineStyle: { + opacity: 0, + }, + smooth: true, + })); return ( { } } -const StyledGraphContainer = styled(props => { - return ; -})` +const StyledGraphContainer = styled(props => ( + +))` height: 100px; display: flex; diff --git a/src/sentry/static/sentry/app/views/eventsV2/queryList.tsx b/src/sentry/static/sentry/app/views/eventsV2/queryList.tsx index d9dbbe1349b784..7c94e90af51bc6 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/queryList.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/queryList.tsx @@ -121,15 +121,13 @@ class QueryList extends React.Component { title={eventView.name} subtitle={eventView.statsPeriod ? recentTimeline : customTimeline} queryDetail={eventView.query} - renderGraph={() => { - return ( - - ); - }} + renderGraph={() => ( + + )} onEventClick={() => { trackAnalyticsEvent({ eventKey: 'discover_v2.prebuilt_query_click', @@ -178,33 +176,29 @@ class QueryList extends React.Component { query_name: eventView.name, }); }} - renderGraph={() => { - return ( - - ); - }} - renderContextMenu={() => { - return ( - - - {t('Delete Query')} - - - {t('Duplicate Query')} - - - ); - }} + renderGraph={() => ( + + )} + renderContextMenu={() => ( + + + {t('Delete Query')} + + + {t('Duplicate Query')} + + + )} /> ); }); diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/index.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/index.tsx index 1d032424a42057..a0443dfe5d827a 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/index.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/index.tsx @@ -95,15 +95,13 @@ class Table extends React.PureComponent { return; } - this.setState(prevState => { - return { - isLoading: false, - tableFetchID: undefined, - error: null, - pageLinks: jqXHR ? jqXHR.getResponseHeader('Link') : prevState.pageLinks, - tableData: data, - }; - }); + this.setState(prevState => ({ + isLoading: false, + tableFetchID: undefined, + error: null, + pageLinks: jqXHR ? jqXHR.getResponseHeader('Link') : prevState.pageLinks, + tableData: data, + })); }) .catch(err => { this.setState({ diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/tableModalEditColumn.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/tableModalEditColumn.tsx index e11c0bc806445b..316589ca324eaa 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/tableModalEditColumn.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/tableModalEditColumn.tsx @@ -36,22 +36,20 @@ export function renderTableModalEditColumnFactory( column?: TableColumn, onSuccessFromChild?: () => void, onErrorFromChild?: (error?: Error) => void - ) => { - return ( - - ); - }, + ) => ( + + ), renderModalFooter: () => , }; } diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/tableView.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/tableView.tsx index af34be177e3857..17ea3eb947747c 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/tableView.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/tableView.tsx @@ -423,42 +423,40 @@ class TableView extends React.Component { startColumnDrag, draggingColumnIndex, destinationColumnIndex, - }) => { - return ( - downloadAsCsv(tableData, columnOrder, title), - }} - /> - ); - }} + }) => ( + downloadAsCsv(tableData, columnOrder, title), + }} + /> + )} ); } diff --git a/src/sentry/static/sentry/app/views/eventsV2/utils.tsx b/src/sentry/static/sentry/app/views/eventsV2/utils.tsx index 0d55da23c124c0..09f2908d389878 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/utils.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/utils.tsx @@ -317,8 +317,8 @@ export function downloadAsCsv(tableData, columnOrder, filename) { const csvContent = Papa.unparse({ fields: headings, - data: data.map(row => { - return headings.map(col => { + data: data.map(row => + headings.map(col => { // alias for project doesn't match the table data name if (col === 'project') { col = 'project.name'; @@ -326,8 +326,8 @@ export function downloadAsCsv(tableData, columnOrder, filename) { col = getAggregateAlias(col); } return disableMacros(row[col]); - }); - }), + }) + ), }); // Need to also manually replace # since encodeURI skips them diff --git a/src/sentry/static/sentry/app/views/issueList/actions.jsx b/src/sentry/static/sentry/app/views/issueList/actions.jsx index 8fe320ad13af70..131550c0b2ccb7 100644 --- a/src/sentry/static/sentry/app/views/issueList/actions.jsx +++ b/src/sentry/static/sentry/app/views/issueList/actions.jsx @@ -48,8 +48,8 @@ const getBulkConfirmMessage = (action, queryCount) => { ); }; -const getConfirm = (numIssues, allInQuerySelected, query, queryCount) => { - return function(action, canBeUndone, append = '') { +const getConfirm = (numIssues, allInQuerySelected, query, queryCount) => + function(action, canBeUndone, append = '') { const question = allInQuerySelected ? getBulkConfirmMessage(`${action}${append}`, queryCount) : tn( @@ -84,10 +84,9 @@ const getConfirm = (numIssues, allInQuerySelected, query, queryCount) => { ); }; -}; -const getLabel = (numIssues, allInQuerySelected) => { - return function(action, append = '') { +const getLabel = (numIssues, allInQuerySelected) => + function(action, append = '') { const capitalized = capitalize(action); const text = allInQuerySelected ? t(`Bulk ${action} issues`) @@ -99,7 +98,6 @@ const getLabel = (numIssues, allInQuerySelected) => { return text + append; }; -}; const ExtraDescription = ({all, query, queryCount}) => { if (!all) { diff --git a/src/sentry/static/sentry/app/views/issueList/sidebar.jsx b/src/sentry/static/sentry/app/views/issueList/sidebar.jsx index 5d205f46fef277..73944760c443c2 100644 --- a/src/sentry/static/sentry/app/views/issueList/sidebar.jsx +++ b/src/sentry/static/sentry/app/views/issueList/sidebar.jsx @@ -141,18 +141,16 @@ const IssueListSidebar = createReactClass({
    - {map(tags, tag => { - return ( - - ); - })} + {map(tags, tag => ( + + ))} )} diff --git a/src/sentry/static/sentry/app/views/issueList/sortOptions.jsx b/src/sentry/static/sentry/app/views/issueList/sortOptions.jsx index 6c97860b761e45..58885a7d040b87 100644 --- a/src/sentry/static/sentry/app/views/issueList/sortOptions.jsx +++ b/src/sentry/static/sentry/app/views/issueList/sortOptions.jsx @@ -25,17 +25,15 @@ class IssueListSortOptions extends React.PureComponent { }); } - getMenuItem = key => { - return ( - - {this.getSortLabel(key)} - - ); - }; + getMenuItem = key => ( + + {this.getSortLabel(key)} + + ); onSelect = sort => { this.setState({sortKey: sort}); diff --git a/src/sentry/static/sentry/app/views/issueList/tagFilter.jsx b/src/sentry/static/sentry/app/views/issueList/tagFilter.jsx index 34f0e05ac2741d..868d448da2b5ea 100644 --- a/src/sentry/static/sentry/app/views/issueList/tagFilter.jsx +++ b/src/sentry/static/sentry/app/views/issueList/tagFilter.jsx @@ -15,12 +15,10 @@ class IssueListTagFilter extends React.Component { tagValueLoader: PropTypes.func.isRequired, }; - static tagValueToSelectFormat = ({value}) => { - return { - value, - label: value, - }; - }; + static tagValueToSelectFormat = ({value}) => ({ + value, + label: value, + }); static defaultProps = { tag: {}, diff --git a/src/sentry/static/sentry/app/views/monitors/monitorCheckIns.tsx b/src/sentry/static/sentry/app/views/monitors/monitorCheckIns.tsx index a4a1518a4c76c1..7e687147820278 100644 --- a/src/sentry/static/sentry/app/views/monitors/monitorCheckIns.tsx +++ b/src/sentry/static/sentry/app/views/monitors/monitorCheckIns.tsx @@ -45,21 +45,17 @@ export default class MonitorCheckIns extends AsyncComponent { renderBody() { return ( - {this.state.checkInList.map(checkIn => { - return ( - - - - - - - -
    - {checkIn.duration && } -
    -
    - ); - })} + {this.state.checkInList.map(checkIn => ( + + + + + + + +
    {checkIn.duration && }
    +
    + ))}
    ); } diff --git a/src/sentry/static/sentry/app/views/monitors/monitorForm.jsx b/src/sentry/static/sentry/app/views/monitors/monitorForm.jsx index 038e7ef7853c8d..f1db35c26d73b9 100644 --- a/src/sentry/static/sentry/app/views/monitors/monitorForm.jsx +++ b/src/sentry/static/sentry/app/views/monitors/monitorForm.jsx @@ -117,9 +117,7 @@ class MonitorForm extends Component { disabled={!hasAccess} choices={this.props.organization.projects .filter(p => p.isMember) - .map(p => { - return [p.slug, p.slug]; - })} + .map(p => [p.slug, p.slug])} required /> - {this.state.monitorList.map(monitor => { - return ( - - - - {monitor.name} - - {monitor.nextCheckIn ? ( - - ) : ( - t('n/a') - )} - - ); - })} + {this.state.monitorList.map(monitor => ( + + + + {monitor.name} + + {monitor.nextCheckIn ? ( + + ) : ( + t('n/a') + )} + + ))} {monitorListPageLinks && ( diff --git a/src/sentry/static/sentry/app/views/organizationActivity/activityFeed.jsx b/src/sentry/static/sentry/app/views/organizationActivity/activityFeed.jsx index 23d8298f65dbcd..75bb19ea35f25f 100644 --- a/src/sentry/static/sentry/app/views/organizationActivity/activityFeed.jsx +++ b/src/sentry/static/sentry/app/views/organizationActivity/activityFeed.jsx @@ -95,17 +95,15 @@ class ActivityFeed extends React.Component { } else if (this.state.itemList.length > 0) { body = (
    - {this.state.itemList.map(item => { - return ( - - - - ); - })} + {this.state.itemList.map(item => ( + + + + ))}
    ); } else { diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachments.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachments.tsx index 6a3949e53e5364..6b41e296ea5b3a 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachments.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachments.tsx @@ -47,11 +47,9 @@ class GroupEventAttachments extends AsyncComponent { } handleDelete = (deletedAttachmentId: string) => { - this.setState(prevState => { - return { - deletedAttachments: [...prevState.deletedAttachments, deletedAttachmentId], - }; - }); + this.setState(prevState => ({ + deletedAttachments: [...prevState.deletedAttachments, deletedAttachmentId], + })); }; renderNoQueryResults() { diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTable.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTable.tsx index f1230238a812a5..3d3e7b64d40eab 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTable.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTable.tsx @@ -27,25 +27,23 @@ const GroupEventAttachmentsTable = ({
    - - {row.name} - -
    - {row.slug} -
    + + {row.name} + +
    + {row.slug} +
    Organization - - {row.name} - -
    - {row.organization.name} -
    {row.status}{prettyDate(row.dateCreated)} + + {row.name} + +
    + {row.organization.name} +
    {row.status}{prettyDate(row.dateCreated)} - - {row.username} - -
    - {row.email !== row.username && {row.email}} -
    {prettyDate(row.dateJoined)}{prettyDate(row.lastLogin)} + + {row.username} + +
    + {row.email !== row.username && {row.email}} +
    {prettyDate(row.dateJoined)}{prettyDate(row.lastLogin)}
    - {tableRowNames.map(name => { - return ; - })} + {tableRowNames.map(name => ( + + ))} - {attachments.map(attachment => { - return ( - attachment.id === id)} - /> - ); - })} + {attachments.map(attachment => ( + attachment.id === id)} + /> + ))}
    {name}{name}
    ); diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTableRow.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTableRow.tsx index ec82dfb71329cb..75ef452893a39b 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTableRow.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTableRow.tsx @@ -26,50 +26,48 @@ const GroupEventAttachmentsTableRow = ({ isDeleted, orgId, groupId, -}: Props) => { - return ( - - -
    - {attachment.name} -
    - - ·{' '} - - {attachment.event_id} - - -
    - +}: Props) => ( + + +
    + {attachment.name} +
    + + ·{' '} + + {attachment.event_id} + + +
    + - {types[attachment.type] || t('Other')} + {types[attachment.type] || t('Other')} - - - + + + - - - {url => - !isDeleted && ( - - ) - } - - -
    - ); -}; + + + {url => + !isDeleted && ( + + ) + } + + +
    +); const TableRow = styled('tr')<{isDeleted: boolean}>` opacity: ${p => (p.isDeleted ? 0.3 : 1)}; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/index.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/index.tsx index 47829ae8156295..131eb9c74ef1cb 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/index.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/index.tsx @@ -13,16 +13,14 @@ type Props = RouteComponentProps<{orgId: string; groupId: string}, {}> & { group: Group; }; -const GroupEventAttachmentsContainer = ({organization, group}: Props) => { - return ( - } - > - - - ); -}; +const GroupEventAttachmentsContainer = ({organization, group}: Props) => ( + } + > + + +); export default withOrganization(GroupEventAttachmentsContainer); diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedList.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedList.jsx index 46e42e4b3634b3..8327ab9eebec81 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedList.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedList.jsx @@ -22,13 +22,11 @@ class MergedList extends React.Component { projectId: PropTypes.string.isRequired, }; - renderEmpty = () => { - return ( - -

    {t("There don't seem to be any hashes for this issue.")}

    -
    - ); - }; + renderEmpty = () => ( + +

    {t("There don't seem to be any hashes for this issue.")}

    +
    + ); render() { const {items, pageLinks, onToggleCollapse, onUnmerge, orgId, projectId} = this.props; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilar/similarList.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilar/similarList.jsx index 7432e4cd63116b..c889c4fa75d775 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilar/similarList.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilar/similarList.jsx @@ -41,15 +41,13 @@ class SimilarList extends React.Component { }; } - renderEmpty = () => { - return ( - - -

    {t('There are no similar issues.')}

    -
    -
    - ); - }; + renderEmpty = () => ( + + +

    {t('There are no similar issues.')}

    +
    +
    + ); handleShowAll = () => { this.setState({showAllItems: true}); diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.jsx index 3939a259c37781..cbec5a459bdb0f 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.jsx @@ -75,16 +75,14 @@ class GroupUserFeedback extends React.Component { return (
    - {reportList.map((item, idx) => { - return ( - - ); - })} + {reportList.map((item, idx) => ( + + ))}
    diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/SplitInstallationIdModal.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/SplitInstallationIdModal.tsx index 53ea6549f190ab..976c6d2c58cde0 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/SplitInstallationIdModal.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/SplitInstallationIdModal.tsx @@ -22,10 +22,9 @@ export default class SplitInstallationIdModal extends React.Component { closeModal: PropTypes.func.isRequired, }; - onCopy = async () => { + onCopy = async () => //This hack is needed because the normal copying methods with TextCopyInput do not work correctly - return await navigator.clipboard.writeText(this.props.installationId); - }; + await navigator.clipboard.writeText(this.props.installationId); handleContinue = () => { const delay = 2000; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx index b78a72b36024fe..417b11911bd849 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx @@ -341,14 +341,12 @@ class AbstractIntegrationDetailedView< {this.author} )} - {this.resourceLinks.map(({title, url}) => { - return ( - - {this.getIcon(title)} - {t(title)} - - ); - })} + {this.resourceLinks.map(({title, url}) => ( + + {this.getIcon(title)} + {t(title)} + + ))} diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/index.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/index.tsx index eca5eec284c639..d16e276dcbaebb 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/index.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/index.tsx @@ -208,9 +208,8 @@ class OrganizationIntegrations extends AsyncComponent< this.setState({appInstalls: [install, ...this.state.appInstalls]}); }; - getAppInstall = (app: SentryApp) => { - return this.state.appInstalls.find(i => i.app.slug === app.slug); - }; + getAppInstall = (app: SentryApp) => + this.state.appInstalls.find(i => i.app.slug === app.slug); //Returns 0 if uninstalled, 1 if pending, and 2 if installed getInstallValue(integration: AppOrProvider) { @@ -306,9 +305,9 @@ class OrganizationIntegrations extends AsyncComponent< // we dont want the app to render twice if its the org that created // the published app. - const orgOwned = orgOwnedApps.filter(app => { - return !published.find(p => p.slug === app.slug); - }); + const orgOwned = orgOwnedApps.filter( + app => !published.find(p => p.slug === app.slug) + ); /** * We should have three sections: diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationListDirectory.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationListDirectory.tsx index 2647c889bcdd97..c9df8929bd7905 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationListDirectory.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationListDirectory.tsx @@ -95,9 +95,9 @@ export class OrganizationIntegrations extends AsyncComponent< // we dont want the app to render twice if its the org that created // the published app. - const orgOwned = orgOwnedApps.filter(app => { - return !published.find(p => p.slug === app.slug); - }); + const orgOwned = orgOwnedApps.filter( + app => !published.find(p => p.slug === app.slug) + ); /** * We should have three sections: @@ -182,9 +182,8 @@ export class OrganizationIntegrations extends AsyncComponent< return this.state.config.providers; } - getAppInstall = (app: SentryApp) => { - return this.state.appInstalls.find(i => i.app.slug === app.slug); - }; + getAppInstall = (app: SentryApp) => + this.state.appInstalls.find(i => i.app.slug === app.slug); //Returns 0 if uninstalled, 1 if pending, and 2 if installed getInstallValue(integration: AppOrProviderOrPlugin) { diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRepos.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRepos.tsx index 0add8315aaaabe..99745b99427615 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRepos.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRepos.tsx @@ -153,17 +153,15 @@ export default class IntegrationRepos extends AsyncComponent { const repositoryOptions = (this.state.integrationRepos.repos || []).filter( repo => !repositories.has(repo.identifier) ); - const items = repositoryOptions.map(repo => { - return { - searchKey: repo.name, - value: repo.identifier, - label: ( - - {repo.name} - - ), - }; - }); + const items = repositoryOptions.map(repo => ({ + searchKey: repo.name, + value: repo.identifier, + label: ( + + {repo.name} + + ), + })); const menuHeader = {t('Repositories')}; const onChange = this.state.integrationRepos.searchable @@ -240,17 +238,15 @@ export default class IntegrationRepos extends AsyncComponent { } /> )} - {itemList.map(repo => { - return ( - - ); - })} + {itemList.map(repo => ( + + ))} {itemListPageLinks && ( diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRow.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRow.tsx index eda40e306ec520..6beebc6dcb9caa 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRow.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRow.tsx @@ -104,9 +104,9 @@ const StyledLink = styled(Link)` type PublishStatusProps = {status: SentryApp['status']; theme?: any}; -const PublishStatus = styled(({status, ...props}: PublishStatusProps) => { - return
    {t(`${status}`)}
    ; -})` +const PublishStatus = styled(({status, ...props}: PublishStatusProps) => ( +
    {t(`${status}`)}
    +))` color: ${(props: PublishStatusProps) => props.status === 'published' ? props.theme.success : props.theme.gray2}; font-weight: light; diff --git a/src/sentry/static/sentry/app/views/organizationStats/index.jsx b/src/sentry/static/sentry/app/views/organizationStats/index.jsx index ea7eac09727405..69efd927aa3aae 100644 --- a/src/sentry/static/sentry/app/views/organizationStats/index.jsx +++ b/src/sentry/static/sentry/app/views/organizationStats/index.jsx @@ -90,13 +90,11 @@ class OrganizationStatsContainer extends React.Component { projectMap[project.id] = project; }); - this.setState(prevState => { - return { - pageLinks: jqxhr.getResponseHeader('Link'), - projectMap, - projectsRequestsPending: prevState.projectsRequestsPending - 1, - }; - }); + this.setState(prevState => ({ + pageLinks: jqxhr.getResponseHeader('Link'), + projectMap, + projectsRequestsPending: prevState.projectsRequestsPending - 1, + })); }, error: () => { this.setState({ diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/deploys.jsx b/src/sentry/static/sentry/app/views/projectsDashboard/deploys.jsx index 210cc874553f47..e62fa4ef17b9fb 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/deploys.jsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/deploys.jsx @@ -21,11 +21,9 @@ export default class Deploys extends React.Component { render() { const {project, organization} = this.props; - const flattenedDeploys = Object.entries(project.latestDeploys || {}).map( - ([environment, value]) => { - return {environment, ...value}; - } - ); + const flattenedDeploys = Object.entries( + project.latestDeploys || {} + ).map(([environment, value]) => ({environment, ...value})); const deploys = (flattenedDeploys || []) .sort((a, b) => new Date(b.dateFinished) - new Date(a.dateFinished)) diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx b/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx index 846333bc07dee3..ee059f804ac780 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx @@ -135,13 +135,11 @@ class Dashboard extends React.Component { } } -const OrganizationDashboard = props => { - return ( - - - - ); -}; +const OrganizationDashboard = props => ( + + + +); const TeamLink = styled(Link)` display: flex; diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/newIssues.jsx b/src/sentry/static/sentry/app/views/projectsDashboard/newIssues.jsx index f1cca881218c58..9891dff674e1c8 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/newIssues.jsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/newIssues.jsx @@ -13,21 +13,17 @@ export default class NewIssues extends React.Component { issueListRef = React.createRef(); - getEndpoint = () => { - return `/organizations/${this.props.params.orgId}/issues/new/`; - }; + getEndpoint = () => `/organizations/${this.props.params.orgId}/issues/new/`; - renderEmpty = () => { - return ( - - - - {t('No new issues have been seen in the last week.')} - - - - ); - }; + renderEmpty = () => ( + + + + {t('No new issues have been seen in the last week.')} + + + + ); refresh = () => { this.issueListRef.current.remountComponent(); diff --git a/src/sentry/static/sentry/app/views/releases/detail/commitAuthorStats.jsx b/src/sentry/static/sentry/app/views/releases/detail/commitAuthorStats.jsx index 00a397ec272b4b..8efcec84e58018 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/commitAuthorStats.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/commitAuthorStats.jsx @@ -101,9 +101,7 @@ class CommitAuthorStats extends React.Component { const commitAuthorValues = Object.values(commitAuthors); // sort commitAuthors by highest commitCount to lowest commitCount - commitAuthorValues.sort((a, b) => { - return b.commitCount - a.commitCount; - }); + commitAuthorValues.sort((a, b) => b.commitCount - a.commitCount); return (
    diff --git a/src/sentry/static/sentry/app/views/releases/detail/groupListHeader.jsx b/src/sentry/static/sentry/app/views/releases/detail/groupListHeader.jsx index d508bb18237ed4..3c4f8bd6dbf1e7 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/groupListHeader.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/groupListHeader.jsx @@ -4,31 +4,29 @@ import {Flex, Box} from 'reflexbox'; import {t} from 'app/locale'; import {PanelHeader} from 'app/components/panels'; -const GroupListHeader = () => { - return ( - - - {t('Issue')} - - - {t('Last 24 hours')} - - - {t('events')} - - - {t('users')} - - - {t('Assignee')} - - - ); -}; +const GroupListHeader = () => ( + + + {t('Issue')} + + + {t('Last 24 hours')} + + + {t('events')} + + + {t('users')} + + + {t('Assignee')} + + +); export default GroupListHeader; diff --git a/src/sentry/static/sentry/app/views/releases/detail/index.jsx b/src/sentry/static/sentry/app/views/releases/detail/index.jsx index a568e755fc58ff..b181b94ec7afc4 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/index.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/index.jsx @@ -18,14 +18,12 @@ import withProjects from 'app/utils/withProjects'; import ReleaseHeader from './releaseHeader'; -const ReleaseDetailsContainer = props => { - return ( - - - - - ); -}; +const ReleaseDetailsContainer = props => ( + + + + +); ReleaseDetailsContainer.propTypes = { organization: SentryTypes.Organization, }; @@ -123,9 +121,7 @@ class OrganizationReleaseDetails extends AsyncView { )} :{' '} {selected_projects - .map(p => { - return all_projects.find(pp => parseInt(pp.id, 10) === p).name; - }) + .map(p => all_projects.find(pp => parseInt(pp.id, 10) === p).name) .join(', ')} diff --git a/src/sentry/static/sentry/app/views/releases/detail/releaseArtifacts.jsx b/src/sentry/static/sentry/app/views/releases/detail/releaseArtifacts.jsx index 79be8f59ec605b..ce0e457d4d2a85 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/releaseArtifacts.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/releaseArtifacts.jsx @@ -84,9 +84,7 @@ class ReleaseArtifacts extends React.Component { this.props.api.request(this.getFilesEndpoint() + `${id}/`, { method: 'DELETE', success: () => { - const fileList = this.state.fileList.filter(file => { - return file.id !== id; - }); + const fileList = this.state.fileList.filter(file => file.id !== id); this.setState({ fileList, @@ -129,59 +127,57 @@ class ReleaseArtifacts extends React.Component { {t('Size')} - {this.state.fileList.map(file => { - return ( - - - {file.name || '(empty)'} - - - {file.dist || {t('None')}} - - - - - {access.has('project:write') ? ( - + {this.state.fileList.map(file => ( + + + {file.name || '(empty)'} + + + {file.dist || {t('None')}} + + + + + {access.has('project:write') ? ( + + + + ) : ( + +
    - - ) : ( - -
    - -
    -
    - )} -
    - - - -
    - +
    +
    + )} +
    + + + +
    -
    - ); - })} + + + ))}
    diff --git a/src/sentry/static/sentry/app/views/releases/detail/releaseCommits.jsx b/src/sentry/static/sentry/app/views/releases/detail/releaseCommits.jsx index 7d63a196cd1eb7..dd3499dce7e3f2 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/releaseCommits.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/releaseCommits.jsx @@ -96,9 +96,9 @@ class ReleaseCommits extends React.Component { {repo} - {activeCommits.map(commit => { - return ; - })} + {activeCommits.map(commit => ( + + ))} ); @@ -136,20 +136,18 @@ class ReleaseCommits extends React.Component { > {t('All Repositories')} - {Object.keys(commitsByRepository).map(repository => { - return ( - { - this.setActiveRepo(repository); - }} - isActive={this.state.activeRepo === repository} - > - {repository} - - ); - })} + {Object.keys(commitsByRepository).map(repository => ( + { + this.setActiveRepo(repository); + }} + isActive={this.state.activeRepo === repository} + > + {repository} + + ))}
    @@ -157,9 +155,9 @@ class ReleaseCommits extends React.Component { {activeRepo ? this.renderCommitsForRepo(activeRepo) - : Object.keys(commitsByRepository).map(repository => { - return this.renderCommitsForRepo(repository); - })} + : Object.keys(commitsByRepository).map(repository => + this.renderCommitsForRepo(repository) + )} ); } diff --git a/src/sentry/static/sentry/app/views/releases/detail/releaseOverview.jsx b/src/sentry/static/sentry/app/views/releases/detail/releaseOverview.jsx index 76d0dfdfcac283..bf1f3c4dd55ebe 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/releaseOverview.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/releaseOverview.jsx @@ -54,15 +54,13 @@ export default class ReleaseOverview extends AsyncComponent { {hasRepos && (
    - {Object.keys(filesByRepository).map((repository, i) => { - return ( - - ); - })} + {Object.keys(filesByRepository).map((repository, i) => ( + + ))}
    )} @@ -77,16 +75,14 @@ export default class ReleaseOverview extends AsyncComponent {
      {release.projects.length === 0 ? this.renderEmpty() - : release.projects.map(project => { - return ( - - ); - })} + : release.projects.map(project => ( + + ))}
    ) : ( diff --git a/src/sentry/static/sentry/app/views/releases/list/progressBar.jsx b/src/sentry/static/sentry/app/views/releases/list/progressBar.jsx index 867e425d4eb3b5..602d69bb4df174 100644 --- a/src/sentry/static/sentry/app/views/releases/list/progressBar.jsx +++ b/src/sentry/static/sentry/app/views/releases/list/progressBar.jsx @@ -2,13 +2,11 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from '@emotion/styled'; -const ProgressBar = props => { - return ( - - - - ); -}; +const ProgressBar = props => ( + + + +); ProgressBar.propTypes = { width: PropTypes.number, }; diff --git a/src/sentry/static/sentry/app/views/releases/list/releaseLanding.tsx b/src/sentry/static/sentry/app/views/releases/list/releaseLanding.tsx index 4ea72dbaf69614..6395e77e6401b5 100644 --- a/src/sentry/static/sentry/app/views/releases/list/releaseLanding.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/releaseLanding.tsx @@ -114,9 +114,7 @@ const ReleaseLanding = withOrganization( }); }; - getCard = stepId => { - return cards[stepId]; - }; + getCard = stepId => cards[stepId]; render() { const {stepId} = this.state; diff --git a/src/sentry/static/sentry/app/views/releases/list/releaseList.jsx b/src/sentry/static/sentry/app/views/releases/list/releaseList.jsx index 93651b4cb3a37a..46f89f978ba85a 100644 --- a/src/sentry/static/sentry/app/views/releases/list/releaseList.jsx +++ b/src/sentry/static/sentry/app/views/releases/list/releaseList.jsx @@ -35,47 +35,45 @@ const ReleaseList = props => {
    {({projects}) => - releaseList.map(release => { - return ( - - - - - - - - - - - - - - release.projects.map(p => p.slug).includes(project.slug) - )} - orgId={orgId} + releaseList.map(release => ( + + + + + - - - - - - {release.lastEvent ? ( - - ) : ( - — + + + + + + + + + release.projects.map(p => p.slug).includes(project.slug) )} - - - - ); - }) + orgId={orgId} + version={release.version} + /> + + + + + + {release.lastEvent ? ( + + ) : ( + — + )} + + + + )) }
    diff --git a/src/sentry/static/sentry/app/views/releases/list/releaseListHeader.jsx b/src/sentry/static/sentry/app/views/releases/list/releaseListHeader.jsx index 1525c0df5a1509..41ae637433d97f 100644 --- a/src/sentry/static/sentry/app/views/releases/list/releaseListHeader.jsx +++ b/src/sentry/static/sentry/app/views/releases/list/releaseListHeader.jsx @@ -12,17 +12,15 @@ import { StatsColumn, } from './layout'; -const ReleaseListHeader = () => { - return ( - - - {t('Version')} - {t('Project')} - - {t('New Issues')} - {t('Last Event')} - - - ); -}; +const ReleaseListHeader = () => ( + + + {t('Version')} + {t('Project')} + + {t('New Issues')} + {t('Last Event')} + + +); export default ReleaseListHeader; diff --git a/src/sentry/static/sentry/app/views/releasesV2/list/index.tsx b/src/sentry/static/sentry/app/views/releasesV2/list/index.tsx index bf91ccc979de53..3e9063d0605cf3 100644 --- a/src/sentry/static/sentry/app/views/releasesV2/list/index.tsx +++ b/src/sentry/static/sentry/app/views/releasesV2/list/index.tsx @@ -94,8 +94,8 @@ class ReleasesList extends AsyncView { } transformToProjectRelease(releases: Release[]): ProjectRelease[] { - return releases.flatMap(release => { - return release.projects.map(project => { + return releases.flatMap(release => + release.projects.map(project => { const { version, dateCreated, @@ -118,8 +118,8 @@ class ReleasesList extends AsyncView { projectSlug: slug, // TODO(releasesv2): make api send also project platform }; - }); - }); + }) + ); } renderInnerBody() { diff --git a/src/sentry/static/sentry/app/views/releasesV2/list/releaseCard.tsx b/src/sentry/static/sentry/app/views/releasesV2/list/releaseCard.tsx index f313d8224be2fe..0ea02b12b1728a 100644 --- a/src/sentry/static/sentry/app/views/releasesV2/list/releaseCard.tsx +++ b/src/sentry/static/sentry/app/views/releasesV2/list/releaseCard.tsx @@ -20,77 +20,75 @@ type Props = { project?: Project | AvatarProject; }; -const ReleaseCard = ({release, project}: Props) => { +const ReleaseCard = ({release, project}: Props) => ( // TODO(releasesv2): probably makes sense at this point to split the header and data to different files (move styles to share layout file) - return ( - - - - - - {t('Version')} - - - {t('Project name')} - - - {release.commitCount > 0 && ( - - {[ - tn('%s commit', '%s commits', release.commitCount || 0), - t('by'), - tn('%s author', '%s authors', release.authors?.length || 0), - ].join(' ')} - - )} - - - {t('Created')} - - - {t('New issues')} - - - - - - - - - - - - - - - - - - - - {release.dateReleased || release.dateCreated ? ( - - ) : ( - - - )} - - - - - - - - - - {release.healthData && } - - ); -}; + + + + + + {t('Version')} + + + {t('Project name')} + + + {release.commitCount > 0 && ( + + {[ + tn('%s commit', '%s commits', release.commitCount || 0), + t('by'), + tn('%s author', '%s authors', release.authors?.length || 0), + ].join(' ')} + + )} + + + {t('Created')} + + + {t('New issues')} + + + + + + + + + + + + + + + + + + + + {release.dateReleased || release.dateCreated ? ( + + ) : ( + - + )} + + + + + + + + + + {release.healthData && } + +); const StyledPanelItem = styled(PanelItem)` flex-direction: column; diff --git a/src/sentry/static/sentry/app/views/releasesV2/list/usersChart.tsx b/src/sentry/static/sentry/app/views/releasesV2/list/usersChart.tsx index 8378053b882ef7..df6e3f3ae1e394 100644 --- a/src/sentry/static/sentry/app/views/releasesV2/list/usersChart.tsx +++ b/src/sentry/static/sentry/app/views/releasesV2/list/usersChart.tsx @@ -38,9 +38,7 @@ class UsersChart extends React.Component { return null; } - const chartData = stats.map(point => { - return {x: point[0], y: point[1]}; - }); + const chartData = stats.map(point => ({x: point[0], y: point[1]})); return ( diff --git a/src/sentry/static/sentry/app/views/routeNotFound.tsx b/src/sentry/static/sentry/app/views/routeNotFound.tsx index 0e9c0dedf9f55c..4ee5ac0bcf57b9 100644 --- a/src/sentry/static/sentry/app/views/routeNotFound.tsx +++ b/src/sentry/static/sentry/app/views/routeNotFound.tsx @@ -14,9 +14,7 @@ class RouteNotFound extends React.Component { }); } - getTitle = () => { - return 'Page Not Found'; - }; + getTitle = () => 'Page Not Found'; render() { // TODO(dcramer): show additional resource links diff --git a/src/sentry/static/sentry/app/views/settings/account/accountAuthorizations.jsx b/src/sentry/static/sentry/app/views/settings/account/accountAuthorizations.jsx index 84ae2a037f0391..a36210f87ea8cb 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountAuthorizations.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountAuthorizations.jsx @@ -103,15 +103,13 @@ class AccountAuthorizations extends AsyncView { {!isEmpty && (
    - {data.map(authorization => { - return ( - - ); - })} + {data.map(authorization => ( + + ))}
    )} diff --git a/src/sentry/static/sentry/app/views/settings/account/accountClose.jsx b/src/sentry/static/sentry/app/views/settings/account/accountClose.jsx index 48d00f6c3b32af..ec437a0e2d8a3b 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountClose.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountClose.jsx @@ -61,11 +61,10 @@ class AccountClose extends AsyncView { } // Returns an array of single owners - getSingleOwners = () => { - return this.state.organizations + getSingleOwners = () => + this.state.organizations .filter(({singleOwner}) => singleOwner) .map(({organization}) => organization.slug); - }; handleChange = ({slug}, isSingle, event) => { const checked = event.target.checked; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx b/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx index d36ba7dd745dac..a1858458ed695a 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx @@ -162,17 +162,15 @@ class AccountEmails extends AsyncView { )} {secondary && - secondary.map(emailObj => { - return ( - - ); - })} + secondary.map(emailObj => ( + + ))} diff --git a/src/sentry/static/sentry/app/views/settings/account/accountNotificationFineTuning.jsx b/src/sentry/static/sentry/app/views/settings/account/accountNotificationFineTuning.jsx index 083859f542d177..4cda8d4a730160 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountNotificationFineTuning.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountNotificationFineTuning.jsx @@ -122,45 +122,37 @@ class AccountNotificationsByProject extends React.Component { const {title, description, ...fieldConfig} = field; // Display as select box in this view regardless of the type specified in the config - return Object.values(projectsByOrg).map(org => { - return { - name: org.organization.name, - projects: org.projects.map(project => { - return { - ...fieldConfig, - // `name` key refers to field name - // we use project.id because slugs are not unique across orgs - name: project.id, - label: project.slug, - }; - }), - }; - }); + return Object.values(projectsByOrg).map(org => ({ + name: org.organization.name, + projects: org.projects.map(project => ({ + ...fieldConfig, + // `name` key refers to field name + // we use project.id because slugs are not unique across orgs + name: project.id, + label: project.slug, + })), + })); } render() { const data = this.getFieldData(); - return data.map(({name, projects: projectFields}) => { - return ( -
    - {name} - {projectFields.map(field => { - return ( - - - - ); - })} -
    - ); - }); + return data.map(({name, projects: projectFields}) => ( +
    + {name} + {projectFields.map(field => ( + + + + ))} +
    + )); } } @@ -176,15 +168,13 @@ class AccountNotificationsByOrganization extends React.Component { const {title, description, ...fieldConfig} = field; // Display as select box in this view regardless of the type specified in the config - return organizations.map(org => { - return { - ...fieldConfig, - // `name` key refers to field name - // we use org.id to remain consistent project.id use (which is required because slugs are not unique across orgs) - name: org.id, - label: org.slug, - }; - }); + return organizations.map(org => ({ + ...fieldConfig, + // `name` key refers to field name + // we use org.id to remain consistent project.id use (which is required because slugs are not unique across orgs) + name: org.id, + label: org.slug, + })); } render() { @@ -192,19 +182,17 @@ class AccountNotificationsByOrganization extends React.Component { return ( - {orgFields.map(field => { - return ( - - - - ); - })} + {orgFields.map(field => ( + + + + ))} ); } diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecuritySessionHistory.jsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecuritySessionHistory.jsx index 916d94996ff79e..d3b73d5a062b34 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecuritySessionHistory.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecuritySessionHistory.jsx @@ -97,9 +97,9 @@ class AccountSecuritySessionHistory extends AsyncView { - {ipList.map(ipObj => { - return ; - })} + {ipList.map(ipObj => ( + + ))} diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSettingsNavigation.tsx b/src/sentry/static/sentry/app/views/settings/account/accountSettingsNavigation.tsx index 36576daf7d7f3e..13aeac9aac3e8f 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSettingsNavigation.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSettingsNavigation.tsx @@ -3,8 +3,8 @@ import React from 'react'; import SettingsNavigation from 'app/views/settings/components/settingsNavigation'; import navigationConfiguration from 'app/views/settings/account/navigationConfiguration'; -const AccountSettingsNavigation = () => { - return ; -}; +const AccountSettingsNavigation = () => ( + +); export default AccountSettingsNavigation; diff --git a/src/sentry/static/sentry/app/views/settings/account/apiApplications/details.tsx b/src/sentry/static/sentry/app/views/settings/account/apiApplications/details.tsx index 9118c728f8d988..8ea711b9b32769 100644 --- a/src/sentry/static/sentry/app/views/settings/account/apiApplications/details.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/apiApplications/details.tsx @@ -51,15 +51,13 @@ class ApiApplicationsDetails extends AsyncView { - {({value}) => { - return ( -
    - - {getDynamicText({value, fixed: 'PERCY_CLIENT_ID'})} - -
    - ); - }} + {({value}) => ( +
    + + {getDynamicText({value, fixed: 'PERCY_CLIENT_ID'})} + +
    + )}
    { help={t(`Your secret is only available briefly after application creation. Make sure to save this value!`)} > - {({value}) => { - return value ? ( + {({value}) => + value ? ( {getDynamicText({value, fixed: 'PERCY_CLIENT_SECRET'})} ) : ( hidden - ); - }} + ) + } diff --git a/src/sentry/static/sentry/app/views/settings/account/apiApplications/index.tsx b/src/sentry/static/sentry/app/views/settings/account/apiApplications/index.tsx index db25817a307129..97fd9ce9d66d47 100644 --- a/src/sentry/static/sentry/app/views/settings/account/apiApplications/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/apiApplications/index.tsx @@ -75,16 +75,14 @@ class ApiApplications extends AsyncView { {!isEmpty ? ( - this.state.appList.map(app => { - return ( - - ); - }) + this.state.appList.map(app => ( + + )) ) : ( {t("You haven't created any applications yet.")} diff --git a/src/sentry/static/sentry/app/views/settings/account/apiTokens.jsx b/src/sentry/static/sentry/app/views/settings/account/apiTokens.jsx index 46eeb924b6015a..2aa167155b536e 100644 --- a/src/sentry/static/sentry/app/views/settings/account/apiTokens.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/apiTokens.jsx @@ -117,15 +117,13 @@ export class ApiTokens extends AsyncView { )} {!isEmpty && - tokenList.map(token => { - return ( - - ); - })} + tokenList.map(token => ( + + ))} diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/controls/multipleCheckbox.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/controls/multipleCheckbox.jsx index 0ef5c83fd71f3a..cf6c788d94f837 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/controls/multipleCheckbox.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/controls/multipleCheckbox.jsx @@ -52,22 +52,20 @@ export default class MultipleCheckbox extends React.Component { return ( - {choices.map(([choiceValue, choiceLabel]) => { - return ( - - - - ); - })} + {choices.map(([choiceValue, choiceLabel]) => ( + + + + ))} ); } diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioGroup.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioGroup.tsx index c0f9d28736b7bc..8348fcb92cbe7e 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioGroup.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioGroup.tsx @@ -16,40 +16,38 @@ type Props = { onChange: (id: string, e: React.MouseEvent) => void; }; -const RadioGroup = ({value, disabled, choices, label, onChange, ...props}: Props) => { - return ( -
    - {(choices || []).map(([id, name, description], index) => { - const isSelected = value === id; +const RadioGroup = ({value, disabled, choices, label, onChange, ...props}: Props) => ( +
    + {(choices || []).map(([id, name, description], index) => { + const isSelected = value === id; - return ( - !disabled && onChange(id, e)} - role="radio" - index={index} - aria-checked={isSelected} - disabled={disabled} - > - - {isSelected && ( - - )} - - {name} - {description && ( - - {/* If there is a description then we want to have a 2x2 grid so the first column width aligns with Radio Button */} -
    - {description} - + return ( + !disabled && onChange(id, e)} + role="radio" + index={index} + aria-checked={isSelected} + disabled={disabled} + > + + {isSelected && ( + )} - - ); - })} -
    - ); -}; + + {name} + {description && ( + + {/* If there is a description then we want to have a 2x2 grid so the first column width aligns with Radio Button */} +
    + {description} + + )} + + ); + })} +
    +); RadioGroup.propTypes = { value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/inputField.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/inputField.jsx index 3a8d9baf47f6ae..7197a96cc22bf4 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/inputField.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/inputField.jsx @@ -26,11 +26,11 @@ export default class InputField extends React.Component { return ( - {({children, ...formFieldProps}) => { - return field({ + {({children, ...formFieldProps}) => + field({ ...formFieldProps, - }); - }} + }) + } ); } diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/returnButton.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/returnButton.jsx index d47114e06483ff..20946d9a961bf5 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/returnButton.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/returnButton.jsx @@ -34,16 +34,14 @@ const ClickTargetStyled = styled('div')` } `; -const returnButton = props => { - return ( - - - - - - - - ); -}; +const returnButton = props => ( + + + + + + + +); export default returnButton; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/selectField.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/selectField.jsx index f6ecfca339ea39..e9c539a10c6ace 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/selectField.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/selectField.jsx @@ -60,16 +60,14 @@ export default class SelectField extends React.Component { { - return ( - - ); - }} + field={({onChange, onBlur, required: _required, ...props}) => ( + + )} /> ); } diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown.jsx b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown.jsx index c1be087d3db01c..93598186c5cef4 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown.jsx @@ -97,21 +97,19 @@ class BreadcrumbDropdown extends React.Component { onSelect={onSelect} virtualizedHeight={41} > - {({getActorProps, actions, isOpen}) => { - return ( - - {name || route.name} - - - ); - }} + {({getActorProps, actions, isOpen}) => ( + + {name || route.name} + + + )} ); } diff --git a/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx b/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx index 93ec7fb2eb4759..fc33a5a30c8039 100644 --- a/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx @@ -76,9 +76,7 @@ class TeamSelect extends React.Component { options = []; } else { options = teams - .filter(team => { - return !selectedTeams.includes(team.slug); - }) + .filter(team => !selectedTeams.includes(team.slug)) .map(team => ({ value: team.slug, searchKey: team.slug, @@ -125,18 +123,16 @@ class TeamSelect extends React.Component { ? confirmLastTeamRemoveMessage : null; - return selectedTeams.map(team => { - return ( - - ); - }); + return selectedTeams.map(team => ( + + )); } render() { diff --git a/src/sentry/static/sentry/app/views/settings/organizationAuditLog/auditLogList.jsx b/src/sentry/static/sentry/app/views/settings/organizationAuditLog/auditLogList.jsx index c8ee597e52df84..ddfd35e835b1f6 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationAuditLog/auditLogList.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationAuditLog/auditLogList.jsx @@ -108,39 +108,37 @@ class AuditLogList extends React.Component { )} {hasEntries && - entries.map(entry => { - return ( - - -
    - {entry.actor.email && ( - - )} -
    - - - {entry.actor.isSuperuser - ? t('%s (Sentry Staff)', entry.actor.name) - : entry.actor.name} - - {entry.note} - -
    -
    {entry.event}
    + entries.map(entry => ( + +
    - - {entry.ipAddress} - + {entry.actor.email && ( + + )}
    -
    - -
    -
    - ); - })} + + + {entry.actor.isSuperuser + ? t('%s (Sentry Staff)', entry.actor.name) + : entry.actor.name} + + {entry.note} + + +
    {entry.event}
    +
    + + {entry.ipAddress} + +
    +
    + +
    +
    + ))} {pageLinks && } diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/resourceSubscriptions.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/resourceSubscriptions.tsx index 3a88628cea1409..7ed9329dbe5f6c 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/resourceSubscriptions.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/resourceSubscriptions.tsx @@ -54,9 +54,9 @@ export default class Subscriptions extends React.Component { componentDidUpdate() { const {permissions, events} = this.props; - const permittedEvents = events.filter(resource => { - return permissions[PERMISSIONS_MAP[resource]] !== 'no-access'; - }); + const permittedEvents = events.filter( + resource => permissions[PERMISSIONS_MAP[resource]] !== 'no-access' + ); if (JSON.stringify(events) !== JSON.stringify(permittedEvents)) { this.save(permittedEvents); diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx index b9b4aa40713327..d5e81fe4f1f636 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx @@ -83,8 +83,8 @@ const ResponseCode = ({code}: {code: number}) => { ); }; -const TimestampLink = ({date, link}: {date: moment.MomentInput; link?: string}) => { - return link ? ( +const TimestampLink = ({date, link}: {date: moment.MomentInput; link?: string}) => + link ? ( @@ -92,7 +92,6 @@ const TimestampLink = ({date, link}: {date: moment.MomentInput; link?: string}) ) : ( ); -}; type Props = AsyncComponent['props'] & { app: SentryApp; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx index e60ded708f9365..1490706fb01b6a 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx @@ -233,44 +233,42 @@ export default class SentryApplicationDetails extends AsyncView { renderTokens = () => { const {tokens} = this.state; if (tokens.length > 0) { - return tokens.map(token => { - return ( - - - - - {getDynamicText({value: token.token, fixed: 'xxxxxx'})} - - - - - Created: - - - - - ); - }); + + {getDynamicText({value: token.token, fixed: 'xxxxxx'})} + + + + + Created: + + + + + )); } else { return ; } @@ -369,18 +367,16 @@ export default class SentryApplicationDetails extends AsyncView { {app.status !== 'internal' && ( - {({value}) => { - return ( - - {getDynamicText({value, fixed: 'PERCY_CLIENT_ID'})} - - ); - }} + {({value}) => ( + + {getDynamicText({value, fixed: 'PERCY_CLIENT_ID'})} + + )} )} - {({value}) => { - return value ? ( + {({value}) => + value ? ( { ) : ( hidden - ); - }} + ) + } diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/index.tsx index 1723b78050943f..402be62e603077 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/index.tsx @@ -236,13 +236,11 @@ const StatusIndicator = styled(({status, ...props}: StatusIndicatorProps) => { type PublishStatusProps = {status: SentryApp['status']; theme?: any}; -const PublishStatus = styled(({status, ...props}: PublishStatusProps) => { - return ( - -
    {t(`${status}`)}
    -
    - ); -})` +const PublishStatus = styled(({status, ...props}: PublishStatusProps) => ( + +
    {t(`${status}`)}
    +
    +))` color: ${(props: PublishStatusProps) => props.status === 'published' ? props.theme.success : props.theme.gray2}; font-weight: light; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/installButtons.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/installButtons.tsx index 143ff07e3017ff..01532579119a42 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/installButtons.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/installButtons.tsx @@ -44,18 +44,16 @@ export const UninstallButton = ({ type InstallButtonProps = { onClickInstall?: () => void; }; -export const InstallButton = ({onClickInstall}: InstallButtonProps) => { - return ( - - ); -}; +export const InstallButton = ({onClickInstall}: InstallButtonProps) => ( + +); const StyledButton = styled(Button)` color: ${p => p.theme.gray2}; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx index 20c54e00e114ab..b852bab8bd16dc 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx @@ -104,12 +104,11 @@ class InviteMember extends React.Component { router.push(replaceRouterParams(pathToParentRoute, params)); }; - splitEmails = text => { - return text + splitEmails = text => + text .split(',') .map(e => e.trim()) .filter(e => e); - }; inviteUser = email => { const {slug} = this.props.organization; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersList.tsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersList.tsx index 2aa4c6c2ada672..c3946cac778ba7 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersList.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersList.tsx @@ -204,27 +204,25 @@ class OrganizationMembersList extends AsyncView { {t('Members')} - {members.map(member => { - return ( - - ); - })} + {members.map(member => ( + + ))} {members.length === 0 && ( {t('No members found.')} )} diff --git a/src/sentry/static/sentry/app/views/settings/organizationProjects/projectStatsGraph.jsx b/src/sentry/static/sentry/app/views/settings/organizationProjects/projectStatsGraph.jsx index b3b02f8c3075e8..dc020785e14074 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationProjects/projectStatsGraph.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationProjects/projectStatsGraph.jsx @@ -7,11 +7,7 @@ import SentryTypes from 'app/sentryTypes'; const ProjectStatsGraph = ({project, stats}) => { stats = stats || project.stats; - const chartData = - stats && - stats.map(point => { - return {x: point[0], y: point[1]}; - }); + const chartData = stats && stats.map(point => ({x: point[0], y: point[1]})); return (
    diff --git a/src/sentry/static/sentry/app/views/settings/organizationRateLimits/organizationRateLimits.jsx b/src/sentry/static/sentry/app/views/settings/organizationRateLimits/organizationRateLimits.jsx index e7f52a95e9c93e..d21972bc49565a 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRateLimits/organizationRateLimits.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRateLimits/organizationRateLimits.jsx @@ -83,13 +83,13 @@ export default class OrganizationRateLimit extends React.Component { 'The maximum number of events to accept across this entire organization.' )} placeholder="e.g. 500" - formatLabel={value => { - return !value + formatLabel={value => + !value ? t('No Limit') : tct('[number] per hour', { number: value.toLocaleString(), - }); - }} + }) + } /> ) : ( { - return value !== 100 ? ( + formatLabel={value => + value !== 100 ? ( `${value}%` ) : ( - ); - }} + ) + } /> diff --git a/src/sentry/static/sentry/app/views/settings/organizationRepositories/addRepositoryLink.jsx b/src/sentry/static/sentry/app/views/settings/organizationRepositories/addRepositoryLink.jsx index 071745323d3ef6..50cf1bb9159dac 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRepositories/addRepositoryLink.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRepositories/addRepositoryLink.jsx @@ -140,18 +140,16 @@ class AddRepositoryLink extends PluginComponentBase {
    )} {!hasIntegration && this.renderNote(provider)} - {provider.config.map(field => { - return ( -
    - {this.renderField({ - config: field, - formData: this.state.formData, - formErrors: errors, - onChange: this.changeField.bind(this, field.name), - })} -
    - ); - })} + {provider.config.map(field => ( +
    + {this.renderField({ + config: field, + formData: this.state.formData, + formErrors: errors, + onChange: this.changeField.bind(this, field.name), + })} +
    + ))} ); } diff --git a/src/sentry/static/sentry/app/views/settings/organizationRepositories/organizationRepositories.tsx b/src/sentry/static/sentry/app/views/settings/organizationRepositories/organizationRepositories.tsx index 65765db413605f..c638cda173ca05 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRepositories/organizationRepositories.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRepositories/organizationRepositories.tsx @@ -58,18 +58,16 @@ const OrganizationRepositories = ({itemList, onRepositoryChange, api, params}: P - {itemList.map(repo => { - return ( - - ); - })} + {itemList.map(repo => ( + + ))} diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsList.jsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsList.jsx index dc8cd8b958c39e..25ff68c44863fa 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsList.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsList.jsx @@ -37,18 +37,16 @@ class AllTeamsList extends React.Component { render() { const {access, organization, urlPrefix, openMembership, useCreateModal} = this.props; - const teamNodes = this.props.teamList.map((team, teamIdx) => { - return ( - - ); - }); + const teamNodes = this.props.teamList.map((team, teamIdx) => ( + + )); if (teamNodes.length !== 0) { return teamNodes; diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.jsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.jsx index be08cea6206c03..756cff639c2fa1 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.jsx @@ -84,9 +84,7 @@ class TeamMembers extends React.Component { { success: () => { this.setState({ - teamMemberList: this.state.teamMemberList.filter(m => { - return m.id !== member.id; - }), + teamMemberList: this.state.teamMemberList.filter(m => m.id !== member.id), }); addSuccessMessage(t('Successfully removed member from team.')); }, @@ -166,9 +164,9 @@ class TeamMembers extends React.Component { }, { success: () => { - const orgMember = this.state.orgMemberList.find(member => { - return member.id === selection.value; - }); + const orgMember = this.state.orgMemberList.find( + member => member.id === selection.value + ); this.setState({ loading: false, error: false, @@ -208,18 +206,16 @@ class TeamMembers extends React.Component { const items = (this.state.orgMemberList || []) .filter(m => !existingMembers.has(m.id)) - .map(m => { - return { - searchKey: `${m.name} ${m.email}`, - value: m.id, - label: ( - - - {m.name || m.email} - - ), - }; - }); + .map(m => ({ + searchKey: `${m.name} ${m.email}`, + value: m.id, + label: ( + + + {m.name || m.email} + + ), + })); const menuHeader = ( @@ -261,22 +257,20 @@ class TeamMembers extends React.Component { ); }; - removeButton = member => { - return ( - - ); - }; + removeButton = member => ( + + ); render() { if (this.state.loading) { diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamProjects.jsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamProjects.jsx index 88e73782e84758..381adcc998a199 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamProjects.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamProjects.jsx @@ -123,9 +123,7 @@ class TeamProjects extends React.Component { }; handleProjectSelected = selection => { - const project = this.state.unlinkedProjects.find(p => { - return p.id === selection.value; - }); + const project = this.state.unlinkedProjects.find(p => p.id === selection.value); this.handleLinkProject(project, 'add'); }; @@ -179,13 +177,11 @@ class TeamProjects extends React.Component { const access = new Set(this.props.organization.access); - const otherProjects = unlinkedProjects.map(p => { - return { - value: p.id, - searchKey: p.slug, - label: {p.slug}, - }; - }); + const otherProjects = unlinkedProjects.map(p => ({ + value: p.id, + searchKey: p.slug, + label: {p.slug}, + })); return ( diff --git a/src/sentry/static/sentry/app/views/settings/project/projectEnvironments.jsx b/src/sentry/static/sentry/app/views/settings/project/projectEnvironments.jsx index 1b5a2f21d17ec2..3f4972ec0618e9 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectEnvironments.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectEnvironments.jsx @@ -145,19 +145,17 @@ class ProjectEnvironments extends React.Component { return ( {this.renderAllEnvironmentsSystemRow()} - {envs.map(env => { - return ( - - ); - })} + {envs.map(env => ( + + ))} ); } diff --git a/src/sentry/static/sentry/app/views/settings/project/projectFilters/groupTombstones.jsx b/src/sentry/static/sentry/app/views/settings/project/projectFilters/groupTombstones.jsx index 90f6604931c165..ea22306b6f8fc4 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectFilters/groupTombstones.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectFilters/groupTombstones.jsx @@ -108,15 +108,13 @@ class GroupTombstones extends AsyncComponent { return tombstones.length ? ( - {tombstones.map(data => { - return ( - - ); - })} + {tombstones.map(data => ( + + ))} ) : ( this.renderEmpty() diff --git a/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersChart.jsx b/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersChart.jsx index 8237d28421d890..0b818f25a4b4b5 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersChart.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersChart.jsx @@ -63,19 +63,17 @@ class ProjectFiltersChart extends React.Component { } formatData(rawData) { - return Object.keys(this.getStatOpts()).map(stat => { - return { - data: rawData[stat].map(([x, y]) => { - if (y > 0) { - this.setState({blankStats: false}); - } - - return {x, y}; - }), - label: this.getStatOpts()[stat], - statName: stat, - }; - }); + return Object.keys(this.getStatOpts()).map(stat => ({ + data: rawData[stat].map(([x, y]) => { + if (y > 0) { + this.setState({blankStats: false}); + } + + return {x, y}; + }), + label: this.getStatOpts()[stat], + statName: stat, + })); } getFilterStats() { @@ -88,11 +86,11 @@ class ProjectFiltersChart extends React.Component { until: this.state.queryUntil, resolution: '1d', }; - const requests = statOptions.map(stat => { - return this.props.api.requestPromise(statEndpoint, { + const requests = statOptions.map(stat => + this.props.api.requestPromise(statEndpoint, { query: Object.assign({stat}, query), - }); - }); + }) + ); Promise.all(requests) .then(results => { const rawStatsData = {}; @@ -138,8 +136,8 @@ class ProjectFiltersChart extends React.Component {
    {intcomma(totalY)} {tn('total event', 'total events', totalY)}
    - {formattedData.map((dataPoint, i) => { - return ( + {formattedData.map( + (dataPoint, i) => point.y[i] > 0 && (
    @@ -154,8 +152,7 @@ class ProjectFiltersChart extends React.Component {
    ) - ); - })} + )}
    ); }; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/index.tsx b/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/index.tsx index 0e16b3b2dc4aec..2d449264a4c62a 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/index.tsx @@ -51,13 +51,9 @@ class ProjectKeys extends AsyncView { addLoadingMessage(t('Revoking key..')); - this.setState(state => { - return { - keyList: state.keyList.filter(key => { - return key.id !== data.id; - }), - }; - }); + this.setState(state => ({ + keyList: state.keyList.filter(key => key.id !== data.id), + })); const {orgId, projectId} = this.props.params; @@ -118,11 +114,9 @@ class ProjectKeys extends AsyncView { } ); - this.setState(state => { - return { - keyList: [...state.keyList, data], - }; - }); + this.setState(state => ({ + keyList: [...state.keyList, data], + })); addSuccessMessage(t('Created a new key.')); } catch (_err) { addErrorMessage(t('Unable to create new key. Please try again.')); @@ -147,23 +141,21 @@ class ProjectKeys extends AsyncView { return ( - {this.state.keyList.map(key => { - return ( - - ); - })} + {this.state.keyList.map(key => ( + + ))} ); diff --git a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.jsx b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.jsx index 37f825cf5072d9..5b43d84f7c1dfa 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.jsx @@ -25,10 +25,9 @@ class ProjectOwnershipModal extends AsyncComponent { `/issues/${issueId}/tags/url/`, {}, { - allowError: error => { + allowError: error => // Allow for 404s - return error.status === 404; - }, + error.status === 404, }, ], ['eventData', `/issues/${issueId}/events/latest/`], diff --git a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.jsx b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.jsx index 9c9e48c15fb182..2b0b4115865eae 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.jsx @@ -82,52 +82,46 @@ export default class SelectOwners extends React.Component { } } - renderUserBadge = user => { - return ; - }; - - createMentionableUser = user => { - return { - value: buildUserId(user.id), - label: this.renderUserBadge(user), - searchKey: getSearchKeyForUser(user), - actor: { - type: 'user', - id: user.id, - name: user.name, - }, - }; - }; - - createUnmentionableUser = ({user}) => { - return { - ...this.createMentionableUser(user), - disabled: true, - label: ( - - - {this.renderUserBadge(user)} - - - ), - }; - }; - - createMentionableTeam = team => { - return { - value: buildTeamId(team.id), - label: , - searchKey: `#${team.slug}`, - actor: { - type: 'team', - id: team.id, - name: team.slug, - }, - }; - }; + renderUserBadge = user => ( + + ); + + createMentionableUser = user => ({ + value: buildUserId(user.id), + label: this.renderUserBadge(user), + searchKey: getSearchKeyForUser(user), + actor: { + type: 'user', + id: user.id, + name: user.name, + }, + }); + + createUnmentionableUser = ({user}) => ({ + ...this.createMentionableUser(user), + disabled: true, + label: ( + + + {this.renderUserBadge(user)} + + + ), + }); + + createMentionableTeam = team => ({ + value: buildTeamId(team.id), + label: , + searchKey: `#${team.slug}`, + actor: { + type: 'team', + id: team.id, + name: team.slug, + }, + }); createUnmentionableTeam = team => { const {organization} = this.props; @@ -282,34 +276,27 @@ export default class SelectOwners extends React.Component { } }); }) - .then(members => { + .then(members => // Be careful here as we actually want the `users` object, otherwise it means user // has not registered for sentry yet, but has been invited - return members + members ? members .filter(({user}) => user && usersInProjectById.indexOf(user.id) === -1) .map(this.createUnmentionableUser) - : []; - }) - .then(members => { - return { - options: [ - ...usersInProject, - ...teamsInProject, - ...teamsNotInProject, - ...members, - ], - }; - }); + : [] + ) + .then(members => ({ + options: [...usersInProject, ...teamsInProject, ...teamsNotInProject, ...members], + })); }; render() { return ( { - return options.filter(({searchKey}) => searchKey.indexOf(filterText) > -1); - }} + filterOptions={(options, filterText) => + options.filter(({searchKey}) => searchKey.indexOf(filterText) > -1) + } ref={ref => (this.selectRef = ref)} loadOptions={this.handleLoadOptions} defaultOptions diff --git a/src/sentry/static/sentry/app/views/settings/project/projectProcessingIssues.jsx b/src/sentry/static/sentry/app/views/settings/project/projectProcessingIssues.jsx index 7b220b9fb27ec3..4ca129ad47d3ba 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectProcessingIssues.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectProcessingIssues.jsx @@ -216,23 +216,19 @@ class ProjectProcessingIssues extends React.Component { return body; }; - renderLoading = () => { - return ( -
    - -
    - ); - }; + renderLoading = () => ( +
    + +
    + ); - renderEmpty = () => { - return ( - - -

    {t('Good news! There are no processing issues.')}

    -
    -
    - ); - }; + renderEmpty = () => ( + + +

    {t('Good news! There are no processing issues.')}

    +
    +
    + ); getProblemDescription = item => { const msg = MESSAGES[item.type]; @@ -382,20 +378,18 @@ class ProjectProcessingIssues extends React.Component {
    {processingRow} - {this.state.processingIssues.issues.map((item, idx) => { - return ( -
    -
    -
    {this.renderProblem(item)}
    -
    {this.renderDetails(item)}
    -
    {item.numEvents + ''}
    -
    - -
    + {this.state.processingIssues.issues.map((item, idx) => ( +
    +
    +
    {this.renderProblem(item)}
    +
    {this.renderDetails(item)}
    +
    {item.numEvents + ''}
    +
    +
    - ); - })} +
    + ))}
    diff --git a/src/sentry/static/sentry/app/views/settings/project/projectServiceHooks.jsx b/src/sentry/static/sentry/app/views/settings/project/projectServiceHooks.jsx index d445d67c2a7a89..720800e68cb45f 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectServiceHooks.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectServiceHooks.jsx @@ -117,17 +117,15 @@ export default class ProjectServiceHooks extends AsyncView { Service Hooks are an early adopter preview feature and will change in the future. - {this.state.hookList.map(hook => { - return ( - - ); - })} + {this.state.hookList.map(hook => ( + + ))}
    ); diff --git a/src/sentry/static/sentry/app/views/settings/project/projectTeams.jsx b/src/sentry/static/sentry/app/views/settings/project/projectTeams.jsx index f5c4f180eea9e9..ef0e670fa36a16 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectTeams.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectTeams.jsx @@ -49,21 +49,15 @@ class ProjectTeams extends AsyncView { }; handleRemovedTeam = teamSlug => { - this.setState(prevState => { - return { - projectTeams: this.state.projectTeams.filter(team => { - return team.slug !== teamSlug; - }), - }; - }); + this.setState(prevState => ({ + projectTeams: this.state.projectTeams.filter(team => team.slug !== teamSlug), + })); }; handleAddedTeam = team => { - this.setState(prevState => { - return { - projectTeams: this.state.projectTeams.concat([team]), - }; - }); + this.setState(prevState => ({ + projectTeams: this.state.projectTeams.concat([team]), + })); }; handleAdd = team => { diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNodeList.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNodeList.tsx index 6eb486c2ac1862..b99275138585e7 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNodeList.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNodeList.tsx @@ -64,18 +64,16 @@ class RuleNodeList extends React.Component { {items && !!items.length && ( - {items.map((item, idx) => { - return ( - - ); - })} + {items.map((item, idx) => ( + + ))} )} { - {data.conditions.map((condition, i) => { - return ( - - - - ); - })} + {data.conditions.map((condition, i) => ( + + + + ))}
    {condition.name}
    {condition.name}
    @@ -156,13 +154,11 @@ class RuleRow extends React.Component { - {data.actions.map((action, i) => { - return ( - - - - ); - })} + {data.actions.map((action, i) => ( + + + + ))}
    {action.name}
    {action.name}
    diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRowNew.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRowNew.tsx index 5c099550ef2dc1..399d20a41ed8d8 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRowNew.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRowNew.tsx @@ -71,17 +71,17 @@ class RuleRow extends React.Component { {data.conditions.length !== 0 && ( - {data.conditions.map((condition, i) => { - return
    {condition.name}
    ; - })} + {data.conditions.map((condition, i) => ( +
    {condition.name}
    + ))}
    )} - {data.actions.map((action, i) => { - return
    {action.name}
    ; - })} + {data.actions.map((action, i) => ( +
    {action.name}
    + ))}
    @@ -106,26 +106,22 @@ class RuleRow extends React.Component {
    {data.triggers.length !== 0 && - data.triggers.map((trigger, i) => { - return ( - - - {trigger.label} -
    - {data.aggregations[0] === 0 ? t('Events') : t('Users')}{' '} - {trigger.thresholdType === 0 ? t('above') : t('below')}{' '} - {trigger.alertThreshold}/{data.timeWindow}min -
    -
    - - {trigger.actions && - trigger.actions.map((action, j) => ( -
    {action.desc}
    - ))} -
    -
    - ); - })} + data.triggers.map((trigger, i) => ( + + + {trigger.label} +
    + {data.aggregations[0] === 0 ? t('Events') : t('Users')}{' '} + {trigger.thresholdType === 0 ? t('above') : t('below')}{' '} + {trigger.alertThreshold}/{data.timeWindow}min +
    +
    + + {trigger.actions && + trigger.actions.map((action, j) =>
    {action.desc}
    )} +
    +
    + ))}
    ); diff --git a/src/sentry/static/sentry/app/views/settings/projectGeneralSettings.jsx b/src/sentry/static/sentry/app/views/settings/projectGeneralSettings.jsx index e0701683bb105d..540ab51965d415 100644 --- a/src/sentry/static/sentry/app/views/settings/projectGeneralSettings.jsx +++ b/src/sentry/static/sentry/app/views/settings/projectGeneralSettings.jsx @@ -245,9 +245,7 @@ class ProjectGeneralSettings extends AsyncView { ); } - isProjectAdmin = () => { - return new Set(this.context.organization.access).has('project:admin'); - }; + isProjectAdmin = () => new Set(this.context.organization.access).has('project:admin'); renderRemoveProject() { const project = this.state.data; diff --git a/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPlugins.jsx b/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPlugins.jsx index ba94d5821c89b8..55d4baf54ecaff 100644 --- a/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPlugins.jsx +++ b/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPlugins.jsx @@ -51,8 +51,8 @@ class ProjectPlugins extends Component { - {({hasAccess}) => { - return hasAccess + {({hasAccess}) => + hasAccess ? tct( "Legacy Integrations must be configured per-project. It's recommended to prefer organization integrations over the legacy project integrations when available. Visit the [link:organization integrations] settings to manage them.", { @@ -61,8 +61,8 @@ class ProjectPlugins extends Component { ) : t( "Legacy Integrations must be configured per-project. It's recommended to prefer organization integrations over the legacy project integrations when available." - ); - }} + ) + } diff --git a/tests/js/setup.js b/tests/js/setup.js index 568e6bf75ff511..41fc27e0075e5e 100644 --- a/tests/js/setup.js +++ b/tests/js/setup.js @@ -78,9 +78,7 @@ jest.mock('react-virtualized', () => { const ActualReactVirtualized = require.requireActual('react-virtualized'); return { ...ActualReactVirtualized, - AutoSizer: ({children}) => { - return children({width: 100, height: 100}); - }, + AutoSizer: ({children}) => children({width: 100, height: 100}), }; }); @@ -207,8 +205,6 @@ window.TestStubs = { }, }), - AllAuthenticators: () => { - return Object.values(fixtures.Authenticators()).map(x => x()); - }, + AllAuthenticators: () => Object.values(fixtures.Authenticators()).map(x => x()), ...fixtures, }; diff --git a/tests/js/spec/components/activity/note/input.spec.jsx b/tests/js/spec/components/activity/note/input.spec.jsx index b44e50b2df5ed6..c7565a98b6c5ab 100644 --- a/tests/js/spec/components/activity/note/input.spec.jsx +++ b/tests/js/spec/components/activity/note/input.spec.jsx @@ -68,9 +68,8 @@ describe('NoteInput', function() { teams: [], }; - const createWrapper = props => { - return mountWithTheme(, routerContext); - }; + const createWrapper = props => + mountWithTheme(, routerContext); it('edits existing message', async function() { const onUpdate = jest.fn(); diff --git a/tests/js/spec/components/activity/note/inputWithStorage.spec.jsx b/tests/js/spec/components/activity/note/inputWithStorage.spec.jsx index 2f8a437e141864..981cc99b3f2fb3 100644 --- a/tests/js/spec/components/activity/note/inputWithStorage.spec.jsx +++ b/tests/js/spec/components/activity/note/inputWithStorage.spec.jsx @@ -17,12 +17,8 @@ describe('NoteInputWithStorage', function() { }; const routerContext = TestStubs.routerContext(); - const createWrapper = props => { - return mountWithTheme( - , - routerContext - ); - }; + const createWrapper = props => + mountWithTheme(, routerContext); it('loads draft item from local storage when mounting', function() { localStorage.getItem.mockImplementation(() => JSON.stringify({item1: 'saved item'})); diff --git a/tests/js/spec/components/avatar.spec.jsx b/tests/js/spec/components/avatar.spec.jsx index 1b31f0b76e4bcb..f9d0c99e1839d1 100644 --- a/tests/js/spec/components/avatar.spec.jsx +++ b/tests/js/spec/components/avatar.spec.jsx @@ -3,13 +3,11 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import Avatar from 'app/components/avatar'; -jest.mock('app/stores/configStore', () => { - return { - getConfig: () => ({ - gravatarBaseUrl: 'gravatarBaseUrl', - }), - }; -}); +jest.mock('app/stores/configStore', () => ({ + getConfig: () => ({ + gravatarBaseUrl: 'gravatarBaseUrl', + }), +})); describe('Avatar', function() { const USER = { diff --git a/tests/js/spec/components/dropdownMenu.spec.jsx b/tests/js/spec/components/dropdownMenu.spec.jsx index f638f49f46664a..2799a363c0653c 100644 --- a/tests/js/spec/components/dropdownMenu.spec.jsx +++ b/tests/js/spec/components/dropdownMenu.spec.jsx @@ -11,18 +11,16 @@ describe('DropdownMenu', function() { beforeEach(function() { wrapper = mount( - {({getRootProps, getActorProps, getMenuProps, isOpen}) => { - return ( - - - {isOpen && ( -
      -
    • Dropdown Menu Item 1
    • -
    - )} -
    - ); - }} + {({getRootProps, getActorProps, getMenuProps, isOpen}) => ( + + + {isOpen && ( +
      +
    • Dropdown Menu Item 1
    • +
    + )} +
    + )}
    ); }); @@ -72,18 +70,16 @@ describe('DropdownMenu', function() { it('ignores "Escape" key if `closeOnEscape` is false', function() { wrapper = mount( - {({getRootProps, getActorProps, getMenuProps, isOpen}) => { - return ( - - - {isOpen && ( -
      -
    • Dropdown Menu Item 1
    • -
    - )} -
    - ); - }} + {({getRootProps, getActorProps, getMenuProps, isOpen}) => ( + + + {isOpen && ( +
      +
    • Dropdown Menu Item 1
    • +
    + )} +
    + )}
    ); @@ -97,18 +93,16 @@ describe('DropdownMenu', function() { it('keeps dropdown open when clicking on anything in menu with `keepMenuOpen` prop', function() { wrapper = mount( - {({getRootProps, getActorProps, getMenuProps, isOpen}) => { - return ( - - - {isOpen && ( -
      -
    • Dropdown Menu Item 1
    • -
    - )} -
    - ); - }} + {({getRootProps, getActorProps, getMenuProps, isOpen}) => ( + + + {isOpen && ( +
      +
    • Dropdown Menu Item 1
    • +
    + )} +
    + )}
    ); @@ -127,35 +121,33 @@ describe('DropdownMenu', function() { wrapper = mount( - {({getRootProps, getActorProps, getMenuProps, isOpen}) => { - return ( - ( + + - {isOpen && ( -
      -
    • Dropdown Menu Item 1
    • -
    - )} -
    - ); - }} +
  • Dropdown Menu Item 1
  • + + )} +
    + )}
    ); @@ -186,30 +178,28 @@ describe('DropdownMenu', function() { wrapper = mount( - {({getRootProps, getActorProps, getMenuProps, isOpen}) => { - return ( - ( + + -
      -
    • Dropdown Menu Item 1
    • -
    -
    - ); - }} + Open Dropdown + +
      +
    • Dropdown Menu Item 1
    • +
    +
    + )}
    ); diff --git a/tests/js/spec/components/events/meta/annotated.spec.jsx b/tests/js/spec/components/events/meta/annotated.spec.jsx index 4b79f200dd0162..9f3d195faedfdd 100644 --- a/tests/js/spec/components/events/meta/annotated.spec.jsx +++ b/tests/js/spec/components/events/meta/annotated.spec.jsx @@ -7,8 +7,8 @@ import {withMeta} from 'app/components/events/meta/metaProxy'; describe('Annotated', () => { const mock = jest.fn(() => null); - const createEvent = (value, {err, rem, chunks} = {}) => { - return withMeta({ + const createEvent = (value, {err, rem, chunks} = {}) => + withMeta({ value, _meta: { value: { @@ -20,7 +20,6 @@ describe('Annotated', () => { }, }, }); - }; beforeEach(function() { mock.mockClear(); diff --git a/tests/js/spec/components/group/externalIssueForm.spec.jsx b/tests/js/spec/components/group/externalIssueForm.spec.jsx index 8b61cf7e6ace73..2db76f34b55fc2 100644 --- a/tests/js/spec/components/group/externalIssueForm.spec.jsx +++ b/tests/js/spec/components/group/externalIssueForm.spec.jsx @@ -5,19 +5,17 @@ import ExternalIssueForm from 'app/components/group/externalIssueForm'; jest.mock('lodash/debounce', () => { const debounceMap = new Map(); - const mockDebounce = (fn, timeout) => { - return (...args) => { - if (debounceMap.has(fn)) { - clearTimeout(debounceMap.get(fn)); - } - debounceMap.set( - fn, - setTimeout(() => { - fn.apply(fn, args); - debounceMap.delete(fn); - }, timeout) - ); - }; + const mockDebounce = (fn, timeout) => (...args) => { + if (debounceMap.has(fn)) { + clearTimeout(debounceMap.get(fn)); + } + debounceMap.set( + fn, + setTimeout(() => { + fn.apply(fn, args); + debounceMap.delete(fn); + }, timeout) + ); }; return mockDebounce; }); diff --git a/tests/js/spec/components/group/sentryAppExternalIssueForm.spec.jsx b/tests/js/spec/components/group/sentryAppExternalIssueForm.spec.jsx index 3f6460e225bf54..6041c7c063c108 100644 --- a/tests/js/spec/components/group/sentryAppExternalIssueForm.spec.jsx +++ b/tests/js/spec/components/group/sentryAppExternalIssueForm.spec.jsx @@ -212,9 +212,7 @@ describe('SentryAppExternalIssueForm Async Field', () => { await tick(); wrapper.update(); - const optionLabelSelector = label => { - return `[aria-label="${label}"]`; - }; + const optionLabelSelector = label => `[aria-label="${label}"]`; expect(wrapper.find(optionLabelSelector('Issue 1')).exists()).toBe(true); expect(wrapper.find(optionLabelSelector('Issue 2')).exists()).toBe(true); diff --git a/tests/js/spec/components/hook.spec.jsx b/tests/js/spec/components/hook.spec.jsx index b290a748ba30e4..d39d165a83741b 100644 --- a/tests/js/spec/components/hook.spec.jsx +++ b/tests/js/spec/components/hook.spec.jsx @@ -11,13 +11,11 @@ describe('Hook', function() { const routerContext = TestStubs.routerContext(); beforeEach(function() { - HookStore.add('footer', ({organization} = {}) => { - return ( - - {organization.slug} - - ); - }); + HookStore.add('footer', ({organization} = {}) => ( + + {organization.slug} + + )); }); afterEach(function() { @@ -60,13 +58,11 @@ describe('Hook', function() { expect(wrapper.find('Wrapper')).toHaveLength(1); - HookStore.add('footer', ({organization} = {}) => { - return ( - - New Hook - - ); - }); + HookStore.add('footer', ({organization} = {}) => ( + + New Hook + + )); wrapper.update(); @@ -90,13 +86,11 @@ describe('Hook', function() { routerContext ); - HookStore.add('footer', ({organization} = {}) => { - return ( - - New Hook - - ); - }); + HookStore.add('footer', ({organization} = {}) => ( + + New Hook + + )); wrapper.update(); diff --git a/tests/js/spec/components/organizations/globalSelectionHeader.spec.jsx b/tests/js/spec/components/organizations/globalSelectionHeader.spec.jsx index beee83687b9876..0719783bfd2f62 100644 --- a/tests/js/spec/components/organizations/globalSelectionHeader.spec.jsx +++ b/tests/js/spec/components/organizations/globalSelectionHeader.spec.jsx @@ -23,12 +23,10 @@ const changeQuery = (routerContext, query) => ({ }, }); -jest.mock('app/utils/localStorage', () => { - return { - getItem: () => JSON.stringify({projects: [3], environments: ['staging']}), - setItem: jest.fn(), - }; -}); +jest.mock('app/utils/localStorage', () => ({ + getItem: () => JSON.stringify({projects: [3], environments: ['staging']}), + setItem: jest.fn(), +})); describe('GlobalSelectionHeader', function() { const {organization, router, routerContext} = initializeOrg({ diff --git a/tests/js/spec/components/organizations/timeRangeSelector/dateRange.spec.jsx b/tests/js/spec/components/organizations/timeRangeSelector/dateRange.spec.jsx index e759b9604eb292..8b3f7ed8683327 100644 --- a/tests/js/spec/components/organizations/timeRangeSelector/dateRange.spec.jsx +++ b/tests/js/spec/components/organizations/timeRangeSelector/dateRange.spec.jsx @@ -10,27 +10,25 @@ import DateRange from 'app/components/organizations/timeRangeSelector/dateRange' const start = new Date(1507948680000); const end = new Date(1508207880000); //National Pasta Day -const getSelectedRange = wrapper => { - return [ - wrapper - .find('.rdrStartEdge') +const getSelectedRange = wrapper => [ + wrapper + .find('.rdrStartEdge') + .closest('DayCell') + .find('.rdrDayNumber span') + .text(), + ...wrapper.find('.rdrInRange').map(el => + el .closest('DayCell') .find('.rdrDayNumber span') - .text(), - ...wrapper.find('.rdrInRange').map(el => - el - .closest('DayCell') - .find('.rdrDayNumber span') - .text() - ), - - wrapper - .find('.rdrEndEdge') - .closest('DayCell') - .find('.rdrDayNumber span') - .text(), - ]; -}; + .text() + ), + + wrapper + .find('.rdrEndEdge') + .closest('DayCell') + .find('.rdrDayNumber span') + .text(), +]; describe('DateRange', function() { let wrapper; diff --git a/tests/js/spec/stores/globalSelectionStore.spec.jsx b/tests/js/spec/stores/globalSelectionStore.spec.jsx index a4b07f4ac217ec..6dbdf5c6f90d3b 100644 --- a/tests/js/spec/stores/globalSelectionStore.spec.jsx +++ b/tests/js/spec/stores/globalSelectionStore.spec.jsx @@ -5,12 +5,10 @@ import { updateEnvironments, } from 'app/actionCreators/globalSelection'; -jest.mock('app/utils/localStorage', () => { - return { - getItem: () => JSON.stringify({projects: [5], environments: ['staging']}), - setItem: jest.fn(), - }; -}); +jest.mock('app/utils/localStorage', () => ({ + getItem: () => JSON.stringify({projects: [5], environments: ['staging']}), + setItem: jest.fn(), +})); describe('GlobalSelectionStore', function() { const organization = TestStubs.Organization({ diff --git a/tests/js/spec/views/events/events.spec.jsx b/tests/js/spec/views/events/events.spec.jsx index 41d875af6a965a..d00b27d016819c 100644 --- a/tests/js/spec/views/events/events.spec.jsx +++ b/tests/js/spec/views/events/events.spec.jsx @@ -88,9 +88,7 @@ describe('EventsErrors', function() { }); eventsStatsMock = MockApiClient.addMockResponse({ url: '/organizations/org-slug/events-stats/', - body: (_url, opts) => { - return TestStubs.EventsStats(opts.query); - }, + body: (_url, opts) => TestStubs.EventsStats(opts.query), }); eventsMetaMock = MockApiClient.addMockResponse({ url: '/organizations/org-slug/events-meta/', @@ -343,9 +341,7 @@ describe('EventsContainer', function() { }); eventsStatsMock = MockApiClient.addMockResponse({ url: '/organizations/org-slug/events-stats/', - body: (_url, opts) => { - return TestStubs.EventsStats(opts.query); - }, + body: (_url, opts) => TestStubs.EventsStats(opts.query), }); eventsMetaMock = MockApiClient.addMockResponse({ url: '/organizations/org-slug/events-meta/', diff --git a/tests/js/spec/views/events/utils/eventsRequest.spec.jsx b/tests/js/spec/views/events/utils/eventsRequest.spec.jsx index a2612a2e6a9936..ff578c06681e1f 100644 --- a/tests/js/spec/views/events/utils/eventsRequest.spec.jsx +++ b/tests/js/spec/views/events/utils/eventsRequest.spec.jsx @@ -8,11 +8,9 @@ const COUNT_OBJ = { count: 123, }; -jest.mock('app/actionCreators/events', () => { - return { - doEventsRequest: jest.fn(), - }; -}); +jest.mock('app/actionCreators/events', () => ({ + doEventsRequest: jest.fn(), +})); describe('EventsRequest', function() { const project = TestStubs.Project(); diff --git a/tests/js/spec/views/eventsV2/eventView.spec.jsx b/tests/js/spec/views/eventsV2/eventView.spec.jsx index 14ec050d0b36f5..174b66fffb6c5c 100644 --- a/tests/js/spec/views/eventsV2/eventView.spec.jsx +++ b/tests/js/spec/views/eventsV2/eventView.spec.jsx @@ -5,22 +5,16 @@ import EventView, { import {COL_WIDTH_UNDEFINED} from 'app/components/gridEditable/utils'; import {CHART_AXIS_OPTIONS} from 'app/views/eventsV2/data'; -const generateFields = fields => { - return fields.map(field => { - return { - field, - }; - }); -}; - -const generateSorts = sorts => { - return sorts.map(sortName => { - return { - field: sortName, - kind: 'desc', - }; - }); -}; +const generateFields = fields => + fields.map(field => ({ + field, + })); + +const generateSorts = sorts => + sorts.map(sortName => ({ + field: sortName, + kind: 'desc', + })); describe('EventView constructor', function() { it('instantiates default values', function() { diff --git a/tests/js/spec/views/eventsV2/results.spec.jsx b/tests/js/spec/views/eventsV2/results.spec.jsx index 2390dd0e81246f..0f0f2f270d9b97 100644 --- a/tests/js/spec/views/eventsV2/results.spec.jsx +++ b/tests/js/spec/views/eventsV2/results.spec.jsx @@ -20,11 +20,9 @@ const FIELDS = [ }, ]; -const generateFields = () => { - return { - field: FIELDS.map(i => i.field), - }; -}; +const generateFields = () => ({ + field: FIELDS.map(i => i.field), +}); describe('EventsV2 > Results', function() { const eventTitle = 'Oh no something bad'; diff --git a/tests/js/spec/views/eventsV2/tags.spec.jsx b/tests/js/spec/views/eventsV2/tags.spec.jsx index 540dc4eb7b7beb..b6910f045af60a 100644 --- a/tests/js/spec/views/eventsV2/tags.spec.jsx +++ b/tests/js/spec/views/eventsV2/tags.spec.jsx @@ -97,9 +97,7 @@ describe('Tags', function() { const environmentFacetMap = wrapper .find('TagDistributionMeter') - .filterWhere(component => { - return component.props().title === 'environment'; - }) + .filterWhere(component => component.props().title === 'environment') .first(); const clickable = environmentFacetMap.find('Segment').first(); diff --git a/tests/js/spec/views/organizationGroupDetails/groupEventDetails.spec.jsx b/tests/js/spec/views/organizationGroupDetails/groupEventDetails.spec.jsx index dc3c0e160e1b2a..5c787d814bf16e 100644 --- a/tests/js/spec/views/organizationGroupDetails/groupEventDetails.spec.jsx +++ b/tests/js/spec/views/organizationGroupDetails/groupEventDetails.spec.jsx @@ -333,8 +333,8 @@ describe('groupEventDetails', () => { let wrapper; // eslint-disable-line let componentsRequest; - const mountWithThemeWrapper = () => { - return mountWithTheme( + const mountWithThemeWrapper = () => + mountWithTheme( { />, routerContext ); - }; beforeEach(() => { const unpublishedIntegration = TestStubs.SentryApp({status: 'unpublished'}); diff --git a/tests/js/spec/views/organizationIntegrations/integrationDetailedView.spec.jsx b/tests/js/spec/views/organizationIntegrations/integrationDetailedView.spec.jsx index 715ad0059e520a..5be9150eb32201 100644 --- a/tests/js/spec/views/organizationIntegrations/integrationDetailedView.spec.jsx +++ b/tests/js/spec/views/organizationIntegrations/integrationDetailedView.spec.jsx @@ -5,12 +5,12 @@ import {mountWithTheme} from 'sentry-test/enzyme'; import IntegrationDetailedView from 'app/views/organizationIntegrations/integrationDetailedView'; const mockResponse = mocks => { - mocks.forEach(([url, body]) => { - return Client.addMockResponse({ + mocks.forEach(([url, body]) => + Client.addMockResponse({ url, body, - }); - }); + }) + ); }; describe('IntegrationDetailedView', function() { diff --git a/tests/js/spec/views/organizationIntegrations/integrationListDirectory.spec.jsx b/tests/js/spec/views/organizationIntegrations/integrationListDirectory.spec.jsx index c99d4e176232d0..0d10cc7ee6e944 100644 --- a/tests/js/spec/views/organizationIntegrations/integrationListDirectory.spec.jsx +++ b/tests/js/spec/views/organizationIntegrations/integrationListDirectory.spec.jsx @@ -5,12 +5,12 @@ import {mountWithTheme} from 'sentry-test/enzyme'; import IntegrationListDirectory from 'app/views/organizationIntegrations/integrationListDirectory'; const mockResponse = mocks => { - mocks.forEach(([url, body]) => { - return Client.addMockResponse({ + mocks.forEach(([url, body]) => + Client.addMockResponse({ url, body, - }); - }); + }) + ); }; describe('IntegrationListDirectory', function() { @@ -319,9 +319,9 @@ describe('IntegrationListDirectory', function() { }); it('shows legacy plugin that has a First Party Integration if installed', async function() { - const legacyPluginRow = wrapper.find('IntegrationRow').filterWhere(node => { - return node.props().displayName === 'PagerDuty (Legacy)'; - }); + const legacyPluginRow = wrapper + .find('IntegrationRow') + .filterWhere(node => node.props().displayName === 'PagerDuty (Legacy)'); expect(legacyPluginRow).toHaveLength(1); }); diff --git a/tests/js/spec/views/organizationIntegrations/pluginDetailedView.spec.js b/tests/js/spec/views/organizationIntegrations/pluginDetailedView.spec.js index 7521da31c35121..0df2f18ef52778 100644 --- a/tests/js/spec/views/organizationIntegrations/pluginDetailedView.spec.js +++ b/tests/js/spec/views/organizationIntegrations/pluginDetailedView.spec.js @@ -6,12 +6,12 @@ import PluginDetailedView from 'app/views/organizationIntegrations/pluginDetaile import * as modal from 'app/actionCreators/modal'; const mockResponse = mocks => { - mocks.forEach(([url, body]) => { - return Client.addMockResponse({ + mocks.forEach(([url, body]) => + Client.addMockResponse({ url, body, - }); - }); + }) + ); }; describe('PluginDetailedView', function() { diff --git a/tests/js/spec/views/organizationIntegrations/sentryAppDetailedView.spec.jsx b/tests/js/spec/views/organizationIntegrations/sentryAppDetailedView.spec.jsx index b3f38e12548c92..8ca83d5312d427 100644 --- a/tests/js/spec/views/organizationIntegrations/sentryAppDetailedView.spec.jsx +++ b/tests/js/spec/views/organizationIntegrations/sentryAppDetailedView.spec.jsx @@ -7,13 +7,13 @@ import {initializeOrg} from 'sentry-test/initializeOrg'; import SentryAppDetailedView from 'app/views/organizationIntegrations/sentryAppDetailedView'; const mockResponse = mocks => { - mocks.forEach(([url, body, method = 'GET']) => { - return Client.addMockResponse({ + mocks.forEach(([url, body, method = 'GET']) => + Client.addMockResponse({ url, body, method, - }); - }); + }) + ); }; describe('SentryAppDetailedView', function() { diff --git a/tests/js/spec/views/projectFilters.spec.jsx b/tests/js/spec/views/projectFilters.spec.jsx index b6071d6a42d80e..558f2c5fb85634 100644 --- a/tests/js/spec/views/projectFilters.spec.jsx +++ b/tests/js/spec/views/projectFilters.spec.jsx @@ -11,12 +11,11 @@ describe('ProjectFilters', function() { const getFilterEndpoint = filter => `${PROJECT_URL}filters/${filter}/`; - const createFilterMock = filter => { - return MockApiClient.addMockResponse({ + const createFilterMock = filter => + MockApiClient.addMockResponse({ url: getFilterEndpoint(filter), method: 'PUT', }); - }; const creator = custom => { if (custom) { @@ -214,8 +213,8 @@ describe('ProjectFilters', function() { }); it('has custom inbound filters with flag + can change', function() { - wrapper = creator(() => { - return mountWithTheme( + wrapper = creator(() => + mountWithTheme( { const debounceMap = new Map(); - const mockDebounce = (fn, timeout) => { - return (...args) => { - if (debounceMap.has(fn)) { - clearTimeout(debounceMap.get(fn)); - } - debounceMap.set( - fn, - setTimeout(() => { - fn.apply(fn, args); - debounceMap.delete(fn); - }, timeout) - ); - }; + const mockDebounce = (fn, timeout) => (...args) => { + if (debounceMap.has(fn)) { + clearTimeout(debounceMap.get(fn)); + } + debounceMap.set( + fn, + setTimeout(() => { + fn.apply(fn, args); + debounceMap.delete(fn); + }, timeout) + ); }; return mockDebounce; }); diff --git a/tests/js/spec/views/settings/organizationDeveloperSettings/permissionSelection.spec.jsx b/tests/js/spec/views/settings/organizationDeveloperSettings/permissionSelection.spec.jsx index 43d279e0b1063f..0b1ee43cf6bd3b 100644 --- a/tests/js/spec/views/settings/organizationDeveloperSettings/permissionSelection.spec.jsx +++ b/tests/js/spec/views/settings/organizationDeveloperSettings/permissionSelection.spec.jsx @@ -79,9 +79,7 @@ describe('PermissionSelection', () => { }); it('stores the permissions the User has selected', () => { - const getStateValue = resource => { - return wrapper.instance().state.permissions[resource]; - }; + const getStateValue = resource => wrapper.instance().state.permissions[resource]; selectByValue(wrapper, 'write', {name: 'Project--permission'}); selectByValue(wrapper, 'read', {name: 'Team--permission'}); diff --git a/tests/js/spec/views/settings/organizationMembers/organizationMemberDetail.spec.jsx b/tests/js/spec/views/settings/organizationMembers/organizationMemberDetail.spec.jsx index a2d26d236ca63f..d5bce4e5203838 100644 --- a/tests/js/spec/views/settings/organizationMembers/organizationMemberDetail.spec.jsx +++ b/tests/js/spec/views/settings/organizationMembers/organizationMemberDetail.spec.jsx @@ -367,12 +367,12 @@ describe('OrganizationMemberDetail', function() { }); it('can reset member 2FA', function() { - const deleteMocks = has2fa.user.authenticators.map(auth => { - return MockApiClient.addMockResponse({ + const deleteMocks = has2fa.user.authenticators.map(auth => + MockApiClient.addMockResponse({ url: `/users/${has2fa.user.id}/authenticators/${auth.id}/`, method: 'DELETE', - }); - }); + }) + ); wrapper = mountWithTheme( ,