mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add New Object context menu entries on the objects themselves in OE (#23676)
This commit is contained in:
@@ -522,7 +522,37 @@
|
|||||||
{
|
{
|
||||||
"command": "mssql.newObject",
|
"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|Databases)$/ && config.workbench.enablePreviewFeatures",
|
||||||
"group": "1_objectManagement"
|
"group": "1_objectManagement@0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.newObject",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole|Database)$/ && config.workbench.enablePreviewFeatures",
|
||||||
|
"group": "1_objectManagement@0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.renameObject",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|Table|View|ServerLevelServerRole|ApplicationRole|DatabaseRole)$/ && config.workbench.enablePreviewFeatures",
|
||||||
|
"group": "1_objectManagement@1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.renameObject",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType == Column && config.workbench.enablePreviewFeatures && nodePath =~ /^.*\\/Tables\\/.*\\/Columns\\/.*$/",
|
||||||
|
"group": "1_objectManagement@1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.detachDatabase",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType == Database && !isCloud && config.workbench.enablePreviewFeatures",
|
||||||
|
"group": "1_objectManagement@2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.deleteObject",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole|Database)$/ && config.workbench.enablePreviewFeatures",
|
||||||
|
"group": "1_objectManagement@3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.enableGroupBySchema",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType && nodeType =~ /^(Server|Database)$/ && !config.mssql.objectExplorer.groupBySchema",
|
||||||
|
"group": "z_objectexplorer@0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "mssql.objectProperties",
|
"command": "mssql.objectProperties",
|
||||||
@@ -535,31 +565,6 @@
|
|||||||
"when": "connectionProvider == MSSQL && serverInfo && !isCloud && nodeType && nodeType =~ /^(Database|Server)$/ && mssql:engineedition != 11 && isDevelopment",
|
"when": "connectionProvider == MSSQL && serverInfo && !isCloud && nodeType && nodeType =~ /^(Database|Server)$/ && mssql:engineedition != 11 && isDevelopment",
|
||||||
"group": "z_objectexplorer@3"
|
"group": "z_objectexplorer@3"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"command": "mssql.deleteObject",
|
|
||||||
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole|Database)$/ && config.workbench.enablePreviewFeatures",
|
|
||||||
"group": "1_objectManagement"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "mssql.renameObject",
|
|
||||||
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|Table|View|ServerLevelServerRole|ApplicationRole|DatabaseRole)$/ && config.workbench.enablePreviewFeatures",
|
|
||||||
"group": "1_objectManagement"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "mssql.renameObject",
|
|
||||||
"when": "connectionProvider == MSSQL && nodeType == Column && config.workbench.enablePreviewFeatures && nodePath =~ /^.*\\/Tables\\/.*\\/Columns\\/.*$/",
|
|
||||||
"group": "1_objectManagement"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "mssql.detachDatabase",
|
|
||||||
"when": "connectionProvider == MSSQL && nodeType == Database && !isCloud && config.workbench.enablePreviewFeatures",
|
|
||||||
"group": "1_objectManagement"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "mssql.enableGroupBySchema",
|
|
||||||
"when": "connectionProvider == MSSQL && nodeType && nodeType =~ /^(Server|Database)$/ && !config.mssql.objectExplorer.groupBySchema",
|
|
||||||
"group": "z_objectexplorer@0"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"command": "mssql.disableGroupBySchema",
|
"command": "mssql.disableGroupBySchema",
|
||||||
"when": "connectionProvider == MSSQL && nodeType && nodeType =~ /^(Server|Database)$/ && config.mssql.objectExplorer.groupBySchema"
|
"when": "connectionProvider == MSSQL && nodeType && nodeType =~ /^(Server|Database)$/ && config.mssql.objectExplorer.groupBySchema"
|
||||||
@@ -604,28 +609,33 @@
|
|||||||
{
|
{
|
||||||
"command": "mssql.newObject",
|
"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|Databases)$/ && config.workbench.enablePreviewFeatures",
|
||||||
"group": "1_objectManagement"
|
"group": "1_objectManagement@0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.newObject",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole|Database)$/ && config.workbench.enablePreviewFeatures",
|
||||||
|
"group": "1_objectManagement@0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.renameObject",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|Table|View|ServerLevelServerRole|ApplicationRole|DatabaseRole)$/ && config.workbench.enablePreviewFeatures",
|
||||||
|
"group": "1_objectManagement@1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.renameObject",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType == Column && config.workbench.enablePreviewFeatures && nodePath =~ /^.*\\/Tables\\/.*\\/Columns\\/.*$/",
|
||||||
|
"group": "1_objectManagement@1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "mssql.deleteObject",
|
||||||
|
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole|Database)$/ && config.workbench.enablePreviewFeatures",
|
||||||
|
"group": "1_objectManagement@3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "mssql.objectProperties",
|
"command": "mssql.objectProperties",
|
||||||
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole)$/ && config.workbench.enablePreviewFeatures",
|
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole)$/ && config.workbench.enablePreviewFeatures",
|
||||||
"group": "z_objectManagement"
|
"group": "z_objectManagement"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"command": "mssql.deleteObject",
|
|
||||||
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|ServerLevelServerRole|ApplicationRole|DatabaseRole|Database)$/ && config.workbench.enablePreviewFeatures",
|
|
||||||
"group": "1_objectManagement"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "mssql.renameObject",
|
|
||||||
"when": "connectionProvider == MSSQL && nodeType =~ /^(ServerLevelLogin|User|Table|View|ServerLevelServerRole|ApplicationRole|DatabaseRole)$/ && config.workbench.enablePreviewFeatures",
|
|
||||||
"group": "1_objectManagement"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "mssql.renameObject",
|
|
||||||
"when": "connectionProvider == MSSQL && nodeType == Column && config.workbench.enablePreviewFeatures && nodePath =~ /^.*\\/Tables\\/.*\\/Columns\\/.*$/",
|
|
||||||
"group": "1_objectManagement"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"command": "mssql.enableGroupBySchema",
|
"command": "mssql.enableGroupBySchema",
|
||||||
"when": "connectionProvider == MSSQL && nodeType && nodeType =~ /^(Server|Database)$/ && !config.mssql.objectExplorer.groupBySchema"
|
"when": "connectionProvider == MSSQL && nodeType && nodeType =~ /^(Server|Database)$/ && !config.mssql.objectExplorer.groupBySchema"
|
||||||
|
|||||||
@@ -78,8 +78,21 @@ async function handleNewObjectDialogCommand(context: azdata.ObjectExplorerContex
|
|||||||
case FolderType.Databases:
|
case FolderType.Databases:
|
||||||
objectType = ObjectManagement.NodeType.Database;
|
objectType = ObjectManagement.NodeType.Database;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
// Fall back to node type in case the user right clicked on an object instead of a folder
|
||||||
|
if (!objectType) {
|
||||||
|
switch (context.nodeInfo!.nodeType) {
|
||||||
|
case ObjectManagement.NodeType.ApplicationRole:
|
||||||
|
case ObjectManagement.NodeType.DatabaseRole:
|
||||||
|
case ObjectManagement.NodeType.ServerLevelLogin:
|
||||||
|
case ObjectManagement.NodeType.ServerLevelServerRole:
|
||||||
|
case ObjectManagement.NodeType.User:
|
||||||
|
case ObjectManagement.NodeType.Database:
|
||||||
|
objectType = context.nodeInfo!.nodeType as ObjectManagement.NodeType;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error(`Unsupported folder type: ${context.nodeInfo!.objectType}`);
|
throw new Error(objectManagementLoc.NoDialogFoundError(context.nodeInfo!.nodeType, context.nodeInfo!.objectType));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export const ApplicationRoleTypeDisplayNameInTitle: string = localize('objectMan
|
|||||||
export const DatabaseRoleTypeDisplayName: string = localize('objectManagement.DatabaseRoleTypeDisplayName', "database role");
|
export const DatabaseRoleTypeDisplayName: string = localize('objectManagement.DatabaseRoleTypeDisplayName', "database role");
|
||||||
export const DatabaseRoleTypeDisplayNameInTitle: string = localize('objectManagement.DatabaseRoleTypeDisplayNameInTitle', "Database Role");
|
export const DatabaseRoleTypeDisplayNameInTitle: string = localize('objectManagement.DatabaseRoleTypeDisplayNameInTitle', "Database Role");
|
||||||
export const DatabaseTypeDisplayNameInTitle: string = localize('objectManagement.DatabaseDisplayNameInTitle', "Database");
|
export const DatabaseTypeDisplayNameInTitle: string = localize('objectManagement.DatabaseDisplayNameInTitle', "Database");
|
||||||
|
export function NoDialogFoundError(nodeType: string, objectType: string): string { return localize('objectManagement.noDialogFoundError', "Could not find a supported dialog for node type '{0}' and object type '{1}'.", nodeType, objectType); }
|
||||||
|
|
||||||
// Shared Strings
|
// Shared Strings
|
||||||
export const FailedToRetrieveConnectionInfoErrorMessage: string = localize('objectManagement.noConnectionUriError', "Failed to retrieve the connection information, please reconnect and try again.")
|
export const FailedToRetrieveConnectionInfoErrorMessage: string = localize('objectManagement.noConnectionUriError', "Failed to retrieve the connection information, please reconnect and try again.")
|
||||||
|
|||||||
Reference in New Issue
Block a user