aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-10-18 09:46:22 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-10-21 10:24:17 +0200
commitb7129679327efeeb44f9205656b46376adfe9689 (patch)
treef01159db52a79aae8e478dcafe79a7d9d22156c6 /server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js
parent3d8cdcbf8558e40385f481272045056d5435a3e6 (diff)
downloadsonarqube-b7129679327efeeb44f9205656b46376adfe9689.tar.gz
sonarqube-b7129679327efeeb44f9205656b46376adfe9689.zip
SONAR-8300 Create new "Projects" page [first iter]
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js b/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js
new file mode 100644
index 00000000000..e76fa0e975d
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/projects/components/ProjectCard.js
@@ -0,0 +1,47 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import React from 'react';
+import ProjectCardMeasures from './ProjectCardMeasures';
+import { getComponentUrl } from '../../../helpers/urls';
+
+export default class ProjectCard extends React.Component {
+ static propTypes = {
+ project: React.PropTypes.object
+ };
+
+ render () {
+ const { project } = this.props;
+
+ if (project == null) {
+ return null;
+ }
+
+ return (
+ <div className="boxed-group project-card">
+ <h2 className="project-card-name">
+ <a className="link-base-color" href={getComponentUrl(project.key)}>{project.name}</a>
+ </h2>
+ <div className="boxed-group-inner">
+ <ProjectCardMeasures measures={this.props.measures}/>
+ </div>
+ </div>
+ );
+ }
+}