Merge pull request #5862 from nextcloud/fix/editor/untitle-event-placeholder

fix(editor): show placeholder if an event's title is empty
This commit is contained in:
Richard Steinmetz 2024-03-20 11:01:41 +01:00 committed by GitHub
commit b745387f97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 1 deletions

View File

@ -103,7 +103,7 @@
:is-read-only="isReadOnlyOrViewing || !canModifyCalendar"
@update:value="changeCalendar" />
<PropertyTitle :value="title"
<PropertyTitle :value="titleOrPlaceholder"
:is-read-only="isReadOnlyOrViewing"
@update:value="updateTitle" />
@ -262,6 +262,19 @@ export default {
isReadOnlyOrViewing() {
return this.isReadOnly || this.isViewing || this.isWidget
},
/**
* Return the event's title or a placeholder if it is empty
*
* @return {string}
*/
titleOrPlaceholder() {
if (this.title === '' && this.isReadOnlyOrViewing && !this.isLoading) {
return t('calendar', 'Untitled event')
}
return this.title
}
},
watch: {
$route(to, from) {