[PR #1851] [MERGED] fix: globalAccessAuth error #1886

Closed
opened 2026-02-26 20:31:31 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1851
Author: @catalinpit
Created: 6/20/2025
Status: Merged
Merged: 6/23/2025
Merged by: @dguyen

Base: mainHead: fix/globalaccessauth-error


📝 Commits (2)

  • 41a05cc chore: fix globalAccessAuth error
  • fdd17d7 chore: safe parse global access auth

📊 Changes

4 files changed (+24 additions, -4 deletions)

View changed files

📝 apps/remix/app/components/general/document/document-edit-form.tsx (+7 -1)
📝 apps/remix/app/components/general/template/template-edit-form.tsx (+7 -1)
📝 packages/ui/primitives/document-flow/add-settings.types.ts (+5 -1)
📝 packages/ui/primitives/template-flow/add-template-settings.types.tsx (+5 -1)

📄 Description

Description

Users can't proceed further if they select the No restrictions option for the Document Access field in the document/template editor.

Screenshot 2025-06-20 at 09 51 39

Changes Made

Updated the globalAccessAuth field in the Zod schemas from add-template-settings.types.tsx and add-settings.types.ts:

globalAccessAuth: z
    .array(z.union([ZDocumentAccessAuthTypesSchema, z.literal('-1')]))
    .transform((val) => (val.length === 1 && val[0] === '-1' ? [] : val))
    .optional()
    .default([]),

It converts the -1 value, which represents the No restrictions option , into an empty array, which also serves as the default value.

Testing Performed

Uploaded various documents and templates with various options for the Document Access field. Then, I checked the database to make sure it reflects the correct values.

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1851 **Author:** [@catalinpit](https://github.com/catalinpit) **Created:** 6/20/2025 **Status:** ✅ Merged **Merged:** 6/23/2025 **Merged by:** [@dguyen](https://github.com/dguyen) **Base:** `main` ← **Head:** `fix/globalaccessauth-error` --- ### 📝 Commits (2) - [`41a05cc`](https://github.com/documenso/documenso/commit/41a05cc8cf906ba1accc945c8f2999e0cbb7a451) chore: fix globalAccessAuth error - [`fdd17d7`](https://github.com/documenso/documenso/commit/fdd17d7498ac20b770e5b0de958e371a1d6d2c59) chore: safe parse global access auth ### 📊 Changes **4 files changed** (+24 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `apps/remix/app/components/general/document/document-edit-form.tsx` (+7 -1) 📝 `apps/remix/app/components/general/template/template-edit-form.tsx` (+7 -1) 📝 `packages/ui/primitives/document-flow/add-settings.types.ts` (+5 -1) 📝 `packages/ui/primitives/template-flow/add-template-settings.types.tsx` (+5 -1) </details> ### 📄 Description ## Description Users can't proceed further if they select the `No restrictions` option for the `Document Access` field in the document/template editor. <img width="1061" alt="Screenshot 2025-06-20 at 09 51 39" src="https://github.com/user-attachments/assets/950a8dd1-70cf-46b8-b2c6-9050b1301873" /> ## Changes Made Updated the `globalAccessAuth` field in the Zod schemas from `add-template-settings.types.tsx` and `add-settings.types.ts`: ```tsx globalAccessAuth: z .array(z.union([ZDocumentAccessAuthTypesSchema, z.literal('-1')])) .transform((val) => (val.length === 1 && val[0] === '-1' ? [] : val)) .optional() .default([]), ``` It converts the `-1` value, which represents the `No restrictions` option , into an empty array, which also serves as the default value. ## Testing Performed Uploaded various documents and templates with various options for the `Document Access` field. Then, I checked the database to make sure it reflects the correct values. ## Checklist - [x] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [ ] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 20:31:31 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1886
No description provided.