Skip to content

Commit

Permalink
Show "no templates found" (#2879)
Browse files Browse the repository at this point in the history
  • Loading branch information
ejizba authored Jul 13, 2021
1 parent f52388a commit 129f2da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/commands/createFunction/FunctionListStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,15 @@ export class FunctionListStep extends AzureWizardPromptStep<IFunctionWizardConte
});
}

if (language === ProjectLanguage.CSharp || language === ProjectLanguage.Java || language === ProjectLanguage.Python || language === ProjectLanguage.TypeScript) {
if (templates.length === 0) {
picks.push({
label: localize('noTemplates', '$(warning) No templates found'),
suppressPersistence: true,
data: <IFunctionTemplate | TemplatePromptResult><unknown>undefined,
onPicked: () => { /* do nothing */ }
})
} else if (language === ProjectLanguage.CSharp || language === ProjectLanguage.Java || language === ProjectLanguage.Python || language === ProjectLanguage.TypeScript) {
// NOTE: Only show this if we actually found other templates
picks.push({
label: localize('openAPI', 'HTTP trigger(s) from OpenAPI V2/V3 Specification (Preview)'),
data: 'openAPI',
Expand Down

0 comments on commit 129f2da

Please sign in to comment.