Skip to content

Enable copying attributes by reference #2687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

robyngit
Copy link
Member

This PR extends the attribute copying functionality (#688) to allow users to link to an existing attribute list instead of cloning it. This is supported by the EML attributeList element via .

  • Users can now choose between copying or linking attributes when duplicating across entities.
  • This choice is available for both the "copy from" and "copy to" methods.
  • The UI indicates when an entity references another attributeLis and the user can click a button to directly switch to editing the source attributeList.
  • A new EML references model handles finding the linked attributeList (and can be used for other references elements in EML in the future). References are now parsed and serialized correctly in the attributeList.
  • A new EMLAttributeList model handles parsing, serializing, validating, and managing a collection of EML attributes OR a references element.
  • A new configurable toggle view is used to select between "Copy Attributes" and "Link Attributes."
image image

robyngit added 11 commits April 16, 2025 13:04
The button is now a UI element only and is never removed. It is no longer connected to a new blank model in the collection, which was leading to unexpected behaviour.
The button is now always visible, stickign to the bottom of the list container when there are many attributes.

Fixes #799, #1722, #1216
Ensure that the "Add new attribute" button remains visible even when the
user has autofilled the attributes. Re-rendering the attributes previously removed
the button from the view without re-rendering it.

Issue #799 and #1722
- Including tests for both

Issue #2652
- Since an attributeList cannot have both attrs and refs, make sure that the references are deleted when attrs are added to the list.
- Ensure UI re-renders when references get removed

Issue #2652
- Add option to copyAttributeList to copy attributes as a linked reference
- Added EMLUtilities file to store common EML functions, like getParentEML
- Made sure that parentModel is passed down the line of sub-models correctly in eml attribute related models/collections
- Fixed logic with listeners

Issue #2652
- Fix bug that occurs when a entity view needs to be created for an existing dataone object with no matching eml entity. The view was not being created and an error was thrown.
- Fix a bug introduced in development of #2652 that prevented the dataONEobject ID from being added to the EML entity

Issue #2652
Allows switching between two options.
Uses a button group (aka segmented control) to indicate the selection more clearly than a classic switch toggle or checkbox.
Allows adding a description for both options.

Issue #2652
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Support Copying Attributes as References
2 participants