diff --git a/src/features/contentCreator/createDevfilePage.ts b/src/features/contentCreator/createDevfilePage.ts index ec9b6d681..074f29c02 100644 --- a/src/features/contentCreator/createDevfilePage.ts +++ b/src/features/contentCreator/createDevfilePage.ts @@ -88,6 +88,12 @@ export class CreateDevfile { const nonce = getNonce(); const workspaceDir = this.getWorkspaceFolder(); + let projectName = ""; + + if (workspaceDir !== "") { + const projectNameSplit = workspaceDir.split("/"); + projectName = projectNameSplit[projectNameSplit.length - 1]; + } const webviewUri = getUri(webview, extensionUri, [ "out", @@ -132,7 +138,7 @@ export class CreateDevfile {
- Ansible project name * + Ansible project name *
diff --git a/src/webview/apps/contentCreator/createDevfilePageApp.ts b/src/webview/apps/contentCreator/createDevfilePageApp.ts index 9dbcc2b4c..5d960df70 100644 --- a/src/webview/apps/contentCreator/createDevfilePageApp.ts +++ b/src/webview/apps/contentCreator/createDevfilePageApp.ts @@ -95,6 +95,8 @@ function main() { destinationPathUrlTextField.value = destinationPathUrlTextField.placeholder; + devfileNameTextField.value = devfileNameTextField.placeholder; + devfilePathDiv?.appendChild(devfilePathElement); }