Skip to content

Commit 1f817ce

Browse files
committed
fix(PagePicker): pass title from smart picker to text
Requires: nextcloud-libraries/nextcloud-vue#8532 Requires: nextloud/text#8615 Fixes: #1583 Signed-off-by: Jonas <jonas@freesources.org>
1 parent ca40b04 commit 1f817ce

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/composables/useEditor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import type { TextEditorInstance } from '../types.ts'
99
import { t } from '@nextcloud/l10n'
1010
import debounce from 'debounce'
1111
import { computed, defineCustomElement, markRaw, nextTick, onBeforeUnmount, ref, watch } from 'vue'
12-
import { getLinkWithPicker } from '@nextcloud/vue/components/NcRichText'
12+
import { getReferenceWithPicker } from '@nextcloud/vue/components/NcRichText'
1313
import PageIcon from '../components/Icon/PageIcon.vue'
1414
import { useCirclesStore } from '../stores/circles.js'
1515
import { useCollectivesStore } from '../stores/collectives.js'
@@ -107,7 +107,7 @@ export function useEditor(davContent: Ref<string>) {
107107
label: t('collectives', 'Link to page'),
108108
icon: 'page-icon',
109109
action: () => {
110-
return getLinkWithPicker('collectives-ref-pages', false)
110+
return getReferenceWithPicker('collectives-ref-pages', false)
111111
},
112112
},
113113
openLinkHandler: window.OCA.Collectives.openLink,

src/views/PagePicker.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,13 @@ export default defineComponent({
215215
+ generateUrl('/apps/collectives')
216216
+ collectivePath
217217
+ '/' + pagePath
218+
const detail = {
219+
link: pageLink,
220+
title: page.title,
221+
}
218222
this.$el.dispatchEvent(new CustomEvent('submit', {
219223
bubbles: true,
220-
detail: pageLink,
224+
detail,
221225
}))
222226
} else {
223227
console.error('Cannot generate page link')

0 commit comments

Comments
 (0)