Giter VIP home page Giter VIP logo

Comments (5)

dosubot avatar dosubot commented on July 17, 2024 2

Hello, @pankajsoni22! 👋 I'm here to help you with any bugs, questions, or contributions you have regarding the repository.

To resolve the issue in Superset version 4.0.1-dev where you are unable to edit the mail list of existing alerts and reports because the mail list edit area becomes read-only after saving, you need to ensure that the NotificationMethod component allows for updates to the notification settings. The provided code already includes the necessary logic to handle updates to the notification settings.

Here is the relevant part of the code that handles the update of notification settings:

const updateNotificationSetting = (
    index: number,
    setting: NotificationSetting,
  ) => {
    const settings: NotificationSetting[] = [...notificationSettings];
    settings[index] = setting;

    // if you've changed notification method -> remove trailing methods
    if (notificationSettings[index].method !== setting.method) {
      notificationSettings[index] = setting;

      setNotificationSettings(
        notificationSettings.filter((_, idx) => idx <= index),
      );

      if (notificationSettings.length - 1 > index) {
        setNotificationAddState('active');
      }

      if (setting.method !== undefined && notificationAddState !== 'hidden') {
        setNotificationAddState('active');
      }
    } else {
      setNotificationSettings(settings);
    }
  };

This function updates the notification settings when a change is made. Ensure that this function is correctly called when the notification settings are updated in the NotificationMethod component.

Additionally, ensure that the NotificationMethod component is correctly passing the updated settings back to the parent component:

<NotificationMethod
  setting={notificationSetting}
  index={i}
  key={`NotificationMethod-${i}`}
  onUpdate={updateNotificationSetting}
  onRemove={removeNotificationSetting}
  onInputChange={onInputChange}
  email_subject={currentAlert?.email_subject || ''}
  defaultSubject={emailSubject || ''}
  setErrorSubject={handleErrorUpdate}
/>

If the issue persists, verify that the state updates are correctly propagated and that there are no other parts of the code that might be causing the mail list edit area to become read-only [1].

Details

About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from superset.

aibunny avatar aibunny commented on July 17, 2024 1

I also experienced a similar issue it looks like a frontend issue since the Add button is not activated when I have satified all the requirements to create an alert.
Untitled

from superset.

sfirke avatar sfirke commented on July 17, 2024 1

I believe this is a duplicate of #28149 which was fixed in #28409. The next release -- either 4.1.0 or 4.0.2 -- should have this fix incorporated.

If you believe this is different than the issue I linked, please feel free to comment and I'll reopen.

from superset.

aibunny avatar aibunny commented on July 17, 2024

@pankajsoni22 could share the configs you used for the email alerts I am not able to setup mine I keep getting report schedule refusing to compute

from superset.

mitchgreen avatar mitchgreen commented on July 17, 2024

I too am having this same issue, where the "Add" button in the report edit dialog box is not activated even when I have satisfied all the requirements to create an alert.

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.