mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 18:48:33 -05:00
only show new query when query is supported (#17346)
* only show new query when query is supported * test case fix and pr comments * rename context key
This commit is contained in:
@@ -78,7 +78,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
|
||||
id: OE_NEW_QUERY_ACTION_ID,
|
||||
title: localize('newQuery', "New Query")
|
||||
},
|
||||
when: ContextKeyExpr.or(ContextKeyExpr.and(TreeNodeContextKey.Status.notEqualsTo('Unavailable'), TreeNodeContextKey.NodeType.isEqualTo('Server')), ContextKeyExpr.and(TreeNodeContextKey.Status.notEqualsTo('Unavailable'), TreeNodeContextKey.NodeType.isEqualTo('Database')))
|
||||
when: ContextKeyExpr.and(TreeNodeContextKey.Status.notEqualsTo('Unavailable'), TreeNodeContextKey.IsQueryProvider.isEqualTo(true), ContextKeyExpr.or(TreeNodeContextKey.NodeType.isEqualTo('Server'), TreeNodeContextKey.NodeType.isEqualTo('Database')))
|
||||
});
|
||||
|
||||
// New Query
|
||||
@@ -89,7 +89,7 @@ MenuRegistry.appendMenuItem(MenuId.DataExplorerContext, {
|
||||
id: DE_NEW_QUERY_COMMAND_ID,
|
||||
title: localize('newQuery', "New Query")
|
||||
},
|
||||
when: MssqlNodeContext.IsDatabaseOrServer
|
||||
when: ContextKeyExpr.and(MssqlNodeContext.IsDatabaseOrServer, MssqlNodeContext.IsQueryProvider)
|
||||
});
|
||||
|
||||
const ExplorerNewQueryActionID = 'explorer.query';
|
||||
|
||||
Reference in New Issue
Block a user