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

Allow both fullname and username search when DEFAULT_SHOW_FULL_NAME is true #23463

Merged
merged 32 commits into from
Mar 16, 2023

Conversation

HesterG
Copy link
Contributor

@HesterG HesterG commented Mar 14, 2023

This PR adds the ability to search both fullname and username for assignees, reviewers and author search boxes when the config DEFAULT_SHOW_FULL_NAME in app.ini is set to true. Which is originally raised here
And if DEFAULT_SHOW_FULL_NAME is set to false(default value), these search boxes will only show username.

Example:
When DEFAULT_SHOW_FULL_NAME = true

截屏2023-03-14 14 28 06

When DEFAULT_SHOW_FULL_NAME = false (default value)

截屏2023-03-14 14 29 37

The specific search boxes that adapts these changes include:

  1. Author, Assignee search boxes in pull requests tab and issues tab in repository

截屏2023-03-14 14 35 01

  1. Assigee and Author on milestones issue page (Added missing search box for author here)

截屏2023-03-14 14 38 20

  1. Assignee on issues and PR Sidebar, Reviewer on PR Sidebar

截屏2023-03-14 14 41 06

截屏2023-03-14 14 41 58

  1. Assignee when creating new issue

截屏2023-03-14 14 44 33

  1. Whitelisted users for pushing, Whitelisted users for merging and Whitelisted reviewers in Protected branch settings

截屏2023-03-14 14 48 56

截屏2023-03-14 14 49 02

截屏2023-03-14 14 49 21

  1. "Allowed users" in tags settings

截屏2023-03-14 14 50 11

@lunny lunny added the topic/ui Change the appearance of the Gitea UI label Mar 14, 2023
@lunny lunny added this to the 1.20.0 milestone Mar 14, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 14, 2023
@wxiaoguang
Copy link
Contributor

Is it possible to have a GetFullDisplayName, make it prepare and return everything according to DefaultShowFullName ?

Then:

  • GetFullDisplayName: show username (if no display name) or username (User Name)
  • GetDisplayName: only show User Name

@HesterG
Copy link
Contributor Author

HesterG commented Mar 14, 2023

Is it possible to have a GetFullDisplayName, make it prepare and return everything according to DefaultShowFullName ?

Then:

  • GetFullDisplayName: show username (if no display name) or username (User Name)
  • GetDisplayName: only show User Name

Currently logic for GetDisplayName is to return full name if it's not empty and DEFAULT_SHOW_FULL_NAME is set, and it is used in many places, so might not change it to return User Name.
And for the GetFullDisplayName idea, also thought about this before, but i found it hard to get everything prepared because the html might be different depending on the search box. Or do you mean something else?

@wxiaoguang
Copy link
Contributor

And for the GetFullDisplayName idea, also thought about this before, but i found it hard to get everything prepared because the html might be different depending on the search box. Or do you mean something else?

Does something like <span user-nane>username<span user-full-name>User Name</span></span> work? If no, ignore my comment.

@HesterG
Copy link
Contributor Author

HesterG commented Mar 14, 2023

And for the GetFullDisplayName idea, also thought about this before, but i found it hard to get everything prepared because the html might be different depending on the search box. Or do you mean something else?

Does something like <span user-nane>username<span user-full-name>User Name</span></span> work? If no, ignore my comment.

Yes i found it works. I misunderstood the search input box structure before, let me add a function to return this from backend.

@HesterG HesterG added the pr/wip This PR is not ready for review label Mar 14, 2023
@HesterG HesterG removed the pr/wip This PR is not ready for review label Mar 14, 2023
@HesterG
Copy link
Contributor Author

HesterG commented Mar 14, 2023

Added a commit to use GetSearchNameHTML instead of passing contexts, and this PR is ready for review again.

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Mar 15, 2023
@HesterG HesterG force-pushed the fullname-search branch 2 times, most recently from d3b581f to 3f8e447 Compare March 15, 2023 03:38
@HesterG
Copy link
Contributor Author

HesterG commented Mar 15, 2023

LGTM. And please resolve the conflicts.

resolved

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 15, 2023
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Mar 15, 2023
@GiteaBot GiteaBot removed the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Mar 16, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 16, 2023
@jolheiser
Copy link
Member

🎺 🤖

@jolheiser jolheiser merged commit 661e78b into go-gitea:main Mar 16, 2023
@jolheiser jolheiser removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 16, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 17, 2023
* giteaofficial/main:
  Use `<nav>` instead of `<div>` in the global navbar (go-gitea#23125)
  Fix aria.js bugs: incorrect role element problem, mobile focus problem, tippy problem (go-gitea#23450)
  [skip ci] Updated translations via Crowdin
  Make time tooltips interactive (go-gitea#23526)
  Update mini-css-extract-plugin, remove postcss (go-gitea#23520)
  Fix review comment context menu clipped bug (go-gitea#23523)
  Add absent repounits to create/edit repo API (go-gitea#23500)
  Fix tags sort by creation time (descending) on branch/tag dropdowns  (go-gitea#23491)
  Allow both fullname and username search when `DEFAULT_SHOW_FULL_NAME` is true (go-gitea#23463)
  Handle files starting with colons in WalkGitLog (go-gitea#22935)
  Change `Close` to either `Close issue` or `Close pull request` (go-gitea#23506)
  Update act (go-gitea#23512)
  Move pidfile creation from setting to web cmd package (go-gitea#23285)
@HesterG HesterG deleted the fullname-search branch March 17, 2023 09:42
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants