Skip to content
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

fix: period select fixes #262

Merged
merged 1 commit into from
Nov 18, 2019
Merged

fix: period select fixes #262

merged 1 commit into from
Nov 18, 2019

Conversation

turban
Copy link
Contributor

@turban turban commented Nov 14, 2019

Fixes: https://jira.dhis2.org/browse/DHIS2-7839

This PR fixes 2 issues with the period selector:

  1. Avoids crash if year is changed into the future, and then period type is changed. The crash happened because filterFuturePeriods would return an empty periods array as all of them would be in the future. If this is the case, we return the first period in the array.

  2. If you select a period type, change the year, and then then change the tab, the period will no longer be selected. This PR fixes the issue by making sure the year is still the same, and not reset to the most recent year.

The long term plan is to switch to a shared period selector component, so I've tried to make as few changes as possible here, as the fix also needs to be backported.

@turban turban requested a review from amcgee November 14, 2019 14:32
@turban turban changed the title Period select fixes fix: period select fixes Nov 14, 2019
Copy link
Member

@amcgee amcgee left a comment

Choose a reason for hiding this comment

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

LGTM

@turban turban merged commit 25174f5 into master Nov 18, 2019
turban added a commit that referenced this pull request Nov 20, 2019
@turban turban mentioned this pull request Nov 20, 2019
turban added a commit that referenced this pull request Nov 20, 2019
* Backport of #265

* Backport of #262

* Backport of #263

* Backport of #264

* Linting fixes
turban added a commit that referenced this pull request Nov 20, 2019
turban added a commit that referenced this pull request Nov 20, 2019
turban added a commit that referenced this pull request Nov 20, 2019
* Backport of #262 and linting fixes

* Backport of #263

* Backport of #264

* Version bump
turban added a commit that referenced this pull request Nov 20, 2019
* Backport of #262

* Backport of #264

* Version bump
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants