diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index 3118ddb..0000000
--- a/.eslintrc
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "extends": "eslint-config-discourse",
- "ignorePatterns": ["javascripts/vendor/*"],
- "globals": {
- "settings": "readonly",
- "themePrefix": "readonly"
- }
-}
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
new file mode 100644
index 0000000..1e0f0f5
--- /dev/null
+++ b/.eslintrc.cjs
@@ -0,0 +1 @@
+module.exports = require("@discourse/lint-configs/eslint-theme");
diff --git a/.prettierrc b/.prettierrc
deleted file mode 100644
index 8a1423e..0000000
--- a/.prettierrc
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "plugins": ["prettier-plugin-ember-template-tag"],
- "overrides": [
- {
- "files": "*.gjs",
- "options": {
- "parser": "ember-template-tag"
- }
- },
- {
- "files": "*.gts",
- "options": {
- "parser": "ember-template-tag"
- }
- }
- ]
-}
diff --git a/.prettierrc.cjs b/.prettierrc.cjs
new file mode 100644
index 0000000..df3d063
--- /dev/null
+++ b/.prettierrc.cjs
@@ -0,0 +1 @@
+module.exports = require("@discourse/lint-configs/prettier");
\ No newline at end of file
diff --git a/.streerc b/.streerc
new file mode 100644
index 0000000..88c0133
--- /dev/null
+++ b/.streerc
@@ -0,0 +1,2 @@
+--print-width=100
+--plugins=plugin/trailing_comma,plugin/disable_auto_ternary
\ No newline at end of file
diff --git a/.template-lintrc.cjs b/.template-lintrc.cjs
new file mode 100644
index 0000000..5355ea0
--- /dev/null
+++ b/.template-lintrc.cjs
@@ -0,0 +1 @@
+module.exports = require("@discourse/lint-configs/template-lint");
diff --git a/.template-lintrc.js b/.template-lintrc.js
deleted file mode 100644
index a558b8e..0000000
--- a/.template-lintrc.js
+++ /dev/null
@@ -1,4 +0,0 @@
-module.exports = {
- plugins: ["ember-template-lint-plugin-discourse"],
- extends: "discourse:recommended",
-};
diff --git a/javascripts/discourse/components/kanban/card.gjs b/javascripts/discourse/components/kanban/card.gjs
index d972742..eec9ced 100644
--- a/javascripts/discourse/components/kanban/card.gjs
+++ b/javascripts/discourse/components/kanban/card.gjs
@@ -1,22 +1,75 @@
import Component from "@glimmer/component";
-import i18n from "discourse-common/helpers/i18n";
-import eq from "truth-helpers/helpers/eq";
-import renderTag from "discourse/lib/render-tag";
-import TopicStatus from "discourse/components/topic-status";
-import { renderAvatar } from "discourse/helpers/user-avatar";
-import { htmlSafe } from "@ember/template";
-import icon from "discourse-common/helpers/d-icon";
-import PluginOutlet from "discourse/components/plugin-outlet";
-import { hash } from "@ember/helper";
-import { getOwner } from "@ember/application";
-import concatClass from "discourse/helpers/concat-class";
import { tracked } from "@glimmer/tracking";
-import { action } from "@ember/object";
+import { getOwner } from "@ember/application";
+import { hash } from "@ember/helper";
import { on } from "@ember/modifier";
+import { action } from "@ember/object";
import { inject as service } from "@ember/service";
+import { htmlSafe } from "@ember/template";
+import PluginOutlet from "discourse/components/plugin-outlet";
+import TopicStatus from "discourse/components/topic-status";
+import concatClass from "discourse/helpers/concat-class";
+import { renderAvatar } from "discourse/helpers/user-avatar";
+import renderTag from "discourse/lib/render-tag";
+import icon from "discourse-common/helpers/d-icon";
import not from "truth-helpers/helpers/not";
export default class KanbanCard extends Component {
+ @service kanbanManager;
+
+ @tracked dragging;
+
+ // TODO - FIX THIS ONCE CORE EXPORTS IT PROPERLY
+ formatDate = getOwner(this).resolveRegistration("helper:format-date");
+ categoryBadge = getOwner(this).resolveRegistration("helper:category-badge");
+
+ @action
+ dragStart(event) {
+ this.dragging = true;
+ this.args.setDragData({ topic: this.args.topic });
+ event.dataTransfer.dropEffect = "move";
+ event.stopPropagation();
+ }
+
+ @action
+ dragEnd(event) {
+ this.dragging = false;
+ event.stopPropagation();
+ }
+
+ get showTags() {
+ return settings.show_tags && this.tags.length;
+ }
+
+ get cardStyle() {
+ return settings.card_style;
+ }
+
+ get tags() {
+ const definitionTags = this.args.definition.params.tags || [];
+ const discoveryTag = this.kanbanManager.discoveryTag?.id;
+ const listTags = [...definitionTags, discoveryTag];
+
+ return this.args.topic.tags
+ .reject((t) => listTags?.includes(t))
+ .map((t) => renderTag(t));
+ }
+
+ get showCategory() {
+ const definitionCategory = this.args.definition.params.category;
+ const discoveryCategory = this.kanbanManager.discoveryCategory;
+ return !(definitionCategory || discoveryCategory);
+ }
+
+ get showDetailed() {
+ return this.cardStyle === "detailed";
+ }
+
+ get lastPoster() {
+ return this.args.topic.posters.find((poster) =>
+ poster.extras?.includes("latest")
+ );
+ }
-
- @service kanbanManager;
-
- @tracked dragging;
-
- // TODO - FIX THIS ONCE CORE EXPORTS IT PROPERLY
- formatDate = getOwner(this).resolveRegistration("helper:format-date");
- categoryBadge = getOwner(this).resolveRegistration("helper:category-badge");
-
- @action
- dragStart(event) {
- this.dragging = true;
- this.args.setDragData({ topic: this.args.topic });
- event.dataTransfer.dropEffect = "move";
- event.stopPropagation();
- }
-
- @action
- dragEnd(event) {
- this.dragging = false;
- event.stopPropagation();
- }
-
- get showTags() {
- return settings.show_tags && this.tags.length;
- }
-
- get cardStyle() {
- return settings.card_style;
- }
-
- get tags() {
- const definitionTags = this.args.definition.params.tags || [];
- const discoveryTag = this.kanbanManager.discoveryTag?.id;
- const listTags = [...definitionTags, discoveryTag];
-
- return this.args.topic.tags
- .reject((t) => listTags?.includes(t))
- .map((t) => renderTag(t));
- }
-
- get showCategory() {
- const definitionCategory = this.args.definition.params.category;
- const discoveryCategory = this.kanbanManager.discoveryCategory;
- return !(definitionCategory || discoveryCategory);
- }
-
- get showDetailed() {
- return this.cardStyle === "detailed";
- }
-
- get lastPoster() {
- return this.args.topic.posters.find((poster) =>
- poster.extras?.includes("latest")
- );
- }
}
diff --git a/javascripts/discourse/components/kanban/controls.gjs b/javascripts/discourse/components/kanban/controls.gjs
index f4fa970..6ec2103 100644
--- a/javascripts/discourse/components/kanban/controls.gjs
+++ b/javascripts/discourse/components/kanban/controls.gjs
@@ -1,15 +1,29 @@
-import DButton from "discourse/components/d-button";
-import CopyLinkButton from "./copy-link-button";
-import DMenu from "float-kit/components/d-menu";
import Component from "@glimmer/component";
-import KanbanOptionsModal from "./modal/options";
-import { inject as service } from "@ember/service";
+import { fn } from "@ember/helper";
import { action } from "@ember/object";
+import { inject as service } from "@ember/service";
+import DButton from "discourse/components/d-button";
import bodyClass from "discourse/helpers/body-class";
-import { fn } from "@ember/helper";
import i18n from "discourse-common/helpers/i18n";
+import DMenu from "float-kit/components/d-menu";
+import CopyLinkButton from "./copy-link-button";
+import KanbanOptionsModal from "./modal/options";
export default class KanbanControls extends Component {
+ @service modal;
+ @service kanbanManager;
+
+ @action
+ toggleFullscreen() {
+ this.kanbanManager.fullscreen = !this.kanbanManager.fullscreen;
+ }
+
+ @action
+ openSettings(menu) {
+ this.modal.show(KanbanOptionsModal);
+ menu.close();
+ }
+
{{#if this.kanbanManager.active}}
-
- @service modal;
- @service kanbanManager;
-
- @action
- toggleFullscreen() {
- this.kanbanManager.fullscreen = !this.kanbanManager.fullscreen;
- }
-
- @action
- openSettings(menu) {
- this.modal.show(KanbanOptionsModal);
- menu.close();
- }
}
diff --git a/javascripts/discourse/components/kanban/copy-link-button.gjs b/javascripts/discourse/components/kanban/copy-link-button.gjs
index c0d5a54..1c31594 100644
--- a/javascripts/discourse/components/kanban/copy-link-button.gjs
+++ b/javascripts/discourse/components/kanban/copy-link-button.gjs
@@ -1,20 +1,11 @@
import Component from "@glimmer/component";
-import DButton from "discourse/components/d-button";
-import { action } from "@ember/object";
-import discourseDebounce from "discourse-common/lib/debounce";
import { tracked } from "@glimmer/tracking";
+import { action } from "@ember/object";
+import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
+import discourseDebounce from "discourse-common/lib/debounce";
export default class KanbanCopyLinkButton extends Component {
-
-
-
-
@tracked copyConfirm = false;
@action
@@ -29,4 +20,13 @@ export default class KanbanCopyLinkButton extends Component {
resetCopyButton() {
this.copyConfirm = false;
}
+
+
+
+
}
diff --git a/javascripts/discourse/components/kanban/list.gjs b/javascripts/discourse/components/kanban/list.gjs
index 24ffb25..01fbd58 100644
--- a/javascripts/discourse/components/kanban/list.gjs
+++ b/javascripts/discourse/components/kanban/list.gjs
@@ -1,19 +1,19 @@
import Component from "@glimmer/component";
+import { tracked } from "@glimmer/tracking";
+import { on } from "@ember/modifier";
+import { action } from "@ember/object";
+import didInsert from "@ember/render-modifiers/modifiers/did-insert";
+import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
import { inject as service } from "@ember/service";
+import { modifier } from "ember-modifier";
+import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
+import concatClass from "discourse/helpers/concat-class";
import { popupAjaxError } from "discourse/lib/ajax-error";
import Topic from "discourse/models/topic";
-import I18n from "I18n";
-import { action } from "@ember/object";
import icon from "discourse-common/helpers/d-icon";
-import ConditionalLoadingSpinner from "discourse/components/conditional-loading-spinner";
-import DiscourseKanbanCard from "./card";
import i18n from "discourse-common/helpers/i18n";
-import { on } from "@ember/modifier";
-import { tracked } from "@glimmer/tracking";
-import concatClass from "discourse/helpers/concat-class";
-import { modifier } from "ember-modifier";
-import didInsert from "@ember/render-modifiers/modifiers/did-insert";
-import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
+import I18n from "I18n";
+import DiscourseKanbanCard from "./card";
function removedElements(before, after) {
if (!before) {
@@ -283,9 +283,6 @@ export default class KanbanList extends Component {
const listTitleHeight = mainOutlet
.querySelector(".list-title")
.getBoundingClientRect().height;
- const topicsHeight = document
- .querySelector(".topics")
- .getBoundingClientRect().height;
const height =
mainOutletHeight -
listControlsHeight -
diff --git a/javascripts/discourse/components/kanban/modal/options.gjs b/javascripts/discourse/components/kanban/modal/options.gjs
index f1010fc..6c8b1dd 100644
--- a/javascripts/discourse/components/kanban/modal/options.gjs
+++ b/javascripts/discourse/components/kanban/modal/options.gjs
@@ -1,19 +1,76 @@
import Component from "@glimmer/component";
-import { inject as service } from "@ember/service";
-import DiscourseURL from "discourse/lib/url";
-import { equal } from "@ember/object/computed";
+import { tracked } from "@glimmer/tracking";
+import { fn, hash } from "@ember/helper";
import { action } from "@ember/object";
+import { equal } from "@ember/object/computed";
+import { inject as service } from "@ember/service";
+import DButton from "discourse/components/d-button";
import DModal from "discourse/components/d-modal";
+import DiscourseURL from "discourse/lib/url";
+import i18n from "discourse-common/helpers/i18n";
import ComboBox from "select-kit/components/combo-box";
-import TagChooser from "select-kit/components/tag-chooser";
-import MultiSelect from "select-kit/components/multi-select";
import EmailGroupUserChooser from "select-kit/components/email-group-user-chooser";
-import i18n from "discourse-common/helpers/i18n";
-import { fn, hash } from "@ember/helper";
-import DButton from "discourse/components/d-button";
-import { tracked } from "@glimmer/tracking";
+import MultiSelect from "select-kit/components/multi-select";
+import TagChooser from "select-kit/components/tag-chooser";
export default class KanbanOptionsController extends Component {
+ @service kanbanManager;
+ @service site;
+
+ @tracked tags = [];
+ @tracked usernames = [];
+ @tracked categories = [];
+ @tracked mode = "tags";
+ modes = [{ id: "tags" }, { id: "categories" }, { id: "assigned" }];
+
+ @equal("mode", "tags") isTags;
+ @equal("mode", "categories") isCategories;
+ @equal("mode", "assigned") isAssigned;
+
+ constructor() {
+ super(...arguments);
+ const [mode, params] = this.kanbanManager.resolvedDescriptorParts;
+
+ this.mode = mode;
+ if (this.mode === "tags") {
+ this.tags = params?.split(",") || [];
+ } else if (this.mode === "categories") {
+ this.categories = params?.split(",").map((v) => parseInt(v, 10)) || [];
+ } else if (this.mode === "assigned") {
+ this.usernames = params?.split(",") || [];
+ }
+ }
+
+ @action
+ apply() {
+ let descriptor = "";
+ if (this.isTags) {
+ descriptor += "tags";
+ if (this.tags.length > 0) {
+ descriptor += `:${this.tags.join(",")}`;
+ }
+ } else if (this.isCategories) {
+ descriptor += "categories";
+ if (this.categories.length > 0) {
+ descriptor += `:${this.categories.join(",")}`;
+ }
+ } else if (this.isAssigned) {
+ descriptor += "assigned";
+ if (this.usernames.length > 0) {
+ descriptor += `:${this.usernames}`;
+ }
+ }
+
+ let href = this.kanbanManager.getBoardUrl({
+ category: this.kanbanManager.discoveryCategory,
+ tag: this.kanbanManager.discoveryTag,
+ descriptor,
+ });
+
+ this.args.closeModal();
+ DiscourseURL.routeTo(href, { replaceURL: true });
+ }
+
-
- @service kanbanManager;
- @service site;
-
- @tracked tags = [];
- @tracked usernames = [];
- @tracked categories = [];
- @tracked mode = "tags";
- modes = [{ id: "tags" }, { id: "categories" }, { id: "assigned" }];
-
- @equal("mode", "tags") isTags;
- @equal("mode", "categories") isCategories;
- @equal("mode", "assigned") isAssigned;
-
- constructor() {
- super(...arguments);
- const [mode, params] = this.kanbanManager.resolvedDescriptorParts;
-
- this.mode = mode;
- if (this.mode === "tags") {
- this.tags = params?.split(",") || [];
- } else if (this.mode === "categories") {
- this.categories = params?.split(",").map((v) => parseInt(v, 10)) || [];
- } else if (this.mode === "assigned") {
- this.usernames = params?.split(",") || [];
- }
- }
-
- @action
- apply() {
- let descriptor = "";
- if (this.isTags) {
- descriptor += "tags";
- if (this.tags.length > 0) {
- descriptor += `:${this.tags.join(",")}`;
- }
- } else if (this.isCategories) {
- descriptor += "categories";
- if (this.categories.length > 0) {
- descriptor += `:${this.categories.join(",")}`;
- }
- } else if (this.isAssigned) {
- descriptor += "assigned";
- if (this.usernames.length > 0) {
- descriptor += `:${this.usernames}`;
- }
- }
-
- let href = this.kanbanManager.getBoardUrl({
- category: this.kanbanManager.discoveryCategory,
- tag: this.kanbanManager.discoveryTag,
- descriptor,
- });
-
- this.args.closeModal();
- DiscourseURL.routeTo(href, { replaceURL: true });
- }
}
diff --git a/javascripts/discourse/components/kanban/nav.gjs b/javascripts/discourse/components/kanban/nav.gjs
index 741b75a..4c91599 100644
--- a/javascripts/discourse/components/kanban/nav.gjs
+++ b/javascripts/discourse/components/kanban/nav.gjs
@@ -1,20 +1,9 @@
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
-import i18n from "discourse-common/helpers/i18n";
import concatClass from "discourse/helpers/concat-class";
+import i18n from "discourse-common/helpers/i18n";
export default class KanbanNav extends Component {
-
-
-
- {{i18n (themePrefix "menu_label")}}
-
-
-
-
@service kanbanManager;
get href() {
@@ -28,4 +17,15 @@ export default class KanbanNav extends Component {
filterMode.split("/").pop() === "latest" && this.kanbanManager.active
);
}
+
+
+
+
+ {{i18n (themePrefix "menu_label")}}
+
+
+
}
diff --git a/javascripts/discourse/components/kanban/wrapper.gjs b/javascripts/discourse/components/kanban/wrapper.gjs
index 0a5b4ea..42c9223 100644
--- a/javascripts/discourse/components/kanban/wrapper.gjs
+++ b/javascripts/discourse/components/kanban/wrapper.gjs
@@ -1,14 +1,13 @@
import Component from "@glimmer/component";
-import { inject as service } from "@ember/service";
-import { action } from "@ember/object";
import { tracked } from "@glimmer/tracking";
+import { action } from "@ember/object";
+import { inject as service } from "@ember/service";
import DButton from "discourse/components/d-button";
-import DiscourseKanbanList from "./list";
import bodyClass from "discourse/helpers/body-class";
-import i18n from "discourse-common/helpers/i18n";
import concatClass from "discourse/helpers/concat-class";
+import i18n from "discourse-common/helpers/i18n";
+import DiscourseKanbanList from "./list";
import KanbanOptionsModal from "./modal/options";
-import { getOwner } from "@ember/application";
export default class Kanban extends Component {
@service kanbanManager;
diff --git a/javascripts/discourse/connectors/discovery-list-area/kanban-board.gjs b/javascripts/discourse/connectors/discovery-list-area/kanban-board.gjs
index 6d7930b..bd7e097 100644
--- a/javascripts/discourse/connectors/discovery-list-area/kanban-board.gjs
+++ b/javascripts/discourse/connectors/discovery-list-area/kanban-board.gjs
@@ -1,6 +1,6 @@
-import DiscourseKanban from "../../components/kanban/wrapper";
import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
+import DiscourseKanban from "../../components/kanban/wrapper";
export default class KanbanBoard extends Component {
@service kanbanManager;
diff --git a/javascripts/discourse/initializers/initialize-discourse-kanban.js b/javascripts/discourse/initializers/initialize-discourse-kanban.js
index 9ae0872..9aa6627 100644
--- a/javascripts/discourse/initializers/initialize-discourse-kanban.js
+++ b/javascripts/discourse/initializers/initialize-discourse-kanban.js
@@ -1,15 +1,14 @@
+import { next } from "@ember/runloop";
import { inject as service } from "@ember/service";
import { withPluginApi } from "discourse/lib/plugin-api";
import discourseComputed from "discourse-common/utils/decorators";
+import DiscourseKanbanControls from "../components/kanban/controls";
+import DiscourseKanbanNav from "../components/kanban/nav";
import {
boardDefaultView,
displayConnector,
isDefaultView,
} from "../lib/kanban-utilities";
-import { next } from "@ember/runloop";
-import DiscourseKanban from "../components/kanban/wrapper";
-import DiscourseKanbanNav from "../components/kanban/nav";
-import DiscourseKanbanControls from "../components/kanban/controls";
const PLUGIN_ID = "kanban-board";
diff --git a/javascripts/discourse/services/kanban-manager.js b/javascripts/discourse/services/kanban-manager.js
index 1e8f591..8211344 100644
--- a/javascripts/discourse/services/kanban-manager.js
+++ b/javascripts/discourse/services/kanban-manager.js
@@ -1,10 +1,10 @@
+import { tracked } from "@glimmer/tracking";
+import { get } from "@ember/object";
import Service, { inject as service } from "@ember/service";
import Category from "discourse/models/category";
-import { get } from "@ember/object";
-import buildTagLists from "../lib/kanban-list-builders/tags";
-import buildCategoryLists from "../lib/kanban-list-builders/categories";
import buildAssignedLists from "../lib/kanban-list-builders/assigned";
-import { tracked } from "@glimmer/tracking";
+import buildCategoryLists from "../lib/kanban-list-builders/categories";
+import buildTagLists from "../lib/kanban-list-builders/tags";
export default class KanbanManager extends Service {
@service router;