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

feat: [DHIS2-16262] Support Custom Layout for Enrollment Pages #3481

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion cypress/e2e/ScopeSelector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ And('you see the enrollment event Edit page but there is no org unit id in the u

And('you see the enrollment event New page but there is no org unit id in the url', () => {
cy.url().should('eq', `${Cypress.config().baseUrl}/#/enrollmentEventNew?enrollmentId=gPDueU02tn8&programId=IpHINAT79UW&stageId=A03MvHHogjR&teiId=fhFQhO0xILJ`);
cy.contains('Enrollment: New Event');
cy.contains('Choose a registering unit to start reporting');
});

And('you see the enrollment event New page but there is no stage id in the url', () => {
Expand Down
52 changes: 20 additions & 32 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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-01-25T12:12:47.253Z\n"
"PO-Revision-Date: 2024-01-25T12:12:47.253Z\n"
"POT-Creation-Date: 2024-01-26T09:31:09.168Z\n"
"PO-Revision-Date: 2024-01-26T09:31:09.168Z\n"

msgid "Choose one or more dates..."
msgstr "Choose one or more dates..."
Expand Down Expand Up @@ -668,15 +668,6 @@ msgstr "There is an error while opening this enrollment. Please enter a valid ur
msgid "An error occurred while fetching enrollments. Please enter a valid url."
msgstr "An error occurred while fetching enrollments. Please enter a valid url."

msgid "Enrollment Dashboard"
msgstr "Enrollment Dashboard"

msgid "No indicator output for this enrollment yet"
msgstr "No indicator output for this enrollment yet"

msgid "No feedback for this enrollment yet"
msgstr "No feedback for this enrollment yet"

msgid "Quick actions"
msgstr "Quick actions"

Expand Down Expand Up @@ -757,21 +748,12 @@ msgstr "Org unit is not valid with current program"
msgid "There was an error opening the Page"
msgstr "There was an error opening the Page"

msgid "Enrollment{{escape}} New Event"
msgstr "Enrollment{{escape}} New Event"

msgid "There was an error loading the page"
msgstr "There was an error loading the page"

msgid "Choose a registering unit to start reporting"
msgstr "Choose a registering unit to start reporting"

msgid "There are no feedbacks for this event"
msgstr "There are no feedbacks for this event"

msgid "There are no indicators for this event"
msgstr "There are no indicators for this event"

msgid "Program stage is invalid"
msgstr "Program stage is invalid"

Expand Down Expand Up @@ -799,18 +781,6 @@ msgstr "Program Stages could not be loaded"
msgid "Stage"
msgstr "Stage"

msgid "The enrollment event data could not be found"
msgstr "The enrollment event data could not be found"

msgid "There are no feedback for this event"
msgstr "There are no feedback for this event"

msgid "Enrollment{{escape}} View Event"
msgstr "Enrollment{{escape}} View Event"

msgid "Enrollment{{escape}} Edit Event"
msgstr "Enrollment{{escape}} Edit Event"

msgid "Registered events"
msgstr "Registered events"

Expand Down Expand Up @@ -938,6 +908,21 @@ msgstr "Event could not be loaded"
msgid "Organisation unit could not be loaded"
msgstr "Organisation unit could not be loaded"

msgid "Dashboard"
msgstr "Dashboard"

msgid "Edit Event"
msgstr "Edit Event"

msgid "View Event"
msgstr "View Event"

msgid "No feedback for this enrollment yet"
msgstr "No feedback for this enrollment yet"

msgid "No indicator output for this enrollment yet"
msgstr "No indicator output for this enrollment yet"

msgid "Selected program"
msgstr "Selected program"

Expand All @@ -950,6 +935,9 @@ msgstr "Search by attributes"
msgid "Could not retrieve metadata. Please try again later."
msgstr "Could not retrieve metadata. Please try again later."

msgid "The enrollment event data could not be found"
msgstr "The enrollment event data could not be found"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import { EnrollmentPageDefault } from './EnrollmentPageDefault';
import { TopBar } from './TopBar.container';

const getStyles = ({ typography }) => ({
container: {
padding: '16px 24px 16px 24px',
},
loadingMask: {
height: '100vh',
},
Expand Down Expand Up @@ -43,7 +40,7 @@ const EnrollmentPagePlain = ({
enrollmentId={enrollmentId}
/>

<div data-test="enrollment-page-content" className={classes.container}>
<div data-test="enrollment-page-content">
{enrollmentPageStatus === enrollmentPageStatuses.MISSING_SELECTIONS && <MissingMessage />}

{enrollmentPageStatus === enrollmentPageStatuses.DEFAULT && <EnrollmentPageDefault />}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// @flow
import {
QuickActions,
StagesAndEvents,
EnrollmentComment,
DefaultWidgetsForEnrollmentOverview,
WidgetTypes,
} from '../../../common/EnrollmentOverviewDomain/EnrollmentPageLayout';
import type {
PageLayoutConfig,
WidgetConfig,
} from '../../../common/EnrollmentOverviewDomain/EnrollmentPageLayout/DefaultEnrollmentLayout.types';

export const WidgetsForEnrollmentPageDefault: $ReadOnly<{ [key: string]: WidgetConfig }> = Object.freeze({
QuickActions,
StagesAndEvents,
EnrollmentComment,
...DefaultWidgetsForEnrollmentOverview,
});

export const DefaultPageLayout: PageLayoutConfig = Object.freeze({
leftColumn: [
{
type: WidgetTypes.COMPONENT,
name: 'QuickActions',
},
{
type: WidgetTypes.COMPONENT,
name: 'StagesAndEvents',
},
],
rightColumn: [
{
type: WidgetTypes.COMPONENT,
name: 'ErrorWidget',
},
{
type: WidgetTypes.COMPONENT,
name: 'WarningWidget',
},
{
type: WidgetTypes.COMPONENT,
name: 'EnrollmentComment',
},
{
type: WidgetTypes.COMPONENT,
name: 'FeedbackWidget',
},
{
type: WidgetTypes.COMPONENT,
name: 'IndicatorWidget',
},
{
type: WidgetTypes.COMPONENT,
name: 'TrackedEntityRelationship',
},
{
type: WidgetTypes.COMPONENT,
name: 'ProfileWidget',
settings: { readOnlyMode: false },
},
{
type: WidgetTypes.COMPONENT,
name: 'EnrollmentWidget',
settings: { readOnlyMode: false },
},
],
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// @flow
export { WidgetsForEnrollmentPageDefault, DefaultPageLayout } from './DefaultPageLayout.constants';

This file was deleted.

Loading
Loading