mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 09:35:38 -05:00
Edit Connection Feature added, edit existing connection in connection tree. (#10214)
* Added Edit Connection Command * Wip changes for new connection dialog * Testing * WIP commit * added ID check to ensure connection * wip commit * model id check implemented * addfooterbutton now accepts events * wip commit * message explaining check * temporary change * connectionManagementService restored * Revert "connectionManagementService restored" This reverts commit 9704a63184a06a33bee2648ef0a899229d117cc0. * formatting test * editConnection promise testing * edit existing connection command added * WIP Connection Edit * disconnect added to editConnection promise * WIP on editExistingConnection * changed isEdit to true * Amir/edit connection (#10112) * Get edit connection working * Delete unused code * check for isEdit as well * connection tree test added * WIP connection management tests * comment out test to find out what's wrong * fix for one error * added note about test skipped * changed signature of saveprofile * saveprofile fixed * wrote working test * added additional test * changed message * Fixes made * fix for matcher Co-authored-by: Amir Omidi <amomidi@microsoft.com>
This commit is contained in:
@@ -69,18 +69,23 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
this.options['databaseDisplayName'] = this.databaseName;
|
||||
}
|
||||
|
||||
public matches(other: interfaces.IConnectionProfile): boolean {
|
||||
return other
|
||||
&& this.providerName === other.providerName
|
||||
&& this.nullCheckEqualsIgnoreCase(this.serverName, other.serverName)
|
||||
&& this.nullCheckEqualsIgnoreCase(this.databaseName, other.databaseName)
|
||||
&& this.nullCheckEqualsIgnoreCase(this.userName, other.userName)
|
||||
&& this.nullCheckEqualsIgnoreCase(this.options['databaseDisplayName'], other.options['databaseDisplayName'])
|
||||
&& this.authenticationType === other.authenticationType
|
||||
&& this.groupId === other.groupId;
|
||||
public static matchesProfile(a: interfaces.IConnectionProfile, b: interfaces.IConnectionProfile): boolean {
|
||||
return a && b
|
||||
&& a.providerName === b.providerName
|
||||
&& ConnectionProfile.nullCheckEqualsIgnoreCase(a.serverName, b.serverName)
|
||||
&& ConnectionProfile.nullCheckEqualsIgnoreCase(a.databaseName, b.databaseName)
|
||||
&& ConnectionProfile.nullCheckEqualsIgnoreCase(a.userName, b.userName)
|
||||
&& ConnectionProfile.nullCheckEqualsIgnoreCase(a.options['databaseDisplayName'], b.options['databaseDisplayName'])
|
||||
&& a.authenticationType === b.authenticationType
|
||||
&& a.groupId === b.groupId;
|
||||
}
|
||||
|
||||
private nullCheckEqualsIgnoreCase(a: string, b: string) {
|
||||
public matches(other: interfaces.IConnectionProfile): boolean {
|
||||
return ConnectionProfile.matchesProfile(this, other);
|
||||
|
||||
}
|
||||
|
||||
private static nullCheckEqualsIgnoreCase(a: string, b: string) {
|
||||
let bothNull: boolean = !a && !b;
|
||||
return bothNull ? bothNull : equalsIgnoreCase(a, b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user