5
11
Fork
You've already forked tomato
1

Show upcoming shift changes #121

Merged
edwardloveall merged 3 commits from el-shift-changes into main 2026年03月24日 15:22:09 +01:00

It can be useful while doing shift triage to show when a recurring shift has upcoming changes.

We do our best here to calculate when those changes happen and link to the occurrence where they change. It's somewhat limited because I ran out of time, but still works pretty well (I think).

It can be useful while doing shift triage to show when a recurring shift has upcoming changes. <img src="/attachments/d876799e-eaab-4e2c-97b5-81704c6db2c9" width="860" height="458" /> We do our best here to calculate when those changes happen and link to the occurrence where they change. It's somewhat limited because I ran out of time, but still works pretty well (I think).
edwardloveall force-pushed el-shift-changes from 9a83277010
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
to 06cb5ed819
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
2026年03月18日 19:54:27 +01:00
Compare
edwardloveall changed target branch from el-past-users-fix to el-fix-admin-task-logs 2026年03月18日 19:55:23 +01:00
edwardloveall force-pushed el-shift-changes from 06cb5ed819
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
to d9f8e7c541
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
2026年03月18日 22:01:19 +01:00
Compare
edwardloveall force-pushed el-shift-changes from d9f8e7c541
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
to cf54efd80d
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
2026年03月23日 21:26:22 +01:00
Compare
jsilasbailey left a comment
Copy link

Not familiar enough with how reoccurrences can be set up to suggest any edge cases but seems solid to me 👍

Not familiar enough with how reoccurrences can be set up to suggest any edge cases but seems solid to me 👍
@ -26,1 +25,3 @@
@event = @shift.representative_event
@shift_summary = ShiftSummary.find(params[:id])
shift = @shift_summary.shift
@event = @shift_summary.representative_event
First-time contributor
Copy link

👍

👍
@ -0,0 +11,4 @@
def calculate
events_to_search.each_cons(2).filter_map do |(original, compare)|
next if original.single?
First-time contributor
Copy link

If I'm reading this right, these are just for safety and the recurring filter in events_to_search is what really allows this to work?

If I'm reading this right, these are just for safety and the `recurring` filter in `events_to_search` is what really allows this to work?
Author
Owner
Copy link

I'm 99% sure I had a problem without these next, but I can't reproduce it now. But yes, they're there for safety. Maybe one day they can be removed.

I'm 99% sure I had a problem without these `next`, but I can't reproduce it now. But yes, they're there for safety. Maybe one day they can be removed.
@ -0,0 +13,4 @@
events_to_search.each_cons(2).filter_map do |(original, compare)|
next if original.single?
next if compare.single?
original_recur = original.recurrence_options.except("UNTIL", "COUNT", "BYDAY")
First-time contributor
Copy link

Should we extract and name ["UNTIL", "COUNT", "BYDAY"] to show why they are excepted?

Should we extract and name ["UNTIL", "COUNT", "BYDAY"] to show why they are excepted?
edwardloveall changed target branch from el-fix-admin-task-logs to main 2026年03月24日 14:21:04 +01:00
edwardloveall force-pushed el-shift-changes from cf54efd80d
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
to 21c1d77198
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
2026年03月24日 14:53:19 +01:00
Compare
edwardloveall deleted branch el-shift-changes 2026年03月24日 15:22:11 +01:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rootable/tomato!121
Reference in a new issue
rootable/tomato
No description provided.
Delete branch "el-shift-changes"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?