aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/overview/events/Event.js
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-06-23 17:34:10 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-07-04 14:15:34 +0200
commit3a604bda9aa574c291f764ca8791b9af91d66a67 (patch)
tree4e92e74a1c5fb3d9fa9c483fb3fb1b742b45ce68 /server/sonar-web/src/main/js/apps/overview/events/Event.js
parent21cdccf048db95fdeae2bf7046c2f2d830d172f5 (diff)
downloadsonarqube-3a604bda9aa574c291f764ca8791b9af91d66a67.tar.gz
sonarqube-3a604bda9aa574c291f764ca8791b9af91d66a67.zip
SONAR-9414 Display a preview of the project activity graph on the project page
Diffstat (limited to 'server/sonar-web/src/main/js/apps/overview/events/Event.js')
-rw-r--r--server/sonar-web/src/main/js/apps/overview/events/Event.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/events/Event.js b/server/sonar-web/src/main/js/apps/overview/events/Event.js
new file mode 100644
index 00000000000..1d377ecd253
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/overview/events/Event.js
@@ -0,0 +1,44 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.
+ */
+// @flow
+import React from 'react';
+import { TooltipsContainer } from '../../../components/mixins/tooltips-mixin';
+import type { Event as EventType } from '../../projectActivity/types';
+import { translate } from '../../../helpers/l10n';
+
+export default function Event(props: { event: EventType }) {
+ const { event } = props;
+
+ if (event.category === 'VERSION') {
+ return <span className="overview-analysis-event badge">{props.event.name}</span>;
+ }
+
+ return (
+ <div className="overview-analysis-event">
+ <TooltipsContainer>
+ <span>
+ <span className="note">{translate('event.category', event.category)}:</span>
+ {' '}
+ <strong title={event.description} data-toggle="tooltip">{event.name}</strong>
+ </span>
+ </TooltipsContainer>
+ </div>
+ );
+}