From 7b2b08cf89bdab332d14b68cd17cdfb4aa8a7113 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 14 Apr 2025 15:36:16 +0100 Subject: [PATCH] DEV: [gjs-codemod] Convert automation/styleguide/other to gjs Co-authored-by: Jarek Radosz --- .../discourse/app/lib/utilities.js | 4 + .../wizard/components/fields/checkbox.gjs | 59 +- .../wizard/components/fields/checkboxes.gjs | 40 +- .../fields/image-previews/generic.gjs | 8 +- .../fields/styling-preview/-preview-base.gjs | 20 +- .../fields/styling-preview/index.gjs | 65 +- .../static/wizard/components/fields/text.gjs | 22 +- .../color-palettes/color-palettes-row.gjs | 22 +- .../addon/components/create-color-row.gjs | 6 +- .../dropdown-select-box-row.gjs | 36 +- .../email-group-user-chooser-row.gjs | 55 +- .../select-kit/addon/components/flair-row.gjs | 25 +- .../future-date-input-selector-row.gjs | 29 +- .../homepage-style-selector-row.gjs | 19 +- .../mini-tag-chooser/selected-collection.gjs | 37 +- .../multi-select/format-selected-content.gjs | 10 +- .../multi-select/multi-select-filter.gjs | 57 +- .../multi-select/selected-category.gjs | 32 +- .../addon/components/none-category-row.gjs | 41 +- .../notifications-filter-header.gjs | 24 +- .../period-chooser/period-chooser-header.gjs | 24 +- .../period-chooser/period-chooser-row.gjs | 23 +- .../select-kit/errors-collection.gjs | 20 +- .../components/select-kit/select-kit-body.gjs | 10 +- .../select-kit/select-kit-create-row.gjs | 19 +- .../select-kit/select-kit-filter.gjs | 58 +- .../select-kit/select-kit-none-row.gjs | 19 +- .../components/select-kit/select-kit-row.gjs | 23 +- .../addon/components/selected-choice.gjs | 54 +- .../addon/components/selected-flair.gjs | 25 +- .../addon/components/selected-name.gjs | 98 ++- .../addon/components/tag-chooser-row.gjs | 9 +- .../select-kit/addon/components/tag-row.gjs | 25 +- .../toolbar-popup-menu-options-heading.gjs | 6 +- .../select-kit/addon/components/topic-row.gjs | 29 +- .../components/user-chooser/user-row.gjs | 18 +- .../javascripts/select-kit/package.json | 3 +- .../admin/components/automation-field.gjs | 4 +- .../da-category-notification-level-field.gjs | 2 +- .../admin/components/form-error.gjs | 10 + .../admin/components/topic-trigger.gjs | 22 + .../admin/templates/components/form-error.hbs | 5 - .../templates/components/topic-trigger.hbs | 12 - .../admin-plugins/show/automation/edit.gjs | 383 +++++---- .../admin-plugins/show/automation/index.gjs | 7 +- .../admin-plugins/show/automation/new.gjs | 64 +- .../components/da-boolean-field-test.gjs | 11 +- .../components/da-categories-field-test.gjs | 11 +- .../components/da-category-field-test.gjs | 11 +- ...category-notification-level-field-test.gjs | 11 +- .../components/da-choices-field-test.gjs | 11 +- .../components/da-custom-field-test.gjs | 11 +- .../components/da-date-time-field-test.gjs | 11 +- .../da-email-group-user-field-test.gjs | 6 +- .../components/da-group-field-test.gjs | 11 +- .../components/da-groups-field-test.gjs | 20 +- .../components/da-message-field-test.gjs | 20 +- .../components/da-pms-field-test.gjs | 11 +- .../components/da-post-field-test.gjs | 11 +- .../components/da-tags-field-test.gjs | 11 +- .../components/da-text-field-test.gjs | 11 +- .../components/da-text-list-field-test.gjs | 11 +- .../components/da-trust-levels-field-test.gjs | 11 +- .../components/da-user-field-test.gjs | 11 +- .../components/da-users-field-test.gjs | 20 +- .../chat-composer-message-details.gjs | 50 +- .../components/styleguide/chat-composer.gjs | 67 +- .../styleguide/chat-header-icon.gjs | 136 +-- .../components/styleguide/chat-message.gjs | 108 ++- .../styleguide/chat-modal-archive-channel.gjs | 23 +- .../styleguide/chat-modal-create-channel.gjs | 23 +- .../styleguide/chat-modal-delete-channel.gjs | 23 +- .../chat-modal-edit-channel-description.gjs | 23 +- .../chat-modal-edit-channel-name.gjs | 23 +- .../chat-modal-move-message-to-channel.gjs | 23 +- .../styleguide/chat-modal-new-message.gjs | 23 +- .../styleguide/chat-modal-thread-settings.gjs | 23 +- .../chat-modal-toggle-channel-status.gjs | 23 +- .../styleguide/chat-thread-list-item.gjs | 27 +- .../components/modal/local-dates-create.gjs | 387 +++++---- .../before-composer-controls/presence.gjs | 9 +- .../topic-above-footer-buttons/presence.gjs | 9 +- .../components/modal/poll-breakdown.gjs | 172 ++-- .../components/modal/poll-ui-builder.gjs | 528 ++++++------ .../component/poll-buttons-dropdown-test.gjs | 108 ++- .../javascripts/component/poll-info-test.gjs | 70 +- .../component/poll-options-test.gjs | 130 +-- .../component/poll-results-pie-test.gjs | 8 +- .../poll-results-ranked-choice-test.gjs | 18 +- .../component/poll-results-standard-test.gjs | 138 +-- .../component/poll-results-tabs-test.gjs | 96 ++- .../test/javascripts/component/poll-test.gjs | 44 +- .../component/poll-ui-builder-test.gjs | 28 +- .../discourse/components/color-example.gjs | 11 +- .../sections/atoms/01-font-scale.gjs | 167 ++-- .../components/sections/atoms/02-buttons.gjs | 334 ++++---- .../components/sections/atoms/03-colors.gjs | 226 ++--- .../components/sections/atoms/04-icons.gjs | 55 +- .../components/sections/atoms/05-forms.gjs | 518 ++++++------ .../components/sections/atoms/06-spinners.gjs | 17 +- .../sections/atoms/date-time-inputs.gjs | 56 +- .../components/sections/atoms/dropdowns.gjs | 310 +++---- .../components/sections/atoms/topic-link.gjs | 12 +- .../sections/atoms/topic-statuses.gjs | 48 +- .../sections/molecules/bread-crumbs.gjs | 20 +- .../sections/molecules/categories.gjs | 46 +- .../sections/molecules/char-counter.gjs | 25 +- .../sections/molecules/empty-state.gjs | 12 +- .../sections/molecules/footer-message.gjs | 52 +- .../components/sections/molecules/menus.gjs | 225 ++--- .../sections/molecules/navigation-bar.gjs | 64 +- .../sections/molecules/navigation-stacked.gjs | 42 +- .../sections/molecules/post-menu.gjs | 20 +- .../sections/molecules/signup-cta.gjs | 12 +- .../components/sections/molecules/toasts.gjs | 215 ++--- .../sections/molecules/tooltips.gjs | 211 ++--- .../sections/molecules/topic-list-item.gjs | 70 +- .../molecules/topic-notifications.gjs | 18 +- .../sections/molecules/topic-timer-info.gjs | 12 +- .../components/sections/organisms/00-post.gjs | 20 +- .../sections/organisms/02-topic-map.gjs | 18 +- .../organisms/03-topic-footer-buttons.gjs | 31 +- .../sections/organisms/04-topic-list.gjs | 18 +- .../sections/organisms/basic-topic-list.gjs | 12 +- .../sections/organisms/categories-list.gjs | 12 +- .../components/sections/organisms/modal.gjs | 163 ++-- .../sections/organisms/navigation.gjs | 35 +- .../sections/organisms/suggested-topics.gjs | 12 +- .../sections/organisms/user-about.gjs | 783 +++++++++--------- .../components/sections/syntax/00-bem.gjs | 157 ++-- .../components/styleguide-example.gjs | 12 +- .../discourse/components/styleguide-icons.gjs | 17 +- .../discourse/components/styleguide-link.gjs | 19 +- .../components/styleguide-section.gjs | 28 +- .../styleguide/calendar-date-time-input.gjs | 79 +- .../components/styleguide/component.gjs | 65 +- .../components/styleguide/controls.gjs | 13 +- .../components/styleguide/controls/row.gjs | 19 +- .../components/styleguide/controls/toggle.gjs | 8 +- .../components/toggle-color-mode.gjs | 11 +- .../discourse/templates/styleguide.gjs | 44 +- .../discourse/templates/styleguide/index.gjs | 18 +- .../discourse/templates/styleguide/show.gjs | 25 +- pnpm-lock.yaml | 3 + 144 files changed, 4859 insertions(+), 3715 deletions(-) create mode 100644 plugins/automation/admin/assets/javascripts/admin/components/form-error.gjs create mode 100644 plugins/automation/admin/assets/javascripts/admin/components/topic-trigger.gjs delete mode 100644 plugins/automation/admin/assets/javascripts/admin/templates/components/form-error.hbs delete mode 100644 plugins/automation/admin/assets/javascripts/admin/templates/components/topic-trigger.hbs diff --git a/app/assets/javascripts/discourse/app/lib/utilities.js b/app/assets/javascripts/discourse/app/lib/utilities.js index cdbb4e950bd..24c4d1ac636 100644 --- a/app/assets/javascripts/discourse/app/lib/utilities.js +++ b/app/assets/javascripts/discourse/app/lib/utilities.js @@ -794,3 +794,7 @@ export function isPrimaryTab() { } }); } + +export function optionalRequire(path, name = "default") { + return require.has(path) && require(path)[name]; +} diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkbox.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkbox.gjs index ca8443c8580..75706573e8c 100644 --- a/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkbox.gjs +++ b/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkbox.gjs @@ -1,31 +1,36 @@ -import Component from "@ember/component"; +import Component, { Input } from "@ember/component"; +import { hash } from "@ember/helper"; import { tagName } from "@ember-decorators/component"; +import PluginOutlet from "discourse/components/plugin-outlet"; +import icon from "discourse/helpers/d-icon"; @tagName("") -export default class Checkbox extends Component {} +export default class Checkbox extends Component { + +} diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkboxes.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkboxes.gjs index 50959f080b7..111e984cd0a 100644 --- a/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkboxes.gjs +++ b/app/assets/javascripts/discourse/app/static/wizard/components/fields/checkboxes.gjs @@ -1,5 +1,7 @@ -import Component from "@ember/component"; +import Component, { Input } from "@ember/component"; +import { on } from "@ember/modifier"; import { action, set } from "@ember/object"; +import icon from "discourse/helpers/d-icon"; export default class Checkboxes extends Component { init(...args) { @@ -30,21 +32,23 @@ export default class Checkboxes extends Component { } this.set("field.value", newFieldValue); } -} -{{#each this.field.choices as |c|}} -
- -
-{{/each}} \ No newline at end of file + +} diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/generic.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/generic.gjs index 7906d639a37..ce4eb980b06 100644 --- a/app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/generic.gjs +++ b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image-previews/generic.gjs @@ -2,6 +2,8 @@ import Component from "@ember/component"; import { classNameBindings } from "@ember-decorators/component"; @classNameBindings(":wizard-image-preview", "fieldClass") -export default class Generic extends Component {} - - \ No newline at end of file +export default class Generic extends Component { + +} diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-preview-base.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-preview-base.gjs index cdaa3616f5f..084c9c7022f 100644 --- a/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-preview-base.gjs +++ b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/-preview-base.gjs @@ -446,6 +446,17 @@ export default class PreviewBase extends Component { unreadTextX + ctx.measureText(unreadText).width + headerMargin * 2.0; ctx.fillText(topText, topTextX, pillButtonTextY); } + + } function loadImage(src) { @@ -457,12 +468,3 @@ function loadImage(src) { img.src = getUrl(src); return new Promise((resolve) => (img.onload = () => resolve(img))); } - -
- - -
\ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.gjs index 06b7be1f4ef..d95e8f3b50f 100644 --- a/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.gjs +++ b/app/assets/javascripts/discourse/app/static/wizard/components/fields/styling-preview/index.gjs @@ -1,3 +1,4 @@ +import { on } from "@ember/modifier"; import { action } from "@ember/object"; import { observes } from "@ember-decorators/object"; import { bind } from "discourse/lib/decorators"; @@ -247,35 +248,37 @@ export default class Index extends PreviewBaseComponent { event?.preventDefault(); this.set("previewTopic", true); } + + } - -
-
- - -
-
- -
-
- - \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/fields/text.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/text.gjs index 08841ba8263..23bbc0156e6 100644 --- a/app/assets/javascripts/discourse/app/static/wizard/components/fields/text.gjs +++ b/app/assets/javascripts/discourse/app/static/wizard/components/fields/text.gjs @@ -1,11 +1,13 @@ -import Component from "@ember/component"; +import Component, { Input } from "@ember/component"; -export default class Text extends Component {} - - \ No newline at end of file +export default class Text extends Component { + +} diff --git a/app/assets/javascripts/select-kit/addon/components/color-palettes/color-palettes-row.gjs b/app/assets/javascripts/select-kit/addon/components/color-palettes/color-palettes-row.gjs index 368084f95de..53bb786de3b 100644 --- a/app/assets/javascripts/select-kit/addon/components/color-palettes/color-palettes-row.gjs +++ b/app/assets/javascripts/select-kit/addon/components/color-palettes/color-palettes-row.gjs @@ -29,14 +29,16 @@ export default class ColorPalettesRow extends SelectKitRowComponent { return ""; } } + + } - - - {{this.label}} - - -{{#if this.item.colors}} -
- {{this.palettes}} -
-{{/if}} \ No newline at end of file diff --git a/app/assets/javascripts/select-kit/addon/components/create-color-row.gjs b/app/assets/javascripts/select-kit/addon/components/create-color-row.gjs index 2dea1d68c65..23773d596dd 100644 --- a/app/assets/javascripts/select-kit/addon/components/create-color-row.gjs +++ b/app/assets/javascripts/select-kit/addon/components/create-color-row.gjs @@ -15,6 +15,8 @@ export default class CreateColorRow extends SelectKitRowComponent { : `#${color}`; }); } -} -{{this.label}} \ No newline at end of file + +} diff --git a/app/assets/javascripts/select-kit/addon/components/dropdown-select-box/dropdown-select-box-row.gjs b/app/assets/javascripts/select-kit/addon/components/dropdown-select-box/dropdown-select-box-row.gjs index 643acf6417c..47a5a81e03a 100644 --- a/app/assets/javascripts/select-kit/addon/components/dropdown-select-box/dropdown-select-box-row.gjs +++ b/app/assets/javascripts/select-kit/addon/components/dropdown-select-box/dropdown-select-box-row.gjs @@ -1,24 +1,28 @@ import { readOnly } from "@ember/object/computed"; +import { htmlSafe } from "@ember/template"; import { classNames } from "@ember-decorators/component"; +import icon from "discourse/helpers/d-icon"; import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row"; @classNames("dropdown-select-box-row") export default class DropdownSelectBoxRow extends SelectKitRowComponent { @readOnly("item.description") description; + + } - -{{#if this.icons}} -
- - {{#each this.icons as |icon|}} - {{d-icon icon}} - {{/each}} -
-{{/if}} - -
- {{html-safe this.label}} - {{#if this.description}} - {{html-safe this.description}} - {{/if}} -
\ No newline at end of file diff --git a/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser-row.gjs b/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser-row.gjs index b84ca9dceaa..5b13d1594b4 100644 --- a/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser-row.gjs +++ b/app/assets/javascripts/select-kit/addon/components/email-group-user-chooser-row.gjs @@ -1,26 +1,37 @@ import { classNames } from "@ember-decorators/component"; +import { and } from "truth-helpers"; +import UserStatusMessage from "discourse/components/user-status-message"; +import avatar from "discourse/helpers/avatar"; +import icon from "discourse/helpers/d-icon"; +import decorateUsernameSelector from "discourse/helpers/decorate-username-selector"; +import formatUsername from "discourse/helpers/format-username"; import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row"; @classNames("email-group-user-chooser-row") -export default class EmailGroupUserChooserRow extends SelectKitRowComponent {} - -{{#if this.item.isUser}} - {{avatar this.item imageSize="tiny"}} -
- {{format-username this.item.id}} - {{this.item.name}} -
- {{#if (and this.item.showUserStatus this.item.status)}} - - {{/if}} - {{decorate-username-selector this.item.id}} -{{else if this.item.isGroup}} - {{d-icon "users"}} -
- {{this.item.id}} - {{this.item.full_name}} -
-{{else}} - {{d-icon "envelope"}} - {{this.item.id}} -{{/if}} \ No newline at end of file +export default class EmailGroupUserChooserRow extends SelectKitRowComponent { + +} diff --git a/app/assets/javascripts/select-kit/addon/components/flair-row.gjs b/app/assets/javascripts/select-kit/addon/components/flair-row.gjs index 411b77a8aa3..d3bf5a1a2a3 100644 --- a/app/assets/javascripts/select-kit/addon/components/flair-row.gjs +++ b/app/assets/javascripts/select-kit/addon/components/flair-row.gjs @@ -1,16 +1,19 @@ import { classNames } from "@ember-decorators/component"; +import AvatarFlair from "discourse/components/avatar-flair"; import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row"; @classNames("flair-row") -export default class FlairRow extends SelectKitRowComponent {} +export default class FlairRow extends SelectKitRowComponent { + +} diff --git a/app/assets/javascripts/select-kit/addon/components/future-date-input-selector/future-date-input-selector-row.gjs b/app/assets/javascripts/select-kit/addon/components/future-date-input-selector/future-date-input-selector-row.gjs index f60b4984c75..bdbab018d74 100644 --- a/app/assets/javascripts/select-kit/addon/components/future-date-input-selector/future-date-input-selector-row.gjs +++ b/app/assets/javascripts/select-kit/addon/components/future-date-input-selector/future-date-input-selector-row.gjs @@ -1,19 +1,22 @@ import { classNames } from "@ember-decorators/component"; +import icon from "discourse/helpers/d-icon"; import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row"; @classNames("future-date-input-selector-row") -export default class FutureDateInputSelectorRow extends SelectKitRowComponent {} +export default class FutureDateInputSelectorRow extends SelectKitRowComponent { + +} diff --git a/app/assets/javascripts/select-kit/addon/components/homepage-style-selector/homepage-style-selector-row.gjs b/app/assets/javascripts/select-kit/addon/components/homepage-style-selector/homepage-style-selector-row.gjs index 440776a9977..e939588122e 100644 --- a/app/assets/javascripts/select-kit/addon/components/homepage-style-selector/homepage-style-selector-row.gjs +++ b/app/assets/javascripts/select-kit/addon/components/homepage-style-selector/homepage-style-selector-row.gjs @@ -1,12 +1,15 @@ +import { htmlSafe } from "@ember/template"; import { classNames } from "@ember-decorators/component"; import SelectKitRowComponent from "select-kit/components/select-kit/select-kit-row"; @classNames("homepage-style-selector-row") -export default class HomepageStyleSelectorRow extends SelectKitRowComponent {} - -
- {{html-safe this.label}} - {{#if this.item.description}} - {{html-safe this.item.description}} - {{/if}} -
\ No newline at end of file +export default class HomepageStyleSelectorRow extends SelectKitRowComponent { + +} diff --git a/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser/selected-collection.gjs b/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser/selected-collection.gjs index ef8ccdf430d..89e3a9424bc 100644 --- a/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser/selected-collection.gjs +++ b/app/assets/javascripts/select-kit/addon/components/mini-tag-chooser/selected-collection.gjs @@ -1,7 +1,10 @@ import Component from "@ember/component"; +import { fn } from "@ember/helper"; import { computed } from "@ember/object"; import { reads } from "@ember/object/computed"; import { tagName } from "@ember-decorators/component"; +import DButton from "discourse/components/d-button"; +import discourseTag from "discourse/helpers/discourse-tag"; @tagName("") export default class SelectedCollection extends Component { @@ -27,20 +30,22 @@ export default class SelectedCollection extends Component { }; }); } -} -{{#if this.tags}} -
- {{#each this.tags as |tag|}} - - {{discourse-tag tag.value noHref=true}} - - {{/each}} -
-{{/if}} \ No newline at end of file + +} diff --git a/app/assets/javascripts/select-kit/addon/components/multi-select/format-selected-content.gjs b/app/assets/javascripts/select-kit/addon/components/multi-select/format-selected-content.gjs index 007ee618448..efb95c1d4b1 100644 --- a/app/assets/javascripts/select-kit/addon/components/multi-select/format-selected-content.gjs +++ b/app/assets/javascripts/select-kit/addon/components/multi-select/format-selected-content.gjs @@ -21,8 +21,10 @@ export default class FormatSelectedContent extends Component.extend( return this.getName(this.selectKit.noneItem); } } -} - - {{this.formattedContent}} - \ No newline at end of file + +} diff --git a/app/assets/javascripts/select-kit/addon/components/multi-select/multi-select-filter.gjs b/app/assets/javascripts/select-kit/addon/components/multi-select/multi-select-filter.gjs index f9dd2dbb520..05fc22434cd 100644 --- a/app/assets/javascripts/select-kit/addon/components/multi-select/multi-select-filter.gjs +++ b/app/assets/javascripts/select-kit/addon/components/multi-select/multi-select-filter.gjs @@ -1,6 +1,9 @@ +import { Input } from "@ember/component"; +import { on } from "@ember/modifier"; import { action } from "@ember/object"; import { isEmpty } from "@ember/utils"; import { classNames } from "@ember-decorators/component"; +import icon from "discourse/helpers/d-icon"; import discourseComputed from "discourse/lib/decorators"; import SelectKitFilterComponent from "select-kit/components/select-kit/select-kit-filter"; @@ -34,30 +37,32 @@ export default class MultiSelectFilter extends SelectKitFilterComponent { return false; } } + + } - -{{#unless this.isHidden}} - {{! filter-input-search prevents 1password from attempting autocomplete }} - {{! template-lint-disable no-pointer-down-event-binding }} - - - - {{#if this.selectKit.options.filterIcon}} - {{d-icon this.selectKit.options.filterIcon class="filter-icon"}} - {{/if}} -{{/unless}} \ No newline at end of file diff --git a/app/assets/javascripts/select-kit/addon/components/multi-select/selected-category.gjs b/app/assets/javascripts/select-kit/addon/components/multi-select/selected-category.gjs index d09e33cb94e..a5492784cee 100644 --- a/app/assets/javascripts/select-kit/addon/components/multi-select/selected-category.gjs +++ b/app/assets/javascripts/select-kit/addon/components/multi-select/selected-category.gjs @@ -1,7 +1,9 @@ +import { on } from "@ember/modifier"; import { computed } from "@ember/object"; import { htmlSafe } from "@ember/template"; import { classNames } from "@ember-decorators/component"; import { categoryBadgeHTML } from "discourse/helpers/category-link"; +import icon from "discourse/helpers/d-icon"; import SelectedNameComponent from "select-kit/components/selected-name"; @classNames("selected-category") @@ -15,18 +17,20 @@ export default class SelectedCategory extends SelectedNameComponent { }) ); } -} -
-
- {{this.badge}} - {{d-icon "xmark"}} -
-
\ No newline at end of file + +} diff --git a/app/assets/javascripts/select-kit/addon/components/none-category-row.gjs b/app/assets/javascripts/select-kit/addon/components/none-category-row.gjs index 8f71f5c5e55..9c65beae496 100644 --- a/app/assets/javascripts/select-kit/addon/components/none-category-row.gjs +++ b/app/assets/javascripts/select-kit/addon/components/none-category-row.gjs @@ -1,6 +1,7 @@ import { htmlSafe } from "@ember/template"; import { classNames } from "@ember-decorators/component"; import { categoryBadgeHTML } from "discourse/helpers/category-link"; +import dirSpan from "discourse/helpers/dir-span"; import discourseComputed from "discourse/lib/decorators"; import CategoryRowComponent from "select-kit/components/category-row"; @@ -16,24 +17,26 @@ export default class NoneCategoryRow extends CategoryRowComponent { }) ); } -} -{{#if this.category}} -