-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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: move create workflow to app gen package #5396
feat: move create workflow to app gen package #5396
Conversation
✅ Deploy Preview for dev-web-novu ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for novu-design ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@coderabbitai review |
WalkthroughThe recent updates focus on refining the codebase across various modules, enhancing readability, and improving error handling. Key changes include the restructuring of imports and exports, updating dependencies, and introducing new utility functions and enums. The modifications also extend to entity and schema updates, particularly with the addition of new properties and types. Overall, these changes aim to streamline processes and enforce stricter type checks, thereby increasing the robustness of the application. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 3
@@ -220,7 +217,7 @@ export class UpdateNotificationTemplate { | |||
const variants = command.steps ? command.steps?.flatMap((step) => step.variants || []) : []; | |||
|
|||
for (const variant of variants) { | |||
if (checkIsVariantEmpty(variant)) { | |||
if (isVariantEmpty(variant)) { |
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.
Tip
Codebase Verification
The replacement of checkIsVariantEmpty
with isVariantEmpty
in the main application code has been successfully verified. However, the function checkIsVariantEmpty
is still referenced in a test file (packages/application-generic/src/utils/variants/isVariantEmpty.spec.ts
). It is recommended to update this test file to use isVariantEmpty
to maintain consistency and ensure all tests are aligned with the current implementation.
Analysis chain
Ensure the replacement of checkIsVariantEmpty
with isVariantEmpty
maintains the intended functionality.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for usages of the old function `checkIsVariantEmpty` to ensure it's fully replaced.
rg --type ts "checkIsVariantEmpty"
Length of output: 145
packages/application-generic/src/usecases/create-workflow/create-workflow.usecase.ts
Show resolved
Hide resolved
export const normalizeVariantDefault = (items: ITemplateVariable[]) => { | ||
return items.map((item) => { | ||
if (item.defaultValue === '') { | ||
item.defaultValue = undefined; | ||
} | ||
|
||
return item; | ||
}); | ||
}; |
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.
Ensure proper handling of null
values for defaultValue
.
- if (item.defaultValue === '') {
+ if (item.defaultValue === '' || item.defaultValue === null) {
item.defaultValue = undefined;
This change ensures that both empty strings and null
values are normalized to undefined
, enhancing the robustness of the function.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
export const normalizeVariantDefault = (items: ITemplateVariable[]) => { | |
return items.map((item) => { | |
if (item.defaultValue === '') { | |
item.defaultValue = undefined; | |
} | |
return item; | |
}); | |
}; | |
export const normalizeVariantDefault = (items: ITemplateVariable[]) => { | |
return items.map((item) => { | |
if (item.defaultValue === '' || item.defaultValue === null) { | |
item.defaultValue = undefined; | |
} | |
return item; | |
}); | |
}; |
What change does this PR introduce?
Refactor the code so we would reuse the same logic and not maintain duplicated code.
Why was this change needed?
Other information (Screenshots)
EE REF
Summary by CodeRabbit
New Features
Refactor
Bug Fixes
Style