diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.js b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs similarity index 52% rename from app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.js rename to app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs index 1cde3096894..44e4f2cf706 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.js +++ b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.gjs @@ -1,11 +1,22 @@ import Component from "@glimmer/component"; import { tracked } from "@glimmer/tracking"; +import { Input } from "@ember/component"; +import { concat, fn, get } from "@ember/helper"; +import { on } from "@ember/modifier"; import { action } from "@ember/object"; import { inject as service } from "@ember/service"; +import EditNavigationMenuModal from "discourse/components/sidebar/edit-navigation-menu/modal"; +import borderColor from "discourse/helpers/border-color"; +import categoryBadge from "discourse/helpers/category-badge"; +import dirSpan from "discourse/helpers/dir-span"; import { popupAjaxError } from "discourse/lib/ajax-error"; import Category from "discourse/models/category"; import { INPUT_DELAY } from "discourse-common/config/environment"; +import i18n from "discourse-common/helpers/i18n"; import discourseDebounce from "discourse-common/lib/debounce"; +import gt from "truth-helpers/helpers/gt"; +import includes from "truth-helpers/helpers/includes"; +import not from "truth-helpers/helpers/not"; export default class extends Component { @service currentUser; @@ -174,4 +185,93 @@ export default class extends Component { this.saving = false; }); } + + } diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.hbs b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.hbs deleted file mode 100644 index ca3a174b02f..00000000000 --- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/categories-modal.hbs +++ /dev/null @@ -1,75 +0,0 @@ - - - \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.gjs b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.gjs new file mode 100644 index 00000000000..928e502fce2 --- /dev/null +++ b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.gjs @@ -0,0 +1,135 @@ +import Component from "@glimmer/component"; +import { tracked } from "@glimmer/tracking"; +import { Input } from "@ember/component"; +import { hash } from "@ember/helper"; +import { on } from "@ember/modifier"; +import { action } from "@ember/object"; +import DButton from "discourse/components/d-button"; +import DModal from "discourse/components/d-modal"; +import dIcon from "discourse-common/helpers/d-icon"; +import i18n from "discourse-common/helpers/i18n"; +import I18n from "discourse-i18n"; +import DropdownSelectBox from "select-kit/components/dropdown-select-box"; + +export default class extends Component { + @tracked filter = ""; + @tracked filterDropdownValue = "all"; + + filterDropdownContent = [ + { + id: "all", + name: I18n.t("sidebar.edit_navigation_modal_form.filter_dropdown.all"), + }, + { + id: "selected", + name: I18n.t( + "sidebar.edit_navigation_modal_form.filter_dropdown.selected" + ), + }, + { + id: "unselected", + name: I18n.t( + "sidebar.edit_navigation_modal_form.filter_dropdown.unselected" + ), + }, + ]; + + @action + onFilterInput(input) { + this.args.onFilterInput(input.target.value); + } + + @action + onFilterDropdownChange(value) { + this.filterDropdownValue = value; + + switch (value) { + case "all": + this.args.resetFilter(); + break; + case "selected": + this.args.filterSelected(); + break; + case "unselected": + this.args.filterUnselected(); + break; + } + } + + +} diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.hbs b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.hbs deleted file mode 100644 index f3c04e32735..00000000000 --- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.hbs +++ /dev/null @@ -1,74 +0,0 @@ - - <:belowModalTitle> - - - - <:belowHeader> - - - - <:body> - {{yield}} - - - <:footer> - - - \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.js b/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.js deleted file mode 100644 index 3ddf0f3549d..00000000000 --- a/app/assets/javascripts/discourse/app/components/sidebar/edit-navigation-menu/modal.js +++ /dev/null @@ -1,50 +0,0 @@ -import Component from "@glimmer/component"; -import { tracked } from "@glimmer/tracking"; -import { action } from "@ember/object"; -import I18n from "discourse-i18n"; - -export default class extends Component { - @tracked filter = ""; - @tracked filterDropdownValue = "all"; - - filterDropdownContent = [ - { - id: "all", - name: I18n.t("sidebar.edit_navigation_modal_form.filter_dropdown.all"), - }, - { - id: "selected", - name: I18n.t( - "sidebar.edit_navigation_modal_form.filter_dropdown.selected" - ), - }, - { - id: "unselected", - name: I18n.t( - "sidebar.edit_navigation_modal_form.filter_dropdown.unselected" - ), - }, - ]; - - @action - onFilterInput(value) { - this.args.onFilterInput(value); - } - - @action - onFilterDropdownChange(value) { - this.filterDropdownValue = value; - - switch (value) { - case "all": - this.args.resetFilter(); - break; - case "selected": - this.args.filterSelected(); - break; - case "unselected": - this.args.filterUnselected(); - break; - } - } -}