mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: display error message when upload fails in wizard
This commit is contained in:
parent
87a5cb982c
commit
bd760e98af
@ -38,5 +38,21 @@ export default Ember.Component.extend({
|
|||||||
this.set("field.value", response.result.url);
|
this.set("field.value", response.result.url);
|
||||||
this.set("uploading", false);
|
this.set("uploading", false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$upload.on("fileuploadfail", (e, response) => {
|
||||||
|
let message = I18n.t("wizard.upload_error")
|
||||||
|
if (response.jqXHR.responseJSON && response.jqXHR.responseJSON.errors) {
|
||||||
|
message = response.jqXHR.responseJSON.errors.join("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
window.swal({
|
||||||
|
customClass: "wizard-warning",
|
||||||
|
title: "",
|
||||||
|
text: message,
|
||||||
|
type: "warning",
|
||||||
|
confirmButtonColor: "#6699ff"
|
||||||
|
});
|
||||||
|
this.set("uploading", false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -3949,6 +3949,7 @@ en:
|
|||||||
step: "%{current} of %{total}"
|
step: "%{current} of %{total}"
|
||||||
upload: "Upload"
|
upload: "Upload"
|
||||||
uploading: "Uploading..."
|
uploading: "Uploading..."
|
||||||
|
upload_error: "Sorry, there was an error uploading that file. Please try again."
|
||||||
quit: "Maybe Later"
|
quit: "Maybe Later"
|
||||||
|
|
||||||
staff_count:
|
staff_count:
|
||||||
|
@ -3860,7 +3860,7 @@ en:
|
|||||||
fields:
|
fields:
|
||||||
favicon_url:
|
favicon_url:
|
||||||
label: "Small Icon"
|
label: "Small Icon"
|
||||||
description: "Icon image used to represent your site in web browsers that looks good at small sizes such as 32px by 32px."
|
description: "Icon image used to represent your site in web browsers that looks good at small sizes such as 32px by 32px. Recommended image extensions are PNG or JPG."
|
||||||
apple_touch_icon_url:
|
apple_touch_icon_url:
|
||||||
label: "Large Icon"
|
label: "Large Icon"
|
||||||
description: "Icon image used to represent your site on modern devices that looks good at larger sizes. Recommended size is at least 512px by 512px."
|
description: "Icon image used to represent your site on modern devices that looks good at larger sizes. Recommended size is at least 512px by 512px."
|
||||||
|
Loading…
Reference in New Issue
Block a user