Skip to content

Commit 6f02177

Browse files
author
Vandita Patidar
committed
quickPick changes
1 parent d226d31 commit 6f02177

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

packages/core/src/awsService/appBuilder/serverlessLand/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ExtContext } from '../../../shared/extensions'
1616
import { addFolderToWorkspace } from '../../../shared/utilities/workspaceUtils'
1717
import { ToolkitError } from '../../../shared/errors'
1818
import { fs } from '../../../shared/fs/fs'
19+
import { sleep } from '../../../shared/utilities/timeoutUtils'
1920
import { getPattern } from '../../../shared/utilities/downloadPatterns'
2021
import { MetadataManager } from './metadataManager'
2122

@@ -115,8 +116,6 @@ async function openReadmeFile(config: CreateServerlessLandWizardForm): Promise<v
115116
getLogger().warn('README.md file not found in the project directory')
116117
return
117118
}
118-
await new Promise((resolve) => setTimeout(resolve, 2000))
119-
120119
await vscode.commands.executeCommand('workbench.action.focusFirstEditorGroup')
121120
await vscode.commands.executeCommand('markdown.showPreview', readmeUri)
122121
} catch (err) {

packages/core/src/awsService/appBuilder/serverlessLand/wizard.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function promptRuntime(metadataManager: MetadataManager, pattern: string | undef
7171
{
7272
title: localize('AWS.serverlessLand.initWizard.runtime.prompt', 'Select Runtime'),
7373
placeholder: 'Choose a runtime for your project',
74-
buttons: [vscode.QuickInputButtons.Back],
74+
buttons: createCommonButtons(),
7575
}
7676
)
7777
}
@@ -94,24 +94,30 @@ function promptIac(metadataManager: MetadataManager, pattern: string | undefined
9494
{
9595
title: localize('AWS.serverlessLand.initWizard.iac.prompt', 'Select IaC'),
9696
placeholder: 'Choose an IaC option for your project',
97-
buttons: [vscode.QuickInputButtons.Back],
97+
buttons: createCommonButtons(),
9898
}
9999
)
100100
}
101101

102102
function promptLocation() {
103103
return createFolderPrompt(vscode.workspace.workspaceFolders ?? [], {
104104
title: localize('AWS.serverlessLand.initWizard.location.prompt', 'Select Project Location'),
105-
buttons: [vscode.QuickInputButtons.Back],
106-
browseFolderDetail: 'Select a folder for your project',
105+
buttons: createCommonButtons(),
106+
browseFolderDetail: 'Select a parent folder for your project',
107107
})
108108
}
109109

110-
function promptName() {
110+
function promptName(location: vscode.Uri | undefined) {
111+
let folderName: string
112+
if (location) {
113+
folderName = path.basename(location.fsPath)
114+
} else {
115+
folderName = ''
116+
}
111117
return createInputBox({
112118
title: localize('AWS.serverlessLand.initWizard.name.prompt', 'Enter Project Name'),
113-
placeholder: 'Enter a name for your new application',
114-
buttons: [vscode.QuickInputButtons.Back],
119+
placeholder: ` ${folderName}/: Enter a name for your new application`,
120+
buttons: createCommonButtons(),
115121
validateInput: (value: string): string | undefined => {
116122
if (!value) {
117123
return 'Application name cannot be empty'
@@ -140,6 +146,6 @@ export class CreateServerlessLandWizard extends Wizard<CreateServerlessLandWizar
140146
this.form.runtime.bindPrompter((state) => promptRuntime(this.metadataManager, state.pattern))
141147
this.form.iac.bindPrompter((state) => promptIac(this.metadataManager, state.pattern))
142148
this.form.location.bindPrompter(() => promptLocation())
143-
this.form.name.bindPrompter(() => promptName())
149+
this.form.name.bindPrompter((state) => promptName(state.location))
144150
}
145151
}

0 commit comments

Comments
 (0)