FEATURE: Use uppy for watched word uploader (#14817)

This commit, while changing the watched word uploader to use
uppy, also fixes a minor bug with the UppyUploadMixin where
the file input's value was not cleared after reset, which
prevented subsequent file uploads. The composer mixin already
has this fix.
This commit is contained in:
Martin Brennan 2021-11-05 09:23:28 +10:00 committed by GitHub
parent 6360d3d4e7
commit 1dddbf3d47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -1,15 +1,16 @@
import Component from "@ember/component";
import I18n from "I18n";
import UploadMixin from "discourse/mixins/upload";
import UppyUploadMixin from "discourse/mixins/uppy-upload";
import { alias } from "@ember/object/computed";
import bootbox from "bootbox";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend(UploadMixin, {
export default Component.extend(UppyUploadMixin, {
type: "txt",
classNames: "watched-words-uploader",
uploadUrl: "/admin/customize/watched_words/upload",
addDisabled: alias("uploading"),
preventDirectS3Uploads: true,
validateUploadedFilesOptions() {
return { skipValidation: true };

View File

@ -287,5 +287,6 @@ export default Mixin.create({
processing: false,
uploadProgress: 0,
});
this.fileInputEl.value = "";
},
});