-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: allow generating legal hold bundles in filestore directly #70
base: main
Are you sure you want to change the base?
Conversation
for _, entry := range files { | ||
header := &zip.FileHeader{ | ||
Name: entry, | ||
Method: zip.Deflate, // deflate also works, but at a cost |
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 comment makes it seem like we're not using Deflate
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.
I copied this verbatim from the original code, it's also confusing to me tbh.
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.
Looks like a comment that outlasted a code change that it shouldn't have. I'd remove it.
<OverlayTrigger | ||
|
||
// @ts-ignore | ||
delayShow={300} | ||
placement='top' |
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.
What typescript error is occurring here?
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.
Apparently this attribute does not exist. This comes from the rest of the code as well, maybe it's safe to remove?
Type '{ children: Element; delayShow: number; placement: "top"; overlay: Element; }' is not assignable to type 'IntrinsicAttributes & OverlayTriggerProps & { disabled?: boolean | undefined; className?: string | undefined; } & RefAttributes<any>'.
Property 'delayShow' does not exist on type 'IntrinsicAttributes & OverlayTriggerProps & { disabled?: boolean | undefined; className?: string | undefined; } & RefAttributes<any>'.ts(2322)
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.
If I remember correctly, this ts error is somehow spurious - the props do exist and influence UI behaviour even though ts says they don't. It was a while ago though, so may be misremembering.
webapp/src/components/legal_hold_table/legal_hold_row/legal_hold_row.tsx
Outdated
Show resolved
Hide resolved
webapp/src/components/legal_hold_table/legal_hold_row/legal_hold_row.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael Kochell <[email protected]>
Co-authored-by: Michael Kochell <[email protected]>
…ld_row.tsx Co-authored-by: Michael Kochell <[email protected]>
…ld_row.tsx Co-authored-by: Michael Kochell <[email protected]>
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.
LGTM
for _, entry := range files { | ||
header := &zip.FileHeader{ | ||
Name: entry, | ||
Method: zip.Deflate, // deflate also works, but at a cost |
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.
Looks like a comment that outlasted a code change that it shouldn't have. I'd remove it.
"github.com/mattermost/mattermost-server/v6/shared/filestore" | ||
) | ||
|
||
// fileBackendWritter is a simple io.Writer that writes to a file using a filestore.FileBackend |
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.
Is there a reason this is spelled Writter
rather than Writer
?
<OverlayTrigger | ||
|
||
// @ts-ignore | ||
delayShow={300} | ||
placement='top' |
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.
If I remember correctly, this ts error is somehow spurious - the props do exist and influence UI behaviour even though ts says they don't. It was a while ago though, so may be misremembering.
Summary
This pull request adds the feature of allowing users to create the legal hold download bundles directly in the configured filestore rather than downloading them directly in the browser.
bundle
to prevent several uploads at the same time.GenerateDownloadOnFilestore(bool)
to setup this workflow.bufio.BufferedWritter
and a customio.Writter
implementation to use themodel.Filestore
underneath.Notes
I have been experimenting with this feature for several days and before I had a setting to dis/allow this action. But when I had it ready it made no sense, since the page to download the legal holds is the same as the settings, and I had permissions to enable/disable it on the spot:
Screen.Recording.2024-06-21.at.11.59.49.mp4
(You can see the upload button appearing and disappearing)
#44