From cd4c1ef27ed7f98774444267122d27def1d3b6cf Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Wed, 5 Oct 2022 14:18:16 -0700 Subject: [PATCH] feat: Update the design of mentions with thumbnail (#5551) --- .../components/widgets/WootWriter/Editor.vue | 7 +- .../widgets/conversation/TagAgents.vue | 161 +++++++++++++++--- .../widgets/mentions/MentionBox.vue | 45 +---- .../mentions/mentionSelectionKeyboardMixin.js | 39 +++++ .../mentionSelectionKeyboardMixin.spec.js | 64 +++++++ 5 files changed, 251 insertions(+), 65 deletions(-) create mode 100644 app/javascript/dashboard/components/widgets/mentions/mentionSelectionKeyboardMixin.js create mode 100644 app/javascript/dashboard/components/widgets/mentions/specs/mentionSelectionKeyboardMixin.spec.js diff --git a/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue b/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue index 92023444c..ee3337cf9 100644 --- a/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue +++ b/app/javascript/dashboard/components/widgets/WootWriter/Editor.vue @@ -6,7 +6,7 @@ @click="insertMentionNode" /> @@ -223,8 +223,8 @@ export default { return null; } const node = this.editorView.state.schema.nodes.mention.create({ - userId: mentionItem.key, - userFullName: mentionItem.label, + userId: mentionItem.id, + userFullName: mentionItem.name, }); const tr = this.editorView.state.tr.replaceWith( @@ -256,6 +256,7 @@ export default { this.plugins ); this.editorView.updateState(this.state); + this.focusEditorInputField(); return false; }, diff --git a/app/javascript/dashboard/components/widgets/conversation/TagAgents.vue b/app/javascript/dashboard/components/widgets/conversation/TagAgents.vue index 73002eb5c..8cfe1033b 100644 --- a/app/javascript/dashboard/components/widgets/conversation/TagAgents.vue +++ b/app/javascript/dashboard/components/widgets/conversation/TagAgents.vue @@ -1,49 +1,160 @@ + + diff --git a/app/javascript/dashboard/components/widgets/mentions/MentionBox.vue b/app/javascript/dashboard/components/widgets/mentions/MentionBox.vue index e5963d0ee..4613d8357 100644 --- a/app/javascript/dashboard/components/widgets/mentions/MentionBox.vue +++ b/app/javascript/dashboard/components/widgets/mentions/MentionBox.vue @@ -20,7 +20,9 @@