Skip to content

Commit

Permalink
Merge branch 'master' into DHIS2-17750
Browse files Browse the repository at this point in the history
  • Loading branch information
simonadomnisoru committed Aug 7, 2024
2 parents ab0a6ba + 24be388 commit c83542f
Show file tree
Hide file tree
Showing 78 changed files with 4,101 additions and 6,454 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@
"node": { "extensions": [".js", ".mjs"] },
"webpack": {
"config": "config/eslint/webpack.config.js"
}
},
"exports": {}
},
"import/core-modules": ["rxjs/operators"]
}
Expand Down
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ src/core_modules/capture-core/flow/
module.name_mapper='^capture-core' ->'<PROJECT_ROOT>/src/core_modules/capture-core'
module.name_mapper='^capture-ui' ->'<PROJECT_ROOT>/src/core_modules/capture-ui'
module.name_mapper='^capture-core-utils' ->'<PROJECT_ROOT>/src/core_modules/capture-core-utils'
module.name_mapper='^@dhis2/app-runtime/experimental' ->'<PROJECT_ROOT>/node_modules/@dhis2/app-runtime/build/es/experimental'
module.name_mapper='^@dhis2/rules-engine-javascript' ->'<PROJECT_ROOT>/packages/rules-engine/src'
esproposal.optional_chaining=enable
70 changes: 70 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,73 @@
# [100.73.0](https://github.com/dhis2/capture-app/compare/v100.72.0...v100.73.0) (2024-08-07)


### Features

