mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Add support for "More Actions" column in Resource Viewer (#13093)
* Add support for "More Actions" column in resource viewer * update provider * remove import * Use menu contribution and make actions column always show * cleanup * move context menu anchor * Comments
This commit is contained in:
@@ -174,6 +174,10 @@
|
||||
"dark": "resources/dark/add_to_server_list_inverse.svg",
|
||||
"light": "resources/light/add_to_server_list.svg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "azure.dataGrid.openInAzurePortal",
|
||||
"title": "%azure.openInAzurePortal.title%"
|
||||
}
|
||||
],
|
||||
"connectionTreeProvider": [
|
||||
@@ -211,6 +215,10 @@
|
||||
{
|
||||
"command": "azure.resource.connectsqlserver",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "azure.dataGrid.openInAzurePortal",
|
||||
"when": "false"
|
||||
}
|
||||
],
|
||||
"view/title": [
|
||||
@@ -293,6 +301,11 @@
|
||||
"when": "treeId == connectionDialog/azureResourceExplorer",
|
||||
"group": "navigation"
|
||||
}
|
||||
],
|
||||
"dataGrid/item/context": [
|
||||
{
|
||||
"command": "azure.dataGrid.openInAzurePortal"
|
||||
}
|
||||
]
|
||||
},
|
||||
"hasAzureResourceProviders": true
|
||||
|
||||
@@ -45,12 +45,14 @@ export class AzureDataGridProvider implements azdata.DataGridProvider {
|
||||
.map(item => {
|
||||
return <azdata.DataGridItem>{
|
||||
id: item.id,
|
||||
// nameLink: <azdata.DataGridHyperlinkInfo>{ displayText: item.name, linkOrCommand: ''},
|
||||
resourceGroup: item.resourceGroup,
|
||||
subscriptionName: subscriptions.find(subscription => subscription.id === item.subscriptionId)?.name ?? item.subscriptionId,
|
||||
locationDisplayName: utils.getRegionDisplayName(item.location),
|
||||
typeDisplayName: utils.getResourceTypeDisplayName(item.type),
|
||||
iconPath: utils.getResourceTypeIcon(this._appContext, item.type)
|
||||
fieldValues: {
|
||||
nameLink: <azdata.DataGridHyperlinkInfo>{ displayText: item.name, linkOrCommand: 'https://microsoft.com' },
|
||||
resourceGroup: item.resourceGroup,
|
||||
subscriptionName: subscriptions.find(subscription => subscription.id === item.subscriptionId)?.name ?? item.subscriptionId,
|
||||
locationDisplayName: utils.getRegionDisplayName(item.location),
|
||||
typeDisplayName: utils.getResourceTypeDisplayName(item.type),
|
||||
iconPath: utils.getResourceTypeIcon(this._appContext, item.type),
|
||||
}
|
||||
};
|
||||
});
|
||||
items.push(...newItems);
|
||||
|
||||
@@ -91,6 +91,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<azurec
|
||||
pushDisposable(vscode.workspace.onDidChangeConfiguration(e => onDidChangeConfiguration(e), this));
|
||||
registerAzureResourceCommands(appContext, [azureResourceTree, connectionDialogTree]);
|
||||
azdata.dataprotocol.registerDataGridProvider(new AzureDataGridProvider(appContext));
|
||||
vscode.commands.registerCommand('azure.dataGrid.openInAzurePortal', async (item: azdata.DataGridItem) => {
|
||||
await vscode.env.openExternal(vscode.Uri.parse('https://microsoft.com'));
|
||||
});
|
||||
|
||||
return {
|
||||
getSubscriptions(account?: azdata.Account, ignoreErrors?: boolean, selectedOnly: boolean = false): Thenable<azurecore.GetSubscriptionsResult> {
|
||||
|
||||
Reference in New Issue
Block a user