From be8edcc9d646ef85767e7785eaa09943e410dab5 Mon Sep 17 00:00:00 2001 From: Cilibiu Bogdan Date: Fri, 15 Jun 2018 14:18:30 +0300 Subject: [PATCH] [ACA] Upload - 500 error message (#419) * 500 error message * generic error message --- src/app/components/page.component.ts | 12 +++++++++--- src/assets/i18n/en.json | 12 +++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/components/page.component.ts b/src/app/components/page.component.ts index 38cbc8f93..a81857959 100644 --- a/src/app/components/page.component.ts +++ b/src/app/components/page.component.ts @@ -191,12 +191,18 @@ export abstract class PageComponent implements OnInit, OnDestroy { } onFileUploadedError(error: FileUploadErrorEvent) { - let message = null; + let message = 'APP.MESSAGES.UPLOAD.ERROR.GENERIC'; if (error.error.status === 409) { - message = new SnackbarErrorAction('VERSION.MESSAGE.ERROR.CONFLICT'); + message = 'APP.MESSAGES.UPLOAD.ERROR.CONFLICT'; } - this.store.dispatch(message); + if (error.error.status === 500) { + message = 'APP.MESSAGES.UPLOAD.ERROR.500'; + } + + const action = new SnackbarErrorAction(message); + + this.store.dispatch(action); } } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 32b256490..cec609fb1 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -174,6 +174,13 @@ } } }, + "UPLOAD": { + "ERROR": { + "GENERIC": "Opps! There was a problem", + "CONFLICT": "New version not uploaded, another file with the same name already exists", + "500": "Opps! There was a problem while uploading" + } + }, "INFO": { "TRASH": { "NODES_PURGE": { @@ -231,11 +238,6 @@ "SEARCH": "Search" }, "VERSION": { - "MESSAGE": { - "ERROR": { - "CONFLICT": "New version not uploaded, another file with the same name already exists" - } - }, "DIALOG": { "TITLE": "Manage Versions", "CLOSE": "Close"