Skip to content

Commit

Permalink
Merge pull request #2878 from nextcloud/bug/use-primary-attr-for-curr…
Browse files Browse the repository at this point in the history
…ent-user-mention

fix: add primary attribute for current user
  • Loading branch information
mejo- authored Sep 13, 2022
2 parents 9a45c93 + 7f883b1 commit 6b7ea64
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 23 deletions.
4 changes: 2 additions & 2 deletions js/editor-rich.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor-rich.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/files-modal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/files-modal.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ export default {
return true
},

/** @param {Event} event */
/** @param {Event} event The passed event */
preparePrinting(event) {
const content = document.getElementById('content')
// Hide Content behind modal, this also hides the sidebar if open
Expand Down
11 changes: 10 additions & 1 deletion src/extensions/Mention.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<NodeViewWrapper as="span" class="mention" contenteditable="false">
<NcUserBubble :user="node.attrs.id" :display-name="username" class="mention-user-bubble">
<NcUserBubble :user="node.attrs.id"
:display-name="username"
:primary="isCurrentUser"
class="mention-user-bubble">
@{{ username }}
</NcUserBubble>
</NodeViewWrapper>
Expand All @@ -9,6 +12,7 @@
<script>
import NcUserBubble from '@nextcloud/vue/dist/Components/NcUserBubble.js'
import { NodeViewWrapper } from '@tiptap/vue-2'
import { getCurrentUser } from '@nextcloud/auth'
export default {
name: 'Mention',
Expand All @@ -32,6 +36,11 @@ export default {
username: this.node.attrs.label,
}
},
computed: {
isCurrentUser() {
return this.node.attrs.id === getCurrentUser().uid
},
},
}
</script>
<style scoped>
Expand Down

0 comments on commit 6b7ea64

Please sign in to comment.