Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
7aa24f0
fix: disable enrollement actions button on ready only access
henrikmv Apr 17, 2026
68866e5
fix: prop change
henrikmv Apr 17, 2026
3e1b925
feat: add read only prop
henrikmv Apr 28, 2026
fa071a2
Merge branch 'hv/fix/DHIS2-21136_DisableEnrollmentActionsWhenReadOnly…
henrikmv Apr 28, 2026
3329b82
fix: remove unused prop
henrikmv Apr 28, 2026
5ce334e
fix: restore readOnly prop on MiniMap types
devin-ai-integration[bot] Apr 28, 2026
3855625
fix: mini map read only
devin-ai-integration[bot] Apr 28, 2026
8ae9420
fix: layout setting should not cause tooltip
devin-ai-integration[bot] Apr 29, 2026
c485887
feat: pass readOnly to Actions and use isReadOnly
devin-ai-integration[bot] Apr 29, 2026
2e3c3db
fix: propagate readOnly to EnrollmentWidget for Actions tooltip
devin-ai-integration[bot] Apr 29, 2026
4aa90ab
fix: sonar qube and ts error
henrikmv Apr 29, 2026
1e37c3f
feat: hide buttons instead of disabling with tooltip when read-only
devin-ai-integration[bot] Apr 30, 2026
f06e5eb
fix: clean up
devin-ai-integration[bot] Apr 30, 2026
eefed63
feat: empty state messages and style adjustments
henrikmv Apr 30, 2026
cd80fe4
feat: add read-only badge EnrollmentPageLayout
henrikmv Apr 30, 2026
ef447f9
fix: review
henrikmv May 1, 2026
7854f41
feat: propagate readOnly prop to LinkedEntityTable components
henrikmv May 1, 2026
7597048
feat: temp
henrikmv May 1, 2026
8f89902
feat: clean up
henrikmv May 1, 2026
3d4bc44
feat: update cypress tests to match read only behaviour
henrikmv May 3, 2026
d9377a7
Merge remote-tracking branch 'origin/master' into hv/chore/DHIS2-2137…
henrikmv May 4, 2026
671d0ee
feat: clean up linter errors after merge conflicts
henrikmv May 4, 2026
830c11c
fix: update readOnly prop logic in WidgetEnrollment component to use …
henrikmv May 4, 2026
0794e38
feat: type clean up
henrikmv May 4, 2026
d1b7783
feat: clean up
henrikmv May 4, 2026
46dced3
feat: improve props and styling
henrikmv May 4, 2026
39ebf6a
feat: temp
henrikmv May 5, 2026
71c541c
feat: updates access
henrikmv May 5, 2026
9e468b3
feat: update labels
henrikmv May 5, 2026
78bdfc2
feat: temp
henrikmv May 6, 2026
d9528f4
feat: read only tag with tooltip
henrikmv May 6, 2026
58663c8
fix: [DHIS2-21392] Form elements visble when no access to form (#4535)
henrikmv May 7, 2026
347c31f
feat: program stage access handeling
henrikmv May 7, 2026
ab2e2ae
fix: remove console log
henrikmv May 7, 2026
a0289b7
Revert "fix: [DHIS2-21392] Form elements visble when no access to for…
henrikmv May 7, 2026
404cc8a
Merge remote-tracking branch 'origin/master' into hv/chore/DHIS2-2137…
henrikmv May 7, 2026
0ca774e
feat: initial clean up
henrikmv May 7, 2026
c3e04ac
fet: remove hideReadOnlyBadge prop
henrikmv May 7, 2026
4dc0083
feat: simplify access handling in ReadOnlyBadge and related components
henrikmv May 8, 2026
5f1ef8c
feat: clean up
henrikmv May 8, 2026
7bdf4d6
feat: clean up settings
henrikmv May 8, 2026
f297d62
feat: clean up
henrikmv May 8, 2026
7e67dd8
feat: clean up
henrikmv May 8, 2026
3fe212c
fix: temp fix to clean up prop pasing
henrikmv May 8, 2026
0ce59c3
feat: stipp for widget specific fields
henrikmv May 8, 2026
be31619
feat: revert chanes
henrikmv May 8, 2026
5505b27
feat: remove useStageAccess and simplify access handling in Enrollmen…
henrikmv May 8, 2026
121759b
feat: enhance access handling in TrackedEntityRelationshipsWrapper an…
henrikmv May 8, 2026
baa6a0f
fix: read only prop required
henrikmv May 8, 2026
3f71333
fix: cypress test
henrikmv May 11, 2026
cb42811
fix: devin review
henrikmv May 11, 2026
4ac95d6
fix: devin review finished
henrikmv May 11, 2026
92a88de
fix: clean up
henrikmv May 11, 2026
f2573d6
Merge remote-tracking branch 'origin/master' into hv/chore/DHIS2-2137…
henrikmv May 13, 2026
744a709
feat: (review) keep widget note generic
henrikmv May 14, 2026
bcb1672
feat: (review) include message in translated string
henrikmv May 14, 2026
be65268
eat: (review) wrap EnrollmentAddEventPageDefault with EnrollmentAcces…
henrikmv May 14, 2026
144c239
feat: (review) create file for EnrollmentReadOnlyBadge
henrikmv May 15, 2026
05a7a08
feat: (review) split widget profile read only data entry from write a…
henrikmv May 15, 2026
c7fdc63
fix: (review) revert inline typing
henrikmv May 18, 2026
8838b73
feat: expired period and block data entry after completed read only b…
henrikmv May 18, 2026
0d56c2b
fix: increase font weight
henrikmv May 18, 2026
1af3a8b
feat: (review) update strings
henrikmv May 24, 2026
ac4a366
Merge branch 'master' into hv/chore/DHIS2-21371_EnrollmentDashboardRe…
henrikmv May 26, 2026
4a9ac01
Merge remote-tracking branch 'origin/master' into hv/chore/DHIS2-2137…
henrikmv May 28, 2026
e469463
chore: [DHIS2-21583] Restore self-contained user roles fetching in Wi…
henrikmv Jun 1, 2026
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 @@ -19,4 +19,4 @@ Feature: Program stage selector when navigating to EnrollmentEventNew without st
@user:trackerAutoTestRestricted
Scenario: Stages buttons should not be displayed when no data write access
Given user lands on the Enrollment dashboard page by typing #/enrollmentEventNew?enrollmentId=X7g83OFRALm&orgUnitId=DiszpKrYNg8&programId=WSGAb5XwJ3Y&teiId=YsKjdOcl9Cd
Then the New event quick action button is disabled
Then the quick actions widget is not visible
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Then('only three program stages are displayed in the stage selector widget', ()
cy.get('[data-test=program-stage-selector-button]').should('have.length', 3);
});

