From 2e3089bba9ff20c52ff440f079fa6ad98b5f5163 Mon Sep 17 00:00:00 2001 From: CM Date: Sat, 28 Sep 2024 14:45:22 +0200 Subject: [PATCH 1/3] Push devcontainer version to php8.2 Signed-off-by: Christoph Mair --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bffdc8744..4ccc0b60b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "image": "ghcr.io/juliushaertl/nextcloud-dev-php80:latest", + "image": "ghcr.io/juliushaertl/nextcloud-dev-php82:latest", "forwardPorts": [80], "containerEnv": { "NEXTCLOUD_AUTOINSTALL_APPS": "tables", From d4018ed4427b2cea4389ced1212ae2b4a8903ca5 Mon Sep 17 00:00:00 2001 From: Christoph Mair Date: Sat, 28 Sep 2024 15:11:44 +0200 Subject: [PATCH 2/3] re-add thumbnailUrl and icon to write those into the DB. Actually thumbnailUrl gets sent to the api but is dropped. Therefore no preview inside the table is possible anymore. Signed-off-by: Christoph Mair --- lib/Service/ColumnTypes/TextLinkBusiness.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Service/ColumnTypes/TextLinkBusiness.php b/lib/Service/ColumnTypes/TextLinkBusiness.php index 52560eec5..606592c13 100644 --- a/lib/Service/ColumnTypes/TextLinkBusiness.php +++ b/lib/Service/ColumnTypes/TextLinkBusiness.php @@ -36,6 +36,8 @@ public function parseValue($value, ?Column $column = null): string { if($data !== null) { if (isset($data['resourceUrl'])) { return json_encode(json_encode([ + 'thumbnailUrl' => $data['thumbnailUrl'], + 'icon' => $data['icon'], 'title' => $data['title'] ?? $data['resourceUrl'], 'value' => $data['resourceUrl'], 'providerId' => 'url', From ed9264f0b88d3282326c8678b813a7213b77a382 Mon Sep 17 00:00:00 2001 From: CM Date: Tue, 22 Oct 2024 15:00:30 +0000 Subject: [PATCH 3/3] Correct phpunit tests because of modifications to TextLinkBusiness.php to show thumbnail of files Signed-off-by: CM --- .../Service/ColumnTypes/TextLinkBusinessTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/unit/Service/ColumnTypes/TextLinkBusinessTest.php b/tests/unit/Service/ColumnTypes/TextLinkBusinessTest.php index d25cd5972..c92ad8aae 100644 --- a/tests/unit/Service/ColumnTypes/TextLinkBusinessTest.php +++ b/tests/unit/Service/ColumnTypes/TextLinkBusinessTest.php @@ -71,10 +71,25 @@ public function testParseValue() { 'unknown' => 'https://nextcloud.com' ]), $column)); self::assertEquals(json_encode(json_encode([ + 'thumbnailUrl' => 'https://cloud.nextcloud.com/index.php/core/preview?x=32&y=32&fileId=1', + 'icon' => '/index.php/apps/theming/img/core/filetypes/images.svg?v=0a0a0a0a', 'title' => 'https://nextcloud.com', 'value' => 'https://nextcloud.com', 'providerId' => 'url', ])), $this->textLink->parseValue(json_encode([ + 'thumbnailUrl' => 'https://cloud.nextcloud.com/index.php/core/preview?x=32&y=32&fileId=1', + 'icon' => '/index.php/apps/theming/img/core/filetypes/images.svg?v=0a0a0a0a', + 'resourceUrl' => 'https://nextcloud.com' + ]), $column)); + self::assertEquals(json_encode(json_encode([ + 'thumbnailUrl' => '', + 'icon' => '/index.php/apps/theming/img/core/filetypes/application-pdf.svg?v=0a0a0a0a', + 'title' => 'https://nextcloud.com', + 'value' => 'https://nextcloud.com', + 'providerId' => 'url', + ])), $this->textLink->parseValue(json_encode([ + 'thumbnailUrl' => '', + 'icon' => '/index.php/apps/theming/img/core/filetypes/application-pdf.svg?v=0a0a0a0a', 'resourceUrl' => 'https://nextcloud.com' ]), $column)); self::assertEquals(json_encode(json_encode([