From 2aa00eba80409d6e4ba1301e801e7cdc0ccbeb3b Mon Sep 17 00:00:00 2001 From: Monica Gupta Date: Thu, 17 Sep 2020 17:00:33 -0700 Subject: [PATCH] Change default Select query label to "Take 10" for Kusto tables (#12396) * Change default label to "Take 10" for Kusto tables * Addressed comments Co-authored-by: Monica Gupta --- .../browser/scripting.contribution.ts | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/sql/workbench/contrib/scripting/browser/scripting.contribution.ts b/src/sql/workbench/contrib/scripting/browser/scripting.contribution.ts index eadf81b03f..b753009e84 100644 --- a/src/sql/workbench/contrib/scripting/browser/scripting.contribution.ts +++ b/src/sql/workbench/contrib/scripting/browser/scripting.contribution.ts @@ -94,7 +94,26 @@ MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { id: commands.OE_SCRIPT_AS_SELECT_COMMAND_ID, title: localize('scriptSelect', "Select Top 1000") }, - when: ContextKeyExpr.or(TreeNodeContextKey.NodeType.isEqualTo('Table'), TreeNodeContextKey.NodeType.isEqualTo('View')) + when: ContextKeyExpr.and( + ConnectionContextKey.Provider.notEqualsTo('KUSTO'), + ContextKeyExpr.or( + TreeNodeContextKey.NodeType.isEqualTo('Table'), + TreeNodeContextKey.NodeType.isEqualTo('View') + ) + ) +}); + +MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, { + group: '0_query', + order: 1, + command: { + id: commands.OE_SCRIPT_AS_SELECT_COMMAND_ID, + title: localize('scriptKustoSelect', "Take 10") + }, + when: ContextKeyExpr.and( + ConnectionContextKey.Provider.isEqualTo('KUSTO'), + TreeNodeContextKey.NodeType.isEqualTo('Table') + ) }); MenuRegistry.appendMenuItem(MenuId.ObjectExplorerItemContext, {