Skip to content

Commit

Permalink
Merge branch 'master' into hv/feat/DHIS2-17771_OrgUnitContextualizati…
Browse files Browse the repository at this point in the history
…onInSelfContainedWidgets
  • Loading branch information
henrikmv committed Sep 12, 2024
2 parents 1193a08 + f6b7f3d commit efe949d
Show file tree
Hide file tree
Showing 71 changed files with 1,341 additions and 716 deletions.
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# [101.4.0](https://github.com/dhis2/capture-app/compare/v101.3.3...v101.4.0) (2024-09-09)


### Features

* [DHIS2-17878][DHIS2-17048] Add overflow menu with actions to stages&events ([#3756](https://github.com/dhis2/capture-app/issues/3756)) ([12af138](https://github.com/dhis2/capture-app/commit/12af1384f4ab4e9c6eeef2460bee7d53bfb6b8cc))

## [101.3.3](https://github.com/dhis2/capture-app/compare/v101.3.2...v101.3.3) (2024-09-02)


### Bug Fixes

* [DHIS2-17971] trigger program stage specific rules on opening new event page ([#3776](https://github.com/dhis2/capture-app/issues/3776)) ([cd06e41](https://github.com/dhis2/capture-app/commit/cd06e414fc2162397f3844887e1b3f902d18a874))

## [101.3.2](https://github.com/dhis2/capture-app/compare/v101.3.1...v101.3.2) (2024-09-01)


### Bug Fixes

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

## [101.3.1](https://github.com/dhis2/capture-app/compare/v101.3.0...v101.3.1) (2024-08-29)


### Bug Fixes

* [DHIS2-17651] enrollment dashboard UI changes ([#3767](https://github.com/dhis2/capture-app/issues/3767)) ([012b60d](https://github.com/dhis2/capture-app/commit/012b60d3c297eea1bc3bfb62d9329ba37a9c0f94))

# [101.3.0](https://github.com/dhis2/capture-app/compare/v101.2.2...v101.3.0) (2024-08-28)


### Features

* [DHIS2-11836] respect block entry form ([#3759](https://github.com/dhis2/capture-app/issues/3759)) ([ed3ed5a](https://github.com/dhis2/capture-app/commit/ed3ed5a58f602ea487b90bb5997aad9f3b6e22cb))

## [101.2.2](https://github.com/dhis2/capture-app/compare/v101.2.1...v101.2.2) (2024-08-28)


### Bug Fixes

* [DHIS2-17953] Invalid dateFormat conversion in related stages ([#3774](https://github.com/dhis2/capture-app/issues/3774)) ([334297c](https://github.com/dhis2/capture-app/commit/334297c91fca8ef427729a6454f5a8f8dd550453))

## [101.2.1](https://github.com/dhis2/capture-app/compare/v101.2.0...v101.2.1) (2024-08-25)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const changeEnrollmentAndEventsStatus = () => (
);

const showAllEventsInProgramStage = () => {
cy.get('[data-test="dhis2-uicore-tablefoot"]')
cy.get('[data-test="dhis2-uicore-tabletoolbar"]')
.then(($footer) => {
if ($footer.find('[data-test="show-more-button"]').length > 0) {
$footer.find('[data-test="show-more-button"]')
Expand Down Expand Up @@ -119,11 +119,6 @@ When(/^you click the button to (.*) without post request/, (buttonText) => {

When('the enrollment overview is finished loading', () => {
cy.get('[data-test="dhis2-uicore-circularloader"]').should('not.exist');
cy.get('[data-test="dhis2-uicore-datatable"]')
.within(() => {
cy.get('[data-test="dhis2-uicore-datatablerow"]')
.should('exist');
});
});

When('the form is finished loading', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ Scenario: User can see disabled scheduled date for active event
Then the user see the following text: Enrollment: Edit Event
Then the user see the schedule date field with tooltip: Scheduled date cannot be changed for Active events

@user:trackerAutoTestRestricted
Scenario: The user cannot enter edit mode for completed events
Given you land on the enrollment event page with selected Person by having typed /#/enrollmentEventEdit?eventId=nUVwTLuQ6FT&orgUnitId=DiszpKrYNg8
And the user see the following text: Enrollment: View Event
Then the edit button should be disabled

Scenario: User can edit the event and complete the enrollment
Given you land on the enrollment event page with selected Malaria Entity by having typed #/enrollmentEventEdit?eventId=MHR4Zj6KLz0&orgUnitId=DiszpKrYNg8
And the enrollment status is active
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,9 @@ And('you open the Birth stage event', () => {
});
});

Then('the edit button should be disabled', () => {
cy.get('[data-test="widget-enrollment-event"]')
.find('[data-test="dhis2-uicore-button"]')
.eq(1)
.should('be.disabled');
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
Feature: User interacts with Stages and Events Widget

@user:trackerAutoTestRestricted
Scenario: Create new event button is disabled if no data write access
Given you open the enrollment page by typing #enrollment?enrollmentId=WKPoiZxZxNG&orgUnitId=DiszpKrYNg8&programId=WSGAb5XwJ3Y&teiId=PgmUFEQYZdt
Then you should see the disabled button New Previous deliveries event

Scenario: User can view program stages
Given you open the enrollment page
Expand All @@ -29,13 +25,10 @@ Feature: User interacts with Stages and Events Widget
And you see the first 5 events in the table
And you see buttons in the footer list

Scenario: User can view more events and then view less
Scenario: User can view more events
Given you open the enrollment page which has multiples events and stages
When you click show more button in stages&event list
Then more events should be displayed
And reset button should be displayed
And you click reset button
Then there should be 5 rows in the table
Then there should be 10 rows in the table

Scenario: User can sort the list of events
Given you open the enrollment page which has multiples events and stages
Expand All @@ -60,13 +53,36 @@ Feature: User interacts with Stages and Events Widget
When you click New First antenatal care visit event
Then you should navigate to Add new page #/enrollmentEventNew?enrollmentId=ek4WWAgXX5i&orgUnitId=DwpbWkiqjMy&programId=WSGAb5XwJ3Y&stageId=WZbXY0S00lP&teiId=yFcOhsM1Yoa


Scenario: User can not go to Add new page if stage is not repeatable and there is event in the stage
Given you open the enrollment page by typing #enrollment?programId=IpHINAT79UW&orgUnitId=UgYg0YW7ZIh&teiId=fhFQhO0xILJ&enrollmentId=gPDueU02tn8
Then you should see the disabled button New Birth event

Scenario: User can skip a scheduled event
Given you open the enrollment page by typing #/enrollment?enrollmentId=gL8BooqKhdX&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=RABlFsj5Omi
And there is an Overdue event in the TB visit stage
When you click the Skip event overflow button on the Overdue event
Then the event should be skipped

Scenario: User can unskip a scheduled event
Given you open the enrollment page by typing #/enrollment?enrollmentId=gL8BooqKhdX&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=RABlFsj5Omi
And there is an Skipped event in the TB visit stage
When you click the Unskip event overflow button on the Skipped event
Then there is an Overdue event in the TB visit stage

@with-restore-deleted-event
Scenario: User can delete an event
Given you open the enrollment page by typing #/enrollment?enrollmentId=ikYMpSKXik1&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=Trc1H9T5C6f
And there is an Active event in the TB visit stage
When you click the Delete event overflow button on the Active event
And you confirm you want to delete the event
Then the TB visit stage should be empty

@user:trackerAutoTestRestricted
Scenario: Program stage is hidden if no data read access
And you open the enrollment page by typing #enrollment?enrollmentId=iNEq9d22Nyp&orgUnitId=DiszpKrYNg8&programId=WSGAb5XwJ3Y&teiId=k4ODejBytgv
Then the Care at birth program stage should be hidden

@user:trackerAutoTestRestricted
Scenario: Create new event button is disabled if no data write access
Given you open the enrollment page by typing #enrollment?enrollmentId=WKPoiZxZxNG&orgUnitId=DiszpKrYNg8&programId=WSGAb5XwJ3Y&teiId=PgmUFEQYZdt
Then you should see the disabled button New Previous deliveries event
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
import { Given, When, Then, defineStep as And } from '@badeball/cypress-cucumber-preprocessor';
import { Given, When, Then, defineStep as And, After } from '@badeball/cypress-cucumber-preprocessor';
import { getCurrentYear } from '../../../support/date';
import '../sharedSteps';

After({ tags: '@with-restore-deleted-event' }, () => {
cy.visit('#/enrollment?enrollmentId=ikYMpSKXik1&orgUnitId=DiszpKrYNg8&programId=ur1Edk5Oe2n&teiId=Trc1H9T5C6f');

cy.get('[data-test="stages-and-events-widget"]')
.find('[data-test="widget-contents"]')
.contains('[data-test="stage-content"]', 'TB visit')
.find('[data-test="create-new-button"]')
.click();

cy.get('[data-test="capture-ui-input"]')
.first()
.type('2023-01-26')
.blur();

cy.get('[data-test="virtualized-select"]')
.eq(0)
.click()
.contains('P+')
.click();

cy.get('[data-test="virtualized-select"]')
.eq(1)
.click()
.contains('New')
.click();

cy.get('[data-test="dhis2-uicore-button"]')
.contains('Save without completing')
.click();
});

Then('the program stages should be displayed', () => {
cy.get('[data-test="stages-and-events-widget"]')
.within(() => {
Expand Down Expand Up @@ -49,7 +80,7 @@ When('you click show more button in stages&event list', () => {
});
});

Then('more events should be displayed', () => {
Then('there should be 10 rows in the table', () => {
cy.get('[data-test="stages-and-events-widget"]')
.find('[data-test="widget-contents"]')
.find('[data-test="stage-content"]')
Expand All @@ -61,34 +92,6 @@ Then('more events should be displayed', () => {
});
});

Then('reset button should be displayed', () => {
cy.get('[data-test="stages-and-events-widget"]').within(() => {
cy.get('[data-test="view-all-button"]').should('exist');
cy.get('[data-test="show-more-button"]').should('exist');
cy.get('[data-test="reset-button"]').should('exist');
cy.get('[data-test="create-new-button"]').should('exist');
});
});

And('you click reset button', () => {
cy.get('[data-test="stages-and-events-widget"]').within(() => {
cy.get('[data-test="reset-button"]').click();
cy.wait(100);
});
});

Then('there should be 5 rows in the table', () => {
cy.get('[data-test="stages-and-events-widget"]')
.find('[data-test="widget-contents"]')
.find('[data-test="stage-content"]')
.eq(2)
.within(() => {
cy.get('[data-test="dhis2-uicore-datatable"]').should('exist');
cy.get('[data-test="dhis2-uicore-tablebody"]')
.find('[data-test="dhis2-uicore-datatablerow"]').should('have.length', 5);
});
});

Then('the default list should be displayed', () => {
const rows = [
'07-13|Bumbeh MCHP',
Expand Down Expand Up @@ -190,3 +193,58 @@ Then('the Care at birth program stage should be hidden', () => {
cy.contains('[data-test="stages-and-events-widget"]', 'Postpartum care visit').should('exist');
cy.contains('[data-test="stages-and-events-widget"]', 'Care at birth').should('not.exist');
});

Given(/there is an (.*) event in the TB visit stage$/, (eventStatus) => {
cy.get('[data-test="stages-and-events-widget"]')
.find('[data-test="widget-contents"]')
.contains('[data-test="stage-content"]', 'TB visit')
.within(() => {
cy.get('[data-test="dhis2-uicore-datatablerow"]')
.contains(eventStatus);
});
});

When(/you click the (.*) event overflow button on the (.*) event$/, (buttonName, eventStatus) => {
cy.get('[data-test="stages-and-events-widget"]')
.find('[data-test="widget-contents"]')
.contains('[data-test="stage-content"]', 'TB visit')
.find('[data-test="dhis2-uicore-tablebody"]')
.contains('tr', eventStatus)
.find('[data-test="overflow-button"]')
.click({ force: true });

cy.get('[data-test="overflow-menu"]')
.contains(buttonName)
.click();
});

Then('the event should be skipped', () => {
cy.get('[data-test="stages-and-events-widget"]')
.find('[data-test="widget-contents"]')
.contains('[data-test="stage-content"]', 'TB visit')
.find('[data-test="dhis2-uicore-datatablerow"]')
.contains('Skipped');
});

Then('the TB visit stage should be empty', () => {
cy.get('[data-test="stages-and-events-widget"]')
.find('[data-test="widget-contents"]')
.contains('[data-test="stage-content"]', 'TB visit')
.find('[data-test="dhis2-uicore-datatablerow"]')
.should('not.exist');
});

When('you confirm you want to delete the event', () => {
cy.intercept('POST', '**/tracker?async=false&importStrategy=DELETE')
.as('deleteEvent');

cy.get('[data-test="dhis2-uicore-modal"]').within(() => {
cy.contains('button', 'Yes, delete event')
.click();
});

cy.wait('@deleteEvent')
.its('response.statusCode')
.should('eq', 200);
});

29 changes: 10 additions & 19 deletions i18n/ar_IQ.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
msgid ""
msgstr ""
"Project-Id-Version: i18next-conv\n"
"POT-Creation-Date: 2024-08-08T11:49:13.423Z\n"
"POT-Creation-Date: 2024-08-10T10:42:21.141Z\n"
"PO-Revision-Date: 2019-06-27 07:31+0000\n"
"Last-Translator: KRG HIS <[email protected]>, 2024\n"
"Language-Team: Arabic (Iraq) (https://app.transifex.com/hisp-uio/teams/100509/ar_IQ/)\n"
Expand Down Expand Up @@ -491,18 +491,6 @@ msgstr "يحتوي على نص"
msgid "Yes"
msgstr "نعم"

msgid "mm/dd/yyyy"
msgstr "شهر / يوم / سنة"

msgid "Years"
msgstr "السنوات"

msgid "Months"
msgstr "الأشهر"

msgid "Days"
msgstr "‏‏الأيام"

msgid "Uploading file"
msgstr "تحميل ملف"

Expand Down Expand Up @@ -1323,6 +1311,9 @@ msgstr ""
msgid "Event completed"
msgstr ""

msgid "The event cannot be edited after it has been completed"
msgstr ""

msgid "Back to all stages and events"
msgstr ""

Expand Down Expand Up @@ -1482,22 +1473,22 @@ msgstr ""
msgid "Please select a valid event"
msgstr ""

msgid "New {{ eventName }} event"
msgid "You do not have access to create events in this stage"
msgstr ""

msgid "To open this event, please wait until saving is complete"
msgid "This stage can only have one event"
msgstr ""

msgid "Show {{ rest }} more"
msgid "New {{ eventName }} event"
msgstr ""

msgid "Reset list"
msgid "To open this event, please wait until saving is complete"
msgstr ""

msgid "Go to full {{ eventName }}"
msgid "Show {{ rest }} more"
msgstr ""

msgid "This stage can only have one event"
msgid "Go to full {{ eventName }}"
msgstr ""

msgid "Events could not be retrieved. Please try again later."
Expand Down
Loading

0 comments on commit efe949d

Please sign in to comment.