Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dashboard): Add for block and show behind a ff #7312

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FormControl, FormField, FormMessage } from '@/components/primitives/form/form';
import { useWorkflow } from '@/components/workflow-editor/workflow-provider';
import { useFeatureFlag } from '@/hooks/use-feature-flag';
import { parseStepVariablesToLiquidVariables } from '@/utils/parseStepVariablesToLiquidVariables';
import { cn } from '@/utils/ui';
import { Editor } from '@maily-to/core';
Expand All @@ -20,6 +21,7 @@ import {
spacer,
text,
} from '@maily-to/core/blocks';
import { FeatureFlagsKeysEnum } from '@novu/shared';
import type { Editor as TiptapEditor } from '@tiptap/core';
import { HTMLAttributes, useMemo, useState } from 'react';
import { useFormContext } from 'react-hook-form';
Expand All @@ -32,16 +34,33 @@ export const Maily = (props: MailyProps) => {
const [_, setEditor] = useState<TiptapEditor>();
const { control } = useFormContext();

const isForBlockEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_ND_EMAIL_FOR_BLOCK_ENABLED);
const isShowEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_ND_EMAIL_SHOW_ENABLED);

/*
button:has(.lucide-eye) {
display: none;
}
*/
Comment on lines +40 to +44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed

Comment on lines +40 to +44
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover


return (
<FormField
control={control}
name="body"
render={({ field }) => {
return (
<>
{!isShowEnabled && (
<style>{`
button:has(.lucide-eye) {
display: none;
}
`}</style>
)}
<div className={cn('mx-auto flex h-full w-full', className)} {...rest}>
<FormControl>
<Editor
key={isForBlockEnabled ? 'for-block-enabled' : 'for-block-disabled'}
config={{
hasMenuBar: false,
wrapClassName: 'h-full w-full',
Expand All @@ -57,7 +76,7 @@ export const Maily = (props: MailyProps) => {
image,
section,
columns,
forLoop,
...(isForBlockEnabled ? [forLoop] : []),
divider,
spacer,
button,
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@
height: 100%;
scroll-behavior: smooth;
}
}
}
2 changes: 2 additions & 0 deletions packages/shared/src/types/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ export enum FeatureFlagsKeysEnum {
IS_NEW_DASHBOARD_GETTING_STARTED_ENABLED = 'IS_NEW_DASHBOARD_GETTING_STARTED_ENABLED',
IS_ND_DELAY_DIGEST_EMAIL_ENABLED = 'IS_ND_DELAY_DIGEST_EMAIL_ENABLED',
IS_NEW_DASHBOARD_ACTIVITY_FEED_ENABLED = 'IS_NEW_DASHBOARD_ACTIVITY_FEED_ENABLED',
IS_ND_EMAIL_FOR_BLOCK_ENABLED = 'IS_ND_EMAIL_FOR_BLOCK_ENABLED',
IS_ND_EMAIL_SHOW_ENABLED = 'IS_ND_EMAIL_SHOW_ENABLED',
}
Loading