Skip to content

feat(timecard-entries): auto-select open timecard based on selected event - #620

Open
tomas-goncalves wants to merge 2 commits into
ABTech:masterfrom
tomas-goncalves:feat/timecard-entry-autoselect
Open

feat(timecard-entries): auto-select open timecard based on selected event#620
tomas-goncalves wants to merge 2 commits into
ABTech:masterfrom
tomas-goncalves:feat/timecard-entry-autoselect

Conversation

@tomas-goncalves

Copy link
Copy Markdown
Contributor

When creating a timecard entry, the timecard field now automatically filters to only show open timecards that cover the selected event's date.

  • If one timecard matches, it collapses to the same display as when there's only one open timecard
  • If multiple match, the dropdown is filtered to only the valid options
  • If none match (shouldn't happen), an error message is shown mentioning this is weird
  • If no timecards are open at all, a message says so instead of hiding the field entirely (improvement)

@DaAwesomeP DaAwesomeP Mar 11, 2026

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.

Can we do this all in the template/on page render instead?

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.

No - the logic needs to run again when the selected event changes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I also would prefer to precompute the mapping to keep business logic in the backend.

Comment thread app/views/timecard_entries/_form.html.erb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants