Fix bugs in resources download

Fix a bug caused when downloading with smart query filter on. Also
fix a bug in downloading presets.
This commit is contained in:
Shweelan Samson authored and Zaid Abdulla committed 2019-03-04 16:12:39 -08:00
1 parent 3b3369a236
commit d70263e798
7 files changed
+26 -22

No files matched your search

+3 -3
View File
@@ -8,7 +8,7 @@ import memoize from "../lib/common/memoize";
import putFormComponent from "./put-form-component";
import * as overlay from "./overlay";
import * as smartQuery from "./smart-query";
import { map, parse } from "../lib/common/expression-parser";
import { map, parse, stringify } from "../lib/common/expression-parser";
const PAGE_SIZE = config.ui.pageSize || 10;
@@ -112,7 +112,7 @@ const getDownloadUrl = memoize(filter => {
const cols = {};
for (const attr of attributes) cols[attr.label] = attr.id;
return `/api/files.csv?${m.buildQueryString({
filter: filter,
filter: stringify(filter),
columns: JSON.stringify(cols)
})}`;
});
@@ -375,7 +375,7 @@ export const component: ClosureComponent = (): Component => {
}
vnode.state["selected"] = selected;
const downloadUrl = getDownloadUrl(vnode.attrs["filter"]);
const downloadUrl = getDownloadUrl(filter);
const attrs = {};
attrs["resource"] = "files";