Skip to content

Reload target period on schedule entry move, create and delete#10048

Open
BacLuc wants to merge 3 commits into
ecamp:develfrom
BacLuc:reload-target-period-on-schedule-entry-move
Open

Reload target period on schedule entry move, create and delete#10048
BacLuc wants to merge 3 commits into
ecamp:develfrom
BacLuc:reload-target-period-on-schedule-entry-move

Conversation

@BacLuc

@BacLuc BacLuc commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

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

BacLuc and others added 3 commits June 13, 2026 20:23
…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>
@BacLuc BacLuc requested a review from a team June 13, 2026 18:38
this.close()
this.api.reload(this.activity)
this.api.reload(this.scheduleEntry.period().scheduleEntries())
const originalPeriodUri = this.scheduleEntry.period()._meta.self

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Collect all original periods (probably we have to calculate and cache this earlier before the user can edit)
  2. Collect all target periods
  3. Array_unique and trigger api reloads

@BacLuc BacLuc Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's quite some overlap with the logic above. Can we reuse some of the logic?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reload target period if ScheduleEntry is moved to another period

2 participants