Merge pull request #8366 from backstage/natasha/fix-scaffolder-owner-bug
Fix scaffolder repo owner bug
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder': patch
|
||||
---
|
||||
|
||||
Fix bug with setting owner in RepoUrlPicker causing validation failure
|
||||
@@ -27,7 +27,7 @@ import FormHelperText from '@material-ui/core/FormHelperText';
|
||||
import { useApi } from '@backstage/core-plugin-api';
|
||||
import { Progress } from '@backstage/core-components';
|
||||
|
||||
function splitFormData(url: string | undefined, allowedOwners: string[]) {
|
||||
function splitFormData(url: string | undefined, allowedOwners?: string[]) {
|
||||
let host = undefined;
|
||||
let owner = undefined;
|
||||
let repo = undefined;
|
||||
@@ -39,10 +39,7 @@ function splitFormData(url: string | undefined, allowedOwners: string[]) {
|
||||
if (url) {
|
||||
const parsed = new URL(`https://${url}`);
|
||||
host = parsed.host;
|
||||
owner =
|
||||
parsed.searchParams.get('owner') || allowedOwners
|
||||
? allowedOwners[0]
|
||||
: undefined;
|
||||
owner = parsed.searchParams.get('owner') || allowedOwners?.[0];
|
||||
repo = parsed.searchParams.get('repo') || undefined;
|
||||
// This is azure dev ops specific. not used for any other provider.
|
||||
organization = parsed.searchParams.get('organization') || undefined;
|
||||
|
||||
Reference in New Issue
Block a user