-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Show the username as a fallback on feeds if full name is blank #10438
Show the username as a fallback on feeds if full name is blank #10438
Conversation
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.
Not that we're the most efficient system but perhaps it would be better to restructure this so we only do the trimspace if the setting is set.
To be honest I'm not really sure what the trim is there for. I guess if the user puts in a full name of just spaces we should ignore it, but surely that validation should be done at setting time? |
Codecov Report
@@ Coverage Diff @@
## master #10438 +/- ##
==========================================
- Coverage 43.69% 43.68% -0.02%
==========================================
Files 586 586
Lines 81411 81411
==========================================
- Hits 35574 35564 -10
- Misses 41430 41437 +7
- Partials 4407 4410 +3
Continue to review full report at Codecov.
|
@zeripath String trimming in both the user and action models are now done only if |
models/action.go
Outdated
return a.GetActFullName() | ||
trimmedFullName := strings.TrimSpace(a.GetActFullName()) | ||
if len(trimmedFullName) > 0 { | ||
return a.GetActFullName() |
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.
return a.GetActFullName() | |
return trimmedFullName |
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.
Doh! 🤦♂
e4a55fa
to
a92ff62
Compare
1ff004c
to
3e6af9f
Compare
3e6af9f
to
b142219
Compare
While the
DEFAULT_SHOW_FULL_NAME
works well, there's a bug on the feed/dashboard page that causes the username not be used as a fallback and nothing shown instead:This PR copies the logic from
DisplayName
inmodels/user.go:741
to return the username as a fallback for the template:(where
review
is the username, andJimbo
as a user with the full name set)I'm happy to make a backport too. 😃