diff --git a/addons/web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js b/addons/web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js index cb23e0943b4..5625a1c21e7 100644 --- a/addons/web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js +++ b/addons/web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js @@ -10,12 +10,19 @@ export class ProgressBar extends Component { } ProgressBar.template = 'web_editor.ProgressBar'; ProgressBar.props = { - progress: Number, - hasError: Boolean, - uploaded: Boolean, + progress: { type: Number, optional: true }, + hasError: { type: Boolean, optional: true }, + uploaded: { type: Boolean, optional: true }, name: String, - size: String, - errorMessage: String, + size: { type: String, optional: true }, + errorMessage: { type: String, optional: true }, +}; +ProgressBar.defaultProps = { + progress: 0, + hasError: false, + uploaded: false, + size: "", + errorMessage: "", }; export class UploadProgressToast extends Component { diff --git a/addons/web_editor/static/src/components/upload_progress_toast/upload_service.js b/addons/web_editor/static/src/components/upload_progress_toast/upload_service.js index 8aa461caf4b..5dcf3dc82cd 100644 --- a/addons/web_editor/static/src/components/upload_progress_toast/upload_service.js +++ b/addons/web_editor/static/src/components/upload_progress_toast/upload_service.js @@ -74,7 +74,7 @@ export const uploadService = { return null; } if (!fileSize) { - fileSize = null; + fileSize = ""; } else { fileSize = humanNumber(fileSize) + "B"; } @@ -87,10 +87,6 @@ export const uploadService = { id, name: file.name, size: fileSize, - progress: 0, - hasError: false, - uploaded: false, - errorMessage: '', }); } diff --git a/addons/web_unsplash/static/src/components/media_dialog/image_selector.js b/addons/web_unsplash/static/src/components/media_dialog/image_selector.js index e716dc7afef..cf1ad7b29cb 100644 --- a/addons/web_unsplash/static/src/components/media_dialog/image_selector.js +++ b/addons/web_unsplash/static/src/components/media_dialog/image_selector.js @@ -246,8 +246,6 @@ patch(uploadService, { name: records.length > 1 ? _t("Uploading %s '%s' images.", records.length, records[0].query) : _t("Uploading '%s' image.", records[0].query), - size: null, - progress: 0, }); try {