-
Notifications
You must be signed in to change notification settings - Fork 18
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
Replace ortto External Embedded Webform for Onboarding guide #1657
Replace ortto External Embedded Webform for Onboarding guide #1657
Conversation
Warning Review failedThe pull request is closed. WalkthroughThe changes introduce a new method Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant Resolver as OnboardingFormResolver
participant NotificationCenter as NotificationCenterAdapter
participant MockNotification as MockNotificationAdapter
Client->>Resolver: subscribeOnboarding({ email })
Resolver->>NotificationCenter: subscribeOnboarding({ email })
NotificationCenter->>MockNotification: subscribeOnboarding({ email })
MockNotification-->>NotificationCenter: Promise<void>
NotificationCenter-->>Resolver: Promise<void>
Resolver-->>Client: Subscription confirmed
Poem
Tip Early access features: enabledWe are currently testing the following features in early access:
Note:
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: 2
export class OnboardingFormResolver { | ||
@Query(_returns => [QfRound], { nullable: true }) | ||
async subscribeOnboarding( | ||
@Args() |
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.
Correct the decorator usage.
The static analysis tool flagged an error with the decorator usage on the method parameter. This needs to be corrected to ensure proper functionality.
- @Args()
+ @Args({ validate: false }) // Assuming validation is not required. Adjust as necessary.
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. Thoroughly test & benchmark the code to ensure it meets the requirements.
@Args() | |
@Args({ validate: false }) // Assuming validation is not required. Adjust as necessary. |
Tools
Biome
[error] 9-9: Decorators are not valid here. (parse)
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.
@@ -20,6 +20,7 @@ import { ProjectUserInstantPowerViewResolver } from './instantPowerResolver'; | |||
import { AnchorContractAddressResolver } from './anchorContractAddressResolver'; | |||
import { RecurringDonationResolver } from './recurringDonationResolver'; | |||
import { DraftDonationResolver } from './draftDonationResolver'; | |||
import { OnboardingFormResolver } from './onboardingFormResolver'; | |||
|
|||
// eslint-disable-next-line @typescript-eslint/ban-types | |||
export const getResolvers = (): Function[] => { |
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.
Replace the generic Function
type with a more specific type.
The use of Function
as a type is discouraged due to its broad acceptance of any function-like value. Specify a more explicit function type to prevent bugs.
- export const getResolvers = (): Function[] => {
+ export const getResolvers = (): Array<() => any> => { // Adjust the return type based on actual resolver function signatures.
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. Thoroughly test & benchmark the code to ensure it meets the requirements.
export const getResolvers = (): Function[] => { | |
export const getResolvers = (): Array<() => any> => { |
Tools
Biome
[error] 26-26: Don't use 'Function' as a type. (lint/complexity/noBannedTypes)
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
…or-Onboarding-guide
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: 2
} catch (e) { | ||
logger.debug('subscribeOnboarding() error', e); | ||
return e; |
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.
Improve error handling.
Returning raw error objects can expose sensitive information and lead to security vulnerabilities. Consider returning a boolean or a custom error message instead.
- } catch (e) {
- logger.debug('subscribeOnboarding() error', e);
- return e;
+ } catch (error) {
+ logger.debug('subscribeOnboarding() error', error);
+ return false;
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. Thoroughly test & benchmark the code to ensure it meets the requirements.
} catch (e) { | |
logger.debug('subscribeOnboarding() error', e); | |
return e; | |
} catch (e) { | |
logger.debug('subscribeOnboarding() error', e); | |
return false; |
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: 2
@Resolver() | ||
export class OnboardingFormResolver { | ||
@Query(_returns => Boolean) | ||
async subscribeOnboarding(@Arg('email') email: string): Promise<boolean> { |
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.
Correct the decorator usage.
The static analysis tool flagged an error with the decorator usage on the method parameter. This needs to be corrected to ensure proper functionality.
- async subscribeOnboarding(@Arg('email') email: string): Promise<boolean> {
+ async subscribeOnboarding(@Arg('email', { validate: false }) email: string): Promise<boolean> {
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. Thoroughly test & benchmark the code to ensure it meets the requirements.
async subscribeOnboarding(@Arg('email') email: string): Promise<boolean> { | |
async subscribeOnboarding(@Arg('email', { validate: false }) email: string): Promise<boolean> { |
Tools
Biome
[error] 8-8: Decorators are not valid here.
Decorators are only valid on class declarations, class expressions, and class methods.
You can enable parameter decorators by setting theunsafeParameterDecoratorsEnabled
option totrue
in your configuration file.(parse)
…d-Webform-for-Onboarding-guide # Conflicts: # src/adapters/notifications/NotificationCenterAdapter.ts
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.
LGTM! Thanks @RamRamez
#1548
Summary by CodeRabbit
New Features
Enhancements