diff options
author | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-04-20 11:10:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 11:10:13 +0200 |
commit | f6e90fdc19e222b3b238f0f5995a8039b7db158e (patch) | |
tree | 69c22415cb50a650b046ce4b9a9ac99e57695dfd /server/sonar-web/src/main/js/components/issue | |
parent | 36c9fa041018d7eed91f1d22e0c5eda075737ebc (diff) | |
download | sonarqube-f6e90fdc19e222b3b238f0f5995a8039b7db158e.tar.gz sonarqube-f6e90fdc19e222b3b238f0f5995a8039b7db158e.zip |
upgrade prettier (#1954)
Diffstat (limited to 'server/sonar-web/src/main/js/components/issue')
22 files changed, 55 insertions, 62 deletions
diff --git a/server/sonar-web/src/main/js/components/issue/Issue.js b/server/sonar-web/src/main/js/components/issue/Issue.js index 471a62e04f0..f45671c6f74 100644 --- a/server/sonar-web/src/main/js/components/issue/Issue.js +++ b/server/sonar-web/src/main/js/components/issue/Issue.js @@ -28,9 +28,9 @@ import type { Issue } from './types'; type Props = {| checked?: boolean, issue: Issue, - onChange: (Issue) => void, - onCheck?: (string) => void, - onClick: (string) => void, + onChange: Issue => void, + onCheck?: string => void, + onClick: string => void, onFilter?: (property: string, issue: Issue) => void, selected: boolean |}; diff --git a/server/sonar-web/src/main/js/components/issue/IssueView.js b/server/sonar-web/src/main/js/components/issue/IssueView.js index 3d959f26573..f7690db0625 100644 --- a/server/sonar-web/src/main/js/components/issue/IssueView.js +++ b/server/sonar-web/src/main/js/components/issue/IssueView.js @@ -31,14 +31,14 @@ type Props = {| checked?: boolean, currentPopup: string, issue: Issue, - onAssign: (string) => void, - onChange: (Issue) => void, - onCheck?: (string) => void, - onClick: (string) => void, - onFail: (Error) => void, + onAssign: string => void, + onChange: Issue => void, + onCheck?: string => void, + onClick: string => void, + onFail: Error => void, onFilter?: (property: string, issue: Issue) => void, selected: boolean, - togglePopup: (string) => void + togglePopup: string => void |}; export default class IssueView extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/components/issue/actions.js b/server/sonar-web/src/main/js/components/issue/actions.js index a44430520bd..46acb282549 100644 --- a/server/sonar-web/src/main/js/components/issue/actions.js +++ b/server/sonar-web/src/main/js/components/issue/actions.js @@ -23,7 +23,7 @@ import { parseIssueFromResponse } from '../../helpers/issues'; import type { Issue } from './types'; export const updateIssue = ( - onChange: (Issue) => void, + onChange: Issue => void, resultPromise: Promise<*>, oldIssue?: Issue, newIssue?: Issue diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.js b/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.js index 9006cd9a19e..9a7bcf803a7 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.js @@ -32,10 +32,10 @@ import type { Issue } from '../types'; type Props = { issue: Issue, currentPopup: string, - onAssign: (string) => void, - onChange: (Issue) => void, - onFail: (Error) => void, - togglePopup: (string) => void + onAssign: string => void, + onChange: Issue => void, + onFail: Error => void, + togglePopup: string => void }; type State = { @@ -58,7 +58,7 @@ export default class IssueActionsBar extends React.PureComponent { setIssueProperty = ( property: string, popup: string, - apiCall: (Object) => Promise<*>, + apiCall: Object => Promise<*>, value: string ) => { const { issue } = this.props; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueAssign.js b/server/sonar-web/src/main/js/components/issue/components/IssueAssign.js index 836ef6a5a8c..55c84072696 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueAssign.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueAssign.js @@ -29,9 +29,9 @@ type Props = { isOpen: boolean, issue: Issue, canAssign: boolean, - onAssign: (string) => void, - onFail: (Error) => void, - togglePopup: (string) => void + onAssign: string => void, + onFail: Error => void, + togglePopup: string => void }; export default class IssueAssign extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.js b/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.js index 864886af959..c1e77f71801 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueChangelog.js @@ -28,8 +28,8 @@ type Props = { isOpen: boolean, issue: Issue, creationDate: string, - togglePopup: (string) => void, - onFail: (Error) => void + togglePopup: string => void, + onFail: Error => void }; export default class IssueChangelog extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueCommentAction.js b/server/sonar-web/src/main/js/components/issue/components/IssueCommentAction.js index 8111815e942..32df39c5b61 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueCommentAction.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueCommentAction.js @@ -30,7 +30,7 @@ type Props = {| commentPlaceholder: string, currentPopup: string, issueKey: string, - onChange: (Issue) => void, + onChange: Issue => void, toggleComment: (open?: boolean, placeholder?: string) => void |}; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.js b/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.js index 6e2b9595997..c82e8c4a0d9 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueCommentLine.js @@ -28,7 +28,7 @@ import type { IssueComment } from '../types'; type Props = { comment: IssueComment, - onDelete: (string) => void, + onDelete: string => void, onEdit: (string, string) => void }; diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.js b/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.js index 7e52e538742..f4e46db81e3 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueSeverity.js @@ -30,7 +30,7 @@ type Props = { isOpen: boolean, issue: Issue, setIssueProperty: (string, string, apiCall: (Object) => Promise<*>, string) => void, - togglePopup: (string) => void + togglePopup: string => void }; export default class IssueSeverity extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueTags.js b/server/sonar-web/src/main/js/components/issue/components/IssueTags.js index c7cebdf74d7..c634406c5f6 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueTags.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueTags.js @@ -31,9 +31,9 @@ type Props = {| canSetTags: boolean, isOpen: boolean, issue: Issue, - onChange: (Issue) => void, - onFail: (Error) => void, - togglePopup: (string) => void + onChange: Issue => void, + onFail: Error => void, + togglePopup: string => void |}; export default class IssueTags extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.js b/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.js index 55ef295f55d..901ae80febf 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.js @@ -30,9 +30,9 @@ import type { Issue } from '../types'; type Props = {| issue: Issue, currentPopup: string, - onFail: (Error) => void, + onFail: Error => void, onFilter?: (property: string, issue: Issue) => void, - togglePopup: (string) => void + togglePopup: string => void |}; const stopPropagation = (event: Event) => event.stopPropagation(); diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueTransition.js b/server/sonar-web/src/main/js/components/issue/components/IssueTransition.js index 24e3625d529..509d58ddb31 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueTransition.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueTransition.js @@ -30,8 +30,8 @@ type Props = { hasTransitions: boolean, isOpen: boolean, issue: Issue, - onChange: (Issue) => void, - togglePopup: (string) => void + onChange: Issue => void, + togglePopup: string => void }; export default class IssueTransition extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueType.js b/server/sonar-web/src/main/js/components/issue/components/IssueType.js index df1d8740031..952d481c1b1 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueType.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueType.js @@ -31,7 +31,7 @@ type Props = { isOpen: boolean, issue: Issue, setIssueProperty: (string, string, apiCall: (Object) => Promise<*>, string) => void, - togglePopup: (string) => void + togglePopup: string => void }; export default class IssueType extends React.PureComponent { diff --git a/server/sonar-web/src/main/js/components/issue/components/SimilarIssuesFilter.js b/server/sonar-web/src/main/js/components/issue/components/SimilarIssuesFilter.js index c28593d7c89..bf80c555101 100644 --- a/server/sonar-web/src/main/js/components/issue/components/SimilarIssuesFilter.js +++ b/server/sonar-web/src/main/js/components/issue/components/SimilarIssuesFilter.js @@ -27,8 +27,8 @@ import type { Issue } from '../types'; type Props = {| isOpen: boolean, issue: Issue, - togglePopup: (string) => void, - onFail: (Error) => void, + togglePopup: string => void, + onFail: Error => void, onFilter: (property: string, issue: Issue) => void |}; diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelog-test.js b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelog-test.js index 608112423d5..446dc8bcea4 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelog-test.js +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueChangelog-test.js @@ -28,11 +28,10 @@ const issue = { creationDate: '2017-03-01T09:36:01+0100' }; -jest.mock('moment', () => - () => ({ - format: () => 'March 1, 2017 9:36 AM', - fromNow: () => 'a month ago' - })); +jest.mock('moment', () => () => ({ + format: () => 'March 1, 2017 9:36 AM', + fromNow: () => 'a month ago' +})); it('should render correctly', () => { const element = shallow( diff --git a/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.js b/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.js index 49bdee8218e..501f4b2b612 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.js +++ b/server/sonar-web/src/main/js/components/issue/popups/ChangelogPopup.js @@ -38,7 +38,7 @@ type Changelog = { type Props = { issue: Issue, - onFail: (Error) => void, + onFail: Error => void, popupPosition?: {} }; @@ -63,14 +63,11 @@ export default class ChangelogPopup extends React.PureComponent { } loadChangelog() { - getIssueChangelog(this.props.issue.key).then( - changelogs => { - if (this.mounted) { - this.setState({ changelogs }); - } - }, - this.props.onFail - ); + getIssueChangelog(this.props.issue.key).then(changelogs => { + if (this.mounted) { + this.setState({ changelogs }); + } + }, this.props.onFail); } render() { diff --git a/server/sonar-web/src/main/js/components/issue/popups/CommentPopup.js b/server/sonar-web/src/main/js/components/issue/popups/CommentPopup.js index cb079327d53..befea8fef19 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/CommentPopup.js +++ b/server/sonar-web/src/main/js/components/issue/popups/CommentPopup.js @@ -28,8 +28,8 @@ import type { IssueComment } from '../types'; type Props = { comment?: IssueComment, customClass?: string, - onComment: (string) => void, - toggleComment: (boolean) => void, + onComment: string => void, + toggleComment: boolean => void, placeholder: string, popupPosition?: {} }; diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetAssigneePopup.js b/server/sonar-web/src/main/js/components/issue/popups/SetAssigneePopup.js index c700c3a341f..df38baef06a 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetAssigneePopup.js +++ b/server/sonar-web/src/main/js/components/issue/popups/SetAssigneePopup.js @@ -42,8 +42,8 @@ type User = { type Props = { issue: Issue, - onFail: (Error) => void, - onSelect: (string) => void, + onFail: Error => void, + onSelect: string => void, popupPosition?: {} }; diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetIssueTagsPopup.js b/server/sonar-web/src/main/js/components/issue/popups/SetIssueTagsPopup.js index f8584f59f07..04b1a31ae28 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetIssueTagsPopup.js +++ b/server/sonar-web/src/main/js/components/issue/popups/SetIssueTagsPopup.js @@ -25,9 +25,9 @@ import { searchIssueTags } from '../../../api/issues'; type Props = { popupPosition?: {}, - onFail: (Error) => void, + onFail: Error => void, selectedTags: Array<string>, - setTags: (Array<string>) => void + setTags: Array<string> => void }; type State = { @@ -54,12 +54,9 @@ export default class SetIssueTagsPopup extends React.PureComponent { searchIssueTags({ q: query || '', ps: Math.min(this.props.selectedTags.length - 1 + LIST_SIZE, 100) - }).then( - (tags: Array<string>) => { - this.setState({ searchResult: tags }); - }, - this.props.onFail - ); + }).then((tags: Array<string>) => { + this.setState({ searchResult: tags }); + }, this.props.onFail); }; onSelect = (tag: string) => { diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetSeverityPopup.js b/server/sonar-web/src/main/js/components/issue/popups/SetSeverityPopup.js index bef971615d5..be89f2120b9 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetSeverityPopup.js +++ b/server/sonar-web/src/main/js/components/issue/popups/SetSeverityPopup.js @@ -28,7 +28,7 @@ import type { Issue } from '../types'; type Props = { issue: Issue, - onSelect: (string) => void, + onSelect: string => void, popupPosition?: {} }; diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.js b/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.js index d1c83099551..dc1703d15ec 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.js +++ b/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.js @@ -26,7 +26,7 @@ import { translate } from '../../../helpers/l10n'; type Props = { transitions: Array<string>, - onSelect: (string) => void, + onSelect: string => void, popupPosition?: {} }; diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetTypePopup.js b/server/sonar-web/src/main/js/components/issue/popups/SetTypePopup.js index 7bd10d57ede..1f1864307a7 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetTypePopup.js +++ b/server/sonar-web/src/main/js/components/issue/popups/SetTypePopup.js @@ -28,7 +28,7 @@ import type { Issue } from '../types'; type Props = { issue: Issue, - onSelect: (string) => void, + onSelect: string => void, popupPosition?: {} }; |