aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2018-07-06 11:40:29 +0200
committerSonarTech <sonartech@sonarsource.com>2018-07-11 20:21:22 +0200
commit29b0f28f9e4fc05ce662212a55aef45ad0278201 (patch)
treee167021989b32129e7f7695ff1fc5d43b797a05f /server/sonar-web/src/main/js/apps/projects
parentd34f9f46391d73cb89e9b7ead8e828dc65362829 (diff)
downloadsonarqube-29b0f28f9e4fc05ce662212a55aef45ad0278201.tar.gz
sonarqube-29b0f28f9e4fc05ce662212a55aef45ad0278201.zip
Migrate remaining of organization app to TS
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/AllProjectsContainer.tsx4
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx16
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/ProjectCard.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx3
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx1
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsList-test.tsx1
-rw-r--r--server/sonar-web/src/main/js/apps/projects/utils.ts1
8 files changed, 25 insertions, 8 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx
index c015b983357..cbb5d82aa9b 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjects.tsx
@@ -26,7 +26,7 @@ import ProjectsList from './ProjectsList';
import PageSidebar from './PageSidebar';
import Suggestions from '../../../app/components/embed-docs-modal/Suggestions';
import Visualizations from '../visualizations/Visualizations';
-import { CurrentUser, isLoggedIn } from '../../../app/types';
+import { CurrentUser, isLoggedIn, Organization } from '../../../app/types';
import handleRequiredAuthentication from '../../../app/utils/handleRequiredAuthentication';
import ScreenPositionHelper from '../../../components/common/ScreenPositionHelper';
import ListFooter from '../../../components/controls/ListFooter';
@@ -44,7 +44,7 @@ export interface Props {
currentUser: CurrentUser;
isFavorite: boolean;
location: { pathname: string; query: RawQuery };
- organization?: { key: string };
+ organization: Organization | undefined;
organizationsEnabled: boolean;
storageOptionsSuffix?: string;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/components/AllProjectsContainer.tsx b/server/sonar-web/src/main/js/apps/projects/components/AllProjectsContainer.tsx
index 5de80726a26..cf7600a82b6 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/AllProjectsContainer.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/AllProjectsContainer.tsx
@@ -18,7 +18,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { connect } from 'react-redux';
-import { CurrentUser } from '../../../app/types';
+import { CurrentUser, Organization } from '../../../app/types';
import { lazyLoad } from '../../../components/lazyLoad';
import { getCurrentUser, areThereCustomOrganizations } from '../../../store/rootReducer';
import { RawQuery } from '../../../helpers/query';
@@ -31,7 +31,7 @@ interface StateProps {
interface OwnProps {
isFavorite: boolean;
location: { pathname: string; query: RawQuery };
- organization?: { key: string };
+ organization: Organization | undefined;
storageOptionsSuffix?: string;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx b/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx
index 1fffa7f7d3e..8b4e37b1ec6 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/DefaultPageSelector.tsx
@@ -114,7 +114,13 @@ export default class DefaultPageSelector extends React.PureComponent<Props, Stat
render() {
if (isSonarCloud() && isLoggedIn(this.props.currentUser)) {
- return <AllProjectsContainer isFavorite={true} location={this.props.location} />;
+ return (
+ <AllProjectsContainer
+ isFavorite={true}
+ location={this.props.location}
+ organization={undefined}
+ />
+ );
}
const { shouldBeRedirected, shouldForceSorting } = this.state;
@@ -124,7 +130,13 @@ export default class DefaultPageSelector extends React.PureComponent<Props, Stat
shouldBeRedirected !== true &&
shouldForceSorting === undefined
) {
- return <AllProjectsContainer isFavorite={false} location={this.props.location} />;
+ return (
+ <AllProjectsContainer
+ isFavorite={false}
+ location={this.props.location}
+ organization={undefined}
+ />
+ );
}
return null;
diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.tsx
index d572edb0d5b..e562aac058e 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.tsx
@@ -21,10 +21,11 @@ import * as React from 'react';
import ProjectCardLeak from './ProjectCardLeak';
import ProjectCardOverall from './ProjectCardOverall';
import { Project } from '../types';
+import { Organization } from '../../../app/types';
interface Props {
height: number;
- organization?: { key: string };
+ organization: Organization | undefined;
project: Project;
type?: string;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx b/server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx
index a019fca6cbf..23cf0206096 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectsList.tsx
@@ -28,12 +28,13 @@ import EmptyFavoriteSearch from './EmptyFavoriteSearch';
import EmptySearch from '../../../components/common/EmptySearch';
import { Project } from '../types';
import { Query } from '../query';
+import { Organization } from '../../../app/types';
interface Props {
cardType?: string;
isFavorite: boolean;
isFiltered: boolean;
- organization?: { key: string };
+ organization: Organization | undefined;
projects: Project[];
query: Query;
}
diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx
index 7497a286fa9..babf7c999e0 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/AllProjects-test.tsx
@@ -171,6 +171,7 @@ function shallowRender(
currentUser={{ isLoggedIn: true }}
isFavorite={false}
location={{ pathname: '/projects', query: {} }}
+ organization={undefined}
organizationsEnabled={false}
{...props}
/>,
diff --git a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsList-test.tsx b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsList-test.tsx
index a7dcb6ea2bc..fd28e6c2481 100644
--- a/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsList-test.tsx
+++ b/server/sonar-web/src/main/js/apps/projects/components/__tests__/ProjectsList-test.tsx
@@ -37,6 +37,7 @@ function shallowRender(props?: any) {
cardType="overall"
isFavorite={false}
isFiltered={false}
+ organization={undefined}
projects={[{ key: 'foo', name: 'Foo' }, { key: 'bar', name: 'Bar' }]}
{...props}
/>
diff --git a/server/sonar-web/src/main/js/apps/projects/utils.ts b/server/sonar-web/src/main/js/apps/projects/utils.ts
index 419ef569f9f..fe010d42316 100644
--- a/server/sonar-web/src/main/js/apps/projects/utils.ts
+++ b/server/sonar-web/src/main/js/apps/projects/utils.ts
@@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+/* eslint-disable camelcase */
import { uniq } from 'lodash';
import { Query, convertToFilter } from './query';
import { translate } from '../../helpers/l10n';