mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

Add Custom Date Range to Gantt Charts Part 2

Open paldeep-singh opened this issue 1 year ago • 7 comments

:bookmark_tabs: Summary

This PR is a duplicate of #4563, to resolve #1530. I am slightly desperate for this feature and did not want to trouble @AlexMooney for permission to fork his repo so I have simply copied his changes over into a new branch. Big thanks to him for letting me take over and for doing most of the work!

Most of the changes included in this PR are Alex's work, I have only done the following:

  • Changed logic for determining start date to take an end-only date range into account
    • This fixes the failures on the e2e tests for Actual date, Only start and Only end that Alex wrote in response to the one outstanding comment on his PR.
    • I have also added the documentation for verifying snapshots to the contribution docs, and had a look at the snapshots in Cypress to verify them (would appreciate a second set of eyes though since I this is my first contribution).
  • Fixed the failing ganttDb unit test

Resolves #1530

:straight_ruler: Design Decisions

[x] Remove all tasks which are completely outside of the custom range [x] Force the x-range on the plot to match the custom range (though there might be some rounding) [x] Allow setting an absolute range dateRange :2023-06-01, 2023-07-01 [ ] Allow setting a relative range dateRange :today - 7d, today + 30d (Alex suggested leaving this for future PRs and I tend to agree) [x] Allow setting only lower bound dateRange :2023-06-01 [x] Allow setting only upper bound dateRange :,2023-07-01 👈 kind of strange; proposals welcomed [x] Tests for the range values [x] Manual testing with some screen shots (As mentioned above, would appreciate a second set of eyes since I this is my first contribution)

Possible problems

  • The dateRange is interpreted with the dateFormat, so if the former comes first, it'll can screw up the date parsing
    • This was mentioned on the other PR but not as a blocker from what I could tell, let me know if it is and I can look into it

:clipboard: Tasks

Make sure you

  • [x] :book: have read the contribution guidelines
  • [x] :computer: have added necessary unit/e2e tests.
  • [x] :notebook: have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • [x] :bookmark: targeted develop branch

paldeep-singh avatar Jan 20 '24 13:01 paldeep-singh