Skip to content

Prefill period selector comparison values from URL hash #21242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 15, 2023

Conversation

mneudert
Copy link
Member

@mneudert mneudert commented Sep 8, 2023

Description:

The period selector does not keep information about the last selected comparison type (e.g "previous year" or "custom") across page reloads. Adding a new parameter containing the last type selection solves this issue without guessing the type based on the values of compareDates or comparePeriods (or introducing custom period parsers).

Fixes #20321.

Review

@mneudert mneudert added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review Regression Indicates a feature used to work in a certain way but it no longer does even though it should. labels Sep 8, 2023
@michalkleiner
Copy link
Contributor

@mneudert please either remove the Needs review label if the PR is still draft or move the PR from draft to 'full', at the moment I'm not sure if it's ready for review or not.

@mneudert mneudert removed the Needs Review PRs that need a code review label Sep 11, 2023
@mneudert mneudert force-pushed the fix-period-comparison-preselection branch from e630b2c to 085db93 Compare September 12, 2023 12:54
@mneudert mneudert marked this pull request as ready for review September 12, 2023 13:38
@mneudert mneudert added the Needs Review PRs that need a code review label Sep 12, 2023
@mneudert mneudert force-pushed the fix-period-comparison-preselection branch 2 times, most recently from 95166d1 to 4ce4f76 Compare September 13, 2023 15:59
Copy link
Contributor

@caddoo caddoo left a comment

Choose a reason for hiding this comment

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

Thanks for completing the suggestions, nice work 🎉

Copy link
Contributor

@michalkleiner michalkleiner left a comment

Choose a reason for hiding this comment

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

Haven't run this locally but the code changes look good to me.

@sgiehl
Copy link
Member

sgiehl commented Sep 15, 2023

@mneudert feel free to merge once the conflicts were resolved by rebasing and rebuilding the vue files...

@sgiehl sgiehl added this to the 5.0.0 milestone Sep 15, 2023
@mneudert mneudert force-pushed the fix-period-comparison-preselection branch from 4ce4f76 to d98107c Compare September 15, 2023 15:03
@mneudert mneudert merged commit aca5146 into 5.x-dev Sep 15, 2023
@mneudert mneudert deleted the fix-period-comparison-preselection branch September 15, 2023 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Development

Successfully merging this pull request may close these issues.

Date comparison selector should stay when changing site
4 participants