Skip to content

Commit bd09be8

Browse files
fix(bulk-import): automatically select templates for bulkImport.importTemplate configuration (#1588)
1 parent 316e356 commit bd09be8

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@red-hat-developer-hub/backstage-plugin-bulk-import-backend': patch
3+
---
4+
5+
Automatically select templates from default namespace for bulkImport.importTemplate configuration.

workspaces/bulk-import/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"lint": "backstage-cli repo lint --since origin/main",
2121
"lint:all": "backstage-cli repo lint",
2222
"prettier:check": "prettier --check .",
23+
"prettier:fix": "prettier --write .",
2324
"new": "backstage-cli new --scope @red-hat-developer-hub",
2425
"postinstall": "cd ../../ && yarn install"
2526
},

workspaces/bulk-import/plugins/bulk-import-backend/src/helpers/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ export function parseGitURLForApprovalTool(repoUrl: string) {
6969

7070
export function getImportTemplateRef(templateRef: string): string {
7171
try {
72-
const { name, namespace, kind } = parseEntityRef(templateRef);
72+
const { name, namespace, kind } = parseEntityRef(templateRef, {
73+
defaultKind: 'template',
74+
defaultNamespace: 'default',
75+
});
7376

7477
if (kind !== 'template') {
7578
throw new InputError(

0 commit comments

Comments
 (0)