From 134e0a7926ac9efe24de042d82e297f718a2229d Mon Sep 17 00:00:00 2001 From: Sergei Ogorelkov Date: Fri, 6 May 2022 15:00:45 +0700 Subject: [PATCH] Don't allow saving an issue with empty title (#1679) (#1681) Signed-off-by: Sergei Ogorelkov --- .../src/components/CreateIssue.svelte | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/tracker-resources/src/components/CreateIssue.svelte b/plugins/tracker-resources/src/components/CreateIssue.svelte index 1e35cfee02..466d550360 100644 --- a/plugins/tracker-resources/src/components/CreateIssue.svelte +++ b/plugins/tracker-resources/src/components/CreateIssue.svelte @@ -73,6 +73,7 @@ sort: { rank: SortingOrder.Ascending } } ) + $: canSave = !!(space && object.status && getTitle()) async function updateIssueStatusId (teamId: Ref, issueStatusId?: Ref) { if (issueStatusId !== undefined) { @@ -92,6 +93,10 @@ } } + function getTitle () { + return object.title.trim() + } + export function canClose (): boolean { // if (object.title !== undefined) { // showPopup( @@ -107,11 +112,11 @@ // } // ) // } - return object.title === '' + return canSave } async function createIssue () { - if (!object.status) { + if (!canSave) { return } @@ -131,7 +136,7 @@ ) const value: Data = { - title: object.title, + title: getTitle(), description: object.description, assignee: currentAssignee, number: (incResult as any).object.sequence, @@ -166,11 +171,10 @@ } -