Skip to content

Conversation

@siddhant1
Copy link
Member

@siddhant1 siddhant1 commented Dec 31, 2025

Describe your changes:

Fixes

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • 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.

Summary by Gitar

  • Component migration:
    • Replaced StyleModal (Ant Design) with IconColorModal (MUI) in DomainDetails.component.tsx
  • Cover image support:
    • Added optional includeCoverImage prop to IconColorModal for conditional cover image upload field
  • Architecture improvement:
    • Uses prop-based feature flagging instead of runtime app detection for cleaner component design
  • Data transformation:
    • Handles cover image position format conversion from nested {y: "50%"} to flat string "50%" for API compatibility

This will update automatically on new commits.


@github-actions
Copy link
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!

@github-actions
Copy link
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!

@github-actions
Copy link
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!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

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!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

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!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

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!

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

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!

@gitar-bot
Copy link

gitar-bot bot commented Jan 5, 2026

Code Review ⚠️ Changes requested

Well-structured refactor to add cover image support for domain updates. One important issue with potential missing error rethrow in the new utility function's catch block.

⚠️ Edge Case: Missing error rethrow in updateEntityWithCoverImage catch block

📄 openmetadata-ui/src/main/resources/ui/src/utils/CoverImageUploadUtils.tsx:382-391

The updateEntityWithCoverImage function's catch block shows an error notification but the diff is truncated. Comparing with createEntityWithCoverImage (line 278-286), it includes throw error; after showing the notification. Ensure the new function also rethrows the error after the showNotistackError call to maintain consistent error propagation behavior.

If the error is not rethrown, callers won't know the operation failed and may proceed as if it succeeded. The inner upload error correctly throws (line 373), but the outer catch block at the end needs to also throw.

Suggested fix: Verify the catch block ends with throw error; similar to the existing createEntityWithCoverImage function.

More details 💡 1 suggestion ✅ 4 resolved
💡 Code Quality: Redundant null check in coverImage position condition

📄 openmetadata-ui/src/main/resources/ui/src/utils/CoverImageUploadUtils.tsx:400-406

In the style object construction (lines 400-410), the condition coverImagePosition !== undefined && coverImagePosition !== null includes a redundant null check. Since coverImagePosition is typed as string | undefined (line 351), it cannot be null.

Current code:

...(coverImagePosition !== undefined &&
  coverImagePosition !== null && {
    position: coverImagePosition,
  }),

Suggested fix:

...(coverImagePosition !== undefined && {
  position: coverImagePosition,
}),

This is minor but improves code clarity by aligning the condition with the type.

Edge Case: coverImage may be created with position but no URL

📄 openmetadata-ui/src/main/resources/ui/src/utils/CoverImageUploadUtils.tsx:384-392
The condition if (coverImageUrl || coverImagePosition) allows creating a coverImage object with only a position property when coverImageUrl is undefined but coverImagePosition has a value:\n\ntypescript\nif (coverImageUrl || coverImagePosition) {\n updatedStyle.coverImage = {\n ...(coverImageUrl && { url: coverImageUrl }),\n ...(coverImagePosition && { position: coverImagePosition }),\n };\n}\n\n\nA cover image with only a position and no URL is likely invalid and could cause rendering issues.\n\nSuggested fix: Require coverImageUrl to be present when setting a cover image:\ntypescript\nif (coverImageUrl) {\n updatedStyle.coverImage = {\n url: coverImageUrl,\n ...(coverImagePosition && { position: coverImagePosition }),\n };\n}\n

Bug: Potential type mismatch in coverImage position transformation

📄 openmetadata-ui/src/main/resources/ui/src/components/Modals/IconColorModal/IconColorModal.tsx:122-125
The cover image position transformation logic may have a type inconsistency:

position: style.coverImage.position
  ? { y: style.coverImage.position }
  : undefined,

This wraps style.coverImage.position in { y: ... }. If the source position is already an object like { y: number }, this creates nested objects { y: { y: number } }. If position is a raw number representing the Y offset, the transformation is correct.

Impact: This could cause the cover image position to be improperly initialized when editing an existing style, leading to incorrect cover image positioning or runtime errors.

Suggested fix: Verify the type definition of Style.coverImage.position and ensure consistent transformation:

position: style.coverImage.position
  ? (typeof style.coverImage.position === 'number' 
      ? { y: style.coverImage.position } 
      : style.coverImage.position)
  : undefined,

Or if position is always a number in the API response, add a clarifying comment.

Code Quality: Debug console.log left in production code

📄 openmetadata-ui/src/main/resources/ui/src/components/Modals/IconColorModal/IconColorModal.tsx:114
A console.log(values) statement is left in the handleSubmit function. This should be removed before merging to avoid polluting the console in production.

const handleSubmit = async (values: Style & { coverImage?: unknown }) => {
  try {
    setSaving(true);
    console.log(values);  // <-- Remove this
Code Quality: Debug console.log statement left in production code

📄 openmetadata-ui/src/main/resources/ui/src/components/Modals/IconColorModal/IconColorModal.tsx:52
A debug console.log('style', style) statement is present at line 52. This appears to be leftover debugging code that should be removed before merging.

Impact: Debug logs in production can expose internal data to browser console, clutter logs, and indicate incomplete code review.

Suggested fix: Remove the console.log statement:

-  console.log('style', style);

What Works Well

Clean abstraction with the new updateEntityWithCoverImage utility that mirrors the existing createEntityWithCoverImage pattern. Good handling of various cover image states (new file upload, existing URL preservation, no cover image).

Recommendations

The previous review flagged a debug console.log statement at line 358 that doesn't appear to be addressed in this diff. Consider removing it if still present.

Options

Auto-apply is off Gitar will not commit updates to this branch.
✅ Code review is on Gitar will review this change.
Display: compact Hiding non-applicable rules.

Comment with these commands to change:

Auto-apply ✅ Code review Compact
gitar auto-apply:on         
gitar code-review:off         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | This comment will update automatically (Docs)

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