Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
10 changes: 7 additions & 3 deletions mssql/localization/l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@
"message": "({0} rows affected)",
"comment": ["{0} is the number of rows affected"]
},
"Result Set {0}/{0} is the index of the result set": {
"message": "Result Set {0}",
"comment": ["{0} is the index of the result set"]
"Result Set Batch {0} - Query {1}/{0} is the batch number{1} is the query number": {
"message": "Result Set Batch {0} - Query {1}",
"comment": ["{0} is the batch number", "{1} is the query number"]
},
"Loading text view...": "Loading text view...",
"Loading results...": "Loading results...",
Expand Down Expand Up @@ -1329,6 +1329,10 @@
"Clear cache and refresh token": "Clear cache and refresh token",
"Clear token cache": "Clear token cache",
"No workspaces found. Please change Fabric account or tenant to view available workspaces.": "No workspaces found. Please change Fabric account or tenant to view available workspaces.",
"Unable to enforce default User Connections group: {0}/{0} is the error message": {
"message": "Unable to enforce default User Connections group: {0}",
"comment": ["{0} is the error message"]
},
"Add Firewall Rule to {0}/{0} is the server name": {
"message": "Add Firewall Rule to {0}",
"comment": ["{0} is the server name"]
Expand Down
11 changes: 8 additions & 3 deletions mssql/localization/xliff/vscode-mssql.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3061,9 +3061,10 @@
<trans-unit id="++CODE++26b4293018ea72418733109f2e245387d9dfcfe7d4083c0c1f29eb1155c98365">
<source xml:lang="en">Restore properties pane</source>
</trans-unit>
<trans-unit id="++CODE++5d7e64a2598658aaaf1674a1b6222a0f6ab5bb588831a51d0936879cbf88670c">
<source xml:lang="en">Result Set {0}</source>
<note>{0} is the index of the result set</note>
<trans-unit id="++CODE++a1519957e8b397de6037c8e8a9a1af37009bf6d89fa0f388b1e4b3dc76179e64">
<source xml:lang="en">Result Set Batch {0} - Query {1}</source>
<note>{0} is the batch number
{1} is the query number</note>
</trans-unit>
<trans-unit id="++CODE++219c4a6c86a716e99d5dc9611b61e584deb11b57e972d87d4b773387ebc3cadd">
<source xml:lang="en">Results</source>
Expand Down Expand Up @@ -3892,6 +3893,10 @@
<trans-unit id="++CODE++baaddf70fb5d432b8bd948ef91d6f910124a6d138edae4d5f000c4610ddc8eae">
<source xml:lang="en">Type</source>
</trans-unit>
<trans-unit id="++CODE++42e6c5ad1e91dbc1117d11a06c9c8e77abe8ab091d68d4447b85e9c124c3e0ee">
<source xml:lang="en">Unable to enforce default User Connections group: {0}</source>
<note>{0} is the error message</note>
</trans-unit>
<trans-unit id="++CODE++e395097d9cde221cdb9af8b04e1073d0d3394439fce660d1c954d012cdeae6c1">
<source xml:lang="en">Unable to execute the command while the extension is initializing. Please try again later.</source>
</trans-unit>
Expand Down
21 changes: 21 additions & 0 deletions mssql/src/connectionconfig/connectionDialogWebviewController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,23 @@ export class ConnectionDialogWebviewController extends FormWebviewController<
this.state.connectionProfile.groupId = initialConnectionGroup.id;
}

// Enforce default group selection: if groupId is missing or points to ROOT, set to User Connections
try {
const rootGroupId = this._mainController.connectionManager.connectionStore.rootGroupId;
if (
!this.state.connectionProfile.groupId ||
this.state.connectionProfile.groupId === rootGroupId
) {
const userGroupId =
this._mainController.connectionManager.connectionStore.connectionConfig.getUserConnectionsGroupId();
if (userGroupId) {
this.state.connectionProfile.groupId = userGroupId;
}
}
} catch (err) {
this.logger.error(Loc.unableToEnforceDefaultUserConnectionsGroup(getErrorMessage(err)));
}

await this.updateItemVisibility();
}

Expand Down Expand Up @@ -1080,6 +1097,10 @@ export class ConnectionDialogWebviewController extends FormWebviewController<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
cleanedConnection as any,
);
// Refresh the Object Explorer tree to include new connections/groups
if (self._objectExplorerProvider?.objectExplorerService?.refreshTree) {
await self._objectExplorerProvider.objectExplorerService.refreshTree();
}
const node =
await self._mainController.createObjectExplorerSession(cleanedConnection);
await self.updateLoadedConnections(state);
Expand Down
Loading