mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 01:32:23 +08:00
f14c6d81f4
This commit contains 3 features: - FEATURE: Allow downloading watched words This introduces a button that allows admins to download watched words per action in a `.txt` file. - FEATURE: Allow clearing watched words in bulk This adds a "Clear All" button that clears all deleted words per action (e.g. block, flag etc.) - FEATURE: List all blocked words contained in the post when it's blocked When a post is rejected because it contains one or more blocked words, the error message now lists all the blocked words contained in the post. ------- This also changes the format of the file for importing watched words from `.csv` to `.txt` so it becomes inconsistent with the extension of the file when watched words are exported.
26 lines
631 B
JavaScript
26 lines
631 B
JavaScript
import computed from "ember-addons/ember-computed-decorators";
|
|
import UploadMixin from "discourse/mixins/upload";
|
|
|
|
export default Ember.Component.extend(UploadMixin, {
|
|
type: "txt",
|
|
classNames: "watched-words-uploader",
|
|
uploadUrl: "/admin/logs/watched_words/upload",
|
|
addDisabled: Ember.computed.alias("uploading"),
|
|
|
|
validateUploadedFilesOptions() {
|
|
return { skipValidation: true };
|
|
},
|
|
|
|
@computed("actionKey")
|
|
data(actionKey) {
|
|
return { action_key: actionKey };
|
|
},
|
|
|
|
uploadDone() {
|
|
if (this) {
|
|
bootbox.alert(I18n.t("admin.watched_words.form.upload_successful"));
|
|
this.done();
|
|
}
|
|
}
|
|
});
|