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

Fix DEFAULT_SHOW_FULL_NAME=false has no effect in commit list and commit graph page #30096

Merged
merged 2 commits into from Mar 28, 2024

Conversation

yp05327
Copy link
Contributor

@yp05327 yp05327 commented Mar 26, 2024

Fix #20446

This PR will fix the username in:
repo home page
image
repo commit list page
image
repo commit graph page
image
pr commit page
image

Will not fix:
wiki revisions page:
image
ps: the author name is FullName by default

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 26, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 26, 2024
@yp05327 yp05327 added the topic/ui Change the appearance of the Gitea UI label Mar 26, 2024
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Mar 26, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 26, 2024
@delvh
Copy link
Member

delvh commented Mar 26, 2024

Wait… DEFAULT_SHOW_FULL_NAME is used as ENABLE_SHOW_FULL_NAME?
Sounds a bit weird to me.

@delvh
Copy link
Member

delvh commented Mar 26, 2024

Do we need to rename the config key?
Or how should we handle that?

@wxiaoguang
Copy link
Contributor

Do we need to rename the config key? Or how should we handle that?

The "user name" display needs a complete rewriting. IMO it could be used by 3 methods:

  1. UserName
  2. GetDisplayNameFull():
    • If DEFAULT_SHOW_FULL_NAME == true:
      • UserName if FullName is empty; UserName (FullName) if FullName is not empty
    • If DEFAULT_SHOW_FULL_NAME == false:
      • UserName
  3. GetDisplayNameShort():
    • UserName if FullName is empty; FullName if FullName is not empty
    • Actually I think this case should be avoided for most cases, it only cause confusing.

@silverwind
Copy link
Member

silverwind commented Mar 26, 2024

Yes, it does sound like this logic belongs in Go, not in the templates. But I guess I would accept current patch too as a short-term measure.

@yp05327
Copy link
Contributor Author

yp05327 commented Mar 27, 2024

Actually, we already have a function (same to GetDisplayNameFull mentioned above ) for User:
image

I'm confuseing which one to use, commit.Author.Name/FullName or commit.User.Name/FullName

Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

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

I agree with others that this is a suitable interim approach

@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 28, 2024
@techknowlogick techknowlogick merged commit 6103623 into go-gitea:main Mar 28, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Mar 28, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 29, 2024
* upstream/main:
  Remove fomantic checkbox module (go-gitea#30162)
  Refactor topic Find functions and add more tests for pagination (go-gitea#30127)
  replace jquery-minicolors with coloris (go-gitea#30055)
  Add API for `Variables` (go-gitea#29520)
  Fix `DEFAULT_SHOW_FULL_NAME=false` has no effect in commit list and commit graph page (go-gitea#30096)
  Fix migration v292 (go-gitea#30153)
  Adjust VS Code debug filename match in .gitignore (go-gitea#30158)
  Prevent re-review and dismiss review actions on closed and merged PRs (go-gitea#30065)
  Render code tags in commit messages (go-gitea#30146)
  Bump `@github/relative-time-element` to v4.4.0 (go-gitea#30154)
  Migrate font-family to tailwind (go-gitea#30118)
  Move from `max( id )` to `max( index )` for latest commit statuses (go-gitea#30076)
  Remember login for a month by default (go-gitea#30150)
@wxiaoguang wxiaoguang modified the milestones: 1.23.0, 1.22.0 Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/templates This PR modifies the template files size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Commits Showing Author By Full Name Not Username
7 participants