Display meaningful upload error message
This commit is contained in:
parent
606e4fbb5a
commit
61a04f0a18
@ -1,10 +1,6 @@
|
|||||||
<section (mouseout)="close()">
|
<section (mouseout)="close()">
|
||||||
<mat-icon class="upload-icon" svgIcon="red:upload"></mat-icon>
|
<mat-icon svgIcon="red:upload"></mat-icon>
|
||||||
<div class="heading-xl">
|
<div class="heading-xl">
|
||||||
{{ 'dossier-overview.upload-files' | translate }}
|
{{ 'dossier-overview.upload-files' | translate }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button (click)="close()" class="close-icon" mat-icon-button>
|
|
||||||
<mat-icon svgIcon="red:close"></mat-icon>
|
|
||||||
</button>
|
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
@import '../../../../assets/styles/red-variables.scss';
|
||||||
|
|
||||||
section {
|
section {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
@ -15,16 +17,12 @@ section {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.upload-icon {
|
mat-icon {
|
||||||
width: 34px;
|
height: 60px;
|
||||||
height: 34px;
|
width: 60px;
|
||||||
margin-bottom: 10px;
|
}
|
||||||
|
|
||||||
|
.heading-xl {
|
||||||
|
margin-top: 24px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-icon {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 1100;
|
|
||||||
top: 20px;
|
|
||||||
right: 40px;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -181,13 +181,18 @@ export class FileUploadService {
|
|||||||
await this._appStateService.reloadActiveDossierFiles();
|
await this._appStateService.reloadActiveDossierFiles();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
() => {
|
err => {
|
||||||
uploadFile.completed = true;
|
uploadFile.completed = true;
|
||||||
uploadFile.error = {
|
uploadFile.error = {
|
||||||
message: this._translateService.instant('upload-status.error.generic')
|
// Extract error message
|
||||||
|
message:
|
||||||
|
this._translateService.instant('upload-status.error.generic') +
|
||||||
|
(err?.error?.message?.includes('message')
|
||||||
|
? ` ${err.error.message.match('"message":"(.*?)\\"')[1]}`
|
||||||
|
: '')
|
||||||
};
|
};
|
||||||
this._removeUpload(uploadFile);
|
this._removeUpload(uploadFile);
|
||||||
if (uploadFile.retryCount < 5) {
|
if (uploadFile.retryCount < 5 && err.status !== 400) {
|
||||||
uploadFile.retryCount += 1;
|
uploadFile.retryCount += 1;
|
||||||
this.scheduleUpload(uploadFile);
|
this.scheduleUpload(uploadFile);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
"upload-status": {
|
"upload-status": {
|
||||||
"error": {
|
"error": {
|
||||||
"file-size": "Datei zu groß. Das Limit ist {{size}} MB.",
|
"file-size": "Datei zu groß. Das Limit ist {{size}} MB.",
|
||||||
"generic": "Datei konnte nicht hochgeladen werden ..."
|
"generic": "Datei konnte nicht hochgeladen werden."
|
||||||
},
|
},
|
||||||
"dialog": {
|
"dialog": {
|
||||||
"title": "Datei-Uploads ({{len}})",
|
"title": "Datei-Uploads ({{len}})",
|
||||||
|
|||||||
@ -10,8 +10,8 @@
|
|||||||
"dev-mode": "[ DEV MODE ]",
|
"dev-mode": "[ DEV MODE ]",
|
||||||
"upload-status": {
|
"upload-status": {
|
||||||
"error": {
|
"error": {
|
||||||
"file-size": "File to large. Limit is {{size}}MB.",
|
"file-size": "File too large. Limit is {{size}}MB.",
|
||||||
"generic": "Failed to upload file... "
|
"generic": "Failed to upload file. "
|
||||||
},
|
},
|
||||||
"dialog": {
|
"dialog": {
|
||||||
"title": "File Uploads ({{len}})",
|
"title": "File Uploads ({{len}})",
|
||||||
@ -257,7 +257,7 @@
|
|||||||
"approve": "Approve",
|
"approve": "Approve",
|
||||||
"approve-disabled": "File can only be approved once it has been analysed with the latest dictionaries and all suggestions have been processed",
|
"approve-disabled": "File can only be approved once it has been analysed with the latest dictionaries and all suggestions have been processed",
|
||||||
"under-review": "Under Review",
|
"under-review": "Under Review",
|
||||||
"upload-files": "Drag & Drop files anywhere",
|
"upload-files": "Drag & drop files anywhere...",
|
||||||
"upload-files-btn": "Upload Files",
|
"upload-files-btn": "Upload Files",
|
||||||
"new-rule": {
|
"new-rule": {
|
||||||
"label": "Outdated",
|
"label": "Outdated",
|
||||||
|
|||||||
@ -99,7 +99,6 @@ form {
|
|||||||
border: 1px solid $grey-5;
|
border: 1px solid $grey-5;
|
||||||
font-family: Inter, sans-serif;
|
font-family: Inter, sans-serif;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 18px;
|
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
outline: none;
|
outline: none;
|
||||||
@ -133,6 +132,10 @@ form {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
.hex-color-input {
|
.hex-color-input {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
max-width: 150px;
|
max-width: 150px;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user