diff --git a/webapp/components/ContributionForm.vue b/webapp/components/ContributionForm.vue index 3ef041569..a859fd0fb 100644 --- a/webapp/components/ContributionForm.vue +++ b/webapp/components/ContributionForm.vue @@ -16,6 +16,7 @@ /> @@ -125,6 +126,22 @@ export default { // this.form.content = value this.$refs.contributionForm.update('content', value) } + }, + apollo: { + User: { + query() { + return gql(`{ + User { + id + name + slug + } + }`) + }, + result(result) { + this.users = result.data.User + } + } } } diff --git a/webapp/components/Editor/Editor.vue b/webapp/components/Editor/Editor.vue index 2dc0fb899..7bf697363 100644 --- a/webapp/components/Editor/Editor.vue +++ b/webapp/components/Editor/Editor.vue @@ -197,6 +197,7 @@ export default { EditorMenuBubble }, props: { + users: { type: Array, default: () => [] }, value: { type: String, default: '' }, doc: { type: Object, default: () => {} } }, @@ -227,12 +228,9 @@ export default { }), new History(), new Mention({ - items: () => [ - { id: 1, name: 'Philipp Kühn' }, - { id: 2, name: 'Hans Pagel' }, - { id: 3, name: 'Kris Siepert' }, - { id: 4, name: 'Justin Schueler' } - ], + items: () => { + return this.users + }, onEnter: ({ items, query, range, command, virtualNode }) => { this.query = query this.filteredUsers = items