eschutho commented on code in PR #29846:
URL: https://github.com/apache/superset/pull/29846#discussion_r1706184491
##########
superset-frontend/src/features/alerts/components/NotificationMethod.tsx:
##########
@@ -257,51 +259,47 @@ export const NotificationMethod:
FunctionComponent<NotificationMethodProps> = ({
};
useEffect(() => {
- if (
- method &&
- [
- NotificationMethodOption.Slack,
- NotificationMethodOption.SlackV2,
- ].includes(method) &&
- !slackOptions[0]?.options.length
- ) {
+ if (!slackOptions[0]?.options.length) {
fetchSlackChannels({ types: ['public_channel', 'private_channel'] })
.then(({ json }) => {
const { result } = json;
-
const options: SlackOptionsType = mapChannelsToOptions(result);
setSlackOptions(options);
if (isFeatureEnabled(FeatureFlag.AlertReportSlackV2)) {
- // map existing ids to names for display
+ // for edit mode, map existing ids to names for display if slack v2
// or names to ids if slack v1
const [publicOptions, privateOptions] = options;
-
- setSlackRecipients(
- mapSlackValues({
- method,
- recipientValue,
- slackOptions: [
- ...publicOptions.options,
- ...privateOptions.options,
- ],
- }),
- );
- if (method === NotificationMethodOption.Slack) {
- onMethodChange({
- label: NotificationMethodOption.Slack,
- value: NotificationMethodOption.SlackV2,
- });
+ if (
+ method &&
Review Comment:
I'm going to merge, but if you suggest another way to approach this, I'll
put it up in a new PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]