aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/coding-rules/controller.js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-12-22 18:06:43 +0100
committerStas Vilchik <vilchiks@gmail.com>2014-12-23 12:37:57 +0100
commit567c1fb55e6e53760adebe16bb55d60db9700342 (patch)
tree0bb890954976f9e9d78a6c20224e18786cb5a5d3 /server/sonar-web/src/main/js/coding-rules/controller.js
parent8eb75e33ad854822f9a6765c5941dceab8d94f8e (diff)
downloadsonarqube-567c1fb55e6e53760adebe16bb55d60db9700342.tar.gz
sonarqube-567c1fb55e6e53760adebe16bb55d60db9700342.zip
SONAR-5820 Add quality profiles
Diffstat (limited to 'server/sonar-web/src/main/js/coding-rules/controller.js')
-rw-r--r--server/sonar-web/src/main/js/coding-rules/controller.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/coding-rules/controller.js b/server/sonar-web/src/main/js/coding-rules/controller.js
index 3eec23d697c..3d391182d74 100644
--- a/server/sonar-web/src/main/js/coding-rules/controller.js
+++ b/server/sonar-web/src/main/js/coding-rules/controller.js
@@ -39,6 +39,7 @@ define([
that.app.list.add(rules);
}
that.app.list.setIndex();
+ that.app.list.addExtraAttributes(that.app.languages, that.app.repositories);
that.app.facets.reset(that._allFacets());
that.app.facets.add(r.facets, { merge: true });
that.enableFacets(that._enabledFacets());
@@ -74,26 +75,30 @@ define([
},
getRuleDetails: function (rule) {
- var url = baseUrl + '/api/rules/show',
+ var that = this,
+ url = baseUrl + '/api/rules/show',
options = {
key: rule.id,
actives: true
};
return $.get(url, options).done(function (data) {
rule.set(data.rule);
+ rule.addExtraAttributes(that.app.languages, that.app.repositories);
});
},
showDetails: function (rule) {
- var that = this;
+ var that = this,
+ ruleModel = typeof rule === 'string' ? new Backbone.Model({ key: rule }) : rule;
this.app.layout.workspaceDetailsRegion.reset();
- this.getRuleDetails(rule).done(function () {
+ this.getRuleDetails(ruleModel).done(function (data) {
key.setScope('details');
that.app.workspaceListView.unbindScrollEvents();
- that.app.state.set({ rule: rule });
+ that.app.state.set({ rule: ruleModel });
that.app.workspaceDetailsView = new RuleDetailsView({
app: that.app,
- model: rule
+ model: ruleModel,
+ actives: data.actives
});
that.app.layout.workspaceDetailsRegion.show(that.app.workspaceDetailsView);
that.app.layout.showDetails();