Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compass-global-writes): show error on all invalid statuses COMPASS-8451 #6472

Merged
merged 19 commits into from
Nov 19, 2024

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
@@ -49,7 +55,7 @@ export const PluginTitle = ({ showWarning }: { showWarning: boolean }) => {
}}
>
<Icon
glyph="ImportantWithCircle"
glyph={showWarning ? 'Warning' : 'ImportantWithCircle'}
Copy link
Contributor

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!

@@ -49,7 +55,7 @@ export const PluginTitle = ({ showWarning }: { showWarning: boolean }) => {
}}
>
<Icon
glyph="ImportantWithCircle"
glyph={showWarning ? 'Warning' : 'ImportantWithCircle'}
aria-label="warning"
Copy link
Contributor

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
Contributor

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
Contributor

@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.

2 participants