]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6918 fix display of internal WS
authorStas Vilchik <vilchiks@gmail.com>
Mon, 9 Nov 2015 15:07:28 +0000 (16:07 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 9 Nov 2015 15:07:28 +0000 (16:07 +0100)
server/sonar-web/src/main/js/apps/api-documentation/action-view.js
server/sonar-web/src/main/js/apps/api-documentation/app.js
server/sonar-web/src/main/js/apps/api-documentation/controller.js
server/sonar-web/src/main/js/apps/api-documentation/item-view.js

index 8ac7ec60f964a8a0886b9e0ff2bb4b94b1431a28..b96ca7e0c0716e7066b2c61100a06b0ee62299e5 100644 (file)
@@ -16,7 +16,7 @@ export default Marionette.ItemView.extend({
   },
 
   initialize: function () {
-    this.listenTo(this.options.state, 'change:query', this.toggleHidden);
+    this.listenTo(this.options.state, 'change', this.toggleHidden);
   },
 
   onRender: function () {
@@ -47,6 +47,6 @@ export default Marionette.ItemView.extend({
 
   toggleHidden: function () {
     var test = this.model.get('path') + '/' + this.model.get('key');
-    this.$el.toggleClass('hidden', !this.options.state.match(test));
+    this.$el.toggleClass('hidden', !this.options.state.match(test, this.model.get('internal')));
   }
 });
index f345685e8da7af909637cd2fb2d4b63926ac385a..ac3f28c00cf626a784e4e4a973b039a529b427e9 100644 (file)
@@ -16,9 +16,10 @@ var App = new Marionette.Application(),
 
       // State
       this.state = new Backbone.Model({ internal: false });
-      this.state.match = function (test) {
+      this.state.match = function (test, internal) {
         var pattern = new RegExp(this.get('query'), 'i');
-        return test.search(pattern) !== -1;
+        var internalCheck = !this.get('internal') && internal;
+        return test.search(pattern) !== -1 && !internalCheck;
       };
 
       // Layout
index 1d668e2d46f89ee0565b2701a32663705d2605e8..4b75c7138df466b6a60607b5f4f53d8ad700e354 100644 (file)
@@ -62,7 +62,13 @@ export default Marionette.Controller.extend({
     this.options.app.layout.headerRegion.show(new HeaderView({ model: item }));
 
     if (opts.action != null) {
-      actionsView.scrollToAction(opts.action);
+      var model = actions.findWhere({ key: opts.action });
+      if (model) {
+        if (model.get('internal')) {
+          this.options.state.set({ internal: true });
+        }
+        actionsView.scrollToAction(opts.action);
+      }
     } else {
       actionsView.scrollToTop();
     }
index 6a8c1143b17f8ce39d0b10402b42604e3236a8c8..c8435bae3246ca0ed33befa197a25b20c8fb463e 100644 (file)
@@ -25,7 +25,7 @@ export default Marionette.ItemView.extend({
     var match = this.options.state.match(this.model.get('path')) ||
         _.some(this.model.get('actions'), function (action) {
           var test = action.path + '/' + action.key;
-          return that.options.state.match(test);
+          return that.options.state.match(test, action.internal);
         });
 
     var showInternal = this.options.state.get('internal'),