Skip to content

Conversation

@jvega190
Copy link
Member

@jvega190 jvega190 commented Oct 24, 2025

Update to tokenized prop name in descriptors and in serializer. In legacy system the prop name is tokenize, and when saving into html the property is tokenized. Updated to match legacy.

craftercms/craftercms#7418

Summary by CodeRabbit

  • Refactor
    • Renamed the tokenization option from "Tokenized" to "Tokenize" across content-type controls and serializers.
    • Consolidated common field options (readonly, required, tokenize) for consistent UI presentation and validation.
    • Preserved labels and behavior so indexing hints and form behavior remain unchanged for end users.

✏️ Tip: You can customize this high-level summary in your review settings.

@jvega190 jvega190 requested a review from rart as a code owner October 24, 2025 23:00
@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2025

Walkthrough

Centralized common field descriptors into a new commonDescriptors.ts, replaced many inline boolean/flag field definitions with commonFieldPropertiesDescriptors references, and renamed the field key tokenizedtokenize across descriptors and the FormsEngine XML serializer.

Changes

Cohort / File(s) Summary
New shared descriptors
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts
Added a new module exporting shared sections and descriptor maps including commonFieldPropertiesDescriptors (defines tokenize, readonly, required) and commonControlFieldsDescriptors.
Tokenize rename & descriptor updates
ui/app/src/components/ContentTypeManagement/descriptors/controls/{input,internalName,linkInput,numericInput}.ts
Renamed tokenizedtokenize in sections and fields; replaced inline tokenization/readonly/required definitions with `commonFieldPropertiesDescriptors['tokenize'
Descriptor files switching to shared descriptors
ui/app/src/components/ContentTypeManagement/descriptors/controls/{awsFileUpload,checkbox,checkboxGroup,dateTime,disabled,dropdown,fileName,forceHttps,imagePicker,linkTextarea,linkedDropdown,localeSelector,nodeSelector,pageNavOrder,rte,textarea,time,transcodedVideoPicker,videoPicker,...}
Replaced many inline readonly/required (and similar) field definitions with references to `commonFieldPropertiesDescriptors['readonly'
Removed exports from controls index
ui/app/src/components/ContentTypeManagement/descriptors/controls/index.ts
Removed previously-exported shared descriptors/sections (moved to commonDescriptors.ts); left controlDescriptors mapping intact.
Import path updates in views/util
ui/app/src/components/ContentTypeManagement/{components/EditTypeView.tsx,components/TypeDetailsView.tsx,utils.ts}
Updated imports to source moved symbols from ./descriptors/controls/commonDescriptors instead of ./descriptors/controls.
Forms engine serializer update
ui/app/src/components/FormsEngine/lib/valueSerializers.ts
Updated runtime check from field.properties.tokenized.valuefield.properties.tokenize.value so serialization reads the renamed property while still emitting the same XML attribute key.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • rart
  • sumerjabri

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description explains the purpose and rationale but is minimal and does not follow the provided template which requests a ticket reference or full description. Consider expanding the description to follow the template structure and provide more context about the implementation approach and scope of changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically references the main change: updating the tokenized property name across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 14297db and 6128514.

📒 Files selected for processing (28)
  • ui/app/src/components/ContentTypeManagement/components/EditTypeView.tsx
  • ui/app/src/components/ContentTypeManagement/components/TypeDetailsView.tsx
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/awsFileUpload.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/checkbox.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/checkboxGroup.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/dateTime.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/disabled.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/dropdown.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/fileName.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/forceHttps.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/imagePicker.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/index.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/input.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/internalName.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/linkInput.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/linkTextarea.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/linkedDropdown.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/localeSelector.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/nodeSelector.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/numericInput.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/pageNavOrder.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/rte.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/textarea.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/time.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/transcodedVideoPicker.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/videoPicker.ts
  • ui/app/src/components/ContentTypeManagement/utils.ts
✅ Files skipped from review due to trivial changes (1)
  • ui/app/src/components/ContentTypeManagement/components/EditTypeView.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/numericInput.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/internalName.ts
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: jvega190
Repo: craftercms/studio-ui PR: 4451
File: ui/app/src/components/ContentTypeManagement/utils.ts:253-264
Timestamp: 2025-08-27T23:08:05.012Z
Learning: In the ContentTypeManagement utils.ts reverseTypeFieldValuesObject function, properties that are not available in the descriptor values should be removed/cleaned up, not preserved. This keeps the field configuration in sync with the current descriptor definitions and prevents accumulation of obsolete properties.
📚 Learning: 2025-08-27T23:08:05.012Z
Learnt from: jvega190
Repo: craftercms/studio-ui PR: 4451
File: ui/app/src/components/ContentTypeManagement/utils.ts:253-264
Timestamp: 2025-08-27T23:08:05.012Z
Learning: In the ContentTypeManagement utils.ts reverseTypeFieldValuesObject function, properties that are not available in the descriptor values should be removed/cleaned up, not preserved. This keeps the field configuration in sync with the current descriptor definitions and prevents accumulation of obsolete properties.

Applied to files:

  • ui/app/src/components/ContentTypeManagement/descriptors/controls/checkbox.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/nodeSelector.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/input.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/dropdown.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/videoPicker.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/pageNavOrder.ts
  • ui/app/src/components/ContentTypeManagement/components/TypeDetailsView.tsx
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/linkInput.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/time.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/imagePicker.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/checkboxGroup.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/fileName.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/linkTextarea.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/transcodedVideoPicker.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/dateTime.ts
  • ui/app/src/components/ContentTypeManagement/utils.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/awsFileUpload.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/rte.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/index.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/localeSelector.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/disabled.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/textarea.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/linkedDropdown.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/forceHttps.ts
📚 Learning: 2025-10-22T17:00:22.544Z
Learnt from: jvega190
Repo: craftercms/studio-ui PR: 4658
File: ui/app/src/components/FormsEngine/controls/Checkbox.tsx:21-21
Timestamp: 2025-10-22T17:00:22.544Z
Learning: In the CrafterCMS Studio UI forms engine, ContentTypeField properties with type='boolean' are converted from strings to actual boolean values during ContentType parsing in contentTypes.ts (lines 274-278). Therefore, properties like 'readonly' with type='boolean' will have boolean values, not string values, at runtime.

Applied to files:

  • ui/app/src/components/ContentTypeManagement/descriptors/controls/checkbox.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/checkboxGroup.ts
📚 Learning: 2025-12-11T21:19:00.860Z
Learnt from: jvega190
Repo: craftercms/studio-ui PR: 4708
File: ui/app/src/components/PreviewAudiencesPanel/PreviewAudiencesPanel.tsx:72-74
Timestamp: 2025-12-11T21:19:00.860Z
Learning: The EmptyState component's title prop in ui/app/src/components/EmptyState accepts type `ReactNode | MessageDescriptor`, allowing both React elements like <FormattedMessage> and MessageDescriptor objects to be passed.

Applied to files:

  • ui/app/src/components/ContentTypeManagement/descriptors/controls/checkbox.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/nodeSelector.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/input.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/pageNavOrder.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/linkInput.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/time.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/linkTextarea.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/localeSelector.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/disabled.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/textarea.ts
📚 Learning: 2025-10-16T16:09:27.232Z
Learnt from: jvega190
Repo: craftercms/studio-ui PR: 4663
File: ui/app/src/components/FormsEngine/controls/NodeSelector.tsx:0-0
Timestamp: 2025-10-16T16:09:27.232Z
Learning: In the NodeSelector component (ui/app/src/components/FormsEngine/controls/NodeSelector.tsx), when looking up items in itemsByPath, use value[index].key rather than value[index].include. For embedded components, the key is used since they never reach handleViewItem (they're always editable). For shared components/assets, key and include are the same path, so key works correctly for the lookup.

Applied to files:

  • ui/app/src/components/ContentTypeManagement/descriptors/controls/nodeSelector.ts
  • ui/app/src/components/ContentTypeManagement/components/TypeDetailsView.tsx
📚 Learning: 2025-09-23T15:24:08.254Z
Learnt from: rart
Repo: craftercms/studio-ui PR: 0
File: :0-0
Timestamp: 2025-09-23T15:24:08.254Z
Learning: In SectionAccordion.tsx, the AccordionSummary component should have data-section-id={section.id} (not section.title) to match what TableOfContents click handlers expect to find. The section.id is the unique identifier while section.title is the display text.

Applied to files:

  • ui/app/src/components/ContentTypeManagement/components/TypeDetailsView.tsx
📚 Learning: 2025-12-11T21:18:51.227Z
Learnt from: jvega190
Repo: craftercms/studio-ui PR: 4708
File: ui/app/src/components/PreviewAudiencesPanel/PreviewAudiencesPanel.tsx:72-74
Timestamp: 2025-12-11T21:18:51.227Z
Learning: When reviewing components in ui/app/src/components, verify that props expecting a title (e.g., EmptyState) allow ReactNode or MessageDescriptor (e.g., React elements like FormattedMessage and MessageDescriptor objects). Ensure TS types reflect ReactNode | MessageDescriptor where appropriate, and audit usages to avoid passing incompatible values. Update tests or PropTypes/TypeScript types as needed to maintain correct typing and rendering behavior.

Applied to files:

  • ui/app/src/components/ContentTypeManagement/components/TypeDetailsView.tsx
📚 Learning: 2025-10-24T18:12:08.208Z
Learnt from: jvega190
Repo: craftercms/studio-ui PR: 4648
File: ui/app/src/components/FormsEngine/controls/Time.tsx:57-69
Timestamp: 2025-10-24T18:12:08.208Z
Learning: The Time control in ui/app/src/components/FormsEngine/controls/Time.tsx does not have an `allowPastDate` property in its descriptor, unlike the DateTime control. This is an intentional design difference between the two controls.

Applied to files:

  • ui/app/src/components/ContentTypeManagement/descriptors/controls/time.ts
  • ui/app/src/components/ContentTypeManagement/descriptors/controls/dateTime.ts
🧬 Code graph analysis (20)
ui/app/src/components/ContentTypeManagement/descriptors/controls/checkbox.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/nodeSelector.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/input.ts (2)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/utils/object.ts (1)
  • immutableEmptyObject (282-282)
ui/app/src/components/ContentTypeManagement/descriptors/controls/dropdown.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/videoPicker.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/pageNavOrder.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/linkInput.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/imagePicker.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/checkboxGroup.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/fileName.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/linkTextarea.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/transcodedVideoPicker.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/dateTime.ts (2)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/utils/object.ts (1)
  • immutableEmptyObject (282-282)
ui/app/src/components/ContentTypeManagement/descriptors/controls/awsFileUpload.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/rte.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/localeSelector.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/disabled.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/components/ContentTypeManagement/descriptors/controls/textarea.ts (2)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/utils/object.ts (1)
  • immutableEmptyObject (282-282)
ui/app/src/components/ContentTypeManagement/descriptors/controls/linkedDropdown.ts (2)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
ui/app/src/utils/object.ts (1)
  • immutableEmptyObject (282-282)
ui/app/src/components/ContentTypeManagement/descriptors/controls/forceHttps.ts (1)
ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (1)
  • commonFieldPropertiesDescriptors (121-143)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Travis CI - Pull Request
🔇 Additional comments (27)
ui/app/src/components/ContentTypeManagement/descriptors/controls/index.ts (1)

18-77: LGTM! Clean refactoring to centralize descriptors.

The removal of multiple descriptor exports and simplification of imports aligns with the centralization strategy. The controlDescriptors map remains intact and functional.

ui/app/src/components/ContentTypeManagement/components/TypeDetailsView.tsx (1)

43-43: LGTM! Import path correctly updated.

The import path change reflects the new centralized descriptor module structure.

ui/app/src/components/ContentTypeManagement/descriptors/controls/nodeSelector.ts (1)

20-20: LGTM! Consistent migration to shared descriptors.

The readonly field now correctly references the centralized descriptor definition, maintaining consistency with other controls.

Also applies to: 62-62

ui/app/src/components/ContentTypeManagement/utils.ts (1)

58-58: LGTM! Import path correctly updated.

The import source change aligns with the centralized descriptor module structure. Both commonControlFieldsDescriptors and defaultDataSourcesSection are used correctly throughout the file.

ui/app/src/components/ContentTypeManagement/descriptors/controls/rte.ts (1)

20-20: LGTM! Consistent migration to shared descriptors.

The required field now correctly references the centralized descriptor definition, eliminating duplication.

Also applies to: 112-112

ui/app/src/components/ContentTypeManagement/descriptors/controls/awsFileUpload.ts (1)

20-20: LGTM! Consistent migration to shared descriptors.

The required field now correctly references the centralized descriptor definition.

Also applies to: 46-46

ui/app/src/components/ContentTypeManagement/descriptors/controls/checkboxGroup.ts (1)

20-20: LGTM! Consistent migration to shared descriptors.

The readonly field now correctly references the centralized descriptor definition.

Also applies to: 73-73

ui/app/src/components/ContentTypeManagement/descriptors/controls/checkbox.ts (1)

19-19: LGTM! Consistent migration to shared descriptors.

Both readonly and required fields now correctly reference the centralized descriptor definitions, completing the refactoring pattern seen across all controls.

Also applies to: 38-39

ui/app/src/components/ContentTypeManagement/descriptors/controls/pageNavOrder.ts (1)

19-19: LGTM! Centralized field descriptors improve maintainability.

The refactor eliminates inline field definitions in favor of shared descriptors from commonDescriptors.ts, following DRY principles while preserving the original semantics.

Also applies to: 38-39

ui/app/src/components/ContentTypeManagement/descriptors/controls/fileName.ts (1)

20-20: LGTM! Consistent with the centralization effort.

The readonly field now references the shared descriptor while field-specific properties (maxlength, allowEditWithoutWarning) appropriately remain inline.

Also applies to: 41-41

ui/app/src/components/ContentTypeManagement/descriptors/controls/linkedDropdown.ts (1)

20-20: LGTM! Proper use of shared descriptors.

The refactor correctly moves common fields (readonly, required) to shared descriptors while keeping control-specific fields inline.

Also applies to: 55-55, 63-63

ui/app/src/components/ContentTypeManagement/descriptors/controls/input.ts (2)

20-20: LGTM! Centralized descriptors reduce duplication.

The refactor consolidates readonly, tokenize, and required fields to shared descriptors from commonDescriptors.ts.

Also applies to: 46-46, 55-55


30-30: Property rename applied correctly with proper serializer handling.

The field name change from tokenized to tokenize (lines 30, 47) is correctly implemented in the descriptors, and the serializer properly handles the conversion: it reads from field?.properties?.tokenize?.value and outputs the legacy tokenized attribute for XML serialization. This aligns with the PR objective to match the legacy system naming convention.

ui/app/src/components/ContentTypeManagement/descriptors/controls/forceHttps.ts (1)

19-19: LGTM! Consistent refactor.

The readonly field now uses the shared descriptor, maintaining consistency with other control descriptors.

Also applies to: 33-33

ui/app/src/components/ContentTypeManagement/descriptors/controls/imagePicker.ts (1)

20-20: LGTM! Appropriate use of shared descriptors.

Common fields (readonly, required) now reference shared descriptors while image-specific properties remain inline.

Also applies to: 76-77

ui/app/src/components/ContentTypeManagement/descriptors/controls/dateTime.ts (1)

20-20: LGTM! Clean refactor to shared descriptors.

The change consolidates common fields while preserving DateTime-specific properties inline, maintaining good separation of concerns.

Also applies to: 106-106, 114-114

ui/app/src/components/ContentTypeManagement/descriptors/controls/disabled.ts (1)

19-19: LGTM! Consistent with the centralization effort.

The readonly field now uses the shared descriptor, aligning with the project-wide refactor.

Also applies to: 34-34

ui/app/src/components/ContentTypeManagement/descriptors/controls/textarea.ts (1)

20-20: LGTM! Clean refactoring to centralized descriptors.

The migration from inline field definitions to shared descriptors from commonFieldPropertiesDescriptors reduces code duplication and improves maintainability. The field references are correct and consistent with the broader refactoring pattern across multiple descriptor files.

Also applies to: 60-60, 68-68

ui/app/src/components/ContentTypeManagement/descriptors/controls/transcodedVideoPicker.ts (1)

19-19: LGTM! Consistent refactoring to shared descriptors.

The changes align with the centralization effort, replacing inline definitions for readonly and required with references to commonFieldPropertiesDescriptors. The removal of the immutableEmptyObject import is appropriate since these fields no longer define inline validations.

Also applies to: 47-48

ui/app/src/components/ContentTypeManagement/descriptors/controls/localeSelector.ts (1)

19-19: LGTM! Refactoring aligns with centralized descriptor pattern.

The changes consistently replace inline field definitions with shared descriptor references, maintaining the same logical structure while improving code reuse.

Also applies to: 38-39

ui/app/src/components/ContentTypeManagement/descriptors/controls/time.ts (1)

20-20: LGTM! Selective migration to shared descriptors.

The refactoring appropriately migrates readonly and required fields to centralized descriptors while keeping immutableEmptyObject for other field-specific validations. This selective approach is correct.

Also applies to: 82-82, 90-90

ui/app/src/components/ContentTypeManagement/descriptors/controls/linkTextarea.ts (1)

20-20: LGTM! Refactoring maintains consistency.

The changes follow the established pattern of centralizing common field descriptors while preserving inline definitions for control-specific fields.

Also applies to: 60-61

ui/app/src/components/ContentTypeManagement/descriptors/controls/videoPicker.ts (1)

3-3: LGTM! Clean refactoring with appropriate import cleanup.

The changes consistently migrate to shared descriptors, and the removal of the immutableEmptyObject import is correct since no other fields in this descriptor require it.

Also applies to: 31-32

ui/app/src/components/ContentTypeManagement/descriptors/controls/dropdown.ts (1)

20-20: LGTM! Refactoring follows established pattern.

The changes consistently centralize readonly and required field descriptors while appropriately retaining inline definitions for control-specific fields like emptyvalue.

Also applies to: 55-56

ui/app/src/components/ContentTypeManagement/descriptors/controls/linkInput.ts (1)

20-20: LGTM! Centralization with tokenize field rename per PR objectives.

The refactoring migrates readonly, tokenize, and required to shared descriptors. Notably, line 30 renames the field from tokenized to tokenize to match the legacy system's property name, which aligns with the PR's stated objective of updating the tokenized prop name.

Also applies to: 30-30, 46-48

ui/app/src/components/ContentTypeManagement/descriptors/controls/commonDescriptors.ts (2)

1-365: LGTM: Well-structured centralization of common descriptors.

The file successfully consolidates reusable descriptor definitions with proper TypeScript typing, consistent i18n usage via defineMessage, and appropriate validation patterns. The separation into distinct exports (system fields, control fields, field properties, type details, section details) provides a clean, maintainable API for consuming components.


122-128: Migration from tokenized to tokenize is complete and correctly implemented.

The descriptor property is correctly named tokenize in commonDescriptors.ts (line 122). The FormsEngine serializer properly converts this to the HTML attribute tokenized when persisting (valueSerializers.ts lines 117-118). No residual tokenized references remain in descriptor files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@rart rart left a comment

Choose a reason for hiding this comment

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

Can we refactor tokenize and possible other common control props for reuse? Perhaps export them out of the common control props file?

…o 7418-tokenized

# Conflicts:
#	ui/app/src/components/ContentTypeManagement/descriptors/controls/input.ts
#	ui/app/src/components/ContentTypeManagement/descriptors/controls/internalName.ts
#	ui/app/src/components/ContentTypeManagement/descriptors/controls/linkInput.ts
#	ui/app/src/components/ContentTypeManagement/descriptors/controls/numericInput.ts
@jvega190 jvega190 requested a review from rart December 23, 2025 14:58
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