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.
This commit is contained in:
swviswan 2020-09-10 23:39:33 -07:00 committed by GitHub
parent ed9b443bf6
commit a2845a0102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -195,8 +195,9 @@ export class NotebookContentClient {
} }
public readFileContent(filePath: string): Promise<string> { public readFileContent(filePath: string): Promise<string> {
const fileType = NotebookUtil.isNotebookFile(filePath) ? "notebook" : "file";
return this.contentProvider return this.contentProvider
.get(this.getServerConfig(), filePath, { type: "notebook", format: "text", content: 1 }) .get(this.getServerConfig(), filePath, { type: fileType, format: "text", content: 1 })
.toPromise() .toPromise()
.then(xhr => { .then(xhr => {
const content = (xhr.response as any).content; const content = (xhr.response as any).content;