(feat) Improve appointments calendar with monthly, weekly, and daily drill-down views#2321
Open
Brijesh03032001 wants to merge 2 commits intoopenmrs:mainfrom
Open
Conversation
…ments calendar The calendar was only showing a monthly overview before, with no way to get a closer look at specific weeks or days. This adds weekly and daily views that you can switch between using a tab switcher in the header. Clicking on a day now opens a modal showing all the appointments for that day, grouped by service — so you no longer get redirected away from the calendar. Changes include: - Monthly/weekly/daily view switcher in the calendar header - New WeeklyCalendarView and DailyCalendarView components - Day cells and service rows open a Carbon Modal on click (no navigation) - weekDays() helper added for weekly view grid - calendarView state added to the appointments store - Tests for the new views, header switcher, and helper functions
Added missing i18n keys for the daily, weekly and monthly views — things like navigation labels, modal text, and empty state messages. Co-Authored-By: Brijesh Kumar <brijeshkumar03@users.noreply.github.com>
72c0f51 to
e6d5617
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
https://issues.openmrs.org/browse/O3-5484
What I worked on
The appointments calendar wasn't very useful in its current state — it only showed a monthly grid with counts per service, and clicking a day would navigate you away from the calendar entirely. I worked on making it significantly more functional.
Here's what I added:
Three calendar views (Monthly, Weekly, Daily) — I added a content switcher in the calendar header so you can switch between views. The selected view is stored in the global store so it stays in sync.
Modal on click — Instead of navigating away when you click a day, I made it open a Carbon modal that shows all appointments for that day grouped by service. This keeps you in context.
Weekly view — I built a weekly grid showing all 7 days of the current week with service counts per day. You can navigate between weeks with Prev/Next buttons.
Daily view — I added a focused daily view with a full service breakdown table, a total count, a "Today" badge for the current date, and Prev/Next day navigation.
Tests — I wrote tests for all three new views, the calendar header switcher, and the
weekDays/isSameMonthhelper functions.Notes for reviewers
ContentSwitcherfor the view tabs — happy to change this if there's a preferred approach.@internationalized/datesupport for non-Gregorian calendars is not in this PR yet — I plan to tackle that as a follow-up.appointments-form.test.tsxare pre-existing and unrelated to this PR.Screenshots