DEV: Convert tag-upload to the new modal API (#23590)

This commit is contained in:
Jarek Radosz 2023-09-14 21:32:45 +02:00 committed by GitHub
parent e1c3b14b1a
commit ed8d0656f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 11 deletions

View File

@ -0,0 +1,9 @@
<DModal @title={{i18n "tagging.upload"}} @closeModal={{@closeModal}}>
<:body>
<TagsUploader
@refresh={{route-action "triggerRefresh"}}
@closeModal={{@closeModal}}
@id="tags-uploader"
/>
</:body>
</DModal>

View File

@ -5,12 +5,12 @@ import I18n from "I18n";
import { ajax } from "discourse/lib/ajax";
import discourseComputed from "discourse-common/utils/decorators";
import { popupAjaxError } from "discourse/lib/ajax-error";
import showModal from "discourse/lib/show-modal";
import { inject as service } from "@ember/service";
import TagUpload from "discourse/components/modal/tag-upload";
export default Controller.extend({
dialog: service(),
modal: service(),
sortedByCount: true,
sortedByName: false,
canAdminTags: alias("currentUser.staff"),
@ -63,7 +63,7 @@ export default Controller.extend({
actions: {
showUploader() {
showModal("tag-upload");
this.modal.show(TagUpload);
},
deleteUnused() {

View File

@ -23,7 +23,6 @@ const KNOWN_LEGACY_MODALS = [
"reject-reason-reviewable",
"reorder-categories",
"request-group-membership-form",
"tag-upload",
];
const LEGACY_OPTS = new Set([

View File

@ -1,7 +0,0 @@
<DModalBody @title="tagging.upload">
<TagsUploader
@refresh={{route-action "triggerRefresh"}}
@closeModal={{route-action "closeModal"}}
@id="tags-uploader"
/>
</DModalBody>