Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into hv/fix/DHIS2-17101_…
Browse files Browse the repository at this point in the history
…ConsiderPreventAddingEventsToStageProgramRule
  • Loading branch information
henrikmv committed Aug 13, 2024
2 parents 86062d2 + e6f2a15 commit 50eb87f
Show file tree
Hide file tree
Showing 222 changed files with 5,570 additions and 7,488 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
119 changes: 119 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,122 @@
## [100.76.1](https://github.com/dhis2/capture-app/compare/v100.76.0...v100.76.1) (2024-08-09)


### Bug Fixes

* [DHIS2-17632][DHIS2-17633] restrict invalid category combo for orgUnit ([#3738](https://github.com/dhis2/capture-app/issues/3738)) ([bfffe06](https://github.com/dhis2/capture-app/commit/bfffe069e3c16387dc0da6c08ed25b91f3f55bf1))

# [100.76.0](https://github.com/dhis2/capture-app/compare/v100.75.1...v100.76.0) (2024-08-08)


### Features

* [DHIS2-17171] preview images in versions prior to 41 ([#3694](https://github.com/dhis2/capture-app/issues/3694)) ([2f51805](https://github.com/dhis2/capture-app/commit/2f51805b469d74b57bff7c927a9aa76420913ea1))

## [100.75.1](https://github.com/dhis2/capture-app/compare/v100.75.0...v100.75.1) (2024-08-08)


### Bug Fixes

* [DHIS2-17859] Add missing ids to Enrollment plugin ([#3748](https://github.com/dhis2/capture-app/issues/3748)) ([19c77ec](https://github.com/dhis2/capture-app/commit/19c77ec50c2fff0deef948abd516726b51f95418))

# [100.75.0](https://github.com/dhis2/capture-app/compare/v100.74.0...v100.75.0) (2024-08-07)


### Features

* [DHIS2-17726] Plugins in Profile Widget ([#3709](https://github.com/dhis2/capture-app/issues/3709)) ([d783ade](https://github.com/dhis2/capture-app/commit/d783ade253e27badf03d267d8a3935186b170fd8))

# [100.74.0](https://github.com/dhis2/capture-app/compare/v100.73.0...v100.74.0) (2024-08-07)


### Features

* [DHIS2-17591][DHIS2-17607] Plugins in event forms ([#3684](https://github.com/dhis2/capture-app/issues/3684)) ([205b9f5](https://github.com/dhis2/capture-app/commit/205b9f5746f3d9b3d0d28035fd99e40b5649003c))

# [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)


### Bug Fixes

* [DHIS2-15633] Change comment to note ([#3549](https://github.com/dhis2/capture-app/issues/3549)) ([56ea017](https://github.com/dhis2/capture-app/commit/56ea0174d1c18a008141ad7c9016353bdd01b9bc))

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


### Bug Fixes

* [DHIS2-17736] Dropdown Regression in Registration Form ([#3710](https://github.com/dhis2/capture-app/issues/3710)) ([4c46276](https://github.com/dhis2/capture-app/commit/4c462760547b796fe145a61a073cdf5987fe7e3f))

## [100.70.9](https://github.com/dhis2/capture-app/compare/v100.70.8...v100.70.9) (2024-07-10)


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 @@ -79,14 +77,14 @@ Feature: User interacts with the Enrollment New Event Workspace
Given you land on the enrollment new event page by having typed /#/enrollmentEventNew?enrollmentId=qcFFRp7DpcX&orgUnitId=DiszpKrYNg8&programId=WSGAb5XwJ3Y&stageId=edqlbukwRfQ&teiId=erqa3phUfpI
And you see the following Enrollment: New Event
And you select the schedule tab
When you add a comment to the event
When you add a note to the event
And the events saves successfully

Scenario: User can add a new event and complete the enrollment
Given you land on the enrollment new event page by having typed #/enrollmentEventNew?enrollmentId=FZAa7j0muDj&orgUnitId=DiszpKrYNg8&programId=qDkgAbB5Jlk&stageId=eHvTba5ijAh&teiId=bj4UmUpqaSp
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 @@ -61,12 +61,12 @@ Given('you select the schedule tab', () => {
.click();
});

When('you add a comment to the event', () => {
cy.get('[data-test="comment-textfield"]')
.type('This is a comment')
When('you add a note to the event', () => {
cy.get('[data-test="note-textfield"]')
.type('This is a note')
.blur();

cy.get('[data-test="add-comment-btn"]')
cy.get('[data-test="add-note-btn"]')
.click();
});

Expand Down 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
11 changes: 7 additions & 4 deletions cypress/e2e/NewPage/NewPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ And('you see the registration form for the Malaria case registration', () => {
.contains('Complete event')
.should('exist');
cy.get('[data-test="registration-page-content"]')
.contains('Comments')
.contains('Notes')
.should('exist');
cy.get('[data-test="registration-page-content"]')
.contains('Write comment')
.contains('Write note')
.should('exist');
cy.get('[data-test="registration-page-content"]')
.contains('Relationships')
Expand Down Expand Up @@ -291,10 +291,10 @@ And('you see the registration form for the specific category', () => {
.contains('Complete event')
.should('exist');
cy.get('[data-test="registration-page-content"]')
.contains('Comments')
.contains('Notes')
.should('exist');
cy.get('[data-test="registration-page-content"]')
.contains('Write comment')
.contains('Write note')
.should('exist');

cy.get('[data-test="dhis2-uicore-splitbutton"]')
Expand Down 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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { When, Then } from '@badeball/cypress-cucumber-preprocessor';

Then('the stages and events should be loaded', () => {
cy.contains('Stages and Events').should('exist');
});

When(/^you fill in the note: (.*)$/, (note) => {
cy.get('[data-test="enrollment-note-widget"]').within(() => {
cy.get('[data-test="note-textfield"]').type(note);
cy.wait(100);

cy.get('[data-test="add-note-btn"]').should('exist');
cy.get('[data-test="add-note-btn"]').click();
});
});

Then(/^list should contain the new note: (.*)$/, (note) => {
cy.get('[data-test="enrollment-note-widget"]').within(() => {
cy.get('[data-test="note-item"]').contains(note).should('exist');
});
});
Loading

0 comments on commit 50eb87f

Please sign in to comment.