Browse Source

[search] Allow shared dashboards to be copied

Romain Rigaux 10 năm trước cách đây
mục cha
commit
d548f11b1b

+ 1 - 1
apps/search/src/search/static/search/js/collections.ko.js

@@ -151,7 +151,7 @@ var SearchCollectionsModel = function (props) {
   };
 
   self.copyCollections = function (collections) {
-    if (self.atLeastOneSelected()){
+    if (self.selectedCollections().length > 0){
       $(document).trigger("copying");
       $.post(self.COPY_URL, {
           collections: ko.mapping.toJSON(self.selectedCollections())

+ 2 - 2
apps/search/src/search/templates/admin_collections.mako

@@ -44,11 +44,11 @@ ${ commonheader(_('Search'), "search", user, "29px") | n,unicode }
   <div class="card card-home card-small">
     <%actionbar:render>
       <%def name="search()">
-        <input type="text" placeholder="${_('Filter dashboards...')}" class="input-xlarge search-query" id="filterInput" data-bind="visible: collections().length > 0 && !isLoading()">
+        <input type="text" placeholder="${_('Filter dashboards...')}" class="input-xlarge search-query" id="filterInput" data-bind="visible: collections().length > 0 && ! isLoading()">
       </%def>
 
       <%def name="actions()">
-        <a data-bind="visible: collections().length > 0 && !isLoading(), click: $root.copyCollections, clickBubble: false, css: {'btn': true, 'disabled': ! atLeastOneSelected()}">
+        <a data-bind="visible: collections().length > 0 && !isLoading(), click: $root.copyCollections, clickBubble: false, css: {'btn': true, 'disabled': selectedCollections().length == 0}">
           <i class="fa fa-files-o"></i> ${_('Copy')}
         </a>