Duplicate data from an existing Item to a new WorskpaceItem, aka clone/copy item #3076
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
Description
This PR introduces the ability to create a new WorkspaceItem by reusing properties from an existing Item, kind of like how versioning works now, but resulting in a partially completed edit form of a new Item. Some existing code from the versioning infrastructure was adapted and integrated as two new methods,
copy
andclone
, within the ItemService, and tweaked, just to make things work more smoothly.Here's a preview:
dspace_clone_item_feat.mp4
Instructions for Reviewers
As my REST PR introduces a change in the existing endpoint, pressing the clone button will not work without the REST PR.
On the Angular side:
On the REST side:
Example request (endpoint, header, body):
Response should show a new WorkspaceItem with some of the metadata copied from the specified :itemUuid. Although some of the metadata will be omitted to prevent duplicates or multiple values in places they shouldn't occur – see
nonCopyableMetadataFields
incore-services.xml
.Checklist
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.