Skip to content

141 lost license in workflow edit#144

Open
amadulhaxxani wants to merge 3 commits into
clarin-v7from
141-lost-license-in-workflow-edit
Open

141 lost license in workflow edit#144
amadulhaxxani wants to merge 3 commits into
clarin-v7from
141-lost-license-in-workflow-edit

Conversation

@amadulhaxxani
Copy link
Copy Markdown

Problem description

Fix the CLARIN license section so it uses the route-aware submission service instead of workspace-only lookups. This makes the component work against both workspace item edit pages and workflow item edit pages by loading the correct submission endpoint and sending the PATCH request to the submission’s own self link.

Copilot review

  • Requested review from Copilot

Delete the generated binary test-output.log from the repository to avoid committing test artifacts and reduce repository noise. The file has been removed from the index and will no longer be tracked.
reverting accidental changes
Copilot AI review requested due to automatic review settings May 11, 2026 13:00
@amadulhaxxani amadulhaxxani linked an issue May 11, 2026 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the CLARIN license submission section to work on both workspace item edit and workflow item edit pages by relying on the route-aware SubmissionService and PATCHing the submission object via its own self link.

Changes:

  • Replace workspaceitem-only lookup logic with SubmissionService.retrieveSubmission(submissionId) to support both workspace and workflow edit routes.
  • Send the license PATCH request directly to submission._links.self.href instead of constructing a workspaceitems endpoint URL.
  • Adjust item/license initialization to resolve the item via submission._links.item.href.
Comments suppressed due to low confidence (2)

src/app/submission/sections/clarin-license-resource/section-license.component.ts:301

  • buildFromRequestUUID(requestId) emits a completed RemoteData even on failures, where payload can be undefined. This code immediately dereferences/destructures response.payload (const workspaceitem = response.payload; const {sections} = workspaceitem; ...), which will throw if the PATCH fails (e.g. 4xx/5xx). Add a guard like if (!response?.hasSucceeded || !response.payload) { ... return; } before reading sections/errors, and handle the failure path (e.g. show an error notification).
          .subscribe((response: RemoteData<SubmissionObject>) => {

            // show validation errors in every section
            const workspaceitem = response.payload;

            const {sections} = workspaceitem;
            const {errors} = workspaceitem;

src/app/submission/sections/clarin-license-resource/section-license.component.ts:300

  • The local variable name workspaceitem is misleading here because the response is now typed as RemoteData<SubmissionObject> and may represent either a workspace or workflow submission. Renaming it to something like submissionObject (and updating sections/errors destructuring) will make the code clearer and reduce confusion during maintenance.
            // show validation errors in every section
            const workspaceitem = response.payload;

            const {sections} = workspaceitem;
            const {errors} = workspaceitem;

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.

Lost license in workflow edit

2 participants