Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#50286] added error toast on failed attachment upload

Eric Schuberta8d815a57615
diff --git a/frontend/src/app/shared/components/attachments/attachments.component.ts b/frontend/src/app/shared/components/attachments/attachments.component.ts
index af38669bdf4..eb3ecb32021 100644
--- a/frontend/src/app/shared/components/attachments/attachments.component.ts
+++ b/frontend/src/app/shared/components/attachments/attachments.component.ts
@@ -53,6 +53,7 @@ import { OpUploadService } from 'core-app/core/upload/upload.service';
import { TimezoneService } from 'core-app/core/datetime/timezone.service';
import { IAttachment } from 'core-app/core/state/attachments/attachment.model';
import isNewResource from 'core-app/features/hal/helpers/is-new-resource';
+import { HttpErrorResponse } from '@angular/common/http';
function containsFiles(dataTransfer:DataTransfer):boolean {
return dataTransfer.types.indexOf('Files') >= 0;
@@ -246,7 +247,10 @@ export class OpAttachmentsComponent extends UntilDestroyedMixin implements OnIni
this
.attachmentsResourceService
.attachFiles(this.resource, filesWithoutFolders)
- .subscribe();
+ .subscribe({
+ next: () => {},
+ error: (error:HttpErrorResponse) => this.toastService.addError(error),
+ });
}
/**