implements a dico
This commit is contained in:
parent
3626be3d8b
commit
91fc7f168b
8 changed files with 502 additions and 5 deletions
15
src/PostIt/PostIt.Tests/HomePageProviderFlowTests.cs
Normal file
15
src/PostIt/PostIt.Tests/HomePageProviderFlowTests.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using PostIt.ViewModels;
|
||||
|
||||
namespace PostIt.Tests;
|
||||
|
||||
public class HomePageProviderFlowTests
|
||||
{
|
||||
[Fact]
|
||||
public void HomePage_exposes_provider_requests_command()
|
||||
{
|
||||
var vm = new HomePageViewModel();
|
||||
|
||||
Assert.NotNull(vm.OpenProviderRequests);
|
||||
Assert.True(vm.OpenProviderRequests.CanExecute(null));
|
||||
}
|
||||
}
|
||||
|
|
@ -30,10 +30,11 @@ public class HomePageViewModel : ViewModelBase
|
|||
SessionStatus = sessionStatus;
|
||||
|
||||
OpenActivities = new AsyncRelayCommand(OpenActivitiesAsync);
|
||||
|
||||
OpenProviderRequests = new AsyncRelayCommand(OpenProviderRequestsAsync);
|
||||
}
|
||||
public IAsyncRelayCommand OpenBlogs { get; } = new AsyncRelayCommand(App.PushBlogsPageAsync);
|
||||
public IAsyncRelayCommand OpenActivities { get; }
|
||||
public IAsyncRelayCommand OpenProviderRequests { get; }
|
||||
|
||||
private async Task OpenActivitiesAsync()
|
||||
{
|
||||
|
|
@ -48,6 +49,8 @@ public class HomePageViewModel : ViewModelBase
|
|||
await app.PushPageAsync(vm);
|
||||
}
|
||||
|
||||
private Task OpenProviderRequestsAsync() => OpenActivitiesAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Avalonia designer constructor. Builds a self-contained VM
|
||||
/// with a freshly-constructed Settings so the XAML preview can
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<TextBox Text="{Binding SearchText, Mode=TwoWay}" PlaceholderText="Filter by title or author..." />
|
||||
<CommandBar IsDynamicOverflowEnabled="True">
|
||||
<CommandBar.PrimaryCommands>
|
||||
|
||||
|
||||
<CommandBarButton Label="Filter" Command="{Binding SearchAsync}">
|
||||
<CommandBarButton.Icon>
|
||||
<PathIcon Data="{StaticResource FilterIcon}" />
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
<PathIcon Data="{StaticResource RefreshIcon}" />
|
||||
</CommandBarButton.Icon>
|
||||
</CommandBarButton>
|
||||
<CommandBarButton Label="Save" Command="{Binding SaveAsync}">
|
||||
<CommandBarButton x:Name="SaveButton" Label="Save" Command="{Binding SaveAsync}">
|
||||
<CommandBarButton.Icon>
|
||||
<PathIcon Data="{StaticResource SaveIcon}" />
|
||||
</CommandBarButton.Icon>
|
||||
|
|
@ -57,7 +57,8 @@
|
|||
</CommandBarButton.Icon>
|
||||
</CommandBarButton>
|
||||
<CommandBarButton x:Name="ManageAclButton"
|
||||
Label="ACL" Command="{Binding ManageAclAsync}">
|
||||
Label="ACL"
|
||||
Command="{Binding ManageAclAsync}">
|
||||
<CommandBarButton.Icon>
|
||||
<PathIcon Data="{StaticResource AclIcon}" />
|
||||
</CommandBarButton.Icon>
|
||||
|
|
@ -114,7 +115,8 @@
|
|||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Row="0" Text="Post detail" FontWeight="SemiBold" />
|
||||
<TextBox Grid.Row="1" Text="{Binding DraftTitle, Mode=TwoWay}" PlaceholderText="Title" />
|
||||
<TextBox x:Name="DraftTitleTextBox"
|
||||
Grid.Row="1" Text="{Binding DraftTitle, Mode=TwoWay}" PlaceholderText="Title" />
|
||||
<TextBox Grid.Row="2" PlaceholderText="Write something here !"
|
||||
Text="{Binding DraftArticle, Mode=TwoWay}"
|
||||
MinHeight="320"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue