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: view mode dashboards-bar design changes [DHIS2-18441] #3155

Open
wants to merge 106 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
a9ec00d
feat: add new dashboards header and display it alongside the old one
HendrikThePendric Nov 21, 2024
f7dcdea
refactor: destructure all props
HendrikThePendric Nov 21, 2024
0916e9d
chore: address eslint warning about missing dependenies in useEffect
HendrikThePendric Nov 21, 2024
bbf1cc0
chore: remove hook that scrolls container to top because the componen…
HendrikThePendric Nov 21, 2024
1041dd3
chore: fix eslint warning about missing effect hook dependencies
HendrikThePendric Nov 21, 2024
5447d97
refactor: cleanup ViewDashboard component implementation
HendrikThePendric Nov 21, 2024
ed451fa
chore: move title-bar into new dashboardsbar
HendrikThePendric Nov 21, 2024
5df8634
chore: move navigation menu components into dedicated directory
HendrikThePendric Nov 21, 2024
6f4748e
chore: move information block components into dedicated directory
HendrikThePendric Nov 21, 2024
c338f46
chore: remove old titlebar component from view dashboard content
HendrikThePendric Nov 21, 2024
65f1e8b
chore: add information block to new header bar
HendrikThePendric Nov 21, 2024
d76024d
chore: apply new design to star-dashboard-button
HendrikThePendric Nov 21, 2024
8d07b6c
chore: organise imports in actions-bar
HendrikThePendric Nov 21, 2024
7b85123
chore: remove star-dashboard-button from action menu and add it to th…
HendrikThePendric Nov 21, 2024
4956554
chore: adjust actions-bar to new design
HendrikThePendric Nov 21, 2024
1e41162
chore: cleanup mockup code from dashboards bar
HendrikThePendric Nov 21, 2024
ef9ce46
fix: remove margin around header
HendrikThePendric Nov 21, 2024
67606f2
fix: address issue when scrolling to active menu item
HendrikThePendric Nov 25, 2024
1a443ba
fix: address prop-types error when passing node to Notice component
HendrikThePendric Nov 25, 2024
f0a19b5
fix: prevent prop-types error in DropdownButton due to empty children…
HendrikThePendric Nov 25, 2024
43da2cc
fix: avoid invalidDomNesting error by removing link and navigating vi…
HendrikThePendric Nov 25, 2024
a8e6a82
fix: ensure bar is 45px in height
HendrikThePendric Nov 25, 2024
78684dd
fix: smooth scrolling on item focus
HendrikThePendric Nov 25, 2024
a44314c
chore: update pot file
HendrikThePendric Nov 25, 2024
f202f38
fix: ensure star button does not give focus to inner element when tab…
HendrikThePendric Nov 25, 2024
f2e60b3
refactor: split up actions-bar and more-menu
HendrikThePendric Nov 26, 2024
1eebfb2
chore: update pot files
HendrikThePendric Nov 26, 2024
9dea744
fix: upgrade UI lib for better minu item styles
HendrikThePendric Nov 26, 2024
ea05897
chore: clean up dashboards-bar code
HendrikThePendric Nov 26, 2024
19ab7b5
fix: adjust no-dashboards styles to specs
HendrikThePendric Nov 26, 2024
56eb0ac
Revert "refactor: split up actions-bar and more-menu"
HendrikThePendric Nov 26, 2024
eb0b15f
chore: align component name with filename
HendrikThePendric Nov 26, 2024
653d086
fix: dynamically set offline icon on nav menu items
HendrikThePendric Nov 26, 2024
444dc15
chore: add dataStatistics logic to navigation menu items
HendrikThePendric Nov 26, 2024
b6740b6
fix: restore selected menu item styles
HendrikThePendric Nov 26, 2024
676dfa7
chore: re-add the description to the dashboards container
HendrikThePendric Nov 26, 2024
a642c09
chore: update pot file
HendrikThePendric Nov 26, 2024
4144041
chore: upgrade @dhis2/ui
HendrikThePendric Nov 26, 2024
3afeb87
chore: remove the old dashboard bar from the view and adjust menu height
HendrikThePendric Nov 26, 2024
ac3de4f
chore: make nav menu dense
HendrikThePendric Nov 28, 2024
03f0859
fix: ensure star icon in nav menu has color grey500
HendrikThePendric Nov 28, 2024
644d7bd
chore: implement filter badge redesign
HendrikThePendric Nov 28, 2024
c5daa3e
chore: apply small screen styles
HendrikThePendric Nov 28, 2024
cba12bf
chore: upgrade @dhis2/ui to get button alignment fixes
HendrikThePendric Nov 28, 2024
9bc6a0a
fix: clear selected dashboard when not found
HendrikThePendric Nov 28, 2024
56988a2
chore: clear information-block when no dashboard found
HendrikThePendric Nov 28, 2024
1496864
chore: show new headerbar on the landing page
HendrikThePendric Nov 28, 2024
c0c8145
chore: remove re-export of redundant component
HendrikThePendric Nov 28, 2024
26da1ca
chore: remove redundant code related to the controlBar
HendrikThePendric Nov 28, 2024
eeb06fb
chore: remove tests related to redundant functionailty
HendrikThePendric Nov 28, 2024
0f8bc97
chore: move tests to new dashboards-bar dir amd outdated snapshots
HendrikThePendric Nov 28, 2024
2275d72
chore: remove old dashboards-bar implementation
HendrikThePendric Nov 28, 2024
0100e31
chore: move offline-saved icon to the root of component folder becaus…
HendrikThePendric Nov 28, 2024
b891605
chore: remove New suffix from new dashboards-bar dir
HendrikThePendric Nov 28, 2024
2045f5b
fix: import local useCacheableSection
HendrikThePendric Nov 28, 2024
f1fbd62
fix: address vertical alignment issues and screen real-estate issues …
HendrikThePendric Dec 2, 2024
3ea5201
chore: remove redundant classNames
HendrikThePendric Dec 2, 2024
aa1b5f9
chore: configure testing-library/react to work with data-test attribute
HendrikThePendric Dec 3, 2024
d25c054
chore: relax eslint rules for spec files so component mocking is easier
HendrikThePendric Dec 3, 2024
027a68d
chore: update pot file
HendrikThePendric Dec 3, 2024
7786f2f
test: align unit tests to new implementation
HendrikThePendric Dec 3, 2024
d527a7d
test: add test cases for posting data statistics
HendrikThePendric Dec 4, 2024
75017e7
chore: add jest-dom module from testing-library for more ergonomic as…
HendrikThePendric Dec 4, 2024
d57a139
fix: adjust filter-badge so that it is only enabled when online and a…
HendrikThePendric Dec 4, 2024
93a7533
chore: align tests to new implementation
HendrikThePendric Dec 4, 2024
0ce3286
chore: adjust preexiting tests to new implementation
HendrikThePendric Dec 5, 2024
bf8e9d9
chore: fix accessibility warnings and invalid dom nesting errors to u…
HendrikThePendric Dec 5, 2024
8ecda67
chore: address lint errors
HendrikThePendric Dec 5, 2024
4c1ffb6
chore: address css lint errors
HendrikThePendric Dec 5, 2024
fa6b460
chore: update pot file
HendrikThePendric Dec 5, 2024
42ebefc
fix: adjust filter e2e tests
HendrikThePendric Dec 5, 2024
ae268de
fix: improve itemGrid empty state
cooper-joe Dec 6, 2024
20513e0
fix: use UI colors for background
cooper-joe Dec 6, 2024
0cfdb75
fix: adjust dashboard item style
cooper-joe Dec 6, 2024
14405e5
fix: adjust item hover in edit mode
cooper-joe Dec 6, 2024
309d1bb
fix: adjust spacer style in edit mode
cooper-joe Dec 6, 2024
7181c47
fix: edit mode style adjustments
cooper-joe Dec 6, 2024
c80f08b
fix: change dashboard item menu button icon
cooper-joe Dec 6, 2024
af4b75d
fix: layout modal style fixes
cooper-joe Dec 6, 2024
094cd55
fix: description display style
cooper-joe Dec 6, 2024
86cc0ff
fix: start screen style adjustments
cooper-joe Dec 6, 2024
a90104e
chore: update jest snapshots after design changes by Joe
HendrikThePendric Dec 9, 2024
a3abbc5
chore: allow omitting network requests from the Cypress log
HendrikThePendric Dec 9, 2024
c5f39f7
fix: hide create button on small screen
HendrikThePendric Dec 10, 2024
50877e4
fix: disable filters on small screen
HendrikThePendric Dec 10, 2024
6655f2f
fix: add gap between filter badges
HendrikThePendric Dec 10, 2024
aa96541
fix: close nav menu when selecting current item and repair keyboard n…
HendrikThePendric Dec 10, 2024
82d5090
chore: fix cypress tests
HendrikThePendric Dec 10, 2024
082a871
chore: update pot file
HendrikThePendric Dec 10, 2024
d8d21d6
chore: remove unused imports
HendrikThePendric Dec 10, 2024
2a17a15
chore: fix tests
HendrikThePendric Dec 10, 2024
0a0aeef
chore: removed unused cypress helpers
HendrikThePendric Dec 10, 2024
ab04a65
chore: remove redundant e2e test file
HendrikThePendric Dec 10, 2024
609dd28
fix: restore e2e helpers that are still used
HendrikThePendric Dec 10, 2024
8b99f54
chore: add test for closing menu when clicking selected dashboard men…
HendrikThePendric Dec 10, 2024
d501076
chore: add test for disabling buttons on small screen
HendrikThePendric Dec 10, 2024
0cfded6
fix: new default grid/item spacing
janhenrikoverland Dec 11, 2024
b7d1abb
Merge branch 'feat/header-bar-design-ui-update' of github.com:dhis2/d…
janhenrikoverland Dec 11, 2024
56b3b76
chore: add test for dahboard details failing to load
HendrikThePendric Dec 11, 2024
adc9a95
feat: add hook to assess if a scrollbar is present in the main conten…
HendrikThePendric Dec 11, 2024
ae4cba4
chore: return a width in px instead of a boolean
HendrikThePendric Dec 11, 2024
7ecfcc6
chore: remove stray console.log
HendrikThePendric Dec 11, 2024
7764bcf
chore: gitignore aider AI files
HendrikThePendric Dec 12, 2024
a4baaac
feat: measure container width and use it in ItemGrid
HendrikThePendric Dec 12, 2024
f14aad2
chore: fix failing tests
HendrikThePendric Dec 12, 2024
78399f0
chore: change width to inline-size
HendrikThePendric Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,15 @@ const { config } = require('@dhis2/cli-style')

