feat: user preference url and sort order change#6505
feat: user preference url and sort order change#6505sriramveeraghanta merged 2 commits intopreviewfrom
Conversation
WalkthroughThe pull request introduces changes to the workspace user preferences system in a Django application. The modifications involve renaming URL paths from "user-preferences" to "sidebar-preferences", updating the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
apiserver/plane/app/views/workspace/user_preference.py (1)
Line range hint
41-49: Fix indentation of bulk_create operation.The bulk_create operation is incorrectly indented and should be outside the for loop to avoid redundant operations.
- preference = WorkspaceUserPreference.objects.bulk_create( - [ - WorkspaceUserPreference( - key=key, user=request.user, workspace=workspace - ) - for key in create_preference_keys - ], - batch_size=10, - ignore_conflicts=True, - ) + preference = WorkspaceUserPreference.objects.bulk_create( + [ + WorkspaceUserPreference( + key=key, user=request.user, workspace=workspace + ) + for key in create_preference_keys + ], + batch_size=10, + ignore_conflicts=True, + )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apiserver/plane/app/urls/workspace.py(1 hunks)apiserver/plane/app/views/workspace/user_preference.py(1 hunks)apiserver/plane/db/models/workspace.py(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- apiserver/plane/app/urls/workspace.py
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: lint-apiserver
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
apiserver/plane/db/models/workspace.py (1)
395-396: Verify the intention behind enum value changes.The PROJECTS and ANALYTICS choices were removed and re-added in the same position. If this change was intended to modify the sort order, consider:
- Adding a comment explaining the rationale
- Using the
sort_orderfield instead of relying on enum order✅ Verification successful
No issues with enum value changes
The removal and re-addition of PROJECTS and ANALYTICS enum values in the same position:
- Maintains a logical grouping (main sections followed by features)
- Doesn't affect functionality as TextChoices uses string values
- Has proper
sort_orderfields available for explicit ordering when needed🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if these enum values were previously defined in a different order git log -p -- apiserver/plane/db/models/workspace.py | grep -A 5 -B 5 "PROJECTS = \|ANALYTICS ="Length of output: 0
Script:
#!/bin/bash # Get the complete enum definition and surrounding context echo "=== Enum Definition ===" ast-grep --pattern 'class UserPreferenceKeys$$$' apiserver/plane/db/models/workspace.py # Check for any sort_order field in the model echo -e "\n=== Sort Order Fields ===" rg "sort_order" apiserver/plane/db/models/workspace.py # Look for usages of these enum values echo -e "\n=== Enum Value Usage ===" rg "PROJECTS.*ANALYTICS|ANALYTICS.*PROJECTS" --type pyLength of output: 490
Script:
#!/bin/bash # Get the enum definition with a simpler pattern echo "=== Enum Definition ===" rg -A 10 -B 2 "class UserPreferenceKeys" apiserver/plane/db/models/workspace.pyLength of output: 546
Description
This PR will modify the URL and will return different sort orders of side bar user preference
Summary by CodeRabbit
New Features
Refactor