Skip to content
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(next,ui): fixes global doc permissions and optimizes publish access data loading #6451

Merged
merged 13 commits into from
May 22, 2024

Conversation

jacobsfletch
Copy link
Member

@jacobsfletch jacobsfletch commented May 22, 2024

Description

  1. Document permissions for globals was not wired up properly. The data arg was not being populated, making this example impossible:
access: {
  update: ({ req, data }) => data.name === req.user.email
}

This was because the global access route was wrongly executing the docAccessOperation collection operation, instead of using the explicit docAccessOperationGlobal for globals. This has been fixed along with tests.

  1. In effort to achieve better loading states, we need to minimize CLS. The <PublishButton/> on documents is one culprit for this. It performs client-side fetching for publish access and waits to render itself based on the result. This leads to the component blinking in after initial render. This has fixed by moving this logic to the server and the document info context. Now documents that are directly navigated to will immediately know its publish permission. This also meant that this property could only be accessed in that single component, as opposed to only document-wide.
  • I have read and understand the CONTRIBUTING.md document in this repository.

@jacobsfletch jacobsfletch requested a review from denolfe as a code owner May 22, 2024 06:52
@jacobsfletch jacobsfletch changed the title fix: global access control and fix(next): fixes global access control and optimizes publish access data loading May 22, 2024
@jacobsfletch jacobsfletch changed the title fix(next): fixes global access control and optimizes publish access data loading fix(next): fixes global access route and optimizes publish access data loading May 22, 2024
@jacobsfletch jacobsfletch changed the title fix(next): fixes global access route and optimizes publish access data loading fix(next,ui): fixes global access and optimizes publish access data loading May 22, 2024
@jacobsfletch jacobsfletch changed the title fix(next,ui): fixes global access and optimizes publish access data loading fix(next,ui): fixes global doc permissions and optimizes publish access data loading May 22, 2024
@jacobsfletch jacobsfletch merged commit 2b941b7 into beta May 22, 2024
52 checks passed
@jacobsfletch jacobsfletch deleted the fix/global-access branch May 22, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant