Skip to content

feat: [DHIS2-21655] Uncomplete events from view mode - #4649

Open
henrikmv wants to merge 49 commits into
masterfrom
hv/feat/DHIS2-21655_uncomplete-event-view-mode
Open

feat: [DHIS2-21655] Uncomplete events from view mode#4649
henrikmv wants to merge 49 commits into
masterfrom
hv/feat/DHIS2-21655_uncomplete-event-view-mode

Conversation

@henrikmv

@henrikmv henrikmv commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

DHIS2-21655

Completion behavior — event toggle

Baseline: user has canEditProgramStage. Without it, the completion action is not shown.

Event status Toggle button Requirement
ACTIVE Complete not expired ¹
COMPLETED (blockEntryForm=false) Uncomplete F_UNCOMPLETE_EVENT AND (not expired ¹ OR F_EDIT_EXPIRED)
COMPLETED (blockEntryForm=true) Uncomplete (form read-only until then) F_UNCOMPLETE_EVENT AND (not expired ¹ OR F_EDIT_EXPIRED)
SCHEDULE / OVERDUE / SKIPPED Completion toggle not shown

¹ Expiry rules

"Not expired" = the event's occurredAt is inside the program's editing window (and, for completed events, the complete-events-expiry window). F_EDIT_EXPIRED bypasses expiry. It does not bypass F_UNCOMPLETE_EVENT — the two authorities are additive.

Behavior when blockEntryForm=true and event is COMPLETED

The form is read-only ("This event has been completed"). To edit values, the user must Uncomplete first (requires F_UNCOMPLETE_EVENT), edit, then re-Complete.

Hook flag

canToggleCompletion returned from useEventEditPermissions — replaces the previous canUncompleteEvent and generalizes it to cover both Complete (ACTIVE→COMPLETED) and Uncomplete (COMPLETED→ACTIVE) transitions.

@henrikmv henrikmv changed the title feat: [DHIS2-21655] Allow uncompleting expired completed events from view mode feat: [DHIS2-21655] Uncomplete events from view mode Jul 22, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

@henrikmv
henrikmv marked this pull request as ready for review July 22, 2026 11:46
@henrikmv
henrikmv requested a review from a team as a code owner July 22, 2026 11:46

@simonadomnisoru simonadomnisoru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@github-actions

Copy link
Copy Markdown

@henrikmv henrikmv added testing and removed testing labels Aug 5, 2026

@simonadomnisoru simonadomnisoru left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! 🥳

@henrikmv
henrikmv marked this pull request as draft August 13, 2026 13:43

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 new potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

@sonarqubecloud

Copy link
Copy Markdown

@henrikmv
henrikmv marked this pull request as ready for review August 28, 2026 11:30
@henrikmv henrikmv added testing and removed testing labels Aug 28, 2026
@henrikmv henrikmv added testing and removed testing labels Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants