diff --git a/Sources/HeartTrack/Models/Ticket/Ticket.cs b/Sources/HeartTrack/Models/Ticket/Ticket.cs index e21b3c5..293afed 100644 --- a/Sources/HeartTrack/Models/Ticket/Ticket.cs +++ b/Sources/HeartTrack/Models/Ticket/Ticket.cs @@ -6,7 +6,6 @@ public string Username { get; set; } public string Contexte { get; set; } public string Description { get; set; } - public string Urgence { get; set; } public Boolean isCheck { get; set; } } } diff --git a/Sources/HeartTrack/Models/Ticket/TicketModel.cs b/Sources/HeartTrack/Models/Ticket/TicketModel.cs index e9bdc40..54427ca 100644 --- a/Sources/HeartTrack/Models/Ticket/TicketModel.cs +++ b/Sources/HeartTrack/Models/Ticket/TicketModel.cs @@ -20,7 +20,6 @@ namespace HeartTrack.Models [Required] [StringLength(500, ErrorMessage = "Description must not exceed 500 characters.")] public string Description { get; set; } - public Boolean Urgence { get; set; } public Boolean isCheck { get; set; } = false; } } diff --git a/Sources/HeartTrack/Pages/AddTicket.razor b/Sources/HeartTrack/Pages/AddTicket.razor index e1a4bed..7a6620e 100644 --- a/Sources/HeartTrack/Pages/AddTicket.razor +++ b/Sources/HeartTrack/Pages/AddTicket.razor @@ -25,13 +25,6 @@

-

- -

