-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
When a location is requested by ID, sort its children location by name #421
When a location is requested by ID, sort its children location by name #421
Conversation
…e, it helps to organize the user interface.
WalkthroughThe pull request modifies the Changes
Assessment against linked issues
Security Recommendations🔒 Security Insights for this Pull Request:
Recommendation: Conduct thorough testing to validate the sorting implementation, especially with edge cases involving special characters and large datasets. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
backend/internal/data/repo/repo_locations.go (1)
167-169
: Sorting child locations by name is a welcome improvement!
- Sorting logic looks correct, and it aligns with the PR objective to consistently display child locations in alphabetical order.
- Performance hint: For very large sets of child locations, ensure that an index is created on the
name
field at the database level to preserve efficient query performance.- Security advice: Since this code deals with hierarchical location data, verify that the user or service has the proper authorization to see all child locations. While
ent
helps mitigate SQL injection via parameterized queries, always confirm that role-based access checks or location-ownership checks are in place to prevent unauthorized data exposure.
What type of PR is this?
What this PR does / why we need it:
It sorts the results of requests of locations by ID, it sorts the child location. This way it appears sorted by name in the user interface as almost everything is sorted by name. It helps to find and navigate through locations making the order predictable.
Which issue(s) this PR fixes:
Fixes #412
Testing
Access a location and add children locations to it, no matter the order the locations are inserted it needs to appear sorted by name.
Summary by CodeRabbit
New Features
Bug Fixes