-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add space efficient dashboard bar design and dashboard selectio…
…n, and keyboard navigation Implements JIRA issue DHIS2-18441 according to the design specs --- ### Key features 1. New design 2. New navigation menu 3. New keyboard navigation --- ### Description Implements the new design according to the design doc. Some other changes are also included in this PR and these are listed below. #### Changes to `ViewDashboard` - Use the `useAlert` hook instead of rendering a `AlertStack`. This ensures the show/hide animation runs and that there won't be problems when we show this alert together with another alert - The logic to load a dashboard has been simplified, I suspect this component still contained some logic that predates the inclusion of react-router. In any case, there was some logic present that accommodated "loading a new dashboard". But this scenario would never occur, because when the route changes the component is remounted. - Instead of having a `getContent` function, we now have the `ViewDashboardContent` component. #### Changes to `CacheableViewDashboard` A `useEffect` hook was added to ensure that the selected dashboard is cleared from the redux store when the user chooses "Close dashboard" in the "action menu" dropdown. #### Changes to `FilterBadge` The design was updated and some modifications were done to the behaviour as well: - When online on a large screen it is possible to edit and/or remove a filter - When online on a small screen (width =< 480px) it is not possible to edit a filter, but it can be removed. When attempting to edit a filter a tooltip shows to inform the user this is not possible. - When offline filters cannot be edited or deleted. The filter-badge is still visible but the remove-icon is not rendered. When attempting to edit a filter a tooltip shows to inform the user this is not possible. #### Major version upgrade of `@dhis2/ui` (v10) Version 10 includes some improvements in terms of accessibility and keyboard navigation. To comply with the new guidelines in that regard a few small tweaks to components were needed. This involved adding things like `ariaLabel` props, and addressing some invalid DOM nesting (nested `<a>` tags). #### Some tweaks to the unit-testing configuration - React testing-library was configured to work with the `data-test` attribute we use at DHIS2 (i.e. the `dataTest` prop for components from `@dhis2/ui`). The default data-attribute used by React testing-library is `data-test-id`, and some tests needed to be adjusted to no longer use that. - Some ESLint rules were added specifically for `spec.js` to remove the need to add ESLint ignore comments when making mock-components and other types of mocks. --- ### Known issues - Keyboard navigation inconsistencies: this PR includes a major version bump in `@dhis2/ui` which comes with some accessibility improvements including arrow-key keyboard navigation for menus. The navigation- and more-actions-menu in the new dashboards-bar are using these. But the filter-menu is using a custom menu-list and this can be used by keyboard by using the tab-key. This inconsistency will be tackled in a separate PR as described in JIRA issue DHIS2-18537. --- ### References Current JIRA Issue DHIS2-18441: https://dhis2.atlassian.net/browse/DHIS2-18441 Follow-up JIRA issue DHIS2-18537: https://dhis2.atlassian.net/browse/DHIS2-18537 Design specs: https://docs.google.com/document/d/1c8Ll1aLbFYwU8HYsyDlH1wk_QKTrUXwNanCiqayczOM
- Loading branch information
1 parent
b890115
commit 45e6f4c
Showing
145 changed files
with
2,297 additions
and
3,722 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { configure } from '@testing-library/dom' | ||
import '@testing-library/jest-dom' | ||
|
||
configure({ | ||
testIdAttribute: 'data-test', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import { When } from '@badeball/cypress-cucumber-preprocessor' | ||
import { clickViewActionButton } from '../../elements/viewDashboard.js' | ||
|
||
When('I click to preview the print layout', () => { | ||
clickViewActionButton('More') | ||
cy.get('[data-test="more-actions-button"]').click() | ||
cy.get('[data-test="print-menu-item"]').click() | ||
cy.get('[data-test="print-layout-menu-item"]').click() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.