datlechin / filament-menu-builder

Create and manage menu in your Filament app.
MIT License
34 stars 5 forks source link

🩹 Delete unregistered locations when updating menus #18

Closed Log1x closed 1 month ago

Log1x commented 1 month ago

This filters menu locations against registered locations when updating to ensure locations that are no longer registered get properly deleted.

Tóm tắt bởi Sourcery

Lọc các vị trí menu so với các vị trí đã đăng ký trong quá trình cập nhật để xóa các vị trí chưa đăng ký.

Sửa lỗi:

Original summary in English ## Summary by Sourcery Filter menu locations against registered locations during updates to delete unregistered locations. Bug Fixes: - Ensure that menu locations are filtered against registered locations when updating, deleting any unregistered locations.
sourcery-ai[bot] commented 1 month ago

Hướng Dẫn Đánh Giá của Sourcery

Yêu cầu kéo này thực hiện một sửa đổi để xóa các vị trí menu chưa được đăng ký khi cập nhật menu. Thay đổi được thực hiện trong tệp EditMenu.php, cụ thể là trong phương thức handleRecordUpdate. Việc triển khai lọc mảng vị trí so với các vị trí đã đăng ký để đảm bảo rằng các vị trí không còn được đăng ký sẽ bị xóa đúng cách.

Thay Đổi Cấp Độ Tệp

Tệp Thay đổi
src/Resources/MenuResource/Pages/EditMenu.php Thay thế việc gán đơn giản của các vị trí bằng một bộ sưu tập đã lọc
src/Resources/MenuResource/Pages/EditMenu.php Lấy các vị trí đã đăng ký từ FilamentMenuBuilderPlugin
src/Resources/MenuResource/Pages/EditMenu.php Lọc các vị trí để chỉ giữ lại những vị trí tồn tại trong các vị trí đã đăng ký

Mẹo - Kích hoạt một đánh giá Sourcery mới bằng cách bình luận `@sourcery-ai review` trên yêu cầu kéo. - Tiếp tục thảo luận của bạn với Sourcery bằng cách trả lời trực tiếp các bình luận đánh giá. - Bạn có thể thay đổi cài đặt đánh giá của mình bất cứ lúc nào bằng cách truy cập [bảng điều khiển](https://app.sourcery.ai): - Bật hoặc tắt tóm tắt yêu cầu kéo hoặc hướng dẫn đánh giá do Sourcery tạo ra; - Thay đổi ngôn ngữ đánh giá; - Bạn luôn có thể [liên hệ với chúng tôi](mailto:support@sourcery.ai) nếu bạn có bất kỳ câu hỏi hoặc phản hồi nào.
Original review guide in English ## Reviewer's Guide by Sourcery This pull request implements a fix to delete unregistered menu locations when updating menus. The change is made in the `EditMenu.php` file, specifically in the `handleRecordUpdate` method. The implementation filters the locations array against registered locations to ensure that locations no longer registered are properly removed. ### File-Level Changes | Files | Changes | | ----- | ------- | | `src/Resources/MenuResource/Pages/EditMenu.php` | Replace the simple assignment of locations with a filtered collection | | `src/Resources/MenuResource/Pages/EditMenu.php` | Retrieve registered locations from FilamentMenuBuilderPlugin | | `src/Resources/MenuResource/Pages/EditMenu.php` | Filter locations to keep only those that exist in registered locations | ---
Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.