Skip to content

Commit

Permalink
feat: add insufficient quota info to file copy (#11699)
Browse files Browse the repository at this point in the history
* feat: add insufficient quota info to file copy

---------

Co-authored-by: Jan Ackermann <[email protected]>
  • Loading branch information
kulmann and AlexAndBear authored Oct 2, 2024
1 parent b2004f6 commit 4d2cd6c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/web-app-files/src/HandleUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ export class HandleUpload extends BasePlugin {
}

this.messageStore.showErrorMessage({
title: $gettext('Not enough quota'),
title: $gettext('Insufficient quota'),
desc: $gettext(
'There is not enough quota on %{spaceName}, you need additional %{missingSpace} to upload these files',
'Insufficient quota on %{spaceName}. You need additional %{missingSpace} to upload these files',
{
spaceName,
missingSpace: filesize<FileSizeOptionsString>(
Expand Down
4 changes: 2 additions & 2 deletions packages/web-pkg/src/components/AppTemplates/AppWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ export default defineComponent({
if (space) {
errorPopup(
new HttpError(
$gettext('There is not enough quota on "%{spaceName}" to save this file', {
$gettext('Insufficient quota on "%{spaceName}" to save this file', {
spaceName: space.name
}),
e.response
Expand All @@ -394,7 +394,7 @@ export default defineComponent({
break
}
errorPopup(
new HttpError($gettext('There is not enough quota to save this file'), e.response)
new HttpError($gettext('Insufficient quota for saving this file'), e.response)
)
break
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { ClientService } from '../../../services'
import { useMessages } from '../../../composables'
import { Ref, unref } from 'vue'
import type { Language } from 'vue3-gettext'
import { HttpError } from '@ownclouders/web-client'

export class ResourceTransfer extends ConflictDialog {
constructor(
Expand Down Expand Up @@ -90,8 +91,16 @@ export class ResourceTransfer extends ConflictDialog {
? this.$gettext('Failed to copy "%{name}"', { name: errors[0]?.resourceName }, true)
: this.$gettext('Failed to move "%{name}"', { name: errors[0]?.resourceName }, true)
}
let description = ''
if (errors.some(({ error }) => error instanceof HttpError && error.statusCode === 507)) {
description = this.$gettext('Insufficient quota')
}
const messageStore = useMessages()
messageStore.showErrorMessage({ title, errors: errors.map(({ error }) => error) })
messageStore.showErrorMessage({
title,
...(description && { desc: description }),
errors: errors.map(({ error }) => error)
})
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/cucumber/features/smoke/upload.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Feature: Upload
| simple.pdf |
| testavatar.jpg |
And "Alice" tries to upload the following resource
| resource | error |
| lorem-big.txt | Not enough quota |
| resource | error |
| lorem-big.txt | Insufficient quota |
And "Alice" downloads the following resources using the sidebar panel
| resource | type |
| PARENT | folder |
Expand Down

0 comments on commit 4d2cd6c

Please sign in to comment.