mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:07:43 +08:00
UX: Split hide_profile_and_presence
user option (#29632)
It splits the hide_profile_and_presence user option and the default_hide_profile_and_presence site setting for more granular control. It keeps the option to hide the profile under /u/username/preferences/interface and adds the presence toggle in the quick user menu. Co-authored-by: Régis Hanol <regis@hanol.fr>
This commit is contained in:
@ -260,7 +260,7 @@ export default class Chat extends Service {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.currentUser.user_option?.hide_profile_and_presence) {
|
||||
if (this.currentUser.user_option?.hide_presence) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ describe UsersController do
|
||||
before { sign_in(user) }
|
||||
|
||||
it "returns that the user can message themselves" do
|
||||
user.user_option.update!(hide_profile_and_presence: false)
|
||||
user.user_option.update!(hide_profile: false)
|
||||
user.user_option.update!(chat_enabled: true)
|
||||
get "/u/#{user.username}/card.json"
|
||||
expect(response).to be_successful
|
||||
@ -76,7 +76,7 @@ describe UsersController do
|
||||
end
|
||||
|
||||
it "returns that the user can message themselves when the profile is hidden" do
|
||||
user.user_option.update!(hide_profile_and_presence: true)
|
||||
user.user_option.update!(hide_profile: true)
|
||||
user.user_option.update!(chat_enabled: true)
|
||||
get "/u/#{user.username}/card.json"
|
||||
expect(response).to be_successful
|
||||
@ -87,7 +87,7 @@ describe UsersController do
|
||||
context "when hidden users" do
|
||||
before do
|
||||
sign_in(another_user)
|
||||
user.user_option.update!(hide_profile_and_presence: true)
|
||||
user.user_option.update!(hide_profile: true)
|
||||
end
|
||||
|
||||
it "returns the correct partial response when the user has chat enabled" do
|
||||
|
@ -21,7 +21,7 @@ describe Chat::ChatablesSerializer do
|
||||
end
|
||||
|
||||
context "with hidden profile" do
|
||||
before { user_1.user_option.update!(hide_profile_and_presence: true) }
|
||||
before { user_1.user_option.update!(hide_profile: true) }
|
||||
|
||||
it "doesn’t include status" do
|
||||
serializer =
|
||||
|
Reference in New Issue
Block a user