-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix(dashboard): wait for save when switching preview tab #7299
fix(dashboard): wait for save when switching preview tab #7299
Conversation
const isNovuCloud = workflow.origin === WorkflowOriginEnum.NOVU_CLOUD && uiSchema; | ||
const isExternal = workflow.origin === WorkflowOriginEnum.EXTERNAL; | ||
|
||
const editorContent = ( | ||
<> | ||
{isNovuCloud && <EmailEditor uiSchema={uiSchema} />} | ||
{isExternal && ( | ||
<EmailTabsSection> | ||
<CustomStepControls dataSchema={dataSchema} origin={workflow.origin} /> | ||
</EmailTabsSection> | ||
)} | ||
</> | ||
); |
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.
Added more explicit conditions so its unified across steps
@@ -12,8 +12,8 @@ const redirectKey = 'redirect'; | |||
const primaryActionKey = 'primaryAction'; | |||
const secondaryActionKey = 'secondaryAction'; | |||
|
|||
export const InAppEditor = ({ uiSchema }: { uiSchema?: UiSchema }) => { | |||
if (!uiSchema || uiSchema?.group !== UiSchemaGroupEnum.IN_APP) { |
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.
Not sure if its better to check for uiSchema
in child or parent - moved to parent for consistency with email-editor
✅ Deploy Preview for dev-web-novu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for dashboard-v2-novu-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
<span>Preview</span> | ||
</TabsTrigger> | ||
</TabsList> | ||
const isNovuCloud = workflow.origin === WorkflowOriginEnum.NOVU_CLOUD && uiSchema; |
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.
Our goal should be to align Dashboard and Code First workflow management. That is, uiSchema should be available in both. Let's remove it from this check.
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.
Currently its not available in both and the uiSchema type is optional on the response, there needs to be a check somewhere and this is the only place where the check makes sense.
If we want to achieve what you are describing there needs to be additional changes on API which I don't want to include as part of this UI bugfix.
apps/dashboard/src/components/workflow-editor/steps/email/email-editor.tsx
Show resolved
Hide resolved
export const InAppEditor = ({ uiSchema }: { uiSchema?: UiSchema }) => { | ||
if (!uiSchema || uiSchema?.group !== UiSchemaGroupEnum.IN_APP) { | ||
export const InAppEditor = ({ uiSchema }: { uiSchema: UiSchema }) => { | ||
if (uiSchema.group !== UiSchemaGroupEnum.IN_APP) { |
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.
Ditto
…itching-from-editor-to
…itching-from-editor-to
What changed? Why was the change needed?
The preview components already had the logic to wait for preview data - the issue was that it was incorrectly mounted in
in-app
due to different tabs implementation compared toemail
.tab-switch.mov
slow network:
3g-network.mov