-
Notifications
You must be signed in to change notification settings - Fork 62
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: resolve previewed document URL for any language #208
Conversation
Hi @AriFreyr, thanks for the PR! This is a good catch. I wonder if this could cause problems in other parts of an app once it gets past I can see how your change is necessary, even in that situation. If an app uses the URL to determine how the client is configured, for example, you would need to first get past Requested changesCould you update the tests for In each test, the following server.use(
createMockRepositoryHandler(t),
createMockQueryHandler(t, [queryResponse], undefined, {
ref: previewToken,
q: `[[at(document.id, "${documentId}")]]`,
+ lang: "*",
}),
); I can also make these changes if you enable maintainer edits (details here). Thanks! |
Yeah i can see how it would be confusing, i think the only other way to address this (and maybe a better way, atleast for my use case) would be if the preview callback url provided the language of the document as a query param. I fixed the tests, should be working now, also edits should be allowed so feel free to edit |
Great! Thanks for updating the tests. I'll merge and publish this. 🙂
I could see that being useful. Since the previewed document contains the language in the |
Codecov Report
@@ Coverage Diff @@
## master #208 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 19 19
Lines 316 316
Branches 60 60
=========================================
Hits 316 316
Continue to review full report at Codecov.
|
This has been published in Thanks again @AriFreyr! |
Types of changes
Description
Preview only works for the default language, fetch the preview document for all languages. Otherweise getByID will crash before calling the linkResolver
Checklist: