Skip to content
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 editing calendar on existing events #1421

Merged
merged 9 commits into from
Jun 10, 2024

Conversation

jonas-haeusler
Copy link
Contributor

@jonas-haeusler jonas-haeusler commented Jul 18, 2023

these changes have been lying around for some time, finally found the time to finalize them and create this merge request.

in essence, this will just delete the old event and recreate it with a new id in the new calendar.
please test thoroughly and let me know if something is unclear.

fixes a bunch of open (duplicated) issues, here a few i found while quickly scanning the backlog:
fixes #62
fixes #101
fixes #812
fixes #1266
fixes #1400
fixes #1410

and also fixes #1351 and fixes #1134: the color picker is now hidden if the calendar does not provide any colors.

@Gitsaibot
Copy link
Contributor

Gitsaibot commented Jul 19, 2023

Thank you for the pull request. I think many have been waiting for this ;).

@ALL It would help us if many test these changes. The more test it in advance the faster we can create a new version.
Here is the link to the apk: https://github.com/Etar-Group/Etar-Calendar/actions/runs/5603553145

@jpggithub
Copy link

Hi
I try the apk on lineage kuntao 18.1 (android 11).
I can edit an event and change the calendar without problem.

@Luensche
Copy link

After a quick test: Everything looks fine. :)

@jonas-haeusler jonas-haeusler force-pushed the feature/edit_calendar branch from 4d3e7c5 to 257635f Compare July 19, 2023 20:01
@dumblob
Copy link

dumblob commented Jul 19, 2023

Is this transactional? I.e. using two-phase commit (i.e. first creating a copy in the destination calendar, and if successful, then removing the original).

@jonas-haeusler
Copy link
Contributor Author

no, currently, the existing event is deleted and then the new event is inserted. should the deletion fail, the event is lost. i agree that this is suboptimal, and first inserting and only deleting on success would already provide a safety net. i don't know how easy (or not) this would be to implement. sadly, we can't just slap @transactional on here :-(

on another note: changing the calendar on a recurring event seems to be broken right now. this will require some more work...

@jonas-haeusler jonas-haeusler marked this pull request as draft July 20, 2023 11:53
@BalooRJ1
Copy link

Thank you for implementing this! Looking forward to seeing it pushed to the final version.

@Cwpute
Copy link

Cwpute commented Sep 10, 2023

Thank you for the pull request. I think many have been waiting for this ;).

@ALL It would help us if many test these changes. The more test it in advance the faster we can create a new version. Here is the link to the apk: https://github.com/Etar-Group/Etar-Calendar/actions/runs/5603553145

Tested on Android 11, Nokia TA-1157: it works too!

@mgw2013
Copy link

mgw2013 commented Oct 26, 2023

Happy to test but would need a link.

@Gitsaibot
Copy link
Contributor

Gitsaibot commented Oct 26, 2023

@mgw2013 All you have to do is look under Actions where you will find the workflows and the appropriate apk. But here is the link https://github.com/Etar-Group/Etar-Calendar/actions/runs/6519434058

@jonas-haeusler jonas-haeusler force-pushed the feature/edit_calendar branch 2 times, most recently from f1f64e3 to b1931c0 Compare November 13, 2023 00:12
@kerbless
Copy link

in essence, this will just delete the old event and recreate it with a new id in the new calendar.

Is this really the only way to do this?

@Gitsaibot
Copy link
Contributor

Ready for testing or is something still missing?

@jonas-haeusler
Copy link
Contributor Author

recurring events should currently work okay-ish (i think there were some problems with recurrence exceptions when moving them to local/synced calendars) and the whole thing is now transactional, so all or nothing, which is nice.

i currently don't know how to proceed with the todo here, as this method is not available before api level 30 and there seems to be no easy workaround for that. maybe the moving of recurring events should just be disabled for now (or for users of api level <30) to get this merged?

@Gitsaibot
Copy link
Contributor

I think moving recurring events for users of api level 30 would be a good solution. If there are problems for users >api 30 with recurring events, we can still deactivate it for everyone. Would that be feasible?

@jspricke What do you think?

@jspricke
Copy link
Member

Enabling it for API 30 only would be fine with me.

@Etar-Group Etar-Group deleted a comment from mgw2013 Jan 20, 2024
@jonas-haeusler jonas-haeusler force-pushed the feature/edit_calendar branch 2 times, most recently from cbd2a5b to 211eca1 Compare January 27, 2024 17:08
@myshen
Copy link

myshen commented Feb 7, 2024

Tested on Android 14, Samsung Galaxy. works great!

@Gitsaibot
Copy link
Contributor

