mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 02:03:40 +08:00
FIX: close user card after clicking Message button
This was primarily an issue on mobile, where after clicking the "Messsage" button in the user card, the composer would load behind the user card overlay.
This commit is contained in:
parent
310a8ac242
commit
4d6eacac5c
|
@ -184,6 +184,14 @@ export default Ember.Component.extend(
|
|||
this._close();
|
||||
},
|
||||
|
||||
composePM(user, post) {
|
||||
this._close();
|
||||
|
||||
Ember.getOwner(this)
|
||||
.lookup("router:main")
|
||||
.send("composePrivateMessage", user, post);
|
||||
},
|
||||
|
||||
cancelFilter() {
|
||||
const postStream = this.postStream;
|
||||
postStream.cancelFilter();
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
<li class='compose-pm'>
|
||||
{{d-button
|
||||
class="btn-primary"
|
||||
action=(route-action "composePrivateMessage" user post)
|
||||
action=(action "composePM" user post)
|
||||
icon="envelope"
|
||||
label="user.private_message"}}
|
||||
</li>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
acceptance("User Card");
|
||||
acceptance("User Card", { loggedIn: true });
|
||||
|
||||
QUnit.test("user card", async assert => {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
|
@ -16,4 +16,13 @@ QUnit.test("user card", async assert => {
|
|||
DiscourseURL.routeTo.calledWith("/u/eviltrout"),
|
||||
"it should navigate to the user profile"
|
||||
);
|
||||
|
||||
await click("a[data-user-card=charlie]:first");
|
||||
assert.ok(visible("#user-card"), "card should appear");
|
||||
|
||||
await click(".card-content .compose-pm button");
|
||||
assert.ok(
|
||||
invisible("#user-card"),
|
||||
"user card dismissed after hitting Message button"
|
||||
);
|
||||
});
|
||||
|
|
|
@ -2057,6 +2057,13 @@ export default {
|
|||
avatar_template: "/images/avatar.png",
|
||||
post_count: 4
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
username: "charlie",
|
||||
uploaded_avatar_id: 5275,
|
||||
avatar_template: "/images/avatar.png",
|
||||
post_count: 1
|
||||
},
|
||||
{
|
||||
id: 3704,
|
||||
username: "mojzis",
|
||||
|
|
Loading…
Reference in New Issue
Block a user