Skip to content

Commit

Permalink
Merge branch 'master' into TECH-1627
Browse files Browse the repository at this point in the history
  • Loading branch information
superskip authored Oct 2, 2023
2 parents 8ea6206 + 12060ed commit 1f0a128
Show file tree
Hide file tree
Showing 107 changed files with 3,920 additions and 3,351 deletions.
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-capture-app:r:en-pot]
file_filter = i18n/<lang>.po
Expand Down
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
## [100.40.1](https://github.com/dhis2/capture-app/compare/v100.40.0...v100.40.1) (2023-09-30)


### Bug Fixes

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

# [100.40.0](https://github.com/dhis2/capture-app/compare/v100.39.4...v100.40.0) (2023-09-20)


### Features

* [DHIS2-15830] Add orgUnitId to plugin context ([b9ec237](https://github.com/dhis2/capture-app/commit/b9ec237af595a1112dc6db01206e8332c9bb6647))

## [100.39.4](https://github.com/dhis2/capture-app/compare/v100.39.3...v100.39.4) (2023-09-19)


### Bug Fixes

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

## [100.39.3](https://github.com/dhis2/capture-app/compare/v100.39.2...v100.39.3) (2023-09-14)


### Bug Fixes

* [DHIS2-15356] change tei search parameter from `ou` to `orgUnit` ([#3362](https://github.com/dhis2/capture-app/issues/3362)) ([c7ab828](https://github.com/dhis2/capture-app/commit/c7ab82826254be24959ff25d643b68c1e525c893))

## [100.39.2](https://github.com/dhis2/capture-app/compare/v100.39.1...v100.39.2) (2023-09-14)


### Bug Fixes

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

## [100.39.1](https://github.com/dhis2/capture-app/compare/v100.39.0...v100.39.1) (2023-09-13)


### Bug Fixes

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

# [100.39.0](https://github.com/dhis2/capture-app/compare/v100.38.0...v100.39.0) (2023-09-07)


### Features

* [DHIS2-13343] hidden program stage rule effect ([#3406](https://github.com/dhis2/capture-app/issues/3406)) ([4ef2973](https://github.com/dhis2/capture-app/commit/4ef2973b71d6376f99db07e70bc4d51facb8018e))

# [100.38.0](https://github.com/dhis2/capture-app/compare/v100.37.0...v100.38.0) (2023-09-06)


### Features

* [DHIS2-14334] edit enrollment date ([#3350](https://github.com/dhis2/capture-app/issues/3350)) ([9dd1b6a](https://github.com/dhis2/capture-app/commit/9dd1b6a046e94021ae4e63a67a3d6b16a099212d))

# [100.37.0](https://github.com/dhis2/capture-app/compare/v100.36.0...v100.37.0) (2023-08-22)


Expand Down
7 changes: 7 additions & 0 deletions cypress/integration/EnrollmentPage/HiddenProgramStage.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
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
And and an error is show in the Postpartum care visit stage
And the Postpartum care visit button is disabled in the enrollmentEventNew page
66 changes: 66 additions & 0 deletions cypress/integration/EnrollmentPage/HiddenProgramStage/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import moment from 'moment';

const cleanUpIfApplicable = () => {
cy.buildApiUrl(
'tracker',
'trackedEntities/uW8Y7AIcRKA?program=WSGAb5XwJ3Y&fields=enrollments',
)
.then(url => cy.request(url))
.then(({ body }) => {
const enrollment = body.enrollments?.find(e => e.enrollment === 'fmhIsWXVDmS');
const event = enrollment?.events?.find(e => e.programStage === 'PFDfvmGpsR3');
if (!event) {
return null;
}
return cy
.buildApiUrl('events', event.event)
.then(eventUrl =>
cy.request('DELETE', eventUrl));
});
};

Given('you add an enrollment event that will result in a rule effect to hide a program stage', () => {
cleanUpIfApplicable();
cy.visit(
'/#/enrollmentEventNew?enrollmentId=fmhIsWXVDmS&orgUnitId=s7SLtx8wmRA&programId=WSGAb5XwJ3Y&stageId=PFDfvmGpsR3&teiId=uW8Y7AIcRKA',
);

cy.get('[data-test="capture-ui-input"]')
.eq(0)
.type(moment().format('YYYY-MM-DD'))
.blur();

cy
.get('[data-test="virtualized-select"]')
.eq(6)
.click()
.contains('Termination of pregnancy')
.click();

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('and an error is show in the Postpartum care visit stage', () => {
cy.visit(
'/#/enrollmentEventNew?enrollmentId=fmhIsWXVDmS&orgUnitId=s7SLtx8wmRA&programId=WSGAb5XwJ3Y&teiId=uW8Y7AIcRKA&stageId=bbKtnxRZKEP',
);
cy.contains('[data-test="dhis2-uicore-button"]', 'Complete')
.should('be.disabled');
cy.contains('[data-test="dhis2-uicore-button"]', 'Save without completing')
.should('be.disabled');
cy.contains('[data-test="dhis2-uicore-noticebox-content"]', 'You can\'t add any more Postpartum care visit events')
.should('exist');
});

Then('the Postpartum care visit button is disabled in the enrollmentEventNew page', () => {
cy.visit(
'/#/enrollmentEventNew?enrollmentId=fmhIsWXVDmS&orgUnitId=s7SLtx8wmRA&programId=WSGAb5XwJ3Y&teiId=uW8Y7AIcRKA',
);

cy.contains('[data-test="program-stage-selector-button"]', 'Postpartum care visit').should('be.disabled');
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ Then('the enrollment widget should be opened', () => {
});

Then('the user sees the enrollment date', () => {
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-enrollment-date"]').within(() => {
cy.get('[data-test="widget-enrollment-icon-calendar"]').should('exist');
cy.get('[data-test="widget-enrollment-enrollment-date"]')
.contains(`Date of enrollment ${getCurrentYear()}-08-01`)
cy.get('[data-test="widget-enrollment-date"]')
.contains(`Date of enrollment: ${getCurrentYear()}-08-01`)
.should('exist');
});
});

Then('the user sees the incident date', () => {
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-incident-date"]')
.contains(`Date of birth ${getCurrentYear()}-08-01`)
cy.get('[data-test="widget-enrollment-incident-date"]').within(() => {
cy.get('[data-test="widget-enrollment-date"]')
.contains(`Date of birth: ${getCurrentYear()}-08-01`)
.should('exist');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Then('the list should display the events retrieved from the api', () => {
cy.get('[data-test="event-working-lists"]')
.find('tr')
.each(($teiRow, index) => {
const rowId = $teiRow.get(0).getAttribute('id');
const rowId = $teiRow.get(0).getAttribute('data-test');
if (index > 1) {
expect(rowId).to.equal(teis[index - 1].event);
}
Expand Down Expand Up @@ -232,25 +232,27 @@ When('you click the report date column header', () => {

cy.route('GET', '**/tracker/events**').as('getEvents');

cy.get('[data-test="online-list-table"]')
.contains('Report date')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click()
.click();
});

Then('events should be retrieved from the api ordered ascendingly by report date', () => {
cy.wait('@getEvents', { timeout: 40000 }).as('result');
cy.wait('@getEvents', { timeout: 40000 }).as('resultDefault');
cy.wait('@getEvents', { timeout: 40000 }).as('resultAsc');

cy.get('@result')
cy.get('@resultAsc')
.its('status')
.should('equal', 200);

cy.get('@result')
cy.get('@resultAsc')
.its('url')
.should('match', /order=.*asc/);

cy.get('@result')
cy.get('@resultAsc')
.its('url')
.should('include', 'page=1');

cy.get('@result').its('response.body.instances').as('events');
cy.get('@resultAsc').its('response.body.instances').as('events');
});
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,9 @@ Then('the list should display 10 rows of data', () => {
});

When('you click the report date column header', () => {
cy.get('[data-test="online-list-table"]')
.contains('Report date')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click()
.click();
});

Expand Down Expand Up @@ -364,8 +365,9 @@ When('you change the sharing settings', () => {


When('you update the working list', () => {
cy.get('[data-test="online-list-table"]')
.contains('Report date')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click()
.click();

cy.get('[data-test="list-view-menu-button"]')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Then('the list should display the teis retrieved from the api', () => {
cy.get('[data-test="tei-working-lists"]')
.find('tr')
.each(($teiRow, index) => {
const rowId = $teiRow.get(0).getAttribute('id');
const rowId = $teiRow.get(0).getAttribute('data-test');
if (index > 1) {
expect(rowId).to.equal(teis[index - 1].trackedEntity);
}
Expand Down Expand Up @@ -226,8 +226,8 @@ When('you click the first name column header', () => {

cy.route('GET', '**/tracker/trackedEntities**').as('getTeis');

cy.get('[data-test="online-list-table"]')
.contains('First name')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ And you apply the current filter
When you click the last name column header
Then the sort arrow should indicate ascending order
And the list should display data ordered ascendingly by last name
When you click the WHOMCH Smoking column header
When you click the WHOMCH Hemoglobin value column header
Then the sort arrow should indicate descending order
And the list should display data ordered ascendingly by WHOMCH Smoking
And the list should display data ordered descending by WHOMCH Hemoglobin

@v>=39
Scenario: The user can remove the program stage filter
Expand Down Expand Up @@ -233,7 +233,7 @@ And the Custom Program stage list is deleted

@v>=40
Scenario: The user can save a program stage working list, based on a TEI working list configuration
Given you open the main page with Ngelehun and Malaria focus investigation context
Given you open a clean main page with Ngelehun and Malaria focus investigation context
Then you see the custom TEI working lists
And you can load the view with the name Ongoing foci responses
And you open the program stage filters from the more filters dropdown menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ import { v4 as uuid } from 'uuid';
import '../../sharedSteps';
import '../../../sharedSteps';

const cleanUpIfApplicable = () => {
cy.buildApiUrl('programStageWorkingLists?filter=program.id:eq:qDkgAbB5Jlk&fields=id,displayName')
.then(url => cy.request(url))
.then(({ body }) => {
const workingList = body.programStageWorkingLists?.find(e => e.displayName === 'Custom Program stage list');
if (!workingList) {
return null;
}
return cy
.buildApiUrl('programStageWorkingLists', workingList.id)
.then(workingListUrl => cy.request('DELETE', workingListUrl));
});
};
Given('you open the main page with Ngelehun and child programme context', () => {
cy.visit('#/?programId=IpHINAT79UW&orgUnitId=DiszpKrYNg8');
});
Expand Down Expand Up @@ -42,6 +55,7 @@ Given('you open the main page with Ngelehun and Malaria case diagnosis context',
});

Given('you open the main page with Ngelehun and Malaria case diagnosis and Household investigation context', () => {
cleanUpIfApplicable();
cy.visit('#/?programId=qDkgAbB5Jlk&orgUnitId=DiszpKrYNg8');

cy.get('[data-test="tei-working-lists"]')
Expand All @@ -60,6 +74,11 @@ Given('you open the main page with Ngelehun and Malaria case diagnosis and House
.click();
});

Given('you open a clean main page with Ngelehun and Malaria focus investigation context', () => {
cleanUpIfApplicable();
cy.visit('#/?programId=M3xtLkYBlKI&orgUnitId=DiszpKrYNg8');
});

Then('the default working list should be displayed', () => {
const names = [
'Filona',
Expand Down Expand Up @@ -332,20 +351,21 @@ Then('the list should display 10 rows of data', () => {
});

When('you click the first name column header', () => {
cy.get('[data-test="online-list-table"]')
.contains('First name')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(0)
.click();
});

When('you click the last name column header', () => {
cy.get('[data-test="online-list-table"]')
.contains('Last name')
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.eq(2)
.click();
});

When('you click the WHOMCH Smoking column header', () => {
cy.get('[data-test="online-list-table"]')
.contains('WHOMCH Smoking')
When('you click the WHOMCH Hemoglobin value column header', () => {
cy.get('[data-test="dhis2-uicore-tableheadercellaction"]')
.last()
.click()
.click();
});

Expand Down Expand Up @@ -399,10 +419,10 @@ Then('the list should display data ordered ascendingly by last name', () => {
});
});

Then('the list should display data ordered ascendingly by WHOMCH Smoking', () => {
Then('the list should display data ordered descending by WHOMCH Hemoglobin', () => {
const names = [
'Siren',
'Hertz',
'Siren',
];

cy.get('[data-test="tei-working-lists"]')
Expand Down Expand Up @@ -739,3 +759,4 @@ Then('the program stage custom working list filters are loaded', () => {
.find('[data-test="more-filters"]')
.should('have.length', 2);
});

10 changes: 6 additions & 4 deletions cypress/integration/WorkingLists/sharedSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ Then('the pagination for the tei working list should show the second page', () =
});

Then('the sort arrow should indicate ascending order', () => {
cy.get('[data-test="data-table-asc-sort-icon"]')
.should('exist');
cy.get('[data-test="table-row"]').within(() => {
cy.get('[data-test="table-row-asc"]').should('exist');
});
});

Then('the enrollment status filter button should show that the active filter is in effect', () => {
Expand Down Expand Up @@ -133,8 +134,9 @@ When('you click the first page button', () => {
});

Then('the sort arrow should indicate descending order', () => {
cy.get('[data-test="data-table-desc-sort-icon"]')
.should('exist');
cy.get('[data-test="table-row"]').within(() => {
cy.get('[data-test="table-row-desc"]').should('exist');
});
});

Then('rows per page should be set to 15', () => {
Expand Down
Loading

0 comments on commit 1f0a128

Please sign in to comment.