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

Allow cloning of deleted assets #15160

Merged
merged 4 commits into from
Jul 24, 2024
Merged

Conversation

snipe
Copy link
Owner

@snipe snipe commented Jul 24, 2024

This cleans up a bit of confusing UI and also now allows users to clone deleted assets. We were inconsistent with our UI, allowing the clone button on the "Deleted Assets" page, but would just return an "asset not found" error, so it should have been disabled, or it should have worked.

I can see scenarios where you might want to clone a deleted item, so this PR makes it so that clicking "clone" on that asset will now bring up a normal clone page.

Copy link

what-the-diff bot commented Jul 24, 2024

PR Summary

  • Refactoring AssetsController.php
    The code in AssetsController.php was streamlined by allowing the getClone method to directly accept an Asset object instead of an assetId. This modification enhances the efficiency and readability of the code. Furthermore, the view was updated to use the newly defined $cloned variable which now holds the attributes of the asset object.

  • Improvising view.blade.php
    In view.blade.php, amendments were made to provide a more structured user interface. A new section was introduced, accompanied by a link for auditing assets. This link is displayed in specific conditions which will help the user with efficient asset management.

  • Adjustments in the hardware.php route
    For better comprehension, the route {assetId}/clone was updated to use {asset}. This gives a more descriptive outlook of our route. Additionally, a new method, withTrashed, has been implemented, providing a view of deleted assets as well. Overall, this change enhances the maintainability and user understandability of the code.

Signed-off-by: snipe <[email protected]>
@snipe snipe merged commit 8368fb5 into develop Jul 24, 2024
8 checks passed
@snipe snipe deleted the fixes/allow_cloning_of_deleted_assets branch July 24, 2024 17:09
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.

1 participant