Comments (4)
The issues you are experiencing with saving an alert in Superset and modifying the email recipients of old alerts are likely due to the validation and state management logic in the AlertReportModal
component.
-
Notification Method Highlighted in Red:
The notification method is highlighted in red because the validation logic checks if all required fields are complete before enabling the save button. Specifically, thevalidateNotificationSection
function checks if the notification settings have the required information, including the recipients. If the recipients are not provided, it marks the section as having errors, which results in the notification method being highlighted in red.const validateNotificationSection = () => { const hasErrors = !checkNotificationSettings(); const errors = hasErrors ? [TRANSLATIONS.RECIPIENTS_ERROR_TEXT] : []; if (emailError) { errors.push(TRANSLATIONS.EMAIL_SUBJECT_ERROR_TEXT); } updateValidationStatus(Sections.Notification, errors); }; const checkNotificationSettings = () => { if (!notificationSettings.length) { return false; } let hasInfo = false; notificationSettings.forEach(setting => { if (!!setting.method && setting.recipients?.length) { hasInfo = true; } }); return hasInfo; };
-
Unable to Modify Email Recipients of Old Alerts:
The inability to modify email recipients of old alerts created in version 3.1.2 could be due to the way the notification settings are initialized and managed. When an alert is fetched, the notification settings are populated based on the recipients from the resource. If the recipients are not correctly parsed or if the allowed notification methods do not match the existing methods, it could prevent modifications.useEffect(() => { if (resource) { // Add notification settings const settings = (resource.recipients || []).map(setting => { const config = typeof setting.recipient_config_json === 'string' ? JSON.parse(setting.recipient_config_json) : {}; return { method: setting.type, // @ts-ignore: Type not assignable recipients: config.target || setting.recipient_config_json, options: allowedNotificationMethods, }; }); setNotificationSettings(settings); setNotificationAddState( settings.length === allowedNotificationMethods.length ? 'hidden' : 'active', ); } }, [resource]);
Ensure that the
allowedNotificationMethods
includes the methods used in old alerts and that the recipients are correctly parsed and assigned.
Additionally, the NotificationMethod
component handles the rendering and validation of the notification method and recipients. If the recipients are not correctly set or if there are validation errors, the component will highlight the input fields in red.
const onRecipientsChange = (
event: React.ChangeEvent<HTMLTextAreaElement>,
) => {
const { target } = event;
setRecipientValue(target.value);
if (onUpdate) {
const updatedSetting = {
...setting,
recipients: target.value,
};
onUpdate(index, updatedSetting);
}
};
To resolve these issues, you need to ensure that all required fields, including the notification method and recipients, are correctly filled out and validated. Additionally, verify that the initialization logic for old alerts correctly parses and assigns the recipients and notification methods [1][2].
To continue talking to Dosu, mention @dosu.
from superset.
Allready taken care in #28409
from superset.
It looks like this has been resolved in this Pull Request. But has not yet been released.
from superset.
Great, thanks
from superset.
Related Issues (20)
- Inconsistencies in the handling of misspelled URLs HOT 2
- AttributeError: 'Template' object has no attribute 'strip' HOT 3
- Embedded view shows only [Error: column "string" does not exist] HOT 2
- bug when updating chart /api/v1/chart/{pk} HOT 2
- Missing prefix in URLs of scripts and CSS files when STATIC_ASSETS_PREFIX config is set HOT 2
- Set Specific Time for Dashboard Refresh HOT 7
- Forbidden error when selecting database from Dataset creation or SQLab HOT 4
- Drill By Modal window disappear when chart is not in view in embedded mode HOT 4
- superset.exceptions.SupersetErrorsException: [SupersetError(message='questdb error: QuestDbEngineSpec.execute() takes 3 positional arguments but 4 were given', error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'QuestDB', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error HOT 13
- An error occurred while rendering the visualization: TypeError: o.getTime is not a function HOT 2
- Dockerfile parse error line 40: Unknown flag: mount HOT 7
- [docker compose] Can't change default metadata database password HOT 7
- Starrocks executing a specific query will cause the Query history page to report an error and not load the data HOT 3
- Viz Plugin is not building anymore HOT 2
- Cant save Dataset with params HOT 6
- Cache setting Redis, still reporting exception upon startup! HOT 3
- Without "can write on DashboardPermalinkRestApi", a click on a anchor (tabs or header) redirect to login page HOT 1
- Without "can time range on Api", a click on a custom filter redirect to login page HOT 3
- Cannot generate translations HOT 2
- GET /api/v1/report/slack_channels is being called with ALERT_REPORT_SLACK_V2 off
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.