Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,17 @@
<RadioButton Content="Couchbase Server"
IsChecked="{Binding IsCouchbaseServer}"
Margin="0,0,0,8" />
<RadioButton Content="Couchbase Capella"
IsChecked="{Binding IsCouchbaseCapella}" />
<StackPanel Orientation="Horizontal">
<RadioButton Content="Couchbase Capella"
IsChecked="{Binding IsCouchbaseCapella}"
IsEnabled="False" />
<TextBlock Text="Coming Soon!"
FontSize="11"
FontStyle="Italic"
Foreground="{DynamicResource {x:Static vsshell:VsBrushes.GrayTextKey}}"
VerticalAlignment="Center"
Margin="8,0,0,0" />
</StackPanel>
</StackPanel>
</GroupBox>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,26 +240,28 @@ public ConnectionDialogViewModel(HashSet<string> existingConnectionNames = null,
_useSsl = existingConnection.UseSsl;

_password = CredentialManagerService.GetPassword(existingConnection.Id);

// Detect if it's Capella based on URL
if (!string.IsNullOrEmpty(_host) && _host.Contains(".cloud.couchbase.com"))
{
_isCouchbaseCapella = true;
_isCouchbaseServer = false;
}
}

TestConnectionCommand = new RelayCommand(async _ => await TestConnectionAsync(), CanTestConnection);
SaveCommand = new RelayCommand(_ => Save(), _ => CanSave());
CancelCommand = new RelayCommand(_ => Cancel());
}

private void DetectCapellaUrl()
private bool IsCapellaUrl(string host)
{
if (!string.IsNullOrEmpty(Host) && Host.Contains(".cloud.couchbase.com"))
if (string.IsNullOrEmpty(host))
{
IsCouchbaseCapella = true;
return false;
}

return host.Contains(".cloud.couchbase.com") ||
host.StartsWith("couchbases://", StringComparison.OrdinalIgnoreCase);
}

private void DetectCapellaUrl()
{
// Re-validate host when URL changes to show Capella error if needed
ValidateHost();
}

private void ValidateConnectionName()
Expand All @@ -285,6 +287,10 @@ private void ValidateHost()
{
HostError = "Host is required";
}
else if (IsCapellaUrl(Host))
{
HostError = "Couchbase Capella connections are not supported yet";
}
else
{
HostError = null;
Expand Down