Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ export default styled(CountryMap)`
}

.superset-legacy-chart-country-map text.result-text {
fill: ${theme.colorText};
font-weight: ${theme.fontWeightLight};
font-size: ${theme.fontSizeXL}px;
}

.superset-legacy-chart-country-map text.big-text {
fill: ${theme.colorText};
font-weight: ${theme.fontWeightStrong};
font-size: ${theme.fontSizeLG}px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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:
Expand All @@ -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');
Expand Down Expand Up @@ -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
Copy link
Contributor Author

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.

css={
isRunningIcon
? css`
display: inline-flex;
align-items: center;
justify-content: center;
transform: scale(1.8);
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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>
);
}
Loading