Skip to content

Commit

Permalink
fix: [DHIS2-15633] Change comment to note (#3549)
Browse files Browse the repository at this point in the history
Co-authored-by: Joakim Storløkken Melseth <[email protected]>
  • Loading branch information
henrikmv and JoakimSM authored Jul 15, 2024
1 parent b9bf96f commit 56ea017
Show file tree
Hide file tree
Showing 64 changed files with 339 additions and 341 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ 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
Expand Down
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
8 changes: 4 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

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');
});
});
27 changes: 0 additions & 27 deletions cypress/e2e/WidgetsForEnrollmentPages/WidgetEventComment/index.js

This file was deleted.

27 changes: 27 additions & 0 deletions cypress/e2e/WidgetsForEnrollmentPages/WidgetEventNote/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { When, Then } from '@badeball/cypress-cucumber-preprocessor';

Then('the enrollment widget should be loaded', () => {
cy.contains('The enrollment event data could not be found').should('not.exist');
});

When('you click edit mode', () => {
cy.contains('[data-test="dhis2-uicore-button"]', 'Edit event')
.click();
cy.contains('Enrollment: Edit Event').should('exist');
});

When(/^you fill in the note: (.*)$/, (note) => {
cy.get('[data-test="event-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="event-note-widget"]').within(() => {
cy.get('[data-test="note-item"]').contains(note).should('exist');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ Feature: The user interacts with the widgets on the enrollment dashboard
Scenario: User can add note on enrollment dashboard page
Given you land on the enrollment dashboard page by having typed #/enrollment?enrollmentId=wBU0RAsYjKE
Then the stages and events should be loaded
When you fill in the comment: new test enrollment comment
Then list should contain the new comment: new test enrollment comment
When you fill in the note: new test enrollment note
Then list should contain the new note: new test enrollment note

Scenario: The program rules are triggered and the effects are displayed in the sidebar widgets
Given you land on the enrollment dashboard page by having typed #/enrollment?enrollmentId=wBU0RAsYjKE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import moment from 'moment';
import '../sharedSteps';
import '../WidgetEnrollment';
import '../WidgetProfile';
import '../WidgetEnrollmentComment';
import '../WidgetEnrollmentNote';

When('the user sets the birthday date to the current date', () => {
cy.get('[data-test="modal-edit-profile"]').find('[data-test="capture-ui-input"]').eq(8).clear()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ Feature: The user interacts with the widgets on the enrollment edit event
Scenario: User can add note on edit event page view mode
Given you land on the enrollment edit event page by having typed /#/enrollmentEventEdit?eventId=XGLkLlOXgmE&orgUnitId=DiszpKrYNg8
Then the enrollment widget should be loaded
When you fill in the comment: new test comment
Then list should contain the new comment: new test comment
When you fill in the note: new test note
Then list should contain the new note: new test note

# DHIS2-17635
@v<=41
Scenario: User can see note on edit event page edit mode
Given you land on the enrollment edit event page by having typed /#/enrollmentEventEdit?eventId=XGLkLlOXgmE&orgUnitId=DiszpKrYNg8
Then the enrollment widget should be loaded
When you click edit mode
Then list should contain the new comment: new test comment
Then list should contain the new note: new test note

Scenario: You can assign a user to a event
Given you land on the enrollment edit event page by having typed /#/enrollmentEventEdit?eventId=veuwiLC2x0e&orgUnitId=g8upMTyEZGZ
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../sharedSteps';
import '../WidgetEnrollment';
import '../WidgetProfile';
import '../WidgetEventComment';
import '../WidgetEventNote';
import '../WidgetAssignee';
import '../WidgetChangelog';

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user/resources/images/schedule_event_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/user/resources/images/schedule_event_04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 11 additions & 10 deletions docs/user/using-the-capture-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ In the Capture app you register events that occurred at a particular time and pl
the field. This will open a map where you can search for a location and capture
a polygon (button in the upper right corner of the map).

7. If desired you can add a comment by clicking the **Write comment** button at the bottom of the form. Note that Event comments are attributed to a user and cannot be deleted.
7. If desired, you can add a note by clicking the **Write note** button at the bottom of the form. Be aware that Event notes are attributed to a user and cannot be deleted.

8. If desired you can add a relationship by clicking the **Add relationship** button at the bottom of the form.
See the section about **Adding a relationship** for more information.
Expand Down Expand Up @@ -120,7 +120,7 @@ The second option, is to register a tracked entity instance with program and enr

3. Select a tracker program of your choice.

4. Click **Create new person**. Please note that the label of this button corresponds to the tracked entity type of the program, which could vary, such as "Building," "Person," etc.
4. Click **Create new person**. Note that the label of this button corresponds to the tracked entity type of the program, which could vary, such as "Building," "Person," etc.

![create new event](resources/images/register-and-enroll-program-selection.png)

Expand Down Expand Up @@ -233,7 +233,7 @@ When the "Scheduled days from start" does not contain a number or contains 0 the
### Possible duplicates detection

In both cases of registering a tracked entity instance, (with enrollment or without enrollment) the system will start looking for possible duplicates.
Note that, programs need to be correctly configured through the maintenance app for the system to start detecting duplicates when enrolling a new person in a program.
Note that programs need to be correctly configured through the maintenance app for the system to start detecting duplicates when enrolling a new person in a program.

To configure a program through the maintenance app you will have to:

Expand Down Expand Up @@ -280,8 +280,8 @@ Click **Save person**. The system will start looking for possible duplicates tha

### Program rules execution

In both cases of registering a tracked entity instance, (with enrollment or without enrollment) the system will run program rules you have configured.
Note that, rules can be configured in the maintenance app.
In both cases of registering a tracked entity instance (with enrollment or without enrollment), the system will run program rules you have configured.
Note that rules can be configured in the maintenance app.

To see a rule being executed while enrolling a tracked entity instance you will have to take the following steps.

Expand Down Expand Up @@ -1002,13 +1002,14 @@ You can complete the enrollment by clicking the complete button. When there are

![](resources/images/enrollment-dash-enrollment-widget-4.png)

### Enrollment comment widget
### Enrollment note widget

![](resources/images/enrollment-widget-comment.png)
The enrollment note widget displays notes and allows addition of notes, associated with the current enrollment.

The enrollment comment widget displays comments and allows addition of comments, associated with the current enrollment.
![](resources/images/enrollment-widget-note.png)

By clicking in the text field, you will be able to enter new text and see action buttons **Save note** and **Cancel**. Be aware that Enrollment notes are attributed to a user and cannot be deleted.

By clicking in the text field, you will be able to enter new text and see action buttons **Save comment** and **Cancel**. Note that Enrollment comments are attributed to a user and cannot be deleted.

### Relationship widget

Expand Down Expand Up @@ -1268,7 +1269,7 @@ If a program stage has a default next scheduled date configured, the suggested d

User can also find more information about how many events that scheduled on the same selected date or the interval of selected date and the suggested date from the information box.

Below the schedule date entry, user can choose to add a comment to the scheduled event.
Below the schedule date entry, user can choose to add a note to the scheduled event.

After clicking **Schedule** button, user will be navigated back to enrollment overview page.

Expand Down
Loading

0 comments on commit 56ea017

Please sign in to comment.