diff options
Diffstat (limited to 'server/sonar-web/src/main/js/components')
7 files changed, 73 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/components/common/handlebars-extensions.js b/server/sonar-web/src/main/js/components/common/handlebars-extensions.js index e8e8c13f3e9..c85329a0535 100644 --- a/server/sonar-web/src/main/js/components/common/handlebars-extensions.js +++ b/server/sonar-web/src/main/js/components/common/handlebars-extensions.js @@ -32,6 +32,10 @@ return baseUrl + '/dashboard/index?id=' + encodeURIComponent(componentKey); }); + Handlebars.registerHelper('componentOverviewPermalink', function (componentKey) { + return baseUrl + '/overview/index?id=' + encodeURIComponent(componentKey); + }); + Handlebars.registerHelper('componentDashboardPermalink', function (componentKey, dashboardKey) { var params = [ { key: 'id', value: componentKey }, diff --git a/server/sonar-web/src/main/js/components/shared/severity-helper.jsx b/server/sonar-web/src/main/js/components/shared/severity-helper.jsx new file mode 100644 index 00000000000..a0e931aca2f --- /dev/null +++ b/server/sonar-web/src/main/js/components/shared/severity-helper.jsx @@ -0,0 +1,17 @@ +import React from 'react'; +import SeverityIcon from './severity-icon'; + +export default React.createClass({ + render() { + if (!this.props.severity) { + return null; + } + return ( + <span> + <SeverityIcon severity={this.props.severity}/> + + {window.t('severity', this.props.severity)} + </span> + ); + } +}); diff --git a/server/sonar-web/src/main/js/components/shared/severity-icon.jsx b/server/sonar-web/src/main/js/components/shared/severity-icon.jsx new file mode 100644 index 00000000000..87aec17ea7b --- /dev/null +++ b/server/sonar-web/src/main/js/components/shared/severity-icon.jsx @@ -0,0 +1,11 @@ +import React from 'react'; + +export default React.createClass({ + render() { + if (!this.props.severity) { + return null; + } + var className = 'icon-severity-' + this.props.severity.toLowerCase(); + return <i className={className}></i>; + } +}); diff --git a/server/sonar-web/src/main/js/components/shared/status-helper.jsx b/server/sonar-web/src/main/js/components/shared/status-helper.jsx new file mode 100644 index 00000000000..033fd3ff786 --- /dev/null +++ b/server/sonar-web/src/main/js/components/shared/status-helper.jsx @@ -0,0 +1,26 @@ +define([ + 'libs/third-party/react', + './status-icon' +], function (React, StatusIcon) { + + return React.createClass({ + render: function () { + if (!this.props.status) { + return null; + } + var resolution; + if (this.props.resolution) { + resolution = ' (' + window.t('issue.resolution', this.props.resolution) + ')'; + } + return ( + <span> + <StatusIcon status={this.props.status}/> + + {window.t('issue.status', this.props.status)} + {resolution} + </span> + ); + } + }); + +}); diff --git a/server/sonar-web/src/main/js/components/shared/status-icon.jsx b/server/sonar-web/src/main/js/components/shared/status-icon.jsx new file mode 100644 index 00000000000..5acd210745e --- /dev/null +++ b/server/sonar-web/src/main/js/components/shared/status-icon.jsx @@ -0,0 +1,11 @@ +import React from 'react'; + +export default React.createClass({ + render() { + if (!this.props.status) { + return null; + } + var className = 'icon-status-' + this.props.status.toLowerCase(); + return <i className={className}></i>; + } +}); diff --git a/server/sonar-web/src/main/js/components/source-viewer/main.js b/server/sonar-web/src/main/js/components/source-viewer/main.js index 34df4821849..1a87855f087 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/main.js +++ b/server/sonar-web/src/main/js/components/source-viewer/main.js @@ -125,7 +125,7 @@ define([ var that = this, opts = typeof options === 'object' ? options : {}, finalize = function () { - that.requestIssues().done(function () { + that.requestNutshellIssues().done(function () { that.render(); that.trigger('loaded'); }); @@ -269,7 +269,7 @@ define([ }); }, - requestIssues: function () { + requestNutshellIssues: function () { var that = this, options = { data: { diff --git a/server/sonar-web/src/main/js/components/source-viewer/measures-overlay.js b/server/sonar-web/src/main/js/components/source-viewer/measures-overlay.js index 0341d42b883..54ec351b29b 100644 --- a/server/sonar-web/src/main/js/components/source-viewer/measures-overlay.js +++ b/server/sonar-web/src/main/js/components/source-viewer/measures-overlay.js @@ -31,7 +31,7 @@ define([ initialize: function () { var that = this, - requests = [this.requestMeasures(), this.requestIssues()]; + requests = [this.requestMeasures(), this.requestNutshellIssues()]; if (this.model.get('isUnitTest')) { requests.push(this.requestTests()); } @@ -132,7 +132,7 @@ define([ }); }, - requestIssues: function () { + requestNutshellIssues: function () { var that = this, url = baseUrl + '/api/issues/search', options = { |