-
Notifications
You must be signed in to change notification settings - Fork 433
RI:7799: Stream bulk delete report #5278
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
Merged
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
572effc
ui: delete download report button
pawelangelow 69d6fd0
be: remove keys from summary
pawelangelow 2a1fefc
this works
pawelangelow 77e9b5b
unit tests
pawelangelow 4bc0e7a
ui: add download report toggle
pawelangelow a0f0191
ui: stop showing errors
pawelangelow 8fa1f91
be: stop reporting error messages, just count
pawelangelow e5bb9d6
use timestamp in the report name
pawelangelow 54a67de
fe: fix tests
pawelangelow 4431ce2
lint issues
pawelangelow a66892f
fix test
pawelangelow 6231d39
cleanup
pawelangelow b9cc9c4
fix tests
pawelangelow 5c566c0
cleanup: leftovers
pawelangelow fa2ef44
handle missing HTTP request to start actual delete process
pawelangelow 56a3d5f
use buffers
pawelangelow 6ad83e0
extract downloadFile util
pawelangelow b68adec
address PR comment
pawelangelow c1c74d7
move download util to a separate file
pawelangelow 9ce17ac
handle late or failed stream
pawelangelow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
redisinsight/api/src/modules/bulk-actions/bulk-actions.controller.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import { Response } from 'express'; | ||
| import { | ||
| Controller, | ||
| Get, | ||
| Param, | ||
| Res, | ||
| UsePipes, | ||
| ValidationPipe, | ||
| } from '@nestjs/common'; | ||
| import { ApiParam, ApiTags } from '@nestjs/swagger'; | ||
| import { ApiEndpoint } from 'src/decorators/api-endpoint.decorator'; | ||
| import { BulkActionsService } from 'src/modules/bulk-actions/bulk-actions.service'; | ||
| import { BulkActionIdDto } from 'src/modules/bulk-actions/dto/bulk-action-id.dto'; | ||
|
|
||
| @UsePipes(new ValidationPipe({ transform: true })) | ||
| @ApiTags('Bulk Actions') | ||
| @Controller('bulk-actions') | ||
| export class BulkActionsController { | ||
| constructor(private readonly service: BulkActionsService) {} | ||
|
|
||
| @ApiEndpoint({ | ||
| description: 'Stream bulk action report as downloadable file', | ||
| statusCode: 200, | ||
| }) | ||
| @ApiParam({ | ||
| name: 'id', | ||
| description: 'Bulk action id', | ||
| type: String, | ||
| }) | ||
| @Get(':id/report/download') | ||
| async downloadReport( | ||
| @Param() { id }: BulkActionIdDto, | ||
| @Res() res: Response, | ||
| ): Promise<void> { | ||
| await this.service.streamReport(id, res); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This solution does not support multi-tenancy we need to rework it in the future