Skip to content
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

Signup flow configuration #2876

Merged
merged 4 commits into from
Dec 5, 2024
Merged

Signup flow configuration #2876

merged 4 commits into from
Dec 5, 2024

Conversation

tomer-shvadron
Copy link
Collaborator

@tomer-shvadron tomer-shvadron commented Dec 4, 2024

  • feat(signup): add job title and additional info to signup form
  • feat(database): add DBA column to Business model and migration
  • fix(ui-definition): correct URL formatting in collection flow event

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced an optional showJobTitle property in the signup interface for enhanced customization.
    • Added a new optional additionalInfo field in the signup process to allow for more detailed user information.
  • Improvements

    • Enhanced the layout and spacing of the sidebar and navigation elements for better user experience.
    • Optimized the signup form validation process through memoization, improving performance.
  • Bug Fixes

    • Corrected the API URL formatting to ensure proper functionality in API calls.

- Introduce optional job title field in signup form schema
- Modify user creation logic to include additional information
- Update UI to accommodate new form structure

(Your signup form is expanding faster than my collection of dad jokes)
- Introduce a new 'dba' column to the Business schema
- Create migration for adding the 'dba' column in the database

(Your database schema has more additions than my Netflix watchlist)
- Update URLs to remove unnecessary closing curly braces
- Ensure consistent formatting across multiple files

(your code is like a URL with a typo—hard to reach the destination)
Copy link

changeset-bot bot commented Dec 4, 2024

⚠️ No Changeset found

Latest commit: 23c8dbc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Dec 4, 2024

Walkthrough

The changes in this pull request introduce several modifications across various components and files within the application. Key updates include the addition of a new optional property showJobTitle to the ITheme interface, enhancements to the SignUpForm component for improved schema handling, and modifications to the SignupDto class to include an additionalInfo property. Additionally, layout adjustments in the CollectionFlow and AppShell components improve visual presentation. Database schema updates include the addition of a new column dba in the Business table.

Changes

File Change Summary
apps/kyb-app/src/common/types/settings.ts Added optional property showJobTitle?: boolean to ITheme interface.
apps/kyb-app/src/components/layouts/AppShell/AppShell.tsx Reordered class names in div element of AppShell component.
apps/kyb-app/src/components/layouts/AppShell/Sidebar.tsx Modified className of div wrapping children prop to w-[24rem] and p-10.
apps/kyb-app/src/domains/collection-flow/collection-flow.api.ts Updated CreateEndUserDto interface to include additionalInfo?: Record<string, unknown>; modified createEndUserRequest function to accept this parameter.
apps/kyb-app/src/pages/CollectionFlow/CollectionFlow.tsx Adjusted layout of sidebar and modified PoweredByLogo component's class for improved visual alignment.
apps/kyb-app/src/pages/SignUpPage/components/SignUpForm/SignUpForm.tsx Introduced useMemo for signupSchema based on themeParams?.showJobTitle; updated handleSubmit to use memoized schema.
apps/kyb-app/src/pages/SignUpPage/components/SignUpForm/signup-form-schema.ts Changed signupFormSchema to a function accepting jobTitle parameter; modified additionalInfo property.
services/workflows-service/prisma/data-migrations Updated subproject commit reference.
services/workflows-service/prisma/migrations/20241203215328_dba_column_in_business_table/migration.sql Added new column "dba" TEXT to "Business" table.
services/workflows-service/prisma/schema.prisma Added optional field dba String? to Business model.
services/workflows-service/scripts/workflows/ui-definition/... Corrected URL formatting in send_collection_flow_finished API plugin by removing an extraneous closing brace.
services/workflows-service/src/collection-flow/controllers/... Updated signUp method to destructure SignupDto and handle additionalInfo.
services/workflows-service/src/collection-flow/dto/signup.dto.ts Added optional property additionalInfo?: Record<string, unknown> to SignupDto class.

Possibly related PRs

Suggested reviewers

  • alonp99
  • chesterkmr

🐇 "In the code, new fields bloom,
showJobTitle finds its room.
With layouts neat and schemas bright,
Our forms are ready, what a sight!
From dba in business, to flows refined,
Hop along, dear coder, let’s not fall behind!" 🐇✨


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@tomer-shvadron tomer-shvadron changed the title bal 3025 Signup flow configuration Dec 4, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
services/workflows-service/prisma/schema.prisma (1)

127-127: LGTM! The DBA field addition looks good.

The new optional dba field is well-placed and properly documented. The field type and nullability are appropriate for storing "Doing Business As" names.

Consider adding a maximum length constraint to prevent extremely long DBA names if your database has specific limitations:

-  dba                     String? // Doing Business As (DBA) name of the business entity
+  dba                     String? @db.VarChar(255) // Doing Business As (DBA) name of the business entity
apps/kyb-app/src/pages/SignUpPage/components/SignUpForm/signup-form-schema.ts (1)

28-28: Simplify the construction of the 'required' array

For better readability, consider simplifying the required array assignment:

