Skip to content

Conversation

@djechlin-mongodb
Copy link
Contributor

@djechlin-mongodb djechlin-mongodb commented Nov 11, 2024

Description

Checklist

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions bot added the fix label Nov 11, 2024
@djechlin-mongodb djechlin-mongodb added the no release notes Fix or feature not for release notes label Nov 11, 2024
>
<Icon
glyph="ImportantWithCircle"
glyph={showWarning ? 'Warning' : 'ImportantWithCircle'}
Copy link
Collaborator

Choose a reason for hiding this comment

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

The other way around :) I know it's confusing, but we want it to match the banner icon
Screenshot 2024-11-12 at 18 10 07
Screenshot 2024-11-12 at 18 15 34

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

<Icon
glyph="ImportantWithCircle"
glyph={showWarning ? 'Warning' : 'ImportantWithCircle'}
aria-label="warning"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we make this message and the color of the icon variable as well?

Copy link
Contributor Author

@djechlin-mongodb djechlin-mongodb Nov 12, 2024

Choose a reason for hiding this comment

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

Is this what you mean?

Error:
image

Warning:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Code quality question, it seems weird that the properties of the Icon are so coupled to each other, should we just pull out a WarningIcon and ErrorIcon or something pre-parameterized? Does this pattern come up a lot in compass?

Copy link
Collaborator

Choose a reason for hiding this comment

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

You're right, with this many differences it makes sense to move the icons into their own function components so that the main render is more readable. And yes that's a common pattern, not only in compass. If your question is more towards reusable components in Compass, check the compass-components package. But I wouldn't put these in there as the warning = ImportantWithcircle and error = Warning is a bit odd. I'd just keep them in the same file.

@djechlin-mongodb djechlin-mongodb marked this pull request as ready for review November 12, 2024 19:33
@djechlin-mongodb
Copy link
Contributor Author

Reviewed with Paula this morning - we think this is LGTM once Paula's refactor PR is in. And that PR makes this one easier to merge so it's better to wait.

Copy link
Collaborator

@paula-stacho paula-stacho left a comment

Choose a reason for hiding this comment

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

The last detail - the colors are the other way around 😅 Otherwise looks great!

@djechlin-mongodb djechlin-mongodb merged commit 7116409 into main Nov 19, 2024
22 of 24 checks passed
@djechlin-mongodb djechlin-mongodb deleted the COMPASS-8451 branch November 19, 2024 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix no release notes Fix or feature not for release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants