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

Backport 'Allow deletion of categories when there are no resources associated' to v0.27 #12808

Conversation

andreslucena
Copy link
Member

🎩 What? Why?

Backport #12143 to v0.27

♥️ Thank you!

* 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>
@andreslucena andreslucena added backport Pull Requests that are a backport for a fixed bug type: fix PRs that implement a fix for a bug labels Apr 30, 2024
@andreslucena andreslucena force-pushed the backport/0.27/allow-deletion-of-categories-w-12143 branch from 56ed178 to 5e2ac20 Compare April 30, 2024 07:08
@alecslupu alecslupu added this to the 0.27.6 milestone Apr 30, 2024
Copy link
Contributor

@alecslupu alecslupu left a 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 %>
Copy link
Contributor

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
Copy link
Contributor

@alecslupu alecslupu left a 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>
Copy link
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

👍

@alecslupu alecslupu merged commit 6718a41 into release/0.27-stable Apr 30, 2024
45 checks passed
@alecslupu alecslupu deleted the backport/0.27/allow-deletion-of-categories-w-12143 branch April 30, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Pull Requests that are a backport for a fixed bug module: admin module: core type: fix PRs that implement a fix for a bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants