From 10d94b809c220f60827a933cfd90a4d31dfd6033 Mon Sep 17 00:00:00 2001 From: "l.mauser" Date: Mon, 13 Feb 2023 12:40:13 +0100 Subject: [PATCH 1/7] fix(richtext): add support for nested texts --- components/Elements/Link.vue | 15 ++++++++++----- components/Elements/RichTextElement.vue | 19 ++++++++++++------- components/Elements/Text.vue | 11 ----------- plugins/1.setupRemoteApi.server.ts | 2 +- 4 files changed, 23 insertions(+), 24 deletions(-) delete mode 100644 components/Elements/Text.vue diff --git a/components/Elements/Link.vue b/components/Elements/Link.vue index a4129e9..3bc4fe7 100644 --- a/components/Elements/Link.vue +++ b/components/Elements/Link.vue @@ -1,8 +1,10 @@ @@ -15,5 +17,8 @@ interface RichTextLink { data: Link; } -defineProps<{ richTextElement: RichTextLink }>(); +const props = defineProps<{ richTextElement: RichTextLink }>(); + +console.log("link "); +console.log(props.richTextElement); diff --git a/components/Elements/RichTextElement.vue b/components/Elements/RichTextElement.vue index 11f0791..1f9ef84 100644 --- a/components/Elements/RichTextElement.vue +++ b/components/Elements/RichTextElement.vue @@ -1,10 +1,15 @@ diff --git a/plugins/1.setupRemoteApi.server.ts b/plugins/1.setupRemoteApi.server.ts index b9c1398..86c4316 100644 --- a/plugins/1.setupRemoteApi.server.ts +++ b/plugins/1.setupRemoteApi.server.ts @@ -32,7 +32,7 @@ export default defineNuxtPlugin(() => { appConfig.logLevel || LogLevel.NONE, enableEventStream: - runtimeConfig.private["enableEventStream"] || + !!runtimeConfig.private["enableEventStream"] || appConfig.enableEventStream || false, }; From 050afa4fe971acdccb18d3c87406c0efc6c73702 Mon Sep 17 00:00:00 2001 From: "l.mauser" Date: Mon, 13 Feb 2023 16:15:53 +0100 Subject: [PATCH 2/7] fix(link): internal and external links in richtext --- components/Elements/Link.vue | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/components/Elements/Link.vue b/components/Elements/Link.vue index 3bc4fe7..009cda5 100644 --- a/components/Elements/Link.vue +++ b/components/Elements/Link.vue @@ -1,16 +1,28 @@ From 30a61ff5a651f82a77979c6301665102d732b011 Mon Sep 17 00:00:00 2001 From: "l.mauser" Date: Mon, 13 Feb 2023 16:29:48 +0100 Subject: [PATCH 3/7] fix(richtextelement): add styling capabilities --- components/Elements/Link.vue | 2 +- components/Elements/RichTextElement.vue | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/components/Elements/Link.vue b/components/Elements/Link.vue index 009cda5..85b93bf 100644 --- a/components/Elements/Link.vue +++ b/components/Elements/Link.vue @@ -1,5 +1,5 @@ @@ -73,7 +92,6 @@ Clicking on it will show you further information about the missing component. image:RichText/RichTextInfoWindow.png[RichText Info Window] -And finally, clicking the content tab in the info window will reveal all of the data that will be passed into your component. [source,json] ---- From ff73ccd89eab84c8ef07369e6905c4684d8cd765 Mon Sep 17 00:00:00 2001 From: Lukas Mauser Date: Tue, 14 Feb 2023 09:28:34 +0100 Subject: [PATCH 7/7] Update components/Elements/Link.vue Co-authored-by: Jonas Scholz --- components/Elements/Link.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/Elements/Link.vue b/components/Elements/Link.vue index 85b93bf..805a139 100644 --- a/components/Elements/Link.vue +++ b/components/Elements/Link.vue @@ -35,8 +35,9 @@ const internalLinkRoute = computed(() => { const referenceId: string = props.richTextElement.data.data["lt_link"]?.referenceId; if (!referenceId) return ""; + const target = navigationData.value?.idMap[referenceId]; - if (target) return target.seoRoute; - return ""; + + return target?.seoRoute ?? ""; });