RocketChat / RocketChat/Rocket.Chat
feat(omnichannel): Add time validation for Business Hours form
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description
Currently, the Business Hours form (BusinessHoursForm.tsx) allows users to set invalid time configurations:
- Start time equal to finish time (e.g., Open: 09:00, Close: 09:00)
- Start time greater than finish time (e.g., Open: 18:00, Close: 08:00)
These invalid configurations can cause unexpected behavior in the livechat business hours logic.
Current Behavior
- No validation on start/finish time inputs
- Invalid time configurations are saved to the database
- TODO comments already exist in the codebase (lines 37-38 of BusinessHoursForm.tsx)
Expected Behavior
- Show error message when start time equals finish time
- Show error message when start time is greater than finish time
- Prevent form submission until times are valid
Screenshots/Evidence
The TODO comments in the codebase:
// TODO: add time validation for start and finish not be equal on UI
// TODO: add time validation for start not be higher than finish on UI
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with BusinessHoursForm.tsx and inspect the time inputs, form submission flow, and the TODO comments around lines 37-38. Confirm how the form currently saves values, then make the completed behavior show errors for equal or reversed times and prevent submission until the times are valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100