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

[#50898] fixed default upload error

Eric Schubertab5d370529d3
diff --git a/frontend/src/app/shared/components/storages/storage/storage.component.ts b/frontend/src/app/shared/components/storages/storage/storage.component.ts
index 8e6d307f754..58b9d8b9167 100644
--- a/frontend/src/app/shared/components/storages/storage/storage.component.ts
+++ b/frontend/src/app/shared/components/storages/storage/storage.component.ts
@@ -59,6 +59,7 @@ import { IProjectStorage } from 'core-app/core/state/project-storages/project-st
import { FileLinksResourceService } from 'core-app/core/state/file-links/file-links.service';
import {
fileLinkViewError,
+ nextcloud,
storageConnected,
} from 'core-app/shared/components/storages/storages-constants.const';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
@@ -143,6 +144,7 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnD
toast: {
successFileLinksCreated: (count:number):string => this.i18n.t('js.storages.file_links.success_create', { count }),
uploadFailed: (fileName:string):string => this.i18n.t('js.storages.file_links.upload_error.default', { fileName }),
+ uploadFailedNextcloudDetail: this.i18n.t('js.storages.file_links.upload_error.detail.nextcloud'),
uploadFailedForbidden: (fileName:string):string => this.i18n.t('js.storages.file_links.upload_error.403', { fileName }),
uploadFailedSizeLimit:
(fileName:string, storageType:string):string => this.i18n.t(
@@ -433,7 +435,12 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnD
this.toastService.addError(this.text.toast.uploadFailedQuota(fileName));
break;
default:
- this.toastService.addError(this.text.toast.uploadFailed(fileName));
+ this.storage
+ .pipe(first())
+ .subscribe((storage) => {
+ const additionalInfo = storage._links.type.href === nextcloud ? this.text.toast.uploadFailedNextcloudDetail : [];
+ this.toastService.addError(this.text.toast.uploadFailed(fileName), additionalInfo);
+ });
}
}
diff --git a/modules/storages/config/locales/js-en.yml b/modules/storages/config/locales/js-en.yml
index 52f955438f9..16bf9cd179b 100644
--- a/modules/storages/config/locales/js-en.yml
+++ b/modules/storages/config/locales/js-en.yml
@@ -75,7 +75,7 @@ en:
other: "Successfully created %{count} file links."
upload_error:
default: >
- Your file (%{fileName}) could not be uploaded. Please check that the latest version of the Nextcloud App "OpenProject Integration" is installed and contact your administrator for more information.
+ Your file (%{fileName}) could not be uploaded.
403: >
Your file (%{fileName}) could not be uploaded due to system restrictions.
Please contact your administrator for more information.
@@ -85,6 +85,10 @@ en:
507: >
Your file (%{fileName}) is bigger than the storage quota allows.
Contact your administrator to modify this quota.
+ detail:
+ nextcloud: >
+ Please check that the latest version of the Nextcloud App"OpenProject Integration" is installed and
+ contact your administrator for more information.
link_uploaded_file_error: >
An error occurred linking the recently uploaded file '%{fileName}' to the work package %{workPackageId}.
not_allowed_tooltip: "Please log in to Nextcloud to access this file"