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: cumulative values in PT (DHIS2-5497) #2746

Merged
merged 47 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
64205ad
chore(deps): bump tar from 4.4.13 to 4.4.19 (#1946)
dependabot[bot] Feb 27, 2023
c58bd14
feat: support non-gregorian fixed periods (#2233)
kabaros Mar 1, 2023
181cbc5
fix: dependency updates (#2243)
edoardo Mar 15, 2023
14c1d94
chore: configure continuous delivery workflows (#2254)
jenniferarnesen Apr 14, 2023
7096568
feat: single value background color change based upon legend (DHIS2-1…
martinkrulltott Apr 20, 2023
4fe9ef1
feat: implement data icon option for SV visualization (DHIS2-10496) (…
edoardo Apr 27, 2023
c783b11
chore: manually bump deps (#2543)
martinkrulltott Jun 28, 2023
126f8df
chore: upgrade cypress to v12 and adjust project to it
HendrikThePendric Jul 6, 2023
561bf08
chore: remove videos
HendrikThePendric Jul 6, 2023
c062ac4
chore: switch test server to debug (test.e2e is broken/slow)
martinkrulltott Jul 7, 2023
15e3235
chore: revert the test server changes and move to a separate PR
martinkrulltott Jul 7, 2023
b7bd981
test: refactor clickCheckbox to check/uncheckCheckbox
edoardo Aug 25, 2023
a548ee0
test: add helper functions for totals options
edoardo Aug 25, 2023
638b91e
test: add tests for cumulativeValues option in PT
edoardo Aug 25, 2023
b939c69
refactor: allow non toggleable select to be disabled
edoardo Aug 25, 2023
78eee2f
refactor: allow checkbox options to be disabled
edoardo Aug 25, 2023
e6518d0
feat: disable option when cumulativeValues is checked in PT DHiS2-15728
edoardo Aug 25, 2023
760897b
refactor: add helper text when used in PT DHIS2-15727
edoardo Aug 25, 2023
d3642a0
feat: disabled options based on cumulativeValues in PT DHIS2-15728
edoardo Aug 25, 2023
408c062
chore: update pot file
edoardo Aug 25, 2023
22be1fb
feat: handle disabled option in Redux store
edoardo Aug 30, 2023
7e77a5c
refactor: revert changes to option components
edoardo Aug 30, 2023
8224146
feat: handle disabled and helpText props for disabled options
edoardo Aug 30, 2023
7fc9288
refactor: avoid extra prop and detect visType internally
edoardo Aug 30, 2023
b765e32
feat: remove disabled before passing object to visualization generator
edoardo Aug 31, 2023
7297564
refactor: remove unnecessary code
edoardo Sep 1, 2023
75deac6
refactor: streamlined code
edoardo Sep 1, 2023
20838f8
fix: set disabledOptions on AO loading and vis type switching
edoardo Sep 1, 2023
6aac0b8
fix: fix bug which cause current to loose props
edoardo Sep 1, 2023
f38c180
chore: update pot file
edoardo Sep 1, 2023
ab79c26
refactor: rename variable for clarity
edoardo Sep 1, 2023
579672e
chore: fix rebase conflict resolutions
edoardo Oct 23, 2023
62121cb
fix: avoid crash when visualization object is empty (ie. New)
edoardo Oct 23, 2023
f4f37fd
refactor: allow disabled to be passed as prop
edoardo Nov 13, 2023
8832da3
refactor: allow legend related option to be disabled
edoardo Nov 13, 2023
45a7691
feat: disable legend option when cumulative values is enabled
edoardo Nov 13, 2023
0c0a34d
refactor: add styles for titles of disabled sections
edoardo Nov 13, 2023
ff5b3f1
chore: regenerate pot file
edoardo Nov 13, 2023
13a52c2
fix: avoid visualization flashing when changing options
edoardo Nov 24, 2023
ef0f79d
refactor: simplify code for passing displayProperty
edoardo Nov 24, 2023
2a84a02
refactor: avoid involuntary changes to current in Redux store
edoardo Nov 24, 2023
15ab22e
test: enhance tests, options and sorting
edoardo Dec 11, 2023
02df1d2
test: use current year instead of hardcode it
edoardo Dec 11, 2023
b4ab014
chore: use alpha version of analytics
edoardo Dec 12, 2023
f7259b6
docs: add PT to the list of vis types for cumulative values
edoardo Dec 14, 2023
751bc8a
chore: fix linting error
edoardo Dec 14, 2023
24c826c
chore(analytics): add support for cumulative values
edoardo Dec 14, 2023
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
9 changes: 8 additions & 1 deletion cypress/elements/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ const loadingEl = 'dhis2-uicore-circularloader'
export const expectAppToNotBeLoading = () =>
cy.getBySel(loadingEl, { timeout: 15000 }).should('not.exist')

export const clickCheckbox = (target) =>
export const checkCheckbox = (target) =>
cy.getBySel(target).click().find('[type="checkbox"]').should('be.checked')

export const uncheckCheckbox = (target) =>
cy
.getBySel(target)
.click()
.find('[type="checkbox"]')
.should('not.be.checked')

export const typeInput = (target, text) =>
cy.getBySel(target).find('input').type(text)

Expand Down
8 changes: 4 additions & 4 deletions cypress/elements/optionsModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ export {
} from './axes.js'

export {
clickTrendLineCheckbox,
checkTrendLineCheckbox,
selectTrendLineType,
clickTargetLineCheckbox,
checkTargetLineCheckbox,
setTargetLineValue,
setTargetLineLabel,
clickBaseLineCheckbox,
checkBaseLineCheckbox,
setBaseLineLabel,
setBaseLineValue,
} from './lines.js'

export { setCustomSubtitle } from './subtitle.js'

export { clickOutliersCheckbox } from './outliers.js'
export { checkOutliersCheckbox } from './outliers.js'

export { setItemToAxis, setItemToType } from './series.js'

Expand Down
8 changes: 4 additions & 4 deletions cypress/elements/optionsModal/lines.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { clickCheckbox, typeInput } from '../common.js'
import { checkCheckbox, typeInput } from '../common.js'

const trendLineCheckboxEl = 'option-trend-line-checkbox'
const trendLineSelectEl = 'option-trend-line-select'
Expand All @@ -10,22 +10,22 @@ const baseLineCheckboxEl = 'option-base-line-checkbox'
const baseLineValueInputEl = 'option-base-line-value-input'
const baseLineLabelInputEl = 'option-base-line-label-input'

export const clickTrendLineCheckbox = () => clickCheckbox(trendLineCheckboxEl)
export const checkTrendLineCheckbox = () => checkCheckbox(trendLineCheckboxEl)

export const selectTrendLineType = (optionName) => {
cy.getBySel(trendLineSelectEl).findBySel('dhis2-uicore-select').click()
cy.getBySel(trendLineSelectOptionEl).contains(optionName).click()
}

export const clickTargetLineCheckbox = () => clickCheckbox(targetLineCheckboxEl)
export const checkTargetLineCheckbox = () => checkCheckbox(targetLineCheckboxEl)

export const setTargetLineValue = (text) =>
typeInput(targetLineValueInputEl, text)

export const setTargetLineLabel = (text) =>
typeInput(targetLineLabelInputEl, text)

export const clickBaseLineCheckbox = () => clickCheckbox(baseLineCheckboxEl)
export const checkBaseLineCheckbox = () => checkCheckbox(baseLineCheckboxEl)

export const setBaseLineValue = (text) => typeInput(baseLineValueInputEl, text)

Expand Down
4 changes: 2 additions & 2 deletions cypress/elements/optionsModal/outliers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { clickCheckbox } from '../common.js'
import { checkCheckbox } from '../common.js'

const outliersCheckboxEl = 'option-outliers-enabled-checkbox'

export const clickOutliersCheckbox = () => clickCheckbox(outliersCheckboxEl)
export const checkOutliersCheckbox = () => checkCheckbox(outliersCheckboxEl)
100 changes: 100 additions & 0 deletions cypress/elements/optionsModal/totals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
export const colTotalsOptionEl = 'option-col-totals'
const colSubTotalsOptionEl = 'option-col-subtotals'
const rowTotalsOptionEl = 'option-row-totals'
const rowSubTotalsOptionEl = 'option-row-subtotals'

export const expectColumnsTotalsToBeDisabled = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectColumnsTotalsToBeEnabled = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.disabled')

export const expectColumnsTotalsToBeChecked = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectColumnsTotalsToBeUnchecked = () =>
cy
.getBySel(colTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')

export const expectColumnsSubTotalsToBeDisabled = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectColumnsSubTotalsToBeEnabled = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.enabled')

export const expectColumnsSubTotalsToBeChecked = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectColumnsSubTotalsToBeUnchecked = () =>
cy
.getBySel(colSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')

export const expectRowsTotalsToBeDisabled = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectRowsTotalsToBeEnabled = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.enabled')

export const expectRowsTotalsToBeChecked = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectRowsTotalsToBeUnchecked = () =>
cy
.getBySel(rowTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')

export const expectRowsSubTotalsToBeDisabled = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.disabled')

export const expectRowsSubTotalsToBeEnabled = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.enabled')

export const expectRowsSubTotalsToBeChecked = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('be.checked')

export const expectRowsSubTotalsToBeUnchecked = () =>
cy
.getBySel(rowSubTotalsOptionEl)
.find('[type="checkbox"]')
.should('not.be.checked')
7 changes: 7 additions & 0 deletions cypress/elements/pivotTable.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
const valueCellEl = 'visualization-value-cell'
const headerCellEl = 'visualization-column-header'

export const clickTableValueCell = (index) =>
cy.getBySel(valueCellEl).eq(index).click()

export const expectTableValueCellsToHaveLength = (length) =>
cy.getBySel(valueCellEl).should('have.length', length)

export const expectTableValueCellToContainValue = (index, value) =>
cy.getBySel(valueCellEl).eq(index).contains(value)

export const clickTableHeaderCell = (name) =>
cy.getBySel(headerCellEl).contains(name).click()
Loading
Loading