Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [DHIS2-15633] Change comment to note #3549

Merged
merged 25 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9c36d63
fix: changed on all strings with translator
henrikmv Mar 1, 2024
5b0fe1e
fix: remove debugger
henrikmv Mar 1, 2024
663cc47
fix: merge conflict
henrikmv Mar 1, 2024
1be9c50
fix: add translator
henrikmv Mar 1, 2024
cc44889
fix: minor
JoakimSM Mar 19, 2024
18577b8
fix: cypress tests data-test prop
JoakimSM Mar 19, 2024
10a56ab
fix: merge conflict
henrikmv Apr 12, 2024
951c136
Merge remote-tracking branch 'origin/master' into hv/fix/DHIS2-15633_…
henrikmv Apr 19, 2024
7576482
Merge branch 'master' into hv/fix/DHIS2-15633_ChangeCommentToNote
henrikmv May 24, 2024
94cecf8
fix: update en.pot
henrikmv May 25, 2024
bde62b8
fix: remove dublicate from en.pot
henrikmv May 25, 2024
a849a7b
docs: [DHIS2-15633] change comment to note docs (#3649)
henrikmv May 27, 2024
0dadb76
Merge branch 'master' into hv/fix/DHIS2-15633_ChangeCommentToNote
henrikmv Jun 3, 2024
f2763e3
Merge remote-tracking branch 'origin/master' into hv/fix/DHIS2-15633_…
henrikmv Jun 19, 2024
f12ba6b
fix: merge conflict
henrikmv Jun 24, 2024
1cc09a5
fix: keep comment-item as data test prop
henrikmv Jun 26, 2024
02689f0
Merge remote-tracking branch 'origin/master' into hv/fix/DHIS2-15633_…
henrikmv Jun 28, 2024
bb0f503
fix: change from comment to note in code
henrikmv Jun 28, 2024
2408865
fix: typo
henrikmv Jul 1, 2024
c6c4a2f
Merge branch 'master' into hv/fix/DHIS2-15633_ChangeCommentToNote
henrikmv Jul 1, 2024
a3cd5ea
Merge remote-tracking branch 'origin/master' into hv/fix/DHIS2-15633_…
henrikmv Jul 3, 2024
0b62005
Merge remote-tracking branch 'origin/master' into hv/fix/DHIS2-15633_…
henrikmv Jul 5, 2024
69a76b1
Merge remote-tracking branch 'origin/master' into hv/fix/DHIS2-15633_…
henrikmv Jul 10, 2024
e124693
fix: dublicated newNoteButtonContainer class
henrikmv Jul 10, 2024
cfb1e55
fix: lint error
henrikmv Jul 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,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 @@ -62,12 +62,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/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,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 @@ -292,10 +292,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
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ Then('the stages and events should be loaded', () => {
cy.contains('Stages and Events').should('exist');
});

When(/^you fill in the comment: (.*)$/, (comment) => {
cy.get('[data-test="enrollment-comment-widget"]').within(() => {
cy.get('[data-test="comment-textfield"]').type(comment);
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-comment-btn"]').should('exist');
cy.get('[data-test="add-comment-btn"]').click();
cy.get('[data-test="add-note-btn"]').should('exist');
cy.get('[data-test="add-note-btn"]').click();
});
});

Then(/^list should contain the new comment: (.*)$/, (comment) => {
cy.get('[data-test="enrollment-comment-widget"]').within(() => {
cy.get('[data-test="comment-item"]').contains(comment).should('exist');
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');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ When('you click edit mode', () => {
cy.contains('Enrollment: Edit Event').should('exist');
});

When(/^you fill in the comment: (.*)$/, (comment) => {
cy.get('[data-test="event-comment-widget"]').within(() => {
cy.get('[data-test="comment-textfield"]').type(comment);
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-comment-btn"]').should('exist');
cy.get('[data-test="add-comment-btn"]').click();
cy.get('[data-test="add-note-btn"]').should('exist');
cy.get('[data-test="add-note-btn"]').click();
});
});

Then(/^list should contain the new comment: (.*)$/, (comment) => {
cy.get('[data-test="event-comment-widget"]').within(() => {
cy.get('[data-test="comment-item"]').contains(comment).should('exist');
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 @@ -165,8 +165,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 @@ -102,14 +102,14 @@ 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

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
62 changes: 33 additions & 29 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"

"POT-Creation-Date: 2024-04-05T13:37:32.910Z\n"
"PO-Revision-Date: 2024-04-05T13:37:32.910Z\n"

Expand Down Expand Up @@ -188,15 +189,15 @@ msgstr "Assigned user"
msgid "Search for user"
msgstr "Search for user"

msgid "Notes"
msgstr "Notes"

msgid "Basic info"
msgstr "Basic info"

msgid "Status"
msgstr "Status"

msgid "Comments"
msgstr "Comments"

msgid "Relationships"
msgstr "Relationships"

Expand Down Expand Up @@ -229,8 +230,8 @@ msgstr "Active"
msgid "Completed"
msgstr "Completed"

msgid "Please add or cancel comment before saving the event"
msgstr "Please add or cancel comment before saving the event"
msgid "Please add or cancel note before saving the event"
msgstr "Please add or cancel note before saving the event"

msgid "Save and add another"
msgstr "Save and add another"
Expand Down Expand Up @@ -619,14 +620,14 @@ msgstr "Offline"
msgid "Syncing"
msgstr "Syncing"

msgid "Add comment"
msgstr "Add comment"
msgid "Add note"
msgstr "Add note"

msgid "You don't have access to write comments"
msgstr "You don't have access to write comments"
msgid "You don't have access to write notes"
msgstr "You don't have access to write notes"

msgid "Write comment"
msgstr "Write comment"
msgid "Write note"
msgstr "Write note"

msgid "was blanked out and hidden by your last action"
msgstr "was blanked out and hidden by your last action"
Expand Down Expand Up @@ -1161,8 +1162,8 @@ msgstr ""
"You must provide a reason to check for enrollments in this protected "
"program. All activity will be logged."

msgid "Save comment"
msgstr "Save comment"
msgid "Save note"
msgstr "Save note"

msgid "Enrollment actions"
msgstr "Enrollment actions"
Expand Down Expand Up @@ -1291,14 +1292,17 @@ msgstr "Add coordinates"
msgid "Add area"
msgstr "Add area"

msgid "Comments about this enrollment"
msgstr "Comments about this enrollment"
msgid "Notes about this enrollment"
msgstr "Notes about this enrollment"

msgid "Write a note about this enrollment"
msgstr "Write a note about this enrollment"

msgid "Write a comment about this enrollment"
msgstr "Write a comment about this enrollment"
msgid "This enrollment doesn't have any notes"
msgstr "This enrollment doesn't have any notes"

msgid "This enrollment doesn't have any comments"
msgstr "This enrollment doesn't have any comments"
msgid "Please add or cancel the note before saving the event"
msgstr "Please add or cancel the note before saving the event"

msgid "organisation unit could not be retrieved. Please try again later."
msgstr "organisation unit could not be retrieved. Please try again later."
Expand All @@ -1315,14 +1319,14 @@ msgstr "Error"
msgid "Warning"
msgstr "Warning"

msgid "Comments about this event"
msgstr "Comments about this event"
msgid "Notes about this event"
msgstr "Notes about this event"

msgid "Write a comment about this event"
msgstr "Write a comment about this event"
msgid "Write a note about this event"
msgstr "Write a note about this event"

msgid "This event doesn't have any comments"
msgstr "This event doesn't have any comments"
msgid "This event doesn't have any notes"
msgstr "This event doesn't have any notes"

msgid "stage not found in rules execution"
msgstr "stage not found in rules execution"
Expand Down Expand Up @@ -1379,11 +1383,11 @@ msgstr "Schedule info"
msgid "Schedule date / Due date"
msgstr "Schedule date / Due date"

msgid "Event comments"
msgstr "Event comments"
msgid "Event notes"
msgstr "Event notes"

msgid "Write a comment about this scheduled event"
msgstr "Write a comment about this scheduled event"
msgid "Write a note about this scheduled event"
msgstr "Write a note about this scheduled event"

msgid ""
"Change information about this {{trackedEntityName}} here. To change "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ const buildGeometrySettingsFn = () => ({

return createComponentProps(props, {
width: props && props.formHorizontal ? 150 : 350,
label: 'Coordinate',
dialogLabel: 'Coordinate',
label: i18n.t('Coordinate'),
dialogLabel: i18n.t('Coordinate'),
required: false,
orientation: getOrientation(props.formHorizontal),
shrinkDisabled: props.formHorizontal,
Expand Down Expand Up @@ -311,7 +311,7 @@ const buildNotesSettingsFn = () => {
const notesSettings = {
getComponent: () => noteComponent,
getComponentProps: (props: Object) => createComponentProps(props, {
label: 'Comments',
label: i18n.t('Notes'),
onAddNote: props.onAddNote,
id: 'comments',
dataEntryId: props.id,
Expand Down Expand Up @@ -467,7 +467,7 @@ const dataEntrySectionDefinitions = {
},
[dataEntrySectionNames.COMMENTS]: {
placement: placements.BOTTOM,
name: i18n.t('Comments'),
name: i18n.t('Notes'),
},
[dataEntrySectionNames.RELATIONSHIPS]: {
placement: placements.BOTTOM,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const getNoteValidatorContainers = () => {
const validatorContainers = [
{
validator: validateNote,
message: i18n.t('Please add or cancel comment before saving the event'),
message: i18n.t('Please add or cancel note before saving the event'),
},
];
return validatorContainers;
Expand Down
22 changes: 11 additions & 11 deletions src/core_modules/capture-core/components/Notes/Notes.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ class NotesPlain extends React.Component<Props, State> {
onChange={this.handleChange}
value={this.state.value}
multiLine
data-test="comment-textfield"
data-test="note-textfield"
/>
</Editor>
<div className={classes.newCommentButtonContainer} data-test="comment-buttons-container">
<div className={classes.newCommentButtonContainer} data-test="note-buttons-container">
<Button
onClick={this.handleAddNote}
className={classes.addCommentContainer}
primary
small
>
{i18n.t('Add comment')}
{i18n.t('Add note')}
</Button>
<Button
onClick={this.onCancel}
Expand All @@ -180,18 +180,18 @@ class NotesPlain extends React.Component<Props, State> {
return (
<div
className={classes.newNoteButtonContainer}
data-test="new-comment-button"
data-test="new-note-button"
>
<ConditionalTooltip
content={i18n.t('You don\'t have access to write comments')}
content={i18n.t('You don\'t have access to write notes')}
enabled={!canAddComment}
>
<Button
onClick={this.toggleIsOpen}
disabled={!canAddComment}
small={smallMainButton}
>
{i18n.t('Write comment')}
{i18n.t('Write note')}
</Button>
</ConditionalTooltip>
</div>
Expand All @@ -207,25 +207,25 @@ class NotesPlain extends React.Component<Props, State> {
<MenuItem
className={classes.noteItem}
key={n.clientId}
data-test="comment"
data-test="note"
label={<>
<div className={classes.noteItemHeader}>
<div className={classes.noteItemUser} data-test="comment-user">
<div className={classes.noteItemUser} data-test="note-user">
{n.createdBy ? `${n.createdBy.firstName} ${n.createdBy.surname}` : `${n.storedBy}` }
</div>
<div className={classes.noteItemDate} data-test="comment-date">
<div className={classes.noteItemDate} data-test="note-date">
{n.storedDate}
</div>
</div>
<div data-test="comment-text">
<div data-test="note-text">
<Parser>{n.value}</Parser>
</div>
</>}
/>
))}
</Menu>
{
<div className={classes.newNoteContainer} data-test="new-comment-container">
<div className={classes.newNoteContainer} data-test="new-note-container">
{ this.state.addIsOpen ? this.renderInput() : this.renderButton(entityAccess.write) }
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const loadingIndicatorStyle = {
width: 36,
};

const headerText = i18n.t('Comments');
const headerText = i18n.t('Notes');

const getStyles = (theme: Theme) => ({
badge: {
Expand Down
Loading
Loading