From daa2ed3b1c86396791367c9adbe06dd64a81cf1e Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 21 Oct 2023 19:33:32 +0200 Subject: [PATCH] feat(editor): allow passing placeholder down --- src/components/input/editor/TipTap.vue | 6 ++++++ src/i18n/lang/en.json | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/input/editor/TipTap.vue b/src/components/input/editor/TipTap.vue index d92942636..f82333fea 100644 --- a/src/components/input/editor/TipTap.vue +++ b/src/components/input/editor/TipTap.vue @@ -175,12 +175,14 @@ const { isEditEnabled = true, bottomActions = [], showSave = false, + placeholder = '', } = defineProps<{ modelValue: string, uploadCallback?: UploadCallback, isEditEnabled?: boolean, bottomActions?: BottomAction[], showSave?: boolean, + placeholder?: string, }>() const emit = defineEmits(['update:modelValue', 'save']) @@ -269,6 +271,10 @@ const editor = useEditor({ if (!isEditEnabled) { return '' } + + if (placeholder !== '') { + return placeholder + } return t('input.editor.placeholder') }, diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 91c4cf829..625ce4aa7 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -258,7 +258,7 @@ "identifier": "Project Identifier", "identifierPlaceholder": "The project identifier goes here…", "description": "Description", - "descriptionPlaceholder": "The projects description goes here…", + "descriptionPlaceholder": "Enter a description for this project, hit '/' for more options…", "color": "Color", "success": "The project was successfully updated." }, @@ -383,7 +383,7 @@ "title": "Title", "titlePlaceholder": "The saved filter title goes here…", "description": "Description", - "descriptionPlaceholder": "The description goes here…", + "descriptionPlaceholder": "Add a description for this filter here, hit '/' for more options…", "includeNulls": "Include Tasks which don't have a value set", "requireAll": "Require all filters to be true for a task to show up", "showDoneTasks": "Show Done Tasks", @@ -744,7 +744,7 @@ "loading": "Loading comments…", "edited": "edited {date}", "creating": "Creating comment…", - "placeholder": "Add your comment…", + "placeholder": "Add your comment, hit '/' for more options…", "comment": "Comment", "delete": "Delete this comment", "deleteText1": "Are you sure you want to delete this comment?", @@ -758,7 +758,7 @@ "1week": "1 week" }, "description": { - "placeholder": "Click here to enter a description…", + "placeholder": "Enter a description, hit '/' for more options…", "empty": "No description available yet." }, "assignee": { @@ -909,7 +909,7 @@ "namePlaceholder": "The team's name goes here…", "nameRequired": "Please specify a name.", "description": "Description", - "descriptionPlaceholder": "The teams description goes here…", + "descriptionPlaceholder": "Describe the team here, hit '/' for more options…", "admin": "Admin", "member": "Member" }