Skip to content

Conversation

@Sky-FE
Copy link
Contributor

@Sky-FE Sky-FE commented Oct 29, 2025

No description provided.

@Sky-FE Sky-FE requested a review from Copilot October 29, 2025 08:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces protection for required fields in form views that don't have default values. These "protected fields" must remain visible in form views and cannot be removed, ensuring data integrity by preventing forms from being submitted without values for required fields that lack defaults.

Key Changes:

  • Added logic to identify "protected fields" (required fields without default values)
  • Prevented removal of protected fields from form views in the UI
  • Enhanced backend to automatically set protected fields as visible when creating/updating form views

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
apps/nextjs-app/src/features/app/blocks/view/form/util.ts Added isProtectedField utility function to identify required fields without defaults
apps/nextjs-app/src/features/app/blocks/view/form/components/FormFieldEditor.tsx Updated UI to show tooltip and disable removal for protected fields
apps/nextjs-app/src/features/app/blocks/view/form/components/FormField.tsx Updated required field logic to use isProtectedField helper
apps/nextjs-app/src/features/app/blocks/view/form/components/FormEditor.tsx Prevented drag-to-remove operations for protected fields
apps/nextjs-app/src/features/app/blocks/view/form/components/FromBody.tsx Added whitespace handling for form descriptions
apps/nestjs-backend/src/features/view/view.service.ts Added logic to enforce visibility for protected fields when creating form views
apps/nestjs-backend/src/features/field/field-calculate/field-view-sync.service.ts Added logic to enforce visibility when converting fields to protected status
apps/nestjs-backend/test/view.e2e-spec.ts Added test for protected field visibility in new form views
apps/nestjs-backend/test/field-view-sync.e2e-spec.ts Added test for protected field visibility when updating fields
packages/common-i18n/src/locales/*/table.json Added translations for protectedFieldTip message across 10 locales

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sky-FE Sky-FE merged commit 8dce5c2 into develop Nov 4, 2025
12 of 14 checks passed
@Sky-FE Sky-FE deleted the fix/form-required-fields branch November 4, 2025 02:59
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

🧹 Preview Environment Cleanup

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.

2 participants