Skip to content

refactor(ui): migrate TagsForm from antd Form to React Hook Form + Autocomplete#29776

Open
Rohit0301 wants to merge 4 commits into
mainfrom
migrate-tagsform-to-hookform
Open

refactor(ui): migrate TagsForm from antd Form to React Hook Form + Autocomplete#29776
Rohit0301 wants to merge 4 commits into
mainfrom
migrate-tagsform-to-hookform

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

I worked on migrating the TagsForm component (used for creating/editing Tags and Classifications) from the legacy antd Form/FormInstance pattern to React Hook Form, following the AddDomainForm reference pattern exactly. The owner and domain pickers were switched from MUIUserTeamSelect / DOMAIN_SELECT_MUI to Autocomplete-based USER_TEAM_SELECT_INPUT / DOMAIN_SELECT fields with async search.

Fixes 4875

Type of change:

  • Improvement

High-level design:

TagsForm.tsx — Replaced antd Form with HookForm from @openmetadata/ui-core-components. Added async user/team and domain fetch logic (debounced, mirrors AddDomainForm). Description now uses FormField + RichTextEditor instead of generateFormFields. A submitRef prop allows the external Save buttons in SlideoutMenu.Footer to programmatically trigger validated form submission (submitRef.current = () => form.handleSubmit(handleSave)()).

tagFormFields.tsx — All _MUI field type variants replaced with RHF core-components equivalents (TEXT, ICON_PICKER, COLOR_PICKER, SWITCH). Owner/domain fields now accept options/onFocus/onSearchChange props. FieldProp and FieldTypes imported from @openmetadata/ui-core-components instead of the legacy local interface. name paths changed from antd NamePath arrays to RHF dot-notation strings.

TagsPage.interface.ts — Added TagFormValues, TagFormSelectItem, TAG_FORM_DEFAULTS. formRef: FormInstance replaced with form: UseFormReturn<TagFormValues> + optional submitRef across all three prop interfaces.

ClassificationFormDrawer / TagFormDrawer — Each creates a submitRef ref, passes it to TagsForm, and wires the Save button to submitRef.current().

TagsPage.tsxuseForm() from antd/lib/form/Form replaced with useForm<TagFormValues>() from react-hook-form; resetFields()reset().

Tests:

Use cases covered

  • Add Classification drawer: name, display name, description, owners, domains, mutually exclusive toggle
  • Add/Edit Tag drawer: all fields including icon, color, disabled toggle, owner, domain pre-population

Unit tests

  • Updated TagsForm.test.tsx, ClassificationFormDrawer.test.tsx, TagFormDrawer.test.tsx to use RHF useForm harness instead of antd Form.useForm
  • Rewrote tagFormFields.test.tsx to assert against the new RHF field configs

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no new UI interactions; existing Playwright tests cover the Tags page flow).

Manual testing performed

TypeScript compilation passes with zero errors (npx tsc --noEmit).

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Greptile Summary

This PR migrates the TagsForm component (used for creating/editing Tags and Classifications) from the legacy antd Form/FormInstance pattern to React Hook Form, following the AddDomainForm reference pattern. Owner and domain pickers are switched from MUIUserTeamSelect/DOMAIN_SELECT_MUI to Autocomplete-based USER_TEAM_SELECT_INPUT/DOMAIN_SELECT fields with async search, and MUIUserTeamSelect.tsx is deleted entirely.

  • TagsForm.tsx: Replaced antd Form with HookForm; added debounced async fetch for user/team and domain options; introduced submitRef to let external Save buttons trigger validated submission.
  • tagFormFields.tsx: All _MUI field type variants replaced with RHF core-components equivalents (TEXT, ICON_PICKER, COLOR_PICKER, SWITCH); name paths changed from antd NamePath arrays to RHF dot-notation strings.
  • TagsPage.interface.ts / TagsPage.tsx: Added TagFormValues, TagFormSelectItem, TAG_FORM_DEFAULTS; FormInstance replaced with UseFormReturn; resetFields()reset().

Confidence Score: 4/5

Safe to merge with one fix: the name field's format and length validation rules must be restored before merge.

