Skip to content

Commit

Permalink
feat: add correct permissions for scheduling
Browse files Browse the repository at this point in the history
JIRA: F1-437
  • Loading branch information
scavnickyj committed Jun 28, 2024
1 parent 90166da commit d32b729
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { IAutomationMetadataObject } from "@gooddata/sdk-model";

import { useDashboardDispatch, useDashboardSelector } from "./DashboardStoreProvider.js";
import {
selectCanExportPdf,
selectDashboardRef,
selectEnableScheduling,
selectIsInViewMode,
Expand Down Expand Up @@ -35,6 +36,7 @@ export const useDashboardScheduledEmails = ({ onReload }: { onReload?: () => voi
const isInViewMode = useDashboardSelector(selectIsInViewMode);
const menuButtonItemsVisibility = useDashboardSelector(selectMenuButtonItemsVisibility);
const isScheduledEmailingEnabled = useDashboardSelector(selectEnableScheduling);
const canExport = useDashboardSelector(selectCanExportPdf);

const openScheduleEmailingDialog = useCallback(
() => isScheduledEmailingEnabled && dispatch(uiActions.openScheduleEmailDialog()),
Expand All @@ -59,6 +61,7 @@ export const useDashboardScheduledEmails = ({ onReload }: { onReload?: () => voi
isInViewMode &&
!isReadOnly &&
isScheduledEmailingEnabled &&
canExport &&
(menuButtonItemsVisibility.scheduleEmailButton ?? true);

/*
Expand Down

0 comments on commit d32b729

Please sign in to comment.