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

feat: responsive item grid in view and edit mode [DHIS2-10138] #1431

Merged
merged 50 commits into from
Jan 29, 2021

Conversation

jenniferarnesen
Copy link
Collaborator

@jenniferarnesen jenniferarnesen commented Jan 6, 2021

Implements the responsive dashboard grid in View and Edit mode.

  • The responsive view has a single breakpoint at 480px, at which point the dashboard will change to a single column format (view mode only - edit mode will not be available at <480px)
  • We attempt to preserve the original aspect ratio of the grid items by making the assumption that the dashboard creator used a desktop with an approximately 1200px wide viewport. Thus, the height will be scaled down or up to match keep the ratio.
  • Visualization items have a minimum height of about 320px
  • Non visualizations will keep their original pixel height.
  • padding between dashboard items increases from 10px to 16px on small screen

Refactoring:

  • move gridUtil to modules folder (and move some functions into separate modules (smallScreen, getGridItemDomId) to reduce scope of gridUtil)
    ** these functions in gridUtil haven't changed: getPrintTitlePageItemShape , getPageBreakItemShape , hasShape, withShape, getShape, isNonNegativeInteger
  • create separate ViewItemGrid and EditItemGrid components (used to be ItemGrid with editMode flag) since functionality and grid props very different
  • start replacing windowHeight redux prop with the useWindowDimensions hook
  • reduce duplication in PrintItemGrid and PrintLayoutItemGrid by breaking out a StaticGrid component with the common functionality

@jenniferarnesen jenniferarnesen changed the title Feat/responsive view for small screens feat: responsive item grid Jan 6, 2021
@jenniferarnesen jenniferarnesen changed the title feat: responsive item grid feat: responsive item grid in view and edit mode [DHIS2-10138] Jan 27, 2021
@jenniferarnesen jenniferarnesen merged commit 0e0c93f into master Jan 29, 2021
@jenniferarnesen jenniferarnesen deleted the feat/responsive-view-for-small-screens branch January 29, 2021 09:33
dhis2-bot added a commit that referenced this pull request Jan 29, 2021
# [31.10.0](v31.9.0...v31.10.0) (2021-01-29)

### Features

* responsive item grid in view and edit mode [DHIS2-10138] ([#1431](#1431)) ([0e0c93f](0e0c93f))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 31.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@jenniferarnesen jenniferarnesen restored the feat/responsive-view-for-small-screens branch March 19, 2023 13:08
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.

4 participants