UX: don't display tag notification menu on category page. (#11989)

If both category and tag are selected then we shouldn't display a notification menu.
This commit is contained in:
Vinoth Kannan 2021-02-05 09:19:00 +05:30 committed by GitHub
parent a6e3877b8a
commit 792c2b94f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 6 deletions

View File

@ -22,6 +22,12 @@ export default Component.extend(FilterModeMixin, {
return category && this.currentUser;
},
// don't show tag notification menu on tag intersections
@discourseComputed("tagNotification", "additionalTags")
showTagNotifications(tagNotification, additionalTags) {
return tagNotification && !additionalTags;
},
@discourseComputed("category", "createTopicDisabled")
categoryReadOnlyBanner(category, createTopicDisabled) {
if (category && this.currentUser && createTopicDisabled) {

View File

@ -65,15 +65,15 @@
{{/if}}
{{#if tag}}
{{#if tagNotification}}
{{#unless additionalTags}}
{{!-- don't show tag notification menu on tag intersections --}}
{{#unless category}}
{{!-- don't show tag notification menu on category pages --}}
{{#if showTagNotifications}}
{{tag-notifications-button
onChange=changeTagNotificationLevel
value=tagNotification.notification_level
}}
{{/unless}}
{{/if}}
{{/if}}
{{/unless}}
{{/if}}
</div>
</div>

View File

@ -77,6 +77,28 @@ acceptance("Tags", function (needs) {
);
server.put("/topics/bulk", () => helper.response({}));
server.get("/tags/c/faq/4/test/l/latest.json", () => {
return helper.response({
users: [],
primary_groups: [],
topic_list: {
can_create_topic: true,
draft: null,
draft_key: "new_topic",
draft_sequence: 1,
per_page: 30,
tags: [
{
id: 1,
name: "planters",
topic_count: 1,
},
],
topics: [],
},
});
});
});
test("list the tags", async function (assert) {
@ -95,6 +117,11 @@ acceptance("Tags", function (needs) {
await click(".dismiss-read-modal button.btn-primary");
assert.ok(invisible(".dismiss-read-modal"));
});
test("hide tag notifications menu", async function (assert) {
await visit("/tags/c/faq/4/test");
assert.ok(invisible(".tag-notifications-button"));
});
});
acceptance("Tags listed by group", function (needs) {