-
Notifications
You must be signed in to change notification settings - Fork 153
feat: integrate create application API in onboarding form #1139
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
Conversation
Deploying www-rds with
|
| Latest commit: |
e8c6f83
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9313702a.www-rds.pages.dev |
| Branch Preview URL: | https://feat-integrate-onboarding-fo.www-rds.pages.dev |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
WalkthroughThe changes implement a complete application submission workflow with server-side image upload validation, remote application data loading and prepopulation, and form submission with API integration. Three new API endpoints are added to support profile image uploads, retrieving existing applications, and creating new applications. Client-side enhancements include file validation, async handling, and comprehensive error and success notifications via toast messages. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Client as Client (Browser)
participant Server as API Server
User->>Client: Visits application form
Client->>Server: GET /applications/:userId
Server-->>Client: Return existing application data
Client->>Client: Prepopulate form fields<br/>from application data
Client-->>User: Display populated form
User->>Client: Select profile image
Client->>Client: Validate file<br/>(type, size ≤ 2MB)
User->>Client: Modify form fields
User->>Client: Click submit
Client->>Server: POST /applications<br/>(step data, user info)
Server-->>Client: Success response
Client->>Client: Clear localStorage<br/>step data
Client-->>User: Show success toast<br/>Advance application flow
alt Submission Error
Server-->>Client: Error response
Client-->>User: Show error toast
end
sequenceDiagram
participant User
participant Client as Client (Browser)
participant Server as API Server
User->>Client: Upload profile image
Client->>Client: Validate file<br/>(exists, is image, ≤ 2MB)
alt Validation Error
Client-->>User: Show error toast
else Validation Success
Client->>Server: POST /upload-image<br/>(FormData with image)
Server-->>Client: Return {picture/url: imageUrl}
Client->>Client: Update profileImageUrl<br/>profileImageBase64<br/>imagePreview
Client-->>User: Show success toast
end
alt Network/Exception Error
Server-->>Client: Network error
Client-->>User: Show generic error toast
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
🤖 Fix all issues with AI agents
In `@app/components/new-join-steps/new-step-one.js`:
- Around line 124-129: After handling image upload in the catch/finally block,
reset the file input value to allow re-selecting the same file; replace or add
to the finally block a line that clears the DOM input via this.fileInput (not
this.fileInputElement) so the input value is set to '' after upload
errors/success—locate the upload error handling around this.isImageUploading and
the mounted hook where this.fileInput is assigned from this.$refs.fileInput to
implement the reset.
In `@app/components/new-stepper.js`:
- Around line 259-274: collectAllStepData currently calls JSON.parse directly on
values from getLocalStorageItem (using STEP_DATA_STORAGE_KEY.stepOne..stepFive),
which will throw on malformed JSON; fix by adding a small safe JSON parse
wrapper (e.g., safeParseJSON) or wrap each JSON.parse in try-catch to return an
empty object on error and optionally log the parsing error via console.error or
a logger; update collectAllStepData to use that wrapper for
stepOneData..stepFiveData so corrupted localStorage doesn't break submission.
- Around line 71-131: The step components read localStorage only once in
BaseStepComponent (constructor), causing a race when
prepopulateFormFromApplication writes STEP_DATA_STORAGE_KEY.* via
setLocalStorageItem asynchronously; update the design so step components react
to later prepopulation by either: 1) passing the prepopulated objects
(stepOneData..stepFiveData from prepopulateFormFromApplication) directly into
the step components instead of relying on localStorage, or 2) adding a
lifecycle/reactive hook in BaseStepComponent to re-read localStorage (or
subscribe to a shared state service) when inputs change or when a storage-update
event is emitted, ensuring components refresh their state after
prepopulateFormFromApplication completes.
6f79eb5 to
e8c6f83
Compare
0c4f0c4
Date: 25-01-2026
Developer Name: @MayankBansal12
Issue Ticket Number:-
Description:
Is Under Feature Flag
Database changes
Breaking changes (If your feature is breaking/missing something please mention pending tickets)
Is Development Tested?
Tested in staging?
Add relevant Screenshot below ( e.g test coverage etc. )
demo
Screencast.from.2026-01-27.00-49-26.online-video-cutter.com.mp4