feat: Aggiunto sistema completo di gestione profili per Data Coupler
- Creata nuova libreria Components con componenti Blazor riutilizzabili * ProfileSelector: dropdown per selezione profili salvati * ProfileSaver: componente per salvare configurazioni correnti come profili * ProfileManagement: modale per gestione profili salvati * ProfileQuickActions: bottoni azioni rapide per operazioni sui profili - Esteso CredentialManager con entità e servizi per DataCouplerProfile * Aggiunto modello DataCouplerProfile con configurazioni mapping e metadati * Implementata migrazione Entity Framework per memorizzazione profili * Creato DataCouplerProfileService per operazioni CRUD * Aggiunto CredentialDbContextFactory per operazioni database design-time - Migliorato componente principale DataCoupler con integrazione profili * Integrata funzionalità caricamento/salvataggio profili * Aggiunto selettore profili nella parte superiore dell'interfaccia * Mantenuta retrocompatibilità con funzionalità esistenti * Migliorata esperienza utente con gestione configurazioni salvate - Aggiornata struttura progetto e dipendenze * Aggiunto progetto Components alla soluzione * Aggiornati riferimenti progetti e import * Rimosso progetto obsoleto TestDatabaseFix Questo aggiornamento migliora significativamente il flusso di lavoro permettendo agli utenti di salvare, caricare e gestire configurazioni complete di accoppiamento dati come
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using CredentialManager;
|
||||
using CredentialManager.Services;
|
||||
using CredentialManager.Models;
|
||||
|
||||
Console.WriteLine("🧪 Testing DataCouplerProfile Service...");
|
||||
|
||||
try
|
||||
{
|
||||
// Crea un service provider con CredentialManager
|
||||
var serviceProvider = await CredentialManagerFactory.CreateServiceProviderAsync();
|
||||
|
||||
// Ottieni il servizio per i profili
|
||||
var profileService = serviceProvider.GetRequiredService<IDataCouplerProfileService>();
|
||||
|
||||
Console.WriteLine("✅ Service created successfully!");
|
||||
|
||||
// Test: Ottieni tutti i profili (dovrebbe essere vuoto)
|
||||
var profiles = await profileService.GetAllProfilesAsync();
|
||||
Console.WriteLine($"📋 Found {profiles.Count()} existing profiles");
|
||||
|
||||
// Test: Crea un profilo di test
|
||||
var testProfile = new DataCouplerProfile
|
||||
{
|
||||
Name = "Test Profile",
|
||||
Description = "Profile creato durante il test",
|
||||
SourceType = "database",
|
||||
DestinationType = "rest",
|
||||
SourceSchema = "dbo",
|
||||
SourceTable = "customers",
|
||||
DestinationEndpoint = "/api/customers",
|
||||
CreatedBy = "System Test"
|
||||
};
|
||||
|
||||
// Salva il profilo
|
||||
var savedProfile = await profileService.SaveProfileAsync(testProfile);
|
||||
Console.WriteLine($"💾 Test profile saved with ID: {savedProfile.Id}");
|
||||
|
||||
// Ricarica i profili
|
||||
profiles = await profileService.GetAllProfilesAsync();
|
||||
Console.WriteLine($"📋 Now found {profiles.Count()} profiles");
|
||||
|
||||
// Elimina il profilo di test
|
||||
var deleted = await profileService.DeleteProfileAsync(savedProfile.Id);
|
||||
Console.WriteLine($"🗑️ Test profile deleted: {deleted}");
|
||||
|
||||
Console.WriteLine("✅ All tests passed! DataCouplerProfile service is working correctly.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"❌ Error during testing: {ex.Message}");
|
||||
Console.WriteLine($"Stack trace: {ex.StackTrace}");
|
||||
}
|
||||
|
||||
Console.WriteLine("Press any key to exit...");
|
||||
Console.ReadKey();
|
||||
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CredentialManager\CredentialManager.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user