Skip to content
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

Sorted autocomplete #1918

Merged
merged 11 commits into from Jan 18, 2022
Merged

Sorted autocomplete #1918

merged 11 commits into from Jan 18, 2022

Conversation

pfeuffer
Copy link
Member

@pfeuffer pfeuffer commented Jan 12, 2022

Proposed changes

Users, groups, repositories and repository roles have been sorted in the rest layer by default if no other sort option was given. In the layers "below" (aka the manager classes or the dao), the collections have been unsorted. This led to the effect, that the autocomplete resource, which did not sort all values beforehand, returned unsorted results. As a sideeffect, direct matches for an input could occur at a random position or not at all (as reported in #1695), when there were enough other matches.

With this pull request the databases for users, groups, repositories and repository roles will use instances of TreeMap instead of LinkedHashMap internally, so that these values are sorted implicitly (by id respectively name for users, groups and repository roles and namespace/name for repositories).

Due to this change the default sort applied in the rest layer could be removed.

Fixes #1695

Your checklist for this pull request

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Contributor:

  • PR is well described and the description can be used as a commit message on squash
  • Related issues linked to PR if existing and labels set
  • New code is covered with unit tests
  • Changelog entry file created in gradle/changelog or CHANGELOG.md is updated for plugins
  • Feature has been tested with different permissions

Reviewer:

  • The clean code principles are respected (CleanCode)
  • All new code/logic is implemented on the right spot / "Should this be done here?"
  • UI changes fits into the layout
  • The UI views / components are responsive (mobile views)
  • Correct translations are available

Checklist for branch merge request (not required for forks)

@pfeuffer pfeuffer marked this pull request as ready for review January 13, 2022 15:06
@sonarcloud
Copy link

sonarcloud bot commented Jan 14, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

87.1% 87.1% Coverage
0.0% 0.0% Duplication

@sdorra sdorra merged commit f2a1eff into develop Jan 18, 2022
@sdorra sdorra deleted the feature/sorted_autocomplete branch January 18, 2022 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autocomplete in groups doesn't always show exact match
2 participants