From d08430bdfdb0893436c511edb926bf1063ff8525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Thu, 5 Dec 2024 17:01:11 +0100 Subject: [PATCH 1/3] feat: add servingurl to default refkeys in filebone --- src/viur/core/bones/file.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/viur/core/bones/file.py b/src/viur/core/bones/file.py index 249e6231c..f63382984 100644 --- a/src/viur/core/bones/file.py +++ b/src/viur/core/bones/file.py @@ -146,6 +146,7 @@ def __init__( "height", "derived", "public", + "servingurl" ), public: bool = False, **kwargs From 403f26c4bbb490951f7e85ccf084fbe9c638e5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=B6gl?= Date: Thu, 5 Dec 2024 17:53:15 +0100 Subject: [PATCH 2/3] feat: add missing trailing comma on end of refkeys spec line --- src/viur/core/bones/file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/viur/core/bones/file.py b/src/viur/core/bones/file.py index f63382984..dfaab47c6 100644 --- a/src/viur/core/bones/file.py +++ b/src/viur/core/bones/file.py @@ -146,7 +146,7 @@ def __init__( "height", "derived", "public", - "servingurl" + "servingurl", ), public: bool = False, **kwargs From 4c79f4637969c0dbd5e27a4d71443fbdac3064c0 Mon Sep 17 00:00:00 2001 From: Jan Max Meyer Date: Thu, 5 Dec 2024 20:03:32 +0100 Subject: [PATCH 3/3] fix: Addig tooltip to serving_url bone. --- src/viur/core/modules/file.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/viur/core/modules/file.py b/src/viur/core/modules/file.py index 73edf89cc..a8bf27459 100644 --- a/src/viur/core/modules/file.py +++ b/src/viur/core/modules/file.py @@ -387,6 +387,9 @@ class FileLeafSkel(TreeSkel): serving_url = StringBone( descr="Serving-URL", readOnly=True, + params={ + "tooltip": "The 'serving_url' is only available in public file repositories.", + } ) def preProcessBlobLocks(self, locks): @@ -1263,7 +1266,7 @@ def inject_serving_url(self, skel: SkeletonInstance) -> None: and skel["mimetype"].startswith("image/") and not skel["serving_url"]: try: - bucket = File.get_bucket(skel['dlkey']) + bucket = File.get_bucket(skel["dlkey"]) skel["serving_url"] = images.get_serving_url( None, secure_url=True,