From 11915e2ac7a83034deedc232ae48cf2467b69784 Mon Sep 17 00:00:00 2001 From: Valentin Rigal Date: Thu, 20 Jun 2024 15:51:28 +0200 Subject: [PATCH] Run linter --- tests/ui/job-view/Filtering_test.jsx | 8 +- tests/ui/job-view/Push_test.jsx | 3 +- tests/ui/job-view/details/PinBoard_test.jsx | 8 +- .../ui/perfherder/alerts-view/alerts_test.jsx | 42 +-- .../compare-view/compare_table_test.jsx | 12 +- .../graphs-view/graphs_view_test.jsx | 16 +- tests/ui/perfherder/replicates_graph_test.jsx | 102 +----- .../push-health/details/DetailsPanel_test.jsx | 3 +- ui/helpers/job.js | 3 +- ui/helpers/performance.js | 1 - ui/helpers/revision.js | 2 +- ui/helpers/sort.js | 1 - ui/helpers/taskcluster.js | 1 - ui/helpers/utils.js | 2 - ui/infra-compare/InfraCompareTableView.jsx | 17 +- ui/intermittent-failures/MainView.jsx | 8 +- ui/intermittent-failures/constants.js | 1 - ui/job-view/App.jsx | 7 +- ui/job-view/CustomJobActions.jsx | 8 +- ui/job-view/details/PinBoard.jsx | 32 +- ui/job-view/details/summary/ActionBar.jsx | 41 +-- ui/job-view/details/summary/LogItem.jsx | 9 +- ui/job-view/details/tabs/AnnotationsTab.jsx | 7 +- ui/job-view/details/tabs/PerformanceTab.jsx | 25 +- ui/job-view/details/tabs/SimilarJobsTab.jsx | 6 +- ui/job-view/details/tabs/TabsPanel.jsx | 5 +- ui/job-view/pushes/PushActionMenu.jsx | 9 +- ui/job-view/pushes/PushList.jsx | 8 +- ui/logviewer/App.jsx | 5 +- ui/models/bugJobMap.js | 9 +- ui/models/classification.js | 11 +- ui/models/job.js | 8 +- ui/models/perfSeries.js | 17 +- ui/perfherder/Validation.jsx | 344 +++++++++--------- ui/perfherder/alerts/AlertModal.jsx | 10 +- ui/perfherder/alerts/AlertTable.jsx | 19 +- ui/perfherder/alerts/Assignee.jsx | 5 +- .../CompareSubtestDistributionView.jsx | 16 +- ui/perfherder/compare/CompareSubtestsView.jsx | 8 +- ui/perfherder/compare/CompareTable.jsx | 6 +- ui/perfherder/compare/CompareTableView.jsx | 8 +- ui/perfherder/compare/CompareView.jsx | 8 +- ui/perfherder/compare/ReplicatesGraph.jsx | 9 +- ui/perfherder/compare/RetriggerModal.jsx | 7 +- ui/perfherder/compare/SelectorCard.jsx | 17 +- ui/perfherder/graphs/TableView.jsx | 18 +- ui/perfherder/perf-helpers/textualSummary.js | 10 +- ui/perfherder/tests/TestsTableControls.jsx | 8 +- ui/push-health/PlatformConfig.jsx | 9 +- ui/push-health/Test.jsx | 7 +- ui/push-health/details/DetailsPanel.jsx | 8 +- ui/shared/BugFiler.jsx | 10 +- ui/shared/HelpMenu.jsx | 6 +- ui/shared/JobArtifacts.jsx | 8 +- ui/shared/auth/AuthService.js | 2 - 55 files changed, 341 insertions(+), 639 deletions(-) diff --git a/tests/ui/job-view/Filtering_test.jsx b/tests/ui/job-view/Filtering_test.jsx index 85dcce7a1eb..dd6e6e2f397 100644 --- a/tests/ui/job-view/Filtering_test.jsx +++ b/tests/ui/job-view/Filtering_test.jsx @@ -468,12 +468,8 @@ describe('Filtering', () => { }); test('Filters | Reset should get back to original set of jobs', async () => { - const { - getAllByText, - findAllByText, - findByText, - queryAllByText, - } = render(testApp()); + const { getAllByText, findAllByText, findByText, queryAllByText } = + render(testApp()); const symbolToRemove = 'yaml'; await findAllByText('B'); diff --git a/tests/ui/job-view/Push_test.jsx b/tests/ui/job-view/Push_test.jsx index 5c5a8789cd5..2c3a91090d1 100644 --- a/tests/ui/job-view/Push_test.jsx +++ b/tests/ui/job-view/Push_test.jsx @@ -71,8 +71,7 @@ describe('Transformations', () => { expected: 'devtools/client/framework/browser-toolbox/test/browser.ini', }, { - path: - 'devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js', + path: 'devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js', expected: 'devtools/client/framework/browser-toolbox/test/browser_browser_toolbox.js', }, diff --git a/tests/ui/job-view/details/PinBoard_test.jsx b/tests/ui/job-view/details/PinBoard_test.jsx index 512dcf61ced..4922cc479ac 100644 --- a/tests/ui/job-view/details/PinBoard_test.jsx +++ b/tests/ui/job-view/details/PinBoard_test.jsx @@ -262,12 +262,8 @@ describe('DetailsPanel', () => { }); test('classify and unclassify all jobs', async () => { - const { - getByPlaceholderText, - getByText, - getByTitle, - queryAllByTitle, - } = render(testDetailsPanel()); + const { getByPlaceholderText, getByText, getByTitle, queryAllByTitle } = + render(testDetailsPanel()); store.dispatch(pinJobs(jobList.data)); store.dispatch(setSelectedJob(jobList.data[1], true)); diff --git a/tests/ui/perfherder/alerts-view/alerts_test.jsx b/tests/ui/perfherder/alerts-view/alerts_test.jsx index 48a43b9030b..4aff039e0c7 100644 --- a/tests/ui/perfherder/alerts-view/alerts_test.jsx +++ b/tests/ui/perfherder/alerts-view/alerts_test.jsx @@ -467,11 +467,8 @@ test("'Take' button hides when clicking on 'Unassigned' badge", async () => { alertSummary.assignee_email = 'test_user@mozilla.com'; alertSummary.assignee_username = 'mozilla-ldap/test_user@mozilla.com'; - const { - getByText, - queryByText, - queryByPlaceholderText, - } = alertsViewControls(); + const { getByText, queryByText, queryByPlaceholderText } = + alertsViewControls(); const unassignedBadge = await waitFor(() => getByText('Unassigned')); @@ -659,11 +656,8 @@ const assertAlertsAreInOrder = async (alertsInOrder, alertTableRows) => { }; test(`table data can be sorted in descending order by 'Test'`, async () => { - const { - getAllByLabelText, - getByTestId, - getAllByTitle, - } = alertsViewControls(); + const { getAllByLabelText, getByTestId, getAllByTitle } = + alertsViewControls(); let alertTableRows = await waitFor(() => getAllByLabelText('Alert table row'), @@ -698,11 +692,8 @@ test(`table data can be sorted in descending order by 'Test'`, async () => { }); test(`table data can be sorted in ascending order by 'Platform'`, async () => { - const { - getByTestId, - getAllByLabelText, - getAllByTitle, - } = alertsViewControls(); + const { getByTestId, getAllByLabelText, getAllByTitle } = + alertsViewControls(); let alertTableRows = await waitFor(() => getAllByLabelText('Alert table row'), @@ -744,11 +735,8 @@ test(`table data cannot be sorted by 'Tags & Options'`, async () => { }); test(`table data can be sorted in ascending order by 'Confidence'`, async () => { - const { - getAllByLabelText, - getByTestId, - getAllByTitle, - } = alertsViewControls(); + const { getAllByLabelText, getByTestId, getAllByTitle } = + alertsViewControls(); let alertTableRows = await waitFor(() => getAllByLabelText('Alert table row'), @@ -780,11 +768,8 @@ test(`table data can be sorted in ascending order by 'Confidence'`, async () => }); test(`table data can be sorted in ascending order by 'Magnitude of Change'`, async () => { - const { - getAllByLabelText, - getByTestId, - getAllByTitle, - } = alertsViewControls(); + const { getAllByLabelText, getByTestId, getAllByTitle } = + alertsViewControls(); let alertTableRows = await waitFor(() => getAllByLabelText('Alert table row'), @@ -817,11 +802,8 @@ test(`table data can be sorted in ascending order by 'Magnitude of Change'`, asy }); test('Data can be sorted only by one column', async () => { - const { - getAllByLabelText, - getByTestId, - getAllByTitle, - } = alertsViewControls(); + const { getAllByLabelText, getByTestId, getAllByTitle } = + alertsViewControls(); let alertTableRows = await waitFor(() => getAllByLabelText('Alert table row'), diff --git a/tests/ui/perfherder/compare-view/compare_table_test.jsx b/tests/ui/perfherder/compare-view/compare_table_test.jsx index c4f22527e1e..69c9300076c 100644 --- a/tests/ui/perfherder/compare-view/compare_table_test.jsx +++ b/tests/ui/perfherder/compare-view/compare_table_test.jsx @@ -343,9 +343,8 @@ test('filters that are not enabled are removed from URL params', async () => { }); test('page parameter updates with value 2 when clicking on the second page', async () => { - const { getByText, findAllByLabelText } = compareTableControls( - compareResults, - ); + const { getByText, findAllByLabelText } = + compareTableControls(compareResults); const result1 = await waitFor(() => getByText(compareTablesControlsResults[0].name), @@ -374,11 +373,8 @@ test('page parameter updates with value 2 when clicking on the second page', asy }); test('text input filter results should differ when filter button(s) are selected', async () => { - const { - getByText, - getByPlaceholderText, - queryByText, - } = compareTableControls(); + const { getByText, getByPlaceholderText, queryByText } = + compareTableControls(); const result1 = await waitFor(() => getByText(result[0].name)); const result2 = await waitFor(() => getByText(result[1].name)); diff --git a/tests/ui/perfherder/graphs-view/graphs_view_test.jsx b/tests/ui/perfherder/graphs-view/graphs_view_test.jsx index 1a6b943584f..49e13f92001 100644 --- a/tests/ui/perfherder/graphs-view/graphs_view_test.jsx +++ b/tests/ui/perfherder/graphs-view/graphs_view_test.jsx @@ -215,12 +215,8 @@ test('Using select query param displays tooltip for correct datapoint', async () }); test('InputFilter from TestDataModal can filter by application name', async () => { - const { - getByText, - getByTestId, - getByPlaceholderText, - getByTitle, - } = graphsViewControls(); + const { getByText, getByTestId, getByPlaceholderText, getByTitle } = + graphsViewControls(); const { name, application, projectName, platform } = seriesData[0]; const fullTestName = projectName.concat( @@ -250,12 +246,8 @@ test('InputFilter from TestDataModal can filter by application name', async () = test('Changing the platform dropdown while filtered by text in the Test Data Modal displays expected tests', async () => { mockShowModal.mockClear(); - const { - getByText, - getByPlaceholderText, - getByTitle, - getByTestId, - } = graphsViewControls(); + const { getByText, getByPlaceholderText, getByTitle, getByTestId } = + graphsViewControls(); fireEvent.click(getByText('Add test data')); diff --git a/tests/ui/perfherder/replicates_graph_test.jsx b/tests/ui/perfherder/replicates_graph_test.jsx index 3bd98184e65..187434bbea5 100644 --- a/tests/ui/perfherder/replicates_graph_test.jsx +++ b/tests/ui/perfherder/replicates_graph_test.jsx @@ -23,31 +23,8 @@ const mockedReplicateData = { lowerIsBetter: true, name: SUBTEST_NAME, replicates: [ - 500, - 345, - 366, - 358, - 355, - 365, - 354, - 354, - 363, - 360, - 389, - 357, - 273, - 376, - 350, - 381, - 373, - 356, - 351, - 348, - 271, - 354, - 351, - 360, - 385, + 500, 345, 366, 358, 355, 365, 354, 354, 363, 360, 389, 357, 273, + 376, 350, 381, 373, 356, 351, 348, 271, 354, 351, 360, 385, ], shouldAlert: false, unit: 'ms', @@ -58,31 +35,8 @@ const mockedReplicateData = { lowerIsBetter: true, name: 'tablemutation.html', replicates: [ - 89, - 88, - 90, - 83, - 87, - 87, - 88, - 86, - 85, - 84, - 85, - 88, - 102, - 83, - 100, - 86, - 100, - 80, - 87, - 88, - 82, - 85, - 84, - 83, - 86, + 89, 88, 90, 83, 87, 87, 88, 86, 85, 84, 85, 88, 102, 83, 100, 86, + 100, 80, 87, 88, 82, 85, 84, 83, 86, ], shouldAlert: false, unit: 'ms', @@ -98,26 +52,8 @@ const mockedReplicateData = { { name: 'ts_paint', replicates: [ - 844, - 832, - 842, - 825, - 849, - 816, - 857, - 841, - 849, - 840, - 846, - 872, - 864, - 837, - 830, - 843, - 841, - 854, - 841, - 858, + 844, 832, 842, 825, 849, 816, 857, 841, 849, 840, 846, 872, 864, + 837, 830, 843, 841, 854, 841, 858, ], value: 842, }, @@ -134,26 +70,12 @@ const mockedReplicateData = { lowerIsBetter: true, name: '', replicates: [ - 552.9000000000001, - 561.6599999999999, - 558.1199999999999, - 565.0799999999999, - 554.94, - 599.9399999999998, - 600.9200000000001, - 559.22, - 552.0600000000002, - 559.4000000000001, - 603.0999999999999, - 586.4199999999998, - 587.3200000000002, - 606.3800000000001, - 587.1000000000001, - 592.9200000000001, - 542.9199999999998, - 553.98, - 556.4200000000001, - 576.0999999999999, + 552.9000000000001, 561.6599999999999, 558.1199999999999, + 565.0799999999999, 554.94, 599.9399999999998, 600.9200000000001, + 559.22, 552.0600000000002, 559.4000000000001, 603.0999999999999, + 586.4199999999998, 587.3200000000002, 606.3800000000001, + 587.1000000000001, 592.9200000000001, 542.9199999999998, 553.98, + 556.4200000000001, 576.0999999999999, ], shouldAlert: false, unit: 'ms', diff --git a/tests/ui/push-health/details/DetailsPanel_test.jsx b/tests/ui/push-health/details/DetailsPanel_test.jsx index 11b3173e7da..451ab34c54e 100644 --- a/tests/ui/push-health/details/DetailsPanel_test.jsx +++ b/tests/ui/push-health/details/DetailsPanel_test.jsx @@ -65,8 +65,7 @@ describe('DetailsPanel', () => { }, line_number: 18841, }, - line: - '22:42:53 INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js | Uncaught exception - at chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/helpers.js:358 - TypeError: can\'t access property "wrapClass", lineInfo is null', + line: '22:42:53 INFO - TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-sourcemaps.js | Uncaught exception - at chrome://mochitests/content/browser/devtools/client/debugger/test/mochitest/helpers.js:358 - TypeError: can\'t access property "wrapClass", lineInfo is null', line_number: 18841, }, ], diff --git a/ui/helpers/job.js b/ui/helpers/job.js index 4a32e9eabb8..ae0848b5d5a 100644 --- a/ui/helpers/job.js +++ b/ui/helpers/job.js @@ -237,7 +237,8 @@ export const getTaskRunStr = (job) => `${job.task_id}.${job.retry_id}`; // This matches as taskId, optionally followed by `.` or`-` and a runId. // We support `-` for backwards compatability with the original format used. -const taskRunPattern = /^([A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw])(?:[-.]([0-9]+))?$/; +const taskRunPattern = + /^([A-Za-z0-9_-]{8}[Q-T][A-Za-z0-9_-][CGKOSWaeimquy26-][A-Za-z0-9_-]{10}[AQgw])(?:[-.]([0-9]+))?$/; export const getTaskRun = function getTaskRun(taskRunStr) { const match = taskRunPattern.exec(taskRunStr); diff --git a/ui/helpers/performance.js b/ui/helpers/performance.js index 773c272c124..b859e9ddd5c 100644 --- a/ui/helpers/performance.js +++ b/ui/helpers/performance.js @@ -1,5 +1,4 @@ // This file may export additional functions. -/* eslint-disable import/prefer-default-export */ import TaskclusterModel from '../models/taskcluster'; diff --git a/ui/helpers/revision.js b/ui/helpers/revision.js index 370d755fb50..f6e50e82ff0 100644 --- a/ui/helpers/revision.js +++ b/ui/helpers/revision.js @@ -21,7 +21,7 @@ export const getRevisionTitle = function getRevisionTitle(revisions) { * Strip out unwanted things like additional lines, trychooser * syntax, request flags, mq cruft, whitespace, and punctuation */ - // eslint-disable-next-line prefer-destructuring + title = title.split('\n')[0]; title = title.replace(/\btry: .*/, ''); title = title.replace(/\b(r|sr|f|a)=.*/, ''); diff --git a/ui/helpers/sort.js b/ui/helpers/sort.js index 45d17cfa87c..6b64c013184 100644 --- a/ui/helpers/sort.js +++ b/ui/helpers/sort.js @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/prefer-default-export export const sortAlphaNum = (a, b) => { // Implement a better alphanumeric sort so that mochitest-10 // is sorted after mochitest 9, not mochitest-1 diff --git a/ui/helpers/taskcluster.js b/ui/helpers/taskcluster.js index e6e6c7b8cbd..ab9f70f0bd4 100644 --- a/ui/helpers/taskcluster.js +++ b/ui/helpers/taskcluster.js @@ -80,7 +80,6 @@ const taskcluster = (() => { userCredentials[_rootUrl] && moment(userCredentials[_rootUrl].expires).isAfter(moment()) ) { - // eslint-disable-next-line no-promise-executor-return return resolve(userCredentials[_rootUrl]); } diff --git a/ui/helpers/utils.js b/ui/helpers/utils.js index b901cfd6d4a..9e20da7ac1b 100644 --- a/ui/helpers/utils.js +++ b/ui/helpers/utils.js @@ -1,5 +1,3 @@ -/* eslint-disable no-bitwise */ - export const hashFunction = (someString) => { // Borrowed from https://github.com/darkskyapp/string-hash let hash = 5381; diff --git a/ui/infra-compare/InfraCompareTableView.jsx b/ui/infra-compare/InfraCompareTableView.jsx index bfb9b6358ca..984485060ad 100644 --- a/ui/infra-compare/InfraCompareTableView.jsx +++ b/ui/infra-compare/InfraCompareTableView.jsx @@ -66,12 +66,8 @@ export default class InfraCompareTableView extends React.Component { getInfraData = async () => { const { getQueryParams, getDisplayResults } = this.props; - const { - originalProject, - originalRevision, - newProject, - newRevision, - } = this.props.validated; + const { originalProject, originalRevision, newProject, newRevision } = + this.props.validated; const { timeRange, failureMessages } = this.state; this.setState({ loading: true }); @@ -143,13 +139,8 @@ export default class InfraCompareTableView extends React.Component { pageTitle, } = this.props.validated; const { jobsNotDisplayed } = this.props; - const { - compareResults, - loading, - failureMessages, - timeRange, - tabTitle, - } = this.state; + const { compareResults, loading, failureMessages, timeRange, tabTitle } = + this.state; const compareDropdowns = []; const params = { originalProject, diff --git a/ui/intermittent-failures/MainView.jsx b/ui/intermittent-failures/MainView.jsx index cce02dac95b..01d4ed3ef04 100644 --- a/ui/intermittent-failures/MainView.jsx +++ b/ui/intermittent-failures/MainView.jsx @@ -99,12 +99,8 @@ const MainView = (props) => { let totalRuns = 0; if (graphData.length) { - ({ - graphOneData, - graphTwoData, - totalFailures, - totalRuns, - } = calculateMetrics(graphData)); + ({ graphOneData, graphTwoData, totalFailures, totalRuns } = + calculateMetrics(graphData)); graphOneData = { all: graphOneData }; graphOneData.all[0].count = tableData.length; } diff --git a/ui/intermittent-failures/constants.js b/ui/intermittent-failures/constants.js index bc9a66c9461..a4c66a6743e 100644 --- a/ui/intermittent-failures/constants.js +++ b/ui/intermittent-failures/constants.js @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ export const treeOptions = [ 'all', 'trunk', diff --git a/ui/job-view/App.jsx b/ui/job-view/App.jsx index bfb3ad66ece..7a8cac4fc4e 100644 --- a/ui/job-view/App.jsx +++ b/ui/job-view/App.jsx @@ -128,11 +128,8 @@ class App extends React.Component { this.setState({ serverRev: revision }); this.updateInterval = setInterval(() => { this.fetchDeployedRevision().then((revision) => { - const { - serverChangedTimestamp, - serverRev, - serverChanged, - } = this.state; + const { serverChangedTimestamp, serverRev, serverChanged } = + this.state; if (serverChanged) { if ( diff --git a/ui/job-view/CustomJobActions.jsx b/ui/job-view/CustomJobActions.jsx index c4c9b9b913f..fd0d6550152 100644 --- a/ui/job-view/CustomJobActions.jsx +++ b/ui/job-view/CustomJobActions.jsx @@ -48,12 +48,8 @@ class CustomJobActions extends React.PureComponent { const { id: decisionTaskId } = decisionTaskMap[pushId]; TaskclusterModel.load(decisionTaskId, job, currentRepo).then((results) => { - const { - originalTask, - originalTaskId, - staticActionVariables, - actions, - } = results; + const { originalTask, originalTaskId, staticActionVariables, actions } = + results; if (actions.length) { const mappedActions = keyBy(actions, 'name'); diff --git a/ui/job-view/details/PinBoard.jsx b/ui/job-view/details/PinBoard.jsx index 45781bccd60..2f6259833f7 100644 --- a/ui/job-view/details/PinBoard.jsx +++ b/ui/job-view/details/PinBoard.jsx @@ -139,10 +139,8 @@ class PinBoard extends React.Component { createNewClassification = () => { const { email } = this.props; - const { - failureClassificationId, - failureClassificationComment, - } = this.props; + const { failureClassificationId, failureClassificationComment } = + this.props; return new JobClassificationModel({ text: failureClassificationComment, @@ -274,14 +272,12 @@ class PinBoard extends React.Component { recalculateUnclassifiedCounts, } = this.props; - const { - data, - failureStatus, - } = await JobClassificationTypeAndBugsModel.destroy( - Object.values(pinnedJobs), - currentRepo, - notify, - ); + const { data, failureStatus } = + await JobClassificationTypeAndBugsModel.destroy( + Object.values(pinnedJobs), + currentRepo, + notify, + ); if (!failureStatus) { for (const pinnedJob of Object.values(pinnedJobs)) { @@ -307,10 +303,8 @@ class PinBoard extends React.Component { canSaveClassifications = () => { const { pinnedJobBugs, isLoggedIn, currentRepo } = this.props; - const { - failureClassificationId, - failureClassificationComment, - } = this.props; + const { failureClassificationId, failureClassificationComment } = + this.props; return ( this.hasPinnedJobs() && @@ -328,10 +322,8 @@ class PinBoard extends React.Component { // Facilitates Clear all if no jobs pinned to reset pinBoard UI pinboardIsDirty = () => { - const { - failureClassificationId, - failureClassificationComment, - } = this.props; + const { failureClassificationId, failureClassificationComment } = + this.props; return ( failureClassificationComment !== '' || diff --git a/ui/job-view/details/summary/ActionBar.jsx b/ui/job-view/details/summary/ActionBar.jsx index 7ee0179859a..448bbfc64bf 100644 --- a/ui/job-view/details/summary/ActionBar.jsx +++ b/ui/job-view/details/summary/ActionBar.jsx @@ -95,12 +95,8 @@ class ActionBar extends React.PureComponent { }; createGeckoProfile = async () => { - const { - selectedJobFull, - notify, - decisionTaskMap, - currentRepo, - } = this.props; + const { selectedJobFull, notify, decisionTaskMap, currentRepo } = + this.props; return triggerTask( selectedJobFull, notify, @@ -111,12 +107,8 @@ class ActionBar extends React.PureComponent { }; createSideBySide = async () => { - const { - selectedJobFull, - notify, - decisionTaskMap, - currentRepo, - } = this.props; + const { selectedJobFull, notify, decisionTaskMap, currentRepo } = + this.props; await triggerTask( selectedJobFull, notify, @@ -145,12 +137,8 @@ class ActionBar extends React.PureComponent { }; backfillJob = async () => { - const { - selectedJobFull, - notify, - decisionTaskMap, - currentRepo, - } = this.props; + const { selectedJobFull, notify, decisionTaskMap, currentRepo } = + this.props; if (!this.canBackfill()) { return; @@ -197,12 +185,8 @@ class ActionBar extends React.PureComponent { }; confirmFailure = async () => { - const { - selectedJobFull, - notify, - decisionTaskMap, - currentRepo, - } = this.props; + const { selectedJobFull, notify, decisionTaskMap, currentRepo } = + this.props; const { id: decisionTaskId } = decisionTaskMap[selectedJobFull.push_id]; if (!canConfirmFailure(selectedJobFull)) { @@ -290,13 +274,8 @@ class ActionBar extends React.PureComponent { }; createInteractiveTask = async () => { - const { - user, - selectedJobFull, - notify, - decisionTaskMap, - currentRepo, - } = this.props; + const { user, selectedJobFull, notify, decisionTaskMap, currentRepo } = + this.props; const { id: decisionTaskId } = decisionTaskMap[selectedJobFull.push_id]; const results = await TaskclusterModel.load( diff --git a/ui/job-view/details/summary/LogItem.jsx b/ui/job-view/details/summary/LogItem.jsx index 14a7eef2373..d3aa47d6345 100644 --- a/ui/job-view/details/summary/LogItem.jsx +++ b/ui/job-view/details/summary/LogItem.jsx @@ -47,13 +47,8 @@ function getLogUrlProps(logKey, logUrl, logViewerUrl, logViewerFullUrl) { } export default function LogItem(props) { - const { - logUrls, - logViewerUrl, - logViewerFullUrl, - logKey, - logDescription, - } = props; + const { logUrls, logViewerUrl, logViewerFullUrl, logKey, logDescription } = + props; return (
  • diff --git a/ui/job-view/details/tabs/AnnotationsTab.jsx b/ui/job-view/details/tabs/AnnotationsTab.jsx index 7fdc23a354a..176a7a6e364 100644 --- a/ui/job-view/details/tabs/AnnotationsTab.jsx +++ b/ui/job-view/details/tabs/AnnotationsTab.jsx @@ -179,11 +179,8 @@ class AnnotationsTab extends React.Component { }; deleteClassification = async (classification) => { - const { - selectedJobFull, - recalculateUnclassifiedCounts, - notify, - } = this.props; + const { selectedJobFull, recalculateUnclassifiedCounts, notify } = + this.props; selectedJobFull.failure_classification_id = 1; recalculateUnclassifiedCounts(); diff --git a/ui/job-view/details/tabs/PerformanceTab.jsx b/ui/job-view/details/tabs/PerformanceTab.jsx index 6d08640547f..c76836b0945 100644 --- a/ui/job-view/details/tabs/PerformanceTab.jsx +++ b/ui/job-view/details/tabs/PerformanceTab.jsx @@ -40,12 +40,8 @@ class PerformanceTab extends React.PureComponent { } createGeckoProfile = async () => { - const { - selectedJobFull, - notify, - decisionTaskMap, - currentRepo, - } = this.props; + const { selectedJobFull, notify, decisionTaskMap, currentRepo } = + this.props; await triggerTask( selectedJobFull, notify, @@ -59,12 +55,8 @@ class PerformanceTab extends React.PureComponent { }; createSideBySide = async () => { - const { - selectedJobFull, - notify, - decisionTaskMap, - currentRepo, - } = this.props; + const { selectedJobFull, notify, decisionTaskMap, currentRepo } = + this.props; await triggerTask( selectedJobFull, notify, @@ -102,13 +94,8 @@ class PerformanceTab extends React.PureComponent { } render() { - const { - repoName, - revision, - selectedJobFull, - jobDetails, - perfJobDetail, - } = this.props; + const { repoName, revision, selectedJobFull, jobDetails, perfJobDetail } = + this.props; const { triggeredGeckoProfiles, showSideBySide } = this.state; const profilerLink = this.maybeGetFirefoxProfilerLink(); diff --git a/ui/job-view/details/tabs/SimilarJobsTab.jsx b/ui/job-view/details/tabs/SimilarJobsTab.jsx index b3cca3527a6..1fda1fb2181 100644 --- a/ui/job-view/details/tabs/SimilarJobsTab.jsx +++ b/ui/job-view/details/tabs/SimilarJobsTab.jsx @@ -48,10 +48,8 @@ class SimilarJobsTab extends React.Component { options.nosuccess = ''; } - const { - data: newSimilarJobs, - failureStatus, - } = await JobModel.getSimilarJobs(selectedJobFull.id, options); + const { data: newSimilarJobs, failureStatus } = + await JobModel.getSimilarJobs(selectedJobFull.id, options); if (!failureStatus) { this.setState({ hasNextPage: newSimilarJobs.length > this.pageSize }); diff --git a/ui/job-view/details/tabs/TabsPanel.jsx b/ui/job-view/details/tabs/TabsPanel.jsx index 49f2655e1a7..3be32867d26 100644 --- a/ui/job-view/details/tabs/TabsPanel.jsx +++ b/ui/job-view/details/tabs/TabsPanel.jsx @@ -78,8 +78,9 @@ class TabsPanel extends React.Component { onSelectNextTab = () => { const { tabIndex } = this.state; const nextIndex = tabIndex + 1; - const tabCount = TabsPanel.getTabNames(showTabsFromProps(this.props)) - .length; + const tabCount = TabsPanel.getTabNames( + showTabsFromProps(this.props), + ).length; this.setState({ tabIndex: nextIndex < tabCount ? nextIndex : 0 }); }; diff --git a/ui/job-view/pushes/PushActionMenu.jsx b/ui/job-view/pushes/PushActionMenu.jsx index cfeb460a0a6..56777e78a15 100644 --- a/ui/job-view/pushes/PushActionMenu.jsx +++ b/ui/job-view/pushes/PushActionMenu.jsx @@ -43,13 +43,8 @@ class PushActionMenu extends React.PureComponent { }; triggerMissingJobs = () => { - const { - notify, - revision, - pushId, - currentRepo, - decisionTaskMap, - } = this.props; + const { notify, revision, pushId, currentRepo, decisionTaskMap } = + this.props; const decisionTask = decisionTaskMap[pushId]; if ( diff --git a/ui/job-view/pushes/PushList.jsx b/ui/job-view/pushes/PushList.jsx index 5f060d41ac8..ba9c5c901f1 100644 --- a/ui/job-view/pushes/PushList.jsx +++ b/ui/job-view/pushes/PushList.jsx @@ -36,12 +36,8 @@ class PushList extends React.Component { } componentDidUpdate(prevProps) { - const { - notify, - jobMap, - jobsLoaded, - setSelectedJobFromQueryString, - } = this.props; + const { notify, jobMap, jobsLoaded, setSelectedJobFromQueryString } = + this.props; if (jobsLoaded && jobsLoaded !== prevProps.jobsLoaded) { setSelectedJobFromQueryString(notify, jobMap); diff --git a/ui/logviewer/App.jsx b/ui/logviewer/App.jsx index fe6de43f3ad..64e1402f1ae 100644 --- a/ui/logviewer/App.jsx +++ b/ui/logviewer/App.jsx @@ -214,9 +214,8 @@ class App extends React.PureComponent { selectedLogText = window.getSelection().toString().trim(); } - const descriptionField = window.opener.document.getElementById( - 'summary-input', - ); + const descriptionField = + window.opener.document.getElementById('summary-input'); const startPos = descriptionField.selectionStart; const endPos = descriptionField.selectionEnd; descriptionField.value = diff --git a/ui/models/bugJobMap.js b/ui/models/bugJobMap.js index 9274695c1e5..bc22a490caf 100644 --- a/ui/models/bugJobMap.js +++ b/ui/models/bugJobMap.js @@ -11,10 +11,11 @@ export default class BugJobMapModel { // the options parameter is used to filter/limit the list of objects static getList(options) { - return fetch( - `${getProjectUrl(uri)}${createQueryParams(options)}`, - ).then((resp) => - resp.json().then((data) => data.map((elem) => new BugJobMapModel(elem))), + return fetch(`${getProjectUrl(uri)}${createQueryParams(options)}`).then( + (resp) => + resp + .json() + .then((data) => data.map((elem) => new BugJobMapModel(elem))), ); } diff --git a/ui/models/classification.js b/ui/models/classification.js index 540eedb7efd..f3dc38506e6 100644 --- a/ui/models/classification.js +++ b/ui/models/classification.js @@ -11,12 +11,11 @@ export default class JobClassificationModel { } static getList(params) { - return fetch( - `${getProjectUrl(uri)}${createQueryParams(params)}`, - ).then((resp) => - resp - .json() - .then((data) => data.map((elem) => new JobClassificationModel(elem))), + return fetch(`${getProjectUrl(uri)}${createQueryParams(params)}`).then( + (resp) => + resp + .json() + .then((data) => data.map((elem) => new JobClassificationModel(elem))), ); } diff --git a/ui/models/job.js b/ui/models/job.js index 06578296384..e3b891a8bce 100644 --- a/ui/models/job.js +++ b/ui/models/job.js @@ -36,10 +36,8 @@ export default class JobModel { if (fetchAll && nextUrl) { const page = new URLSearchParams(nextUrl.split('?')[1]).get('page'); const newOptions = { ...options, page }; - const { - data: nextData, - failureStatus: nextFailureStatus, - } = await JobModel.getList(newOptions, config); + const { data: nextData, failureStatus: nextFailureStatus } = + await JobModel.getList(newOptions, config); if (!nextFailureStatus) { nextPagesJobs = nextData; @@ -221,7 +219,6 @@ export default class JobModel { try { notify(`Attempting to cancel selected ${jobTerm} via actions.json`); - /* eslint-disable no-await-in-loop */ for (const job of jobs) { const decisionTaskId = taskIdMap[job.push_id].id; let results; @@ -254,7 +251,6 @@ export default class JobModel { notify(formatTaskclusterError(e), 'danger', { sticky: true }); } } - /* eslint-enable no-await-in-loop */ notify(`Request sent to cancel ${jobTerm} via action.json`, 'success'); } catch (e) { diff --git a/ui/models/perfSeries.js b/ui/models/perfSeries.js index 07791a652d4..162234f7b00 100644 --- a/ui/models/perfSeries.js +++ b/ui/models/perfSeries.js @@ -99,15 +99,14 @@ export default class PerfSeriesModel { if (response.failureStatus) { return response; } - const data = Object.entries( - response.data, - ).map(([signatureId, signatureProps]) => - getSeriesSummary( - projectName, - signatureId, - signatureProps, - this.optionCollectionMap, - ), + const data = Object.entries(response.data).map( + ([signatureId, signatureProps]) => + getSeriesSummary( + projectName, + signatureId, + signatureProps, + this.optionCollectionMap, + ), ); return { data, failureStatus: null }; } diff --git a/ui/perfherder/Validation.jsx b/ui/perfherder/Validation.jsx index 7ce54285181..c29917271b5 100644 --- a/ui/perfherder/Validation.jsx +++ b/ui/perfherder/Validation.jsx @@ -9,208 +9,210 @@ import LoadingSpinner from '../shared/LoadingSpinner'; import { summaryStatusMap } from './perf-helpers/constants'; -const withValidation = ({ requiredParams }, verifyRevisions = true) => ( - WrappedComponent, -) => { - class Validation extends React.Component { - constructor(props) { - super(props); - - this.state = { - originalProject: null, - newProject: null, - originalRevision: null, - newRevision: null, - originalSignature: null, - newSignature: null, - errorMessages: [], - originalResultSet: null, - newResultSet: null, - selectedTimeRange: null, - framework: null, - validationComplete: false, - }; - } +const withValidation = + ({ requiredParams }, verifyRevisions = true) => + (WrappedComponent) => { + class Validation extends React.Component { + constructor(props) { + super(props); + + this.state = { + originalProject: null, + newProject: null, + originalRevision: null, + newRevision: null, + originalSignature: null, + newSignature: null, + errorMessages: [], + originalResultSet: null, + newResultSet: null, + selectedTimeRange: null, + framework: null, + validationComplete: false, + }; + } - async componentDidMount() { - this.validateParams(parseQueryParams(this.props.history.location.search)); - } + async componentDidMount() { + this.validateParams( + parseQueryParams(this.props.history.location.search), + ); + } - componentDidUpdate(prevProps) { - const { history } = this.props; + componentDidUpdate(prevProps) { + const { history } = this.props; - // Using location instead of history requires an extra click when - // using the back button to go back to previous location - if (history.location.search !== prevProps.history.location.search) { - // delete from state params the ones - this.validateParams(parseQueryParams(history.location.search)); + // Using location instead of history requires an extra click when + // using the back button to go back to previous location + if (history.location.search !== prevProps.history.location.search) { + // delete from state params the ones + this.validateParams(parseQueryParams(history.location.search)); + } } - } - updateParams = (params, paramsToBeRemoved = []) => { - const { history, location } = this.props; + updateParams = (params, paramsToBeRemoved = []) => { + const { history, location } = this.props; - const newParams = { - ...parseQueryParams(location.search), - ...params, + const newParams = { + ...parseQueryParams(location.search), + ...params, + }; + if (paramsToBeRemoved.length !== 0) + paramsToBeRemoved.forEach((param) => { + delete newParams[param]; + }); + const queryString = createQueryParams(newParams); + history.push({ search: queryString }); }; - if (paramsToBeRemoved.length !== 0) - paramsToBeRemoved.forEach((param) => { - delete newParams[param]; - }); - const queryString = createQueryParams(newParams); - history.push({ search: queryString }); - }; - errorMessage = (param, value) => `${param} ${value} is not valid`; + errorMessage = (param, value) => `${param} ${value} is not valid`; - findParam = (param, value, list, errors) => { - const valid = list.find((item) => item.name || item === value); + findParam = (param, value, list, errors) => { + const valid = list.find((item) => item.name || item === value); - if (valid === undefined) { - errors.push(this.errorMessage(param, value)); - } - return errors; - }; + if (valid === undefined) { + errors.push(this.errorMessage(param, value)); + } + return errors; + }; - async checkRevisions(params) { - if (!params.originalRevision) { - const newResultResponse = await this.verifyRevision( - params.newProject, - params.newRevision, - 'newResultSet', - ); - return this.setState({ + async checkRevisions(params) { + if (!params.originalRevision) { + const newResultResponse = await this.verifyRevision( + params.newProject, + params.newRevision, + 'newResultSet', + ); + return this.setState({ + ...params, + ...newResultResponse, + validationComplete: true, + }); + } + const [newResultResponse, origResultResponse] = await Promise.all([ + this.verifyRevision( + params.newProject, + params.newRevision, + 'newResultSet', + ), + this.verifyRevision( + params.originalProject, + params.originalRevision, + 'originalResultSet', + ), + ]); + + this.setState({ ...params, ...newResultResponse, + ...origResultResponse, validationComplete: true, }); } - const [newResultResponse, origResultResponse] = await Promise.all([ - this.verifyRevision( - params.newProject, - params.newRevision, - 'newResultSet', - ), - this.verifyRevision( - params.originalProject, - params.originalRevision, - 'originalResultSet', - ), - ]); - - this.setState({ - ...params, - ...newResultResponse, - ...origResultResponse, - validationComplete: true, - }); - } - - async verifyRevision(project, revision, resultSetName) { - const { data, failureStatus } = await PushModel.getList({ - repo: project, - commit_revision: revision, - }); - if (failureStatus) { - return { - errorMessages: [`Error fetching revision ${revision}: ${data}`], - }; - } - if (!data.results.length) { - return { - errorMessages: [`No results found for revision ${revision}`], - }; - } - - return { [resultSetName]: data.results[0] }; - } - - validateParams(params) { - const { projects, frameworks } = this.props; - let errors = []; + async verifyRevision(project, revision, resultSetName) { + const { data, failureStatus } = await PushModel.getList({ + repo: project, + commit_revision: revision, + }); - for (const [param, value] of Object.entries(params)) { - if (!value && requiredParams.has(param)) { - errors.push(`${param} is required`); - continue; + if (failureStatus) { + return { + errorMessages: [`Error fetching revision ${revision}: ${data}`], + }; } - - if (value === 'undefined') { - errors.push(this.errorMessage(param, value)); - continue; + if (!data.results.length) { + return { + errorMessages: [`No results found for revision ${revision}`], + }; } - if (param.indexOf('Project') !== -1 && projects.length) { - errors = this.findParam(param, value, projects, errors); - } + return { [resultSetName]: data.results[0] }; + } - if (param === 'framework' && value && frameworks.length) { - errors = this.findParam(param, value, frameworks, errors); + validateParams(params) { + const { projects, frameworks } = this.props; + let errors = []; + + for (const [param, value] of Object.entries(params)) { + if (!value && requiredParams.has(param)) { + errors.push(`${param} is required`); + continue; + } + + if (value === 'undefined') { + errors.push(this.errorMessage(param, value)); + continue; + } + + if (param.indexOf('Project') !== -1 && projects.length) { + errors = this.findParam(param, value, projects, errors); + } + + if (param === 'framework' && value && frameworks.length) { + errors = this.findParam(param, value, frameworks, errors); + } + + if (param === 'status' && value) { + errors = this.findParam( + param, + parseInt(value, 10), + Object.values(summaryStatusMap), + errors, + ); + } } - if (param === 'status' && value) { - errors = this.findParam( - param, - parseInt(value, 10), - Object.values(summaryStatusMap), - errors, - ); + if (errors.length) { + return this.setState({ errorMessages: errors }); } + if (verifyRevisions) { + return this.checkRevisions(params); + } + this.setState( + { + ...params, + validationComplete: true, + }, + this.updateParams({ ...params }), + ); } - if (errors.length) { - return this.setState({ errorMessages: errors }); - } - if (verifyRevisions) { - return this.checkRevisions(params); + render() { + const updateParams = { updateParams: this.updateParams }; + const removeParams = { removeParams: this.removeParams }; + const validatedProps = { + ...this.state, + ...updateParams, + ...removeParams, + }; + const { validationComplete, errorMessages } = this.state; + + return ( + + {!validationComplete && errorMessages.length === 0 && ( + + )} + + {errorMessages.length > 0 && ( + + + + )} + + {validationComplete && !errorMessages.length && ( + + )} + + ); } - this.setState( - { - ...params, - validationComplete: true, - }, - this.updateParams({ ...params }), - ); } - render() { - const updateParams = { updateParams: this.updateParams }; - const removeParams = { removeParams: this.removeParams }; - const validatedProps = { - ...this.state, - ...updateParams, - ...removeParams, - }; - const { validationComplete, errorMessages } = this.state; - - return ( - - {!validationComplete && errorMessages.length === 0 && ( - - )} - - {errorMessages.length > 0 && ( - - - - )} - - {validationComplete && !errorMessages.length && ( - - )} - - ); - } - } + Validation.propTypes = { + location: PropTypes.shape({}).isRequired, + history: PropTypes.shape({}).isRequired, + }; - Validation.propTypes = { - location: PropTypes.shape({}).isRequired, - history: PropTypes.shape({}).isRequired, + return Validation; }; - return Validation; -}; - export default withValidation; diff --git a/ui/perfherder/alerts/AlertModal.jsx b/ui/perfherder/alerts/AlertModal.jsx index c587f3f6b9e..232c0108298 100644 --- a/ui/perfherder/alerts/AlertModal.jsx +++ b/ui/perfherder/alerts/AlertModal.jsx @@ -48,14 +48,8 @@ export default class AlertModal extends React.Component { }; render() { - const { - showModal, - toggle, - updateAndClose, - dropdownOption, - header, - title, - } = this.props; + const { showModal, toggle, updateAndClose, dropdownOption, header, title } = + this.props; const { inputValue, invalidInput, validated } = this.state; diff --git a/ui/perfherder/alerts/AlertTable.jsx b/ui/perfherder/alerts/AlertTable.jsx index c4f12cb6a97..705054c7e23 100644 --- a/ui/perfherder/alerts/AlertTable.jsx +++ b/ui/perfherder/alerts/AlertTable.jsx @@ -136,11 +136,8 @@ export default class AlertTable extends React.Component { }; filterAlert = (alert) => { - const { - hideDownstream, - hideAssignedToOthers, - filterText, - } = this.props.filters; + const { hideDownstream, hideAssignedToOthers, filterText } = + this.props.filters; const { username } = this.props.user; const { alertSummary } = this.state; @@ -198,9 +195,8 @@ export default class AlertTable extends React.Component { const filteredAlerts = alertSummary.alerts.filter((alert) => this.filterAlert(alert), ); - const filteredAndSortedAlerts = this.getAlertsSortedByDefault( - filteredAlerts, - ); + const filteredAndSortedAlerts = + this.getAlertsSortedByDefault(filteredAlerts); this.setState({ tableConfig, filteredAlerts, @@ -211,11 +207,8 @@ export default class AlertTable extends React.Component { }; updateAssignee = async (newAssigneeUsername) => { - const { - updateAlertSummary, - updateViewState, - fetchAlertSummaries, - } = this.props; + const { updateAlertSummary, updateViewState, fetchAlertSummaries } = + this.props; const { alertSummary } = this.state; const { data, failureStatus } = await updateAlertSummary(alertSummary.id, { diff --git a/ui/perfherder/alerts/Assignee.jsx b/ui/perfherder/alerts/Assignee.jsx index f4046bf7faa..96b1441d40c 100644 --- a/ui/perfherder/alerts/Assignee.jsx +++ b/ui/perfherder/alerts/Assignee.jsx @@ -93,9 +93,8 @@ export default class Assignee extends React.Component { const { user } = this.props; const { assigneeUsername, newAssigneeUsername, inEditMode } = this.state; - const { nickname, placeholder } = this.extractNicknameAndPlaceholder( - assigneeUsername, - ); + const { nickname, placeholder } = + this.extractNicknameAndPlaceholder(assigneeUsername); return !inEditMode ? ( diff --git a/ui/perfherder/compare/CompareSubtestDistributionView.jsx b/ui/perfherder/compare/CompareSubtestDistributionView.jsx index 990ab4d4ccc..50d3067d732 100644 --- a/ui/perfherder/compare/CompareSubtestDistributionView.jsx +++ b/ui/perfherder/compare/CompareSubtestDistributionView.jsx @@ -36,16 +36,12 @@ export default class CompareSubtestDistributionView extends React.Component { newProjectName, ); - const { - testSuite, - subtest, - testName, - platform, - } = await this.fetchTestCharacteristics( - originalProjectName, - originalRevision, - originalSubtestSignature, - ); + const { testSuite, subtest, testName, platform } = + await this.fetchTestCharacteristics( + originalProjectName, + originalRevision, + originalSubtestSignature, + ); this.setState({ filters: { testSuite, subtest }, testName, diff --git a/ui/perfherder/compare/CompareSubtestsView.jsx b/ui/perfherder/compare/CompareSubtestsView.jsx index 06f46b60ba2..7df5e78f2b4 100644 --- a/ui/perfherder/compare/CompareSubtestsView.jsx +++ b/ui/perfherder/compare/CompareSubtestsView.jsx @@ -67,12 +67,8 @@ class CompareSubtestsView extends React.PureComponent { }; createLinks = (oldResults, newResults, timeRange, framework) => { - const { - originalProject, - newProject, - originalRevision, - newRevision, - } = this.props.validated; + const { originalProject, newProject, originalRevision, newRevision } = + this.props.validated; let links = []; if ( diff --git a/ui/perfherder/compare/CompareTable.jsx b/ui/perfherder/compare/CompareTable.jsx index a2ebf2a10ac..0a307527c64 100644 --- a/ui/perfherder/compare/CompareTable.jsx +++ b/ui/perfherder/compare/CompareTable.jsx @@ -73,10 +73,8 @@ export default class CompareTable extends React.Component { getBaseAndNewHeaders = (data) => { const [firstElementOfData] = data; - const { - baseColumnMeasurementUnit, - newColumnMeasurementUnit, - } = firstElementOfData; + const { baseColumnMeasurementUnit, newColumnMeasurementUnit } = + firstElementOfData; let baseName = 'Base'; let newName = 'New'; if (baseColumnMeasurementUnit && newColumnMeasurementUnit) { diff --git a/ui/perfherder/compare/CompareTableView.jsx b/ui/perfherder/compare/CompareTableView.jsx index fea4440e24f..f9d29888261 100644 --- a/ui/perfherder/compare/CompareTableView.jsx +++ b/ui/perfherder/compare/CompareTableView.jsx @@ -98,12 +98,8 @@ export default class CompareTableView extends React.Component { getPerformanceData = async () => { const { getQueryParams, hasSubtests, getDisplayResults } = this.props; - const { - originalProject, - originalRevision, - newProject, - newRevision, - } = this.props.validated; + const { originalProject, originalRevision, newProject, newRevision } = + this.props.validated; const { framework, timeRange, failureMessages } = this.state; this.setState({ loading: true }); diff --git a/ui/perfherder/compare/CompareView.jsx b/ui/perfherder/compare/CompareView.jsx index 004811f0533..13cfd87896c 100644 --- a/ui/perfherder/compare/CompareView.jsx +++ b/ui/perfherder/compare/CompareView.jsx @@ -83,12 +83,8 @@ class CompareView extends React.PureComponent { }; createLinks = (oldResults, newResults, timeRange, framework, app) => { - const { - originalProject, - newProject, - originalRevision, - newRevision, - } = this.props.validated; + const { originalProject, newProject, originalRevision, newRevision } = + this.props.validated; let links = []; const hasSubtests = diff --git a/ui/perfherder/compare/ReplicatesGraph.jsx b/ui/perfherder/compare/ReplicatesGraph.jsx index 2097a9329bc..348a6977e6e 100644 --- a/ui/perfherder/compare/ReplicatesGraph.jsx +++ b/ui/perfherder/compare/ReplicatesGraph.jsx @@ -47,13 +47,8 @@ export default class ReplicatesGraph extends React.Component { : `${title} replicates`; fetchReplicateGraphData = async () => { - const { - project, - revision, - subtestSignature, - getData, - getReplicateData, - } = this.props; + const { project, revision, subtestSignature, getData, getReplicateData } = + this.props; const replicateData = {}; const perfDatumResponse = await getData( diff --git a/ui/perfherder/compare/RetriggerModal.jsx b/ui/perfherder/compare/RetriggerModal.jsx index fedbb2f161f..c694d5dbe9f 100644 --- a/ui/perfherder/compare/RetriggerModal.jsx +++ b/ui/perfherder/compare/RetriggerModal.jsx @@ -43,11 +43,8 @@ export default class RetriggerModal extends React.Component { }; getInitialValue = (isBaseline = false) => { - const { - defaultRetriggersValue, - isBaseAggregate, - currentRetriggerRow, - } = this.props; + const { defaultRetriggersValue, isBaseAggregate, currentRetriggerRow } = + this.props; let initialValue = defaultRetriggersValue; if (isBaseline) { diff --git a/ui/perfherder/compare/SelectorCard.jsx b/ui/perfherder/compare/SelectorCard.jsx index d5155545a94..9265035c9b8 100644 --- a/ui/perfherder/compare/SelectorCard.jsx +++ b/ui/perfherder/compare/SelectorCard.jsx @@ -111,12 +111,8 @@ export default class SelectorCard extends React.Component { }; validateInput = async (value) => { - const { - updateState, - revisionState, - selectedRepo, - getRevisions, - } = this.props; + const { updateState, revisionState, selectedRepo, getRevisions } = + this.props; const { data } = this.state; updateState({ @@ -176,13 +172,8 @@ export default class SelectorCard extends React.Component { validating, validated, } = this.state; - const { - selectedRepo, - projects, - title, - selectedRevision, - missingRevision, - } = this.props; + const { selectedRepo, projects, title, selectedRevision, missingRevision } = + this.props; return ( diff --git a/ui/perfherder/graphs/TableView.jsx b/ui/perfherder/graphs/TableView.jsx index 40fbbe85462..354bede2711 100644 --- a/ui/perfherder/graphs/TableView.jsx +++ b/ui/perfherder/graphs/TableView.jsx @@ -104,13 +104,8 @@ const TableView = ({ Cell: (props) => { let cellElem = null; if (props.original[dataKey]) { - const { - value, - jobsUrl, - compareUrl, - deltaValue, - deltaPercent, - } = props.original[dataKey]; + const { value, jobsUrl, compareUrl, deltaValue, deltaPercent } = + props.original[dataKey]; cellElem = (
    @@ -150,13 +145,8 @@ const TableView = ({ highlightedRevisions, dataKey, ) => { - const { - pushUrl, - jobsUrl, - compareUrl, - deltaValue, - deltaPercent, - } = getRevisionInfo(dataIndex, dataPoint, item); + const { pushUrl, jobsUrl, compareUrl, deltaValue, deltaPercent } = + getRevisionInfo(dataIndex, dataPoint, item); return { date: moment(dataPoint.x), diff --git a/ui/perfherder/perf-helpers/textualSummary.js b/ui/perfherder/perf-helpers/textualSummary.js index c26b0cb3233..0397f8df566 100644 --- a/ui/perfherder/perf-helpers/textualSummary.js +++ b/ui/perfherder/perf-helpers/textualSummary.js @@ -160,9 +160,8 @@ export default class TextualSummary { ); const biggestTenRegressed = sortedRegressed.slice(0, 10); const smallestFiveRegressed = sortedRegressed.slice(-5); - const formattedBiggestRegressions = this.formatAlertBulk( - biggestTenRegressed, - ); + const formattedBiggestRegressions = + this.formatAlertBulk(biggestTenRegressed); const formattedSmallestRegressions = this.formatAlertBulk( smallestFiveRegressed, ); @@ -204,9 +203,8 @@ export default class TextualSummary { const formattedBiggestImprovements = this.formatAlertBulk( biggestFiveImprovements, ); - const formattedSmallestImprovement = this.formatAlertBulk( - smallestImprovement, - ); + const formattedSmallestImprovement = + this.formatAlertBulk(smallestImprovement); // Add a column for the profiler links if at least one alert has them. const maybeProfileColumn = this.hasProfileUrls diff --git a/ui/perfherder/tests/TestsTableControls.jsx b/ui/perfherder/tests/TestsTableControls.jsx index 9840a94a8e3..2962d9ac25b 100644 --- a/ui/perfherder/tests/TestsTableControls.jsx +++ b/ui/perfherder/tests/TestsTableControls.jsx @@ -57,12 +57,8 @@ export default class TestsTableControls extends React.Component { }; render() { - const { - dropdownOptions, - projectsMap, - platformsMap, - allFrameworks, - } = this.props; + const { dropdownOptions, projectsMap, platformsMap, allFrameworks } = + this.props; const { results } = this.state; let framework = false; if (dropdownOptions[0] !== undefined) diff --git a/ui/push-health/PlatformConfig.jsx b/ui/push-health/PlatformConfig.jsx index 86cf4315026..ee68ccbc264 100644 --- a/ui/push-health/PlatformConfig.jsx +++ b/ui/push-health/PlatformConfig.jsx @@ -24,13 +24,8 @@ class PlatformConfig extends React.PureComponent { } componentDidMount() { - const { - selectedJobName, - selectedTaskId, - jobs, - jobName, - testName, - } = this.props; + const { selectedJobName, selectedTaskId, jobs, jobName, testName } = + this.props; this.setState({ detailsShowing: selectedJobName === `${testName} ${jobName}`, diff --git a/ui/push-health/Test.jsx b/ui/push-health/Test.jsx index 78af12f7361..c528beca2e7 100644 --- a/ui/push-health/Test.jsx +++ b/ui/push-health/Test.jsx @@ -225,11 +225,8 @@ class Test extends PureComponent { selectedTaskId, updateParamsAndState, } = this.props; - const { - clipboardVisible, - detailsShowing, - allPlatformsSelected, - } = this.state; + const { clipboardVisible, detailsShowing, allPlatformsSelected } = + this.state; return (
    diff --git a/ui/push-health/details/DetailsPanel.jsx b/ui/push-health/details/DetailsPanel.jsx index 66dcc6d4af0..968603f7365 100644 --- a/ui/push-health/details/DetailsPanel.jsx +++ b/ui/push-health/details/DetailsPanel.jsx @@ -149,12 +149,8 @@ class DetailsPanel extends React.Component { render() { const { currentRepo, closeDetails } = this.props; - const { - selectedTaskFull, - taskDetails, - taskDetailLoading, - tabIndex, - } = this.state; + const { selectedTaskFull, taskDetails, taskDetailLoading, tabIndex } = + this.state; return (
    diff --git a/ui/shared/BugFiler.jsx b/ui/shared/BugFiler.jsx index 5e5decbeabd..7f90bb4ed80 100644 --- a/ui/shared/BugFiler.jsx +++ b/ui/shared/BugFiler.jsx @@ -649,14 +649,8 @@ export class BugFilerClass extends React.Component { } render() { - const { - isOpen, - toggle, - suggestion, - parsedLog, - fullLog, - reftestUrl, - } = this.props; + const { isOpen, toggle, suggestion, parsedLog, fullLog, reftestUrl } = + this.props; const { productSearch, suggestedProducts, diff --git a/ui/shared/HelpMenu.jsx b/ui/shared/HelpMenu.jsx index 4964b23b587..7660ed17164 100644 --- a/ui/shared/HelpMenu.jsx +++ b/ui/shared/HelpMenu.jsx @@ -37,8 +37,7 @@ const menuItems = [ text: 'API Reference', }, { - href: - 'https://wiki.mozilla.org/EngineeringProductivity/Projects/Treeherder', + href: 'https://wiki.mozilla.org/EngineeringProductivity/Projects/Treeherder', icon: faFileWord, text: 'Project Wiki', }, @@ -48,8 +47,7 @@ const menuItems = [ text: 'Mailing List', }, { - href: - 'https://bugzilla.mozilla.org/enter_bug.cgi?product=Tree+Management&component=Treeherder', + href: 'https://bugzilla.mozilla.org/enter_bug.cgi?product=Tree+Management&component=Treeherder', icon: faBug, text: 'Report a Bug', }, diff --git a/ui/shared/JobArtifacts.jsx b/ui/shared/JobArtifacts.jsx index bd8560507a1..15534d5458f 100644 --- a/ui/shared/JobArtifacts.jsx +++ b/ui/shared/JobArtifacts.jsx @@ -20,12 +20,8 @@ export default class JobArtifacts extends React.PureComponent { } render() { - const { - jobDetails, - jobArtifactsLoading, - repoName, - selectedJob, - } = this.props; + const { jobDetails, jobArtifactsLoading, repoName, selectedJob } = + this.props; const sortedDetails = jobDetails.slice(); sortedDetails.sort((a, b) => { diff --git a/ui/shared/auth/AuthService.js b/ui/shared/auth/AuthService.js index 3c9cd54366b..4ab0deb3cca 100644 --- a/ui/shared/auth/AuthService.js +++ b/ui/shared/auth/AuthService.js @@ -15,7 +15,6 @@ export default class AuthService { _fetchUser(userSession) { const loginUrl = getApiUrl('/auth/login/'); - // eslint-disable-next-line no-async-promise-executor return new Promise(async (resolve, reject) => { const userResponse = await fetch(loginUrl, { headers: { @@ -69,7 +68,6 @@ export default class AuthService { this.logout(); } - /* eslint-disable no-console */ console.error('Could not renew login:', err); } }