UX: Update "get a room" composer message (#14104)

This commit is contained in:
Kris 2021-08-23 18:34:23 -04:00 committed by GitHub
parent 8fa4849abc
commit bde6f7e9b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 13 deletions

View File

@ -86,6 +86,12 @@ export default Component.extend({
topic: topic, topic: topic,
}); });
}, },
switchPM(message) {
this.composer.set("action", "privateMessage");
this.composer.set("targetRecipients", message.reply_username);
this._removeMessage(message);
},
}, },
// Resets all active messages. // Resets all active messages.

View File

@ -1,3 +1,8 @@
{{#each messages as |message|}} {{#each messages as |message|}}
{{composer-message message=message closeMessage=(action "closeMessage") shareModal=(action "shareModal")}} {{composer-message
message=message
closeMessage=(action "closeMessage")
shareModal=(action "shareModal")
switchPM=(action "switchPM")
}}
{{/each}} {{/each}}

View File

@ -0,0 +1,10 @@
<a href {{action closeMessage message}} class="close">{{d-icon "times"}}</a>
{{html-safe message.body}}
{{d-button
class="btn-primary"
label="user.private_message"
icon="envelope"
action=(action switchPM message)
}}

View File

@ -109,7 +109,8 @@
background-color: var(--tertiary-low); background-color: var(--tertiary-low);
} }
&.dominating-topic-message { &.dominating-topic-message,
&.get-a-room {
bottom: unset; bottom: unset;
padding: 2.25em 6em 2.5em 2.25em; padding: 2.25em 6em 2.5em 2.25em;
p { p {

View File

@ -526,14 +526,7 @@ en:
dominating_topic: Youve posted more than %{percent}% of the replies here, is there anyone else you would like to hear from? dominating_topic: Youve posted more than %{percent}% of the replies here, is there anyone else you would like to hear from?
get_a_room: | get_a_room: Youve replied %{count} times to @%{reply_username}, did you know you could send them a personal message instead?
### Encourage everyone to get involved in the conversation
Youve replied %{count} times to @%{reply_username} in this particular topic!
A great discussion includes many voices and perspectives. Can you get anybody else involved?
And dont forget, if youd like to continue your conversation with this particular user at length outside of public view, [send them a personal message](%{base_path}/u/%{reply_username}).
too_many_replies: | too_many_replies: |
### You have reached the reply limit for this topic ### You have reached the reply limit for this topic

View File

@ -176,9 +176,10 @@ class ComposerMessagesFinder
{ {
id: 'get_a_room', id: 'get_a_room',
templateName: 'education', templateName: 'get-a-room',
wait_for_typing: true, wait_for_typing: true,
extraClass: 'education-message', reply_username: reply_username,
extraClass: 'education-message get-a-room',
body: PrettyText.cook( body: PrettyText.cook(
I18n.t( I18n.t(
'education.get_a_room', 'education.get_a_room',

View File

@ -423,7 +423,7 @@ describe ComposerMessagesFinder do
expect(message).to be_present expect(message).to be_present
expect(message[:id]).to eq('get_a_room') expect(message[:id]).to eq('get_a_room')
expect(message[:wait_for_typing]).to eq(true) expect(message[:wait_for_typing]).to eq(true)
expect(message[:templateName]).to eq('education') expect(message[:templateName]).to eq('get-a-room')
expect(UserHistory.exists_for_user?(user, :notified_about_get_a_room)).to eq(true) expect(UserHistory.exists_for_user?(user, :notified_about_get_a_room)).to eq(true)
end end