fix(collections): hide draft collections from public browse surfaces#796
Open
vcnainala wants to merge 4 commits into
Open
fix(collections): hide draft collections from public browse surfaces#796vcnainala wants to merge 4 commits into
vcnainala wants to merge 4 commits into
Conversation
Introduce a reusable published() scope on Collection and a matching factory state so public queries and tests can target published records consistently.
Apply the published scope on the collections page, homepage featured collections, identifier redirects, and REST search so DRAFT collections are not exposed outside the dashboard.
Add a feature test that verifies draft collections are excluded from /collections and from the CollectionList Livewire component.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## development #796 +/- ##
================================================
+ Coverage 6.13% 6.35% +0.21%
- Complexity 1737 1740 +3
================================================
Files 227 227
Lines 8961 8971 +10
================================================
+ Hits 550 570 +20
+ Misses 8411 8401 -10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Use where() instead of the published() scope because Lomkit REST builders are typed as the Eloquent contract interface, which PHPStan does not resolve to model-specific query scopes.
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.
Summary
published()query scope onCollectionplus apublished()factory state for tests and fixtures./collections(Livewire), homepage featured collections, collection identifier redirects, and Lomkit REST collection search.Test plan
php artisan test --filter=CollectionListTest/collectionsand confirm onlyPUBLISHEDcollections are listedDRAFTcollection with aCNPC…identifier returns 404 at/collections/{identifier}Resolves
Closes #774