-required: [...[jobTitle ? 'jobTitle' : null]].filter(Boolean),
+required: jobTitle ? ['jobTitle'] : [],
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 43d2bdd and ca2506b.

📒 Files selected for processing (15)
  • apps/kyb-app/src/common/types/settings.ts (1 hunks)
  • apps/kyb-app/src/components/layouts/AppShell/AppShell.tsx (1 hunks)
  • apps/kyb-app/src/components/layouts/AppShell/Sidebar.tsx (1 hunks)
  • apps/kyb-app/src/domains/collection-flow/collection-flow.api.ts (1 hunks)
  • apps/kyb-app/src/pages/CollectionFlow/CollectionFlow.tsx (2 hunks)
  • apps/kyb-app/src/pages/SignUpPage/components/SignUpForm/SignUpForm.tsx (4 hunks)
  • apps/kyb-app/src/pages/SignUpPage/components/SignUpForm/signup-form-schema.ts (2 hunks)
  • services/workflows-service/prisma/data-migrations (1 hunks)
  • services/workflows-service/prisma/migrations/20241203215328_dba_column_in_business_table/migration.sql (1 hunks)
  • services/workflows-service/prisma/schema.prisma (1 hunks)
  • services/workflows-service/scripts/workflows/ui-definition/kyb-parent-dynamic-example/pages/defintion-logic.ts (1 hunks)
  • services/workflows-service/scripts/workflows/ui-definition/kyb-with-associated-companies/ui-definition/associated-company-ui-def/associated-ui-definition.ts (1 hunks)
  • services/workflows-service/scripts/workflows/ui-definition/kyb-with-associated-companies/ui-definition/kyb-with-associated-company-ui-def/defintion-logic.ts (1 hunks)
  • services/workflows-service/src/collection-flow/controllers/collection-flow.no-user.controller.ts (2 hunks)
  • services/workflows-service/src/collection-flow/dto/signup.dto.ts (2 hunks)
✅ Files skipped from review due to trivial changes (6)
  • services/workflows-service/prisma/migrations/20241203215328_dba_column_in_business_table/migration.sql
  • apps/kyb-app/src/components/layouts/AppShell/AppShell.tsx
  • services/workflows-service/scripts/workflows/ui-definition/kyb-with-associated-companies/ui-definition/kyb-with-associated-company-ui-def/defintion-logic.ts
  • services/workflows-service/prisma/data-migrations
  • services/workflows-service/scripts/workflows/ui-definition/kyb-with-associated-companies/ui-definition/associated-company-ui-def/associated-ui-definition.ts
  • services/workflows-service/scripts/workflows/ui-definition/kyb-parent-dynamic-example/pages/defintion-logic.ts
🔇 Additional comments (10)
apps/kyb-app/src/pages/SignUpPage/components/SignUpForm/signup-form-schema.ts (1)

3-5: Great use of dynamic schema generation

Converting signupFormSchema into a function allows for flexible inclusion of optional fields based on runtime parameters.

apps/kyb-app/src/components/layouts/AppShell/Sidebar.tsx (1)

10-10: Layout adjustments enhance consistency and readability

The updated class names simplify the sidebar styling and improve consistency across the application.

services/workflows-service/src/collection-flow/dto/signup.dto.ts (1)

2-2: Addition of 'additionalInfo' property is well-implemented

The new optional additionalInfo property is correctly annotated for validation and API documentation.

Also applies to: 23-25

apps/kyb-app/src/common/types/settings.ts (1)

11-11: Addition of 'showJobTitle' property enhances configurability

Adding showJobTitle to the theme's signup settings allows dynamic control over the display of the "Job Title" field.

apps/kyb-app/src/pages/SignUpPage/components/SignUpForm/SignUpForm.tsx (1)

5-5: Efficient use of 'useMemo' and 'useCallback' to optimize performance

Memoizing the signup schema and updating dependencies ensures the form renders efficiently, re-calculating only when necessary.

Also applies to: 22-27, 36-36, 46-46, 51-51

apps/kyb-app/src/domains/collection-flow/collection-flow.api.ts (2)

111-111: LGTM! Well-typed extension point added

The addition of the optional additionalInfo property using Record<string, unknown> provides good type safety while allowing for extensibility.


114-122: LGTM! Clean implementation of the request handler

The function properly destructures and forwards the additionalInfo to the API endpoint.

services/workflows-service/src/collection-flow/controllers/collection-flow.no-user.controller.ts (1)

53-56: LGTM! Clean parameter destructuring

Good separation of additionalInfo from the rest of the payload using object destructuring.

apps/kyb-app/src/pages/CollectionFlow/CollectionFlow.tsx (2)

203-205: LGTM! Improved sidebar layout

Good use of flex utilities to create a balanced layout between navigation and language picker.


236-239: LGTM! Better logo constraints

The addition of max-width constraint helps maintain consistent visual appearance.

@alonp99 alonp99 merged commit a0601f5 into dev Dec 5, 2024
10 checks passed
@alonp99 alonp99 deleted the bal-3025 branch December 5, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants