-
Notifications
You must be signed in to change notification settings - Fork 49
fix: profile page not loading #2023
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
WalkthroughThe update introduces a Changes
Poem
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (16)
🔇 Additional comments (2)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for kleros-v2-testnet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for kleros-v2-testnet-devtools ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
❌ Deploy Preview for kleros-v2-university failed. Why did it fail? →
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
web/src/hooks/queries/useUser.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: contracts-testing
- GitHub Check: Analyze (javascript)
- GitHub Check: SonarCloud
✅ Deploy Preview for kleros-v2-neo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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
🧹 Nitpick comments (1)
web/src/utils/sanitizeFilter.ts (1)
4-4
: Consider using explicit typing for the destructured parameter.The underscore parameter in the filter callback could be more explicit to improve readability.
Apply this diff for better readability:
- const cleaned = Object.fromEntries(Object.entries(f).filter(([_, v]) => !(Array.isArray(v) && v.length === 0))); + const cleaned = Object.fromEntries(Object.entries(f).filter(([key, v]) => !(Array.isArray(v) && v.length === 0)));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
web/src/hooks/queries/useCasesQuery.ts
(2 hunks)web/src/hooks/queries/useUser.ts
(2 hunks)web/src/pages/Profile/index.tsx
(3 hunks)web/src/utils/sanitizeFilter.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- web/src/hooks/queries/useUser.ts
⏰ Context from checks skipped due to timeout of 90000ms (17)
- GitHub Check: Redirect rules - kleros-v2-university
- GitHub Check: Redirect rules - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-university
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-neo
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-university
- GitHub Check: Pages changed - kleros-v2-neo
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: dependency-review
- GitHub Check: contracts-testing
- GitHub Check: Analyze (javascript)
- GitHub Check: SonarCloud
- GitHub Check: Mend Security Check
🔇 Additional comments (3)
web/src/hooks/queries/useCasesQuery.ts (2)
75-90
: Good implementation of filter sanitization.The consistent application of
sanitizeFilter
across query key, document selection, and variables ensures proper cache behavior and query execution. The logic correctly uses different query documents based on whether a filter is present.
95-111
: Consistent filter sanitization applied correctly.The implementation mirrors the pattern used in
useCasesQuery
, ensuring consistency across the codebase. The inlineenabled
flag is also a good simplification.web/src/pages/Profile/index.tsx (1)
99-102
: Good use of useMemo for performance optimization.The memoization of the statistics calculation with proper dependencies (
userData?.user
anddecodedFilter
) ensures the calculation only runs when necessary, improving performance.
Code Climate has analyzed commit a35ceb0 and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
|
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
PR-Codex overview
This PR introduces a new utility function
sanitizeFilter
for cleaning up filter objects and integrates it into various components and hooks, improving the handling of filters in queries. It also adds acalculateStats
function to compute statistics based on user data.Detailed summary
sanitizeFilter
function inweb/src/utils/sanitizeFilter.ts
to clean filter objects.formattedValue
inweb/src/components/NumberDisplay.tsx
to usecommify
.sanitizeFilter
inuseUserQuery
anduseCasesQuery
hooks for improved filter handling.calculateStats
function inweb/src/pages/Profile/index.tsx
to compute total and ruled cases based on user data.Summary by CodeRabbit
Summary by CodeRabbit