Skip to content

Commit 39d434c

Browse files
committed
Fixing table designer command names
1 parent 19bae06 commit 39d434c

File tree

8 files changed

+69
-34
lines changed

8 files changed

+69
-34
lines changed

.vscode/settings.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,12 @@
2121
"yaml.schemas": {
2222
"https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json": "build/**/*.yml"
2323
},
24-
"eslint.validate": [ "javascript", "javascriptreact", "html", "typescriptreact", "typescript" ],
24+
"eslint.validate": [
25+
"javascript",
26+
"javascriptreact",
27+
"html",
28+
"typescriptreact",
29+
"typescript"
30+
],
31+
"svg.preview.background": "dark-transparent",
2532
}

localization/xliff/enu/localizedPackage.json.enu.xlf

+9
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,15 @@
425425
<trans-unit id="mssql.objectExplorer.expandTimeout">
426426
<source xml:lang="en">The timeout in seconds for expanding a node in Object Explorer. The default value is 45 seconds.</source>
427427
</trans-unit>
428+
<trans-unit id="mssql.enablePreviewFeaturesDescription">
429+
<source xml:lang="en">Enable preview features in the extension. Requires a restart of VS Code to take effect.</source>
430+
</trans-unit>
431+
<trans-unit id="mssql.newTable">
432+
<source xml:lang="en">New Table</source>
433+
</trans-unit>
434+
<trans-unit id="mssql.editTable">
435+
<source xml:lang="en">Edit Table</source>
436+
</trans-unit>
428437
</body>
429438
</file>
430439
</xliff>

media/editTable.svg

+3
Loading

media/editTable_inverse.svg

+3
Loading

package.json

+18-11
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,12 @@
325325
"group": "MS_SQL@3"
326326
},
327327
{
328-
"command": "mssql.TableDesigner",
328+
"command": "mssql.newTable",
329329
"when": "view == objectExplorer && viewItem == TablesFolder && config.mssql.enablePreviewFeatures",
330330
"group": "inline"
331331
},
332332
{
333-
"command": "mssql.TableDesigner",
333+
"command": "mssql.editTable",
334334
"when": "view == objectExplorer && viewItem == Table && config.mssql.enablePreviewFeatures",
335335
"group": "inline"
336336
}
@@ -393,18 +393,16 @@
393393
"when": "view == queryHistory && viewItem == queryHistoryNode"
394394
},
395395
{
396-
"command": "mssql.TableDesigner",
396+
"command": "mssql.newTable",
397397
"when": "view == objectExplorer && viewItem == TablesFolder"
398+
},
399+
{
400+
"command": "mssql.editTable",
401+
"when": "view == objectExplorer && viewItem == Table"
398402
}
399403
]
400404
},
401405
"commands": [
402-
{
403-
"command": "mssql.TableDesigner",
404-
"title": "MSSQL: TableDesigner",
405-
"category": "MS SQL",
406-
"icon": "$(new-table)"
407-
},
408406
{
409407
"command": "mssql.runQuery",
410408
"title": "%mssql.runQuery%",
@@ -537,14 +535,23 @@
537535
"category": "MS SQL"
538536
},
539537
{
540-
"command": "mssql.TableDesigner",
541-
"title": "%mssql.TableDesigner%",
538+
"command": "mssql.newTable",
539+
"title": "%mssql.newTable%",
542540
"category": "MS SQL",
543541
"icon": {
544542
"dark": "media/newTable_inverse.svg",
545543
"light": "media/newTable.svg"
546544
}
547545
},
546+
{
547+
"command": "mssql.editTable",
548+
"title": "%mssql.editTable%",
549+
"category": "MS SQL",
550+
"icon": {
551+
"dark": "media/editTable_inverse.svg",
552+
"light": "media/editTable.svg"
553+
}
554+
},
548555
{
549556
"command": "mssql.scriptAlter",
550557
"title": "%mssql.scriptAlter%",

package.nls.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,7 @@
140140
"mssql.objectExplorer.enableGroupBySchema":"Enable Group By Schema",
141141
"mssql.objectExplorer.disableGroupBySchema":"Disable Group By Schema",
142142
"mssql.objectExplorer.expandTimeout":"The timeout in seconds for expanding a node in Object Explorer. The default value is 45 seconds.",
143-
"mssql.enablePreviewFeaturesDescription": "Enable preview features in the extension. Requires a restart of VS Code to take effect."
143+
"mssql.enablePreviewFeaturesDescription":"Enable preview features in the extension. Requires a restart of VS Code to take effect.",
144+
"mssql.newTable":"New Table",
145+
"mssql.editTable":"Edit Table"
144146
}

src/constants/constants.ts

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export const cmdAzureSignInToCloud = 'azure-account.loginToCloud';
6767
export const cmdAadRemoveAccount = 'mssql.removeAadAccount';
6868
export const cmdAadAddAccount = 'mssql.addAadAccount';
6969
export const cmdClearAzureTokenCache = 'mssql.clearAzureAccountTokenCache';
70+
export const cmdNewTable = 'mssql.newTable';
71+
export const cmdEditTable = 'mssql.editTable';
7072
export const piiLogging = 'piiLogging';
7173
export const mssqlPiiLogging = 'mssql.piiLogging';
7274
export const enableSqlAuthenticationProvider = 'mssql.enableSqlAuthenticationProvider';

src/controllers/mainController.ts

+23-21
Original file line numberDiff line numberDiff line change
@@ -488,27 +488,29 @@ export default class MainController implements vscode.Disposable {
488488
if (this.isPreviewEnabled) {
489489
this._context.subscriptions.push(
490490
vscode.commands.registerCommand(
491-
'mssql.TableDesigner', async (node: TreeNodeInfo) => {
492-
if (node.nodeType === 'Table') {
493-
const reactPanel = new TableDesignerWebViewController(
494-
this._context,
495-
this.tableDesignerService,
496-
this._connectionMgr,
497-
this._objectExplorerProvider,
498-
this._untitledSqlDocumentService,
499-
node
500-
);
501-
reactPanel.revealToForeground();
502-
} else {
503-
const reactPanel = new TableDesignerWebViewController(
504-
this._context,
505-
this.tableDesignerService,
506-
this._connectionMgr,
507-
this._objectExplorerProvider,
508-
this._untitledSqlDocumentService
509-
);
510-
reactPanel.revealToForeground();
511-
}
491+
Constants.cmdNewTable, async (node: TreeNodeInfo) => {
492+
const reactPanel = new TableDesignerWebViewController(
493+
this._context,
494+
this.tableDesignerService,
495+
this._connectionMgr,
496+
this._objectExplorerProvider,
497+
this._untitledSqlDocumentService
498+
);
499+
reactPanel.revealToForeground();
500+
}));
501+
502+
this._context.subscriptions.push(
503+
vscode.commands.registerCommand(
504+
Constants.cmdEditTable, async (node: TreeNodeInfo) => {
505+
const reactPanel = new TableDesignerWebViewController(
506+
this._context,
507+
this.tableDesignerService,
508+
this._connectionMgr,
509+
this._objectExplorerProvider,
510+
this._untitledSqlDocumentService,
511+
node
512+
);
513+
reactPanel.revealToForeground();
512514
}));
513515
}
514516

0 commit comments

Comments
 (0)