From ce246669d943c5861497ab4ec8681bddeaae87ce Mon Sep 17 00:00:00 2001 From: Sebastian Krupinski Date: Sat, 29 Aug 2026 19:11:45 -0400 Subject: [PATCH] feat: use new variant type Signed-off-by: Sebastian Krupinski --- lib/Controllers/TransferController.php | 2 +- lib/Manager.php | 2 +- src/composables/useDocumentManager.ts | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Controllers/TransferController.php b/lib/Controllers/TransferController.php index 7bbd8c5..e2883ba 100644 --- a/lib/Controllers/TransferController.php +++ b/lib/Controllers/TransferController.php @@ -121,7 +121,7 @@ class TransferController extends ControllerAbstract } #[AuthenticatedRoute('/preview/entity/{provider}/{service}/{collection}/{identifier}', name: 'document_manager.preview.entity', methods: ['GET'])] - public function previewEntity(string $provider, string $service, string $collection, string $identifier, string $variant = 'popover'): Response { + public function previewEntity(string $provider, string $service, string $collection, string $identifier, string $variant = 'inline'): Response { try { $preview = $this->manager->entityPreview( $this->tenantContext->identifier(), diff --git a/lib/Manager.php b/lib/Manager.php index bdd7f7b..4b4c434 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -1351,7 +1351,7 @@ class Manager { /** * Resolve an authorized entity and lazily generate or retrieve its preview. */ - public function entityPreview(string $tenantId, string $userId, EntityIdentifier $target, string $variant = 'popover'): ?Preview { + public function entityPreview(string $tenantId, string $userId, EntityIdentifier $target, string $variant = 'inline'): ?Preview { $entities = $this->entityFetchBulk($tenantId, $userId, $target); $entity = $entities[$target->entity()] ?? reset($entities); if (!$entity instanceof EntityBaseInterface) { diff --git a/src/composables/useDocumentManager.ts b/src/composables/useDocumentManager.ts index 8b34a8b..0b20518 100644 --- a/src/composables/useDocumentManager.ts +++ b/src/composables/useDocumentManager.ts @@ -203,9 +203,13 @@ export function useDocumentManager(options: UseDocumentManagerOptions) { return `${TRANSFER_BASE_URL}/download/entity/${encodeURIComponent(currentProviderId())}/${encodeURIComponent(currentServiceId())}/${encodeURIComponent(collection)}/${encodeURIComponent(entityId)}` } - const getEntityPreviewUrl = (entityId: string, collectionId?: string | null): string => { + const getEntityPreviewUrl = ( + entityId: string, + collectionId?: string | null, + variant: 'thumbnail' | 'inline' | 'fullscreen' = 'inline', + ): string => { const collection = collectionId ?? currentLocation.value - return `${TRANSFER_BASE_URL}/preview/entity/${encodeURIComponent(currentProviderId())}/${encodeURIComponent(currentServiceId())}/${encodeURIComponent(collection)}/${encodeURIComponent(entityId)}?variant=popover` + return `${TRANSFER_BASE_URL}/preview/entity/${encodeURIComponent(currentProviderId())}/${encodeURIComponent(currentServiceId())}/${encodeURIComponent(collection)}/${encodeURIComponent(entityId)}?variant=${variant}` } // Download a single file