Skip to content

Commit

Permalink
Merge branch 'dev' into feat/replace-interpretations-component
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen authored Feb 29, 2024
2 parents 05ddc63 + c3110d8 commit 3535602
Show file tree
Hide file tree
Showing 44 changed files with 2,234 additions and 1,130 deletions.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ updates:
schedule:
interval: weekly
open-pull-requests-limit: 10
target-branch: master
versioning-strategy: increase
92 changes: 88 additions & 4 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
id: yarn-cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('patches/*.patch') }}

- name: End-to-End tests
uses: cypress-io/github-action@v2
Expand All @@ -104,7 +104,7 @@ jobs:
start: ${{ env.SERVER_START_CMD }}
wait-on: ${{ env.SERVER_URL }}
wait-on-timeout: 300
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('patches/*.patch') }}
group: 'e2e'
tag: ${{ github.event_name }}
env:
Expand All @@ -126,7 +126,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 @@ -163,11 +163,95 @@ jobs:
!cancelled() &&
github.ref == 'refs/heads/master'
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: :dashboard-app: Dashboard-app release <https://github.com/dhis2/dashboard-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure>'
payload: |
{
"text": ":small_red_triangle_down: :dashboard-app: Dashboard version ${{ steps.extract_version.outputs.version }} release <https://github.com/dhis2/dashboard-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":small_red_triangle_down: :dashboard-app: Dashboard version ${{ steps.extract_version.outputs.version }} release <https://github.com/dhis2/dashboard-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": "Dashboard app release ${{ steps.extract_version.outputs.version }} succeeded",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":large_green_circle: :dashboard-app: Dashboard 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/dashboard-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Asuccess|build>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
2 changes: 1 addition & 1 deletion .tx/config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[main]
host = https://www.transifex.com
lang_map = fa_AF: prs, uz@Cyrl: uz, uz@Latn: uz_Latn
lang_map = fa_AF: prs, uz@Cyrl: uz_UZ_Cyrl, uz@Latn: uz_UZ_Latn


[o:hisp-uio:p:app-dashboards-app:r:en-pot]
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [100.0.4](https://github.com/dhis2/dashboard-app/compare/v100.0.3...v100.0.4) (2023-11-06)


### Bug Fixes

* **translations:** sync translations from transifex (dev) ([9ebfa9f](https://github.com/dhis2/dashboard-app/commit/9ebfa9f06342d04dea506d146f0b686dea25e23e))
* **translations:** sync translations from transifex (dev) ([9c6c0c6](https://github.com/dhis2/dashboard-app/commit/9c6c0c65a20852fd0f1187cc5a359c9180d5b43b))
* **translations:** sync translations from transifex (dev) ([31fc356](https://github.com/dhis2/dashboard-app/commit/31fc356ff3fa0087cd8b91bfd9644e443b1e7c63))
* **translations:** sync translations from transifex (dev) ([b9e9499](https://github.com/dhis2/dashboard-app/commit/b9e9499e4c9a45071599338aecbcf75c8e3c0f14))
* **translations:** sync translations from transifex (dev) ([3fbcee7](https://github.com/dhis2/dashboard-app/commit/3fbcee74a5f6f12127f71770ae892ffb11a3a189))

## [100.0.3](https://github.com/dhis2/dashboard-app/compare/v100.0.2...v100.0.3) (2023-09-13)


### Bug Fixes

* parse the ou filter correctly for all ou types ([#2691](https://github.com/dhis2/dashboard-app/issues/2691)) ([35877e1](https://github.com/dhis2/dashboard-app/commit/35877e16d640b343a847a2826aabc5e07cb7ece5))

## [100.0.2](https://github.com/dhis2/dashboard-app/compare/v100.0.1...v100.0.2) (2023-08-30)


Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,10 @@ CYPRESS_DHIS2_PASSWORD=district

The following commands can be used to run the tests:

| Command | Backend | Environment | Tests |
| ------------------- | :--------: | ----------: | -----------: |
| `yarn cy:open-live` | API server | Cypress UI | All |
| `yarn cy:run-live` | API server | Headless | All |
| `yarn cy:open-stub` | Fixtures | Cypress UI | Non-mutating |
| `yarn cy:run-stub` | Fixtures | Headless | Non-mutating |
| Comman | Backend | Environment | Tests |
| -------------- | :--------: | ----------: | ----: |
| `yarn cy:open` | API server | Cypress UI | All |
| `yarn cy:run` | API server | Headless | All |

### `yarn test`

Expand Down
39 changes: 28 additions & 11 deletions cypress/integration/common/view/add_a_FILTERTYPE_filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,35 @@ const FACILITY_TYPE = 'Clinic'
When('I add a {string} filter', (dimensionType) => {
cy.contains('Add filter').click()

// open the dimensions modal
cy.get(filterDimensionsPanelSel).contains(dimensionType).click()

// select an item in the modal
if (dimensionType === 'Period') {
cy.get(unselectedItemsSel).contains(PERIOD).dblclick()
} else if (dimensionType === 'Organisation unit') {
cy.get(orgUnitTreeSel, EXTENDED_TIMEOUT)
.find('[type="checkbox"]', EXTENDED_TIMEOUT)
.check(OU_ID)
} else {
cy.get(unselectedItemsSel).contains(FACILITY_TYPE).dblclick()
switch (dimensionType) {
case 'Period':
cy.get(filterDimensionsPanelSel).contains(dimensionType).click()
cy.get(unselectedItemsSel).contains(PERIOD).dblclick()
break
case 'Organisation unit':
cy.get(filterDimensionsPanelSel).contains(dimensionType).click()
cy.get(orgUnitTreeSel, EXTENDED_TIMEOUT)
.find('[type="checkbox"]', EXTENDED_TIMEOUT)
.check(OU_ID)
break
case 'Org unit group':
cy.get(filterDimensionsPanelSel)
.contains('Organisation unit')
.click()
cy.getByDataTest('org-unit-group-select').click()
cy.getByDataTest('dhis2-uicore-select-menu-menuwrapper')
.contains('District')
.click()
// close the popup
cy.getByDataTest('dhis2-uicore-select-menu-menuwrapper')
.closest('[data-test="dhis2-uicore-layer"]')
.click('topLeft')
break

default:
cy.get(filterDimensionsPanelSel).contains(dimensionType).click()
cy.get(unselectedItemsSel).contains(FACILITY_TYPE).dblclick()
}

// confirm to apply the filter
Expand Down
17 changes: 9 additions & 8 deletions cypress/integration/edit/edit_dashboard/show_description.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
import { clickViewActionButton } from '../../../elements/viewDashboard.js'
import { getApiBaseUrl } from '../../../support/server/utils.js'
import { getApiBaseUrl } from '../../../support/utils.js'

const SHOW_DESC_RESP_CODE_SUCCESS = 201
const SHOW_DESC_RESP_CODE_FAIL = 409
const RESP_CODE_200 = 200
const RESP_CODE_201 = 201
const RESP_CODE_FAIL = 409

before(() => {
//ensure that the description is not currently shown
Expand All @@ -15,7 +16,7 @@ before(() => {
},
body: 'false',
}).then((response) =>
expect(response.status).to.equal(SHOW_DESC_RESP_CODE_SUCCESS)
expect(response.status).to.be.oneOf([RESP_CODE_201, RESP_CODE_200])
)
})

Expand All @@ -29,7 +30,7 @@ When('I click to show description', () => {

cy.wait('@toggleDescription')
.its('response.statusCode')
.should('eq', SHOW_DESC_RESP_CODE_SUCCESS)
.should('be.oneOf', [RESP_CODE_200, RESP_CODE_201])
})

When('I click to hide the description', () => {
Expand All @@ -38,20 +39,20 @@ When('I click to hide the description', () => {

cy.wait('@toggleDescription')
.its('response.statusCode')
.should('eq', SHOW_DESC_RESP_CODE_SUCCESS)
.should('be.oneOf', [RESP_CODE_200, RESP_CODE_201])
})

// Error scenario
When('clicking to show description fails', () => {
cy.intercept('PUT', 'userDataStore/dashboard/showDescription', {
statusCode: SHOW_DESC_RESP_CODE_FAIL,
statusCode: RESP_CODE_FAIL,
}).as('showDescriptionFails')

clickViewActionButton('More')
cy.contains('Show description').click()
cy.wait('@showDescriptionFails')
.its('response.statusCode')
.should('eq', SHOW_DESC_RESP_CODE_FAIL)
.should('eq', RESP_CODE_FAIL)
})

Then(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
dashboardDescriptionSel,
clickViewActionButton,
} from '../../../elements/viewDashboard.js'
import { getApiBaseUrl } from '../../../support/server/utils.js'
import { EXTENDED_TIMEOUT } from '../../../support/utils.js'
import { getApiBaseUrl, EXTENDED_TIMEOUT } from '../../../support/utils.js'

let norwegianTitle = ''
let norwegianDesc = ''
Expand Down
8 changes: 7 additions & 1 deletion cypress/integration/view/dashboard_filter.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Dashboard filter

Scenario: I add a Period filter
When I start a new dashboard
And I add a MAP and a CHART and save
And I add items and save
Then the dashboard displays in view mode
When I add a "Period" filter
Then the Period filter is applied to the dashboard
Expand All @@ -19,6 +19,12 @@ Feature: Dashboard filter
When I add a "Facility Type" filter
Then the Facility Type filter is applied to the dashboard

Scenario: I add a Org unit group filter
Given I open existing dashboard
Then the dashboard displays in view mode
When I add a "Org unit group" filter
Then the Org unit group filter is applied to the dashboard

Scenario: I can access the dimensions modal from the filter badge
Given I open existing dashboard
When I add a "Period" filter
Expand Down
Loading

0 comments on commit 3535602

Please sign in to comment.