Skip to content

prevents parent assets from being bulk deleted #16315

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

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

Godmartinz
Copy link
Member

@Godmartinz Godmartinz commented Feb 24, 2025

This adds prevention from deleting parent assets, assets that have other assets assigned to them. A error message will appear with the parent asset's tag that can be used to navigate and check in all attached assets.
#16261

image

Copy link

what-the-diff bot commented Feb 24, 2025

PR Summary

  • Enhanced error checking for asset deletion

    • The destroy method in the BulkAssetsController has been upgraded to perform additional checks. This includes new steps to determine if an asset that is being deleted is a "parent" to other assets, and if it has any ongoing assignments. The updated method will gather errors related to both assignments and parent assets. If any errors occur, the system will now provide cleaner, combined error messages and improve the handling of system responses.
  • Improved clarity in feedback messages

    • Language localization messages in message.php have been updated. The aim is to give clearer feedback to the user when there are issues related to asset deletion. The messages assigned_to_error and parent_assigned_error have been specifically enhanced for better understanding.
  • Updated rendering of error messages

    • The notifications.blade.php view has been modified. It will now render error messages with the {!! $message !!} text in place of {{ $message }}. This change will enable HTML content to be included in messages, providing more freedom in the formatting and creation of custom messages.

@Godmartinz
Copy link
Member Author

I've escaped the asset tags and added an error-unescaped to the blade. (I think this is the way?)

@spencerrlongg
Copy link
Collaborator

You might need to add some logic to the individual delete buttons on the rows as well - down to help out, just let me know

@Godmartinz
Copy link
Member Author

Godmartinz commented Feb 27, 2025

Dont think its possible to delete single assets via the GUI, the delete button is disabled. but I will look into the api

EDIT: i take that back, you are right

@Godmartinz Godmartinz changed the title prevents parent assets from being deleted prevents parent assets from being bulk deleted Feb 27, 2025
@Godmartinz
Copy link
Member Author

singular parent asset deletion has been handled as well #16380

@Godmartinz Godmartinz requested a review from snipe March 12, 2025 17:03
@snipe
Copy link
Member

snipe commented Mar 12, 2025

Looks like we have some failing tests here - can you check that out?

@snipe
Copy link
Member

snipe commented Apr 9, 2025

@Godmartinz Can you look into those failing tests?

@Godmartinz
Copy link
Member Author

@snipe tests fixed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants