Skip to content

Commit

Permalink
Merge branch 'dev' into fix/title-translation-DHIS2-16216
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo authored Mar 5, 2024
2 parents 48f3579 + 77c5bcd commit 5d8efe3
Show file tree
Hide file tree
Showing 70 changed files with 1,696 additions and 587 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dhis2-preview-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14.x
node-version: 18.x

- uses: c-hive/gha-yarn-cache@v1
- run: yarn install --frozen-lockfile
Expand Down
92 changes: 89 additions & 3 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
REPORTPORTAL_PROJECT: ${{ vars.REPORTPORTAL_PROJECT }}

call-workflow-e2e-prod:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
needs: [build, lint, test]
uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-prod.yml@master
secrets:
Expand All @@ -98,7 +99,7 @@ jobs:
if: |
!github.event.push.repository.fork &&
github.actor != 'dependabot[bot]' &&
github.event_name != 'pull_request'
github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -133,13 +134,98 @@ jobs:
if: |
failure() &&
!cancelled() &&
github.ref == 'refs/heads/master'
github.ref == 'refs/heads/master' &&
contains(github.event.head_commit.message, 'chore(release)')
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Extract version
id: extract_version
uses: Saionaro/[email protected]

- name: Send failure message to analytics-internal-bot slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
slack-message: ':small_red_triangle_down: Data-visualizer-app release <https://github.com/dhis2/data-visualizer-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure>'
payload: |
{
"text": ":small_red_triangle_down: :data-visualizer-app: Data Visualizer release <https://github.com/dhis2/data-visualizer-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":small_red_triangle_down: :data-visualizer-app: Data Visualizer release <https://github.com/dhis2/data-visualizer-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

report-release-success:
runs-on: ubuntu-latest
needs: release
if: |
success() &&
!cancelled() &&
github.ref == 'refs/heads/master' &&
contains(github.event.head_commit.message, 'chore(release)')
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Extract version
id: extract_version
uses: Saionaro/[email protected]

- name: Send success message to analytics-internal-bot slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"text": "Data Visualizer app release ${{ steps.extract_version.outputs.version }} succeeded",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":large_green_circle: :data-visualizer-app: Data Visualizer version ${{ steps.extract_version.outputs.version }} released :tada:",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Release Notes*"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ${{ toJSON(github.event.head_commit.message) }}
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Link to <https://github.com/dhis2/data-visualizer-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Asuccess|build>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# [100.4.0](https://github.com/dhis2/data-visualizer-app/compare/v100.3.1...v100.4.0) (2023-12-14)


### Bug Fixes

* **translations:** sync translations from transifex (dev) ([65441f2](https://github.com/dhis2/data-visualizer-app/commit/65441f2b454a6e0f74567b8b7107cad63d594a04))
* **translations:** sync translations from transifex (dev) ([005be59](https://github.com/dhis2/data-visualizer-app/commit/005be599f7dd4382f0086861d74064aedc49ac29))


### Features

* cumulative values in PT (DHIS2-5497) ([#2746](https://github.com/dhis2/data-visualizer-app/issues/2746)) ([bff69ab](https://github.com/dhis2/data-visualizer-app/commit/bff69ab9cec7685adad823197de8508e9ae83636)), closes [#1946](https://github.com/dhis2/data-visualizer-app/issues/1946)

## [100.3.1](https://github.com/dhis2/data-visualizer-app/compare/v100.3.0...v100.3.1) (2023-11-08)


Expand Down
27 changes: 23 additions & 4 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const fs = require('fs')
const { chromeAllowXSiteCookies } = require('@dhis2/cypress-plugins')
const { defineConfig } = require('cypress')
const {
Expand All @@ -8,6 +9,28 @@ async function setupNodeEvents(on, config) {
chromeAllowXSiteCookies(on, config)
excludeByVersionTags(on, config)

// Delete videos for passing tests
on('after:spec', (spec, results) => {
try {
if (results && results.video) {
// Do we have failures for any retry attempts?
const failures = results.tests.some((test) =>
test.attempts.some((attempt) => attempt.state === 'failed')
)
if (!failures) {
// delete the video if the spec passed and no tests retried
fs.unlinkSync(results.video)
}
}
} catch (error) {
if (error.code === 'ENOENT') {
console.log('Video already deleted')
} else {
throw error
}
}
})

if (!config.env.dhis2InstanceVersion) {
throw new Error(
'dhis2InstanceVersion is missing. Check the README for more information.'
Expand Down Expand Up @@ -59,10 +82,6 @@ module.exports = defineConfig({
testIsolation: false,
// Record video
video: true,
/* Only compress and upload videos for failures.
* This will save execution time and reduce the risk
* out-of-memory issues on the CI machine */
videoUploadOnPasses: false,
// Enabled to reduce the risk of out-of-memory issues
experimentalMemoryManagement: true,
// Set to a low number to reduce the risk of out-of-memory issues
Expand Down
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
1 change: 1 addition & 0 deletions cypress/elements/dimensionsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const expectDimensionToNotHaveSelectedStyle = (dimensionId) =>
export const expectRecommendedIconToBeVisible = (dimensionId) =>
cy
.getBySel(getDimensionButtonById(dimensionId))
.scrollIntoView()
.findBySel(recommendedIconEl)
.should('have.length', 1)
.and('be.visible')
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

0 comments on commit 5d8efe3

Please sign in to comment.