Skip to content
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

use valkyrie to power collection member removal from Dashboard #4972

Merged
merged 3 commits into from
May 26, 2021

Conversation

straleyb
Copy link
Contributor

@straleyb straleyb commented May 21, 2021

Fixes #4914

This object has been updated to use Valkyrie when deleting collections. Instead of responding to #member_of_collections, it responds to #member_of_collection_ids. Then you can call delete using the id of the collection and then persist the valkyrie object.

Copy link
Contributor

@jeremyf jeremyf left a comment

Choose a reason for hiding this comment

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

I don't know if we need a test case for use valkyrie?

it "removes members from the collection" do
# TODO: Using size until count is fixed https://github.com/projecthydra-labs/activefedora-aggregation/issues/78
expect do
put :update, params: { id: collection,
collection: { members: 'remove' },
batch_document_ids: [asset2] }
end.to change { asset2.reload.member_of_collections.size }.by(-1)
expect(assigns[:collection].member_objects).to match_array [asset1]
end

@no-reply
Copy link
Contributor

@jeremyf i think the use_valkyrie: case is tested in the CI matrix.

Copy link
Contributor

@no-reply no-reply left a comment

Choose a reason for hiding this comment

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

@straleyb since this seems to work with valkyrie, i'd like to just squash it down to the one branch.

we don't return these objects, so doing this behavior with valkyrie behind the scenes is a no-impact refactor. i'm going to approve and merge this, then submit a follow-up to remove the argument and case block.

@no-reply no-reply changed the title update to use config for valkyrie use valkyrie to power collection member removal from Dashboard May 26, 2021
@no-reply no-reply merged commit b87e771 into main May 26, 2021
@no-reply no-reply deleted the feature/EnableDashboardCollectionsControllerValkyrie branch May 26, 2021 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CollectionsController needs to support valkyrie_objects
3 participants