DEV: allows to decouple csv-uploader texts from bulk invite (#10344)
This commit is contained in:
parent
e7c0c53944
commit
8a9e4504fe
|
@ -8,6 +8,7 @@ export default Component.extend(UploadMixin, {
|
||||||
type: "csv",
|
type: "csv",
|
||||||
tagName: "span",
|
tagName: "span",
|
||||||
uploadUrl: "/invites/upload_csv",
|
uploadUrl: "/invites/upload_csv",
|
||||||
|
i18nPrefix: "user.invited.bulk_invite",
|
||||||
|
|
||||||
validateUploadedFilesOptions() {
|
validateUploadedFilesOptions() {
|
||||||
return { csvOnly: true };
|
return { csvOnly: true };
|
||||||
|
@ -15,9 +16,7 @@ export default Component.extend(UploadMixin, {
|
||||||
|
|
||||||
@discourseComputed("uploading")
|
@discourseComputed("uploading")
|
||||||
uploadButtonText(uploading) {
|
uploadButtonText(uploading) {
|
||||||
return uploading
|
return uploading ? I18n.t("uploading") : I18n.t(`${this.i18nPrefix}.text`);
|
||||||
? I18n.t("uploading")
|
|
||||||
: I18n.t("user.invited.bulk_invite.text");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("uploading")
|
@discourseComputed("uploading")
|
||||||
|
@ -27,7 +26,7 @@ export default Component.extend(UploadMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
uploadDone() {
|
uploadDone() {
|
||||||
bootbox.alert(I18n.t("user.invited.bulk_invite.success"));
|
bootbox.alert(I18n.t(`${this.i18nPrefix}.success`));
|
||||||
},
|
},
|
||||||
|
|
||||||
uploadOptions() {
|
uploadOptions() {
|
||||||
|
@ -39,7 +38,7 @@ export default Component.extend(UploadMixin, {
|
||||||
|
|
||||||
$upload.on("fileuploadadd", (e, data) => {
|
$upload.on("fileuploadadd", (e, data) => {
|
||||||
bootbox.confirm(
|
bootbox.confirm(
|
||||||
I18n.t("user.invited.bulk_invite.confirmation_message"),
|
I18n.t(`${this.i18nPrefix}.confirmation_message`),
|
||||||
I18n.t("cancel"),
|
I18n.t("cancel"),
|
||||||
I18n.t("go_ahead"),
|
I18n.t("go_ahead"),
|
||||||
result => (result ? data.submit() : data.abort())
|
result => (result ? data.submit() : data.abort())
|
||||||
|
|
Loading…
Reference in New Issue