Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements resource deletion functionality for Computer Science Resources, adding soft delete capabilities and cleanup operations for associated data.
- Adds soft delete functionality to Computer Science Resources with proper cleanup observers
- Updates resource editing tests to verify image deletion behavior during merges
- Refactors form validation in Vue component from PrimeVue resolver to manual Yup validation
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| database/migrations/2025_08_29_170217_add_soft_delete_and_indexing_to_computer_science_resources.php | Adds soft delete column and page_url index to resources table |
| app/Models/ComputerScienceResource.php | Enables soft deletes and defines cascade delete relationships |
| app/Observers/ComputerScienceResourceObserver.php | Implements cleanup logic for tags and images during deletion |
| app/Observers/ResourceReviewObserver.php | Changes event from 'deleted' to 'deleting' for proper timing |
| app/Listeners/UpdateResourceReviewSummary.php | Fixes property name and adds deletion handling for review summaries |
| app/Events/ResourceReviewProcessed.php | Renames property from 'resource' to 'resource_id' for clarity |
| app/Http/Controllers/ResourceEditsController.php | Adds immediate old image deletion during resource edits merge |
| app/Services/ComputerScienceResourceService.php | Simplifies duplicate detection to use only page_url |
| app/Filament/Admin/Resources/ComputerScienceResource.php | Changes delete action to use forceDelete instead of soft delete |
| tests/Feature/ResourceEditsTest.php | Updates tests to verify image deletion behavior and renames test method |
| tests/Feature/ComputerScienceResourceTest.php | Adds comprehensive cleanup test and updates existing deletion test |
| tests/Feature/CommentsTest.php | Renames test method for consistency |
| resources/js/Components/Resources/Reviews/CreateResourceReview.vue | Refactors from PrimeVue form resolver to manual Yup validation |
Comments suppressed due to low confidence (1)
app/Filament/Admin/Resources/ComputerScienceResource.php:1
- Inconsistent deletion behavior: individual delete action uses forceDelete() but bulk delete uses delete(). Both should use the same deletion method for consistency.
<?php
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.