mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
ServerInfoContextKey instead of MssqlNodeContextKey for OE items (#20563)
* ServerInfoContextKey instead of MssqlNodeContextKey for OE items * add comment
This commit is contained in:
@@ -16,6 +16,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
|||||||
import { ItemContextKey } from 'sql/workbench/contrib/dashboard/browser/widgets/explorer/explorerContext';
|
import { ItemContextKey } from 'sql/workbench/contrib/dashboard/browser/widgets/explorer/explorerContext';
|
||||||
import { EditDataAction } from 'sql/workbench/browser/scriptingActions';
|
import { EditDataAction } from 'sql/workbench/browser/scriptingActions';
|
||||||
import { DatabaseEngineEdition } from 'sql/workbench/api/common/sqlExtHostTypes';
|
import { DatabaseEngineEdition } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||||
|
import { ServerInfoContextKey } from 'sql/workbench/services/connection/common/serverInfoContextKey';
|
||||||
|
|
||||||
//#region -- Data Explorer
|
//#region -- Data Explorer
|
||||||
// Script as Create
|
// Script as Create
|
||||||
@@ -133,8 +134,8 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
|
|||||||
TreeNodeContextKey.NodeType.isEqualTo(NodeType.Table),
|
TreeNodeContextKey.NodeType.isEqualTo(NodeType.Table),
|
||||||
ConnectionContextKey.Provider.notEqualsTo('KUSTO'),
|
ConnectionContextKey.Provider.notEqualsTo('KUSTO'),
|
||||||
ConnectionContextKey.Provider.notEqualsTo('LOGANALYTICS'),
|
ConnectionContextKey.Provider.notEqualsTo('LOGANALYTICS'),
|
||||||
MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString()),
|
ServerInfoContextKey.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString()),
|
||||||
MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlDataWarehouse.toString())
|
ServerInfoContextKey.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlDataWarehouse.toString())
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -153,7 +154,7 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {
|
|||||||
TreeNodeContextKey.NodeType.isEqualTo(NodeType.Table),
|
TreeNodeContextKey.NodeType.isEqualTo(NodeType.Table),
|
||||||
TreeNodeContextKey.NodeType.isEqualTo(NodeType.View),
|
TreeNodeContextKey.NodeType.isEqualTo(NodeType.View),
|
||||||
TreeNodeContextKey.NodeType.isEqualTo(NodeType.Schema),
|
TreeNodeContextKey.NodeType.isEqualTo(NodeType.Schema),
|
||||||
ContextKeyExpr.and(TreeNodeContextKey.NodeType.isEqualTo(NodeType.User), MssqlNodeContext.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString())),
|
ContextKeyExpr.and(TreeNodeContextKey.NodeType.isEqualTo(NodeType.User), ServerInfoContextKey.EngineEdition.notEqualsTo(DatabaseEngineEdition.SqlOnDemand.toString())),
|
||||||
TreeNodeContextKey.NodeType.isEqualTo(NodeType.User),
|
TreeNodeContextKey.NodeType.isEqualTo(NodeType.User),
|
||||||
TreeNodeContextKey.NodeType.isEqualTo(NodeType.UserDefinedTableType),
|
TreeNodeContextKey.NodeType.isEqualTo(NodeType.UserDefinedTableType),
|
||||||
TreeNodeContextKey.NodeType.isEqualTo(NodeType.StoredProcedure),
|
TreeNodeContextKey.NodeType.isEqualTo(NodeType.StoredProcedure),
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ export interface INodeContextValue {
|
|||||||
viewId: string;
|
viewId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This context key is for Data Explorer nodes only - it is not used for Object Explorer nodes. For that use
|
||||||
|
* [treeNodeContextKey](https://github.com/Microsoft/azuredatastudio/blob/main/src/sql/workbench/services/objectExplorer/common/treeNodeContextKey.ts),
|
||||||
|
* [connectionContextKey](https://github.com/Microsoft/azuredatastudio/blob/main/src/sql/workbench/services/connection/common/connectionContextKey.ts) or
|
||||||
|
* [serverInfoContextKey](https://github.com/Microsoft/azuredatastudio/blob/main/src/sql/workbench/services/connection/common/serverInfoContextKey.ts)
|
||||||
|
*/
|
||||||
export class MssqlNodeContext extends Disposable {
|
export class MssqlNodeContext extends Disposable {
|
||||||
|
|
||||||
static readonly canSelect = new Set([NodeType.Table, NodeType.View]);
|
static readonly canSelect = new Set([NodeType.Table, NodeType.View]);
|
||||||
|
|||||||
Reference in New Issue
Block a user