Forráskód Böngészése

HUE-3926 [sentry] Link to the search collections on the Roles section

Romain Rigaux 9 éve
szülő
commit
8c06cce054

+ 2 - 2
apps/security/src/security/static/security/js/sentry.ko.js

@@ -138,8 +138,8 @@ var Privilege = function (vm, privilege) {
   });
 
   self.indexerPath = ko.computed(function () {
-    if (self.authorizables()[1] && self.authorizables()[1]['type'] == 'TABLE') {
-      return '/indexer/#edit/' + self.authorizables()[1];
+    if (self.authorizables().length > 0 && self.authorizables()[0].type() == 'COLLECTION') {
+      return '/indexer/#edit/' + self.authorizables()[0].name_();
     }
     else {
       return '/indexer/#manage';

+ 6 - 1
apps/security/src/security/templates/sentry.mako

@@ -144,7 +144,12 @@ ${ layout.menubar(section=component) }
           <!-- ko if: $index() > 0 -->
             <i class="fa fa-long-arrow-right"></i>
           <!-- /ko -->
-          <span data-bind="text: type"></span>=<span data-bind="text: name_"></span></span>
+          <!-- ko if: type() == 'COLLECTION' && name_() != '*' -->
+            <span data-bind="text: type"></span>=<a data-bind="attr: { href: $parent.indexerPath() }" target="_blank"><span data-bind="text: name_"></span></a></span>
+          <!-- /ko -->
+          <!-- ko ifnot: type() == 'COLLECTION' && name_() != '*' -->
+            <span data-bind="text: type"></span>=<span data-bind="text: name_"></span></span>
+          <!-- /ko -->
         <!-- /ko -->
       <!-- /ko -->
     <!-- /ko -->