-
Notifications
You must be signed in to change notification settings - Fork 427
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
fix(core): hide versions.*
documents from search, update getPublishedId
to account for versions
#7470
Merged
Conversation
This file contains 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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Sep 20, 2024 3:02 PM (UTC) ❌ Failed Tests (1) -- expand for details
|
pedrobonamin
requested review from
ricokahler
and removed request for
a team
September 6, 2024 07:04
pedrobonamin
force-pushed
the
corel-158
branch
2 times, most recently
from
September 10, 2024 07:56
3ccfe26
to
7c25b11
Compare
pedrobonamin
changed the title
fix(core): hide
fix(core): hide Sep 10, 2024
versions.*
documents from search and lists, show error in document panelversions.*
documents from search and lists, update getPublishedId
to account for versions
pedrobonamin
changed the title
fix(core): hide
fix(core): hide Sep 10, 2024
versions.*
documents from search and lists, update getPublishedId
to account for versionsversions.*
documents from search, update getPublishedId
to account for versions
pedrobonamin
force-pushed
the
corel-158
branch
from
September 16, 2024 09:36
7c25b11
to
863527b
Compare
juice49
reviewed
Sep 20, 2024
juice49
previously approved these changes
Sep 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Added one tiny comment.
Co-authored-by: Ash <[email protected]>
juice49
approved these changes
Sep 20, 2024
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.
Description
This PR adds changes to the studio search to not query for documents that start with the id
versions.*
We need to exclude that the version documents from the search queries (lists and global search), so users won't see duplicated results if they have version documents.
This PR also updates how the
getPublishedId
function works, accounting for the version documents.It has been decided that all documents in which the first segment is
versions.
will be considered a version document, the second segment is theversionId
and the following segments are the document published id.The update for the
getPublishedId
function handles this cases. See tests for this scenarioNow, when visiting a document in the URL with the id
versions.foo.bar
when the builder defines the document id inside the pane it will resolve toid=bar
, so the user will be able to interact with the document.E.g: visiting this document won't crash the studio after this changes:
preview branch
https://test-studio-git-corel-158.sanity.dev/test/structure/author;versions.rbtQUMGgH.5a9b3da1-9398-49d3-b593-9fa89f0322ffnext branch
: https://test-studio.sanity.dev/test/structure/author;versions.rbtQUMGgH.5a9b3da1-9398-49d3-b593-9fa89f0322ffWhat to review
Are this changes correct?
Testing
Added new tests for the updates in the draftUtils functions, search tests are also updated to follow the new rules
Notes for release
n/a not public facing yet