mirror of
https://github.com/claunia/marechai.git
synced 2026-07-08 17:57:08 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user