diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 62f1443a9..37c4d54e9 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -1411,7 +1411,7 @@ src/app/services/toast.service.ts - 32 + 35 @@ -2645,11 +2645,36 @@ 195 + + Error retrieving metadata + + src/app/components/document-detail/document-detail.component.ts + 305 + + + + Error retrieving suggestions + + src/app/components/document-detail/document-detail.component.ts + 319 + + + + Error saving document + + src/app/components/document-detail/document-detail.component.ts + 432 + + + src/app/components/document-detail/document-detail.component.ts + 476 + + Confirm delete src/app/components/document-detail/document-detail.component.ts - 489 + 505 src/app/components/manage/management-list/management-list.component.ts @@ -2660,35 +2685,35 @@ Do you really want to delete document ""? src/app/components/document-detail/document-detail.component.ts - 490 + 506 The files for this document will be deleted permanently. This operation cannot be undone. src/app/components/document-detail/document-detail.component.ts - 491 + 507 Delete document src/app/components/document-detail/document-detail.component.ts - 493 + 509 Error deleting document: src/app/components/document-detail/document-detail.component.ts - 509 + 525 Redo OCR confirm src/app/components/document-detail/document-detail.component.ts - 529 + 545 src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -2699,14 +2724,14 @@ This operation will permanently redo OCR for this document. src/app/components/document-detail/document-detail.component.ts - 530 + 546 This operation cannot be undone. src/app/components/document-detail/document-detail.component.ts - 531 + 547 src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -2737,7 +2762,7 @@ Proceed src/app/components/document-detail/document-detail.component.ts - 533 + 549 src/app/components/document-list/bulk-editor/bulk-editor.component.ts @@ -2764,7 +2789,7 @@ Redo OCR operation will begin in the background. Close and re-open or reload this document after the operation has completed to see new content. src/app/components/document-detail/document-detail.component.ts - 541 + 557 @@ -2773,7 +2798,7 @@ )"/> src/app/components/document-detail/document-detail.component.ts - 552,554 + 568,570 @@ -4991,7 +5016,7 @@ Information src/app/services/toast.service.ts - 36 + 43 diff --git a/src-ui/src/app/components/common/toasts/toasts.component.scss b/src-ui/src/app/components/common/toasts/toasts.component.scss index e6dcb7a57..52f8f8957 100644 --- a/src-ui/src/app/components/common/toasts/toasts.component.scss +++ b/src-ui/src/app/components/common/toasts/toasts.component.scss @@ -9,3 +9,14 @@ .toast:not(.show) { display: block; // this corrects an ng-bootstrap bug that prevented animations } + +::ng-deep .toast.error .toast-header { + background-color: hsla(350, 79%, 40%, 0.8); // bg-danger + border-color: black; +} + +::ng-deep .toast.error .toast-body { + background-color: hsla(350, 79%, 40%, 0.8); // bg-danger + border-bottom-left-radius: inherit; + border-bottom-right-radius: inherit; +} diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index 4178ccbda..33a0d4114 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -301,6 +301,9 @@ export class DocumentDetailComponent }, error: (error) => { this.metadata = null + this.toastService.showError( + $localize`Error retrieving metadata` + ': ' + error.toString() + ) }, }) this.documentsService @@ -312,6 +315,9 @@ export class DocumentDetailComponent }, error: (error) => { this.suggestions = null + this.toastService.showError( + $localize`Error retrieving suggestions` + ': ' + error.toString() + ) }, }) this.title = this.documentTitlePipe.transform(doc.title) @@ -422,6 +428,11 @@ export class DocumentDetailComponent error: (error) => { this.networkActive = false this.error = error.error + this.toastService.showError( + $localize`Error saving document` + + ': ' + + (error.message ?? error.toString()) + ) }, }) } @@ -461,6 +472,11 @@ export class DocumentDetailComponent error: (error) => { this.networkActive = false this.error = error.error + this.toastService.showError( + $localize`Error saving document` + + ': ' + + (error.message ?? error.toString()) + ) }, }) } diff --git a/src-ui/src/app/services/toast.service.ts b/src-ui/src/app/services/toast.service.ts index 7c35b624c..6bd1158bc 100644 --- a/src-ui/src/app/services/toast.service.ts +++ b/src-ui/src/app/services/toast.service.ts @@ -11,6 +11,8 @@ export interface Toast { action?: any actionName?: string + + classname?: string } @Injectable({ @@ -29,7 +31,12 @@ export class ToastService { } showError(content: string, delay: number = 10000) { - this.show({ title: $localize`Error`, content: content, delay: delay }) + this.show({ + title: $localize`Error`, + content: content, + delay: delay, + classname: 'error', + }) } showInfo(content: string, delay: number = 5000) {