Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/components/NcRichContenteditable/NcAutoCompleteResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
:status="status.status" />
</div>

<!-- Title and subline -->
<!-- Label and subline -->
<span class="autocomplete-result__content">
<span class="autocomplete-result__title" :title="title">
{{ title }}
<span class="autocomplete-result__title" :title="labelWithFallback">
{{ labelWithFallback }}
</span>
<span v-if="subline" class="autocomplete-result__subline">
{{ subline }}
Expand All @@ -59,9 +59,18 @@ export default {
},

props: {
/**
* @deprecated Use `label` instead
*/
title: {
type: String,
required: true,
required: false,
default: null,
},
label: {
type: String,
required: false,
default: null,
},
subline: {
type: String,
Expand Down Expand Up @@ -98,6 +107,10 @@ export default {
? this.getAvatarUrl(this.id, 44)
: null
},
// For backwards compatibility
labelWithFallback() {
return this.label || this.title
},
},

methods: {
Expand Down
17 changes: 15 additions & 2 deletions src/components/NcRichContenteditable/NcMentionBubble.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class="mention-bubble__icon" />

<!-- Title -->
<span role="heading" class="mention-bubble__title" :title="title" />
<span role="heading" class="mention-bubble__title" :title="labelWithFallback" />
</span>

<!-- Selectable text for copy/paste -->
Expand All @@ -51,9 +51,18 @@ export default {
type: String,
required: true,
},
/**
* @deprecated Use `label` instead
*/
title: {
type: String,
required: true,
required: false,
default: null,
},
label: {
type: String,
required: false,
default: null,
},
icon: {
type: String,
Expand Down Expand Up @@ -87,6 +96,10 @@ export default {
? `@${this.id}`
: `@"${this.id}"`
},
// Fallback to title for compatibility
labelWithFallback() {
return this.label || this.title
},
},

methods: {
Expand Down
14 changes: 7 additions & 7 deletions src/components/NcRichContenteditable/NcRichContenteditable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ export default {
Test01: {
icon: 'icon-user',
id: 'Test01',
title: 'Test01',
label: 'Test01',
source: 'users',
primary: true,
},
Test02: {
icon: 'icon-user',
id: 'Test02',
title: 'Test02',
label: 'Test02',
source: 'users',
status: {
clearAt: null,
Expand All @@ -90,7 +90,7 @@ export default {
'Test@User': {
icon: 'icon-user',
id: 'Test@User',
title: 'Test 03',
label: 'Test 03',
source: 'users',
status: {
clearAt: null,
Expand All @@ -103,7 +103,7 @@ export default {
'Test Offline': {
icon: 'icon-user',
id: 'Test Offline',
title: 'Test Offline',
label: 'Test Offline',
source: 'users',
status: {
clearAt: null,
Expand All @@ -116,7 +116,7 @@ export default {
'Test DND': {
icon: 'icon-user',
id: 'Test DND',
title: 'Test DND',
label: 'Test DND',
source: 'users',
status: {
clearAt: null,
Expand Down Expand Up @@ -560,8 +560,8 @@ export default {
// Allow spaces in the middle of mentions
allowSpaces: true,
fillAttr: 'id',
// Search against id and title (display name)
lookup: result => `${result.id} ${result.title}`,
// Search against id and label (display name) (fallback to title for v8.0.0..8.6.1 compatibility)
lookup: result => `${result.id} ${result.label ?? result.title}`,
// Where to inject the menu popup
menuContainer: this.menuContainer,
// Popup mention autocompletion templates
Expand Down
10 changes: 5 additions & 5 deletions src/components/NcRichText/NcRichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ See [NcRichContenteditable](#/Components/NcRichContenteditable) documentation fo
Test01: {
icon: 'icon-user',
id: 'Test01',
title: 'Test01',
label: 'Test01',
source: 'users',
primary: true,
},
Test02: {
icon: 'icon-user',
id: 'Test02',
title: 'Test02',
label: 'Test02',
source: 'users',
status: {
clearAt: null,
Expand All @@ -188,7 +188,7 @@ See [NcRichContenteditable](#/Components/NcRichContenteditable) documentation fo
'Test@User': {
icon: 'icon-user',
id: 'Test@User',
title: 'Test 03',
label: 'Test 03',
source: 'users',
status: {
clearAt: null,
Expand All @@ -201,7 +201,7 @@ See [NcRichContenteditable](#/Components/NcRichContenteditable) documentation fo
'Test Offline': {
icon: 'icon-user',
id: 'Test Offline',
title: 'Test Offline',
label: 'Test Offline',
source: 'users',
status: {
clearAt: null,
Expand All @@ -214,7 +214,7 @@ See [NcRichContenteditable](#/Components/NcRichContenteditable) documentation fo
'Test DND': {
icon: 'icon-user',
id: 'Test DND',
title: 'Test DND',
label: 'Test DND',
source: 'users',
status: {
clearAt: null,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/mixins/richEditor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('richEditor.js', () => {
userData: {
jdoe: {
id: 'jdoe',
title: 'J. Doe',
label: 'J. Doe',
source: 'users',
icon: 'icon-user',
},
Expand Down