Skip to content

fix: [DHIS2-21392] Form elements visble when no access to form#4535

Merged
henrikmv merged 11 commits into
hv/chore/DHIS2-21371_EnrollmentDashboardReadOnlyfrom
hv/fix/DHIS2-21392_form-elements-renders-when-no-access-to-form
May 7, 2026
Merged

fix: [DHIS2-21392] Form elements visble when no access to form#4535
henrikmv merged 11 commits into
hv/chore/DHIS2-21371_EnrollmentDashboardReadOnlyfrom
hv/fix/DHIS2-21392_form-elements-renders-when-no-access-to-form

Conversation

@henrikmv
Copy link
Copy Markdown
Contributor

@henrikmv henrikmv commented Apr 30, 2026

DHIS2-21392

Stop rendering the form elements when the user lacks write access. Also, by showing NoWriteAccessMessage at the page level instead, we can remove many files and clean up our codebase.

Behavior

  • New TEI page, no write access: message now shows a "Back" button that returns to the main page.
  • Single event registration, no write access: SelectionsNoAccess wrapper removed; renders NoWriteAccessMessage with a "Back" button.
  • Add Event (Tracker), no write access: NewEventWorkspace performs the access check and shows NoWriteAccessMessage for both the Report and Schedule tabs. Replaces the old per-widget no-access screens (disabled Save + Cancel).
  • Edit event (Tracker): Not reachable after implementing read-only behaviour for dashboard.

Cleanup

  • NoWriteAccessMessage component: title prop removed; optional onBack prop adds a "Back" button.
  • Deleted WidgetEnrollmentEventNew/AccessVerification/: in-widget access check no longer reachable (WidgetEnrollmentEventNew is only used by NewEventWorkspace, which now gates upstream). The withBrowserBackWarning HOC the wrapper applied is preserved in a small OrgUnitFetcher.container.tsx.
  • Deleted WidgetEventSchedule/AccessVerification/: safe because the schedule view has no URL of its own: it's only reachable as a tab inside NewEventWorkspace (gated upstream) or via the "Edit event" button (gated by the parent branch's NoWriteAccessMessage).

@henrikmv henrikmv changed the title fix: [DHIS2-21392] Form elements visble when now access to form fix: [DHIS2-21392] Form elements visble when no access to form Apr 30, 2026
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 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

@henrikmv henrikmv changed the base branch from master to hv/chore/DHIS2-21371_EnrollmentDashboardReadOnly April 30, 2026 16:15
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

@henrikmv henrikmv added testing and removed testing labels May 1, 2026
@henrikmv henrikmv added testing and removed testing labels May 4, 2026
@henrikmv henrikmv marked this pull request as ready for review May 4, 2026 07:33
@henrikmv henrikmv requested a review from a team as a code owner May 4, 2026 07:33
henrikmv and others added 2 commits May 4, 2026 14:48
@henrikmv henrikmv added testing and removed testing labels May 4, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 4, 2026

Copy link
Copy Markdown

@geethaalwan geethaalwan left a comment

Choose a reason for hiding this comment

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

Tested successfully on 2.44,2.43.1,2.42.5,2.41.9 versions

@henrikmv henrikmv merged commit 58663c8 into hv/chore/DHIS2-21371_EnrollmentDashboardReadOnly May 7, 2026
42 of 44 checks passed
@henrikmv henrikmv deleted the hv/fix/DHIS2-21392_form-elements-renders-when-no-access-to-form branch May 7, 2026 13:47
@henrikmv henrikmv restored the hv/fix/DHIS2-21392_form-elements-renders-when-no-access-to-form branch May 7, 2026 16:57
henrikmv added a commit that referenced this pull request May 7, 2026
@henrikmv henrikmv deleted the hv/fix/DHIS2-21392_form-elements-renders-when-no-access-to-form branch May 7, 2026 17:09
@henrikmv
Copy link
Copy Markdown
Contributor Author

henrikmv commented May 7, 2026

This PR was merged into a PR in progress instead of master. Therefore, the changes were reverted and will be implemented in PR #4549 instead.

Thanks!

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.

3 participants