Skip to content

CLARIN-DSpace v9/Port #1301 (route-aware CLARIN license PATCH in workflow-item edit) to the v9 base - #1396

Merged
milanmajchrak merged 1 commit into
dtq-dev-9-basefrom
ufal/port-post-snapshot-fe4-9-base
Sep 8, 2026
Merged

milanmajchrak merged 1 commit into
dtq-dev-9-basefrom
ufal/port-post-snapshot-fe4-9-base

Conversation

@milanmajchrak

Copy link
Copy Markdown
Collaborator

Tranža FE-4 (Vlna 3) — post-snapshot sync dtq-dev → dtq-dev-9-base

Per CLARIN_V9_POST_SNAPSHOT_SYNC_PLAN.md §4 Vlna 3 / FE-4.

50a0e3081e (fork PR #1301) — lost CLARIN license in workflow-item edit — ADAPT

The CLARIN license submission section always resolved the item via WorkspaceitemDataService.findById and PATCHed the hardcoded /api/submission/workspaceitems/<id>, so a reviewer editing a workflow item couldn't load the accepted license or save a new one. Fix routes through SubmissionService.retrieveSubmission and PATCHes the submission object's own _links.self.href (/api/workflow/workflowitems/<id> for workflow items), with hasSucceeded/null guards.

v9 adaptations:

  • File is at submission/sections/clarin-license-**resource**/ on v9 (plan card said clarin-license/ — corrected).
  • Removed now-unused imports (WorkspaceItem, WorkspaceitemDataService, HALEndpointService, rxjs find); added SubmissionService + SubmissionObject in eslint-sorted positions. .toPromise() kept (diff-minimal).
  • Spec: v9-base had dropped this spec entirely; rewritten from the dtq-dev spec into v9 standalone TestBed (imports[] not declarations, standalone TestComponent).

Local gates (on 55ec542b2e) — ALL GREEN

🤖 Generated with Claude Code

…ssion PATCH (#1301)

ADAPT port of dtq-dev commit 50a0e30 onto dtq-dev-9-base.

Problem: the CLARIN license submission section always resolved the in-progress
item via WorkspaceitemDataService.findById and PATCHed the hardcoded
/api/submission/workspaceitems/<id> endpoint, so a reviewer editing a WORKFLOW
item could not load the accepted license nor save a new one.

Fix: replace WorkspaceitemDataService + HALEndpointService with the route-aware
SubmissionService.retrieveSubmission (getActualWorkspaceItem -> getActualSubmissionItem
returning SubmissionObject), send the sections/clarin-license/select PATCH to the
submission object's own _links.self.href (which is /api/workflow/workflowitems/<id>
for workflow items), and add hasSucceeded/null guards on both RemoteData resolutions.

v9 adaptations:
- File lives at submission/sections/clarin-license-resource/ on v9 (not clarin-license/).
- Removed now-unused imports (WorkspaceItem, WorkspaceitemDataService,
  HALEndpointService, rxjs find); added SubmissionService + SubmissionObject in
  eslint-sorted positions. .toPromise() kept (compiles on v9-base; diff-minimal).
- Spec: v9-base had dropped this spec entirely; rewritten from the dtq-dev spec into
  v9 standalone TestBed style (imports[] not declarations, standalone TestComponent).
  Karma: 2/2 green incl. the assertion that sendRequest PATCHes the submission
  self link (route-aware, works for workflow items).

Not pulled in: BE twin 8320889f2c (#1327) — separate BE-4 tranža. Happy path
(claimed task) already works on today's v9-base BE via OPERATION_PATH_SECTIONS ->
ClarinLicenseResourceStep; full 403/404 error-semantics parity is the BE-4 pass.

Fulfils CLARIN_V9_POST_SNAPSHOT_SYNC_ACCEPTANCE.md §5 / 50a0e30 (FE-4, Vlna 3).
@milanmajchrak
milanmajchrak merged commit bba71b4 into dtq-dev-9-base Sep 8, 2026
9 checks passed
milanmajchrak added a commit that referenced this pull request Sep 9, 2026
…nsole warnings (#1494)

ensureSelfLink() stripped embed params from the requested url only, so every
request that embeds a subresource compared a url the frontend had normalised
against a self link the API had not, and reported a mismatch it had created
itself. The API also percent decodes values it has no reason to escape - ':' and
'/' are legal in a query component - which looked like another difference.

Both sides are now brought to the same form before the comparison: embed params
stripped, values percent decoded (urlPartsDiffer, decodeUrlParts,
isUnexpectedSelfLink). A difference in an actual value still warns.

The second cause is the call sites that asked for 9999 / 10000 / 1000 elements to
mean "everything". Spring Data REST caps a page at spring.data.rest.max-page-size,
which DSpace leaves at its default of 1000, so those requests never returned more
than 1000 rows anyway - they only made the request claim something the API does
not honour and left the self link legitimately different from the requested url.
MAX_PAGE_SIZE is added next to FindListOptions and used wherever a caller needs
everything.

The condition that rewrites _links.self is untouched, so the url a response is
cached under stays exactly as it was; only whether we warn changes.

Adds the first spec this service has had: 17 cases covering both what is now
tolerated and what still has to warn.

v9 notes:
- The text is the 9.3-native original (customer/jcu ca40c3b), which is the same
  change already formatted for the v9 eslint import rules. registry.service.ts was
  resolved by hand to keep the CLARIN MetadataBitstreamDataService import.
- The six CLARIN-only call sites were hand-applied from d0897c2:
  clarin-zip-download-page, clarin-all-licenses-page, item-license-mapper,
  clarin-item-versions-field, clarin-item-box-view, section-license. The #1400
  (ROR) and #1396 (route-aware submission PATCH) hunks in the last two files are
  untouched.
- Two call sites exist only on v9 and therefore only in the jcu commit:
  filtered-items.component.ts (4 x 10000; the file does not exist on dtq-dev) and
  relationship-type-data.service.ts (dtq-dev still pages it with elementsPerPage 20).
- browse-by-geospatial-data.component.ts is deliberately left alone: its 99999 is a
  Discovery facet limit, not a Spring Data REST page size.

Card FE-06 (tranche T1).

Source: d0897c2 (dtq-dev PR #1415)
Adapted-from: ca40c3b (customer/jcu PR #1440)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
milanmajchrak added a commit that referenced this pull request Sep 9, 2026
…om sections.license (#1497)

TESTS-ONLY completion of the #1292 port. The runtime hunk (the CLARIN license
section PATCHes /sections/clarin-license/select instead of sections.license)
arrived with the v9 squash, and the karma spec that pins the PATCH path arrived
with #1396 (card FE-25) - section-license.component.spec.ts already asserts
body[0].path === '/sections/clarin-license/select'. Nothing to add there.

What was still missing is the e2e half. #1292 also hardened
cypress/e2e/submission-ui.cy.ts so that the CLARIN licence section's card
header is asserted to carry the green status icon (.fa-check-circle.text-success,
15 s timeout) when no file has been uploaded. That file does not exist on the v9
base - the fork's submission-ui.cy.ts was replaced by the vanilla
submission.cy.ts - so the step is adapted into submission.cy.ts instead.

v9 notes:
- The step is conditional on div[id="section_clarin-license"] existing (decision
  D-03). CI e2e runs against a vanilla backend image, which does not ship the
  clarin-license submission step, so an unconditional step would fail there. On a
  CLARIN backend the section is present and the assertions run.
- It is placed in the first test ("should create a new submission when using
  /submit path"), which uploads no file - the same precondition as the fork's
  "should not show validation warnings when no file is uploaded (metadata-only)"
  test the hunk came from.
- The fork's cy.wait(1000) settle and the 15 s retry timeout are kept verbatim.
- No cy./expect() step is removed or weakened (guard X6).

Card PB-08 (tranche T3).

Source: 0645e7e (dtq-dev PR #1292)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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