-
-
Notifications
You must be signed in to change notification settings - Fork 559
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
fix the loading state #2177
fix the loading state #2177
Conversation
WalkthroughThe updates to the Changes
Assessment against linked issues
Poem
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 Configuration File (
|
Our Pull Request Approval ProcessWe have these basic policies to make the approval process smoother for our volunteer team. Testing Your CodePlease make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- src/screens/LoginPage/LoginPage.tsx (10 hunks)
Additional comments not posted (7)
src/screens/LoginPage/LoginPage.tsx (7)
432-432
: LGTM!The
disabled
attribute for the email field is conditionally set based onloginLoading
, preventing interaction during the login process.
469-469
: LGTM!The
disabled
attribute for the password field is conditionally set based onloginLoading
, preventing interaction during the login process.
509-509
: LGTM!The
disabled
attribute for the submit button is conditionally set based onloginLoading
, preventing multiple submissions during the login process.
550-550
: LGTM!The
disabled
attribute for the first name field is conditionally set based onsigninLoading
, preventing interaction during the registration process.
570-570
: LGTM!The
disabled
attribute for the last name field is conditionally set based onsigninLoading
, preventing interaction during the registration process.
856-856
: LGTM!The
disabled
attribute for the submit button is conditionally set based onsigninLoading
, preventing multiple submissions during the registration process.
339-341
: Verify the simplified loading condition.The conditional check for loading states now only includes
componentLoader
,recaptchaLoading
, andloading
. Ensure that this simplification aligns with the intended behavior and that no other loading states are required.Verification successful
Simplified loading condition is appropriate.
The conditional check using
componentLoader
,recaptchaLoading
, andloading
correctly determines when to display the loading indicator. This aligns with the intended behavior of managing loading states in the application.
componentLoader
: Used to manage component-specific loading state.recaptchaLoading
: Tied to the loading state of the reCAPTCHA mutation.loading
: Associated with the loading state of a data query.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the simplified loading condition aligns with the intended behavior. # Test: Search for all loading state variables. Expect: Only `componentLoader`, `recaptchaLoading`, and `loading` are used in conditional checks. rg --type js 'loading' -A 3Length of output: 27
Script:
#!/bin/bash # Description: Search for the usage of `componentLoader`, `recaptchaLoading`, and `loading` in the LoginPage.tsx file. # Find the file path for LoginPage.tsx file_path=$(fd 'LoginPage.tsx') # Search for the usage of the specified loading state variables within the file rg 'componentLoader|recaptchaLoading|loading' -A 3 "$file_path"Length of output: 990
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2177 +/- ##
===========================================
- Coverage 97.57% 97.57% -0.01%
===========================================
Files 241 241
Lines 6857 6848 -9
Branches 1993 1985 -8
===========================================
- Hits 6691 6682 -9
Misses 151 151
Partials 15 15 ☔ View full report in Codecov by Sentry. |
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.
- Is this necessary? Are we adding code we don't really need?
- For example, if logging in doesn't have a loading screen, then we'll need to remove it for every screen selected for logout. There is no user experience consistency
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: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- src/screens/LoginPage/LoginPage.tsx (13 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/screens/LoginPage/LoginPage.tsx
I think the login form one is pretty standard, you will be able to see it everywhere because people try out different credentials many times and you can't show that big loading screen every time for that, but for other stuff, you can. Talking about consistency, maintaining a different loading mechanism could also be a sign of consistency, we can implement that in every form out there, and for the rest of the things, loader will make sense. Let me know, what you think, I will accordingly make the changes. |
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.
Done
I'll approve this as most websites follow this design aesthetic, however we must not eliminate the loading page anywhere else. We have other more important areas to focus on, such as reducing our code bloat and the resulting high memory utilization. |
Yes sure and I'll try to contribute to more serious issues next time. This was my first time contributing to the talawa, so I picked an easier one. |
What kind of change does this PR introduce?
feature
Issue Number:
Fixes #2110
Did you add tests for your changes?
No.
Snapshots/Videos:
login_loading_bug_fix.mp4
Does this PR introduce a breaking change?
No
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Bug Fixes