浏览代码

HUE-4383 [editor] Trashed queries are showing up in the list of saved queries

V1, I kind of think that we should not include them by default and switch the default to false.
Romain Rigaux 9 年之前
父节点
当前提交
73ef431

+ 2 - 0
desktop/core/src/desktop/api2.py

@@ -69,6 +69,8 @@ def search_documents(request):
   Optional params:
     perms=<mode>       - Controls whether to retrieve owned, shared, or both. Defaults to both.
     include_history=<bool> - Controls whether to retrieve history docs. Defaults to false.
+    include_trashed=<bool> - Controls whether to retrieve docs in the trash. Defaults to true.
+    include_managed=<bool> - Controls whether to retrieve docs generated by Hue. Defaults to false.
     flatten=<bool>     - Controls whether to return documents in a flat list, or roll up documents to a common directory
                          if possible. Defaults to true.
     page=<n>           - Controls pagination. Defaults to 1.

+ 2 - 1
desktop/core/src/desktop/static/desktop/js/apiHelper.js

@@ -397,7 +397,8 @@
         text: options.query,
         type: options.type,
         page: options.page,
-        limit: options.limit
+        limit: options.limit,
+        include_trashed: options.include_trashed
       },
       success: function (data) {
         if (! self.successResponseIsError(data)) {

+ 2 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -304,7 +304,8 @@
         page: self.queriesCurrentPage(),
         limit: QUERIES_PER_PAGE,
         type: 'query-' + self.type(),
-        query: self.queriesFilter()
+        query: self.queriesFilter(),
+        include_trashed: false
       });
     }