You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/12/22 11:33:07 UTC
(superset) branch master updated: chore: Adds a tooltip for the alert's SQL input (#26317)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 5bd7fd7990 chore: Adds a tooltip for the alert's SQL input (#26317)
5bd7fd7990 is described below
commit 5bd7fd7990a7f9d236f887e539fe1bce39712461
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Fri Dec 22 08:32:59 2023 -0300
chore: Adds a tooltip for the alert's SQL input (#26317)
---
superset-frontend/src/features/alerts/AlertReportModal.tsx | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx b/superset-frontend/src/features/alerts/AlertReportModal.tsx
index 571c7b1b2a..e371efcf1b 100644
--- a/superset-frontend/src/features/alerts/AlertReportModal.tsx
+++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx
@@ -152,6 +152,10 @@ const StyledModal = styled(Modal)`
}
`;
+const StyledTooltip = styled(InfoTooltipWithTrigger)`
+ margin-left: ${({ theme }) => theme.gridUnit}px;
+`;
+
const StyledIcon = (theme: SupersetTheme) => css`
margin: auto ${theme.gridUnit * 2}px auto 0;
color: ${theme.colors.grayscale.base};
@@ -397,10 +401,12 @@ export const TRANSLATIONS = {
ALERT_CONDITION_TEXT: t('Alert condition'),
DATABASE_TEXT: t('Database'),
SQL_QUERY_TEXT: t('SQL Query'),
+ SQL_QUERY_TOOLTIP: t(
+ 'The result of this query should be a numeric-esque value',
+ ),
TRIGGER_ALERT_IF_TEXT: t('Trigger Alert If...'),
CONDITION_TEXT: t('Condition'),
VALUE_TEXT: t('Value'),
- VALUE_TOOLTIP: t('Threshold value should be double precision number'),
REPORT_SCHEDULE_TEXT: t('Report schedule'),
ALERT_CONDITION_SCHEDULE_TEXT: t('Alert condition schedule'),
TIMEZONE_TEXT: t('Timezone'),
@@ -1284,6 +1290,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
<StyledInputContainer>
<div className="control-label">
{TRANSLATIONS.SQL_QUERY_TEXT}
+ <StyledTooltip tooltip={TRANSLATIONS.SQL_QUERY_TOOLTIP} />
<span className="required">*</span>
</div>
<TextAreaControl
@@ -1319,10 +1326,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
</StyledInputContainer>
<StyledInputContainer>
<div className="control-label">
- {TRANSLATIONS.VALUE_TEXT}{' '}
- <InfoTooltipWithTrigger
- tooltip={TRANSLATIONS.VALUE_TOOLTIP}
- />
+ {TRANSLATIONS.VALUE_TEXT}
<span className="required">*</span>
</div>
<div className="input-container">