Skip to content

fix: [M3-10399] - Restore the previous date value when Cancel is clicked - #12611

Merged
cpathipa merged 4 commits into
linode:developfrom
cpathipa:M3-10399
Jul 31, 2025
Merged

cpathipa merged 4 commits into
linode:developfrom
cpathipa:M3-10399

Conversation

@cpathipa

Copy link
Copy Markdown
Contributor

Description 📝

This PR fixes that when a user opens the DateTimeRangePicker and makes changes to the selected date or time, and then clicks the Cancel button, all changes are discarded and the fields revert to their previous values. This improves the user experience by allowing safe exploration without committing accidental changes.

Changes 🔄

List any change(s) relevant to the reviewer.

  • DateTimeRangePicker.tsx
  • DateTimeRangePicker.test.tsx

Target release date 🗓️

8/12

Preview 📷

Datev201.mov

How to test 🧪

(How to verify changes)

  • Navigate to http://localhost:3000/metrics
  • Switch to mock user
  • Click on the Start Date field
  • Make changes to the either by selecting new date or time or presets
  • Click Cancel and verify the Start Date field should set to previous value.
  • Verify no regressions to the existing functionality

Ensure the popover with calendar and time inputs appears.

Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All tests and CI checks are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@cpathipa
cpathipa requested a review from a team as a code owner July 30, 2025 20:34
@cpathipa
cpathipa requested review from bill-akamai and bnussman-akamai and removed request for a team July 30, 2025 20:34
@cpathipa cpathipa self-assigned this Jul 30, 2025
@linode-gh-bot

Copy link
Copy Markdown

Cloud Manager UI test results

🎉 701 passing tests on test run #4 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
0 Failing701 Passing4 Skipped121m 59s

@cpathipa
cpathipa requested a review from nikhagra-akamai July 31, 2025 02:22

@bnussman-akamai bnussman-akamai left a comment

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.

Change looks reasonable!

We do have a usePrevious helper hook available if that would be useful

@github-project-automation github-project-automation Bot moved this from Review to Approved in Cloud Manager Jul 31, 2025
@cpathipa
cpathipa merged commit ddfa049 into linode:develop Jul 31, 2025
32 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Merged in Cloud Manager Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants