diff --git a/NEW/src/JdeScoping.Client/Pages/DataSync/DataSyncRequests.razor.cs b/NEW/src/JdeScoping.Client/Pages/DataSync/DataSyncRequests.razor.cs index 567a89d..57e4bdc 100644 --- a/NEW/src/JdeScoping.Client/Pages/DataSync/DataSyncRequests.razor.cs +++ b/NEW/src/JdeScoping.Client/Pages/DataSync/DataSyncRequests.razor.cs @@ -47,6 +47,7 @@ public partial class DataSyncRequests : ComponentBase /// /// Loads initial data when the component is initialized. /// + /// protected override async Task OnInitializedAsync() { await LoadPipelinesAsync(); diff --git a/NEW/src/JdeScoping.DataSync/Etl/Transformers/TransformingDataReader.cs b/NEW/src/JdeScoping.DataSync/Etl/Transformers/TransformingDataReader.cs index 2ca55dc..356f251 100644 --- a/NEW/src/JdeScoping.DataSync/Etl/Transformers/TransformingDataReader.cs +++ b/NEW/src/JdeScoping.DataSync/Etl/Transformers/TransformingDataReader.cs @@ -64,18 +64,20 @@ internal sealed class TransformingDataReader : IDataReader public bool IsDBNull(int i) => _transformer.IsDBNull(i, _source); /// - /// Gets the value of the column at the specified ordinal, applying transformations. + /// Gets the value of the column at the specified ordinal. /// - /// The zero-based column ordinal. - /// The transformed value of the column. - public object this[int i] => GetValue(i); + public object this[int i] + { + get => GetValue(i); + } /// - /// Gets the value of the column with the specified name, applying transformations. + /// Gets the value of the column with the specified name. /// - /// The name of the column. - /// The transformed value of the column. - public object this[string name] => GetValue(GetOrdinal(name)); + public object this[string name] + { + get => GetValue(GetOrdinal(name)); + } // Row navigation - delegated directly to source /// diff --git a/NEW/src/JdeScoping.DataSync/Models/DataUpdateTask.cs b/NEW/src/JdeScoping.DataSync/Models/DataUpdateTask.cs index 5c3d593..ac523fd 100644 --- a/NEW/src/JdeScoping.DataSync/Models/DataUpdateTask.cs +++ b/NEW/src/JdeScoping.DataSync/Models/DataUpdateTask.cs @@ -63,6 +63,9 @@ public class DataUpdateTask /// /// Creates a DataUpdateTask from an EtlPipelineConfig. /// + /// The ETL pipeline configuration. + /// The type of update (Mass, Daily, or Hourly). + /// Optional minimum datetime for incremental updates. public static DataUpdateTask FromPipeline( EtlPipelineConfig pipeline, UpdateTypes updateType, diff --git a/NEW/src/JdeScoping.DataSync/Services/PipelineRegistry.cs b/NEW/src/JdeScoping.DataSync/Services/PipelineRegistry.cs index 2bca478..28f65c7 100644 --- a/NEW/src/JdeScoping.DataSync/Services/PipelineRegistry.cs +++ b/NEW/src/JdeScoping.DataSync/Services/PipelineRegistry.cs @@ -46,6 +46,10 @@ public class PipelineRegistry : IPipelineRegistry /// /// Initializes a new instance of the class. /// + /// Data sync configuration options. + /// Pipeline configuration validator. + /// Logger instance for diagnostics. + /// Host environment information. public PipelineRegistry( IOptions options, IPipelineValidator validator, diff --git a/NEW/src/JdeScoping.DataSync/Services/PipelineRegistryInitializer.cs b/NEW/src/JdeScoping.DataSync/Services/PipelineRegistryInitializer.cs index e1ee16e..8e09222 100644 --- a/NEW/src/JdeScoping.DataSync/Services/PipelineRegistryInitializer.cs +++ b/NEW/src/JdeScoping.DataSync/Services/PipelineRegistryInitializer.cs @@ -19,6 +19,10 @@ public class PipelineRegistryInitializer : IHostedService /// /// Initializes a new instance of the class. /// + /// The pipeline registry to initialize. + /// Data sync configuration options. + /// Application lifetime management. + /// Logger instance for diagnostics. public PipelineRegistryInitializer( IPipelineRegistry registry, IOptions options, diff --git a/NEW/src/JdeScoping.Host/JdeScoping.Host.csproj b/NEW/src/JdeScoping.Host/JdeScoping.Host.csproj index 120e6ce..4653504 100644 --- a/NEW/src/JdeScoping.Host/JdeScoping.Host.csproj +++ b/NEW/src/JdeScoping.Host/JdeScoping.Host.csproj @@ -16,10 +16,6 @@ - - - - net10.0 enable diff --git a/NEW/src/JdeScoping.Infrastructure/Validation/ConnectionStringValidator.cs b/NEW/src/JdeScoping.Infrastructure/Validation/ConnectionStringValidator.cs index 3235ce2..038d42f 100644 --- a/NEW/src/JdeScoping.Infrastructure/Validation/ConnectionStringValidator.cs +++ b/NEW/src/JdeScoping.Infrastructure/Validation/ConnectionStringValidator.cs @@ -20,6 +20,12 @@ public class ConnectionStringValidator : IConfigurationValidator /// public string Name => "ConnectionStrings"; + /// + /// Initializes a new instance of the class. + /// + /// Application configuration. + /// Service for retrieving encrypted connection strings. + /// Logger instance for diagnostics. public ConnectionStringValidator( IConfiguration configuration, ISecureStoreService secureStore, diff --git a/NEW/src/JdeScoping.Infrastructure/Validation/LdapOptionsValidator.cs b/NEW/src/JdeScoping.Infrastructure/Validation/LdapOptionsValidator.cs index ad11cf5..fb456e4 100644 --- a/NEW/src/JdeScoping.Infrastructure/Validation/LdapOptionsValidator.cs +++ b/NEW/src/JdeScoping.Infrastructure/Validation/LdapOptionsValidator.cs @@ -19,6 +19,11 @@ public class LdapOptionsValidator : IConfigurationValidator /// public string Name => "LdapOptions"; + /// + /// Initializes a new instance of the class. + /// + /// LDAP configuration options. + /// Logger instance for diagnostics. public LdapOptionsValidator( IOptions options, ILogger logger) diff --git a/NEW/src/JdeScoping.Infrastructure/Validation/SecureStoreValidator.cs b/NEW/src/JdeScoping.Infrastructure/Validation/SecureStoreValidator.cs index 1e0fcb8..ad9b1ce 100644 --- a/NEW/src/JdeScoping.Infrastructure/Validation/SecureStoreValidator.cs +++ b/NEW/src/JdeScoping.Infrastructure/Validation/SecureStoreValidator.cs @@ -21,6 +21,12 @@ public class SecureStoreValidator : IConfigurationValidator /// public string Name => "SecureStore"; + /// + /// Initializes a new instance of the class. + /// + /// Service for retrieving encrypted secrets. + /// SecureStore configuration options. + /// Logger instance for diagnostics. public SecureStoreValidator( ISecureStoreService secureStore, IOptions options, diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/App.axaml b/NEW/src/Utils/JdeScoping.ConfigManager/App.axaml index 9904d30..aad3c5c 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/App.axaml +++ b/NEW/src/Utils/JdeScoping.ConfigManager/App.axaml @@ -3,9 +3,10 @@ xmlns:converters="clr-namespace:JdeScoping.ConfigManager.Converters" x:Class="JdeScoping.ConfigManager.App" RequestedThemeVariant="Dark"> - - - + + + + diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Converters/ProviderToVisibilityConverter.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Converters/ProviderToVisibilityConverter.cs index 5d0d44b..a6660a2 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Converters/ProviderToVisibilityConverter.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Converters/ProviderToVisibilityConverter.cs @@ -38,6 +38,11 @@ public class ProviderToVisibilityConverter : IValueConverter /// /// Converts a ConnectionProvider to a boolean indicating visibility. /// + /// The ConnectionProvider value to convert. + /// The target type (bool). + /// Unused converter parameter. + /// The culture for conversion. + /// True if the value matches the target provider; otherwise, false. public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { if (value is ConnectionProvider provider) @@ -50,6 +55,11 @@ public class ProviderToVisibilityConverter : IValueConverter /// /// Not implemented - this is a one-way converter. /// + /// The value to convert back. + /// The target type. + /// Unused converter parameter. + /// The culture for conversion. + /// This converter does not support reverse conversion. public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) { throw new NotImplementedException(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringEntry.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringEntry.cs index d0c2752..f64bbde 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringEntry.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringEntry.cs @@ -5,25 +5,74 @@ namespace JdeScoping.ConfigManager.Models; /// public class ConnectionStringEntry { + /// + /// Gets or sets the name of this connection string entry. + /// public string Name { get; set; } = string.Empty; + + /// + /// Gets or sets the database provider type for this connection. + /// public ConnectionProvider Provider { get; set; } = ConnectionProvider.Generic; - // SqlServer fields + /// + /// Gets or sets the SQL Server server name or address. + /// public string? Server { get; set; } + + /// + /// Gets or sets the SQL Server database name. + /// public string? Database { get; set; } + + /// + /// Gets or sets the user ID for database authentication. + /// public string? UserId { get; set; } + + /// + /// Gets or sets the password for database authentication. + /// public string? Password { get; set; } + + /// + /// Gets or sets the encryption setting for SQL Server connection ("True" or "False"). + /// public string Encrypt { get; set; } = "True"; + + /// + /// Gets or sets a value indicating whether to trust server certificate for SQL Server. + /// public bool TrustServerCertificate { get; set; } + + /// + /// Gets or sets the connection timeout in seconds for SQL Server. + /// public int ConnectionTimeout { get; set; } = 30; + + /// + /// Gets or sets the application name for SQL Server connection identification. + /// public string? ApplicationName { get; set; } - // Oracle fields + /// + /// Gets or sets the Oracle server host name or address. + /// public string? Host { get; set; } + + /// + /// Gets or sets the Oracle server port number. + /// public int Port { get; set; } = 1521; + + /// + /// Gets or sets the Oracle service name. + /// public string? ServiceName { get; set; } - // Generic fields + /// + /// Gets or sets the raw connection string for Generic provider type. + /// public string? RawConnectionString { get; set; } /// diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringsSection.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringsSection.cs index 65a1ea4..1cb59b7 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringsSection.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringsSection.cs @@ -9,5 +9,8 @@ namespace JdeScoping.ConfigManager.Models; [JsonConverter(typeof(ConnectionStringsSectionConverter))] public class ConnectionStringsSection { + /// + /// Gets or sets the list of connection string entries. + /// public List Entries { get; set; } = new(); } diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringsSectionConverter.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringsSectionConverter.cs index 8d3c7f8..5c4f922 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringsSectionConverter.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Models/ConnectionStringsSectionConverter.cs @@ -19,6 +19,7 @@ namespace JdeScoping.ConfigManager.Models; /// public class ConnectionStringsSectionConverter : JsonConverter { + /// public override ConnectionStringsSection? Read( ref Utf8JsonReader reader, Type typeToConvert, @@ -61,18 +62,16 @@ public class ConnectionStringsSectionConverter : JsonConverter public override void Write( Utf8JsonWriter writer, ConnectionStringsSection value, @@ -95,23 +94,57 @@ public class ConnectionStringsSectionConverter : JsonConverter /// Parses a connection string and attempts to detect the provider type. /// - private static ConnectionStringEntry ParseConnectionString(string name, string connectionString) - { - var entry = new ConnectionStringEntry - { - Name = name, - RawConnectionString = connectionString - }; - - // Try to detect provider and parse structured fields - var parts = ParseConnectionStringParts(connectionString); - - // Detect Oracle first (Data Source with host:port/service pattern) - if (parts.TryGetValue("data source", out var dataSource) && - IsOracleDataSource(dataSource)) - { - entry.Provider = ConnectionProvider.Oracle; - ParseOracleDataSource(entry, dataSource); + internal static ConnectionStringEntry ParseConnectionString(string name, string connectionString) + { + var entry = new ConnectionStringEntry + { + Name = name, + RawConnectionString = connectionString + }; + + // Try to detect provider and parse structured fields + var parts = ParseConnectionStringParts(connectionString); + + // Detect Oracle using HOST/Service Name/Port pattern (DDTek.Oracle style) + var hasHost = parts.TryGetValue("host", out var host); + var hasServiceName = parts.TryGetValue("service name", out var serviceName); + var hasPort = parts.TryGetValue("port", out var portText); + + if (hasHost || hasServiceName || hasPort) + { + entry.Provider = ConnectionProvider.Oracle; + + if (hasHost && !string.IsNullOrEmpty(host)) + { + entry.Host = host; + } + + if (hasServiceName && !string.IsNullOrEmpty(serviceName)) + { + entry.ServiceName = serviceName; + } + + if (hasPort && !string.IsNullOrEmpty(portText) && int.TryParse(portText, out var port)) + { + entry.Port = port; + } + + if (parts.TryGetValue("user id", out var oraUserId)) + { + entry.UserId = oraUserId; + } + + if (parts.TryGetValue("password", out var oraPassword)) + { + entry.Password = oraPassword; + } + } + // Detect Oracle first (Data Source with host:port/service pattern) + else if (parts.TryGetValue("data source", out var dataSource) && + IsOracleDataSource(dataSource)) + { + entry.Provider = ConnectionProvider.Oracle; + ParseOracleDataSource(entry, dataSource); if (parts.TryGetValue("user id", out var oraUserId)) { @@ -179,8 +212,27 @@ public class ConnectionStringsSectionConverter : JsonConverter /// Parses a connection string into key-value pairs. diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Services/ConnectionTestService.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Services/ConnectionTestService.cs index ff73e96..853d4fd 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Services/ConnectionTestService.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Services/ConnectionTestService.cs @@ -11,6 +11,13 @@ public class ConnectionTestService : IConnectionTestService { private const int ConnectionTimeoutSeconds = 10; + /// + /// Tests a database connection asynchronously. + /// + /// The connection string to test. + /// The database provider type. + /// Cancellation token for the operation. + /// A ConnectionTestResult indicating success or failure of the test. public async Task TestConnectionAsync( string connectionString, ConnectionProvider provider, diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Services/IConnectionTestService.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Services/IConnectionTestService.cs index 6e9655b..4964a6a 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Services/IConnectionTestService.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Services/IConnectionTestService.cs @@ -7,8 +7,19 @@ namespace JdeScoping.ConfigManager.Services; /// public class ConnectionTestResult { + /// + /// Gets a value indicating whether the connection test was successful. + /// public bool Success { get; init; } + + /// + /// Gets the message describing the result of the connection test. + /// public string Message { get; init; } = string.Empty; + + /// + /// Gets the elapsed time of the connection test operation. + /// public TimeSpan? Duration { get; init; } } @@ -17,5 +28,12 @@ public class ConnectionTestResult /// public interface IConnectionTestService { + /// + /// Tests a database connection asynchronously. + /// + /// The connection string to test. + /// The database provider type. + /// Cancellation token for the operation. + /// A ConnectionTestResult indicating success or failure of the test. Task TestConnectionAsync(string connectionString, ConnectionProvider provider, CancellationToken cancellationToken = default); } diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Dialogs/DiffPreviewDialogViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Dialogs/DiffPreviewDialogViewModel.cs index 940d958..4cbac97 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Dialogs/DiffPreviewDialogViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Dialogs/DiffPreviewDialogViewModel.cs @@ -11,6 +11,10 @@ public class DiffPreviewDialogViewModel : ViewModelBase { private bool _result; + /// + /// Initializes a new instance of the class. + /// + /// The diff result containing the changes to preview. public DiffPreviewDialogViewModel(DiffResult diff) { ArgumentNullException.ThrowIfNull(diff); @@ -25,19 +29,48 @@ public class DiffPreviewDialogViewModel : ViewModelBase CancelCommand = new RelayCommand(() => { Result = false; RequestClose?.Invoke(); }); } + /// + /// Gets the collection of diff lines to display in the preview. + /// public ObservableCollection Lines { get; } + + /// + /// Gets the number of lines inserted in the diff. + /// public int Insertions { get; } + + /// + /// Gets the number of lines deleted in the diff. + /// public int Deletions { get; } + + /// + /// Gets a value indicating whether the diff contains any changes. + /// public bool HasChanges { get; } + /// + /// Gets or sets the dialog result (true if saved, false if canceled). + /// public bool Result { get => _result; private set => SetProperty(ref _result, value); } + /// + /// Gets the command to save the diff changes and close the dialog. + /// public ICommand SaveCommand { get; } + + /// + /// Gets the command to cancel and close the dialog without saving. + /// public ICommand CancelCommand { get; } + + /// + /// Gets or sets the action to request dialog closure. + /// public Action? RequestClose { get; set; } } @@ -46,6 +79,10 @@ public class DiffPreviewDialogViewModel : ViewModelBase /// public class DiffLineViewModel { + /// + /// Initializes a new instance of the class. + /// + /// The diff line data to represent. public DiffLineViewModel(DiffLine line) { OldLineNumber = line.OldLineNumber?.ToString() ?? ""; @@ -66,10 +103,33 @@ public class DiffLineViewModel }; } + /// + /// Gets the original line number (empty string if not applicable). + /// public string OldLineNumber { get; } + + /// + /// Gets the new line number (empty string if not applicable). + /// public string NewLineNumber { get; } + + /// + /// Gets the text content of the diff line. + /// public string Text { get; } + + /// + /// Gets the type of diff line (added, removed, or context). + /// public DiffLineType Type { get; } + + /// + /// Gets the background color for the diff line visualization. + /// public string Background { get; } + + /// + /// Gets the border color for the diff line visualization. + /// public string BorderColor { get; } } diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/AuthFormViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/AuthFormViewModel.cs index eb4c81d..7de2382 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/AuthFormViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/AuthFormViewModel.cs @@ -10,6 +10,11 @@ public class AuthFormViewModel : ViewModelBase private readonly AuthSection _model; private readonly Action _onChanged; + /// + /// Initializes a new instance of the class. + /// + /// The auth section model to edit. + /// The callback to invoke when configuration changes. public AuthFormViewModel(AuthSection model, Action onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/ConnectionStringsFormViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/ConnectionStringsFormViewModel.cs index 7dd399d..7494ad9 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/ConnectionStringsFormViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/ConnectionStringsFormViewModel.cs @@ -52,11 +52,10 @@ public class ConnectionStringsFormViewModel : ViewModelBase : null; // Update entry's RawConnectionString with SecureStore value if available - if (!string.IsNullOrEmpty(secureStoreValue)) - { - entry.RawConnectionString = secureStoreValue; - entry.Provider = ConnectionProvider.Generic; // Use Generic since we have the full string - } + if (!string.IsNullOrEmpty(secureStoreValue)) + { + ConnectionStringsSectionConverter.ApplyConnectionString(entry, secureStoreValue); + } Connections.Add(new ConnectionStringEntryViewModel(entry, OnEntryChanged)); } diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/DataAccessFormViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/DataAccessFormViewModel.cs index 0b37dd3..c9f8b35 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/DataAccessFormViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/DataAccessFormViewModel.cs @@ -10,6 +10,11 @@ public class DataAccessFormViewModel : ViewModelBase private readonly DataAccessSection _model; private readonly Action _onChanged; + /// + /// Initializes a new instance of the class. + /// + /// The data access section model to edit. + /// The callback to invoke when configuration changes. public DataAccessFormViewModel(DataAccessSection model, Action onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/DataSyncFormViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/DataSyncFormViewModel.cs index a42e415..efd67c7 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/DataSyncFormViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/DataSyncFormViewModel.cs @@ -10,6 +10,11 @@ public class DataSyncFormViewModel : ViewModelBase private readonly DataSyncSection _model; private readonly Action _onChanged; + /// + /// Initializes a new instance of the class. + /// + /// The data sync section model to edit. + /// The callback to invoke when configuration changes. public DataSyncFormViewModel(DataSyncSection model, Action onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/ExcelExportFormViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/ExcelExportFormViewModel.cs index 9b99de5..3fd15a7 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/ExcelExportFormViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/ExcelExportFormViewModel.cs @@ -21,6 +21,11 @@ public class ExcelExportFormViewModel : ViewModelBase .ToList() .AsReadOnly(); + /// + /// Initializes a new instance of the class. + /// + /// The excel export section model to edit. + /// The callback to invoke when configuration changes. public ExcelExportFormViewModel(ExcelExportSection model, Action onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/LdapFormViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/LdapFormViewModel.cs index 8c69507..3c8e520 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/LdapFormViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/LdapFormViewModel.cs @@ -10,6 +10,11 @@ public class LdapFormViewModel : ViewModelBase private readonly LdapSection _model; private readonly Action _onChanged; + /// + /// Initializes a new instance of the class. + /// + /// The LDAP section model to edit. + /// The callback to invoke when configuration changes. public LdapFormViewModel(LdapSection model, Action onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/PipelineEditorViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/PipelineEditorViewModel.cs index 0f19c2b..8ebef3c 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/PipelineEditorViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/PipelineEditorViewModel.cs @@ -17,6 +17,14 @@ public class PipelineEditorViewModel : ViewModelBase private PipelineStepViewModelBase? _selectedStep; private object? _selectedStepEditor; + /// + /// Initializes a new instance of the class. + /// + /// The pipeline name. + /// The pipeline configuration model. + /// List of available connection names from configuration. + /// Service for showing dialogs. + /// Callback invoked when the pipeline configuration changes. public PipelineEditorViewModel(string name, EtlPipelineConfig model, IReadOnlyList availableConnections, IDialogService dialogService, Action onChanged) { Name = name ?? throw new ArgumentNullException(nameof(name)); @@ -318,14 +326,49 @@ public class PipelineEditorViewModel : ViewModelBase } // Commands + /// + /// Gets the command to add a pre-script step. + /// public ICommand AddPreScriptCommand { get; } + + /// + /// Gets the command to add a transformer step. + /// public ICommand AddTransformerCommand { get; } + + /// + /// Gets the command to add a post-script step. + /// public ICommand AddPostScriptCommand { get; } + + /// + /// Gets the command to remove a pipeline step. + /// public ICommand RemoveStepCommand { get; } + + /// + /// Gets the command to delete the currently selected step. + /// public ICommand DeleteSelectedStepCommand { get; } + + /// + /// Gets the command to move a step up in its collection. + /// public ICommand MoveStepUpCommand { get; } + + /// + /// Gets the command to move a step down in its collection. + /// public ICommand MoveStepDownCommand { get; } + + /// + /// Gets the command to move the selected step up. + /// public ICommand MoveSelectedStepUpCommand { get; } + + /// + /// Gets the command to move the selected step down. + /// public ICommand MoveSelectedStepDownCommand { get; } /// @@ -333,10 +376,11 @@ public class PipelineEditorViewModel : ViewModelBase /// public IReadOnlyList AvailableTransformerTypes => TransformerFactory.AvailableTypes; - /// - /// Property to track selected transformer type for adding. - /// private string? _selectedTransformerType; + + /// + /// Gets or sets the selected transformer type for adding a new transformer. + /// public string? SelectedTransformerType { get => _selectedTransformerType; @@ -438,6 +482,7 @@ public class PipelineEditorViewModel : ViewModelBase /// /// Adds a specific transformer type. /// + /// The name of the transformer type to add. public void AddTransformerOfType(string typeName) { var vm = TransformerFactory.CreateNew(typeName, () => diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/SearchFormViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/SearchFormViewModel.cs index e2f6d20..60d00e8 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/SearchFormViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/Forms/SearchFormViewModel.cs @@ -10,6 +10,11 @@ public class SearchFormViewModel : ViewModelBase private readonly SearchSection _model; private readonly Action _onChanged; + /// + /// Initializes a new instance of the class. + /// + /// The search section model to edit. + /// The callback to invoke when configuration changes. public SearchFormViewModel(SearchSection model, Action onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/MainWindowViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/MainWindowViewModel.cs index 0ddc68e..27f89f7 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/MainWindowViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/MainWindowViewModel.cs @@ -194,6 +194,7 @@ public class MainWindowViewModel : ViewModelBase /// Service for managing encrypted secret stores. /// Service for clipboard operations. /// Service for runtime configuration validation. + /// Service for testing database connections. /// Optional logger for recording view model activities. public MainWindowViewModel( IFileSystem fileSystem, @@ -271,6 +272,11 @@ public class MainWindowViewModel : ViewModelBase /// private class NullClipboardService : IClipboardService { + /// + /// Sets text to clipboard (no-op for design-time). + /// + /// The text to set (ignored in this implementation). + /// A completed task. public Task SetTextAsync(string text) => Task.CompletedTask; } diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/DestinationStepViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/DestinationStepViewModel.cs index 4fcd49d..16b3826 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/DestinationStepViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/DestinationStepViewModel.cs @@ -9,14 +9,26 @@ public class DestinationStepViewModel : PipelineStepViewModelBase { private readonly DestinationElement _model; + /// + /// Initializes a new instance of the class. + /// + /// The destination configuration model. + /// Callback invoked when the destination configuration changes. public DestinationStepViewModel(DestinationElement model, Action onChanged) : base(onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); } + /// public override PipelineStepType StepType => PipelineStepType.Destination; + + /// public override string DisplayName => "Destination"; + + /// public override string Icon => "󰆼"; // mdi-database + + /// public override string Summary => !string.IsNullOrEmpty(Table) ? $"→ {Table}" : "(no table)"; /// diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/PipelineStepViewModelBase.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/PipelineStepViewModelBase.cs index 5343815..3440264 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/PipelineStepViewModelBase.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/PipelineStepViewModelBase.cs @@ -23,6 +23,10 @@ public abstract class PipelineStepViewModelBase : ViewModelBase private bool _isSelected; private readonly Action _onChanged; + /// + /// Initializes a new instance of the class. + /// + /// Callback invoked when the step changes. protected PipelineStepViewModelBase(Action onChanged) { _onChanged = onChanged ?? throw new ArgumentNullException(nameof(onChanged)); @@ -73,6 +77,11 @@ public class PreScriptStepViewModel : PipelineStepViewModelBase { private readonly ScriptElement _model; + /// + /// Initializes a new instance of the class with an existing script. + /// + /// The script element to wrap. + /// Callback invoked when the script changes. public PreScriptStepViewModel(ScriptElement model, Action onChanged) : base(onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); @@ -81,14 +90,19 @@ public class PreScriptStepViewModel : PipelineStepViewModelBase /// /// Creates a new pre-script with default values. /// + /// Callback invoked when the script changes. public PreScriptStepViewModel(Action onChanged) : base(onChanged) { _model = new ScriptElement { Connection = "lotfinder", Script = string.Empty }; } + /// public override PipelineStepType StepType => PipelineStepType.PreScript; + /// public override string DisplayName => "Pre-Script"; + /// public override string Icon => "󰯂"; // mdi-script-text + /// public override string Summary => TruncateScript(_model.Script); /// @@ -146,6 +160,11 @@ public class PostScriptStepViewModel : PipelineStepViewModelBase { private readonly ScriptElement _model; + /// + /// Initializes a new instance of the class with an existing script. + /// + /// The script element to wrap. + /// Callback invoked when the script changes. public PostScriptStepViewModel(ScriptElement model, Action onChanged) : base(onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); @@ -154,14 +173,19 @@ public class PostScriptStepViewModel : PipelineStepViewModelBase /// /// Creates a new post-script with default values. /// + /// Callback invoked when the script changes. public PostScriptStepViewModel(Action onChanged) : base(onChanged) { _model = new ScriptElement { Connection = "lotfinder", Script = string.Empty }; } + /// public override PipelineStepType StepType => PipelineStepType.PostScript; + /// public override string DisplayName => "Post-Script"; + /// public override string Icon => "󰯂"; // mdi-script-text + /// public override string Summary => TruncateScript(_model.Script); /// diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/SourceStepViewModel.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/SourceStepViewModel.cs index 091382a..cf593ea 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/SourceStepViewModel.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/SourceStepViewModel.cs @@ -11,6 +11,12 @@ public class SourceStepViewModel : PipelineStepViewModelBase { private readonly SourceElement _model; + /// + /// Initializes a new instance of the class. + /// + /// The source configuration model. + /// List of available connection names from configuration. + /// Callback invoked when the source configuration changes. public SourceStepViewModel(SourceElement model, IReadOnlyList availableConnections, Action onChanged) : base(onChanged) { _model = model ?? throw new ArgumentNullException(nameof(model)); @@ -33,9 +39,16 @@ public class SourceStepViewModel : PipelineStepViewModelBase /// public IReadOnlyList AvailableConnections { get; } + /// public override PipelineStepType StepType => PipelineStepType.Source; + + /// public override string DisplayName => "Source"; + + /// public override string Icon => "󰆼"; // mdi-database + + /// public override string Summary => $"{Connection}: {TruncateQuery(Query)}"; /// @@ -121,6 +134,7 @@ public class SourceStepViewModel : PipelineStepViewModelBase /// /// Removes a parameter. /// + /// The parameter view model to remove. public void RemoveParameter(ParameterViewModel parameter) { if (Parameters.Remove(parameter)) @@ -159,6 +173,12 @@ public class ParameterViewModel : ViewModelBase private string? _value; private readonly Action _onChanged; + /// + /// Initializes a new instance of the class. + /// + /// The parameter key used in the dictionary. + /// The parameter configuration model. + /// Callback invoked when the parameter changes. public ParameterViewModel(string key, ParameterElement model, Action onChanged) { _key = key; diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/TransformerStepViewModels.cs b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/TransformerStepViewModels.cs index c33aa46..456a352 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/TransformerStepViewModels.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/ViewModels/PipelineSteps/TransformerStepViewModels.cs @@ -16,11 +16,17 @@ public abstract class TransformerStepViewModelBase : PipelineStepViewModelBase PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; + /// + /// Initializes a new instance of the class. + /// + /// Callback invoked when the transformer changes. protected TransformerStepViewModelBase(Action onChanged) : base(onChanged) { } + /// public override PipelineStepType StepType => PipelineStepType.Transformer; + /// public override string Icon => "󰁖"; // mdi-cog-transfer /// @@ -36,6 +42,8 @@ public abstract class TransformerStepViewModelBase : PipelineStepViewModelBase /// /// Helper to create a JsonElement from an object. /// + /// The object to serialize into a JsonElement. + /// A JsonElement containing the serialized configuration. protected static JsonElement CreateConfigElement(object config) { var json = JsonSerializer.Serialize(config, JsonOptions); @@ -51,6 +59,11 @@ public class ColumnDropTransformerViewModel : TransformerStepViewModelBase { private string _columnsText; + /// + /// Initializes a new instance of the class with an existing configuration. + /// + /// The transform element containing the column configuration. + /// Callback invoked when the configuration changes. public ColumnDropTransformerViewModel(TransformElement element, Action onChanged) : base(onChanged) { _columnsText = string.Empty; @@ -65,13 +78,20 @@ public class ColumnDropTransformerViewModel : TransformerStepViewModelBase } } + /// + /// Initializes a new instance of the class with default values. + /// + /// Callback invoked when the configuration changes. public ColumnDropTransformerViewModel(Action onChanged) : base(onChanged) { _columnsText = string.Empty; } + /// public override string TransformerType => "ColumnDrop"; + /// public override string DisplayName => "Column Drop"; + /// public override string Summary => GetColumnCount() > 0 ? $"Drop {GetColumnCount()} columns" : "No columns"; /// @@ -103,6 +123,7 @@ public class ColumnDropTransformerViewModel : TransformerStepViewModelBase return _columnsText.Split('\n', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).Length; } + /// public override TransformElement ToModel() => new() { TransformType = TransformerType, @@ -115,6 +136,11 @@ public class ColumnDropTransformerViewModel : TransformerStepViewModelBase /// public class ColumnRenameTransformerViewModel : TransformerStepViewModelBase { + /// + /// Initializes a new instance of the class with an existing configuration. + /// + /// The transform element containing the mapping configuration. + /// Callback invoked when the configuration changes. public ColumnRenameTransformerViewModel(TransformElement element, Action onChanged) : base(onChanged) { Mappings = []; @@ -137,14 +163,21 @@ public class ColumnRenameTransformerViewModel : TransformerStepViewModelBase AddMappingCommand = new RelayCommand(AddMapping); } + /// + /// Initializes a new instance of the class with default values. + /// + /// Callback invoked when the configuration changes. public ColumnRenameTransformerViewModel(Action onChanged) : base(onChanged) { Mappings = []; AddMappingCommand = new RelayCommand(AddMapping); } + /// public override string TransformerType => "ColumnRename"; + /// public override string DisplayName => "Column Rename"; + /// public override string Summary => Mappings.Count > 0 ? $"Rename {Mappings.Count} columns" : "No mappings"; /// @@ -174,6 +207,7 @@ public class ColumnRenameTransformerViewModel : TransformerStepViewModelBase /// /// Removes a mapping. /// + /// The column mapping to remove. public void RemoveMapping(ColumnMappingViewModel mapping) { if (Mappings.Remove(mapping)) @@ -183,6 +217,7 @@ public class ColumnRenameTransformerViewModel : TransformerStepViewModelBase } } + /// public override TransformElement ToModel() => new() { TransformType = TransformerType, @@ -199,6 +234,12 @@ public class ColumnMappingViewModel : ViewModelBase private string _newName; private readonly Action _onChanged; + /// + /// Initializes a new instance of the class. + /// + /// The original column name. + /// The new column name. + /// Callback invoked when the mapping changes. public ColumnMappingViewModel(string oldName, string newName, Action onChanged) { _oldName = oldName; @@ -242,6 +283,11 @@ public class JdeDateTransformerViewModel : TransformerStepViewModelBase private string? _timeColumn; private string? _outputColumn; + /// + /// Initializes a new instance of the class from a TransformElement. + /// + /// The transform element containing date/time column configuration. + /// Callback invoked when the configuration changes. public JdeDateTransformerViewModel(TransformElement element, Action onChanged) : base(onChanged) { _dateColumn = null; @@ -259,6 +305,10 @@ public class JdeDateTransformerViewModel : TransformerStepViewModelBase } } + /// + /// Initializes a new instance of the class with default values. + /// + /// Callback invoked when the configuration changes. public JdeDateTransformerViewModel(Action onChanged) : base(onChanged) { _dateColumn = null; @@ -266,9 +316,13 @@ public class JdeDateTransformerViewModel : TransformerStepViewModelBase _outputColumn = null; } + /// public override string TransformerType => "JdeDate"; + /// public override string DisplayName => "JDE Date Convert"; + /// public override string Icon => "󰃭"; // mdi-calendar + /// public override string Summary => !string.IsNullOrEmpty(_outputColumn) ? $"→ {_outputColumn}" : "Configure..."; /// @@ -316,6 +370,7 @@ public class JdeDateTransformerViewModel : TransformerStepViewModelBase } } + /// public override TransformElement ToModel() => new() { TransformType = TransformerType, @@ -358,6 +413,11 @@ public class RegexTransformerViewModel : TransformerStepViewModelBase private bool _hasTestError; private string _testErrorMessage = string.Empty; + /// + /// Initializes a new instance of the class from a TransformElement. + /// + /// The transform element containing regex configuration. + /// Callback invoked when the configuration changes. public RegexTransformerViewModel(TransformElement element, Action onChanged) : base(onChanged) { _columnName = string.Empty; @@ -396,14 +456,22 @@ public class RegexTransformerViewModel : TransformerStepViewModelBase TestPatternCommand = new RelayCommand(ExecuteTestPattern); } + /// + /// Initializes a new instance of the class with default values. + /// + /// Callback invoked when the configuration changes. public RegexTransformerViewModel(Action onChanged) : base(onChanged) { TestPatternCommand = new RelayCommand(ExecuteTestPattern); } + /// public override string TransformerType => "Regex"; + /// public override string DisplayName => "Regex Transform"; + /// public override string Icon => "󰑑"; // mdi-regex + /// public override string Summary => !string.IsNullOrEmpty(_columnName) ? $"{_columnName}: {(_isFindReplaceMode ? "Replace" : "Extract")}" : "Configure..."; @@ -512,54 +580,81 @@ public class RegexTransformerViewModel : TransformerStepViewModelBase [NonMatchBehavior.KeepOriginal, NonMatchBehavior.ReturnNull, NonMatchBehavior.ReturnEmpty]; // Test feature properties + /// + /// Gets or sets the test input value for pattern testing. + /// public string TestInput { get => _testInput; set => SetProperty(ref _testInput, value ?? string.Empty); } + /// + /// Gets or sets the result value from pattern testing. + /// public string TestResultValue { get => _testResultValue; set => SetProperty(ref _testResultValue, value); } + /// + /// Gets or sets the label describing the test result (e.g., "Output" or "No Match"). + /// public string TestResultLabel { get => _testResultLabel; set => SetProperty(ref _testResultLabel, value); } + /// + /// Gets or sets the icon for the test result. + /// public string TestResultIcon { get => _testResultIcon; set => SetProperty(ref _testResultIcon, value); } + /// + /// Gets or sets the background color for the test result display. + /// public string TestResultBackground { get => _testResultBackground; set => SetProperty(ref _testResultBackground, value); } + /// + /// Gets or sets a value indicating whether a test result is available. + /// public bool HasTestResult { get => _hasTestResult; set => SetProperty(ref _hasTestResult, value); } + /// + /// Gets or sets a value indicating whether a test error occurred. + /// public bool HasTestError { get => _hasTestError; set => SetProperty(ref _hasTestError, value); } + /// + /// Gets or sets the error message from test execution. + /// public string TestErrorMessage { get => _testErrorMessage; set => SetProperty(ref _testErrorMessage, value); } + /// + /// Gets the command to execute pattern testing. + /// public ICommand TestPatternCommand { get; } private void ExecuteTestPattern() @@ -628,6 +723,7 @@ public class RegexTransformerViewModel : TransformerStepViewModelBase TestErrorMessage = string.Empty; } + /// public override TransformElement ToModel() => new() { TransformType = TransformerType, @@ -650,6 +746,9 @@ public static class TransformerFactory /// /// Creates a transformer view model from a TransformElement. /// + /// The transform element containing configuration. + /// Callback invoked when the view model changes. + /// A transformer view model of the appropriate type, or null if the transformer type is unknown. public static TransformerStepViewModelBase? Create(TransformElement element, Action onChanged) { return element.TransformType?.ToLowerInvariant() switch @@ -665,6 +764,9 @@ public static class TransformerFactory /// /// Creates a new transformer view model by type name. /// + /// The type name of the transformer to create. + /// Callback invoked when the view model changes. + /// A new transformer view model of the specified type, or null if the type name is unknown. public static TransformerStepViewModelBase? CreateNew(string typeName, Action onChanged) { return typeName?.ToLowerInvariant() switch diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Controls/FlowArrow.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Controls/FlowArrow.axaml.cs index b6a06ea..66356df 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Controls/FlowArrow.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Controls/FlowArrow.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Controls; public partial class FlowArrow : UserControl { + /// + /// Initializes a new instance of the class. + /// public FlowArrow() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Controls/PipelineStepCard.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Controls/PipelineStepCard.axaml.cs index 5353ed8..b02b815 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Controls/PipelineStepCard.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Controls/PipelineStepCard.axaml.cs @@ -12,6 +12,9 @@ public partial class PipelineStepCard : UserControl public static readonly StyledProperty StepColorProperty = AvaloniaProperty.Register(nameof(StepColor), "#3B82F6"); + /// + /// Initializes a new instance of the class. + /// public PipelineStepCard() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Dialogs/DiffPreviewDialog.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Dialogs/DiffPreviewDialog.axaml.cs index bc54e3b..c5cd9b1 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Dialogs/DiffPreviewDialog.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Dialogs/DiffPreviewDialog.axaml.cs @@ -5,11 +5,18 @@ namespace JdeScoping.ConfigManager.Views.Dialogs; public partial class DiffPreviewDialog : Window { + /// + /// Initializes a new instance of the class. + /// public DiffPreviewDialog() { InitializeComponent(); } + /// + /// Initializes a new instance of the class with a view model. + /// + /// The view model to bind to the dialog. public DiffPreviewDialog(DiffPreviewDialogViewModel viewModel) : this() { DataContext = viewModel; diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ColumnDropEditorView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ColumnDropEditorView.axaml.cs index bedf60c..a1ba56e 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ColumnDropEditorView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ColumnDropEditorView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Editors; public partial class ColumnDropEditorView : UserControl { + /// + /// Initializes a new instance of the class. + /// public ColumnDropEditorView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ColumnRenameEditorView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ColumnRenameEditorView.axaml.cs index 32b9d96..b2d4941 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ColumnRenameEditorView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ColumnRenameEditorView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Editors; public partial class ColumnRenameEditorView : UserControl { + /// + /// Initializes a new instance of the class. + /// public ColumnRenameEditorView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/DestinationEditorView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/DestinationEditorView.axaml.cs index 19799c8..1754b73 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/DestinationEditorView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/DestinationEditorView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Editors; public partial class DestinationEditorView : UserControl { + /// + /// Initializes a new instance of the class. + /// public DestinationEditorView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/JdeDateEditorView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/JdeDateEditorView.axaml.cs index 32496c9..24f23bb 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/JdeDateEditorView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/JdeDateEditorView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Editors; public partial class JdeDateEditorView : UserControl { + /// + /// Initializes a new instance of the class. + /// public JdeDateEditorView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/PostScriptEditorView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/PostScriptEditorView.axaml.cs index 07e5e6b..963d4ff 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/PostScriptEditorView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/PostScriptEditorView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Editors; public partial class PostScriptEditorView : UserControl { + /// + /// Initializes a new instance of the class. + /// public PostScriptEditorView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/RegexEditorView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/RegexEditorView.axaml.cs index aaa2c68..3a74a34 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/RegexEditorView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/RegexEditorView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Editors; public partial class RegexEditorView : UserControl { + /// + /// Initializes a new instance of the class. + /// public RegexEditorView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ScriptEditorView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ScriptEditorView.axaml.cs index 68702d8..445c136 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ScriptEditorView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/ScriptEditorView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Editors; public partial class ScriptEditorView : UserControl { + /// + /// Initializes a new instance of the class. + /// public ScriptEditorView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/SourceEditorView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/SourceEditorView.axaml.cs index cfcb66e..cfaa0d7 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/SourceEditorView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Editors/SourceEditorView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Editors; public partial class SourceEditorView : UserControl { + /// + /// Initializes a new instance of the class. + /// public SourceEditorView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/AuthFormView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/AuthFormView.axaml.cs index ccf52a7..6b46967 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/AuthFormView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/AuthFormView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class AuthFormView : UserControl { + /// + /// Initializes a new instance of the class. + /// public AuthFormView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ConnectionStringsFormView.axaml b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ConnectionStringsFormView.axaml index c1d50fe..3c02fd5 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ConnectionStringsFormView.axaml +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ConnectionStringsFormView.axaml @@ -279,71 +279,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ConnectionStringsFormView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ConnectionStringsFormView.axaml.cs index 0202f20..55e9a4e 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ConnectionStringsFormView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ConnectionStringsFormView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class ConnectionStringsFormView : UserControl { + /// + /// Initializes a new instance of the class. + /// public ConnectionStringsFormView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/DataAccessFormView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/DataAccessFormView.axaml.cs index 579df65..af4543d 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/DataAccessFormView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/DataAccessFormView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class DataAccessFormView : UserControl { + /// + /// Initializes a new instance of the class. + /// public DataAccessFormView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/DataSyncFormView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/DataSyncFormView.axaml.cs index fb0570e..57fc831 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/DataSyncFormView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/DataSyncFormView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class DataSyncFormView : UserControl { + /// + /// Initializes a new instance of the class. + /// public DataSyncFormView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ExcelExportFormView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ExcelExportFormView.axaml.cs index a9f3d7e..6f468c6 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ExcelExportFormView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/ExcelExportFormView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class ExcelExportFormView : UserControl { + /// + /// Initializes a new instance of the class. + /// public ExcelExportFormView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/LdapFormView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/LdapFormView.axaml.cs index cc3895f..f3f7376 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/LdapFormView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/LdapFormView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class LdapFormView : UserControl { + /// + /// Initializes a new instance of the class. + /// public LdapFormView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/PipelineEditorView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/PipelineEditorView.axaml.cs index 471f0e7..b4d97dc 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/PipelineEditorView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/PipelineEditorView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class PipelineEditorView : UserControl { + /// + /// Initializes a new instance of the class. + /// public PipelineEditorView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SearchFormView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SearchFormView.axaml.cs index 47cb8f8..6dced70 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SearchFormView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SearchFormView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class SearchFormView : UserControl { + /// + /// Initializes a new instance of the class. + /// public SearchFormView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SecretFormView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SecretFormView.axaml.cs index 4155096..103f27b 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SecretFormView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SecretFormView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class SecretFormView : UserControl { + /// + /// Initializes a new instance of the class. + /// public SecretFormView() { InitializeComponent(); diff --git a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SecureStoreInfoFormView.axaml.cs b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SecureStoreInfoFormView.axaml.cs index d318338..37149f4 100644 --- a/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SecureStoreInfoFormView.axaml.cs +++ b/NEW/src/Utils/JdeScoping.ConfigManager/Views/Forms/SecureStoreInfoFormView.axaml.cs @@ -4,6 +4,9 @@ namespace JdeScoping.ConfigManager.Views.Forms; public partial class SecureStoreInfoFormView : UserControl { + /// + /// Initializes a new instance of the class. + /// public SecureStoreInfoFormView() { InitializeComponent(); diff --git a/NEW/tests/JdeScoping.ConfigManager.Tests/ViewModels/Forms/ConnectionStringsFormViewModelTests.cs b/NEW/tests/JdeScoping.ConfigManager.Tests/ViewModels/Forms/ConnectionStringsFormViewModelTests.cs index c9621d4..f5b34cf 100644 --- a/NEW/tests/JdeScoping.ConfigManager.Tests/ViewModels/Forms/ConnectionStringsFormViewModelTests.cs +++ b/NEW/tests/JdeScoping.ConfigManager.Tests/ViewModels/Forms/ConnectionStringsFormViewModelTests.cs @@ -22,7 +22,7 @@ public class ConnectionStringsFormViewModelTests } [Fact] - public void Constructor_InitializesFromModel() + public void Constructor_InitializesFromModel() { // Arrange var model = new ConnectionStringsSection @@ -54,11 +54,67 @@ public class ConnectionStringsFormViewModelTests sut.Connections[0].Server.ShouldBe("server1"); sut.Connections[1].Name.ShouldBe("Connection2"); sut.Connections[1].Provider.ShouldBe(ConnectionProvider.Oracle); - sut.Connections[1].Host.ShouldBe("oracle-host"); - } - - [Fact] - public void Constructor_ThrowsOnNullModel() + sut.Connections[1].Host.ShouldBe("oracle-host"); + } + + [Fact] + public void Constructor_LoadsAndParsesSqlServerConnectionStringFromSecureStore() + { + // Arrange + var model = new ConnectionStringsSection + { + Entries = new List + { + new ConnectionStringEntry { Name = "LotFinder" } + } + }; + _secureStoreManager.IsStoreOpen.Returns(true); + _secureStoreManager.GetSecret("LotFinder") + .Returns("Server=localhost,1434;Database=ScopingTool;User Id=scopingapp;Password=pass;TrustServerCertificate=true"); + + // Act + var sut = new ConnectionStringsFormViewModel(model, _secureStoreManager, () => { }, _dialogService, _connectionTestService); + + // Assert + sut.Connections.Count.ShouldBe(1); + sut.Connections[0].Provider.ShouldBe(ConnectionProvider.SqlServer); + sut.Connections[0].Server.ShouldBe("localhost,1434"); + sut.Connections[0].Database.ShouldBe("ScopingTool"); + sut.Connections[0].UserId.ShouldBe("scopingapp"); + sut.Connections[0].Password.ShouldBe("pass"); + sut.Connections[0].TrustServerCertificate.ShouldBeTrue(); + } + + [Fact] + public void Constructor_LoadsAndParsesOracleConnectionStringFromSecureStore() + { + // Arrange + var model = new ConnectionStringsSection + { + Entries = new List + { + new ConnectionStringEntry { Name = "CMS" } + } + }; + _secureStoreManager.IsStoreOpen.Returns(true); + _secureStoreManager.GetSecret("CMS") + .Returns("HOST=ha-iman;Service Name=imanprd;Fetch Array Size=1280000;Port=1522;User ID=app_teamcenter;Password=pass;"); + + // Act + var sut = new ConnectionStringsFormViewModel(model, _secureStoreManager, () => { }, _dialogService, _connectionTestService); + + // Assert + sut.Connections.Count.ShouldBe(1); + sut.Connections[0].Provider.ShouldBe(ConnectionProvider.Oracle); + sut.Connections[0].Host.ShouldBe("ha-iman"); + sut.Connections[0].ServiceName.ShouldBe("imanprd"); + sut.Connections[0].Port.ShouldBe(1522); + sut.Connections[0].UserId.ShouldBe("app_teamcenter"); + sut.Connections[0].Password.ShouldBe("pass"); + } + + [Fact] + public void Constructor_ThrowsOnNullModel() { // Act & Assert Should.Throw(() =>