Skip to content

Route admins from notification "view more" into submission review mode#5996

Open
rtibblesbot wants to merge 1 commit into
learningequality:hotfixesfrom
rtibblesbot:issue-5994-8385cb
Open

Route admins from notification "view more" into submission review mode#5996
rtibblesbot wants to merge 1 commit into
learningequality:hotfixesfrom
rtibblesbot:issue-5994-8385cb

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Admins clicking "view more" on a Community Library submission notification landed on the read-only details panel because SubmissionDetailsModal gated the Review button and side panel on an adminReview prop hardcoded to false on the channelList route.

The fix: remove the adminReview prop entirely and gate the review UI directly on store.getters.isAdmin inside SubmissionDetailsModal/index.vue. One component change — no router changes, no notification handler changes.

What changed:

  • SubmissionDetailsModal/index.vue — removed adminReview prop; added const isAdmin = computed(() => store.getters.isAdmin); replaced v-if="adminReview" with v-if="isAdmin" on Review button, Actions dropdown, and ReviewSubmissionSidePanel; selects AdminCommunityLibrarySubmission vs CommunityLibrarySubmission based on isAdmin
  • SubmissionDetailsModal/__tests__/index.spec.js — new test file asserting that admin users see the Review button and side panel while non-admin users do not
  • administration/router.js — simplified route props from a function passing adminReview: true to props: true (the prop is now removed from the component)

Screenshots

Admin view — Review button visible on PENDING submission:

Admin view with Review button

Admin view — ReviewSubmissionSidePanel open after clicking Review:

Admin review side panel open

References

Closes #5994

Reviewer guidance

Manual verification:

  1. Log in as an admin user
  2. Navigate to any Community Library submission URL (/channels/#/community-library/:channelId/:submissionId)
  3. Expected: "REVIEW" button and "ACTIONS" dropdown visible; clicking "REVIEW" opens ReviewSubmissionSidePanel
  4. Repeat as a non-admin — expected: read-only panel, no Review or Actions buttons

AI usage

Used Claude Code to implement the change following reviewer guidance. Captured live screenshots by driving the running dev server with Playwright.


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks

status

@rtibblesbot rtibblesbot marked this pull request as ready for review June 25, 2026 21:47

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Screenshots: The dev server returned 500 for all pages during PR creation. Manual verification per the steps above is required.

Yes, it is required - I think the devserver should now run properly for you, so please retry!

@rtibblesbot

Copy link
Copy Markdown
Contributor Author

Admin arriving via notification "view more" (?openReview=true) — review side panel opens automatically:

Admin review with side panel open


Same route without ?openReview=true — REVIEW button present but panel not auto-opened:

Admin modal without auto-open

adminReview is driven by isAdmin. Non-admin users see the read-only view (no REVIEW button, no panel).

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry - this can be a much simpler fix. I have amended the issue which added the superfluous "open the review panel automatically" behaviour.

Instead, we can just remove the adminReview prop from the SubmissionDetailsModal/index.vue - remove the one place it is used currently. And instead just gate showing the review button on isAdmin from the core getters.

That means we can clean up almost all of these additions and trim it back to one very small targeted change in this one component (and removing the now superfluous prop from any of its call sites).

Please update and then update screenshots IN THE PR BODY, not as a comment.

@rtibblesbot

Copy link
Copy Markdown
Contributor Author

Done — simplified as requested. The PR now makes a single targeted change: removed the adminReview prop from SubmissionDetailsModal entirely and replaced all uses with computed(() => store.getters.isAdmin) inside the component. This means the component determines admin status itself from the store rather than relying on props passed from routers.

Rolled back:

  • channelList/router.js → reverted to props: true
  • administration/router.js → reverted to props: true
  • NotificationList.vue → reverted goToSubmissionDetails to plain URL redirect (no ?openReview=true)

Also removed the router and notification list tests (no longer relevant), and updated the SubmissionDetailsModal test to verify admin/non-admin resource selection via the store getter.

Please update screenshots in the PR body once you've done manual verification.

@rtibblesbot

Copy link
Copy Markdown
Contributor Author

Removed the adminReview prop from SubmissionDetailsModal/index.vue. The Review button, Actions dropdown, and ReviewSubmissionSidePanel now gate on computed(() => store.getters.isAdmin) directly. All the router, notification handler, and query-param additions are reverted.

Screenshots are in the PR body.

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I appreciate the enthusiasm - but the screenshots should not be committed.

Please remove from the commit history, and simplify this down to a single commit.

Gate SubmissionDetailsModal review actions on isAdmin from the Vuex
store rather than an adminReview prop, so admin users arriving via any
route automatically see the Review button and side panel.

Remove the adminReview prop and all call sites that set it; simplify
administration/router.js to props: true.
@rtibblesbot rtibblesbot force-pushed the issue-5994-8385cb branch 2 times, most recently from 9ec7e51 to ae076bc Compare June 26, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants