diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/background-tasks')
7 files changed, 23 insertions, 20 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js b/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js index b34ba6668ab..9ab30012448 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/__tests__/background-tasks-test.js @@ -61,13 +61,10 @@ describe('Search', () => { const component = shallow(<Search {...defaultProps} onFilterUpdate={searchSpy} />); const searchInput = component.find('.js-search'); change(searchInput, 'some search query'); - setTimeout( - () => { - expect(searchSpy).toBeCalledWith({ query: 'some search query' }); - done(); - }, - DEBOUNCE_DELAY - ); + setTimeout(() => { + expect(searchSpy).toBeCalledWith({ query: 'some search query' }); + done(); + }, DEBOUNCE_DELAY); }); it('should reload', () => { diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js index af0e2743612..6591fc3c4c5 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/BackgroundTasksApp.js @@ -43,7 +43,7 @@ import { fetchOrganizations } from '../../../store/rootActions'; type Props = { component: Object, location: Object, - fetchOrganizations: (Array<string>) => string + fetchOrganizations: Array<string> => string }; type State = { @@ -91,7 +91,8 @@ class BackgroundTasksApp extends React.PureComponent { componentDidUpdate(prevProps: Props) { if ( - prevProps.component !== this.props.component || prevProps.location !== this.props.location + prevProps.component !== this.props.component || + prevProps.location !== this.props.location ) { this.loadTasksDebounced(); } @@ -107,8 +108,8 @@ class BackgroundTasksApp extends React.PureComponent { const status = this.props.location.query.status || DEFAULT_FILTERS.status; const taskType = this.props.location.query.taskType || DEFAULT_FILTERS.taskType; const currents = this.props.location.query.currents || DEFAULT_FILTERS.currents; - const minSubmittedAt = this.props.location.query.minSubmittedAt || - DEFAULT_FILTERS.minSubmittedAt; + const minSubmittedAt = + this.props.location.query.minSubmittedAt || DEFAULT_FILTERS.minSubmittedAt; const maxExecutedAt = this.props.location.query.maxExecutedAt || DEFAULT_FILTERS.maxExecutedAt; const query = this.props.location.query.query || DEFAULT_FILTERS.query; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.js b/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.js index c20dafc23c6..677d7bcc48f 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/CurrentsFilter.js @@ -22,7 +22,7 @@ import React from 'react'; import Checkbox from '../../../components/controls/Checkbox'; import { CURRENTS } from '../constants'; -const CurrentsFilter = ({ value, onChange }: { value: ?string, onChange: (string) => void }) => { +const CurrentsFilter = ({ value, onChange }: { value: ?string, onChange: string => void }) => { function handleChange(value) { const newValue = value ? CURRENTS.ONLY_CURRENTS : CURRENTS.ALL; onChange(newValue); diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.js index 856e93da7c6..119591b2e4e 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TaskDate.js @@ -21,9 +21,11 @@ import moment from 'moment'; import React from 'react'; -const TaskDate = ( - { date, baseDate, format }: { date: string, baseDate: string, format: string } -) => { +const TaskDate = ({ + date, + baseDate, + format +}: { date: string, baseDate: string, format: string }) => { const m = moment(date); const baseM = moment(baseDate); const diff = date && baseDate ? m.diff(baseM, 'days') : 0; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.js b/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.js index 2a0268be408..51d5fc4b759 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/TypesFilter.js @@ -23,9 +23,11 @@ import Select from 'react-select'; import { ALL_TYPES } from '../constants'; import { translate } from '../../../helpers/l10n'; -const TypesFilter = ( - { value, onChange, types }: { value: string, onChange: Function, types: string[] } -) => { +const TypesFilter = ({ + value, + onChange, + types +}: { value: string, onChange: Function, types: string[] }) => { const options = types.map(t => { return { value: t, diff --git a/server/sonar-web/src/main/js/apps/background-tasks/routes.js b/server/sonar-web/src/main/js/apps/background-tasks/routes.js index b67c86a2771..bdc399c3b33 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/routes.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/routes.js @@ -21,7 +21,8 @@ const routes = [ { getIndexRoute(_, callback) { require.ensure([], require => - callback(null, { component: require('./components/BackgroundTasksApp').default })); + callback(null, { component: require('./components/BackgroundTasksApp').default }) + ); } } ]; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/utils.js b/server/sonar-web/src/main/js/apps/background-tasks/utils.js index adb942dacd9..963fb60aea4 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/utils.js +++ b/server/sonar-web/src/main/js/apps/background-tasks/utils.js @@ -22,7 +22,7 @@ import { STATUSES, ALL_TYPES, CURRENTS } from './constants'; import { Task } from './types'; export function updateTask(tasks: Task[], newTask: Task) { - return tasks.map(task => task.id === newTask.id ? newTask : task); + return tasks.map(task => (task.id === newTask.id ? newTask : task)); } export function mapFiltersToParameters(filters: Object = {}) { |