From a2845a0102da68b680a6752726d45f3646985d69 Mon Sep 17 00:00:00 2001 From: swviswan <63078515+swviswan@users.noreply.github.com> Date: Thu, 10 Sep 2020 23:39:33 -0700 Subject: [PATCH] Notebooks: Ability to download file in notebooks. (#194) Today, if we have non notebook file in the container and we try to download the file, it fails. That is because, the filetype is always defined as notebook in the call to content provider's get method. Fixing it to use the right type in this change. --- src/Explorer/Notebook/NotebookContentClient.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Explorer/Notebook/NotebookContentClient.ts b/src/Explorer/Notebook/NotebookContentClient.ts index b4036fadf..a3e52327e 100644 --- a/src/Explorer/Notebook/NotebookContentClient.ts +++ b/src/Explorer/Notebook/NotebookContentClient.ts @@ -195,8 +195,9 @@ export class NotebookContentClient { } public readFileContent(filePath: string): Promise { + const fileType = NotebookUtil.isNotebookFile(filePath) ? "notebook" : "file"; return this.contentProvider - .get(this.getServerConfig(), filePath, { type: "notebook", format: "text", content: 1 }) + .get(this.getServerConfig(), filePath, { type: fileType, format: "text", content: 1 }) .toPromise() .then(xhr => { const content = (xhr.response as any).content;