Skip to content

Administer workflow actions #2227

Merged
tdonohue merged 5 commits intoDSpace:mainfrom
4Science:DURACOM-134
May 17, 2023
Merged

Administer workflow actions #2227
tdonohue merged 5 commits intoDSpace:mainfrom
4Science:DURACOM-134

Conversation

@alisaismailati
Copy link
Copy Markdown
Contributor

References

Description

To fix the problem to delete or send back a workflow item, changed the operator from forkJoin to combineLatest, when one of the actions is performed. To delete a workspace item, a new component to perform the delete action is added.

Instructions for Reviewers

To delete or send back a workflow item from the Administer workflow (it's used the same method to perform one of the actions), the forkJoin is replaced with combineLatest to emit whenever any of the observables emits a value and not to wait for all the observables to complete and then emit an array of the last emitted value from each observable.
To delete a workspace item the logic was missing, so a new component is added. The new component is responsible for deleting a workspace item. When we try to delete a workspace item from Administer workflow we will be redirected to a new page where a table of item's metadata is shown and the cancel and delete actions, which respectively will redirect us to the previous page or performs delete action and then redirect.

List of changes in this PR:

  • First, operator at performAction method at WorkflowItemActionPageComponent is changed from forkJoin to combineLatest.
  • Second, the new WorkspaceItemsDeletePageComponent is created, because it was missing.
  • Next, getDeleteRoute method at WorkspaceItemsDeletePageComponent is fixed to get the right route to redirect us to the right page.
  • After that the route is added to the WorkspaceitemsEditPageRoutingModule.
  • On WorkspaceItemsDeletePageComponent initialization three actions are taken:
    1.value for the workspace item is retrieved from the activated route data,
    2.in a similar way, but from different source, the data for dspace object is retrieved,
    3. finally, the previous query parameters that were stored in the application's location state are retrieved
  • A themed wrapper for the component is also implemented.

Include guidance for how to test or review your PR.
Follow the steps from #2118 to be able to reproduce the behavior and
notice that now:
-a workspace item can be deleted,
-a workflow item can be deleted
-and a workflow item can be sent back.

Checklist

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@tdonohue tdonohue added this to the 7.6 milestone May 2, 2023
@tdonohue tdonohue self-requested a review May 4, 2023 14:36
Copy link
Copy Markdown
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @alisaismailati ! I verified this fixes the bug and that WorkspaceItems can also now be deleted from the Administer Workflow section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Administer workflow actions do not work

3 participants