aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-06-13 11:15:52 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-07-04 14:15:34 +0200
commit47b553e761f7e061cdce150003123f1f5de724be (patch)
treedf209129f10f5f448acaf32ffbc119e0f80050f3 /server/sonar-web/src/main/js/apps/projects
parentab94fb19012b9686efeef543909d2b555fcf8c42 (diff)
downloadsonarqube-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/projects')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/AllProjects.js5
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/PageHeader.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/PageSidebar.js3
-rw-r--r--server/sonar-web/src/main/js/apps/projects/store/utils.js2
6 files changed, 13 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.js b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.js
index 746a6fee39e..13078f320a5 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.js
+++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.js
@@ -28,11 +28,12 @@ import VisualizationsContainer from '../visualizations/VisualizationsContainer';
import { parseUrlQuery } from '../store/utils';
import { translate } from '../../../helpers/l10n';
import * as utils from '../utils';
+import type { RawQuery } from '../../../helpers/query';
import '../styles.css';
type Props = {|
isFavorite: boolean,
- location: { pathname: string, query: { [string]: string } },
+ location: { pathname: string, query: RawQuery },
fetchProjects: (query: string, isFavorite: boolean, organization?: {}) => Promise<*>,
organization?: { key: string },
router: {
@@ -43,7 +44,7 @@ type Props = {|
|};
type State = {
- query: { [string]: string }
+ query: RawQuery
};
export default class AllProjects extends React.PureComponent {
diff --git a/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.js b/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.js
index f3e39df8b4d..bab378af29e 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.js
+++ b/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.js
@@ -25,12 +25,13 @@ import AllProjectsContainer from './AllProjectsContainer';
import { getCurrentUser } from '../../../store/rootReducer';
import { isFavoriteSet, isAllSet } from '../utils';
import { searchProjects } from '../../../api/components';
+import type { RawQuery } from '../../../helpers/query';
type Props = {
currentUser: { isLoggedIn: boolean },
location: { query: {} },
router: {
- replace: (location: { pathname?: string, query?: { [string]: string } }) => void
+ replace: (location: { pathname?: string, query?: RawQuery }) => void
}
};
diff --git a/server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.js b/server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.js
index 45ed4b6e8a8..77cd3f97cc8 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.js
+++ b/server/sonar-web/src/main/js/apps/projects/components/FavoriteFilter.js
@@ -22,13 +22,14 @@ import React from 'react';
import { IndexLink, Link } from 'react-router';
import { translate } from '../../../helpers/l10n';
import { saveAll, saveFavorite } from '../utils';
+import type { RawQuery } from '../../../helpers/query';
type Props = {
user: {
isLoggedIn?: boolean
},
organization?: { key: string },
- query: { [string]: string }
+ query: RawQuery
};
export default class FavoriteFilter extends React.PureComponent {
diff --git a/server/sonar-web/src/main/js/apps/projects/components/PageHeader.js b/server/sonar-web/src/main/js/apps/projects/components/PageHeader.js
index dc1aa2de123..356690901e6 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/PageHeader.js
+++ b/server/sonar-web/src/main/js/apps/projects/components/PageHeader.js
@@ -25,6 +25,7 @@ import Tooltip from '../../../components/controls/Tooltip';
import PerspectiveSelect from './PerspectiveSelect';
import ProjectsSortingSelect from './ProjectsSortingSelect';
import { translate } from '../../../helpers/l10n';
+import type { RawQuery } from '../../../helpers/query';
type Props = {|
currentUser?: { isLoggedIn: boolean },
@@ -33,7 +34,7 @@ type Props = {|
organization?: { key: string },
projects: Array<*>,
projectsAppState: { loading: boolean, total?: number },
- query: { [string]: string },
+ query: RawQuery,
onSortChange: (sort: string, desc: boolean) => void,
selectedSort: string,
view: string,
diff --git a/server/sonar-web/src/main/js/apps/projects/components/PageSidebar.js b/server/sonar-web/src/main/js/apps/projects/components/PageSidebar.js
index 9771b00f497..65fa894d22c 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/PageSidebar.js
+++ b/server/sonar-web/src/main/js/apps/projects/components/PageSidebar.js
@@ -37,11 +37,12 @@ import SecurityFilter from '../filters/SecurityFilter';
import SizeFilter from '../filters/SizeFilter';
import TagsFilterContainer from '../filters/TagsFilterContainer';
import { translate } from '../../../helpers/l10n';
+import type { RawQuery } from '../../../helpers/query';
type Props = {
isFavorite: boolean,
organization?: { key: string },
- query: { [string]: string },
+ query: RawQuery,
view: string,
visualization: string
};
diff --git a/server/sonar-web/src/main/js/apps/projects/store/utils.js b/server/sonar-web/src/main/js/apps/projects/store/utils.js
index 4c383fe8d0c..190facb928c 100644
--- a/server/sonar-web/src/main/js/apps/projects/store/utils.js
+++ b/server/sonar-web/src/main/js/apps/projects/store/utils.js
@@ -34,6 +34,7 @@ const getAsLevel = value => {
return null;
};
+// TODO Maybe use parseAsString form helpers/query
const getAsString = value => {
if (!value) {
return null;
@@ -41,6 +42,7 @@ const getAsString = value => {
return value;
};
+// TODO Maybe move it to helpers/query
const getAsArray = (values, elementGetter) => {
if (!values) {
return null;