-
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
refactor(api-service): issues management #7344
Conversation
# Conflicts: # apps/api/package.json # apps/api/src/app/environments-v1/usecases/output-renderers/render-email-output.usecase.ts # apps/api/src/app/workflows-v2/shared/schemas/email-control.schema.ts
# Conflicts: # apps/api/src/app/workflows-v2/shared/schemas/email-control.schema.ts
# Conflicts: # apps/api/src/app/workflows-v2/usecases/generate-preview/generate-preview.usecase.ts
✅ 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. |
apps/api/src/app/environments-v1/usecases/output-renderers/hydrate-email-schema.usecase.ts
Outdated
Show resolved
Hide resolved
const valueEscapedNewLines = valueSingleQuotes.replace(/\n/g, '\\n'); | ||
|
||
return valueEscapedNewLines; | ||
} else { |
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.
else
is not required.
} else { | |
} |
return this.expandEmailEditorSchemaUseCase.execute({ emailEditorJson: body, fullPayloadForRender }); | ||
} | ||
} | ||
|
||
export const stringifyDataStructureWithSingleQuotes = (value: unknown, spaces: number = 0): 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.
@djabarovgeorge can you please elaborate with an example? Why do we need this extra handling on single quotes?
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.
A few reasons:
- Alignment with the Liquid.js client used in the framework.
- I noticed that when a variable is missing, the framework currently parses it as
unknown
(we have it today in the framework). This option causes this behavior. I believe it's an issue, but I couldn't fix it quickly, so I suggest we address it separately.
For now, we've ensured consistent behavior across channel steps.
@@ -1,11 +1,12 @@ | |||
import { ActionStepEnum, ChannelStepEnum } from '@novu/framework/internal'; |
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.
Nit-picky: This file could be replaced by a mapper returned from the ./schemas/index.ts
to avoid introducing a new filename, mapper.
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 like the idea and have used this pattern myself, but I noticed that not everyone on the team is aligned with it. I suggest introducing it to the team first.
); | ||
|
||
return { | ||
result: { | ||
preview: executeOutput.outputs as any, | ||
type: stepData.type as unknown as ChannelTypeEnum, | ||
}, | ||
previewPayloadExample: finalVariablesExample, | ||
previewPayloadExample: mergedVariablesExample, |
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.
As per lexicon, these are the preview control data. Let's add a TODO for the renaming in a follow up PR.
I also have a task in my list, to remove the nesting added by the result
attribute from this endpoint.
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.
agree :)
What changed? Why was the change needed?
Issue Management:
https://www.loom.com/share/710a5a211e4a4cbaa236fbbcf882008a?provider=slack-openid-connect
Screenshots
Expand for optional sections
Related enterprise PR
Special notes for your reviewer