MainPage => BlogsPage

This commit is contained in:
Paul Schneider 2026-09-11 16:22:49 +01:00
commit 344c38704b
Signed by: notazof
GPG key ID: 1DD5D838E5343B06
6 changed files with 11 additions and 6 deletions

View file

@ -115,6 +115,7 @@ public class MainPageButtonsTests
var window = new MainView(); var window = new MainView();
var page = new BlogsPage { DataContext = vm }; var page = new BlogsPage { DataContext = vm };
var app = (PostIt.App)Application.Current!; var app = (PostIt.App)Application.Current!;
app.AttachMainWindow(window); app.AttachMainWindow(window);
window.NavRoot.PushAsync(page).GetAwaiter().GetResult(); window.NavRoot.PushAsync(page).GetAwaiter().GetResult();
return (window, page); return (window, page);

View file

@ -34,13 +34,13 @@
<Grid Grid.Row="3" Margin="0,12,0,0" ColumnDefinitions="Auto,8,Auto,8,Auto,12,*"> <Grid Grid.Row="3" Margin="0,12,0,0" ColumnDefinitions="Auto,8,Auto,8,Auto,12,*">
<Button Grid.Column="0" <Button Grid.Column="0"
Content="Ouvrir le formulaire" Content="Ouvrir le formulaire de demande"
Command="{Binding OpenSelectedFormCommand}" /> Command="{Binding OpenSelectedFormCommand}" />
<Button Grid.Column="2" <Button Grid.Column="2"
Content="Voir les commandes" Content="Voir les demandes non validées"
Command="{Binding OpenQueriesCommand}" /> Command="{Binding OpenQueriesCommand}" />
<Button Grid.Column="4" <Button Grid.Column="4"
Content="Demandes en cours (lecture seule)" Content="Demandes en cours (validées, en lecture seule)"
Command="{Binding OpenOngoingQueriesCommand}" /> Command="{Binding OpenOngoingQueriesCommand}" />
<postitControls:StatusBar Grid.Column="6" <postitControls:StatusBar Grid.Column="6"
DataContext="{Binding ActionStatus}" /> DataContext="{Binding ActionStatus}" />

View file

@ -22,5 +22,9 @@
Command="{Binding OpenActivities}" Command="{Binding OpenActivities}"
HorizontalAlignment="Center" HorizontalAlignment="Center"
IsEnabled="{Binding SessionStatus.IsLoggedIn}"/> IsEnabled="{Binding SessionStatus.IsLoggedIn}"/>
<Button Content="Mes demandes en cours"
Command="{Binding OpenProviderRequests}"
HorizontalAlignment="Center"
IsEnabled="{Binding SessionStatus.IsLoggedIn}"/>
</StackPanel> </StackPanel>
</ContentPage> </ContentPage>

View file

@ -91,7 +91,7 @@ public sealed class BlogApiClient
=> _api.CallAsync(HttpMethod.Put, $"{_pathPrefix}/{id}/publish", => _api.CallAsync(HttpMethod.Put, $"{_pathPrefix}/{id}/publish",
body: new { publish }, ct: ct); body: new { publish }, ct: ct);
private Task<BlogPostDto?> SendPostAsync( private async Task<BlogPostDto?> SendPostAsync(
HttpMethod method, HttpMethod method,
string path, string path,
BlogPostDto post, BlogPostDto post,
@ -99,9 +99,9 @@ public sealed class BlogApiClient
CancellationToken ct) CancellationToken ct)
{ {
if (files is null || files.Count == 0) if (files is null || files.Count == 0)
return _api.CallAsync<BlogPostDto?>(method, path, body: post, ct: ct); return await _api.CallAsync<BlogPostDto?>(method, path, body: post, ct: ct);
return _api.CallAsync<BlogPostDto?>(method, path, () => CreateMultipartContent(post, files), ct: ct); return await _api.CallAsync<BlogPostDto?>(method, path, () => CreateMultipartContent(post, files), ct: ct);
} }
private static HttpContent CreateMultipartContent(BlogPostDto post, IReadOnlyCollection<BlogUploadFile> files) private static HttpContent CreateMultipartContent(BlogPostDto post, IReadOnlyCollection<BlogUploadFile> files)