-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(dashboard,api-service): layout editor preview fixes NV-6219 #8658
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
base: next
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for dashboard-v2-novu-staging canceled.
|
body: email?.body, | ||
editorType: email?.editorType, | ||
layoutId: null, | ||
body: enhanceBodyForPreview(editorType, body), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the important part where we adjust the "layout body" and replace the {{content}}
variable with the div
placeholder or for the Maily - placeholder node.
* ] | ||
* } | ||
*/ | ||
export const replaceMailyNodesByCondition = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the helper util that allows you with matching condition replace the Maily node
const form = useForm({ | ||
defaultValues, | ||
values, | ||
shouldFocusError: false, | ||
resetOptions: { | ||
keepDirtyValues: true, | ||
}, | ||
}); | ||
const controlValues = useWatch({ control: form.control }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved the form to be inside here as I need to watch on the control value changes and do the preview request
import { useLayoutEditor } from './layout-editor-provider'; | ||
import { EmailCorePreview } from '../workflow-editor/steps/preview/previews/email-preview-wrapper'; | ||
|
||
export const LayoutPreviewFactory = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the future we might have other preview components for example for the in-app
layout
import { useEffect, useState } from 'react'; | ||
import { useDataRef } from './use-data-ref'; | ||
|
||
export function useDebouncedValue<T>(value: T, delay: number): T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from the other component to reusable hook
`<span style="background: #FFFFFF; border: 1px solid #E1E4EA; border-radius: 4px; padding: 4px 8px; flex; justify-content: center; align-items: center; font-size: 10px; line-height: 1; color: #99A0AE;">${placeholderText}</span>` + | ||
'</div>'; | ||
|
||
export const enhanceBodyForPreview = (editorType: string, body: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it ended up quite nicely!
- Introduced ClickHouse client integration for analytics logging. - Added cleanup functions for ClickHouse database and tables. - Updated environment configuration for ClickHouse connection. - Implemented E2E tests for logging requests with filtering capabilities. - Refactored request log mapping to utilize a dedicated mapper function.
What changed? Why was the change needed?
Related Maily PR
Layout Editor - Preview.
Screenshots