The migration is well-structured and the overall approach is sound. However, TAG_NAME_VALIDATION_RULES — which enforced the TAG_NAME_REGEX character-set check and the 2–64 character length constraint — were dropped from the nameField during the antd → RHF refactor. Users can now submit tag/classification names that the backend will reject (single character, >64 chars, disallowed characters), silently turning a clear inline validation message into an API error toast.

openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx — the nameField memo needs the TAG_NAME_VALIDATION_RULES patterns re-attached via RHF rules.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx Core form component migrated from antd Form to React Hook Form; name field validation rules (length + pattern) were dropped from the migration.
openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/tagFormFields.tsx MUI field type variants replaced with RHF core-components equivalents; getDisabledField accepts initialValue but silently ignores it.
openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsPage.interface.ts Added TagFormValues, TagFormSelectItem, TAG_FORM_DEFAULTS; replaced FormInstance with UseFormReturn across all prop interfaces.
openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsPage.tsx Swapped antd useForm for RHF useForm; resetFields() calls replaced with reset(); no logic changes.
openmetadata-ui/src/main/resources/ui/src/components/common/MUIUserTeamSelect/MUIUserTeamSelect.tsx Deleted entirely; functionality moved into TagsForm's async fetch logic using the new Autocomplete-based components.
openmetadata-ui/src/main/resources/ui/src/utils/formUtils.tsx Removed USER_TEAM_SELECT_MUI case and its MUIUserTeamSelect import; other field type handlers unchanged.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant SaveButton as Save Button (SlideoutMenu.Footer)
    participant submitRef as submitRef.current
    participant HookForm as HookForm / RHF
    participant TagsForm
    participant API

    User->>SaveButton: click
    SaveButton->>submitRef: submitRef.current()
    submitRef->>HookForm: form.handleSubmit(handleSave)()
    HookForm->>HookForm: validate fields (required only for name — pattern rules missing)
    HookForm->>TagsForm: handleSave(formData)
    TagsForm->>TagsForm: map owners/domains to EntityReference
    TagsForm->>API: "onSubmit(CreateClassification | CreateTag)"
    API-->>TagsForm: success / error
    TagsForm-->>HookForm: resolve
    HookForm-->>HookForm: "isSubmitSuccessful = true"
    HookForm-->>TagsForm: useEffect → descriptionEditorKey++
    TagsForm-->>User: form reset / drawer closes
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User
    participant SaveButton as Save Button (SlideoutMenu.Footer)
    participant submitRef as submitRef.current
    participant HookForm as HookForm / RHF
    participant TagsForm
    participant API

    User->>SaveButton: click
    SaveButton->>submitRef: submitRef.current()
    submitRef->>HookForm: form.handleSubmit(handleSave)()
    HookForm->>HookForm: validate fields (required only for name — pattern rules missing)
    HookForm->>TagsForm: handleSave(formData)
    TagsForm->>TagsForm: map owners/domains to EntityReference
    TagsForm->>API: "onSubmit(CreateClassification | CreateTag)"
    API-->>TagsForm: success / error
    TagsForm-->>HookForm: resolve
    HookForm-->>HookForm: "isSubmitSuccessful = true"
    HookForm-->>TagsForm: useEffect → descriptionEditorKey++
    TagsForm-->>User: form reset / drawer closes
Loading

Comments Outside Diff (1)

  1. openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/tagFormFields.tsx, line 133-139 (link)

    P2 initialValue parameter accepted but silently dropped

    getDisabledField renames the initialValue parameter to _initialValue and never uses it, yet callers are still forced to pass a value. The disabled switch now reads its initial state purely from form.reset(), so the parameter can be removed from the signature. Keeping the parameter in the public API is misleading and will confuse future callers.

Reviews (2): Last reviewed commit: "lint fix" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

…tocomplete

Replace the antd Form/FormInstance pattern with react-hook-form (UseFormReturn)
and swap MUI owner/domain pickers for Autocomplete-based USER_TEAM_SELECT_INPUT
and DOMAIN_SELECT fields, following the AddDomainForm pattern exactly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Rohit0301 Rohit0301 requested a review from a team as a code owner July 6, 2026 12:09
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@Rohit0301 Rohit0301 self-assigned this Jul 6, 2026
@Rohit0301 Rohit0301 added the safe to test Add this label to run secure Github workflows on PRs label Jul 6, 2026
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

🔴 Playwright Results — 3 failure(s), 18 flaky

✅ 4044 passed · ❌ 3 failed · 🟡 18 flaky · ⏭️ 34 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 2 822 0 2 8
🟡 Shard 3 799 0 2 7
🟡 Shard 4 811 0 5 5
🔴 Shard 5 860 1 2 0
🔴 Shard 6 752 2 7 14

Genuine Failures (failed on all attempts)

Pages/ExploreBrowse.spec.ts › service type drill-down disables unrelated roots and query-panel Clear resets it (shard 5)
�[31mTest timeout of 180000ms exceeded.�[39m
Pages/Tag.spec.ts › Create tag with domain (shard 6)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: locator('#tags_name_help')
Expected: visible
Timeout: 15000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 15000ms�[22m
�[2m  - waiting for locator('#tags_name_help')�[22m

Pages/Tags.spec.ts › Classification Page (shard 6)
Error: �[2mexpect(�[22m�[31mlocator�[39m�[2m).�[22mtoBeVisible�[2m(�[22m�[2m)�[22m failed

Locator: locator('#tags_name_help')
Expected: visible
Timeout: 15000ms
Error: element(s) not found

Call log:
�[2m  - Expect "toBeVisible" with timeout 15000ms�[22m
�[2m  - waiting for locator('#tags_name_help')�[22m

🟡 18 flaky test(s) (passed on retry)
  • Features/ContextCenterPermission.spec.ts › user with deleteAll permission can see delete action but not restore action on an archived document, and can delete it (shard 2, 1 retry)
  • Features/Glossary/GlossaryRemoveOperations.spec.ts › should add and remove tags from glossary term (shard 2, 1 retry)
  • Features/IncidentManager.spec.ts › Resolving incident & re-run pipeline (shard 3, 1 retry)
  • Features/SearchExport.spec.ts › Export queues a background job and downloads from the jobs tray (shard 3, 1 retry)
  • Features/TestSuitePipelineRedeploy.spec.ts › Re-deploy all test-suite ingestion pipelines (shard 4, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Time (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Sql Query (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Hyperlink (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should perform CRUD and Removal operations for searchIndex (shard 5, 2 retries)
  • Pages/GlossaryImportExport.spec.ts › Glossary Bulk Import Export (shard 6, 1 retry)
  • Pages/GlossaryImportExport.spec.ts › Import partial success - some terms pass, some fail (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify Impact Analysis service filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for dashboardService in platform lineage (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab is NOT visible for pipelineService in platform lineage (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Admin user can get all the roles hierarchy and edit roles (shard 6, 1 retry)
  • Pages/Users.spec.ts › Admin soft & hard delete and restore user (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Comment on lines +437 to +440
const mutuallyExclusiveLabel = useMemo(
() => t('label.mutually-exclusive'),
[t]
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Edge Case: Mutually-exclusive helper alert dropped in migration

The old antd getMutuallyExclusiveField config surfaced a contextual alert (t('message.mutually-exclusive-alert-info')) whenever the toggle was switched on, warning the user about the consequence of enabling mutual exclusivity. The new inline Toggle (lines 506-522) renders only the label and no longer shows that informational message, so the useWatch on mutuallyExclusive was removed. This is a user-facing information regression rather than a functional bug. If the alert is still desired, render a HintText/alert below the toggle conditioned on field.value.

Restore the info alert shown when mutual exclusivity is enabled.:

{({ field }) => (
  <Box direction="col" gap={2}>
    <Box align="center" direction="row" gap={2}>
      <Toggle
        aria-label={mutuallyExclusiveLabel}
        data-testid="mutually-exclusive-button"
        isDisabled={disableMutuallyExclusiveField}
        isSelected={field.value ?? false}
        onBlur={field.onBlur}
        onChange={field.onChange}
      />
      <FormItemLabel label={mutuallyExclusiveLabel} />
    </Box>
    {field.value && (
      <HintText>{t('message.mutually-exclusive-alert-info')}</HintText>
    )}
  </Box>
)}
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment on lines 133 to +147
@@ -172,33 +141,29 @@ export const getDisabledField = ({
required: false,
label: 'label.disable-tag',
id: 'root/disabled',
type: FieldTypes.UT_SWITCH,
formItemLayout: FormItemLayout.HORIZONTAL,
type: FieldTypes.SWITCH,
props: {
'data-testid': 'disabled',
initialValue,
isDisabled: disabled,
disabled,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: getDisabledField requires unused initialValue param

getDisabledField still declares a required initialValue parameter but immediately discards it (initialValue: _initialValue). The SWITCH field now derives its state purely from form.reset(...), so the parameter has no effect yet all callers (TagsForm.tsx:427) are still forced to compute and pass (initialValues as Tag)?.disabled ?? false. Keeping a dead parameter in the exported signature is misleading. Remove it from the signature and the caller.

Drop the unused initialValue parameter; update the caller in TagsForm to pass only { disabled }.:

export const getDisabledField = ({
  disabled,
}: {
  disabled: boolean;
}): FieldProp => ({
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 1 resolved / 3 findings

Migrates TagsForm to React Hook Form with improved async select fields, but requires fixes for redundant form.reset() calls, incorrect import ordering, and overly permissive owner selection logic.

💡 Edge Case: Mutually-exclusive helper alert dropped in migration

📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx:437-440 📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx:506-520

The old antd getMutuallyExclusiveField config surfaced a contextual alert (t('message.mutually-exclusive-alert-info')) whenever the toggle was switched on, warning the user about the consequence of enabling mutual exclusivity. The new inline Toggle (lines 506-522) renders only the label and no longer shows that informational message, so the useWatch on mutuallyExclusive was removed. This is a user-facing information regression rather than a functional bug. If the alert is still desired, render a HintText/alert below the toggle conditioned on field.value.

Restore the info alert shown when mutual exclusivity is enabled.
{({ field }) => (
  <Box direction="col" gap={2}>
    <Box align="center" direction="row" gap={2}>
      <Toggle
        aria-label={mutuallyExclusiveLabel}
        data-testid="mutually-exclusive-button"
        isDisabled={disableMutuallyExclusiveField}
        isSelected={field.value ?? false}
        onBlur={field.onBlur}
        onChange={field.onChange}
      />
      <FormItemLabel label={mutuallyExclusiveLabel} />
    </Box>
    {field.value && (
      <HintText>{t('message.mutually-exclusive-alert-info')}</HintText>
    )}
  </Box>
)}
💡 Quality: getDisabledField requires unused initialValue param

📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/tagFormFields.tsx:133-147

getDisabledField still declares a required initialValue parameter but immediately discards it (initialValue: _initialValue). The SWITCH field now derives its state purely from form.reset(...), so the parameter has no effect yet all callers (TagsForm.tsx:427) are still forced to compute and pass (initialValues as Tag)?.disabled ?? false. Keeping a dead parameter in the exported signature is misleading. Remove it from the signature and the caller.

Drop the unused initialValue parameter; update the caller in TagsForm to pass only { disabled }.
export const getDisabledField = ({
  disabled,
}: {
  disabled: boolean;
}): FieldProp => ({
✅ 1 resolved
Bug: Create payload includes extraneous id:'' from form defaults

📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx:327-331 📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx:303-317 📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsPage.interface.ts:56-63 📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsPage.tsx:82-85 📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsPage.tsx:374-379 📄 openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsPage.tsx:216-218
handleSave builds the submit payload with const submitData = { ...formData, owners, domains }. Because both forms are initialized with TAG_FORM_DEFAULTS, which sets id: '', formData.id is '' in create mode and is spread into submitData. This object is passed unchanged to createTag(...) / createClassification(...).

The generated CreateTag and CreateClassification interfaces have no id field, so id: '' is an extraneous property. The previous antd implementation only submitted registered Form.Item values, so no id was ever sent — this is a behavior regression. Sending id: '' risks a server-side validation error (empty string parsed as a UUID) or a silently created entity with an unexpected id, depending on backend leniency. Edit/patch flows are unaffected because convertToTagFormValues populates the real id and compare() produces no diff.

Strip id (and any other non-payload fields) before submitting in create mode.

🤖 Prompt for agents
Code Review: Migrates `TagsForm` to React Hook Form with improved async select fields, but requires fixes for redundant `form.reset()` calls, incorrect import ordering, and overly permissive owner selection logic.

1. 💡 Edge Case: Mutually-exclusive helper alert dropped in migration
   Files: openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx:437-440, openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/TagsForm.tsx:506-520

   The old antd `getMutuallyExclusiveField` config surfaced a contextual alert (`t('message.mutually-exclusive-alert-info')`) whenever the toggle was switched on, warning the user about the consequence of enabling mutual exclusivity. The new inline `Toggle` (lines 506-522) renders only the label and no longer shows that informational message, so the `useWatch` on `mutuallyExclusive` was removed. This is a user-facing information regression rather than a functional bug. If the alert is still desired, render a `HintText`/alert below the toggle conditioned on `field.value`.

   Fix (Restore the info alert shown when mutual exclusivity is enabled.):
   {({ field }) => (
     <Box direction="col" gap={2}>
       <Box align="center" direction="row" gap={2}>
         <Toggle
           aria-label={mutuallyExclusiveLabel}
           data-testid="mutually-exclusive-button"
           isDisabled={disableMutuallyExclusiveField}
           isSelected={field.value ?? false}
           onBlur={field.onBlur}
           onChange={field.onChange}
         />
         <FormItemLabel label={mutuallyExclusiveLabel} />
       </Box>
       {field.value && (
         <HintText>{t('message.mutually-exclusive-alert-info')}</HintText>
       )}
     </Box>
   )}

2. 💡 Quality: getDisabledField requires unused initialValue param
   Files: openmetadata-ui/src/main/resources/ui/src/pages/TagsPage/tagFormFields.tsx:133-147

   `getDisabledField` still declares a required `initialValue` parameter but immediately discards it (`initialValue: _initialValue`). The SWITCH field now derives its state purely from `form.reset(...)`, so the parameter has no effect yet all callers (TagsForm.tsx:427) are still forced to compute and pass `(initialValues as Tag)?.disabled ?? false`. Keeping a dead parameter in the exported signature is misleading. Remove it from the signature and the caller.

   Fix (Drop the unused initialValue parameter; update the caller in TagsForm to pass only { disabled }.):
   export const getDisabledField = ({
     disabled,
   }: {
     disabled: boolean;
   }): FieldProp => ({

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Comment on lines 346 to 354
const nameField = useMemo(() => {
const field = getNameField(disableNameField || false);

return {
...field,
muiLabel: t(field.muiLabel),
placeholder: t(field.placeholder),
rules: TAG_NAME_VALIDATION_RULES.map((rule) => ({
...rule,
message: rule.message
? t(rule.message, {
...rule.messageData,
field: rule.messageData?.field
? t(rule.messageData.field)
: undefined,
entity: rule.messageData?.entity
? t(rule.messageData.entity)
: undefined,
})
: undefined,
})),
label: t(field.label as string),
placeholder: t(field.placeholder ?? ''),
};
}, [t, disableNameField]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Name field validation rules dropped

The old code explicitly applied TAG_NAME_VALIDATION_RULES to the name field — which enforced NAME_LENGTH_REGEX (2–64 chars) and TAG_NAME_REGEX (no disallowed characters). The new nameField memo no longer attaches any pattern rules, so a user can now create a tag or classification with a one-character name, a 200-character name, or a name containing characters that fail backend validation. The backend will likely reject these, but the error surface shifts from a clear inline form message to a raw API error toast.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.59% (72460/113948) 46.7% (42095/90132) 48.01% (12959/26989)

@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant