From f34b5083331098835715743810a87b95bc41856a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 5 Oct 2020 08:33:10 +0200 Subject: [PATCH] Allow spaces in the name of a AppSidebarTab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/AppSidebar/AppSidebarTabs.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/AppSidebar/AppSidebarTabs.vue b/src/components/AppSidebar/AppSidebarTabs.vue index 785fa5f59c..29ed5a0462 100644 --- a/src/components/AppSidebar/AppSidebarTabs.vue +++ b/src/components/AppSidebar/AppSidebarTabs.vue @@ -63,6 +63,10 @@ import Vue from 'vue' const IsValidString = function(value) { + return value && typeof value === 'string' && value.trim() !== '' +} + +const IsValidStringWithoutSpaces = function(value) { return value && typeof value === 'string' && value.trim() !== '' && value.indexOf(' ') === -1 } @@ -227,8 +231,8 @@ export default { const tab = tabNode.componentInstance // Make sure all required props are provided and valid if (IsValidString(tab?.name) - && IsValidString(tab?.id) - && IsValidString(tab?.icon)) { + && IsValidStringWithoutSpaces(tab?.id) + && IsValidStringWithoutSpaces(tab?.icon)) { tabs.push(tab) } else { invalidTabs.push(tabNode)