From 8ef84c67a316e451ffa4f45c4f1dd0e5cae5d28c Mon Sep 17 00:00:00 2001 From: Johan Haals Date: Fri, 15 Jan 2021 16:07:29 +0100 Subject: [PATCH] Update storePath error and description Co-authored-by: blam --- .../src/components/TemplatePage/TemplatePage.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx index 4fc2e98bb0..856ff3d0e2 100644 --- a/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx +++ b/plugins/scaffolder/src/components/TemplatePage/TemplatePage.tsx @@ -67,7 +67,8 @@ const OWNER_REPO_SCHEMA = { format: 'storeLocation', type: 'string' as const, title: 'Store path', - description: 'GitHub store path in org/repo format', + description: + 'A full URL to the repository that should be created. e.g https://github.com/backstage/new-repo', }, access: { type: 'string' as const, @@ -188,9 +189,13 @@ export const TemplatePage = () => { const { storePath } = formData; const parsedUrl = gitParse(storePath); - if (!parsedUrl.resource) { + if ( + !parsedUrl.resource || + !parsedUrl.owner || + !parsedUrl.name + ) { errors.storePath.addError( - 'There needs to be a hostname in the store path', + 'The store path should be a complete Git URL to the new repository location. For example https://github.com/backstage/new-repo', ); }