From 4e780f52dc35f731a2d688c2bd7835129d8f9244 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 17 Jun 2019 18:44:17 +0200 Subject: [PATCH] Copy and refactoring Mentions to Tags, Started --- webapp/components/ContributionForm/index.vue | 35 ++++- webapp/components/Editor/index.vue | 138 +++++++++++++++---- webapp/components/Editor/nodes/Mention.js | 6 +- webapp/components/Editor/nodes/Tag.js | 39 ++++++ 4 files changed, 185 insertions(+), 33 deletions(-) create mode 100644 webapp/components/Editor/nodes/Tag.js diff --git a/webapp/components/ContributionForm/index.vue b/webapp/components/ContributionForm/index.vue index 62c3650c8..3126fdc46 100644 --- a/webapp/components/ContributionForm/index.vue +++ b/webapp/components/ContributionForm/index.vue @@ -4,7 +4,12 @@ - + @@ -75,6 +80,7 @@ export default { disabled: false, slug: null, users: [], + tags: [], } }, watch: { @@ -148,17 +154,34 @@ export default { apollo: { User: { query() { - return gql(`{ - User(orderBy: slug_asc) { - id - slug + return gql` + { + User(orderBy: slug_asc) { + id + slug + } } - }`) + ` }, result(result) { this.users = result.data.User }, }, + Tag: { + query() { + return gql` + { + Tag(orderBy: name_asc) { + id + name + } + } + ` + }, + result(result) { + this.tags = result.data.Tag + }, + }, }, } diff --git a/webapp/components/Editor/index.vue b/webapp/components/Editor/index.vue index 0690b15bd..6307ff5ee 100644 --- a/webapp/components/Editor/index.vue +++ b/webapp/components/Editor/index.vue @@ -1,20 +1,30 @@