feat: [DHIS2-20842] Deactivate tracked entity#4525
Conversation
|
🚀 Deployed on https://deploy-preview-4525.capture.netlify.dhis2.org |
…hv/feat/DHIS2-20842_DeactivateTrackedEntity
| const readOnly = !hasProgramWrite || !hasTETWrite || inactiveReadOnly | ||
| ? { tooltipContent: i18n.t('You do not have access to edit this enrollment') } | ||
| : undefined; |
There was a problem hiding this comment.
🟡 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.
| 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; |
Was this helpful? React with 👍 or 👎 to provide feedback.
…hv/feat/DHIS2-20842_DeactivateTrackedEntity
…hv/feat/DHIS2-20842_DeactivateTrackedEntity
…into hv/feat/DHIS2-20842_DeactivateTrackedEntity
…ashboardReadOnly' into hv/feat/DHIS2-20842_DeactivateTrackedEntity
…hv/feat/DHIS2-20842_DeactivateTrackedEntity
…_DeactivateTrackedEntity
…ashboardReadOnly' into hv/feat/DHIS2-20842_DeactivateTrackedEntity
…mentEditEvent components
…hv/feat/DHIS2-20842_DeactivateTrackedEntity
…hv/feat/DHIS2-20842_DeactivateTrackedEntity
|



DHIS2-20842