From bc70af637456a8cf3fbd30f432483566f36d926c Mon Sep 17 00:00:00 2001 From: Tomas Kikutis Date: Mon, 4 Dec 2023 18:36:11 +0100 Subject: [PATCH 1/2] article embeds --- apps/content_types/content_types.py | 4 ++++ superdesk/editor_utils.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/apps/content_types/content_types.py b/apps/content_types/content_types.py index 6b052afbad..b995c3ab68 100644 --- a/apps/content_types/content_types.py +++ b/apps/content_types/content_types.py @@ -98,6 +98,10 @@ class ContentTypesResource(superdesk.Resource): "type": "boolean", "default": False, }, + "embeddable": { + "type": "boolean", + "default": False, + }, "created_by": superdesk.Resource.rel("users", nullable=True), "updated_by": superdesk.Resource.rel("users", nullable=True), "init_version": {"type": "integer"}, diff --git a/superdesk/editor_utils.py b/superdesk/editor_utils.py index 5d57ddba59..ecf753223e 100644 --- a/superdesk/editor_utils.py +++ b/superdesk/editor_utils.py @@ -38,6 +38,7 @@ TABLE = "TABLE" MULTI_LINE_QUOTE = "MULTI-LINE_QUOTE" IMAGE = "IMAGE" +ARTICLE_EMBED = "ARTICLE_EMBED" EDITOR_STATE = "draftjsState" ENTITY_MAP = "entityMap" @@ -314,6 +315,9 @@ def __init__(self, content_editor): TABLE: self.render_table, MULTI_LINE_QUOTE: self.render_table, IMAGE: self.render_image, + + # TODO: needs to be fixed. I added this for now to simply avoid it from crashing. + ARTICLE_EMBED: lambda props: DOM.create_element("hr"), }, } ) From e2fb5c039fc160089b3a088154495bf919d3be2c Mon Sep 17 00:00:00 2001 From: Petr Jasek Date: Fri, 22 Dec 2023 12:44:53 +0100 Subject: [PATCH 2/2] fix black --- superdesk/editor_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/superdesk/editor_utils.py b/superdesk/editor_utils.py index ecf753223e..2c56ce8eac 100644 --- a/superdesk/editor_utils.py +++ b/superdesk/editor_utils.py @@ -315,7 +315,6 @@ def __init__(self, content_editor): TABLE: self.render_table, MULTI_LINE_QUOTE: self.render_table, IMAGE: self.render_image, - # TODO: needs to be fixed. I added this for now to simply avoid it from crashing. ARTICLE_EMBED: lambda props: DOM.create_element("hr"), },