Skip to content

Commit 9dffc81

Browse files
committed
added displayName for MRU list to avoid setting profileName unexpectedly
1 parent 0c22ba7 commit 9dffc81

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/connectionconfig/connectionDialogWebViewController.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ export class ConnectionDialogWebViewController extends ReactWebViewPanelControll
139139
}
140140

141141
const dialogConnection = connection as IConnectionDialogProfile;
142-
// Set the profile name
143-
dialogConnection.profileName = dialogConnection.profileName ?? getConnectionDisplayName(connection);
142+
// Set the display name
143+
dialogConnection.displayName = dialogConnection.profileName ? dialogConnection.profileName : getConnectionDisplayName(connection);
144144
return dialogConnection;
145145
}
146146

src/reactviews/pages/ConnectionDialog/mruConnectionsContainer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const MruConnectionsContainer = () => {
5454
connectionDialogContext.loadConnection(connection);
5555
}}>
5656
<TreeItemLayout iconBefore={<ServerRegular />}>
57-
{connection.profileName}
57+
{connection.displayName}
5858
</TreeItemLayout>
5959
</TreeItem>;
6060
})

src/sharedInterfaces/connectionDialog.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ export interface IConnectionDialogProfile extends vscodeMssql.IConnectionInfo {
6666
savePassword?: boolean;
6767
emptyPasswordInput?: boolean;
6868
azureAuthType?: vscodeMssql.AzureAuthType;
69+
/** display name for the MRU pane; should be set to the profileName if available, otherwise generated from connection details */
70+
displayName?: string;
6971
}
7072

71-
72-
7373
export interface ConnectionDialogContextProps extends FormContextProps<ConnectionDialogWebviewState, IConnectionDialogProfile> {
7474
theme: Theme;
7575
loadConnection: (connection: IConnectionDialogProfile) => void;

0 commit comments

Comments
 (0)