Ready to review?

@jonas-haeusler jonas-haeusler marked this pull request as ready for review March 11, 2024 20:59
@jonas-haeusler
Copy link
Contributor Author

Ready to review?

sorry for the late reply. yes, this is ready for review and testing. if possible, I would appreciate if you could test moving events between calendars (of different providers if possible, and local/synced calendars) and check whether all event properties stay as expected. thank you!

@Gitsaibot
Copy link
Contributor

At a first glance: editEventLayout seems to be broken. The vertical alignment does not fit and the calendar name is no longer displayed at all in the black theme.

Screenshot_20240314_114402

@Gitsaibot
Copy link
Contributor

What I also noticed is that if you change the privacy setting and the calendar at the same time, for example, this setting is not applied.

@Gitsaibot
Copy link
Contributor

Apart from the two things mentioned above, I haven't noticed anything else so far. Can you have a look? It would be cool if we could complete the PR before it's one year old ;)

@mgw2013
Copy link

mgw2013 commented May 18, 2024

Would love but can't locate the .apk for testing purposes. Might be me or this mobile client...

@jonas-haeusler jonas-haeusler force-pushed the feature/edit_calendar branch 2 times, most recently from ec608be to 1b4100b Compare June 2, 2024 22:19
@jonas-haeusler jonas-haeusler force-pushed the feature/edit_calendar branch from 1b4100b to be82fe7 Compare June 3, 2024 22:10
@jonas-haeusler
Copy link
Contributor Author

Apart from the two things mentioned above, I haven't noticed anything else so far. Can you have a look? It would be cool if we could complete the PR before it's one year old ;)

@Gitsaibot these issues should now be fixed (amongst a few others). if you find the time, please retest and let me know whether it is working for you.

i hope that recurrences are mostly working now. they were a lot harder to get right than i expected.
in fact, one case that is currently still broken is if a recurrence is synced with the EXDATE property set, and then the start time of the recurrence is changed by Etar, then this change does not currently update the start time within the EXDATE property, effectively removing any exceptions defined by EXDATE. however, adding EXDATE support is out of scope for this imo.

Would love but can't locate the .apk for testing purposes. Might be me or this mobile client...

@mgw2013 see https://github.com/Etar-Group/Etar-Calendar/actions/runs/9357933167.

@Gitsaibot
Copy link
Contributor

Thank you very much, I will test it as soon as possible.

@mgw2013
Copy link

mgw2013 commented Jun 4, 2024

Just tried to move a single instance of a recurring event to another calendar - doesn't work. The drop down menu is greyed out.

However, moving the entire series to another calendar works, which is much appreciated! -mgw

@mgw2013
Copy link

mgw2013 commented Jun 4, 2024

Uhhh....it looks like the changes are not replicated via WebDav to the host...waited for several minutes and issued several sync requests on all devices. -mgw

@jonas-haeusler
Copy link
Contributor Author

Just tried to move a single instance of a recurring event to another calendar - doesn't work. The drop down menu is greyed out.

yeah, I disabled moving single instances out of recurrences, as this would be a lot more work. its currently either all or nothing.

it looks like the changes are not replicated via WebDav to the host

can you please tell me how your setup looks like? which sync provider do you use on android and which caldav server software are you running?

@mgw2013
Copy link

mgw2013 commented Jun 5, 2024

can you please tell me how your setup looks like? which sync provider do you use on android and which caldav server software are you running?
Android 14 May w/ sec update DAVx5 from F-Droid. Calendar on GMX mail system - not sure what they r using.

Anyhow - I did a new test - it just takes a longer time to replicate the changes to the host and vice versa. So things r working as designed but slow.

@Gitsaibot
Copy link
Contributor

Tested with google and nextcloud calendar so far I could not find any obvious errors.

So things r working as designed but slow.

The change of the calendar is executed directly in Etar how fast the changes are synchronized with online calendars etc. is not in the hands of Etar.

@Gitsaibot
Copy link
Contributor

@jspricke Any objections? Otherwise I would merge it later and create a new version.

@Gitsaibot Gitsaibot merged commit 190fb0d into Etar-Group:master Jun 10, 2024
1 check passed
@szaimen
Copy link

szaimen commented Jun 10, 2024

🎉🎉🎉🎉🎉

@mgw2013
Copy link

mgw2013 commented Jun 10, 2024

Good job! Txs for ur effort - much appreciated

@jonas-haeusler jonas-haeusler deleted the feature/edit_calendar branch June 11, 2024 09:36
@wilhelmy
Copy link

Awesome, thank you @jonas-haeusler!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment