Skip to content

Commit 262894f

Browse files
Fix deprecated title usage in NcAppNavigationItem
Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
1 parent e0fb518 commit 262894f

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

src/components/NcAppNavigationItem/NcAppNavigationItem.vue

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Just set the `pinned` prop.
224224
:aria-expanded="opened.toString()"
225225
:href="href || '#'"
226226
:target="isExternal(href) ? '_blank' : ''"
227-
:title="title || nameTitleFallback"
227+
:title="title || name"
228228
@blur="handleBlur"
229229
@click="onClick"
230230
@focus="handleFocus"
@@ -238,12 +238,12 @@ Just set the `pinned` prop.
238238
<slot v-else-if="isIconShown" name="icon" />
239239
</div>
240240
<span v-if="!editingActive" class="app-navigation-entry__title">
241-
{{ nameTitleFallback }}
241+
{{ name }}
242242
</span>
243243
<div v-if="editingActive" class="editingContainer">
244244
<NcInputConfirmCancel ref="editingInput"
245245
v-model="editingValue"
246-
:placeholder="editPlaceholder !== '' ? editPlaceholder : nameTitleFallback"
246+
:placeholder="editPlaceholder !== '' ? editPlaceholder : name"
247247
@cancel="cancelEditing"
248248
@confirm="handleEditingDone" />
249249
</div>
@@ -253,7 +253,7 @@ Just set the `pinned` prop.
253253
<!-- undo entry -->
254254
<div v-if="undo" class="app-navigation-entry__deleted">
255255
<div class="app-navigation-entry__deleted-description">
256-
{{ nameTitleFallback }}
256+
{{ name }}
257257
</div>
258258
</div>
259259

@@ -344,20 +344,14 @@ export default {
344344
props: {
345345
/**
346346
* The main text content of the entry.
347-
* Previously called `title`, now deprecated
348347
*/
349348
name: {
350349
type: String,
351-
// TODO: Make it required in the next major release (see title prop)
352-
default: '',
350+
required: true,
353351
},
354352
355353
/**
356354
* The title attribute of the element.
357-
*
358-
* ⚠ Using this prop as the main content text is DEPRECATED
359-
* Please use `name` instead. If you were planning to define the
360-
* html element title attribute, this is the proper way.
361355
*/
362356
title: {
363357
type: String,
@@ -550,17 +544,6 @@ export default {
550544
},
551545
552546
computed: {
553-
/**
554-
* TODO: drop on the 8.0.0 major, see title/name prop
555-
*/
556-
nameTitleFallback() {
557-
if (!this.name) {
558-
console.warn('The `name` prop is required. Please migrate away from the deprecated `title` prop.')
559-
return this.title
560-
}
561-
return this.name
562-
},
563-
564547
collapsible() {
565548
return this.allowCollapse && !!this.$slots.default
566549
},
@@ -656,7 +639,7 @@ export default {
656639
657640
// Edition methods
658641
handleEdit() {
659-
this.editingValue = this.nameTitleFallback
642+
this.editingValue = this.name
660643
this.editingActive = true
661644
this.onMenuToggle(false)
662645
this.$nextTick(() => {
@@ -667,8 +650,6 @@ export default {
667650
this.editingActive = false
668651
},
669652
handleEditingDone() {
670-
// @deprecated, please use `name` instead
671-
this.$emit('update:title', this.editingValue)
672653
this.$emit('update:name', this.editingValue)
673654
this.editingValue = ''
674655
this.editingActive = false

0 commit comments

Comments
 (0)