Skip to content

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

Open
milanmajchrak wants to merge 1 commit into
dtq-dev-9-basefrom
ufal/port-post-snapshot-fe4-9-base
Open

CLARIN-DSpace v9/Port #1301 (route-aware CLARIN license PATCH in workflow-item edit) to the v9 base#1396
milanmajchrak wants to merge 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).
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