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-18019] related stages UI tweaks #3872

Merged
merged 11 commits into from
Nov 20, 2024
Original file line number Diff line number Diff line change
@@ -61,8 +61,7 @@ Given(/^you land on the enrollment event page with selected (.*) by having typed
When(/^the user clicks on the edit button/, () =>
cy
.get('[data-test="widget-enrollment-event"]')
.find('[data-test="dhis2-uicore-button"]')
.eq(1)
.find('[data-test="widget-enrollment-event-edit-button"]')
.click(),
);

@@ -208,7 +207,6 @@ 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)
.find('[data-test="widget-enrollment-event-edit-button"]')
.should('be.disabled');
});
Original file line number Diff line number Diff line change
@@ -21,10 +21,7 @@ When('the user clicks the first second antenatal care visit event', () => {
});

When(/^the user clicks the "Back to all stages and events" button/, () =>
cy
.get('[data-test="widget-enrollment-event"]')
.find('[data-test="dhis2-uicore-button"]')
.eq(0)
cy.get('[data-test="enrollment-edit-event-back-button"]')
.click(),
);

2 changes: 1 addition & 1 deletion cypress/e2e/TopBarActions/TopBarActions.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ Given(/^you land on a enrollment page domain by having typed (.*)$/, (url) => {
});

When(/^the user clicks on the edit button/, () =>
cy.get('[data-test="widget-enrollment-event"]').find('[data-test="dhis2-uicore-button"]').eq(1).click(),
cy.get('[data-test="widget-enrollment-event"]').find('[data-test="widget-enrollment-event-edit-button"]').click(),
);

When('the user clicks the arrow button to see the dropdown', () => {
Original file line number Diff line number Diff line change
@@ -12,8 +12,7 @@ When('you assign the user Geetha in the view mode', () => {
When('you assign the user Tracker demo User in the edit mode', () => {
cy
.get('[data-test="widget-enrollment-event"]')
.find('[data-test="dhis2-uicore-button"]')
.eq(1)
.find('[data-test="widget-enrollment-event-edit-button"]')
.click();

cy.get('[data-test="widget-assignee"]').within(() => {
Original file line number Diff line number Diff line change
@@ -5,7 +5,9 @@ Then('the enrollment widget should be loaded', () => {
});

When('you click edit mode', () => {
cy.contains('[data-test="dhis2-uicore-button"]', 'Edit event')
cy
.get('[data-test="widget-enrollment-event"]')
.find('[data-test="widget-enrollment-event-edit-button"]')
.click();
cy.contains('Enrollment: Edit Event').should('exist');
});
Original file line number Diff line number Diff line change
@@ -16,9 +16,7 @@ Then('you can assign a user when scheduling the event', () => {
});

When(/^the user clicks the "Back to all stages and events" button/, () =>
cy
.get('[data-test="widget-enrollment-event"]')
.contains('Back to all stages and events')
cy.get('[data-test="enrollment-edit-event-back-button"]')
.click(),
);

Original file line number Diff line number Diff line change
@@ -51,9 +51,7 @@ Then(/^the scope selector list contains the text (.*)$/, (name) => {
});

When(/^the user clicks the "Back to all stages and events" button/, () =>
cy
.get('[data-test="widget-enrollment-event"]')
.contains('Back to all stages and events')
cy.get('[data-test="enrollment-edit-event-back-button"]')
.click(),
);

24 changes: 17 additions & 7 deletions i18n/en.pot
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ 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-10-25T18:18:11.518Z\n"
"PO-Revision-Date: 2024-10-25T18:18:11.518Z\n"
"POT-Creation-Date: 2024-11-05T09:50:50.070Z\n"
"PO-Revision-Date: 2024-11-05T09:50:50.070Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
@@ -933,6 +933,9 @@ msgstr "Loading"
msgid "An error occurred while loading the form"
msgstr "An error occurred while loading the form"

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

msgid "Possible duplicates found"
msgstr "Possible duplicates found"

@@ -1291,9 +1294,6 @@ msgstr "Event completed"
msgid "The event cannot be edited after it has been completed"
msgstr "The event cannot be edited after it has been completed"

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

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

@@ -1493,11 +1493,21 @@ msgstr "{{ scheduledEvents }} scheduled"
msgid "Stages and Events"
msgstr "Stages and Events"

msgid "View linked event"
msgstr "View linked event"

msgid "An error occurred while loading the widget."
msgstr "An error occurred while loading the widget."

msgid "View linked event"
msgstr "View linked event"
msgid "Linked event"
msgstr "Linked event"

msgid ""
"This {{stageName}} event is linked to a {{linkedStageName}} event. Review "
"the linked event details before entering data below"
msgstr ""
"This {{stageName}} event is linked to a {{linkedStageName}} event. Review "
"the linked event details before entering data below"

msgid "Scheduled"
msgstr "Scheduled"
Original file line number Diff line number Diff line change
@@ -22,10 +22,6 @@ export const WidgetsForEnrollmentEventEdit: $ReadOnly<{ [key: string]: WidgetCon

export const DefaultPageLayout: PageLayoutConfig = {
leftColumn: [
{
type: WidgetTypes.COMPONENT,
name: 'TwoEventWorkspace',
},
simonadomnisoru marked this conversation as resolved.
Show resolved Hide resolved
{
type: WidgetTypes.COMPONENT,
name: 'EditEventWorkspace',
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ type DefaultComponents = 'QuickActions'
| 'AssigneeWidget'
| 'NewEventWorkspace'
| 'EditEventWorkspace'
| 'TwoEventWorkspace'
| 'EnrollmentNote'
| 'EventNote'
| 'TrackedEntityRelationship'
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow
import React from 'react';
import { IconArrowLeft24, Button } from '@dhis2/ui';
import i18n from '@dhis2/d2-i18n';
import { pageStatuses } from '../../EnrollmentEditEvent/EnrollmentEditEventPage.constants';
import { IncompleteSelectionsMessage } from '../../../IncompleteSelectionsMessage';
@@ -16,6 +17,7 @@ export const WidgetEventEditWrapper = ({ pageStatus, ...passOnProps }: WidgetPro
const {
programId,
stageId,
onGoBack,
} = passOnProps;

const {
@@ -56,12 +58,20 @@ export const WidgetEventEditWrapper = ({ pageStatus, ...passOnProps }: WidgetPro
}

return (
<WidgetEventEdit
{...passOnProps}
stage={stage}
formFoundation={formFoundation}
programId={programId}
stageId={stageId}
/>
<>
<div>
<Button secondary onClick={onGoBack} dataTest="enrollment-edit-event-back-button">
<IconArrowLeft24 />
{i18n.t('Back to all stages and events')}
</Button>
</div>
<WidgetEventEdit
{...passOnProps}
stage={stage}
formFoundation={formFoundation}
programId={programId}
stageId={stageId}
/>
</>
);
};
Loading
Loading