Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Restore behaviour for displayCategory setting #44

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions javascripts/discourse/components/kanban/nav.gjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
import concatClass from "discourse/helpers/concat-class";
import i18n from "discourse-common/helpers/i18n";
import { displayConnector } from "../../lib/kanban-utilities";

export default class KanbanNav extends Component {
@service kanbanManager;
Expand All @@ -19,13 +20,15 @@ export default class KanbanNav extends Component {
}

<template>
<li>
<a
href={{this.href}}
class={{concatClass "kanban-nav" (if this.active "active")}}
>
{{i18n (themePrefix "menu_label")}}
</a>
</li>
{{#if (displayConnector this.kanbanManager.discoveryCategory.slug)}}
<li>
<a
href={{this.href}}
class={{concatClass "kanban-nav" (if this.active "active")}}
>
{{i18n (themePrefix "menu_label")}}
</a>
</li>
{{/if}}
</template>
}
12 changes: 8 additions & 4 deletions javascripts/discourse/services/kanban-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import buildTagLists from "../lib/kanban-list-builders/tags";

export default class KanbanManager extends Service {
@service router;
@service discovery;

@tracked fullscreen;

Expand Down Expand Up @@ -47,23 +48,26 @@ export default class KanbanManager extends Service {
}

get discoveryTopTags() {
return this.discoveryRouteAttribute("list.topic_list.top_tags");
return this.discovery.currentTopicList?.get("topic_list.top_tags");
}

get discoveryCategory() {
return this.discoveryRouteAttribute("category");
return this.discovery.category;
}

get discoveryTag() {
return this.discoveryRouteAttribute("tag");
return this.discovery.tag;
}

get active() {
return !!this.currentDescriptor;
}

get currentDescriptor() {
return this.discoveryParams && get(this.discoveryParams, "board");
return (
this.discovery.onDiscoveryRoute &&
this.router.currentRoute?.queryParams?.board
);
}

get listDefinitions() {
Expand Down