-
Notifications
You must be signed in to change notification settings - Fork 48
feat(cloud): add folder download as zip archive with loading state and blob error parsing (#279) #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(cloud): add folder download as zip archive with loading state and blob error parsing (#279) #297
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -171,6 +171,14 @@ export class CloudService { | |
| }); | ||
| } | ||
|
|
||
| getFolderArchive(relativePath: string): Observable<Blob> { | ||
| const path = this.normalizePath(relativePath); | ||
| return this.http.get(`${this.apiUrl}/folders/archive`, { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This endpoint is not implemented in cloud-page yet (the dependency Vault-Web/cloud-page#105 is an open issue with no PR). The URL and the folderPath param name are guesses until the backend lands. Once it does, verify both against the actual controller and add rate limit and oversized folder handling if the backend returns specific statuses for those, since the acceptance criteria in #279 call them out. |
||
| params: new HttpParams().set('folderPath', path), | ||
| responseType: 'blob', | ||
| }); | ||
| } | ||
|
|
||
| getFileView(path: string) { | ||
| return this.http.get(`${this.apiUrl}/files/view`, { | ||
| params: { path }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error specs wait on a raw setTimeout of 50ms before asserting, which is a flake risk on slow CI. parseBlobError completes its observable, so you can assert inside the subscribe callback or use fakeAsync with tick instead of a wall clock delay.