-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow user to view attachments and clear unused attachments #1
Allow user to view attachments and clear unused attachments #1
Conversation
@@ -624,6 +624,52 @@ function deleteAttachmentsNotPresentInNote (markdownContent, storageKey, noteKey | |||
} | |||
} | |||
|
|||
function getAttachments (markdownContent, storageKey, noteKey) { |
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 name of the function is missleading.. it only returns certain attachments, won't it?
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.
Well it get attachment paths for 3 type of attachments:
- Existing attachments
- Existing attachments that are in use
- Existing attachments that aren't in use
What name should I put it? How about getAttachmentsPath
?
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.
hm.. don't know.. if you stay with the name, can you add javadoc explaining what it returns?
@@ -57,8 +91,61 @@ class StoragesTab extends React.Component { | |||
e.preventDefault() | |||
} | |||
|
|||
removeAllAttachments (attachments) { |
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.
Maybe this method should also be in the attachmentManagement-file..?
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.
And a test for it is required
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'm gonna put it in attachmentManagement, maybe I should change the getAttachments
function return types to compatible with this. Well I plan to do that anyway, let's do it.
@@ -25,6 +27,20 @@ function browseFolder () { | |||
}) | |||
} | |||
|
|||
function humanFileSize (bytes) { |
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.
Note to self: Move this into util file
@ehhc I have re-organized the code and added some comments for return types + added test. Tell me if I need to change anything else. |
I haven't tested your changes, but at first glance they look good |
Hi @ehhc
I have added a section in setting to allow user to view attachments and clear unused attachments.
Feel free to tell me if you need me to fix something. Thanks 👍