mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
Create new context menu item for Database (#23771)
This commit is contained in:
@@ -83,6 +83,12 @@
|
||||
"title": "%title.newObject%",
|
||||
"icon": "$(add)"
|
||||
},
|
||||
{
|
||||
"command": "mssql.newDatabase",
|
||||
"category": "MSSQL",
|
||||
"title": "%title.newDatabase%",
|
||||
"icon": "$(add)"
|
||||
},
|
||||
{
|
||||
"command": "mssql.objectProperties",
|
||||
"category": "MSSQL",
|
||||
@@ -490,6 +496,10 @@
|
||||
"command": "mssql.newObject",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "mssql.newDatabase",
|
||||
"when": "false"
|
||||
},
|
||||
{
|
||||
"command": "mssql.objectProperties",
|
||||
"when": "false"
|
||||
@@ -526,12 +536,22 @@
|
||||
},
|
||||
{
|
||||
"command": "mssql.newObject",
|
||||
"when": "connectionProvider == MSSQL && nodeType == Folder && objectType =~ /^(ServerLevelLogins|Users|ServerLevelServerRoles|ApplicationRoles|DatabaseRoles|Databases)$/ && config.workbench.enablePreviewFeatures",
|
||||
"when": "connectionProvider == MSSQL && nodeType == Folder && objectType =~ /^(ServerLevelLogins|Users|ServerLevelServerRoles|ApplicationRoles|DatabaseRoles)$/ && config.workbench.enablePreviewFeatures",
|
||||
"group": "1_objectManagement@0"
|
||||
},
|
||||
{
|
||||
"command": "mssql.newObject",
|
||||
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole|Database)$/ && !(nodePath =~ /^.*\\/System Databases\\/.*$/) && config.workbench.enablePreviewFeatures",
|
||||
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole)$/ && !(nodePath =~ /^.*\\/System Databases\\/.*$/) && config.workbench.enablePreviewFeatures",
|
||||
"group": "1_objectManagement@0"
|
||||
},
|
||||
{
|
||||
"command": "mssql.newDatabase",
|
||||
"when": "connectionProvider == MSSQL && nodeType == Folder && objectType == Databases && config.workbench.enablePreviewFeatures",
|
||||
"group": "1_objectManagement@0"
|
||||
},
|
||||
{
|
||||
"command": "mssql.newDatabase",
|
||||
"when": "connectionProvider == MSSQL && nodeType == Database && !(nodePath =~ /^.*\\/System Databases\\/.*$/) && config.workbench.enablePreviewFeatures",
|
||||
"group": "1_objectManagement@0"
|
||||
},
|
||||
{
|
||||
@@ -613,12 +633,22 @@
|
||||
},
|
||||
{
|
||||
"command": "mssql.newObject",
|
||||
"when": "connectionProvider == MSSQL && nodeType == Folder && objectType =~ /^(ServerLevelLogins|Users|ServerLevelServerRoles|ApplicationRoles|DatabaseRoles|Databases)$/ && config.workbench.enablePreviewFeatures",
|
||||
"when": "connectionProvider == MSSQL && nodeType == Folder && objectType =~ /^(ServerLevelLogins|Users|ServerLevelServerRoles|ApplicationRoles|DatabaseRoles)$/ && config.workbench.enablePreviewFeatures",
|
||||
"group": "1_objectManagement@0"
|
||||
},
|
||||
{
|
||||
"command": "mssql.newObject",
|
||||
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole|Database)$/ && !(nodePath =~ /^.*\\/System Databases\\/.*$/) && config.workbench.enablePreviewFeatures",
|
||||
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole)$/ && !(nodePath =~ /^.*\\/System Databases\\/.*$/) && config.workbench.enablePreviewFeatures",
|
||||
"group": "1_objectManagement@0"
|
||||
},
|
||||
{
|
||||
"command": "mssql.newDatabase",
|
||||
"when": "connectionProvider == MSSQL && nodeType == Folder && objectType == Databases && config.workbench.enablePreviewFeatures",
|
||||
"group": "1_objectManagement@0"
|
||||
},
|
||||
{
|
||||
"command": "mssql.newDatabase",
|
||||
"when": "connectionProvider == MSSQL && nodeType == Database && !(nodePath =~ /^.*\\/System Databases\\/.*$/) && config.workbench.enablePreviewFeatures",
|
||||
"group": "1_objectManagement@0"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -186,6 +186,7 @@
|
||||
"mssql.objectExplorer.disableGroupBySchemaTitle": "SQL Server: Disable Group By Schema",
|
||||
"mssql.objectExplorer.expandTimeout": "The timeout in seconds for expanding a node in Object Explorer. The default value is 45 seconds.",
|
||||
"title.newObject": "New (Preview)",
|
||||
"title.newDatabase": "New Database (Preview)",
|
||||
"title.objectProperties": "Properties (Preview)",
|
||||
"title.deleteObject": "Delete (Preview)",
|
||||
"title.renameObject": "Rename (Preview)",
|
||||
|
||||
@@ -31,6 +31,9 @@ export function registerObjectManagementCommands(appContext: AppContext) {
|
||||
appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.newObject', async (context: azdata.ObjectExplorerContext) => {
|
||||
await handleNewObjectDialogCommand(context, service);
|
||||
}));
|
||||
appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.newDatabase', async (context: azdata.ObjectExplorerContext) => {
|
||||
await handleNewObjectDialogCommand(context, service);
|
||||
}));
|
||||
appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.objectProperties', async (context: azdata.ObjectExplorerContext) => {
|
||||
await handleObjectPropertiesDialogCommand(context, service);
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user