Then('the New event quick action button is disabled', () => {
cy.get('[data-test=quick-action-button-report]').should('be.disabled');
Then('the quick actions widget is not visible', () => {
cy.get('[data-test=quick-action-button-container]').should('not.exist');
});
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ Scenario: User can see disabled scheduled date for active event
Then the user see the schedule date field with tooltip: Scheduled date cannot be changed for Active events

@user:trackerAutoTestRestricted
Scenario: The user cannot enter edit mode for completed events
Scenario: The edit button is hidden for users with read-only access
Given you land on the enrollment event page with selected Person by having typed /#/enrollmentEventEdit?eventId=nUVwTLuQ6FT&orgUnitId=DiszpKrYNg8
And the view enrollment event form is in view mode
Then the edit button should be disabled
Then the edit button should not be visible

Scenario: User can edit the event and complete the enrollment
Given you land on the enrollment event page with selected Malaria Entity by having typed #/enrollmentEventEdit?eventId=MHR4Zj6KLz0&orgUnitId=DiszpKrYNg8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ And('you open the Birth stage event', () => {
});
});

Then('the edit button should be disabled', () => {
Then('the edit button should not be visible', () => {
cy.get('[data-test="widget-enrollment-event"]')
.find('[data-test="widget-enrollment-event-edit-button"]')
.should('be.disabled');
.should('not.exist');
});

And('the add event form is displayed', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Feature: User interacts with the quick actions-menu
Then you should be navigated to the schedule tab

@user:trackerAutoTestRestricted
Scenario: The create new quick actions button should be disabled if no available stages
Scenario: The quick actions widget is hidden for users with read-only access
Given you open the enrollment page by typing #enrollment?enrollmentId=WKPoiZxZxNG&orgUnitId=DiszpKrYNg8&programId=WSGAb5XwJ3Y&teiId=PgmUFEQYZdt
Then the quick action buttons should be disabled
Then the quick action buttons should not be visible

Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ Then('the buttons should be disabled', () => {
});
});

Then('the quick action buttons should be disabled', () => {
cy.get('[data-test="quick-action-button-container"]')
.find('button')
.should('be.disabled');
Then('the quick action buttons should not be visible', () => {
cy.get('[data-test="enrollment-overview-page"]').should('exist');
cy.get('[data-test="quick-action-button-container"]').should('not.exist');
});
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ Feature: User interacts with Stages and Events Widget
Then the Care at birth program stage should be hidden

@user:trackerAutoTestRestricted
Scenario: Create new event button is disabled if no data write access
Scenario: Create new event buttons are hidden for users with read-only access
Given you open the enrollment page by typing #enrollment?enrollmentId=WKPoiZxZxNG&orgUnitId=DiszpKrYNg8&programId=WSGAb5XwJ3Y&teiId=PgmUFEQYZdt
Then you should see the disabled button New Previous deliveries event
Then create new event button should not be visible
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ Then(/^you should see the disabled button (.*)$/, (stageName) => {
.should('be.disabled');
});

Then('create new event button should not be visible', () => {
cy.get('[data-test="stages-and-events-widget"]').should('exist');
cy.get('[data-test="create-new-button"]').should('not.exist');
});

Then('the Care at birth program stage should be hidden', () => {
cy.contains('[data-test="stages-and-events-widget"]', 'Postpartum care visit').should('exist');
cy.contains('[data-test="stages-and-events-widget"]', 'Care at birth').should('not.exist');
Expand Down
12 changes: 12 additions & 0 deletions cypress/e2e/WidgetsForEnrollmentPages/WidgetEnrollment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ Then('the enrollment widget should be opened', () => {
});
});

Then('the enrollment actions button is not visible', () => {
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-actions-button"]').should('not.exist');
});
});

Then('the enrollment date edit buttons are not visible', () => {
cy.get('[data-test="widget-enrollment"]').within(() => {
cy.get('[data-test="widget-enrollment-icon-edit-date"]').should('not.exist');
});
});

Then('the user sees the enrollment date', () => {
cy.get('[data-test="widget-enrollment-enrollment-date"]').within(() => {
cy.get('[data-test="widget-enrollment-icon-calendar"]').should('exist');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ Feature: The user interacts with the widgets on the enrollment add event page
And the user sees the owner organisation unit
And the user sees the last update date

Scenario: User can open the delete modal
Scenario: The enrollment widget is in read-only mode
Given you land on the enrollment add event page by having typed #/enrollmentEventNew?programId=IpHINAT79UW&orgUnitId=DiszpKrYNg8&teiId=EaOyKGOIGRp&enrollmentId=wBU0RAsYjKE&stageId=A03MvHHogjR
Then the enrollment widget should be opened
When the user opens the enrollment actions menu
And the user clicks on the delete action
Then the user sees the delete enrollment modal
And the enrollment actions button is not visible
And the enrollment date edit buttons are not visible

Scenario: User switch tab in add event page
Given you land on the enrollment add event page by having typed #/enrollmentEventNew?programId=IpHINAT79UW&orgUnitId=DiszpKrYNg8&teiId=EaOyKGOIGRp&enrollmentId=wBU0RAsYjKE&stageId=A03MvHHogjR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ Feature: The user interacts with the widgets on the enrollment edit event
And the user sees the owner organisation unit
And the user sees the last update date

Scenario: User can open the delete modal
Scenario: The enrollment widget is in read-only mode
Given you land on the enrollment edit event page by having typed /#/enrollmentEventEdit?eventId=XGLkLlOXgmE&orgUnitId=DiszpKrYNg8
Then the enrollment widget should be opened
When the user opens the enrollment actions menu
And the user clicks on the delete action
Then the user sees the delete enrollment modal
And the enrollment actions button is not visible
And the enrollment date edit buttons are not visible

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
Expand Down Expand Up @@ -72,13 +71,11 @@ Feature: The user interacts with the widgets on the enrollment edit event
When you remove the assigned user
Then the event has no assignd user

Scenario: User can complete the enrollment and the active events
Scenario: The enrollment widget is in read-only mode on enrollment event page
Given you land on the enrollment edit event page by having typed #/enrollmentEventEdit?eventId=PyXThVzWJzL&orgUnitId=RzgSFJ9E46G
And the enrollment widget should be opened
And the user sees the enrollment status and the Baby Postnatal event status is active
And the user opens the enrollment actions menu
When the user completes the enrollment and the active events
Then the user sees the enrollment status and the Baby Postnatal event status is completed
Then the enrollment actions button is not visible
And the enrollment date edit buttons are not visible

Scenario: User can see the enrollment minimap
Given you land on the enrollment edit event page by having typed #/enrollmentEventEdit?eventId=W1uHdJEjZUI&orgUnitId=DiszpKrYNg8
Expand Down
59 changes: 46 additions & 13 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: 2026-05-26T07:35:44.230Z\n"
"PO-Revision-Date: 2026-05-26T07:35:44.230Z\n"
"POT-Creation-Date: 2026-05-24T11:43:30.545Z\n"
"PO-Revision-Date: 2026-05-24T11:43:30.545Z\n"

msgid "The application could not be loaded."
msgstr "The application could not be loaded."
Expand Down Expand Up @@ -1071,6 +1071,36 @@ msgstr "Possible duplicates found"
msgid "An error occurred loading possible duplicates"
msgstr "An error occurred loading possible duplicates"

msgid "You only have view access to this enrollment"
msgstr "You only have view access to this enrollment"

msgid "You only have view access to this program"
msgstr "You only have view access to this program"

msgid "You only have view access to this {{trackedEntityName}}"
msgstr "You only have view access to this {{trackedEntityName}}"

msgid "You only have view access to this tracked entity type"
msgstr "You only have view access to this tracked entity type"

msgid "You only have view access to these program stages"
msgstr "You only have view access to these program stages"

msgid "You only have view access to this program stage"
msgstr "You only have view access to this program stage"

msgid "This event is outside the valid editing period"
msgstr "This event is outside the valid editing period"

msgid "This event has been completed"
msgstr "This event has been completed"

msgid "View only - {{message}}"
msgstr "View only - {{message}}"

msgid "View only"
msgstr "View only"

msgid "You don't have access to delete this relationship"
msgstr "You don't have access to delete this relationship"

Expand Down Expand Up @@ -1311,9 +1341,6 @@ msgstr "Unsaved changes"
msgid "Continue data entry"
msgstr "Continue data entry"

msgid "You do not have access to modify this enrollment"
msgstr "You do not have access to modify this enrollment"

msgid "Enrollment actions"
msgstr "Enrollment actions"

Expand Down Expand Up @@ -1512,9 +1539,6 @@ msgstr "No polygon captured"
msgid "Event completed"
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 "Notes about this event"
msgstr "Notes about this event"

Expand Down Expand Up @@ -1593,14 +1617,17 @@ msgstr "Save note"
msgid "Edit {{trackedEntityName}}"
msgstr "Edit {{trackedEntityName}}"

msgid "Save changes"
msgstr "Save changes"

msgid "Change information about this {{trackedEntityName}} here."
msgstr "Change information about this {{trackedEntityName}} here."

msgid "Information about this enrollment can be edited in the Enrollment widget."
msgstr "Information about this enrollment can be edited in the Enrollment widget."

msgid "Save changes"
msgstr "Save changes"
msgid "{{trackedEntityName}} profile"
msgstr "{{trackedEntityName}} profile"

msgid "Profile"
msgstr "Profile"
Expand Down Expand Up @@ -1641,6 +1668,9 @@ msgstr "There was a problem deleting the {{trackedEntityTypeName}}"
msgid "Yes, delete {{trackedEntityTypeName}}"
msgstr "Yes, delete {{trackedEntityTypeName}}"

msgid "View profile"
msgstr "View profile"

msgid "Profile widget could not be loaded. Please try again later"
msgstr "Profile widget could not be loaded. Please try again later"

Expand Down Expand Up @@ -1701,9 +1731,6 @@ msgstr "Please enter a date"
msgid "Please select a valid event"
msgstr "Please select a valid event"

msgid "You do not have access to create events in this stage"
msgstr "You do not have access to create events in this stage"

msgid "This stage can only have one event"
msgstr "This stage can only have one event"

Expand Down Expand Up @@ -1751,6 +1778,9 @@ msgstr "{{ overdueEvents }} overdue"
msgid "{{ scheduledEvents }} scheduled"
msgstr "{{ scheduledEvents }} scheduled"

msgid "No stages found in this program"
msgstr "No stages found in this program"

msgid "Stages and Events"
msgstr "Stages and Events"

Expand Down Expand Up @@ -1891,6 +1921,9 @@ msgstr "An error occurred while deleting the relationship."
msgid "To open this relationship, please wait until saving is complete"
msgstr "To open this relationship, please wait until saving is complete"

msgid "This enrollment doesn't have any relationships"
msgstr "This enrollment doesn't have any relationships"

msgid "Type"
msgstr "Type"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export type DataEntryOutputProps = {
onGetValidationContext?: () => any,
orgUnitId?: string,
pluginContext?: PluginContext,
viewMode?: boolean,
};

type OwnProps = DataEntryOutputProps & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useTimeZoneConversion } from '@dhis2/app-runtime';
import type { ApiEnrollmentEvent } from 'capture-core-utils/types/api-types';
import {
commitEnrollmentAndEvents,
EnrollmentAccessProvider,
rollbackEnrollmentAndEvents,
showEnrollmentError,
updateEnrollmentAndEvents,
Expand Down Expand Up @@ -191,42 +192,43 @@ export const EnrollmentPageDefault = () => {
}

return (
<EnrollmentPageLayout
pageLayout={pageLayout}
currentPage={EnrollmentPageKeys.OVERVIEW}
availableWidgets={WidgetsForEnrollmentPageDefault}

teiId={teiId}
orgUnitId={orgUnitId}
program={program}
stages={stages}
events={enrollment?.events}
enrollmentId={enrollmentId}
onAddNew={onAddNew}
onDelete={onDelete}
onDeleteTrackedEntitySuccess={onDeleteTrackedEntitySuccess}
onViewAll={onViewAll}
onBackToMainPage={onBackToMainPage}
onCreateNew={onCreateNew}
widgetEffects={outputEffects}
hideWidgets={hideWidgets}
onEventClick={onEventClick}
onDeleteEvent={onDeleteEvent}
onUpdateEventStatus={onUpdateEventStatus}
onRollbackDeleteEvent={onRollbackDeleteEvent}
onLinkedRecordClick={onLinkedRecordClick}
onUpdateTeiAttributeValues={onUpdateTeiAttributeValues}
onUpdateEnrollmentDate={onUpdateEnrollmentDate}
onUpdateIncidentDate={onUpdateIncidentDate}
onEnrollmentError={onEnrollmentError}
onUpdateEnrollmentStatus={onUpdateEnrollmentStatus}
onUpdateEnrollmentStatusSuccess={onUpdateEnrollmentStatusSuccess}
onUpdateEnrollmentStatusError={onUpdateEnrollmentStatusError}
ruleEffects={ruleEffects}
widgetEnrollmentStatus={widgetEnrollmentStatus}
onAccessLostFromTransfer={onAccessLostFromTransfer}
feedbackEmptyText={i18n.t('No feedback for this enrollment yet')}
indicatorEmptyText={i18n.t('No indicator output for this enrollment yet')}
/>
<EnrollmentAccessProvider program={program}>
<EnrollmentPageLayout
pageLayout={pageLayout}
currentPage={EnrollmentPageKeys.OVERVIEW}
availableWidgets={WidgetsForEnrollmentPageDefault}
teiId={teiId}
orgUnitId={orgUnitId}
program={program}
stages={stages}
events={enrollment?.events}
enrollmentId={enrollmentId}
onAddNew={onAddNew}
onDelete={onDelete}
onDeleteTrackedEntitySuccess={onDeleteTrackedEntitySuccess}
onViewAll={onViewAll}
onBackToMainPage={onBackToMainPage}
onCreateNew={onCreateNew}
widgetEffects={outputEffects}
hideWidgets={hideWidgets}
onEventClick={onEventClick}
onDeleteEvent={onDeleteEvent}
onUpdateEventStatus={onUpdateEventStatus}
onRollbackDeleteEvent={onRollbackDeleteEvent}
onLinkedRecordClick={onLinkedRecordClick}
onUpdateTeiAttributeValues={onUpdateTeiAttributeValues}
onUpdateEnrollmentDate={onUpdateEnrollmentDate}
onUpdateIncidentDate={onUpdateIncidentDate}
onEnrollmentError={onEnrollmentError}
onUpdateEnrollmentStatus={onUpdateEnrollmentStatus}
onUpdateEnrollmentStatusSuccess={onUpdateEnrollmentStatusSuccess}
onUpdateEnrollmentStatusError={onUpdateEnrollmentStatusError}
ruleEffects={ruleEffects}
widgetEnrollmentStatus={widgetEnrollmentStatus}
onAccessLostFromTransfer={onAccessLostFromTransfer}
feedbackEmptyText={i18n.t('No feedback for this enrollment yet')}
indicatorEmptyText={i18n.t('No indicator output for this enrollment yet')}
/>
</EnrollmentAccessProvider>
);
};
Loading
Loading