aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/shared/status-helper.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/components/shared/status-helper.jsx')
-rw-r--r--server/sonar-web/src/main/js/components/shared/status-helper.jsx26
1 files changed, 26 insertions, 0 deletions
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}/>
+ &nbsp;
+ {window.t('issue.status', this.props.status)}
+ {resolution}
+ </span>
+ );
+ }
+ });
+
+});