Skip to content

Commit

Permalink
Changes to azure package
Browse files Browse the repository at this point in the history
  • Loading branch information
MRayermannMSFT committed Jan 23, 2024
1 parent a2b1d00 commit a816a46
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 40 deletions.
143 changes: 108 additions & 35 deletions azure/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion azure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@azure/core-client": "^1.6.0",
"@azure/core-rest-pipeline": "^1.9.0",
"@azure/logger": "^1.0.4",
"@microsoft/vscode-azext-utils": "^2.0.0",
"@microsoft/vscode-azext-utils": "2.2.0-agent.1",
"semver": "^7.3.7",
"uuid": "^9.0.0"
},
Expand Down
18 changes: 14 additions & 4 deletions azure/src/wizard/LocationListStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import type { ExtendedLocation, Provider } from '@azure/arm-resources';
import type { Location } from '@azure/arm-resources-subscriptions';
import { AzureWizardPromptStep, IActionContext, IAzureQuickPickItem, IAzureQuickPickOptions, nonNullProp, nonNullValue } from '@microsoft/vscode-azext-utils';
import { AgentQuickPickItem, AgentQuickPickOptions, AzureWizardPromptStep, IActionContext, IAzureQuickPickOptions, nonNullProp, nonNullValue } from '@microsoft/vscode-azext-utils';
import * as vscode from 'vscode';
import * as types from '../../index';
import { createResourcesClient, createSubscriptionsClient } from '../clients';
Expand Down Expand Up @@ -175,7 +175,16 @@ export class LocationListStep<T extends ILocationWizardContextInternal> extends
}

public async prompt(wizardContext: T): Promise<void> {
const options: IAzureQuickPickOptions = { placeHolder: vscode.l10n.t('Select a location for new resources.'), enableGrouping: true, ...this.options };
const options: AgentQuickPickOptions = {
placeHolder: vscode.l10n.t('Select a location for new resources.'),
enableGrouping: true,
agentMetadata: {
paramterNameTitle: vscode.l10n.t('Location'),
parameterName: 'location',
parameterDescription: vscode.l10n.t('The location where resources will be deployed.')
},
...this.options
};
wizardContext._location = (await wizardContext.ui.showQuickPick(this.getQuickPicks(wizardContext), options)).data;
wizardContext.telemetry.properties.locationType = wizardContext._location.type;
}
Expand All @@ -184,7 +193,7 @@ export class LocationListStep<T extends ILocationWizardContextInternal> extends
return !wizardContext._location;
}

protected async getQuickPicks(wizardContext: T): Promise<IAzureQuickPickItem<types.AzExtLocation>[]> {
protected async getQuickPicks(wizardContext: T): Promise<AgentQuickPickItem<types.AzExtLocation>[]> {
let locations: types.AzExtLocation[] = await LocationListStep.getLocations(wizardContext);
locations = locations.sort(compareLocation);

Expand All @@ -193,7 +202,8 @@ export class LocationListStep<T extends ILocationWizardContextInternal> extends
label: nonNullProp(l, 'displayName'),
group: l.metadata?.regionCategory,
data: l,
description: LocationListStep.getQuickPickDescription?.(l)
description: LocationListStep.getQuickPickDescription?.(l),
agentMetadata: {}
};
});
}
Expand Down

0 comments on commit a816a46

Please sign in to comment.