Skip to content

feat: [DHIS2-20842] Deactivate tracked entity#4525

Draft
henrikmv wants to merge 26 commits into
hv/chore/DHIS2-21371_EnrollmentDashboardReadOnlyfrom
hv/feat/DHIS2-20842_DeactivateTrackedEntity
Draft

feat: [DHIS2-20842] Deactivate tracked entity#4525
henrikmv wants to merge 26 commits into
hv/chore/DHIS2-21371_EnrollmentDashboardReadOnlyfrom
hv/feat/DHIS2-20842_DeactivateTrackedEntity

Conversation

@henrikmv
Copy link
Copy Markdown
Contributor

@henrikmv henrikmv commented Apr 23, 2026

devin-ai-integration[bot]

This comment was marked as resolved.

@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Devin Review found 4 new potential issues.

View 6 additional findings in Devin Review.

Open in Devin Review

@henrikmv henrikmv changed the base branch from master to hv/chore/DHIS2-21371_EnrollmentDashboardReadOnly April 28, 2026 18:11
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Comment on lines 303 to 305
const readOnly = !hasProgramWrite || !hasTETWrite || inactiveReadOnly
? { tooltipContent: i18n.t('You do not have access to edit this enrollment') }
: undefined;
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.

🟡 EnrollmentEditEventPage shows wrong readOnly tooltip when tracked entity is deactivated

When a tracked entity is deactivated, inactiveReadOnly is { tooltipContent: 'Tracked entity is deactivated' } (truthy). The condition !hasProgramWrite || !hasTETWrite || inactiveReadOnly evaluates to true, but the code always assigns the generic tooltip 'You do not have access to edit this enrollment', discarding the specific deactivation message.

Compare with EnrollmentPageDefault.container.tsx:187-190 which handles this correctly by separating the two cases:

const accessReadOnly = !hasProgramWrite || !hasTETWrite ? { tooltipContent: ... } : undefined;
const readOnly = inactiveReadOnly ?? accessReadOnly;

The edit event page should use the same pattern so users see "Tracked entity is deactivated" instead of the misleading access-denied message.

Suggested change
const readOnly = !hasProgramWrite || !hasTETWrite || inactiveReadOnly
? { tooltipContent: i18n.t('You do not have access to edit this enrollment') }
: undefined;
const accessReadOnly = !hasProgramWrite || !hasTETWrite
? { tooltipContent: i18n.t('You do not have access to edit this enrollment') }
: undefined;
const readOnly = inactiveReadOnly ?? accessReadOnly;
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Devin Review found 2 new potential issues.

View 9 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 12 additional findings in Devin Review.

Open in Devin Review

@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant