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: height of interpretations panel in small screen [DHIS2-10425] #1510

Merged
merged 2 commits into from
Feb 8, 2021

Conversation

jenniferarnesen
Copy link
Collaborator

@jenniferarnesen jenniferarnesen commented Feb 5, 2021

Background: the grid component we use expects item heights expressed as "grid units". The EXPANDED_HEIGHT and EXPANDED_HEIGHT_SM constants are expressed in grid units. That is the amount of height that is added to the item to make room for the interpretations container, which is hardcoded to (now) 334px.

Wide screen and small screen use different grid unit heights (this was to allow more space between items in small screen)

So the fix is to calculate the expanded height of the item correctly, using the correct grid units:
Height of expanded area for wide screen: 17 grid units * 20px = 340px
Height of expanded area for small screen: 13 grid units * 26px = 338px

Meanwhile, the interpretations scroll container has a hardcoded height (now 334px), which will fit in the expanded area of the item for both wide and small screen.

Since a revamp of the interpretations functionality in dashboard is planned (probably using a modal instead of an expanding item), I decided not to refactor of this code (and getting rid of the hardcoded 334px height)

<=480px

greater than 480px

@jenniferarnesen jenniferarnesen changed the title fix: height of interpretations panel in small screen fix: height of interpretations panel in small screen [DHIS2-10425] Feb 5, 2021
Copy link
Contributor

@martinkrulltott martinkrulltott left a comment

Choose a reason for hiding this comment

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

LGTM. Although would be interesting to know how this looks on a mobile device when switching from landscape to portrait, does it lag a bit like the More button did?

@jenniferarnesen jenniferarnesen merged commit d2e78c7 into master Feb 8, 2021
@jenniferarnesen jenniferarnesen deleted the fix/interpretations-panel-height branch February 8, 2021 15:00
dhis2-bot added a commit that referenced this pull request Feb 8, 2021
## [31.10.5](v31.10.4...v31.10.5) (2021-02-08)

### Bug Fixes

* calculations for height of interpretations expansion panel in small screen ([#1510](#1510)) ([d2e78c7](d2e78c7))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 31.10.5 🎉

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