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.
It looks like this has been resolved in this Pull Request. But has not yet been released.
from superset.
Great, thanks
from superset.
Allready taken care in #28409
from superset.
Related Issues (20)
- SPAM
- SPAM
- SPAM
- SPAM
- SPAM
- SPAM
- SPAM
- Default native filters values don't set correctly HOT 1
- Superset 4.0.1 - Exported CSV Contains Garbled Chinese Characters and Numbers HOT 4
- Metric datatype incorrect when swap dataset HOT 1
- It is proposed to add the feature of grouping like folders HOT 3
- TimeSeries Chart is showing Year for the January month HOT 5
- Storybook controls are out of date HOT 1
- D3_FORMATS PROBLEM HOT 5
- Request execution time jumps HOT 1
- Unexpected error HOT 2
- Failed to setup alerts and reports based pypi installation HOT 6
- Filter does not follow label HOT 1
- [SIP-138] Proposal for Slack file upload V2 integration for Alerts and Reports HOT 2
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.