module.exports = {
extends: [config.eslintReact, 'plugin:cypress/recommended'],
overrides: [
{
files: ['src/**/*.spec.js'],
rules: {
'react/prop-types': 'off',
'react/display-name': 'off',
'react/no-unknown-property': 'off',
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
},
},
],
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ cypress.env.json
cypress/screenshots
cypress/videos
cypress/downloads
.aider*
9 changes: 9 additions & 0 deletions config/testSetup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { configure } from '@testing-library/dom'
import '@testing-library/jest-dom'
import ResizeObserver from 'resize-observer-polyfill'

global.ResizeObserver = ResizeObserver

configure({
testIdAttribute: 'data-test',
})
2 changes: 1 addition & 1 deletion cypress/e2e/common/add_a_FILTERTYPE_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const OU_ID = 'ImspTQPwCqd' //Sierra Leone
const FACILITY_TYPE = 'Clinic'

When('I add a {string} filter', (dimensionType) => {
cy.contains('Add filter').click()
cy.contains('Filter').click()

// select an item in the modal
switch (dimensionType) {
Expand Down
5 changes: 4 additions & 1 deletion cypress/e2e/common/click_on_the_FILTERTYPE_filter_badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ import { When } from '@badeball/cypress-cucumber-preprocessor'
import { filterBadgeSel } from '../../elements/dashboardFilter.js'

When('I click on the {string} filter badge', (filterName) => {
cy.get(filterBadgeSel).find('span:visible').contains(filterName).click()
cy.get(filterBadgeSel)
.find('button')
.contains(filterName)
.click({ force: true })
})
3 changes: 1 addition & 2 deletions cypress/e2e/common/open_print_layout.js
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()
})
9 changes: 3 additions & 6 deletions cypress/e2e/common/open_the_SL_dashboard.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { Given } from '@badeball/cypress-cucumber-preprocessor'
import { dashboards } from '../../assets/backends/index.js'
// import { gridItemSel, chartSel } from '../../elements/dashboardItem.js'
import {
dashboardTitleSel,
dashboardChipSel,
} from '../../elements/viewDashboard.js'
import { EXTENDED_TIMEOUT } from '../../support/utils.js'
import { getNavigationMenuItem } from '../../elements/navigationMenu.js'
import { dashboardTitleSel } from '../../elements/viewDashboard.js'

Given('I open the {string} dashboard', (title) => {
cy.get(dashboardChipSel, EXTENDED_TIMEOUT).contains(title).click()
getNavigationMenuItem(title).click()

cy.location().should((loc) => {
expect(loc.hash).to.equal(dashboards[title].route)
Expand Down
10 changes: 3 additions & 7 deletions cypress/e2e/dashboard_filter/create_dashboard.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Given, When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { gridItemSel } from '../../elements/dashboardItem.js'
import {
dashboardChipSel,
dashboardTitleSel,
} from '../../elements/viewDashboard.js'
import { getNavigationMenuItem } from '../../elements/navigationMenu.js'
import { dashboardTitleSel } from '../../elements/viewDashboard.js'
import {
EXTENDED_TIMEOUT,
createDashboardTitle,
Expand Down Expand Up @@ -79,9 +77,7 @@ When('I add items and save', () => {
})

Given('I open an existing dashboard', () => {
cy.get(dashboardChipSel, EXTENDED_TIMEOUT)
.contains(TEST_DASHBOARD_TITLE)
.click()
getNavigationMenuItem(TEST_DASHBOARD_TITLE).click()
})

// Some map visualization load very slowly:
Expand Down
3 changes: 2 additions & 1 deletion cypress/e2e/dashboard_filter/dashboard_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Then, When } from '@badeball/cypress-cucumber-preprocessor'
import {
filterBadgeSel,
dimensionsModalSel,
filterBadgeDeleteBtnSel,
} from '../../elements/dashboardFilter.js'
// import {
// gridItemSel,
Expand Down Expand Up @@ -128,7 +129,7 @@ Then('the filter modal is opened', () => {
})

When('I remove the {string} filter', () => {
cy.get(filterBadgeSel).find('button').contains('Remove').click()
cy.get(filterBadgeDeleteBtnSel).click()
})

Then('the filter is removed from the dashboard', () => {
Expand Down
11 changes: 5 additions & 6 deletions cypress/e2e/edit_dashboard/edit_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import {
titleInputSel,
clickEditActionButton,
} from '../../elements/editDashboard.js'
import { getNavigationMenuItem } from '../../elements/navigationMenu.js'
import {
dashboardChipSel,
dashboardTitleSel,
dashboardsNavMenuButtonSel,
} from '../../elements/viewDashboard.js'
import { EXTENDED_TIMEOUT, createDashboardTitle } from '../../support/utils.js'

Expand Down Expand Up @@ -79,9 +80,8 @@ Then('different valid dashboard displays in view mode', () => {
})

Given('I open existing dashboard', () => {
cy.get(dashboardChipSel, EXTENDED_TIMEOUT)
.contains(TEST_DASHBOARD_TITLE)
.click()
cy.get(dashboardsNavMenuButtonSel, EXTENDED_TIMEOUT).click()
cy.get('[role="menu"]').find('li').contains(TEST_DASHBOARD_TITLE).click()

cy.location().should((loc) => {
const currentRoute = getRouteFromHash(loc.hash)
Expand Down Expand Up @@ -124,8 +124,7 @@ Scenario: I delete a dashboard
*/

Then('the dashboard is deleted and first starred dashboard displayed', () => {
cy.get(dashboardChipSel).contains(TEST_DASHBOARD_TITLE).should('not.exist')

getNavigationMenuItem(TEST_DASHBOARD_TITLE).should('not.exist')
cy.get(dashboardTitleSel).should('exist').should('not.be.empty')
})

Expand Down
29 changes: 15 additions & 14 deletions cypress/e2e/edit_dashboard/star_dashboard.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
import {
starSel,
getNavigationMenuItem,
closeNavigationMenu,
} from '../../elements/navigationMenu.js'
import {
dashboardStarredSel,
dashboardUnstarredSel,
dashboardChipSel,
chipStarSel,
navMenuItemStarIconSel,
} from '../../elements/viewDashboard.js'
import { TEST_DASHBOARD_TITLE } from './edit_dashboard.js'

// Scenario: I star the dashboard
When('I click to star the dashboard', () => {
cy.intercept('POST', '**/favorite').as('starDashboard')

cy.get(starSel).click()
cy.get(dashboardUnstarredSel).click()
cy.wait('@starDashboard').its('response.statusCode').should('eq', 200)
})

When('I click to unstar the dashboard', () => {
cy.intercept('DELETE', '**/favorite').as('unstarDashboard')

cy.get(starSel).click()
cy.get(dashboardStarredSel).click()
cy.wait('@unstarDashboard').its('response.statusCode').should('eq', 200)
})

Expand All @@ -28,22 +30,21 @@ Then('the dashboard is starred', () => {
cy.get(dashboardStarredSel).should('be.visible')
cy.get(dashboardUnstarredSel).should('not.exist')

cy.get(dashboardChipSel)
.contains(TEST_DASHBOARD_TITLE)
.parent()
.siblings(chipStarSel)
.first()
getNavigationMenuItem(TEST_DASHBOARD_TITLE)
.find(navMenuItemStarIconSel)
.should('be.visible')

closeNavigationMenu()
})

Then('the dashboard is not starred', () => {
// check for the unfilled star next to the title
cy.get(dashboardUnstarredSel).should('be.visible')
cy.get(dashboardStarredSel).should('not.exist')

cy.get(dashboardChipSel)
.contains(TEST_DASHBOARD_TITLE)
.parent()
.siblings()
getNavigationMenuItem(TEST_DASHBOARD_TITLE)
.find(navMenuItemStarIconSel)
.should('not.exist')

closeNavigationMenu()
})
4 changes: 2 additions & 2 deletions cypress/e2e/filter_restrict/filter_restrict.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ When('I save the dashboard', () => {
})

When('I click Add Filter', () => {
clickViewActionButton('Add filter')
clickViewActionButton('Filter')
})

Then('I see Facility Ownership and no other dimensions', () => {
Expand All @@ -168,7 +168,7 @@ Scenario: I restrict filters to no dimensions and do not see Add Filter in dashb
*/

Then('Add Filter button is not visible', () => {
cy.contains('Add filter').should('not.exist')
cy.contains('Filter').should('not.exist')
})

When('I delete the dashboard', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/offline/offline.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ Then(
// edit, sharing, starring, filtering, all options under more
getViewActionButton('Edit').should('be.disabled')
getViewActionButton('Share').should('be.disabled')
getViewActionButton('Add filter').should('be.disabled')
getViewActionButton('Filter').should('be.disabled')
getViewActionButton('More').should('be.enabled')

checkCorrectMoreOptionsEnabledState(false, cacheState)
Expand Down
10 changes: 2 additions & 8 deletions cypress/e2e/responsive_dashboard/responsive_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ Then('the small screen view is shown', () => {
//titlebar - only the More button and the title
cy.get('button').contains('Edit').should('not.be.visible')
cy.get('button').contains('Share').should('not.be.visible')
cy.get('button').contains('Add filter').should('not.be.visible')

cy.get('button.small').contains('More').should('be.visible')
cy.get('button').not('.small').contains('More').should('not.be.visible')
cy.get('button').contains('Filter').should('not.be.visible')
})

When('I restore the wide screen', () => {
Expand All @@ -44,10 +41,7 @@ Then('the wide screen view is shown', () => {

cy.get('button').contains('Edit').should('be.visible')
cy.get('button').contains('Share').should('be.visible')
cy.get('button').contains('Add filter').should('be.visible')

cy.get('button').not('.small').contains('More').should('be.visible')
cy.get('button.small').contains('More').should('not.be.visible')
cy.get('button').contains('Filter').should('be.visible')
})

Then('the small screen edit view is shown', () => {
Expand Down
19 changes: 1 addition & 18 deletions cypress/e2e/view_dashboard.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ Feature: Viewing dashboards
Given I open the "Antenatal Care" dashboard
When I search for dashboards containing "Immun"
Then Immunization and Immunization data dashboards are choices
When I press enter in the search dashboard field
When I press tab in the search dashboard field and then enter
Then the "Immunization" dashboard displays in view mode

@nonmutating
Scenario: I search for a dashboard with nonmatching search text
Given I open the "Antenatal Care" dashboard
When I search for dashboards containing "Noexist"
Then no dashboards are choices
When I press enter in the search dashboard field
Then dashboards list restored and dashboard is still "Antenatal Care"

@nonmutating
Scenario: I view the print layout preview and then print one-item-per-page preview
Expand All @@ -39,21 +37,6 @@ Feature: Viewing dashboards
Given I open the "Delivery" dashboard with shapes removed
Then the "Delivery" dashboard displays in view mode

@nonmutating
Scenario: I expand the control bar
Given I open the "Delivery" dashboard
Then the control bar should be at collapsed height
When I toggle show more dashboards
Then the control bar should be expanded to full height

@nonmutating
Scenario: I expand the control bar when dashboard not found
Given I type an invalid dashboard id in the browser url
Then a message displays informing that the dashboard is not found
And the control bar should be at collapsed height
When I toggle show more dashboards
Then the control bar should be expanded to full height

# @nonmutating
# FIXME
# Scenario: Maps with tracked entities show layer names in legend
Expand Down
5 changes: 2 additions & 3 deletions cypress/e2e/view_dashboard/dashboard_items_without_shape.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Given } from '@badeball/cypress-cucumber-preprocessor'
import { dashboards } from '../../assets/backends/index.js'
import { dashboardChipSel } from '../../elements/viewDashboard.js'
import { EXTENDED_TIMEOUT } from '../../support/utils.js'
import { getNavigationMenuItem } from '../../elements/navigationMenu.js'

Given('I open the {string} dashboard with shapes removed', (title) => {
const regex = new RegExp(`dashboards/${dashboards[title].id}`, 'g')
Expand All @@ -17,5 +16,5 @@ Given('I open the {string} dashboard with shapes removed', (title) => {
res.send({ body: res.body })
})
})
cy.get(dashboardChipSel, EXTENDED_TIMEOUT).contains(title).click()
getNavigationMenuItem(title).click()
})
6 changes: 1 addition & 5 deletions cypress/e2e/view_dashboard/open_dashboard_app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
import {
dashboardTitleSel,
dashboardChipSel,
} from '../../elements/viewDashboard.js'
import { dashboardTitleSel } from '../../elements/viewDashboard.js'
import { EXTENDED_TIMEOUT } from '../../support/utils.js'

When('I open the dashboard app with the root url', () => {
Expand All @@ -13,7 +10,6 @@ When('I open the dashboard app with the root url', () => {
})

cy.get(dashboardTitleSel).should('be.visible')
cy.get(dashboardChipSel, EXTENDED_TIMEOUT).should('be.visible')
})

Then('the {string} dashboard displays', (title) => {
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/view_dashboard/print.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { When, Then } from '@badeball/cypress-cucumber-preprocessor'
import { dashboards } from '../../assets/backends/sierraLeone_236.js'
import { clickViewActionButton } from '../../elements/viewDashboard.js'

When('I click to preview the print one-item-per-page', () => {
clickViewActionButton('More')
cy.get('[data-test="more-actions-button"]').click()
cy.get('[data-test="print-menu-item"]').click()
cy.get('[data-test="print-oipp-menu-item"]').click()
})
Expand Down
Loading
Loading