Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Group by schema to OE #17543

Merged
merged 16 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions localization/xliff/enu/localizedPackage.json.enu.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@
<trans-unit id="mssql.deviceCode.description">
<source xml:lang="en">Allows users to sign in to input-constrained devices.</source>
</trans-unit>
<trans-unit id="mssql.objectExplorer.groupBySchema">
<source xml:lang="en">When enabled, the database objects in Object explorer will be categorized by schema.</source>
aasimkhan30 marked this conversation as resolved.
Show resolved Hide resolved
</trans-unit>
</body>
</file>
</xliff>
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,11 @@
"type": "boolean",
"description": "%mssql.ignorePlatformWarning%",
"default": false
},
"mssql.objectExplorer.groupBySchema": {
"type": "boolean",
"description": "%mssql.objectExplorer.groupBySchema%",
"default": true
aasimkhan30 marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,6 @@
"mssql.Configuration":"MSSQL configuration",
"mssql.chooseAuthMethod":"Chooses which Authentication method to use",
"mssql.authCodeGrant.description":"Prompts users to sign in using their browser.",
"mssql.deviceCode.description":"Allows users to sign in to input-constrained devices."
"mssql.deviceCode.description":"Allows users to sign in to input-constrained devices.",
"mssql.objectExplorer.groupBySchema":"When enabled, the database objects in Object explorer will be categorized by schema."
}
1 change: 1 addition & 0 deletions src/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const cmdObjectExplorerNodeSignIn = 'mssql.objectExplorerNodeSignIn';
export const cmdConnectObjectExplorerNode = 'mssql.connectObjectExplorerNode';
export const cmdConnectObjectExplorerProfile = 'mssql.connectObjectExplorerProfile';
export const cmdOpenObjectExplorerCommand = 'workbench.view.extension.objectExplorer';
export const cmdObjectExplorerGroupBySchemaFlagName = 'mssql.objectExplorer.groupBySchema';
export const cmdScriptSelect = 'mssql.scriptSelect';
export const cmdScriptCreate = 'mssql.scriptCreate';
export const cmdScriptDelete = 'mssql.scriptDelete';
Expand Down
13 changes: 13 additions & 0 deletions src/controllers/mainController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,19 @@ export default class MainController implements vscode.Disposable {

await this.sanitizeConnectionProfiles();

if(e.affectsConfiguration(Constants.cmdObjectExplorerGroupBySchemaFlagName)){
this._objectExplorerProvider.rootNodeConnections.forEach(async (conn) => {
if(this.connectionManager.isActiveConnection(conn)){
const rootNodes = await this._objectExplorerProvider.getChildren();
aasimkhan30 marked this conversation as resolved.
Show resolved Hide resolved
rootNodes.forEach(async (rootNode: TreeNodeInfo) => {
aasimkhan30 marked this conversation as resolved.
Show resolved Hide resolved
if(rootNode.connectionInfo.accountId === conn.accountId){
await this._objectExplorerProvider.refreshNode(rootNode);
}
});
}
});
}

if (needsRefresh) {
this._objectExplorerProvider.refresh(undefined);
}
Expand Down
59 changes: 35 additions & 24 deletions src/objectExplorer/objectTypes/Schema.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.