RocketChat / RocketChat/Rocket.Chat

feat(omnichannel): Add time validation for Business Hours form

Open
#38,344 1 comment 0 reactions 0 assignees View on GitHub

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:

  1. Start time equal to finish time (e.g., Open: 09:00, Close: 09:00)
  2. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.