From 24a4260e558b7ce3809f6de62ad18b7d4d3e4033 Mon Sep 17 00:00:00 2001 From: raul Date: Wed, 21 Sep 2022 19:12:54 +0200 Subject: [PATCH 01/11] Fix deleteAcl Signed-off-by: raul --- lib/Service/BoardService.php | 17 ++++++++++++----- tests/unit/Service/BoardServiceTest.php | 2 +- tests/unit/controller/BoardControllerTest.php | 8 ++++++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/lib/Service/BoardService.php b/lib/Service/BoardService.php index b6e749f61..01c560102 100644 --- a/lib/Service/BoardService.php +++ b/lib/Service/BoardService.php @@ -42,6 +42,7 @@ use OCA\Deck\Event\AclUpdatedEvent; use OCA\Deck\NoPermissionException; use OCA\Deck\Notification\NotificationHelper; use OCP\AppFramework\Db\DoesNotExistException; +use OCP\AppFramework\Db\MultipleObjectsReturnedException; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IDBConnection; @@ -55,6 +56,8 @@ use OCP\IUserManager; use OCA\Deck\BadRequestException; use OCP\IURLGenerator; use OCP\Server; +use Psr\Container\ContainerExceptionInterface; +use Psr\Container\NotFoundExceptionInterface; class BoardService { private BoardMapper $boardMapper; @@ -592,12 +595,14 @@ class BoardService { } /** + * @throws DbException * @throws DoesNotExistException - * @throws \OCA\Deck\NoPermissionException - * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException - * @throws BadRequestException + * @throws NoPermissionException + * @throws MultipleObjectsReturnedException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ - public function deleteAcl(int $id): bool { + public function deleteAcl(int $id): ?Acl { $this->permissionService->checkPermission($this->aclMapper, $id, Acl::PERMISSION_SHARE); /** @var Acl $acl */ $acl = $this->aclMapper->find($id); @@ -622,8 +627,10 @@ class BoardService { } } + $deletedAcl = $this->aclMapper->delete($acl); $this->eventDispatcher->dispatchTyped(new AclDeletedEvent($acl)); - return (bool) $this->aclMapper->delete($acl); + + return $deletedAcl; } /** diff --git a/tests/unit/Service/BoardServiceTest.php b/tests/unit/Service/BoardServiceTest.php index 128865c8e..1ebc9be41 100644 --- a/tests/unit/Service/BoardServiceTest.php +++ b/tests/unit/Service/BoardServiceTest.php @@ -427,6 +427,6 @@ class BoardServiceTest extends TestCase { ->method('delete') ->with($acl) ->willReturn($acl); - $this->assertTrue($this->service->deleteAcl(123)); + $this->assertEquals($acl, $this->service->deleteAcl(123)); } } diff --git a/tests/unit/controller/BoardControllerTest.php b/tests/unit/controller/BoardControllerTest.php index 505d96fda..fdb0ae203 100644 --- a/tests/unit/controller/BoardControllerTest.php +++ b/tests/unit/controller/BoardControllerTest.php @@ -164,10 +164,14 @@ class BoardControllerTest extends \Test\TestCase { } public function testDeleteAcl() { + $acl = $this->getMockBuilder(Acl::class) + ->disableOriginalConstructor() + ->getMock(); + $this->boardService->expects($this->once()) ->method('deleteAcl') ->with(1) - ->willReturn(true); - $this->assertEquals(true, $this->controller->deleteAcl(1)); + ->willReturn($acl); + $this->assertEquals($acl, $this->controller->deleteAcl(1)); } } From 9d489564d6e8529c0aea6a25a0972e9c7fa09287 Mon Sep 17 00:00:00 2001 From: raul Date: Wed, 21 Sep 2022 19:31:47 +0200 Subject: [PATCH 02/11] Fix psalm test Signed-off-by: raul --- lib/Reference/CardReferenceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Reference/CardReferenceProvider.php b/lib/Reference/CardReferenceProvider.php index ba3327b9c..42ae00ea0 100644 --- a/lib/Reference/CardReferenceProvider.php +++ b/lib/Reference/CardReferenceProvider.php @@ -81,7 +81,7 @@ class CardReferenceProvider implements IReferenceProvider { $card = $this->sanitizeSerializedCard($card); $board = $this->sanitizeSerializedBoard($board); $stack = $this->sanitizeSerializedStack($stack); - + /** @var IReference $reference */ $reference = new Reference($referenceText); $reference->setRichObject(Application::APP_ID . '-card', [ 'id' => $boardId . '/' . $cardId, From 565b2edfdde6b48b7415699b33c3fe9ce6c500bd Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Thu, 22 Sep 2022 13:05:28 +0200 Subject: [PATCH 03/11] use richtext component for description, adjust style to make it work in Text Signed-off-by: Julien Veyssier --- src/views/CardReferenceWidget.vue | 33 ++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/views/CardReferenceWidget.vue b/src/views/CardReferenceWidget.vue index 352495979..75aefb890 100644 --- a/src/views/CardReferenceWidget.vue +++ b/src/views/CardReferenceWidget.vue @@ -62,9 +62,14 @@
- {{ card.description }} + :class="{ + 'description': true, + 'short-description': shortDescription, + }"> +
@@ -83,6 +88,7 @@ import DeckIcon from '../components/icons/DeckIcon.vue' import AvatarList from '../components/cards/AvatarList.vue' import labelStyle from '../mixins/labelStyle.js' +import { RichText } from '@nextcloud/vue-richtext' import moment from '@nextcloud/moment' import { generateUrl } from '@nextcloud/router' @@ -94,6 +100,7 @@ export default { DeckIcon, CalendarBlankIcon, TextIcon, + RichText, }, mixins: [labelStyle], @@ -115,6 +122,7 @@ export default { data() { return { + shortDescription: true, } }, @@ -176,6 +184,8 @@ export default { .link { text-decoration: underline; + color: var(--color-main-text) !important; + padding: 0 !important; } .line { @@ -201,13 +211,22 @@ export default { .description-assignees { width: 100%; display: flex; - align-items: center; + align-items: start; + + .icon { + align-self: start; + margin-top: 8px; + } .description { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; margin-right: 8px; + padding-top: 6px; + max-height: 250px; + overflow: scroll; + &.short-description { + max-height: 25px; + overflow: hidden; + } } .card-assignees { From a383d389c454899c0c4a8db823fad71913edf775 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 22 Sep 2022 13:22:33 +0200 Subject: [PATCH 04/11] Add Nextcloud 25 support on master Signed-off-by: Joas Schilling --- appinfo/info.xml | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 6e9dbc84d..d7cd3c845 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -16,7 +16,7 @@ - 🚀 Get your project organized - 1.8.0-beta.1 + 1.9.0-beta.1 agpl Julius Härtl Deck @@ -34,7 +34,7 @@ pgsql sqlite mysql - + OCA\Deck\Cron\DeleteCron diff --git a/package.json b/package.json index b439a063f..4e45a3b2e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "deck", "description": "", - "version": "1.8.0-beta.1", + "version": "1.9.0-beta.1", "authors": [ { "name": "Julius Härtl", From aecdcb847d055965dc3a109ed876d879c3b8e235 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Thu, 22 Sep 2022 17:02:03 +0200 Subject: [PATCH 05/11] fix width issues Signed-off-by: Julien Veyssier --- src/init-card-reference.js | 1 - src/views/CardReferenceWidget.vue | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/init-card-reference.js b/src/init-card-reference.js index bb8093f21..5fa563ec9 100644 --- a/src/init-card-reference.js +++ b/src/init-card-reference.js @@ -36,7 +36,6 @@ registerWidget('deck-card', (el, { richObjectType, richObject, accessible }) => // trick to change the wrapper element size, otherwise it always is 100% // which is not very nice with a simple card el.parentNode.style['max-width'] = '400px' - el.parentNode.style['min-width'] = '200px' el.parentNode.style['margin-left'] = '0' el.parentNode.style['margin-right'] = '0' diff --git a/src/views/CardReferenceWidget.vue b/src/views/CardReferenceWidget.vue index 75aefb890..a0d711690 100644 --- a/src/views/CardReferenceWidget.vue +++ b/src/views/CardReferenceWidget.vue @@ -179,6 +179,10 @@ export default { .deck-card-reference { width: 100%; + // needed for the specific case of Text + .editor__content & { + width: calc(100% - 24px); + } white-space: normal; padding: 12px; From be36e6de6a3e32a38c415442c87f8defd62fe53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 22 Sep 2022 19:09:51 +0200 Subject: [PATCH 06/11] Use global import for nextcloud-vue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/BoardSelector.vue | 2 +- src/CardCreateDialog.vue | 4 +--- src/CardSelector.vue | 3 +-- src/init-card-reference.js | 2 +- src/views/Dashboard.vue | 3 +-- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/BoardSelector.vue b/src/BoardSelector.vue index 25d6b2bfd..cca16fa31 100644 --- a/src/BoardSelector.vue +++ b/src/BoardSelector.vue @@ -41,7 +41,7 @@