Skip to content

Conversation

@AishDani
Copy link
Contributor

…et correctly and improving type matching in the ContentMapper component.

…et correctly and improving type matching in the ContentMapper component.
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 refactors content mapping logic in two files: it extracts type matching logic into a reusable variable in the ContentMapper UI component, and ensures the safeField.id is properly set in the API service.

Changes:

  • Extracted type matching logic into isTypeMatch variable using checkConditions() function for better code reusability
  • Replaced direct field type comparisons with semantic matching via checkConditions()
  • Added explicit assignment of id to safeField object in the API service to ensure the field is properly set

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
ui/src/components/ContentMapper/index.tsx Refactored type matching logic by extracting it into an isTypeMatch variable and using it in both the value and isClearable props of the Select component
api/src/services/contentMapper.service.ts Added explicit assignment of id to safeField to ensure the field is correctly set before being used in the returned object

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

@sayalijoshi27 sayalijoshi27 merged commit 71ba021 into dev Jan 19, 2026
7 checks passed
@sayalijoshi27 sayalijoshi27 deleted the bugfix/cmg-788 branch January 19, 2026 13:35
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.

3 participants