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("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}"
|
||||
upload: "Upload"
|
||||
uploading: "Uploading..."
|
||||
upload_error: "Sorry, there was an error uploading that file. Please try again."
|
||||
quit: "Maybe Later"
|
||||
|
||||
staff_count:
|
||||
|
|
|
@ -3860,7 +3860,7 @@ en:
|
|||
fields:
|
||||
favicon_url:
|
||||
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:
|
||||
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."
|
||||
|
|
Loading…
Reference in New Issue