feat(hub): Ticket-Settings, Projektliste und Import ueber den Hub

This commit is contained in:
mika kuns
2026-08-27 13:22:54 +02:00
parent 2e236736a7
commit f0a3a186dd
9 changed files with 255 additions and 10 deletions
@@ -217,4 +217,15 @@ public interface IWorkerClient : INotifyPropertyChanged
/// <summary>Starts TokenTracker's local dashboard on the worker and returns its URL; opening
/// the browser is the caller's job.</summary>
Task<TokenTrackerDashboardDto?> OpenTokenTrackerDashboardAsync();
Task<TicketSettingsDto?> GetTicketSettingsAsync();
Task SetTicketApiBaseUrlAsync(string? baseUrl);
Task SetTicketTokenAsync(string token);
Task ClearTicketTokenAsync();
Task<TicketConnectionDto?> TestTicketConnectionAsync();
Task<List<TicketProjectDto>> GetTicketProjectsAsync();
/// <summary>Imports open tickets assigned to the token owner into the given list. Throws
/// HubException (with a user-readable message) on failure so the caller can surface it via
/// the footer error strip.</summary>
Task<TicketImportResultDto> ImportTicketsAsync(string listId);
}
+21
View File
@@ -706,6 +706,27 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
public Task<TokenTrackerDashboardDto?> OpenTokenTrackerDashboardAsync()
=> TryInvokeAsync<TokenTrackerDashboardDto>("OpenTokenTrackerDashboard");
public Task<TicketSettingsDto?> GetTicketSettingsAsync()
=> TryInvokeAsync<TicketSettingsDto>("GetTicketSettings");
public Task SetTicketApiBaseUrlAsync(string? baseUrl)
=> InvokeTimedAsync("SetTicketApiBaseUrl", () => _hub.InvokeAsync("SetTicketApiBaseUrl", baseUrl));
public Task SetTicketTokenAsync(string token)
=> InvokeTimedAsync("SetTicketToken", () => _hub.InvokeAsync("SetTicketToken", token));
public Task ClearTicketTokenAsync()
=> InvokeTimedAsync("ClearTicketToken", () => _hub.InvokeAsync("ClearTicketToken"));
public Task<TicketConnectionDto?> TestTicketConnectionAsync()
=> TryInvokeAsync<TicketConnectionDto>("TestTicketConnection");
public async Task<List<TicketProjectDto>> GetTicketProjectsAsync()
=> await TryInvokeAsync<List<TicketProjectDto>>("GetTicketProjects") ?? [];
public Task<TicketImportResultDto> ImportTicketsAsync(string listId)
=> InvokeTimedAsync<TicketImportResultDto>("ImportTickets", () => _hub.InvokeAsync<TicketImportResultDto>("ImportTickets", listId));
// IWorkerClient explicit implementations (drop typed return values)
async Task IWorkerClient.StartPlanningSessionAsync(string taskId, CancellationToken ct)
=> await StartPlanningSessionAsync(taskId, ct);