diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-06-13 11:15:52 +0200 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-07-04 14:15:34 +0200 |
commit | 47b553e761f7e061cdce150003123f1f5de724be (patch) | |
tree | df209129f10f5f448acaf32ffbc119e0f80050f3 /server/sonar-web/src/main/js/apps/issues/components | |
parent | ab94fb19012b9686efeef543909d2b555fcf8c42 (diff) | |
download | sonarqube-47b553e761f7e061cdce150003123f1f5de724be.tar.gz sonarqube-47b553e761f7e061cdce150003123f1f5de724be.zip |
SONAR-9401 Remove usage of redux on the project activity page
* Create a query helper library and use it in issues page and project activity page
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues/components')
-rw-r--r-- | server/sonar-web/src/main/js/apps/issues/components/App.js | 10 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/apps/issues/components/AppContainer.js | 5 |
2 files changed, 9 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/components/App.js b/server/sonar-web/src/main/js/apps/issues/components/App.js index d827a0d1f1f..e003d9ec0ea 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/App.js +++ b/server/sonar-web/src/main/js/apps/issues/components/App.js @@ -58,15 +58,19 @@ import EmptySearch from '../../../components/common/EmptySearch'; import { translate, translateWithParameters } from '../../../helpers/l10n'; import { scrollToElement } from '../../../helpers/scrolling'; import type { Issue } from '../../../components/issue/types'; +import type { RawQuery } from '../../../helpers/query'; import '../styles.css'; export type Props = { component?: Component, currentUser: CurrentUser, - fetchIssues: ({}) => Promise<*>, - location: { pathname: string, query: { [string]: string } }, + fetchIssues: (query: RawQuery) => Promise<*>, + location: { pathname: string, query: RawQuery }, onRequestFail: Error => void, - router: { push: ({}) => void, replace: ({}) => void } + router: { + push: ({ pathname: string, query?: RawQuery }) => void, + replace: ({ pathname: string, query?: RawQuery }) => void + } }; export type State = { diff --git a/server/sonar-web/src/main/js/apps/issues/components/AppContainer.js b/server/sonar-web/src/main/js/apps/issues/components/AppContainer.js index 3b2ce078438..0ce4f8bb598 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/AppContainer.js +++ b/server/sonar-web/src/main/js/apps/issues/components/AppContainer.js @@ -29,8 +29,7 @@ import { getOrganizations } from '../../../api/organizations'; import { receiveOrganizations } from '../../../store/organizations/duck'; import { searchIssues } from '../../../api/issues'; import { parseIssueFromResponse } from '../../../helpers/issues'; - -type Query = { [string]: string }; +import type { RawQuery } from '../../../helpers/query'; const mapStateToProps = (state, ownProps) => ({ component: ownProps.location.query.id @@ -51,7 +50,7 @@ const fetchIssueOrganizations = issues => dispatch => { ); }; -const fetchIssues = (query: Query) => dispatch => +const fetchIssues = (query: RawQuery) => dispatch => searchIssues({ ...query, additionalFields: '_all' }) .then(response => { const parsedIssues = response.issues.map(issue => |