diff --git a/app/assets/javascripts/discourse/app/templates/modal/sidebar-section-form.hbs b/app/assets/javascripts/discourse/app/templates/modal/sidebar-section-form.hbs index 66c864a0ca..fe5ac508c5 100644 --- a/app/assets/javascripts/discourse/app/templates/modal/sidebar-section-form.hbs +++ b/app/assets/javascripts/discourse/app/templates/modal/sidebar-section-form.hbs @@ -26,7 +26,6 @@ @value={{link.icon}} @options={{hash maximum=1}} class={{link.iconCssClass}} - @onlyAvailable={{true}} @onChange={{action (mut link.icon)}} /> diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/icon-picker-test.js b/app/assets/javascripts/discourse/tests/integration/components/select-kit/icon-picker-test.js deleted file mode 100644 index 1648940c9d..0000000000 --- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/icon-picker-test.js +++ /dev/null @@ -1,58 +0,0 @@ -import { module, test } from "qunit"; -import { setupRenderingTest } from "discourse/tests/helpers/component-test"; -import { render } from "@ember/test-helpers"; -import { hbs } from "ember-cli-htmlbars"; -import selectKit from "discourse/tests/helpers/select-kit-helper"; -import { queryAll } from "discourse/tests/helpers/qunit-helpers"; -import pretender, { response } from "discourse/tests/helpers/create-pretender"; -import { setIconList } from "discourse-common/lib/icon-library"; - -module("Integration | Component | select-kit/icon-picker", function (hooks) { - setupRenderingTest(hooks); - - hooks.beforeEach(function () { - this.set("subject", selectKit()); - setIconList(["ad", "link"]); - - pretender.get("/svg-sprite/picker-search", () => { - return response([ - { id: "ad", symbol: "" }, - { id: "bacon", symbol: "" }, - { id: "link", symbol: [] }, - ]); - }); - }); - - test("content", async function (assert) { - await render(hbs` - - `); - - await this.subject.expand(); - const icons = [...queryAll(".select-kit-row .name")].map( - (el) => el.innerText - ); - assert.deepEqual(icons, ["ad", "bacon", "link"]); - }); - - test("only available", async function (assert) { - await render(hbs` - - `); - - await this.subject.expand(); - const icons = [...queryAll(".select-kit-row .name")].map( - (el) => el.innerText - ); - assert.deepEqual(icons, ["ad", "link"]); - }); -}); diff --git a/app/assets/javascripts/select-kit/addon/components/icon-picker.js b/app/assets/javascripts/select-kit/addon/components/icon-picker.js index 2ce9d6f77b..ab6553acbd 100644 --- a/app/assets/javascripts/select-kit/addon/components/icon-picker.js +++ b/app/assets/javascripts/select-kit/addon/components/icon-picker.js @@ -2,7 +2,6 @@ import { convertIconClass, disableMissingIconWarning, enableMissingIconWarning, - isExistingIconId, } from "discourse-common/lib/icon-library"; import MultiSelectComponent from "select-kit/components/multi-select"; import { computed } from "@ember/object"; @@ -40,9 +39,6 @@ export default MultiSelectComponent.extend({ data: { filter }, }).then((icons) => { icons = icons.map(this._processIcon); - if (this.onlyAvailable) { - icons = icons.filter(this._iconExists); - } if (filter === "") { this._cachedIconsList = icons; } @@ -51,10 +47,6 @@ export default MultiSelectComponent.extend({ } }, - _iconExists(icon) { - return isExistingIconId(icon.id); - }, - _processIcon(icon) { const iconName = typeof icon === "object" ? icon.id : icon, strippedIconName = convertIconClass(iconName);