fix: Dashboad export loading indicator (#17613)

This commit is contained in:
Michael S. Molina 2021-12-01 13:08:38 -03:00 committed by GitHub
parent 78c5d9ac27
commit 76cd7b0481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -722,9 +722,9 @@ class DashboardRestApi(BaseSupersetModelRestApi):
$ref: '#/components/responses/500'
"""
requested_ids = kwargs["rison"]
token = request.args.get("token")
if is_feature_enabled("VERSIONED_EXPORT"):
token = request.args.get("token")
timestamp = datetime.now().strftime("%Y%m%dT%H%M%S")
root = f"dashboard_export_{timestamp}"
filename = f"{root}.zip"
@ -763,6 +763,8 @@ class DashboardRestApi(BaseSupersetModelRestApi):
resp.headers["Content-Disposition"] = generate_download_headers("json")[
"Content-Disposition"
]
if token:
resp.set_cookie(token, "done", max_age=600)
return resp
@expose("/<pk>/thumbnail/<digest>/", methods=["GET"])