feat(configmanager): add ConnectionStrings editor with test connection support

Adds a new ConnectionStrings section to ConfigManager allowing users to manage
database connection strings with provider selection, connection testing, and
visual feedback for connection state.
This commit is contained in:
Joseph Doherty
2026-01-22 11:12:08 -05:00
parent 9bf0c29add
commit db663cc82d
20 changed files with 2508 additions and 2 deletions
@@ -25,6 +25,7 @@ public class MainWindowViewModel : ViewModelBase
private readonly ISecureStoreManager _secureStoreManager;
private readonly IClipboardService _clipboardService;
private readonly IRuntimeConfigValidationService _runtimeValidationService;
private readonly IConnectionTestService _connectionTestService;
private readonly ILogger<MainWindowViewModel>? _logger;
private string _configFolderPath = "No folder selected";
@@ -203,6 +204,7 @@ public class MainWindowViewModel : ViewModelBase
ISecureStoreManager secureStoreManager,
IClipboardService clipboardService,
IRuntimeConfigValidationService runtimeValidationService,
IConnectionTestService connectionTestService,
ILogger<MainWindowViewModel>? logger)
{
_fileSystem = fileSystem;
@@ -214,6 +216,7 @@ public class MainWindowViewModel : ViewModelBase
_secureStoreManager = secureStoreManager;
_clipboardService = clipboardService;
_runtimeValidationService = runtimeValidationService;
_connectionTestService = connectionTestService;
_logger = logger;
OpenFolderCommand = new AsyncRelayCommand(OpenFolderAsync);
@@ -257,6 +260,7 @@ public class MainWindowViewModel : ViewModelBase
new SecureStoreManager(),
new NullClipboardService(),
new RuntimeConfigValidationService(new SecureStoreManager()),
new ConnectionTestService(),
null)
{
}
@@ -457,6 +461,7 @@ public class MainWindowViewModel : ViewModelBase
settingsFolder.Children.Add(new TreeNodeViewModel("Ldap", "👥", TreeNodeType.SettingsSection) { SectionKey = "Ldap" });
settingsFolder.Children.Add(new TreeNodeViewModel("Search", "🔍", TreeNodeType.SettingsSection) { SectionKey = "Search" });
settingsFolder.Children.Add(new TreeNodeViewModel("ExcelExport", "📊", TreeNodeType.SettingsSection) { SectionKey = "ExcelExport" });
settingsFolder.Children.Add(new TreeNodeViewModel("ConnectionStrings", "🔗", TreeNodeType.SettingsSection) { SectionKey = "ConnectionStrings" });
TreeNodes.Add(settingsFolder);
// Pipelines folder
@@ -563,6 +568,11 @@ public class MainWindowViewModel : ViewModelBase
"Ldap" => new LdapFormViewModel(_appSettings.Ldap, MarkAsChanged),
"Search" => new SearchFormViewModel(_appSettings.Search, MarkAsChanged),
"ExcelExport" => new ExcelExportFormViewModel(_appSettings.ExcelExport, MarkAsChanged),
"ConnectionStrings" when _dialogService != null => new ConnectionStringsFormViewModel(
_appSettings.ConnectionStrings,
MarkAsChanged,
_dialogService,
_connectionTestService),
_ when _selectedNode.NodeType == TreeNodeType.Pipeline && _pipelines != null
=> _pipelines.Pipelines.TryGetValue(_selectedNode.SectionKey!, out var pipeline)
? new PipelineEditorViewModel(_selectedNode.SectionKey!, pipeline, GetAvailableConnections(), MarkAsChanged)