Skip to content

Add in:users as a search filter to limit searches to users - #40413

Merged
nickvergessen merged 7 commits into
masterfrom
feature/sorbaugh/in-user-search
Oct 12, 2023
Merged

Add in:users as a search filter to limit searches to users#40413
nickvergessen merged 7 commits into
masterfrom
feature/sorbaugh/in-user-search

Conversation

@sorbaugh

@sorbaughsorbaugh commented Sep 14, 2023

Copy link
Copy Markdown
Contributor

Summary

Add in:users filter to search bar via SearchProvider to have a mechanism to limit the search load in settings/users.

TODO

  • Add new UserSearch Provider
  • Trim search query before executing actual search

Checklist

Comment threadapps/settings/lib/Search/UserSearch.php Outdated
Comment threadapps/settings/lib/Search/UserSearch.php Outdated
@AndyScherzingerAndyScherzinger changed the title Feature/sorbaugh/in user searchAdd in:users as a search filter to limit searches to usersSep 14, 2023
@AndyScherzingerAndyScherzinger added this to the Nextcloud 28 milestone Sep 14, 2023
@AndyScherzinger

Copy link
Copy Markdown
Member

/backport to stable27

@AndyScherzinger

Copy link
Copy Markdown
Member

/backport to stable26

@AndyScherzinger

Copy link
Copy Markdown
Member

/backport to stable25

@artongeartonge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and the code looks good.
Still need to address the copyright comment.

Enjoy the rebase !

@sorbaugh
sorbaughforce-pushed the feature/sorbaugh/in-user-search branch from bf15926 to 2f37665CompareOctober 11, 2023 08:23
@AndyScherzinger
AndyScherzingerforce-pushed the feature/sorbaugh/in-user-search branch from 3999dbf to 280a178CompareOctober 11, 2023 09:33
@AndyScherzinger

Copy link
Copy Markdown
Member

/compile amend /

@nextcloud-command
nextcloud-commandforce-pushed the feature/sorbaugh/in-user-search branch from 280a178 to 82e2a50CompareOctober 11, 2023 09:55
Comment on lines +66 to +70
$this->settingsManager = $settingsManager;
$this->groupManager = $groupManager;
$this->urlGenerator = $urlGenerator;
$this->userManager = $userManager;
$this->accountManager = $accountManager;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am overseeing something, but they are all not being used?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaned this one up, thanks for pointing it out 👍


return SearchResult::complete(
$this->l->t('Users'),
[]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand how it works correctly, that this search plugin intentionally returns an empty result set? For users page it make sense as results are shown on the content and not in the pull down. Maybe I am misinterpreting how that search works though.

The naming would block potential valid future searches for users, although there is the contacts menu for this. It's acceptable, but want to point it out.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I agree this is somewhat strange. ATM the main goal is for a customer to more efficiently search for contacts without triggering everything. You correctly pointed out that the goal is to not have a list of users shown in the pulldown. See commit where how this used to be solved (and how we want to revisit in the future)

54a21d4

@blizzzblizzz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the copyright info ;)

@sorbaugh
sorbaughforce-pushed the feature/sorbaugh/in-user-search branch 2 times, most recently from 3194f6b to f712098CompareOctober 11, 2023 14:02
@blizzz

Copy link
Copy Markdown
Member

/compile /

sorbaughand others added 6 commits October 12, 2023 08:56
Add regex to prevent filter collision in user-list page
Usage:
1. Type a string in the search bar
2. Add in:users to display only users in the search result
…chlist dialog. Will revisit in future search result list in future issue.
Usage:
1. Type a string in the search bar
2. Add in:users filter to avoid unnecessary searches in other apps
Usage:
1. Type a string in the search bar
2. Add in:users filter to avoid unnecessary searches in other apps
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Signed-off-by: sorbaugh <stephan.orbaugh@nextcloud.com>
@AndyScherzinger
AndyScherzingerforce-pushed the feature/sorbaugh/in-user-search branch from 7dea2a4 to bdf0fe6CompareOctober 12, 2023 06:58
@AndyScherzinger

Copy link
Copy Markdown
Member

/compile /

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@nickvergessen
nickvergessen merged commit 62eafdb into masterOct 12, 2023
@nickvergessen
nickvergessen deleted the feature/sorbaugh/in-user-search branch October 12, 2023 08:29
@welcome

welcomeBot commented Oct 12, 2023

Copy link
Copy Markdown

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

@nickvergessen

Copy link
Copy Markdown
Member

/backport ab81cd1,65c70d7cc6425af0bf202d70c67eabd579d913a6,c38bafba9e13e4e735ed2d6698b6c4f5d9efc7d5,a3a599855e20b60627ac4e65fed8fdfa6b2c04f8,f66e4ee07246b285f79173c300de943b3a857bad,bdf0fe6a03beccc58a119f05d9cdb7ab643ebcfd to stable27

@blizzz

Copy link
Copy Markdown
Member

Backportbot seems to have day off :-/ fastest to do it manually it seems

@backportbot-nextcloud

Copy link
Copy Markdown

The backport to stable27 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable27
git pull origin stable27
# Create the new backport branch
git checkout -b fix/foo-stable27
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

1 similar comment
@backportbot-nextcloud

Copy link
Copy Markdown

The backport to stable27 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable27
git pull origin stable27
# Create the new backport branch
git checkout -b fix/foo-stable27
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@backportbot-nextcloud

Copy link
Copy Markdown

The backport to stable26 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable26
git pull origin stable26
# Create the new backport branch
git checkout -b fix/foo-stable26
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

@backportbot-nextcloud

Copy link
Copy Markdown

The backport to stable25 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable25
git pull origin stable25
# Create the new backport branch
git checkout -b fix/foo-stable25
# Cherry pick the change from the commit sha1 of the change against the default branch# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable25

More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add in:users as a search filter to limit searches to users

7 participants

@sorbaugh@AndyScherzinger@blizzz@nickvergessen@artonge@nfebe@nextcloud-command