Skip to content

bugfix/AB#32195-quick-date-range-not-dynamic#2102

Merged
JamesPasta merged 2 commits intodevfrom
bugfix/AB#32195-quick-date-range-not-dynamic-on-load
Mar 6, 2026
Merged

bugfix/AB#32195-quick-date-range-not-dynamic#2102
JamesPasta merged 2 commits intodevfrom
bugfix/AB#32195-quick-date-range-not-dynamic-on-load

Conversation

@DavidBrightBcGov
Copy link
Contributor

Fixed bug that when the QuickDateRange was loaded from memory, stored dates rather than dynamic dates were set. Now when loading, if a quick range is selected, dates are regenerated, and stored dates are only loaded for the 'Custom' range.

Centralized date range filter handling to update UI, filter state, and localStorage consistently.

Fixed an extra bug that date ranges saved with table views were overriding local storage on page load.

Fixed bug that when the QuickDateRange was loaded from memory, stored dates rather than dynamic dates were set. Now when loading, if a quick range is selected, dates are regenerated, and stored dates are only loaded for the 'Custom' range.

Centralized date range filter handling to update UI, filter state, and localStorage consistently.

Fixed an extra bug that date ranges saved with table views were overriding local storage on page load.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes date range filtering on the Grant Applications list so “Quick range” selections remain dynamic when restored (localStorage / saved table views), and centralizes filter/UI/localStorage synchronization to avoid inconsistent state on page load.

Changes:

  • Centralized date range application into setDateRangeFilters(...) and setDateRangeLocalStorage(...).
  • Regenerates dates for non-custom quick ranges when restoring from localStorage or saved table views; only uses stored dates for custom.
  • Prevents saved table view state from overriding localStorage-driven filters on initial page load.
Comments suppressed due to low confidence (1)

applications/Unity.GrantManager/src/Unity.GrantManager.Web/Pages/GrantApplications/Index.js:342

  • When the user selects the "custom" quick range, the handler returns before persisting the selection. This means localStorage may keep the previous preset range, so on reload the UI can revert away from "custom" (even if the user intentionally selected it but didn’t change any dates yet). Persist the quick range selection for the custom case too (e.g., set GrantApplications_QuickRange to custom before returning, and consider keeping existing from/to values).
    function handleQuickDateRangeChange() {
        const selectedRange = $(this).val();

        if (selectedRange === 'custom') {
            // Show the custom date inputs and don't modify their values
            toggleCustomDateInputs(true);
            return;
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

Added in extra defensive checks for date range, in the case that the quick date range filter has had values changed or no longer present against stored dates.
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

🧪 Unit Test Results (Parallel Execution)

Tests

📊 Summary

Result Count
✅ Passed 465
❌ Failed 0
⚠️ Skipped 0

📄 HTML Reports

  • Merged Tests (HTML): Included in artifacts
    Generated automatically by CI.

@JamesPasta JamesPasta merged commit f488c8f into dev Mar 6, 2026
22 checks passed
@JamesPasta JamesPasta deleted the bugfix/AB#32195-quick-date-range-not-dynamic-on-load branch March 6, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants