@microsoft/vscode-azext-utils
Advanced tools
Comparing version
@@ -136,2 +136,4 @@ "use strict"; | ||
errorData.message = (0, masking_1.maskUserInfo)(errorData.message, context.valuesToMask); | ||
context.telemetry.properties.azureSubscriptionId = context.subscriptionId; | ||
context.telemetry.properties.azureResourceId = context.resourceId; | ||
if (errorData.stepName) { | ||
@@ -229,2 +231,4 @@ context.telemetry.properties.lastStep = errorData.stepName; | ||
context.telemetry.measurements.duration = (end - start) / 1000; | ||
context.telemetry.properties.azureSubscriptionId = context.subscriptionId; | ||
context.telemetry.properties.azureResourceId = context.resourceId; | ||
// de-dupe | ||
@@ -231,0 +235,0 @@ context.valuesToMask = context.valuesToMask.filter((v, index) => context.valuesToMask.indexOf(v) === index); |
@@ -30,3 +30,4 @@ "use strict"; | ||
const { resourceTypes, childItemFilter } = options; | ||
return (0, azureResourceExperience_1.azureResourceExperience)(Object.assign(Object.assign({}, context), { v1Compatibility: true }), tdp, resourceTypes ? Array.isArray(resourceTypes) ? resourceTypes : [resourceTypes] : undefined, childItemFilter); | ||
context.v1Compatibility = true; | ||
return (0, azureResourceExperience_1.azureResourceExperience)(context, tdp, resourceTypes ? Array.isArray(resourceTypes) ? resourceTypes : [resourceTypes] : undefined, childItemFilter); | ||
}); | ||
@@ -33,0 +34,0 @@ } |
@@ -34,2 +34,4 @@ "use strict"; | ||
wizardContext.resourceGroup = pickedAzureResource.resource.resourceGroup; | ||
wizardContext.resourceId = pickedAzureResource.resource.id; | ||
wizardContext.subscriptionId = pickedAzureResource.resource.subscription.subscriptionId; | ||
return pickedAzureResource; | ||
@@ -36,0 +38,0 @@ }); |
@@ -25,9 +25,8 @@ "use strict"; | ||
// Fill in the `pickedNodes` property | ||
const wizardContext = Object.assign({}, context); | ||
wizardContext.pickedNodes = startingNode ? [startingNode] : []; | ||
const wizard = new AzureWizard_1.AzureWizard(wizardContext, Object.assign({ hideStepCount: true, showLoadingPrompt: (_a = wizardOptions === null || wizardOptions === void 0 ? void 0 : wizardOptions.showLoadingPrompt) !== null && _a !== void 0 ? _a : true }, wizardOptions)); | ||
context.pickedNodes = startingNode ? [startingNode] : []; | ||
const wizard = new AzureWizard_1.AzureWizard(context, Object.assign({ hideStepCount: true, showLoadingPrompt: (_a = wizardOptions === null || wizardOptions === void 0 ? void 0 : wizardOptions.showLoadingPrompt) !== null && _a !== void 0 ? _a : true }, wizardOptions)); | ||
yield wizard.prompt(); | ||
const lastPickedItem = (0, getLastNode_1.getLastNode)(wizardContext); | ||
const lastPickedItem = (0, getLastNode_1.getLastNode)(context); | ||
if (!lastPickedItem) { | ||
throw new errors_1.NoResourceFoundError(wizardContext); | ||
throw new errors_1.NoResourceFoundError(context); | ||
} | ||
@@ -34,0 +33,0 @@ else { |
@@ -25,2 +25,6 @@ "use strict"; | ||
} | ||
// if the firstArg has a resource property, it is a ResourceGroupsItem from the resource groups extension | ||
function isResourceGroupsItem(object) { | ||
return typeof object === 'object' && object !== null && 'resource' in object; | ||
} | ||
function registerCommand(commandId, callback, debounce, telemetryId) { | ||
@@ -36,2 +40,3 @@ let lastClickTime; /* Used for debounce */ | ||
return yield (0, callWithTelemetryAndErrorHandling_1.callWithTelemetryAndErrorHandling)(telemetryId || commandId, (context) => __awaiter(this, void 0, void 0, function* () { | ||
var _a, _b, _c; | ||
if (args.length > 0) { | ||
@@ -48,2 +53,6 @@ const firstArg = args[0]; | ||
} | ||
if (isResourceGroupsItem(firstArg)) { | ||
context.resourceId = (_a = firstArg === null || firstArg === void 0 ? void 0 : firstArg.resource) === null || _a === void 0 ? void 0 : _a.id; | ||
context.subscriptionId = (_c = (_b = firstArg === null || firstArg === void 0 ? void 0 : firstArg.resource) === null || _b === void 0 ? void 0 : _b.subscription) === null || _c === void 0 ? void 0 : _c.subscriptionId; | ||
} | ||
for (const arg of args) { | ||
@@ -50,0 +59,0 @@ if (arg instanceof AzExtTreeItem_1.AzExtTreeItem) { |
@@ -107,3 +107,3 @@ "use strict"; | ||
result.push(...duplicateChildren.map(c => { | ||
const message = vscode_1.l10n.t('An element with the following id already exists: {0}', c.fullId); | ||
const message = vscode_1.l10n.t('An element with the following id already exists: {id}', { id: c.fullId }); | ||
return new AzExtParentTreeItem_1.InvalidTreeItem(treeItem, new Error(message), { contextValue: 'azureextensionui.duplicate', label: c.label }); | ||
@@ -110,0 +110,0 @@ })); |
{ | ||
"name": "@microsoft/vscode-azext-utils", | ||
"author": "Microsoft Corporation", | ||
"version": "2.5.14", | ||
"version": "2.6.0", | ||
"description": "Common UI tools for developing Azure extensions for VS Code", | ||
@@ -55,3 +55,3 @@ "tags": [ | ||
"@types/uuid": "^9.0.1", | ||
"@types/vscode": "^1.82.0", | ||
"@types/vscode": "^1.94.0", | ||
"@typescript-eslint/eslint-plugin": "^5.53.0", | ||
@@ -58,0 +58,0 @@ "@vscode/test-electron": "^2.3.8", |
Sorry, the diff of this file is too big to display
443478
0.36%8609
0.29%