-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix collection drilling #16819
Fix collection drilling #16819
Conversation
Using just the ID can create conflicts when storing sub-collection elements.
I am not sure if this is the right way to handle collections ... that it isn't obvious to me doesn't mean it's not the right way to do this, but maybe a quick summary helps you make the right choice ? Generally speaking we have 3 concepts:
Ideally it'd always be clear what the item is that you're dealing with. I hope that helps clarify how you want to handle this. |
Thank you so much for the summary! I really appreciate it. I will try to think a bit more about how to handle this with this information 👍 |
This is just to make the handling of top level HDCAs and sub-collections more consistent for fetching and storing elements in the store.
For storing and retrieving collection elements we only need to use the DatasetCollection ID whether the collection entry is an HDCA or a sub-collection.
Whether we are fetching elements for a top level HDCA or a sub-collection we need to provide the top HDCA ID and the DatasetCollection ID to fetch their elements.
Thanks again @mvdbeek! |
client/src/components/History/CurrentCollection/CollectionPanel.vue
Outdated
Show resolved
Hide resolved
client/src/components/History/CurrentCollection/CollectionPanel.vue
Outdated
Show resolved
Hide resolved
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.
Thanks for fixing this! I'd love if this was closer to the API and we didn't have to invent additional models like SubCollection, but maybe that would require having a better way to access elements of a collection.
- Make sure the computed properties are of the right type or error out. - Rename onViewSubCollection to onViewDatasetCollectionElement.
Fixes #16785
This should fix the selenium test failure:
The important stuff is in the function
onViewSubCollection
insideCollectionPanel.vue
. I'm not 100% sure this is how we are supposed to query the elements of a sub-collection i.e. by calling/api/dataset_collections/{hdca_id}/contents/{collection_id}
wherehdca_id
is the top HDCA in the history andcollection_id
is theDatasetCollection
ID in DCObject, but it works on my tests... it is still a little fuzzy in my head how sub-collections work 😅It also fixes the store by using a composed key
[hdca_id + collection_id]
to store and retrieve elements from a collection, since just using the collection ID can create collisions between HDCAs (top level) and sub-collections (DCOs).How to test the changes?
License