[PR #1332] [MERGED] fix: prefill advanced field settings with current field meta in template #1564

Closed
opened 2026-02-26 19:33:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1332
Author: @Etrenak
Created: 9/7/2024
Status: Merged
Merged: 9/10/2024
Merged by: @Mythie

Base: mainHead: fix/field-meta-in-field-settings


📝 Commits (1)

  • 704970d fix: prefill advanced field settings with current field meta

📊 Changes

3 files changed (+9 additions, -19 deletions)

View changed files

📝 packages/lib/translations/de/common.po (+4 -4)
📝 packages/lib/translations/en/common.po (+4 -4)
📝 packages/ui/primitives/document-flow/field-item-advanced-settings.tsx (+1 -11)

📄 Description

Description

Seems like I was overconfident in #1323 and I did not test properly. Currently, the advanced settings for a field in a template is not pre-filled with the current fieldMeta, although it is correctly pre-filled in a draft document (That's probably where I messed up my testing).

In this PR, I propose to directly use the fieldMeta provided by the field prop in FieldAdvancedSettings, instead of multiplying tRPCs to request the fieldMeta while we already have it.

I apologize for the wasted time in reviewing my previous PR which was only correcting the display of the field label in the template view.

Testing Performed

  • This time, I correclty checked that the advanced settings for a field is correctly pre-filled both in a document draft and in a template.
  • npm run buiild builds correclty.

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.

Summary by CodeRabbit

  • New Features
    • Simplified data retrieval in the Field Advanced Settings component, enhancing performance and responsiveness.
  • Localization Updates
    • Updated translation references in both German and English localization files to ensure accuracy with the latest source file structure.

🔄 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/1332 **Author:** [@Etrenak](https://github.com/Etrenak) **Created:** 9/7/2024 **Status:** ✅ Merged **Merged:** 9/10/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `fix/field-meta-in-field-settings` --- ### 📝 Commits (1) - [`704970d`](https://github.com/documenso/documenso/commit/704970d0741d7a3c156b9ed1750070d9c39fff8b) fix: prefill advanced field settings with current field meta ### 📊 Changes **3 files changed** (+9 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `packages/lib/translations/de/common.po` (+4 -4) 📝 `packages/lib/translations/en/common.po` (+4 -4) 📝 `packages/ui/primitives/document-flow/field-item-advanced-settings.tsx` (+1 -11) </details> ### 📄 Description ## Description Seems like I was overconfident in #1323 and I did not test properly. Currently, the advanced settings for a field in a **template** is not pre-filled with the current fieldMeta, although it is correctly pre-filled in a **draft document** (That's probably where I messed up my testing). In this PR, I propose to directly use the fieldMeta provided by the field prop in `FieldAdvancedSettings`, instead of multiplying tRPCs to request the fieldMeta while we already have it. I apologize for the wasted time in reviewing my previous PR which was only correcting the display of the field label in the template view. ## Testing Performed - This time, I correclty checked that the advanced settings for a field is correctly pre-filled both in a document draft and in a template. - `npm run buiild` builds correclty. ## 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. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Simplified data retrieval in the Field Advanced Settings component, enhancing performance and responsiveness. - **Localization Updates** - Updated translation references in both German and English localization files to ensure accuracy with the latest source file structure. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:48 +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#1564
No description provided.