Skip to content

feat: replace hardcoded jobs with configurable actions#2351

Open
minottic wants to merge 4 commits into
generalize_dialogfrom
config_batch
Open

feat: replace hardcoded jobs with configurable actions#2351
minottic wants to merge 4 commits into
generalize_dialogfrom
config_batch

Conversation

@minottic
Copy link
Copy Markdown
Member

@minottic minottic commented Apr 23, 2026

Description

By setting batchActionsEnabled and batchActions in config.json it renders them as actions in the overview page and in the cart (common ones are preserved)

Motivation

This facilitates facilities to set custom actions in the cart and in particular helps us in adding new workflows, delete and restore ones.

This is an example of the config

image image

Changes:

  • new functions registered in configurable-actions that compute sum of size and sum of packedSize and datasetlist required by jobs
  • custom snackbar is refactored to use action with showMessage
  • archiveService is removed
  • selection is cleared when action is submitted from dataset-overview
  • actions are disabled when cart is non empty
  • new functions allow for better enable/disable as one can now disable e.g. archive when size of files = 0

Tests included

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)

Documentation

  • swagger documentation updated [required]
  • official documentation updated [nice-to-have]

official documentation info

If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included

Backend version

  • Does it require a specific version of the backend
  • which version of the backend is required:

Summary by Sourcery

Replace hardcoded archive/retrieve dataset jobs with configurable batch actions and integrate them into the datasets overview and batch views.

New Features:

  • Introduce configurable batch actions in dataset overview and batch views driven by config-defined batchActions.
  • Expose new configurable-action keywords for dataset field lists and total size metrics to support workflow configuration.

Bug Fixes:

  • Ensure dataset selection is cleared automatically when view mode changes or after configurable actions complete successfully.
  • Keep dataset-table selection state in sync with the global selected-datasets store and clear table selection when the store is emptied.

Enhancements:

  • Refactor archiving and retrieval flows to use generic configurable actions instead of the dedicated ArchivingService, removing that service and its dependencies.
  • Route configurable action success and failure through NgRx actions and effects to display standardized success/error snackbars.
  • Disable dataset overview actions when the cart is non-empty to prevent conflicting operations.

Documentation:

  • Document the new configurable-actions dataset keywords for total sizes and PID/file mappings in the technical documentation.

Tests:

  • Extend configurable-actions unit tests to cover new keywords and error handling for failed XHR actions.
  • Update dataset-table-actions and batch-view component tests for the new configurable-actions integration and selection-clearing behavior.

@minottic minottic requested a review from a team as a code owner April 23, 2026 12:20
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • In several places (e.g. building actionItems in DatasetTableActionsComponent and BatchViewComponent) you rely on as ActionItemDataset[] / as UserProfile; consider tightening the selector types (or introducing a typed facade) so you can avoid these casts and catch mismatches at compile time.
  • The { success: boolean } payload for actionFinished is duplicated across multiple components; introducing a shared interface/type (and possibly centralizing the success-handling logic, e.g. driven off actionSuccessAction in an effect) would reduce duplication and make it easier to evolve the contract later.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In several places (e.g. building `actionItems` in `DatasetTableActionsComponent` and `BatchViewComponent`) you rely on `as ActionItemDataset[]` / `as UserProfile`; consider tightening the selector types (or introducing a typed facade) so you can avoid these casts and catch mismatches at compile time.
- The `{ success: boolean }` payload for `actionFinished` is duplicated across multiple components; introducing a shared interface/type (and possibly centralizing the success-handling logic, e.g. driven off `actionSuccessAction` in an effect) would reduce duplication and make it easier to evolve the contract later.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@minottic
Copy link
Copy Markdown
Member Author

after this PR I believe another enhancement of configurable-actions would be to allow for shared blocks, in particular the variables one. This way the config can stay slimmer since often variables in multiple actions inside the same config key are shared

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