aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-04-06 14:02:06 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-04-06 14:02:06 +0200
commitf724b60f2809ea1b33e5060c714b9ce8c80fa226 (patch)
treea4d5c93b101e7e25488f9c8d998c33606cd6af4f
parent918bd5b1f71c095b267b00c681deb3e3029bcc54 (diff)
downloadsonarqube-f724b60f2809ea1b33e5060c714b9ce8c80fa226.tar.gz
sonarqube-f724b60f2809ea1b33e5060c714b9ce8c80fa226.zip
fix rule workspace
-rw-r--r--server/sonar-web/src/main/js/components/workspace/main.js5
-rw-r--r--server/sonar-web/src/main/js/components/workspace/models/item.js11
2 files changed, 7 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/components/workspace/main.js b/server/sonar-web/src/main/js/components/workspace/main.js
index 79735999c64..28381164816 100644
--- a/server/sonar-web/src/main/js/components/workspace/main.js
+++ b/server/sonar-web/src/main/js/components/workspace/main.js
@@ -75,11 +75,11 @@ Workspace.prototype = {
},
openComponent (options) {
- return this.open(_.extend(options, { type: 'component' }));
+ return this.open(_.extend(options, { '__type__': 'component' }));
},
openRule (options) {
- return this.open(_.extend(options, { type: 'rule' }));
+ return this.open(_.extend(options, { '__type__': 'rule' }));
},
showViewer (Viewer, model) {
@@ -142,4 +142,3 @@ Workspace.getInstance = function () {
};
export default Workspace.getInstance();
-
diff --git a/server/sonar-web/src/main/js/components/workspace/models/item.js b/server/sonar-web/src/main/js/components/workspace/models/item.js
index 69f855577a9..c896c940244 100644
--- a/server/sonar-web/src/main/js/components/workspace/models/item.js
+++ b/server/sonar-web/src/main/js/components/workspace/models/item.js
@@ -22,23 +22,23 @@ import Backbone from 'backbone';
export default Backbone.Model.extend({
validate () {
- if (!this.has('type')) {
+ if (!this.has('__type__')) {
return 'type is missing';
}
- if (this.get('type') === 'component' && !this.has('uuid')) {
+ if (this.get('__type__') === 'component' && !this.has('uuid')) {
return 'uuid is missing';
}
- if (this.get('type') === 'rule' && !this.has('key')) {
+ if (this.get('__type__') === 'rule' && !this.has('key')) {
return 'key is missing';
}
},
isComponent () {
- return this.get('type') === 'component';
+ return this.get('__type__') === 'component';
},
isRule () {
- return this.get('type') === 'rule';
+ return this.get('__type__') === 'rule';
},
destroy (options) {
@@ -46,4 +46,3 @@ export default Backbone.Model.extend({
this.trigger('destroy', this, this.collection, options);
}
});
-