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: control bar refactor #1529

Merged
merged 46 commits into from
Feb 17, 2021

Conversation

jenniferarnesen
Copy link
Collaborator

@jenniferarnesen jenniferarnesen commented Feb 11, 2021

Fixes:

  • in small screen, make dashboard non-interactive when control bar is expanded (DHIS2-10436)
non-interactive.dashboard.when.cb.expanded.mov
  • in small screen control bar horiz scrollbar only shows half height (DHIS2-10417)

  • control bar now resizes instantly when moving between portrait and landscape (DHIS2-10418)
landscape.to.portrait.mov
  • control bar fixed while dashboard and header bar scroll in phone landscape orientation (DHIS2-10423)
    ** No video for this, but since the controlbar is no longer position fixed (except when expanded), it should behave better.

Refactor:

  • remove most height calculations for dashboard and control bar. This includes for the PrintDashboards. Use flexbox and margins instead.
  • separate control bar drag functionality into a DragHandle component
    ** Most code in DragHandle hasn't changed from its original form in the deleted ControlBar file
  • delete ControlBar and move functionality (related to userRows) to DashboardsBar together. Most height calcs removed, and instead using hardcoded row heights in the css.
  • Filter component is kind of complex now, as it renders both a Filter for sm (collapsed and expanded) and lg screens (controlled by css display).

@jenniferarnesen jenniferarnesen marked this pull request as draft February 11, 2021 15:44
Copy link
Member

@edoardo edoardo left a comment

Choose a reason for hiding this comment

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

Big PR, but it seems ok.
One comment about the icons used, but they can be changed later in a separate PR.

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.

Generally looks good, just some minor details, see the individual comments

display: none;
}

@media only screen and (max-height: 480px), only screen and (max-width: 480px) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like there's a lot of these media queries now, maybe we could extract the queries to consts, to just use an abstraction like e.g. @media var(--phone-landscape), var(--phone-portrait) instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That could be. I've never tried it actually, so I'll try now.

cypress/integration/ui/view_dashboard.feature Outdated Show resolved Hide resolved
cypress/integration/ui/view_dashboard/control_bar.js Outdated Show resolved Hide resolved
src/components/ControlBar/ViewControlBar/DashboardsBar.js Outdated Show resolved Hide resolved
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.

🥇

@jenniferarnesen jenniferarnesen merged commit 84dde66 into master Feb 17, 2021
@jenniferarnesen jenniferarnesen deleted the fix/no-interactive-below-expanded-ctrlbar branch February 17, 2021 09:44
dhis2-bot added a commit that referenced this pull request Feb 17, 2021
## [31.11.1](v31.11.0...v31.11.1) (2021-02-17)

### Bug Fixes

* control bar refactor ([#1529](#1529)) ([84dde66](84dde66))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 31.11.1 🎉

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.

5 participants