diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-06-09 15:02:20 +0200 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-06-13 15:11:07 +0200 |
commit | 9bbf5c3623172cec5573487249747cf240cd4f21 (patch) | |
tree | 090d6da39700776f2d136a145935dedadc8b05fc /server/sonar-web/src/main/js/apps/projects | |
parent | 5cc073853d45bc73da7eb06cc6c86e53af17a1c8 (diff) | |
download | sonarqube-9bbf5c3623172cec5573487249747cf240cd4f21.tar.gz sonarqube-9bbf5c3623172cec5573487249747cf240cd4f21.zip |
Fix new flow typed issues
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects')
3 files changed, 3 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.js index c266641d6b7..d610b721939 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/LanguagesFilter.js @@ -41,11 +41,10 @@ type Props = { const LIST_SIZE = 10; export default class LanguagesFilter extends React.PureComponent { - getSearchOptions: () => [{ label: string, value: string }]; props: Props; property = 'languages'; - getSearchOptions(facet: {}, languages: {}) { + getSearchOptions(facet?: {}, languages: {}): Array<{ label: string, value: string }> { let languageKeys = Object.keys(languages); if (facet) { languageKeys = difference(languageKeys, Object.keys(facet)); diff --git a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.js b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.js index 0a13f40b228..e5b739e8429 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/SearchableFilterFooter.js @@ -26,7 +26,7 @@ import { translate } from '../../../helpers/l10n'; type Props = { property: string, query: {}, - options: [{ label: string, value: string }], + options: Array<{ label: string, value: string }>, router: { push: ({ pathname: string, query?: {} }) => void }, onInputChange?: string => void, onOpen?: void => void, diff --git a/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.js b/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.js index 28add5b703b..7fb48d31783 100644 --- a/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.js +++ b/server/sonar-web/src/main/js/apps/projects/filters/TagsFilter.js @@ -46,7 +46,6 @@ type State = { const LIST_SIZE = 10; export default class TagsFilter extends React.PureComponent { - getSearchOptions: () => [{ label: string, value: string }]; props: Props; state: State; property: string; @@ -62,7 +61,7 @@ export default class TagsFilter extends React.PureComponent { this.handleSearch = debounce(this.handleSearch.bind(this), 250); } - getSearchOptions(facet: {}, tags: Array<string>) { + getSearchOptions(facet?: {}, tags: Array<string>): Array<{ label: string, value: string }> { let tagsCopy = [...tags]; if (facet) { tagsCopy = difference(tagsCopy, Object.keys(facet)); |