Skip to content

Commit

Permalink
Merge pull request #5714 from gooddata/mkn-f1-976-fix
Browse files Browse the repository at this point in the history
fix: notification channels
  • Loading branch information
ivanmjartan authored Dec 16, 2024
2 parents 95896d3 + 4e1af08 commit bbdc89f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export const ViewModeDashboardVisualizationSwitcherContent: React.FC<
onScheduleEmailingManagementOpen,
isScheduledEmailingVisible,
isScheduledManagementEmailingVisible,
numberOfAvailableDestinations,
} = useDashboardScheduledEmails();

const onScheduleExport = useCallback(() => {
Expand All @@ -131,7 +130,6 @@ export const ViewModeDashboardVisualizationSwitcherContent: React.FC<
} = useAlertingAndScheduling({
widget: activeVisualization,
insight,
numberOfAvailableDestinations,
});

const { closeMenu, isMenuOpen, menuItems, openMenu } = useInsightMenu({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const DefaultDashboardInsightWidgetCore: React.FC<
const {
isScheduledEmailingVisible,
isScheduledManagementEmailingVisible,
numberOfAvailableDestinations,
onScheduleEmailingOpen,
onScheduleEmailingManagementOpen,
} = useDashboardScheduledEmails();
Expand Down Expand Up @@ -88,7 +87,6 @@ const DefaultDashboardInsightWidgetCore: React.FC<
} = useAlertingAndScheduling({
widget,
insight,
numberOfAvailableDestinations,
});

///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
isCustomWidget,
selectIsReadOnly,
selectCanManageWorkspace,
selectNotificationChannelsCount,
} from "../../../../model/index.js";
import { AlertingDisabledReason, SchedulingDisabledReason } from "../../insightMenu/index.js";
import {
Expand All @@ -19,13 +20,11 @@ import {
type UseAlertingAndSchedulingConfig = {
insight?: IInsight;
widget: IInsightWidget;
numberOfAvailableDestinations: number;
};

export const useAlertingAndScheduling = ({
widget,
insight,
numberOfAvailableDestinations,
}: UseAlertingAndSchedulingConfig): {
isAlertingVisible: boolean;
alertingDisabled: boolean;
Expand All @@ -38,6 +37,7 @@ export const useAlertingAndScheduling = ({
const isReadOnly = useDashboardSelector(selectIsReadOnly);
const isWorkspaceManager = useDashboardSelector(selectCanManageWorkspace);

const numberOfAvailableDestinations = useDashboardSelector(selectNotificationChannelsCount);
/**
* We want to hide automations when there are no destinations unless the user is admin.
*/
Expand Down

0 comments on commit bbdc89f

Please sign in to comment.