* [DHIS2-16125] hide program stage under certain circumstances ([#3735](https://github.com/dhis2/capture-app/issues/3735)) ([c6b6dc0](https://github.com/dhis2/capture-app/commit/c6b6dc0330d8c92d8334fb1f0b34a5524ebb2967))

# [100.72.0](https://github.com/dhis2/capture-app/compare/v100.71.3...v100.72.0) (2024-08-06)


### Features

* [DHIS2-17648] Replace Material UI FormGroup, FormLabel and FormControl ([#3713](https://github.com/dhis2/capture-app/issues/3713)) ([f4af266](https://github.com/dhis2/capture-app/commit/f4af266142c95a6d8e899d0bc5b8d3ae90f38f85))

## [100.71.3](https://github.com/dhis2/capture-app/compare/v100.71.2...v100.71.3) (2024-08-06)


### Bug Fixes

* [DHIS2-17516] bad request when sorting in the working lists ([#3737](https://github.com/dhis2/capture-app/issues/3737)) ([69af6ec](https://github.com/dhis2/capture-app/commit/69af6ecdff0bdb6ca67b051aae8c26d519d27d55))

## [100.71.2](https://github.com/dhis2/capture-app/compare/v100.71.1...v100.71.2) (2024-08-04)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([0406022](https://github.com/dhis2/capture-app/commit/04060229ee917101907462edd3b18c7ae4cdb8a4))

## [100.71.1](https://github.com/dhis2/capture-app/compare/v100.71.0...v100.71.1) (2024-08-02)


### Bug Fixes

* [DHIS2-16373] cannot change AOC on existing events in Tracker program ([#3731](https://github.com/dhis2/capture-app/issues/3731)) ([f61c925](https://github.com/dhis2/capture-app/commit/f61c9253e028c3b683a2d5b153751c05ddb9c6f8))

# [100.71.0](https://github.com/dhis2/capture-app/compare/v100.70.15...v100.71.0) (2024-07-29)


### Features

* [DHIS2-17589] show absolute date when hovering over relative dates ([#3699](https://github.com/dhis2/capture-app/issues/3699)) ([1396394](https://github.com/dhis2/capture-app/commit/139639404ebf5fe429f4ea59e125c77dc554ecdd))

## [100.70.15](https://github.com/dhis2/capture-app/compare/v100.70.14...v100.70.15) (2024-07-28)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([f04c0f8](https://github.com/dhis2/capture-app/commit/f04c0f8d6a0c17df74bab6dad493c41b46620799))

## [100.70.14](https://github.com/dhis2/capture-app/compare/v100.70.13...v100.70.14) (2024-07-24)


### Bug Fixes

* **translations:** sync translations from transifex (master) ([2af3de0](https://github.com/dhis2/capture-app/commit/2af3de039dd7e330c34810c398ecb0df23c5a4b1))

## [100.70.13](https://github.com/dhis2/capture-app/compare/v100.70.12...v100.70.13) (2024-07-23)


### Bug Fixes

* [DHIS2-15687] display translated options in profile widget ([#3717](https://github.com/dhis2/capture-app/issues/3717)) ([54e5582](https://github.com/dhis2/capture-app/commit/54e5582bfcf3dbaf67c1e18ac2cf48953fedb22c))

## [100.70.12](https://github.com/dhis2/capture-app/compare/v100.70.11...v100.70.12) (2024-07-18)


### Bug Fixes

* [DHIS2-17653] Exclude Linked Events from Dropdown List in Actions Widget ([#3697](https://github.com/dhis2/capture-app/issues/3697)) ([305623e](https://github.com/dhis2/capture-app/commit/305623ef19b512b0ffc9f97d5824129b3b4484c0))

## [100.70.11](https://github.com/dhis2/capture-app/compare/v100.70.10...v100.70.11) (2024-07-15)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Feature: User interacts with the Enrollment New Event Workspace

# DHIS2-17657
@skip
Scenario: User can complete a Lab monitoring Event
Given you land on the enrollment new event page by having typed /#/enrollment?programId=ur1Edk5Oe2n&orgUnitId=DiszpKrYNg8&teiId=yGIeBkYzW2o&enrollmentId=Pm0VlgHBgRm
And the enrollment overview is finished loading
Expand All @@ -12,9 +10,8 @@ Feature: User interacts with the Enrollment New Event Workspace
And you click the Complete button
Then all events should be displayed
And the newest event in datatable nr 0 should contain Completed
And the events in Lab monitoring are deleted

# DHIS2-17657
@skip
Scenario: User can save a Sputum smear microscopy test without completing
Given you land on the enrollment new event page by having typed /#/enrollment?programId=ur1Edk5Oe2n&orgUnitId=DiszpKrYNg8&teiId=yGIeBkYzW2o&enrollmentId=Pm0VlgHBgRm
And the enrollment overview is finished loading
Expand All @@ -24,9 +21,10 @@ Feature: User interacts with the Enrollment New Event Workspace
And the user selects Positive
And you click the Save without completing button
Then all events should be displayed
And the newest event in datatable nr 2 should contain Active
And the newest event in datatable nr 2 should contain 13
And the newest event in datatable nr 2 should contain Positive
And the newest event in datatable nr 1 should contain Active
And the newest event in datatable nr 1 should contain 13
And the newest event in datatable nr 1 should contain Positive
And the events in Sputum smear microscopy are deleted

Scenario: Required fields should display an error when saving without data
Given you land on the enrollment new event page by having typed /#/enrollment?programId=ur1Edk5Oe2n&orgUnitId=DiszpKrYNg8&teiId=yGIeBkYzW2o&enrollmentId=Pm0VlgHBgRm
Expand Down Expand Up @@ -87,6 +85,6 @@ Feature: User interacts with the Enrollment New Event Workspace
And the enrollment status is active
And you type 2021-10-15 in the input number 0
And you select Died in the select number 0
And the user completes the event
And you click the Complete button
And the user completes the enrollment
Then the user sees the enrollment status and recently added event in Case outcome event status is completed
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,18 @@ And('the enrollment status is active', () => {
changeEnrollmentAndEventsStatus();
});

And('the user completes the event', () => {
And('you click the Complete button', () => {
cy.get('[data-test="dhis2-uicore-button"]')
.contains('Complete')
.click();
});

And('you click the Save without completing button', () => {
cy.get('[data-test="dhis2-uicore-button"]')
.contains('Save without completing')
.click();
});

When('the user completes the enrollment', () => {
cy.get('[data-test="enrollment-complete-modal"]').within(() => {
cy.contains('Case outcome completed').should('exist');
Expand Down Expand Up @@ -230,3 +236,23 @@ Then('the user sees the enrollment status and recently added event in Case outco
});
changeEnrollmentAndEventsStatus();
});

And(/^the events in (.*) are deleted$/, (name) => {
const programStages = [
{ name: 'Lab monitoring', id: 'EPEcjy3FWmI' },
{ name: 'Sputum smear microscopy', id: 'jdRD35YwbRH' },
];
const programStage = programStages.find(e => e.name === name);

cy.buildApiUrl('tracker', 'enrollments/Pm0VlgHBgRm?fields=events[programStage,event]')
.then(url => cy.request(url))
.then(({ body }) => {
const eventsToDelete = body.events.filter(e => e.programStage === programStage.id);

if (eventsToDelete) {
cy.buildApiUrl('tracker?async=false&importStrategy=DELETE').then((eventUrl) => {
cy.request('POST', eventUrl, { events: eventsToDelete });
});
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ Then the user see the following text: Low-dose acetylsalicylic acid given
When the user sets Plurality assessed to Singleton
Then the user don't see the following text: Low-dose acetylsalicylic acid given

# DHIS2-17730
@skip
Scenario: User can modify and save the data in the form
Given you land on the enrollment event page with selected Person by having typed /#/enrollmentEventEdit?orgUnitId=DiszpKrYNg8&eventId=V1CerIi3sdL
Then the user see the following text: Enrollment: View Event
And the user see the following text: 11
And the apgar score is 11
When the user clicks on the edit button
And the user set the apgar score to 5
And the user clicks on the save button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ const changeEnrollmentAndEventsStatus = () => (
})
);

And('the apgar score is 11', () => {
cy.buildApiUrl('tracker', 'events/V1CerIi3sdL')
.then(url => cy.request(url))
.then(({ body }) => {
const { dataValues, ...rest } = body;
const dataValuesToUpdate = dataValues.map(dataValue => (
dataValue.dataElement === 'a3kGcGDCuk6' ? { ...dataValue, value: 11 } : dataValue
));
const eventToUpdate = { ...rest, dataValues: dataValuesToUpdate };

return cy
.buildApiUrl('tracker?async=false&importStrategy=UPDATE')
.then(url => cy.request('POST', url, { events: [eventToUpdate] }))
.then(() => {
cy.reload();
cy.get('[data-test="widget-enrollment-event"]')
.find('[data-test="form-field"]')
.contains('11')
.should('exist');
});
});
});

Given(/^you land on the enrollment event page with selected (.*) by having typed (.*)$/, (tet, url) => {
cy.visit(url);
cy.get('[data-test="scope-selector"]').contains(`${tet}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Feature: Hidden program stage

Scenario: The user cannot add an event in a hidden program stage
Given you add an enrollment event that will result in a rule effect to hide a program stage
Then the New Postpartum care visit event button is disabled in the stages and events widget
Then the Postpartum care visit stage should not be displayed in the Stages and Events widget
And the Postpartum care visit button is disabled in the enrollmentEventNew page
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ Given('you add an enrollment event that will result in a rule effect to hide a p
cy.contains('[data-test="dhis2-uicore-button"]', 'Save without completing').click();
});

Then('the New Postpartum care visit event button is disabled in the stages and events widget', () => {
cy.contains('[data-test="create-new-button"]', 'New Postpartum care visit event')
.should('be.disabled');
Then('the Postpartum care visit stage should not be displayed in the Stages and Events widget', () => {
cy.get('[data-test="stages-and-events-widget"]').should('not.contain', 'Postpartum care visit');
});

Then('the Postpartum care visit button is disabled in the enrollmentEventNew page', () => {
Expand Down
3 changes: 3 additions & 0 deletions cypress/e2e/NewPage/NewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,9 @@ Then('you submit the form again from the duplicates modal', () => {
// New person in WHO RMNCH Tracker
And('you are in the WHO RMNCH program registration page', () => {
cy.visit('/#/new?programId=WSGAb5XwJ3Y&orgUnitId=DiszpKrYNg8');
cy.get('[data-test="capture-ui-input"]')
.eq(1)
.invoke('val').should('not.be.empty');
});

And('you are in Child programme registration page', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/cucumberPreprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = async function cucumberPreprocessor(on, config) {
test: /\.feature$/,
use: [
{
loader: '@badeball/cypress-cucumber-preprocessor/dist/bundler-utils/webpack',
loader: '@badeball/cypress-cucumber-preprocessor/webpack',
options: config,
},
],
Expand Down
Loading

0 comments on commit c83542f

Please sign in to comment.