- diff --git a/Sources/HeartTrack/Pages/Tickets.razor b/Sources/HeartTrack/Pages/Tickets.razor index 9f72370..77e512a 100644 --- a/Sources/HeartTrack/Pages/Tickets.razor +++ b/Sources/HeartTrack/Pages/Tickets.razor @@ -26,9 +26,8 @@ This is the ticket list of users. Responsive Sortable SortMode="DataGridSortMode.Single"> - + - @if (context.isCheck) @@ -46,7 +45,7 @@ This is the ticket list of users. @if (context.isCheck) { - + } else diff --git a/Sources/HeartTrack/Pages/Tickets.razor.cs b/Sources/HeartTrack/Pages/Tickets.razor.cs index 7989734..c8f8147 100644 --- a/Sources/HeartTrack/Pages/Tickets.razor.cs +++ b/Sources/HeartTrack/Pages/Tickets.razor.cs @@ -31,6 +31,9 @@ namespace HeartTrack.Pages [Inject] public NavigationManager NavigationManager { get; set; } + [Inject] + private ISnackbar Snackbar { get; set; } + protected override async Task OnAfterRenderAsync(bool firstRender) { // Do not treat this action if is not the first render @@ -71,11 +74,10 @@ namespace HeartTrack.Pages private async void OnClose(int id) { - await TicketService.Close(id); - // Reload the page NavigationManager.NavigateTo("tickets", true); + Snackbar.Add("Ticket fermé !"); } private void OnView(int id) diff --git a/Sources/HeartTrack/Pages/ViewTicket.razor b/Sources/HeartTrack/Pages/ViewTicket.razor index 09081ff..45e9a23 100644 --- a/Sources/HeartTrack/Pages/ViewTicket.razor +++ b/Sources/HeartTrack/Pages/ViewTicket.razor @@ -13,9 +13,7 @@

Description: @ticket.Description

-

- Urgence: @ticket.Urgence -

Status: @ticket.isCheck -

\ No newline at end of file +

+Return \ No newline at end of file diff --git a/Sources/HeartTrack/Pages/ViewTicket.razor.cs b/Sources/HeartTrack/Pages/ViewTicket.razor.cs index 576aa4d..d014145 100644 --- a/Sources/HeartTrack/Pages/ViewTicket.razor.cs +++ b/Sources/HeartTrack/Pages/ViewTicket.razor.cs @@ -31,9 +31,13 @@ namespace HeartTrack.Pages Username = item.Username, Contexte = item.Contexte, Description = item.Description, - Urgence = item.Urgence, isCheck = item.isCheck }; } + + private void OnNavigateOnReturnClicked() + { + NavigationManager.NavigateTo("/tickets", true); + } } } \ No newline at end of file diff --git a/Sources/HeartTrack/Program.cs b/Sources/HeartTrack/Program.cs index 893584d..9a4bebf 100644 --- a/Sources/HeartTrack/Program.cs +++ b/Sources/HeartTrack/Program.cs @@ -10,11 +10,23 @@ using HeartTrack.Services.TicketDataService; using MudBlazor.Services; using HeartTrack.Services.ActivityDataServiceFactice; using HeartTrack.Services.TicketDataServiceFactice; +using MudBlazor; var builder = WebApplication.CreateBuilder(args); // Add Badge Component services -builder.Services.AddMudServices(); +builder.Services.AddMudServices(config => +{ + config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomLeft; + + config.SnackbarConfiguration.PreventDuplicates = false; + config.SnackbarConfiguration.NewestOnTop = false; + config.SnackbarConfiguration.ShowCloseIcon = true; + config.SnackbarConfiguration.VisibleStateDuration = 10000; + config.SnackbarConfiguration.HideTransitionDuration = 500; + config.SnackbarConfiguration.ShowTransitionDuration = 500; + config.SnackbarConfiguration.SnackbarVariant = Variant.Filled; +}); // Add services to the container. builder.Services.AddRazorPages(); diff --git a/Sources/HeartTrack/Shared/MainLayout.razor b/Sources/HeartTrack/Shared/MainLayout.razor index 4b6d1ba..c434044 100644 --- a/Sources/HeartTrack/Shared/MainLayout.razor +++ b/Sources/HeartTrack/Shared/MainLayout.razor @@ -17,20 +17,12 @@ - + + + Profile + Logout + - @*
- @*
- -
*@ - @* Messages, notifs et pp compte à mettre *@ - @*
- - -
-
*@
@Body diff --git a/Sources/HeartTrack/wwwroot/data/fake-tickets.json b/Sources/HeartTrack/wwwroot/data/fake-tickets.json index 802f171..1143b8d 100644 --- a/Sources/HeartTrack/wwwroot/data/fake-tickets.json +++ b/Sources/HeartTrack/wwwroot/data/fake-tickets.json @@ -5,8 +5,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 2, @@ -14,8 +13,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 3, @@ -23,8 +21,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false + "description": "Wallah c`est la description" }, { "id": 4, @@ -32,8 +29,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false + "description": "Wallah c`est la description" }, { "id": 5, @@ -41,8 +37,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 6, @@ -50,8 +45,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false + "description": "Wallah c`est la description" }, { "id": 7, @@ -59,8 +53,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 8, @@ -68,8 +61,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 9, @@ -78,7 +70,6 @@ "prenom": "John", "contexte": "Jvais dire wallah", "description": "Wallah c`est la description", - "urgence": false }, { "id": 10, @@ -86,8 +77,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 11, @@ -95,8 +85,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false + "description": "Wallah c`est la description" }, { "id": 12, @@ -104,8 +93,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 13, @@ -113,8 +101,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 14, @@ -122,8 +109,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 15, @@ -131,8 +117,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false + "description": "Wallah c`est la description" }, { "id": 16, @@ -140,8 +125,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 17, @@ -149,8 +133,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false + "description": "Wallah c`est la description" }, { "id": 18, @@ -158,8 +141,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 19, @@ -167,8 +149,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 20, @@ -176,8 +157,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 21, @@ -185,8 +165,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" }, { "id": 22, @@ -194,8 +173,7 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false + "description": "Wallah c`est la description" }, { "id": 23, @@ -203,7 +181,6 @@ "nom": "Doe", "prenom": "John", "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true + "description": "Wallah c`est la description" } ] \ No newline at end of file diff --git a/Sources/HeartTrack/wwwroot/fake-tickets.json b/Sources/HeartTrack/wwwroot/fake-tickets.json deleted file mode 100644 index 802f171..0000000 --- a/Sources/HeartTrack/wwwroot/fake-tickets.json +++ /dev/null @@ -1,209 +0,0 @@ -[ - { - "id": 1, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 2, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 3, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false - }, - { - "id": 4, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false - }, - { - "id": 5, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 6, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false - }, - { - "id": 7, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 8, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 9, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false - }, - { - "id": 10, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 11, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false - }, - { - "id": 12, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 13, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 14, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 15, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false - }, - { - "id": 16, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 17, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false - }, - { - "id": 18, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 19, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 20, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 21, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - }, - { - "id": 22, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": false - }, - { - "id": 23, - "username": "johndoe", - "nom": "Doe", - "prenom": "John", - "contexte": "Jvais dire wallah", - "description": "Wallah c`est la description", - "urgence": true - } -] \ No newline at end of file