Reload target period on schedule entry move, create and delete#10048
Open
BacLuc wants to merge 3 commits into
Open
Reload target period on schedule entry move, create and delete#10048BacLuc wants to merge 3 commits into
BacLuc wants to merge 3 commits into
Conversation
…le entry move When a schedule entry's start time was changed to a date belonging to a different period, only the original period's schedule entries were reloaded. The target period retained stale data and didn't show the moved entry until page reload. After a successful update, reload schedule entries for all periods that any of the edited schedule entries were moved to. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: BacLuc <lucius.bachmann@clubpage.ch>
…le entry create/delete When a schedule entry's were created, periods were never reloaded and thus stale. After a successful update, reload schedule entries for all periods that any of the edited schedule entries were moved to. Signed-off-by: BacLuc <lucius.bachmann@clubpage.ch>
It is used, I tested it. Signed-off-by: BacLuc <lucius.bachmann@clubpage.ch>
usu
requested changes
Jun 14, 2026
| this.close() | ||
| this.api.reload(this.activity) | ||
| this.api.reload(this.scheduleEntry.period().scheduleEntries()) | ||
| const originalPeriodUri = this.scheduleEntry.period()._meta.self |
Member
There was a problem hiding this comment.
I think the logic here is not correct, as it only considers the original period of this.scheduleEntry (the ScheduleEntry utilized to trigger the edit dialog) but not the other schedule Entries.
Given you have 3 periods (A,B,C) and an activity with a ScheduleEntry in A and B. If you open the edit dialog from period A and then move the 2nd ScheduleEntry from B->C, then period B is never reloaded.
I'd propose as following:
- Collect all original periods (probably we have to calculate and cache this earlier before the user can edit)
- Collect all target periods
- Array_unique and trigger api reloads
Contributor
Author
There was a problem hiding this comment.
You mean not the other original ScheduleEntry periods?
We go through all the scheduleEntries below.
| const firstPeriodIri = scheduleEntries[0].period()._meta.self | ||
| this.api.reload(this.api.get(firstPeriodIri).scheduleEntries()) | ||
| const reloadedPeriods = new Set([firstPeriodIri]) | ||
| scheduleEntries |
Member
There was a problem hiding this comment.
There's quite some overlap with the logic above. Can we reuse some of the logic?
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
fix(#5059): reload target period's schedule entries after schedule entry move
When a schedule entry's start time was changed to a date belonging to a
different period, only the original period's schedule entries were
reloaded. The target period retained stale data and didn't show the
moved entry until page reload.
After a successful update, reload schedule entries for all periods that
any of the edited schedule entries were moved to.
fixes #5059