Browse Source

[sentry] Removed trailing dots from the add role form

Enrico Berti 9 năm trước cách đây
mục cha
commit
9dfa167

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

@@ -117,9 +117,12 @@ var Privilege = function (vm, privilege) {
   self.showAdvanced = ko.observable(false);
   self.path = ko.computed({
     read: function () {
-      return $.map(self.authorizables(), function(authorizable) {
-        return authorizable.name_();
+      var path = $.map(self.authorizables(), function(authorizable) {
+        if (authorizable.name_() !== ''){
+          return authorizable.name_();
+        }
       }).join(".");
+      return path;
     },
     write: function (value) {
       var _parts = value.split(".");

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

@@ -72,9 +72,7 @@ ${ layout.menubar(section=component) }
       <select data-bind="options: $root.availableActions, value: $data.action, enable: (privilegeType() == 'db')" style="width: 100px; margin-bottom: 0"></select>
     <!-- /ko -->
     <!-- ko if: $root.component() == 'solr' -->
-      <span data-bind="text: ko.mapping.toJSON($data)"></span>
-      <br/>
-      <input type="text" data-bind="hivechooser: $data.path, enable: privilegeType() == 'db'" placeholder="dbName.tableName <CTRL+SPACE>">
+      <input type="text" data-bind="hivechooser: $data.path, enable: privilegeType() == 'db'" placeholder="collections.collectionName <CTRL+SPACE>">
       <select data-bind="options: $root.availableActions, value: $data.action, enable: (privilegeType() == 'db')" style="width: 100px; margin-bottom: 0"></select>
     <!-- /ko -->