aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/overview/helpers
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-09-15 17:54:25 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-09-16 10:12:15 +0200
commit1e26480cb2c8341bce5c9f028d020a520d68bae8 (patch)
treeb224baea056d1aa1d4f84656f5a9a46c980e5538 /server/sonar-web/src/main/js/apps/overview/helpers
parent3c445bc471c8ca2b11df44015bbe7b8997a61ccc (diff)
downloadsonarqube-1e26480cb2c8341bce5c9f028d020a520d68bae8.tar.gz
sonarqube-1e26480cb2c8341bce5c9f028d020a520d68bae8.zip
SONAR-6331 revert overview page
Diffstat (limited to 'server/sonar-web/src/main/js/apps/overview/helpers')
-rw-r--r--server/sonar-web/src/main/js/apps/overview/helpers/donut.jsx41
-rw-r--r--server/sonar-web/src/main/js/apps/overview/helpers/drilldown-link.jsx96
-rw-r--r--server/sonar-web/src/main/js/apps/overview/helpers/gate-link.jsx8
-rw-r--r--server/sonar-web/src/main/js/apps/overview/helpers/issues-link.jsx11
-rw-r--r--server/sonar-web/src/main/js/apps/overview/helpers/measure-variation.jsx11
-rw-r--r--server/sonar-web/src/main/js/apps/overview/helpers/measure.jsx11
-rw-r--r--server/sonar-web/src/main/js/apps/overview/helpers/period-label.jsx15
-rw-r--r--server/sonar-web/src/main/js/apps/overview/helpers/profile-link.jsx8
-rw-r--r--server/sonar-web/src/main/js/apps/overview/helpers/rating.jsx12
9 files changed, 0 insertions, 213 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/donut.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/donut.jsx
deleted file mode 100644
index 58ba8a36736..00000000000
--- a/server/sonar-web/src/main/js/apps/overview/helpers/donut.jsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import React from 'react';
-
-const Sector = React.createClass({
- render() {
- const arc = d3.svg.arc()
- .outerRadius(this.props.radius)
- .innerRadius(this.props.radius - this.props.thickness);
- return <path d={arc(this.props.data)} style={{ fill: this.props.fill }}></path>;
- }
-});
-
-export default React.createClass({
- getDefaultProps() {
- return {
- size: 30,
- thickness: 6
- };
- },
-
- render() {
- const radius = this.props.size / 2;
- const pie = d3.layout.pie().sort(null)
- .value(d => {
- return d.value
- });
- const data = this.props.data;
- const sectors = pie(data).map((d, i) => {
- return <Sector
- key={i}
- data={d}
- fill={data[i].fill}
- radius={radius}
- thickness={this.props.thickness}/>;
- });
- return (
- <svg width={this.props.size} height={this.props.size}>
- <g transform={`translate(${radius}, ${radius})`}>{sectors}</g>
- </svg>
- );
- }
-});
diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/drilldown-link.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/drilldown-link.jsx
deleted file mode 100644
index 57b2996d26b..00000000000
--- a/server/sonar-web/src/main/js/apps/overview/helpers/drilldown-link.jsx
+++ /dev/null
@@ -1,96 +0,0 @@
-import React from 'react';
-import IssuesLink from './issues-link';
-
-export default React.createClass({
- render() {
- if (this.isIssueMeasure()) {
- return this.renderIssuesLink();
- }
-
- let params = { id: this.props.component, metric: this.props.metric };
- if (this.props.period) {
- params.period = this.props.period;
- }
-
- const
- query = Object.keys(params).map(key => {
- return `${key}=${encodeURIComponent(params[key])}`;
- }).join('&'),
- url = `${baseUrl}/drilldown/measures?${query}`;
-
- return <a href={url}>{this.props.children}</a>;
- },
-
- isIssueMeasure() {
- const ISSUE_MEASURES = [
- 'violations',
- 'blocker_violations',
- 'critical_violations',
- 'major_violations',
- 'minor_violations',
- 'info_violations',
- 'new_blocker_violations',
- 'new_critical_violations',
- 'new_major_violations',
- 'new_minor_violations',
- 'new_info_violations',
- 'open_issues',
- 'reopened_issues',
- 'confirmed_issues',
- 'false_positive_issues'
- ];
- return ISSUE_MEASURES.indexOf(this.props.metric) !== -1;
- },
-
- propsToIssueParams() {
- let params = {};
- if (this.props.periodDate) {
- params.createdAfter = moment(this.props.periodDate).format('YYYY-MM-DDTHH:mm:ssZZ');
- }
- switch (this.props.metric) {
- case 'blocker_violations':
- case 'new_blocker_violations':
- _.extend(params, { resolved: 'false', severities: 'BLOCKER' });
- break;
- case 'critical_violations':
- case 'new_critical_violations':
- _.extend(params, { resolved: 'false', severities: 'CRITICAL' });
- break;
- case 'major_violations':
- case 'new_major_violations':
- _.extend(params, { resolved: 'false', severities: 'MAJOR' });
- break;
- case 'minor_violations':
- case 'new_minor_violations':
- _.extend(params, { resolved: 'false', severities: 'MINOR' });
- break;
- case 'info_violations':
- case 'new_info_violations':
- _.extend(params, { resolved: 'false', severities: 'INFO' });
- break;
- case 'open_issues':
- _.extend(params, { resolved: 'false', statuses: 'OPEN' });
- break;
- case 'reopened_issues':
- _.extend(params, { resolved: 'false', statuses: 'REOPENED' });
- break;
- case 'confirmed_issues':
- _.extend(params, { resolved: 'false', statuses: 'CONFIRMED' });
- break;
- case 'false_positive_issues':
- _.extend(params, { resolutions: 'FALSE-POSITIVE' });
- break;
- default:
- _.extend(params, { resolved: 'false' });
- }
- return params;
- },
-
- renderIssuesLink() {
- return (
- <IssuesLink component={this.props.component} params={this.propsToIssueParams()}>
- {this.props.children}
- </IssuesLink>
- );
- }
-});
diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/gate-link.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/gate-link.jsx
deleted file mode 100644
index 7a5e63d9e15..00000000000
--- a/server/sonar-web/src/main/js/apps/overview/helpers/gate-link.jsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import React from 'react';
-
-export default React.createClass({
- render() {
- const url = `${baseUrl}/quality_gates/show/${this.props.gate}`;
- return <a href={url}>{this.props.children}</a>;
- }
-});
diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/issues-link.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/issues-link.jsx
deleted file mode 100644
index 365bee7d643..00000000000
--- a/server/sonar-web/src/main/js/apps/overview/helpers/issues-link.jsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from 'react';
-
-export default React.createClass({
- render() {
- const params = Object.keys(this.props.params).map((key) => {
- return `${key}=${encodeURIComponent(this.props.params[key])}`;
- }).join('|'),
- url = `${baseUrl}/component_issues/index?id=${encodeURIComponent(this.props.component)}#${params}`;
- return <a href={url}>{this.props.children}</a>;
- }
-});
diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/measure-variation.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/measure-variation.jsx
deleted file mode 100644
index 8c84737524e..00000000000
--- a/server/sonar-web/src/main/js/apps/overview/helpers/measure-variation.jsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from 'react';
-
-export default React.createClass({
- render() {
- if (this.props.value == null || isNaN(this.props.value)) {
- return null;
- }
- const formatted = window.formatMeasureVariation(this.props.value, this.props.type);
- return <span>{formatted}</span>;
- }
-});
diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/measure.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/measure.jsx
deleted file mode 100644
index 078e1257dbb..00000000000
--- a/server/sonar-web/src/main/js/apps/overview/helpers/measure.jsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from 'react';
-
-export default React.createClass({
- render() {
- if (this.props.value == null || isNaN(this.props.value)) {
- return null;
- }
- const formatted = window.formatMeasure(this.props.value, this.props.type);
- return <span>{formatted}</span>;
- }
-});
diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/period-label.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/period-label.jsx
deleted file mode 100644
index 996ea01f96b..00000000000
--- a/server/sonar-web/src/main/js/apps/overview/helpers/period-label.jsx
+++ /dev/null
@@ -1,15 +0,0 @@
-export let periodLabel = (periods, periodIndex) => {
- let period = _.findWhere(periods, { index: periodIndex });
- if (!period) {
- return null;
- }
- return window.tp(`overview.period.${period.mode}`, period.modeParam);
-};
-
-export let getPeriodDate = (periods, periodIndex) => {
- let period = _.findWhere(periods, { index: periodIndex });
- if (!period) {
- return null;
- }
- return moment(period.date).toDate();
-};
diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/profile-link.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/profile-link.jsx
deleted file mode 100644
index 3d22d8f4c3d..00000000000
--- a/server/sonar-web/src/main/js/apps/overview/helpers/profile-link.jsx
+++ /dev/null
@@ -1,8 +0,0 @@
-import React from 'react';
-
-export default React.createClass({
- render() {
- const url = `${baseUrl}/profiles/show?key=${encodeURIComponent(this.props.profile)}`;
- return <a href={url}>{this.props.children}</a>;
- }
-});
diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/rating.jsx b/server/sonar-web/src/main/js/apps/overview/helpers/rating.jsx
deleted file mode 100644
index 9b37f948908..00000000000
--- a/server/sonar-web/src/main/js/apps/overview/helpers/rating.jsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import React from 'react';
-
-export default React.createClass({
- render() {
- if (this.props.value == null || isNaN(this.props.value)) {
- return null;
- }
- const formatted = window.formatMeasure(this.props.value, 'RATING');
- const className = 'rating rating-' + formatted;
- return <span className={className}>{formatted}</span>;
- }
-});