From cb1c8c369bc81369b52deaba041f296788272c48 Mon Sep 17 00:00:00 2001 From: capdiem Date: Mon, 4 Mar 2024 18:07:54 +0800 Subject: [PATCH] update --- .../Masa.Blazor.ProApp.Rcl/Models/Task.cs | 10 +-- .../Masa.Blazor.ProApp.Rcl/Pages/Todo.razor | 79 +++++++++++-------- 2 files changed, 51 insertions(+), 38 deletions(-) diff --git a/Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Models/Task.cs b/Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Models/Task.cs index d89f013..e494639 100644 --- a/Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Models/Task.cs +++ b/Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Models/Task.cs @@ -1,16 +1,16 @@ -namespace Masa.Blazor.ProApp.Rcl.Models; +using System.ComponentModel.DataAnnotations; + +namespace Masa.Blazor.ProApp.Rcl.Models; public class TodoTask { public int Id { get; set; } - public string? Title { get; set; } - - public string? Assignee { get; set; } + [Required] public string? Title { get; set; } public string? Description { get; set; } - public DateOnly DueAt { get; set; } + [Required] public DateOnly DueAt { get; set; } public bool Important { get; set; } diff --git a/Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Pages/Todo.razor b/Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Pages/Todo.razor index 6975319..d730131 100644 --- a/Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Pages/Todo.razor +++ b/Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Pages/Todo.razor @@ -17,7 +17,8 @@ - + - - - - - - -
- - mdi-calendar-today-outline - Today - - - mdi-flag-variant-outline - - - - mdi-arrow-up-circle - -
+ + + + + + + +
+ + mdi-calendar-today-outline + Today + + + mdi-flag-variant-outline + + + + mdi-arrow-up-circle + +
+
@@ -67,6 +72,7 @@ @code { private bool? _drawer = false; + private bool _newTaskSheet; private string Category => Filter ?? "inbox"; @@ -74,5 +80,12 @@ [Parameter] public string? Filter { get; set; } + private async Task HandleOnSubmit() + { + // TODO: Save the task + + _newTaskSheet = false; + } + } \ No newline at end of file