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

feat(dashboard): Implement email step editor & small preview #7129

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

desiprisg
Copy link
Contributor

@desiprisg desiprisg commented Nov 26, 2024

What changed? Why was the change needed?

  • Enable adding an email step
  • Add the editor and preview tabs on the configure email template page
  • Add the email editor and subject input on the editor tab

Screenshots

Screenshot 2024-12-04 at 11 35 03 AM Screenshot 2024-12-05 at 11 45 59 AM
Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

linear bot commented Nov 26, 2024

Copy link

netlify bot commented Nov 26, 2024

Deploy Preview for novu-stg-vite-dashboard-poc ready!

Name Link
🔨 Latest commit 169d08d
🔍 Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/6745d27c9f18100008dbdee1
😎 Deploy Preview https://deploy-preview-7129--novu-stg-vite-dashboard-poc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented Nov 26, 2024

Open in Stackblitz

@novu/client

npm i https://pkg.pr.new/novuhq/novu/@novu/client@7129

@novu/framework

npm i https://pkg.pr.new/novuhq/novu/@novu/framework@7129

@novu/headless

npm i https://pkg.pr.new/novuhq/novu/@novu/headless@7129

@novu/js

npm i https://pkg.pr.new/novuhq/novu/@novu/js@7129

@novu/nextjs

npm i https://pkg.pr.new/novuhq/novu/@novu/nextjs@7129

@novu/nest

npm i https://pkg.pr.new/novuhq/novu/@novu/nest@7129

@novu/node

npm i https://pkg.pr.new/novuhq/novu/@novu/node@7129

@novu/notification-center

npm i https://pkg.pr.new/novuhq/novu/@novu/notification-center@7129

novu

npm i https://pkg.pr.new/novuhq/novu@7129

@novu/providers

npm i https://pkg.pr.new/novuhq/novu/@novu/providers@7129

@novu/react

npm i https://pkg.pr.new/novuhq/novu/@novu/react@7129

@novu/react-native

npm i https://pkg.pr.new/novuhq/novu/@novu/react-native@7129

@novu/shared

npm i https://pkg.pr.new/novuhq/novu/@novu/shared@7129

@novu/stateless

npm i https://pkg.pr.new/novuhq/novu/@novu/stateless@7129

commit: 5ae22fe

@desiprisg desiprisg force-pushed the nv-4587-implement-email-template-editor branch from 169d08d to 4f2f506 Compare December 4, 2024 06:57
@desiprisg desiprisg changed the title feat(dashboard): Implement email step editor feat(dashboard): Implement email step editor & small preview Dec 5, 2024
@desiprisg desiprisg force-pushed the nv-4587-implement-email-template-editor branch 3 times, most recently from af95efa to 61c3404 Compare December 5, 2024 10:03
@desiprisg desiprisg force-pushed the nv-4587-implement-email-template-editor branch from 61c3404 to e71d9ef Compare December 5, 2024 10:22
@@ -73,6 +75,7 @@ export const AddStepMenu = ({
onMenuItemClick: (stepType: StepTypeEnum) => void;
}) => {
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
const areNewStepsEnabled = useFeatureFlag(FeatureFlagsKeysEnum.IS_ND_DELAY_DIGEST_EMAIL_ENABLED);
Copy link
Contributor

Choose a reason for hiding this comment

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

Lol, the feature flag name is a bit off, but it's OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was already on ld

@@ -23,6 +25,12 @@ export const getComponentByType = ({ component }: { component?: UiComponentEnum
case UiComponentEnum.URL_TEXT_BOX: {
return <InAppRedirect />;
}
case UiComponentEnum.MAILY: {
Copy link
Contributor

Choose a reason for hiding this comment

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

@desiprisg consider aligning the naming on this one. All other components are based on the step type field, not on the implementation of the built-in ui or the underlying library.

Suggested change
case UiComponentEnum.MAILY: {
case UiComponentEnum.EMAIL_BODY: {

import { cn } from '@/utils/ui';

type SmallEmailPreviewProps = HTMLAttributes<HTMLDivElement>;
const SmallEmailPreview = (props: SmallEmailPreviewProps) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

If not mistaken we call this Mini preview.

Suggested change
const SmallEmailPreview = (props: SmallEmailPreviewProps) => {
const MiniEmailPreview = (props: SmallEmailPreviewProps) => {

<div className="relative flex flex-col gap-3">
<div className="flex items-center gap-2.5 text-sm font-medium">
<Notification5Fill className="size-3" />
In-app template editor
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In-app template editor
Email template editor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not the current ticket

const bodyKey = 'emailEditor';

type MailyProps = HTMLAttributes<HTMLDivElement>;
export const Maily = (props: MailyProps) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const Maily = (props: MailyProps) => {
export const Editor = (props: EditorProps) => {


const bodyKey = 'emailEditor';

type MailyProps = HTMLAttributes<HTMLDivElement>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
type MailyProps = HTMLAttributes<HTMLDivElement>;
type EditorProps = HTMLAttributes<HTMLDivElement>;

@desiprisg desiprisg force-pushed the nv-4587-implement-email-template-editor branch from 8320ff2 to 5ae22fe Compare December 5, 2024 12:12
@desiprisg desiprisg merged commit 2bc56b1 into next Dec 5, 2024
16 of 17 checks passed
@desiprisg desiprisg deleted the nv-4587-implement-email-template-editor branch December 5, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants