Skip to content

[dtq-dev-93] Handle table paging after search, Curate button only for admins, workflow edit stuck on Loading - #1760

Open
milanmajchrak wants to merge 3 commits into
dtq-dev-93from
93/fe-admin-fixes
Open

milanmajchrak wants to merge 3 commits into
dtq-dev-93from
93/fe-admin-fixes

Conversation

@milanmajchrak

@milanmajchrak milanmajchrak commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

References

  • No dtq-dev source to port. The handle table and the Curate button are fork code and have the same bugs on dtq-dev.
  • The "Loading..." hang is the open upstream DSpace/dspace-angular issue "Infinite loading spinner on opening a workflow item". Upstream has no fix. This PR uses the workaround posted in that issue.

Description

Three small fixes in admin and workflow pages. The handle table shows the right page range after a search, the Curate button shows only to users who may open the curation page, and Edit from MyDSpace no longer hangs on "Loading...".

Instructions for Reviewers

List of changes in this PR:

  • Handle table: a search sets the hdl page in the URL to 1. Before, the results were page 1 but the URL stayed on page 2, so the paginator said "Now showing 11 - 1 out of 1 results". The URL is replaced, not pushed, because the search filter is not in the URL and Back could not restore it.
  • Handle table: only the latest load writes the rows. A new load unsubscribes the previous one, so a slow older response cannot overwrite newer search results.
  • Claimed task actions: the Curate button shows only to site administrators. It links to /admin/curation-tasks, and the admin routes let only site administrators in, so a reviewer got a 403 page.
  • workflowItemPageResolver and workspaceItemPageResolver no longer resolve from a cached copy. A workflow item expires from the cache after 10 s. After that, the resolver sent a new GET and resolved at once on the old copy, so the edit form started while that GET was running. The form then did not send its own request (same URL without embeds), got the resolver's response without the embedded collection, and failed on payload.collection.id. Now the route waits for a fresh response.
  • The resolvers sit on the parent :id route, so the View, Delete and Send back pages also do one extra GET.

How to test:

  1. Handle table: log in as admin, open the handle table, go to page 2, search for one handle. The text says "Now showing 1 - 1 out of 1 results". Back does not return to page 2 with the filtered rows.
  2. Curate: claim a workflow task as a reviewer who is not an admin. The task has no Curate button. As an admin, the button is there and opens the curation page with the handle filled in.
  3. Loading: claim a task, reload /mydspace?configuration=workflow, wait 15 s, click Edit. The edit form opens. Before this PR it stayed on "Loading..." with TypeError ... reading 'id' in the console.
  • npm run test -- --include=src/app/handle-page/handle-table/handle-table.component.spec.ts --include=src/app/shared/mydspace-actions/claimed-task/claimed-task-actions.component.spec.ts --include=src/app/workflowitems-edit-page/workflow-item-page.resolver.spec.ts --include=src/app/workspaceitems-edit-page/workspace-item-page.resolver.spec.ts

Codex review (gpt-6.2-sol, high), 3 rounds: 4 findings fixed (older handle loads overwrote newer results, the search pushed a history entry, an edit-only resolver raced with the parent one). The last round found 2 more, not changed in this PR:

  • Clearing a handle search from page 2 can still show the rows of page 2 under a page-1 paginator.
  • The resolver can still take a response that another request cached while its own GET was pending. The real fix belongs in the shared request cache.

Checklist

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

🤖 Generated with Claude Code

milanmajchrak and others added 3 commits November 26, 2026 14:38
A search loads page 1, but the URL kept the old page, so the paginator showed
a wrong range. The URL is replaced and only the latest load writes the rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The button opens the admin curation page, which only site administrators
may open, so other reviewers got a 403 page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
With a cached copy the edit form could start while the resolver's GET was
still running. The form then read that response, which has no embedded
collection, and stayed on "Loading".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant