-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Show visibility status of email in own profile #23900
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
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
854b52c
Show visibility status of email in own profile
n0toose 0b896bc
Move icon to the right side of email address
n0toose 11e5e08
Fix logic errors (?), add hints, add hyperlink
n0toose 3ab86d7
Improve English
n0toose 581ba7c
Formatting changes
n0toose 2093021
Make hints more consistent with user setting hints
n0toose 16f85da
Extra: Make hint in Profile Settings more consistent
n0toose fbfc9c6
Use .ShowUserEmail consistently
n0toose 6236560
Make string more accurate
n0toose 8dadb81
Make icon right-aligned
n0toose f2b17e8
Replace Globe with Unlock icon
n0toose bcb84c3
Use 'Limited' keyword consistently
n0toose 0fda639
Prefer 'authenticated' over 'logged in'
n0toose a47057f
Update options/locale/locale_en-US.ini
silverwind e8e2d78
Merge branch 'main' into add-lock-for-email
n0toose d4f24a9
Fix tests (?), improve comments
n0toose d203ae0
Merge branch 'main' into add-lock-for-email
n0toose 8117462
Update options/locale/locale_en-US.ini
silverwind 1c1a6b3
Merge branch 'main' into add-lock-for-email
silverwind File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,42 +50,42 @@ func TestSettingShowUserEmailProfile(t *testing.T) { | |
|
||
setting.UI.ShowUserEmail = true | ||
|
||
// user1 can see self | ||
// user1 can see own visible email | ||
session := loginUser(t, "user1") | ||
req := NewRequest(t, "GET", "/user1") | ||
resp := session.MakeRequest(t, req, http.StatusOK) | ||
htmlDoc := NewHTMLParser(t, resp.Body) | ||
assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "[email protected]") | ||
|
||
// user1 can not see user2 | ||
// user1 can not see user2's hidden email | ||
req = NewRequest(t, "GET", "/user2") | ||
resp = session.MakeRequest(t, req, http.StatusOK) | ||
htmlDoc = NewHTMLParser(t, resp.Body) | ||
// Should not contain even if the user visits their own profile page | ||
// Should only contain if the user visits their own profile page | ||
assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "[email protected]") | ||
|
||
// user2 can see user1 | ||
// user2 can see user1's visible email | ||
session = loginUser(t, "user2") | ||
req = NewRequest(t, "GET", "/user1") | ||
resp = session.MakeRequest(t, req, http.StatusOK) | ||
htmlDoc = NewHTMLParser(t, resp.Body) | ||
assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "[email protected]") | ||
|
||
// user2 can not see self | ||
// user2 can see own hidden email | ||
session = loginUser(t, "user2") | ||
req = NewRequest(t, "GET", "/user2") | ||
resp = session.MakeRequest(t, req, http.StatusOK) | ||
htmlDoc = NewHTMLParser(t, resp.Body) | ||
assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "[email protected]") | ||
assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "[email protected]") | ||
|
||
setting.UI.ShowUserEmail = false | ||
|
||
// user1 can not see self | ||
// user1 can see own (now hidden) email | ||
session = loginUser(t, "user1") | ||
req = NewRequest(t, "GET", "/user1") | ||
resp = session.MakeRequest(t, req, http.StatusOK) | ||
htmlDoc = NewHTMLParser(t, resp.Body) | ||
assert.NotContains(t, htmlDoc.doc.Find(".user.profile").Text(), "[email protected]") | ||
assert.Contains(t, htmlDoc.doc.Find(".user.profile").Text(), "[email protected]") | ||
|
||
setting.UI.ShowUserEmail = showUserEmail | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.