-
Notifications
You must be signed in to change notification settings - Fork 16.7k
fix(theming): Icons in ExecutionLogList and Country map chart tooltip theme consistency #34828
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| import { t, SupersetTheme, useTheme } from '@superset-ui/core'; | ||
| import { t, SupersetTheme, useTheme, css } from '@superset-ui/core'; | ||
| import { Tooltip } from '@superset-ui/core/components'; | ||
| import { Icons } from '@superset-ui/core/components/Icons'; | ||
| import { AlertState } from '../types'; | ||
|
|
@@ -32,7 +32,7 @@ function getStatusColor( | |
| case AlertState.Error: | ||
| return theme.colorErrorText; | ||
| case AlertState.Success: | ||
| return isReportEnabled ? theme.colorSuccessText : theme.colorErrorText; | ||
| return theme.colorSuccessText; | ||
| case AlertState.Noop: | ||
| return theme.colorSuccessText; | ||
| case AlertState.Grace: | ||
|
|
@@ -57,9 +57,7 @@ export default function AlertStatusIcon({ | |
| }; | ||
| switch (state) { | ||
| case AlertState.Success: | ||
| lastStateConfig.icon = isReportEnabled | ||
| ? Icons.CheckOutlined | ||
| : Icons.WarningOutlined; | ||
| lastStateConfig.icon = Icons.CheckOutlined; | ||
| lastStateConfig.label = isReportEnabled | ||
| ? t('Report sent') | ||
| : t('Alert triggered, notification sent'); | ||
|
|
@@ -95,16 +93,30 @@ export default function AlertStatusIcon({ | |
| lastStateConfig.status = AlertState.Noop; | ||
| } | ||
| const Icon = lastStateConfig.icon; | ||
| const isRunningIcon = state === AlertState.Working; | ||
| return ( | ||
| <Tooltip title={lastStateConfig.label} placement="bottomLeft"> | ||
| <Icon | ||
| iconSize="m" | ||
| iconColor={getStatusColor( | ||
| lastStateConfig.status, | ||
| isReportEnabled, | ||
| theme, | ||
| )} | ||
| /> | ||
| <span | ||
| css={ | ||
| isRunningIcon | ||
| ? css` | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| transform: scale(1.8); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason why we are hardcoding 1.8 and not using what we do with unitSize or some other variable?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this Icon SVG is smaller than the others, using standard sizes (S,M,L,XL) doesn't fit the size needed. so in order to look like the other ones in the screen scaling is easiest solution. I also considered modifying the SVG itself but this icon is used in other components. The other posible solution could be duplicating this icon but bigger, but to be honest i think is better to change size using styles. |
||
| ` | ||
| : undefined | ||
| } | ||
| > | ||
| <Icon | ||
| iconSize="m" | ||
| iconColor={getStatusColor( | ||
| lastStateConfig.status, | ||
| isReportEnabled, | ||
| theme, | ||
| )} | ||
| /> | ||
| </span> | ||
| </Tooltip> | ||
| ); | ||
| } | ||
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 hack needed to fix the size issue with this icon, the main reason is that the original SVG uses only the center portion of their viewBox, changing the SVG could fix this without this hack, but this Icon is being used also in SQLlab and Query history so probably changing the SVG can break those.