hyonun321 opened a new pull request, #182:
URL: https://github.com/apache/polaris-tools/pull/182

   ### What
   
   Extract a reusable `FormField` component and apply it across 11 form modals 
to eliminate repeated Label + Input + Error + Hint boilerplate.
   
   ### Why
   
   The console has 17 form modals, and most repeat the same pattern:
   
   ```tsx
   <div className="space-y-2">
     <Label htmlFor="name">Name</Label>
     <Input id="name" {...register("name")} />
     {errors.name && <p className="text-sm 
text-red-600">{errors.name.message}</p>}
     <p className="text-xs text-muted-foreground">Some hint text</p>
   </div>
   ```
   
   This 4–6 line pattern appears ~50 times across the codebase. A simple 
wrapper component reduces each instance to a single declarative block.
   
   ## Changes
   - New: components/ui/form-field.tsx — lightweight wrapper that renders 
Label, children, error message, and optional hint
   - Modified: 11 form modals to use FormField:
     - CreateViewModal, CreatePrincipalRoleModal, EditPrincipalModal
     - CreateNamespaceModal, CreateCatalogRoleModal
     - CreateCatalogModal, EditCatalogModal
     - GrantPrivilegeModal, ConfigureConnectionModal, ResetCredentialsModal
   
   ## What this does NOT change
   - No behavioral changes — all forms work exactly as before
   - Provider-specific sections (S3/Azure/GCS options) and dynamic key-value 
UIs are left as-is where FormField would add complexity
   - Files without react-hook-form or with Select-only fields are not modified
   
   ## Testing
   - make lint ✅
   - make format-check ✅
   - Manual verification of all modified modals


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to