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

[#45938] fixed toast texts

Eric Schubert711cf287c45f
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 2f28c40dded..5a9dc3cef3b 100644
--- a/frontend/src/app/shared/components/storages/storage/storage.component.ts
+++ b/frontend/src/app/shared/components/storages/storage/storage.component.ts
@@ -139,10 +139,23 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnD
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 }),
uploadFailedForbidden: (fileName:string):string => this.i18n.t('js.storages.file_links.upload_error.403', { fileName }),
- uploadFailedSizeLimit: (fileName:string):string => this.i18n.t('js.storages.file_links.upload_error.413', { fileName }),
+ uploadFailedSizeLimit:
+ (fileName:string, storageType:string):string => this.i18n.t(
+ 'js.storages.file_links.upload_error.413',
+ {
+ fileName,
+ storageType,
+ },
+ ),
uploadFailedQuota: (fileName:string):string => this.i18n.t('js.storages.file_links.upload_error.507', { fileName }),
- linkingAfterUploadFailed: (fileName:string, workPackageId:string):string =>
- this.i18n.t('js.storages.file_links.link_uploaded_file_error', { fileName, workPackageId }),
+ linkingAfterUploadFailed:
+ (fileName:string, workPackageId:string):string => this.i18n.t(
+ 'js.storages.file_links.link_uploaded_file_error',
+ {
+ fileName,
+ workPackageId,
+ },
+ ),
draggingManyFiles: (storageType:string):string => this.i18n.t('js.storages.files.dragging_many_files', { storageType }),
uploadingLabel: this.i18n.t('js.label_upload_notification'),
},
@@ -324,7 +337,7 @@ export class StorageComponent extends UntilDestroyedMixin implements OnInit, OnD
this.toastService.addError(this.text.toast.uploadFailedForbidden(fileName));
break;
case 413:
- this.toastService.addError(this.text.toast.uploadFailedSizeLimit(fileName));
+ this.toastService.addError(this.text.toast.uploadFailedSizeLimit(fileName, this.storageType));
break;
case 507:
this.toastService.addError(this.text.toast.uploadFailedQuota(fileName));
diff --git a/frontend/src/app/shared/components/toaster/toast.component.html b/frontend/src/app/shared/components/toaster/toast.component.html
index 8dfe9eaef2e..52203d38169 100644
--- a/frontend/src/app/shared/components/toaster/toast.component.html
+++ b/frontend/src/app/shared/components/toaster/toast.component.html
@@ -62,3 +62,4 @@
<span class="spot-icon spot-icon_close"></span>
</button>
</div>
+</div>
diff --git a/frontend/src/global_styles/content/_toast.sass b/frontend/src/global_styles/content/_toast.sass
index de81f2427f6..7b6d95b21af 100644
--- a/frontend/src/global_styles/content/_toast.sass
+++ b/frontend/src/global_styles/content/_toast.sass
@@ -106,6 +106,7 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
@include spot-z-index("toast")
+toaster-layout($x: left, $y: top, $size: auto, $offset: rem-calc(0))
+toaster-style($background: $nm-color-background, $color: var(--body-font-color), $padding: $nm-padding-box, $radius: $nm-border-radius)
+
.toaster-icon
+toaster-icon($size: $toaster-icon-size, $margin: $toaster-icon-margin, $align: $toaster-icon-align)
display: flex
@@ -113,21 +114,16 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
border: rem-calc(1px) solid $nm-color-border
font-size: $nm-font-size
word-wrap: break-word
+
& .button
margin: rem-calc(10px 10px 0 0)
.op-toast--close
position: absolute
- top: rem-calc(12px)
- right: rem-calc(12px)
- background-color: rgba(0, 0, 0, 0)
- border-radius: rem-calc(50px)
- width: 1rem
- height: 1rem
- display: flex
- align-items: center
- text-align: center
- line-height: rem-calc(20px)
+ color: $spot-color-basic-gray-1
+ top: $spot-spacing-0_5
+ right: $spot-spacing-0_5
+
&:hover
text-decoration: none
@@ -136,6 +132,7 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
&.-warning,
&.-info
padding: $nm-box-padding
+
&.-ee-upsale
z-index: 1
@@ -144,18 +141,21 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
&.-error
@extend %error-placeholder
+
&::before
@include messages-icon
@extend %nm-icon-error
&.-success
@extend %success-placeholder
+
&::before
@include messages-icon
@extend %nm-icon-success
&.-warning
@extend %warning-placeholder
+
&::before
@include messages-icon
@extend %nm-icon-warning
@@ -176,7 +176,8 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
//messy I dont have all the details for a magic resolve, this might change
& p, & div, & ul
margin-bottom: 0
- & p, & div, & ul>li, & .button
+
+ & p, & div, & ul > li, & .button
font-size: $nm-font-size
&.-with-bottom-spacing
@@ -185,10 +186,13 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
[class^="icon-"]
&.-error
color: var(--content-form-danger-zone-bg-color)
+
&.-success
color: $nm-color-success-icon
+
&.-warning
color: $nm-color-warning-icon
+
&.-info
color: $nm-color-info-icon
@@ -201,11 +205,13 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
right: 10%
.op-toast--wrapper
- z-index: 10000 // Higher than loading indicator and modal wrapper!
+ // Higher than loading indicator and modal wrapper!
+ z-index: 10000
top: 4rem
.op-toast--casing
position: relative
+
.op-toast
margin-bottom: rem-calc(3px)
@@ -217,11 +223,14 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
&.ng-enter
transition: opacity 0.5s ease
opacity: 0
+
&.ng-enter.ng-enter-active
opacity: 1
+
&.ng-leave
transition: opacity 2s ease
opacity: 1
+
&.ng-leave.ng-leave-active
opacity: 0
@@ -235,11 +244,14 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
progress[value]
@extend %progress-styles
+
&::-moz-progress-bar
border-radius: $nm-pb-border-radius
+
&::-webkit-progress-bar
background-color: $nm-pb-regress-color
border-radius: $nm-pb-border-radius
+
&::-webkit-progress-value
border-radius: $nm-pb-border-radius
@@ -273,8 +285,10 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
.op-toast--uploads-element
margin: rem-calc(5 0)
+
.filename
font-weight: bold
+
[class^="icon-"]
font-size: $nm-upload-file-status-icon-size
@@ -288,10 +302,13 @@ $nm-upload-box-padding: rem-calc(15) rem-calc(25)
border-width: rem-calc(1)
padding: rem-calc(5)
margin: rem-calc(5 0)
+
&.-error
@extend %error-placeholder
+
&.-success
@extend %success-placeholder
+
&.-warning
@extend %warning-placeholder
diff --git a/modules/storages/config/locales/js-en.yml b/modules/storages/config/locales/js-en.yml
index aa830034d3b..2b36d21162e 100644
--- a/modules/storages/config/locales/js-en.yml
+++ b/modules/storages/config/locales/js-en.yml
@@ -58,12 +58,16 @@ en:
one: "Successfully created 1 file link."
other: "Successfully created %{count} file links."
upload_error:
- default: "An error occurred uploading the file '%{fileName}'."
- 403: "Uploading '%{fileName}' is forbidden."
+ default: "Your file (%{fileName}) could not be uploaded due to an error."
+ 403: >
+ Your file (%{fileName}) could not be uploaded due to system restrictions.
+ Please contact your administrator for more information.
413: >
- '%{fileName}' exceeds storage upload file size limits. To upload large files use the UI of the storage
- itself and create the file link afterwards.
- 507: "Uploading '%{fileName}' would exceed storage quota."
+ Your file (%{fileName}) is bigger than what OpenProject can upload to %{storageType}.
+ You can upload it directly to %{storageType} first and then link the file.
+ 507: >
+ Your file (%{fileName}) is bigger than the storage quota allows.
+ Contact your administrator to modify this quota.
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"