Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashboard): add ld flag for email, digest, delay (#7205)
Browse files Browse the repository at this point in the history
ChmaraX authored Dec 3, 2024
1 parent b76624f commit 44f83c5
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ import { Badge } from '../primitives/badge';
import { cn } from '@/utils/ui';
import { StepTypeEnum } from '@/utils/enums';
import { STEP_TYPE_TO_COLOR } from '@/utils/color';
import { useFeatureFlag } from '@/hooks/use-feature-flag';
import { FeatureFlagsKeysEnum } from '@novu/shared';

const MenuGroup = ({ children }: { children: ReactNode }) => {
return <div className="flex flex-col">{children}</div>;
@@ -41,7 +43,7 @@ const MenuItem = ({

return (
<span
onClick={onClick}
onClick={!disabled ? onClick : undefined}
className={cn(
'shadow-xs text-foreground-600 hover:bg-accent flex cursor-pointer items-center gap-2 rounded-lg p-1.5',
{
@@ -73,6 +75,7 @@ export const AddStepMenu = ({
onMenuItemClick: (stepType: StepTypeEnum) => void;
}) => {
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
const isDelayDigestEmailEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_ND_DELAY_DIGEST_EMAIL_ENABLED);

const handleMenuItemClick = (stepType: StepTypeEnum) => {
onMenuItemClick(stepType);
@@ -123,7 +126,7 @@ export const AddStepMenu = ({
<MenuItem stepType={StepTypeEnum.DIGEST}>Digest</MenuItem>
<MenuItem
stepType={StepTypeEnum.DELAY}
disabled={true}
disabled={!isDelayDigestEmailEnabled}
onClick={() => handleMenuItemClick(StepTypeEnum.DELAY)}
>
Delay
1 change: 1 addition & 0 deletions packages/shared/src/types/feature-flags.ts
Original file line number Diff line number Diff line change
@@ -43,4 +43,5 @@ export enum FeatureFlagsKeysEnum {
IS_CONTROLS_AUTOCOMPLETE_ENABLED = 'IS_CONTROLS_AUTOCOMPLETE_ENABLED',
IS_USAGE_ALERTS_ENABLED = 'IS_USAGE_ALERTS_ENABLED',
IS_NEW_DASHBOARD_ENABLED = 'IS_NEW_DASHBOARD_ENABLED',
IS_ND_DELAY_DIGEST_EMAIL_ENABLED = 'IS_ND_DELAY_DIGEST_EMAIL_ENABLED',
}

0 comments on commit 44f83c5

Please sign in to comment.