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", 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', 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([