From d44e5fe86899556791fde5172ab6e7847725bbd7 Mon Sep 17 00:00:00 2001 From: Gunnar Velle Date: Fri, 20 Dec 2024 10:23:26 +0100 Subject: [PATCH 1/2] Set hideByline if not copyrighted --- src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx | 2 +- src/containers/VisualElement/VisualElementSearch.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx b/src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx index bb7d048b50..26aace28c0 100644 --- a/src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx +++ b/src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx @@ -114,7 +114,7 @@ const ImageEmbedForm = ({ embed, onSave, onClose, language, allowDecorative, ima lowerRightY: values.lowerRightY, align: values.align, size: values.size, - hideByline: values.hideByline ? "true" : undefined, + hideByline: `${values.hideByline}`, }); onClose(); }; diff --git a/src/containers/VisualElement/VisualElementSearch.tsx b/src/containers/VisualElement/VisualElementSearch.tsx index cf7fc058db..44489dd9f1 100644 --- a/src/containers/VisualElement/VisualElementSearch.tsx +++ b/src/containers/VisualElement/VisualElementSearch.tsx @@ -87,6 +87,7 @@ const VisualElementSearch = ({ alt: image.alttext.alttext ?? "", caption: image.caption.caption ?? "", metaData: image, + hideByline: `${image.copyright.license.license !== "COPYRIGHTED"}`, }) } showCheckbox={showMetaImageCheckbox} From a9b73c6ed55adef1fdb06df8a83ee2604fb3885b Mon Sep 17 00:00:00 2001 From: Gunnar Velle Date: Thu, 2 Jan 2025 10:05:54 +0100 Subject: [PATCH 2/2] Dont save "false" if not neccessary --- src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx b/src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx index 26aace28c0..bb7d048b50 100644 --- a/src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx +++ b/src/components/SlateEditor/plugins/image/ImageEmbedForm.tsx @@ -114,7 +114,7 @@ const ImageEmbedForm = ({ embed, onSave, onClose, language, allowDecorative, ima lowerRightY: values.lowerRightY, align: values.align, size: values.size, - hideByline: `${values.hideByline}`, + hideByline: values.hideByline ? "true" : undefined, }); onClose(); };