From c1267fc0016827797e478c2455ab29eb2a70b6a2 Mon Sep 17 00:00:00 2001 From: Jan Ackermann Date: Fri, 8 Dec 2023 21:28:50 +0100 Subject: [PATCH 1/3] Add quota from existing space while duplicatin --- .../src/composables/actions/spaces/useSpaceActionsDuplicate.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web-pkg/src/composables/actions/spaces/useSpaceActionsDuplicate.ts b/packages/web-pkg/src/composables/actions/spaces/useSpaceActionsDuplicate.ts index c30fed1c751..1798d20ec79 100644 --- a/packages/web-pkg/src/composables/actions/spaces/useSpaceActionsDuplicate.ts +++ b/packages/web-pkg/src/composables/actions/spaces/useSpaceActionsDuplicate.ts @@ -38,7 +38,8 @@ export const useSpaceActionsDuplicate = ({ const { data: createdSpace } = await clientService.graphAuthenticated.drives.createDrive( { name: duplicatedSpaceName, - description: existingSpace.description + description: existingSpace.description, + quota: { total: existingSpace.spaceQuota.total } }, {} ) From 44bfbb847dd14c87b84af521df62922266a66562 Mon Sep 17 00:00:00 2001 From: Jan Ackermann Date: Fri, 8 Dec 2023 21:30:25 +0100 Subject: [PATCH 2/3] Enhance changelog item --- changelog/unreleased/enhancement-duplicate-space | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog/unreleased/enhancement-duplicate-space b/changelog/unreleased/enhancement-duplicate-space index 3428fbf9ea2..f1f5448184b 100644 --- a/changelog/unreleased/enhancement-duplicate-space +++ b/changelog/unreleased/enhancement-duplicate-space @@ -6,4 +6,6 @@ like tags or members. https://github.com/owncloud/web/pull/10024 https://github.com/owncloud/web/pull/10132 +https://github.com/owncloud/web/pull/10139 https://github.com/owncloud/web/issues/10016 +https://github.com/owncloud/web/issues/10123 From a2e9ec2ba33bfc7168393d18c8af661169de72f0 Mon Sep 17 00:00:00 2001 From: Jan Ackermann Date: Fri, 8 Dec 2023 22:15:32 +0100 Subject: [PATCH 3/3] Add to unit test --- .../actions/spaces/useSpaceActionsDuplicate.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/web-pkg/tests/unit/composables/actions/spaces/useSpaceActionsDuplicate.spec.ts b/packages/web-pkg/tests/unit/composables/actions/spaces/useSpaceActionsDuplicate.spec.ts index 1580d91b74b..1a3752d85eb 100644 --- a/packages/web-pkg/tests/unit/composables/actions/spaces/useSpaceActionsDuplicate.spec.ts +++ b/packages/web-pkg/tests/unit/composables/actions/spaces/useSpaceActionsDuplicate.spec.ts @@ -18,7 +18,8 @@ const spaces = [ description: 'To the moon', type: 'project', spaceImageData: null, - spaceReadmeData: null + spaceReadmeData: null, + spaceQuota: { total: Math.pow(10, 9) } }) ] describe('restore', () => { @@ -115,7 +116,10 @@ describe('restore', () => { expect(clientService.graphAuthenticated.drives.createDrive).toHaveBeenCalledWith( { description: 'To the moon', - name: 'Moon (1)' + name: 'Moon (1)', + quota: { + total: Math.pow(10, 9) + } }, expect.anything() )