Skip to content

Commit

Permalink
perf: select sub when no subs show (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenytang-ms authored Feb 17, 2025
1 parent dc47391 commit 45c829b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const APIMAccountCommandId = {
accountSigningIn: "azureApiManagementAccountSigningIn",
accountSelectTenant: "azureApiManagementAccountSelectTenant",
accountError: "azureApiManagementAccountError",
accountSubscription: "azureApiManagementAccountSubscription",
}

export const AzureAccountUrl = {
Expand Down
7 changes: 4 additions & 3 deletions src/explorer/AzureAccountTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,11 @@ export class AzureAccountTreeItem extends AzExtParentTreeItem {
if (subscriptions.result.length === 0) {
return [
new GenericTreeItem(this, {
label: UiStrings.NoSubscriptionsFound,
label: UiStrings.SelectSubscriptionInPanel,
commandId: "azureApiManagement.selectSubscriptions",
contextValue: "azureCommand",
id: APIMAccountCommandId.accountError,
iconPath: new vscode.ThemeIcon("info"),
id: APIMAccountCommandId.accountSubscription,
includeInTreeItemPicker: true,
}),
];
}
Expand Down
1 change: 1 addition & 0 deletions src/uiStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export class UiStrings {
static readonly NoTenantFound = vscode.l10n.t("No tenants found.");
static readonly NoAzureSessionFound = vscode.l10n.t("No Azure session found.");
static readonly FailedTo = vscode.l10n.t("Failed to retrieve Azure session: {0}");
static readonly SelectSubscriptionInPanel = vscode.l10n.t("Select Subscriptions...");
}

0 comments on commit 45c829b

Please sign in to comment.