Update storePath error and description

Co-authored-by: blam<ben@blam.sh>
This commit is contained in:
Johan Haals
2021-01-15 16:07:29 +01:00
parent 548dbf154e
commit 8ef84c67a3
@@ -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',
);
}