From: John Molakvoæ Date: Wed, 8 Nov 2023 16:50:20 +0000 (+0100) Subject: feat(files): disable upload button if quota is reached X-Git-Tag: v29.0.0beta1~710^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=431ac74d788535c29c97a6f7f9746b16af37afa8;p=nextcloud-server.git feat(files): disable upload button if quota is reached Signed-off-by: John Molakvoæ --- diff --git a/apps/files/src/views/FilesList.vue b/apps/files/src/views/FilesList.vue index 6aeb308677c..2fabbc7c5fa 100644 --- a/apps/files/src/views/FilesList.vue +++ b/apps/files/src/views/FilesList.vue @@ -25,6 +25,7 @@ + + + + + {{ t('files', 'Add') }} + + - @@ -122,6 +138,7 @@ import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js' import NcIconSvgWrapper from '@nextcloud/vue/dist/Components/NcIconSvgWrapper.js' import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js' +import PlusIcon from 'vue-material-design-icons/Plus.vue' import ShareVariantIcon from 'vue-material-design-icons/ShareVariant.vue' import ViewGridIcon from 'vue-material-design-icons/ViewGrid.vue' @@ -155,6 +172,7 @@ export default defineComponent({ NcEmptyContent, NcIconSvgWrapper, NcLoadingIcon, + PlusIcon, ShareVariantIcon, UploadPicker, ViewGridIcon, @@ -360,6 +378,15 @@ export default defineComponent({ canUpload() { return this.currentFolder && (this.currentFolder.permissions & Permission.CREATE) !== 0 }, + isQuotaExceeded() { + return this.currentFolder?.attributes?.['quota-available-bytes'] === 0 + }, + cantUploadLabel() { + if (this.isQuotaExceeded) { + return this.t('files', 'Your have used your space quota and cannot upload files anymore') + } + return this.t('files', 'You don’t have permission to upload or create files here') + }, /** * Check if current folder has share permissions