diff --git a/serviceconnector/src/tree/ServiceConnectorGroupTreeItem.ts b/serviceconnector/src/tree/ServiceConnectorGroupTreeItem.ts index 0a2366fb27..e8c9385bec 100644 --- a/serviceconnector/src/tree/ServiceConnectorGroupTreeItem.ts +++ b/serviceconnector/src/tree/ServiceConnectorGroupTreeItem.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import { uiUtils } from "@microsoft/vscode-azext-azureutils"; -import { AzExtParentTreeItem, AzExtTreeItem, TreeItemIconPath, nonNullValue } from "@microsoft/vscode-azext-utils"; +import { AzExtParentTreeItem, AzExtTreeItem, TreeItemIconPath, createContextValue, nonNullValue } from "@microsoft/vscode-azext-utils"; import * as vscode from 'vscode'; import { getIconPath } from "./IconPath"; import { ServiceConnectorTreeItem } from "./ServiceConnectorTreeItem"; export class ServiceConnectorGroupTreeItem extends AzExtParentTreeItem { - constructor(parent: AzExtParentTreeItem, public readonly resourceId: string) { + constructor(parent: AzExtParentTreeItem, public readonly resourceId: string, private readonly contextValuesToAdd: string[]) { super(parent); } @@ -22,7 +22,7 @@ export class ServiceConnectorGroupTreeItem extends AzExtParentTreeItem { linkers, 'invalidServiceConnector', l => { - return new ServiceConnectorTreeItem(l, this) + return new ServiceConnectorTreeItem(l, this, this.contextValuesToAdd) }, l => { return l.name; @@ -48,6 +48,6 @@ export class ServiceConnectorGroupTreeItem extends AzExtParentTreeItem { } public get contextValue(): string { - return 'serviceConnectorGroupItem'; + return createContextValue(['serviceConnectorGroupItem', ...this.contextValuesToAdd]); } } diff --git a/serviceconnector/src/tree/ServiceConnectorTreeItem.ts b/serviceconnector/src/tree/ServiceConnectorTreeItem.ts index 273c641f7d..d9c786f365 100644 --- a/serviceconnector/src/tree/ServiceConnectorTreeItem.ts +++ b/serviceconnector/src/tree/ServiceConnectorTreeItem.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { LinkerResource } from "@azure/arm-servicelinker"; -import { AzExtParentTreeItem, AzExtTreeItem, TreeItemIconPath, nonNullValue } from "@microsoft/vscode-azext-utils"; +import { AzExtParentTreeItem, AzExtTreeItem, TreeItemIconPath, createContextValue, nonNullValue } from "@microsoft/vscode-azext-utils"; import { ThemeIcon } from "vscode"; import { getIconPath } from "./IconPath"; import { connectionIconPath } from "./ServiceConnectorItem"; @@ -14,7 +14,7 @@ export class ServiceConnectorTreeItem extends AzExtTreeItem { public readonly linker: LinkerResource; public readonly item: AzExtTreeItem; - constructor(linker: LinkerResource, parent: AzExtParentTreeItem) { + constructor(linker: LinkerResource, parent: AzExtParentTreeItem, private readonly contextValuesToAdd: string[]) { super(parent); this.linker = linker; this.item = parent; @@ -29,7 +29,7 @@ export class ServiceConnectorTreeItem extends AzExtTreeItem { } public get contextValue(): string { - return 'serviceConnectorItem'; + return createContextValue(['serviceConnectorItem', ...this.contextValuesToAdd]); } public get iconPath(): TreeItemIconPath {