Skip to content

Add 'Add URL bitstream' feature to workspace items#110

Open
amadulhaxxani wants to merge 1 commit intoclarin-v7from
28-better-ui-for-add-bitstream-from-url
Open

Add 'Add URL bitstream' feature to workspace items#110
amadulhaxxani wants to merge 1 commit intoclarin-v7from
28-better-ui-for-add-bitstream-from-url

Conversation

@amadulhaxxani
Copy link

Introduce an "Add bitstream from URL" action for workspace items: add a conditional button and modal UI to input a file URL and optional name. Implement component support using ScriptDataService to call the file-downloader script, manage processing state, show success/error notifications, and navigate to the created process detail on success. Add related unit tests (scriptDataService stub, UI visibility, invocation params, success/failure flows) and update English and Czech i18n strings.

Problem description

Users could technically run the file-downloader script via the generic processes UI, but that flow is not contextual to workspace-item editing and is less discoverable for submitters.
Issue #28 requires an indirect, workspace-item-local UX similar to existing contextual script-trigger patterns in the app.

Analysis

  • Implemented a workspace-item action with modal inputs:
    • required URL
    • optional bitstream name
    • filename placeholder hint (e.g. image.png) to communicate extension expectation
  • Reused existing app architecture instead of introducing new backend/API logic:
    • script availability guard via scriptWithNameExistsAndCanExecute
    • script execution via ScriptDataService.invoke('file-downloader', ...)
    • standard process success/error notifications
    • navigation to process detail using existing route helper
  • Added focused unit coverage for:
    • action visibility (available/unavailable script)
    • invocation payload mapping (-u, -w, optional -n)
    • success and failure handling paths
  • Localization updated in both EN and CS for all new UI strings (including placeholder).

Validation

  • yarn run test:headless --include='**workspaceitem-actions.component.spec.ts' ✅ PASS (13/13)
  • yarn run lint --quiet ✅ PASS
  • yarn run build:prod ✅ PASS (with pre-existing custom-theme unused-file warnings only)

Copilot review

  • Requested review from Copilot

Introduce an "Add bitstream from URL" action for workspace items: add a conditional button and modal UI to input a file URL and optional name. Implement component support using ScriptDataService to call the 'file-downloader' script, manage processing state, show success/error notifications, and navigate to the created process detail on success. Add related unit tests (scriptDataService stub, UI visibility, invocation params, success/failure flows) and update English and Czech i18n strings.
Copilot AI review requested due to automatic review settings March 2, 2026 10:19
@amadulhaxxani amadulhaxxani linked an issue Mar 2, 2026 that may be closed by this pull request
Copy link

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

Adds a contextual “Add bitstream from URL” action to workspace-item actions, leveraging existing Processes/Script infrastructure (file-downloader) to make the feature discoverable during submission editing.

Changes:

  • Adds a conditional workspace-item action button and modal to input a URL + optional bitstream name.
  • Invokes the file-downloader script via ScriptDataService, shows success/error notifications, and navigates to the created process on success.
  • Adds unit tests for visibility, invocation parameters, and success/failure flows; updates EN/CS i18n strings.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/assets/i18n/en.json5 Adds English UI strings for the new workspace-item action + modal.
src/assets/i18n/cs.json5 Adds Czech UI strings for the new workspace-item action + modal.
src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts Implements modal state + file-downloader script invocation and post-success navigation.
src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.html Adds the conditional action button and modal UI (URL + optional name, processing spinner).
src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.spec.ts Adds unit coverage for button visibility and invocation/success/failure behavior.

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.

Better UI for add bitstream from URL

2 participants