-
Notifications
You must be signed in to change notification settings - Fork 241
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
Add attachments to events #4251
Conversation
This PR addresses #298 |
72e07ca
to
2786aab
Compare
This is handled by the server: https://github.com/nextcloud/server/blob/master/apps/dav/lib/CalDAV/Schedule/IMipPlugin.php |
Codecov ReportBase: 22.25% // Head: 21.51% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #4251 +/- ##
============================================
- Coverage 22.25% 21.51% -0.74%
- Complexity 334 338 +4
============================================
Files 227 231 +4
Lines 10789 11213 +424
Branches 2045 2138 +93
============================================
+ Hits 2401 2413 +12
- Misses 8388 8800 +412
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
src/services/attachmentService.js
Outdated
})) | ||
} | ||
else { | ||
const url = `/remote.php/dav/files/${dav.userId}/${file.name}` |
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.
There's the brand new nextcloud-upload
package from @skjnldsv that might be a better fit: https://github.com/nextcloud/nextcloud-upload.
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.
Yes, clearly.
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.
Yes, clearly.
Maybe a stupid question, sorry. npm doesn't have it. How to properly add this dependence?
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.
It's not released yet :)
Nor documented btw. We can discuss what are your needs to make sure it covers them!
I still need to cover the Upload/Choose menu you have in your screenshots. Other than that, seems to be good :)
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.
@skjnldsv Well, since we are not in a hurry, we can discuss =).
I would like to be able to upload to a specific folder + have a callback to provide shared access or something else. Maybe a subscription to some events (loading before, progress, after) ...
By buttons - you need a universal button that can be entered into any standard NC component. Ex.: ListItem,ActionButton, Button and so on.
It would also be cool to be able to set the template of the uploaded file (before uploading, at the moment and after).
If you make the component universal, then in the future consider using it to upload not only to DAV, but also when writing a letter in the mail, for example...
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.
It's been published.
src/store/calendarObjectInstance.js
Outdated
addAttachmentByLocalFile(state, { calendarObjectInstance, file }){ | ||
|
||
const attachment = AttachmentProperty.fromLink(file.url) | ||
// hot-fix needed temporary, becase calendar-js has no fileName get-setter |
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.
Can you open a PR there? https://github.com/nextcloud/calendar-js
Note : this will only affect events deleted through the web UI. In the future we need to implement CalDAV-Managed Attachments (RFC 8607) sabre-io/dav#837 and let the server handle everything instead. We have time though, I'm not aware of any client implementing this (at least not Evolution, KOrganizer or even Thunderbird - this should interest @devvv4ever btw) |
I'm not fond of uploading directly to the user root folder, it might get crowded real quick. One possibility would be to handle this in the app backend (it would be irrelevant once RFC 8607 would be implemented in dav server - see above) and put files in user's appdata. However the users wouldn't have access to files apart from accessing them directly from the event. In the case of Talk the app creates a Later and with the help of file tracking for RFC 8607 we can improve these files discoverability just like Talk has now with a « all files attached to events in this calendar » section. |
@sazanof Tests have to be updated for the new |
Tell me, is it enough to add a parameter or do I need to write a full test? If it's a complete test, then I ask for help, since I've never written tests and don't understand how to write them (It's a matter of time and effort, I don't argue). =(
https://gist.github.com/sazanof/ecb2aaa8c760f93e74d2952294ba09ba When checking, I get an error. I can't understand why it occurs...
|
505b2ba
to
43ff211
Compare
Agreed, "Calendar" folder sounds good. We could also create subfolders for each calendar if possible, I think that would make it more organised. |
@tcitworld Thank you for thinking on us here too :) We would definitely love to implement attachment sync in DAVx⁵! Managed Attachments would be a really really cool feature also on Android. The problem here is that the Android Calendar storage does not offer attachments storage capabilities. So we'd need to find other apps that can provide an interface for it. We need a collaboration with others then, too (etar, acalendar+, jtx board, etc) because DAVx⁵ is not a calendar app itself so that people can also access their attachments then on Android. |
I think it shouldn't be in the root anymore. I think Deck and etc. use an Attachment/ root folder |
Dunno if the frontend is ready for reviewing but I have some design feedback that could be considered, feel free to incorporate it :) The general flow looks really great! The only feedback is regarding wording and icons. In the "empty" screenshot:
In the "with files" screenshot:
In the "file options" screenshot:
Super nice work! cc @jancborchardt |
@nimishavijay Hello! Thank you for the detailed answer and your wishes. I will definitely take them into account when updating the design. Regarding the preview for attachments: I have already implemented this, I just closed the discussion, and this branch is no longer shown. My joint.=) Here is a link to this comment file options actions, in fact, will not be needed if you open a file by clicking on its name and add only one delete button to the right of it. But what if we need to introduce a document preview function? Preview in the modal window, download and delete. Of course it won't be soon, and then you can fix the design, but still. Thanks again for your comments! |
Good stuff! Agree with @nimishavijay's feedback, just 2 points/questions:
Georg wrote back in the issue (not sure if still current): #298 (comment)
|
Just checked Google on how attachments are handled and they are uploaded into the root directory of your Google Drive, and the attachment basically links to that file. If you email another person the the event, they are able to see the attachment and if they click on it, it opens the file in Drive. |
@nimishavijay, @jancborchardt What do you say? |
1f9598e
to
75fab86
Compare
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.
@sazanof really cool! :) Some additional feedback:
- "Upload from PC" → better "Upload from device" since people might be on tablet or mobile
- The preview needs some border radius (like in Files),
var(--border-radius)
- The subline is too technical and too much information, it can just be cut
This should be doable by hooking into the sabre event lifecycle methinks.
I think the export should be ok, we sanitise the data a lot. Of course testing is needed. |
2fb2e8a
to
e087fab
Compare
Signed-off-by: Mikhail Sazanov <m@sazanof.ru>
Signed-off-by: Mikhail Sazanov <m@sazanof.ru>
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 tested it again and it works really great now! I fixed the share creation as it wasn't using the attachment folder.
There is a bug with the attachment folder picker and I'm currently researching what is causing it.
All feedback has been addressed.
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.
Tested and works!
Please squash all commits (including mine) into a single commit and then we are ready to merge.
Signed-off-by: Mikhail Sazanov <m@sazanof.ru>
2da21de
to
9d96445
Compare
Hello, @st3iny! Thank you for review =)
|
🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉 |
*** Sounds of a cork flying out of a champagne bottle *** |
Add the attachment feature to the readme nextcloud#4251 Signed-off-by: strobeflash <68517177+strobeflash@users.noreply.github.com>
Add the attachment feature to the readme #4251 Signed-off-by: strobeflash <68517177+strobeflash@users.noreply.github.com>
Fix #298
Signed-off-by: Mikhail Sazanov m@sazanof.ru
I tried to implement attachment files in events. The parameter is described here https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.1
Probably it will be a draft, although in fact everything works.
I decided to do this: there are several ways to add attachments:
Probably here you can use a separate folder "Calendar". And in the future, the place for attachments may grow, but it is more convenient for users to download from a computer, rather than choose from "Files".
I also plan to delete the file itself when deleting the event (if the owner of the event does this action), if it is not needed in the repository.
Well, the loading indication (start - end) it should also be added.
Please tell me: where is the email notification template generated when an event notification arrives (I want to add attachments section)?
I would be grateful if you would take a look and give your comments. Thanks!=)
empty
with files
file options