etr2460 commented on a change in pull request #16367:
URL: https://github.com/apache/superset/pull/16367#discussion_r695154406
##########
File path: superset-frontend/src/views/CRUD/data/database/state.ts
##########
@@ -21,5 +21,5 @@ import { useSelector } from 'react-redux';
import { ViewState } from 'src/views/types';
export function useCommonConf() {
- return useSelector((state: ViewState) => state.common.conf);
+ return useSelector((state: ViewState) => state?.common?.conf);
Review comment:
why did we need to add `?` here? seems like it worked fine before?
##########
File path: superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
##########
@@ -397,6 +397,10 @@ const AlertReportModal:
FunctionComponent<AlertReportModalProps> = ({
alert = null,
isReport = false,
}) => {
+ const conf = useCommonConf();
+ const allowedNotificationMethods =
Review comment:
should we cast this as `NotificationMethodOption[]` here so that we
don't need to cast it multiple times below?
##########
File path: superset-frontend/src/views/CRUD/alert/AlertReportModal.tsx
##########
@@ -78,7 +80,7 @@ interface AlertReportModalProps {
show: boolean;
}
-const NOTIFICATION_METHODS: NotificationMethod[] = ['Email', 'Slack'];
+const DEFAULT_NOTIFICATION_METHODS: NotificationMethodOption[] = ['Email'];
Review comment:
not sure if changing the default is a breaking change, but since we
should probably never hit this code path (can the page render without the
config options actually here?) it's likely fine
--
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]