-
-
Notifications
You must be signed in to change notification settings - Fork 392
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
Backport 'Allow deletion of categories when there are no resources associated' to v0.27 #12808
Backport 'Allow deletion of categories when there are no resources associated' to v0.27 #12808
Conversation
* Destroy categorization when resource is being destroyed * Add rake task and RELEASE NOTES * Fix template * Prevent destroy command to remove categories in use * Apply suggestions from code review Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com> * Update decidim-core/lib/decidim/core/test/shared_examples/has_category.rb Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com> * Running linters --------- Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
56ed178
to
5e2ac20
Compare
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.
There is one small change here.
<% if allowed_to? :destroy, :category, category: subcategory %> | ||
<%= icon_link_to "circle-x", category_path(current_participatory_space, subcategory), t("actions.destroy", scope: "decidim.admin"), class: "action-icon--remove", method: :delete, data: { confirm: t("actions.confirm_destroy", scope: "decidim.admin") } %> | ||
<% if subcategory.unused? %> | ||
<% if allowed_to? :destroy, :category, category: subcategory %> |
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.
There are 2 if statements, and they are flipped
Suggested in code review
decidim-admin/app/views/decidim/admin/categories/index.html.erb
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.
We still need to check the structure.
Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
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.
👍
🎩 What? Why?
Backport #12143 to v0.27