Skip to content

Commit

Permalink
Merge branch 'dev' into design-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen authored Jun 21, 2024
2 parents bc0eec1 + 09fb87b commit dca740f
Show file tree
Hide file tree
Showing 75 changed files with 3,581 additions and 2,443 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
144 changes: 131 additions & 13 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'dhis2: verify (app)'

on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
types: ['opened', 'labeled', 'reopened', 'synchronize']
push:
branches:
- 'master'
Expand All @@ -19,6 +19,18 @@ env:
CI: true

jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.specs }}
steps:
- uses: actions/checkout@v3
- name: Generate test matrix
id: set-matrix
run: |
node cypress/support/generateTestMatrix.js > matrix.json
echo "::set-output name=specs::$(cat matrix.json)"
build:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -77,12 +89,16 @@ jobs:

e2e-prod:
runs-on: ubuntu-latest
needs: test
needs: [test, setup-matrix]
if: "!contains(github.event.head_commit.message, '[skip ci]')"

strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4]
spec-group: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}

env:
SHOULD_RECORD: ${{ contains(github.event.head_commit.message, '[e2e record]') || contains(join(github.event.pull_request.labels.*.name), 'e2e record') }}

steps:
- uses: actions/checkout@v3
Expand All @@ -94,28 +110,46 @@ 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: Set Cypress Record Environment Variables
if: env.SHOULD_RECORD == 'true'
run: |
echo "CYPRESS_GROUP=e2e-${{ matrix.spec-group.id }}" >> $GITHUB_ENV
echo "CYPRESS_TAG=${{ github.event_name }}" >> $GITHUB_ENV
echo "CYPRESS_CI_BUILD_ID=${{ github.run_id }}" >> $GITHUB_ENV
- name: Debug Environment Variables
run: |
echo "SHOULD_RECORD=${{ env.SHOULD_RECORD }}"
echo "CI Build ID=${{ github.run_id }}"
echo "Computed Group=${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_GROUP || '' }}"
echo "Computed Tag=${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_TAG || '' }}"
echo "Computed CI Build ID=${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_CI_BUILD_ID || '' }}"
echo "Spec=${{ join(matrix.spec-group.tests, ',') }}"
- name: End-to-End tests
uses: cypress-io/github-action@v2
with:
record: true
parallel: true
start: ${{ env.SERVER_START_CMD }}
wait-on: ${{ env.SERVER_URL }}
wait-on-timeout: 300
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
group: 'e2e'
tag: ${{ github.event_name }}
cache-key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('patches/*.patch') }}
record: ${{ env.SHOULD_RECORD }}
parallel: ${{ env.SHOULD_RECORD }}
group: ${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_GROUP || '' }}
tag: ${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_TAG || '' }}
ci-build-id: ${{ env.SHOULD_RECORD == 'true' && env.CYPRESS_CI_BUILD_ID || '' }}
spec: ${{ join(matrix.spec-group.tests, ',') }}
env:
CI: true
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
SERVER_START_CMD: 'yarn cypress:start'
SERVER_URL: 'http://localhost:3000'
cypress_dhis2_api_stub_mode: 'DISABLED'
REACT_APP_DHIS2_BASE_URL: ${{ secrets.CYPRESS_DHIS2_BASE_URL_40 }}
cypress_dhis2_base_url: ${{ secrets.CYPRESS_DHIS2_BASE_URL_40}}
REACT_APP_DHIS2_BASE_URL: ${{ secrets.CYPRESS_DHIS2_BASE_URL_41 }}
cypress_dhis2_base_url: ${{ secrets.CYPRESS_DHIS2_BASE_URL_41}}
cypress_dhis2_username: ${{ secrets.CYPRESS_DHIS2_USERNAME }}
cypress_dhis2_password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -126,7 +160,7 @@ jobs:
if: |
!github.event.push.repository.fork &&
github.actor != 'dependabot[bot]' &&
github.event_name != 'pull_request'
(github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -163,11 +197,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
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,81 @@
## [100.2.3](https://github.com/dhis2/dashboard-app/compare/v100.2.2...v100.2.3) (2024-06-17)


### Bug Fixes

* **translations:** sync translations from transifex (dev) ([7f44585](https://github.com/dhis2/dashboard-app/commit/7f445853046ee68daea3132e4a0d90f347bc802d))
* **translations:** sync translations from transifex (dev) ([1c2d1b2](https://github.com/dhis2/dashboard-app/commit/1c2d1b28a9532fe41352382c7fd4408ad2789ac9))
* **translations:** sync translations from transifex (dev) ([ac3f1c7](https://github.com/dhis2/dashboard-app/commit/ac3f1c729c9e3a59415de5e56b058e771f5bec81))
* **translations:** sync translations from transifex (dev) ([#3001](https://github.com/dhis2/dashboard-app/issues/3001)) ([018e07b](https://github.com/dhis2/dashboard-app/commit/018e07bb38af48f949c6bc67b0959480a5a440d6))
* fetch visualization always when caching (DHIS2-17509) ([#2986](https://github.com/dhis2/dashboard-app/issues/2986)) ([8b3587e](https://github.com/dhis2/dashboard-app/commit/8b3587ed13f7c9019a2606fa8e120e4146de3b7e))

## [100.2.2](https://github.com/dhis2/dashboard-app/compare/v100.2.1...v100.2.2) (2024-05-16)


### Bug Fixes

* avoid re-rendering an item when adding the same again (DHIS2-17016) ([#2935](https://github.com/dhis2/dashboard-app/issues/2935)) ([dd67fc6](https://github.com/dhis2/dashboard-app/commit/dd67fc69c6b39bd177c1dd6a51cdf90d4dd4a1a2))
* avoid reading from undefined error (DHIS2-17334) ([#2970](https://github.com/dhis2/dashboard-app/issues/2970)) ([a4e5340](https://github.com/dhis2/dashboard-app/commit/a4e5340a6605db261fd2a2af1ced272d94c760dc))
* dimension list design (DHIS2-16270) ([#2861](https://github.com/dhis2/dashboard-app/issues/2861)) ([790afd2](https://github.com/dhis2/dashboard-app/commit/790afd2d64e8fb8252088453cdb803735b79c4de))
* system / user setting for display name not respected in Org Unit tree (DHIS2-15000) ([#2971](https://github.com/dhis2/dashboard-app/issues/2971)) ([928b88a](https://github.com/dhis2/dashboard-app/commit/928b88a7a97816f0c0a8a9cf364bf7fa189c848a))

## [100.2.1](https://github.com/dhis2/dashboard-app/compare/v100.2.0...v100.2.1) (2024-04-24)


### Bug Fixes

* in paragraphs were removed in dashboard item description ([#2962](https://github.com/dhis2/dashboard-app/issues/2962)) ([783399e](https://github.com/dhis2/dashboard-app/commit/783399eb916556d1fe5723af1781d2e3c74e6f18))
* short name was not being shown in visualizations ([#2959](https://github.com/dhis2/dashboard-app/issues/2959)) ([c0fc1d6](https://github.com/dhis2/dashboard-app/commit/c0fc1d68b3fae20c1dcd3e5912a26e745fb015cb))
* **translations:** sync translations from transifex (dev) ([3651a71](https://github.com/dhis2/dashboard-app/commit/3651a716531dee8064a44c1771d74a55d6f3e4e1))

# [100.2.0](https://github.com/dhis2/dashboard-app/compare/v100.1.0...v100.2.0) (2024-04-17)


### Bug Fixes

* **translations:** sync translations from transifex (dev) ([dc1f032](https://github.com/dhis2/dashboard-app/commit/dc1f03262dde9bef167cfefe1ac5deab2ac799dc))


### Features

* add metadata support for TE (DHIS2-17242) ([#2956](https://github.com/dhis2/dashboard-app/issues/2956)) ([39bedbe](https://github.com/dhis2/dashboard-app/commit/39bedbe5b5c467d4730857ffe23f4db0c7a74db1))

# [100.1.0](https://github.com/dhis2/dashboard-app/compare/v100.0.4...v100.1.0) (2024-03-21)


### Bug Fixes

* show tag/tooltip about not applied filters for Outlier table (DHIS2-13858) ([#2937](https://github.com/dhis2/dashboard-app/issues/2937)) ([dffb754](https://github.com/dhis2/dashboard-app/commit/dffb75440509a6627d84b80aadf0c045ae1d3ae2))
* show tag/tooltip only when a filter other than ou/pe is used ([#2941](https://github.com/dhis2/dashboard-app/issues/2941)) ([b6b8850](https://github.com/dhis2/dashboard-app/commit/b6b8850a886955252e96b204a06bae36da3d5865))
* **translations:** sync translations from transifex (dev) ([755c6df](https://github.com/dhis2/dashboard-app/commit/755c6dff1e4a9d9e578b63c5711c109f0ad32248))
* use interpretations component from Analytics (DHIS2-15441) ([#2430](https://github.com/dhis2/dashboard-app/issues/2430)) ([0af5c5b](https://github.com/dhis2/dashboard-app/commit/0af5c5b3d4da3591da8766e9d746695830d83492))
* **translations:** sync translations from transifex (dev) ([0de3606](https://github.com/dhis2/dashboard-app/commit/0de3606aed8918ebd1bb4a6f304020bae22ffc75))
* **translations:** sync translations from transifex (dev) ([b88e87c](https://github.com/dhis2/dashboard-app/commit/b88e87cc57e6c1ce2e358dbcce706e3f3f7809e4))
* **translations:** sync translations from transifex (dev) ([#2920](https://github.com/dhis2/dashboard-app/issues/2920)) ([add7139](https://github.com/dhis2/dashboard-app/commit/add7139653fbe6d3c9b2bbd077e3894092b64780))


### Features

* support outlier table plugin (DHIS2-16751) ([#2912](https://github.com/dhis2/dashboard-app/issues/2912)) ([1af22d5](https://github.com/dhis2/dashboard-app/commit/1af22d5566409c438243f932379beae2315e6f41))

## [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
19 changes: 13 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 All @@ -63,6 +61,15 @@ Builds the app for production to the `build` folder.<br />. This command is run

See the [building](https://platform.dhis2.nu/#/scripts/build) section for more information.

## Conditional E2E Test Recording

To record e2e tests in Cypress Cloud, you can use one of the following methods based on your needs:

- **Commit Message**: Include `[e2e record]` in your commit messages to activate recording.
- **GitHub Labels**: Apply the `e2e record` label to your pull request to trigger recording.

This setup helps in managing Cypress Cloud credits more efficiently, ensuring recordings are only made when explicitly required.

## Learn More

You can learn more about the platform in the [DHIS2 Application Platform Documentation](https://platform.dhis2.nu/).
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
Loading

0 comments on commit dca740f

Please sign in to comment.