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)
- Bug crossing lines in line/area chart HOT 2
- Slack HOT 4
- Duplicated entries in Alerts & Reports execution log HOT 1
- /api/v1/dashboard/{id_or_slug}/copy with "duplicate_slices" = true not working because The "json_metadata" take from /api/v1/dashboard/{id_or_slug} doesn't have "positions" HOT 4
- Bar Chart: Bar Chart Echart X Axis and Y Axis labels not showing HOT 3
- The default URL generated by Dashboard has security risks! HOT 22
- Advanced Period filter bug HOT 2
- Switching languages doesn't take effect on some menu elements if BABEL_DEFAULT_LOCALE is not "en" HOT 11
- ENABLE_JAVASCRIPT_CONTROLS use HOT 2
- [SIP-144] Proposal to Integrate VisActor Visualization Plugin into Superset HOT 2
- Dashboard Color Scheme keeps changing every refresh HOT 4
- Bug: fetchGuestToken function is not called after internet is disconnected and error is encountered during embedded report access HOT 3
- The in-memory storage for tracking rate limits HOT 14
- Filtered values not appearing/not working after selected from dropdown Post Migration to Latest SS Version HOT 6
- Proxy is unable to function properly HOT 8
- Importing example dataset failes because of database constraint HOT 3
- DynamoDB Chart Failure HOT 1
- Unable to create/see datasets HOT 1
- [4.1.0rc1] Building Docker image from sources fails HOT 3
- `Error: Referenced columns not available in DataFrame` in Mixed Charts when one query has only nulls HOT 1
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.