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

don't show the "Add to collection" action when type isn't nestable #4987

Merged
merged 1 commit into from
May 28, 2021

Conversation

no-reply
Copy link
Contributor

the previous guard skipped showing this button only if no collection types were
nestable (checking this involved a solr query). it would then base the actual
behavior on the current collection type's nestability. in the case of admin
sets, it was even hard coded to false!

instead, check whether the current type is nestable. this avoids the most common
case where the user might push this button only to be given a deny popup. since
none of the data is loaded in dynamically in response to the button push,
there's no reason we can't remove that modal implementation altogether.

@samvera/hyrax-code-reviewers

<%= link_to "#",
class: 'itemicon add-to-collection',
title: t("hyrax.dashboard.my.action.add_to_collection"),
data: { nestable: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this line guaranteed that the deny modal will be used here.

the previous guard skipped showing this button only if no collection types were
nestable (checking this involved a solr query). it would then base the actual
behavior on the current collection type's nestability. in the case of admin
sets, it was even hard coded to false!

instead, check whether the current type is nestable. this avoids the most common
case where the user might push this button only to be given a deny popup. since
none of the data is loaded in dynamically in response to the button push,
there's no reason we can't remove that modal implementation altogether.
@dlpierce dlpierce merged commit f73064f into main May 28, 2021
@dlpierce dlpierce deleted the skip-deny-modal branch May 28, 2021 17:34
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.

2 participants