mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Update export CSV and Excel endpoints
Summary: The endpoints for exporting CSV and Excel are now under /api/docs/:docId/ and are forwarded to a doc worker for export. The Share Menu has been updated to use the new endpoints. Test Plan: No new tests. Existing tests that verify endpoints work correctly. Reviewers: paulfitz Reviewed By: paulfitz Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3007
This commit is contained in:
@@ -626,11 +626,11 @@ export class GristDoc extends DisposableWithEvents {
|
||||
}
|
||||
|
||||
public getXlsxLink() {
|
||||
const baseUrl = this.docPageModel.appModel.api.getDocAPI(this.docId()).getGenerateXlsxUrl();
|
||||
const params = {
|
||||
...this.docComm.getUrlParams(),
|
||||
title: this.docPageModel.currentDocTitle.get(),
|
||||
};
|
||||
return this.docComm.docUrl(`gen_xlsx`) + '?' + encodeQueryParams(params);
|
||||
return baseUrl + '?' + encodeQueryParams(params);
|
||||
}
|
||||
|
||||
public getCsvLink() {
|
||||
@@ -638,15 +638,16 @@ export class GristDoc extends DisposableWithEvents {
|
||||
colRef : field.colRef.peek(),
|
||||
filter : field.activeFilter.peek()
|
||||
}));
|
||||
|
||||
const baseUrl = this.docPageModel.appModel.api.getDocAPI(this.docId()).getGenerateCsvUrl();
|
||||
const params = {
|
||||
...this.docComm.getUrlParams(),
|
||||
title: this.docPageModel.currentDocTitle.get(),
|
||||
viewSection: this.viewModel.activeSectionId(),
|
||||
tableId: this.viewModel.activeSection().table().tableId(),
|
||||
activeSortSpec: JSON.stringify(this.viewModel.activeSection().activeSortSpec()),
|
||||
filters : JSON.stringify(filters),
|
||||
};
|
||||
return this.docComm.docUrl(`gen_csv`) + '?' + encodeQueryParams(params);
|
||||
return baseUrl + '?' + encodeQueryParams(params);
|
||||
}
|
||||
|
||||
public hasGranularAccessRules(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user