Add Reports tab to Uno Messages page

The Messages page already had an IsAdmin flag and the server already
supported a "reports" folder of system-authored conversations, but
there was no button/command in the Uno app to ever navigate to it, so
admins had no way to see system messages in the Messages area.
This commit is contained in:
2026-06-30 13:08:29 +01:00
parent 42ed8daaa7
commit 643bf86bed
2 changed files with 17 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ public partial class MessagesViewModel : ObservableObject, IRegionAware
public bool IsInboxSelected => Folder == "inbox";
public bool IsSentSelected => Folder == "sent";
public bool IsReportsSelected => Folder == "reports";
public bool CanGoPrevious => CurrentPage > 1;
public bool CanGoNext => CurrentPage * PageSize < TotalCount;
public string PageSummary => TotalCount <= 0
@@ -78,6 +79,7 @@ public partial class MessagesViewModel : ObservableObject, IRegionAware
CurrentPage = 1;
OnPropertyChanged(nameof(IsInboxSelected));
OnPropertyChanged(nameof(IsSentSelected));
OnPropertyChanged(nameof(IsReportsSelected));
return LoadAsync();
}
@@ -88,6 +90,18 @@ public partial class MessagesViewModel : ObservableObject, IRegionAware
CurrentPage = 1;
OnPropertyChanged(nameof(IsInboxSelected));
OnPropertyChanged(nameof(IsSentSelected));
OnPropertyChanged(nameof(IsReportsSelected));
return LoadAsync();
}
[RelayCommand]
Task GoToReports()
{
Folder = "reports";
CurrentPage = 1;
OnPropertyChanged(nameof(IsInboxSelected));
OnPropertyChanged(nameof(IsSentSelected));
OnPropertyChanged(nameof(IsReportsSelected));
return LoadAsync();
}

View File

@@ -41,6 +41,9 @@
Style="{ThemeResource AccentButtonStyle}" />
<Button Content="Sent"
Command="{Binding GoToSentCommand}" />
<Button Content="Reports"
Command="{Binding GoToReportsCommand}"
Visibility="{Binding IsAdmin}" />
<Button Content="Compose"
Command="{Binding OpenComposeCommand}" />
</StackPanel>