-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
base: master
Are you sure you want to change the base?
Conversation
Korbit doesn't automatically review large (500+ lines changed) pull requests such as this one. If you want me to review anyway, use |
superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/components/ErrorMessage/InvalidSQLErrorMessage.test.tsx
Outdated
Show resolved
Hide resolved
From some functional testing:
|
component: ErrorAlert, | ||
} as Meta; | ||
|
||
export const Gallery: StoryFn = () => ( |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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...
@@ -56,15 +56,6 @@ const baseConfig: ThemeConfig = { | |||
zIndexPopupBase: supersetTheme.zIndex.max, | |||
}, | |||
components: { | |||
Alert: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go vanilla!
2b87057
to
2eb9330
Compare
c5c85ea
to
b96705d
Compare
219ef36
to
40bad64
Compare
40bad64
to
272e0b0
Compare
/testenv up |
@sadpandajoe Processing your ephemeral environment request here. |
@kasiazjc hoping to spin up an ephemeral for you to get a pass on this if you have time. |
@sadpandajoe Ephemeral environment spinning up at http://54.149.181.65:8080. Credentials are |
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
272e0b0
to
37768e7
Compare
) | ||
} | ||
closeIcon={closable && <Icons.XSmall aria-label="close icon" />} | ||
closeIcon={closable} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be closable
instead of closeIcon
given that the value of closable
is a boolean and that of closeIcon
is supposed to be a ReactNode?
}; | ||
const preStyle = { | ||
whiteSpace: 'pre-wrap', | ||
// fontFamily: theme.antd.fontFamilyCode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// fontFamily: theme.antd.fontFamilyCode, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a E2E failing and this brought me to check SQL Lab which seems broken on this branch. Checked on master and could not repro there.
Also not sure what the other Cypress failures are about, first time seeing this error on our CI:
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
I have been looking at other E2E tests and I did not see any failures strictly related to this work so I think we'll be good here once that issue on SQL Lab is fixed.
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