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

chore: refactor Alert-related components #31858

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Jan 15, 2025

Chiseling at #31590 that has gotten big / unruly, in this PR is a refactor of Alert-related components, going vanilla AntD.

Also here. Deprecating colors.alerts since it's ambiguous/redundant with warning/error and does not exist in antd-v5

Screenshot 2025-01-14 at 11 42 05 PM Screenshot 2025-01-14 at 11 41 47 PM

Copy link

korbit-ai bot commented Jan 15, 2025

Korbit doesn't automatically review large (500+ lines changed) pull requests such as this one. If you want me to review anyway, use /korbit-review.

@dosubot dosubot bot added the alert-reports Namespace | Anything related to the Alert & Reports feature label Jan 15, 2025
@geido
Copy link
Member

geido commented Jan 15, 2025

From some functional testing:

  • A bit of an edge case but the error looks like it is not correctly padded in full page width
Screenshot 2025-01-15 at 17 26 57
  • Is a chart failure considered a warning?
Screenshot 2025-01-15 at 17 28 55
  • Same, for a chart in Explore. I am thinking these should probably be errors.
Screenshot 2025-01-15 at 17 30 49
  • The positioning of the icon on the left of the text looks off.

  • In general, the text color of these alerts seem to stick out a bit too much. I know we want be as vanilla as possible but I'd like to hear @kasiazjc opinion too.

component: ErrorAlert,
} as Meta;

export const Gallery: StoryFn = () => (
Copy link
Member

Choose a reason for hiding this comment

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

This is not coming with this PR but I find it odd that an ErrorAlert can be of type info or warning. Naming here could probably be improved.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, maybe limiting to warning/error here makes more sense here. I think there may be one or two edge cases where ErrorAlert is used to info, maybe cause someone wanted some of the features in here. We should probably change those to use a normal Alert

title: ReactNode;
description?: string;
import { useState } from 'react';
import { Modal, Tooltip } from 'antd';
Copy link
Member

Choose a reason for hiding this comment

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

Why importing from antd directly? From one side this is the previous version of antd and on the other hand, I think we said to import components from our wrappers not from antd directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

ooops. We really need a lint rule to catch this...

@justinpark justinpark self-requested a review January 15, 2025 18:25
@@ -56,15 +56,6 @@ const baseConfig: ThemeConfig = {
zIndexPopupBase: supersetTheme.zIndex.max,
},
components: {
Alert: {
Copy link
Member Author

Choose a reason for hiding this comment

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

Let's go vanilla!

@github-actions github-actions bot added the doc Namespace | Anything related to documentation label Jan 16, 2025
@github-actions github-actions bot removed the doc Namespace | Anything related to documentation label Jan 16, 2025
@mistercrunch mistercrunch force-pushed the alerts_refactor branch 2 times, most recently from d5cc420 to c5c85ea Compare January 18, 2025 00:01
mistercrunch and others added 11 commits January 17, 2025 16:20
Chiseling at #31590 that has gotten big / unruly, in this PR is a refactor of Alert-related components, going vanilla AntD.

Also. Deprecating colors.alerts since it's ambiguous/redundant with warning/error and does not exist in antd-v5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alert-reports Namespace | Anything related to the Alert & Reports feature packages plugins preset-io size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants