-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for linked SingleItem in holdings #1091
Conversation
It has not been used in a long time. Works are now handled like any other node.
Move the id-fnurgel pill seen in the top right corner of cards to its own component. Use it in item-local as well. Co-authored-by: Lars Rosenström <[email protected]>
@@ -559,7 +603,7 @@ export default { | |||
/> | |||
|
|||
<entity-action | |||
v-if="inspector.status.editing && !isLocked" | |||
v-if="inspector.status.editing && !isLocked && !isInlinedRecord && !isExtracting" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!isExtracting
is a workaround for a bug in the old "extract" code.
If you start extracting an entity and then delete it you get an error when saving.
It is still possible to trigger:
- Add a new Item in hasComponent
- Click "Extract Single item" / "Extrahera Exemplar"
- Click Undo (removing the added item)
- Save
- Error!
2f48f5d
to
6fbccd8
Compare
LGTM! Must say I have little knowledge of this part of the code, but all looks reasonable. Nice cleaning job too. Have tried creating/extracting, editing, viewing (both inline and on its own) and unlinking/deleting The only thing I noticed is an alert saying I have unsaved changes when I try to navigate away in edit mode, even if I save and try again. Using the green button does it. Maybe it’s always been like this. |
Checklist:
yarn test:unit
yarn lint
Description
Add support for
SingleItem
s (sv: exemplar) in holdings.Initially to be used for pinpointing
itemUsed
in digital reproductions.An Item in
hasComponent
can be converted to aSingleItem
.It looks similiar to when extracting linked works.
The single items are always stored in their own records and linked from the the holding record.
Note the id in the top right corner.
But they can be edited in place as if the were part of the same record.
There are separate options for removing the linked entity or just the link.
Reused the ❌ for removing links. Maybe needs to be more obvious.
There can of course be many linked items and mixed with local items.
The feature is currently only available for sigel S.
Depends on libris/definitions#494
Depends on libris/librisxl#1467
Tickets involved
LXL-4504
Summary of changes
Add
settings.extractableMappedTypes
that specifies which types can be extracted and which type they should be converted to. That is,Item
can be extracted to its own document and should then be converted to'SingleItem
. This is a bit clumsy but does the job for now.When loading a record/document, other documents that should be inlined are moved from quoted to the main inspector data.
compositional
(onlyhasComponent
...).compositional
+integral
When saving, inlined documents are extracted and updated before the main document in separate requests.
Inlined records that should be deleted are deleted after the main doc is saved (this might fail...).
81208b0 breaks out the id-pill used in the top right corner of entity-summary to its own component. Taken from Feature/lxl 4504 cataloguing items #1073
bcf023b contains the main changes.
The other commits just remove obsolete and dead code that I encountered.
Not in scope
There is no way to move (link) a SingleItem to another holding record.
TODO