This is an automated email from the ASF dual-hosted git repository. maximebeauchemin pushed a commit to branch fire-alert in repository https://gitbox.apache.org/repos/asf/superset.git
commit 5cc353355ce426b62d22f8111892ff1f47da4191 Author: Maxime Beauchemin <[email protected]> AuthorDate: Wed Sep 10 00:32:44 2025 -0700 fix: Correct validation section for Database and SQL fields Fix dynamic asterisk coloring by using the correct validation section: - Database field: Use Sections.Alert instead of Sections.Content - SQL field: Use Sections.Alert instead of Sections.Content - Fix SQL condition: !currentAlert?.sql?.length (matches actual validation) The validateAlertSection() function validates both Database and SQL fields, so error props must check validationStatus[Sections.Alert]?.hasErrors. Now asterisks should properly turn red when validation fails! 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --- superset-frontend/src/features/alerts/AlertReportModal.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx b/superset-frontend/src/features/alerts/AlertReportModal.tsx index 79dc5d5a02..8b2e112652 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx @@ -248,11 +248,6 @@ export const StyledInputContainer = styled.div` text-align: left; } - .required { - margin-left: ${theme.sizeUnit / 2}px; - color: ${theme.colorIcon}; - } - .control-label { margin-bottom: ${theme.sizeUnit * 2}px; color: ${theme.colorText}; @@ -1497,7 +1492,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({ label={t('Database')} required error={ - validationStatus[Sections.Content]?.hasErrors && + validationStatus[Sections.Alert]?.hasErrors && !currentAlert?.database ? t('Database is required') : undefined @@ -1527,8 +1522,8 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({ 'The result of this query must be a value capable of numeric interpretation e.g. 1, 1.0, or "1" (compatible with Python\'s float() function).', )} error={ - validationStatus[Sections.Content]?.hasErrors && - !resource?.sql + validationStatus[Sections.Alert]?.hasErrors && + !currentAlert?.sql?.length ? t('SQL Query is required') : undefined }
