UX: PM inboxes being expanded incorrectly when viewing tags. (#14478)

Follow-up to 9d5da2b383
This commit is contained in:
Alan Guo Xiang Tan 2021-10-01 10:48:30 +08:00 committed by GitHub
parent 62b27ea9f3
commit dad4781806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 4 deletions

View File

@ -12,7 +12,8 @@ export default Controller.extend({
pmView: false,
viewingSelf: alias("user.viewingSelf"),
isGroup: equal("pmView", "groups"),
isGroup: equal("pmView", "group"),
isPersonal: equal("pmView", "user"),
group: null,
groupFilter: alias("group.name"),
currentPath: alias("router._router.currentPath"),

View File

@ -6,7 +6,7 @@
{{/link-to}}
</li>
{{#unless group}}
{{#if isPersonal}}
<li class="archive">
{{#link-to "userPrivateMessages.sent" model}}
{{i18n "user.messages.sent"}}
@ -32,7 +32,7 @@
{{i18n "user.messages.archive"}}
{{/link-to}}
</li>
{{/unless}}
{{/if}}
{{#each model.groups as |group|}}
{{#if group.has_messages}}
@ -43,7 +43,7 @@
{{/link-to}}
</li>
{{#if (eq groupFilter group.name)}}
{{#if (and isGroup (eq groupFilter group.name))}}
{{#if viewingSelf}}
<li class="archive">
{{#link-to "userPrivateMessages.groupNew" group.name class="new"}}

View File

@ -73,6 +73,10 @@ acceptance(
});
needs.pretender((server, helper) => {
server.get("/tags/personal_messages/:username.json", () => {
return helper.response({ tags: [] });
});
server.get("/t/13.json", () => {
const response = { ...fixturesByUrl["/t/12/1.json"] };
response.suggested_group_name = "awesome_group";
@ -268,6 +272,16 @@ acceptance(
);
};
test("viewing messages filtered by tags", async function (assert) {
await visit("/u/charlie/messages/tags");
assert.equal(
count(".action-list li"),
3,
"it does not expand personal or group inbox"
);
});
test("incoming group archive message acted by current user", async function (assert) {
await visit("/u/charlie/messages");