Résolution erreur affichage Datagrid ticket

CI_tests
Antoine PINAGOT 1 year ago
parent 207ac95462
commit bc87676131

@ -6,7 +6,6 @@
public string Username { get; set; } public string Username { get; set; }
public string Contexte { get; set; } public string Contexte { get; set; }
public string Description { get; set; } public string Description { get; set; }
public string Urgence { get; set; }
public Boolean isCheck { get; set; } public Boolean isCheck { get; set; }
} }
} }

@ -20,7 +20,6 @@ namespace HeartTrack.Models
[Required] [Required]
[StringLength(500, ErrorMessage = "Description must not exceed 500 characters.")] [StringLength(500, ErrorMessage = "Description must not exceed 500 characters.")]
public string Description { get; set; } public string Description { get; set; }
public Boolean Urgence { get; set; }
public Boolean isCheck { get; set; } = false; public Boolean isCheck { get; set; } = false;
} }
} }

@ -25,13 +25,6 @@
</label> </label>
</p> </p>
<p>
<label for="urgence">
Urgence:
<InputCheckbox id="urgence" @bind-Value="ticketModel.Urgence" />
</label>
</p>
<button type="submit">Submit</button> <button type="submit">Submit</button>
</EditForm> </EditForm>

@ -26,9 +26,8 @@ This is the ticket list of users.
Responsive Responsive
Sortable Sortable
SortMode="DataGridSortMode.Single"> SortMode="DataGridSortMode.Single">
<DataGridColumn TItem="Ticket" Field="@nameof(Ticket.Username)" Caption="Username" /> <DataGridColumn TItem="Ticket" Field="@nameof(Ticket.Username)" Caption="Username" Width="200px"/>
<DataGridColumn TItem="Ticket" Field="@nameof(Ticket.Contexte)" Caption="Context" /> <DataGridColumn TItem="Ticket" Field="@nameof(Ticket.Contexte)" Caption="Context" />
<DataGridColumn TItem="Ticket" Field="@nameof(Ticket.Urgence)" Caption="Urgency" Width="150px" />
<DataGridColumn TItem="Ticket" Field="@nameof(Ticket.isCheck)" Caption="Status" SortField="@nameof( Ticket.isCheck )" SortDirection="Blazorise.SortDirection.Ascending" Width="150px" Editable> <DataGridColumn TItem="Ticket" Field="@nameof(Ticket.isCheck)" Caption="Status" SortField="@nameof( Ticket.isCheck )" SortDirection="Blazorise.SortDirection.Ascending" Width="150px" Editable>
<DisplayTemplate> <DisplayTemplate>
@if (context.isCheck) @if (context.isCheck)
@ -46,7 +45,7 @@ This is the ticket list of users.
<DisplayTemplate> <DisplayTemplate>
@if (context.isCheck) @if (context.isCheck)
{ {
<MudFab Color="Color.Tertiary" StartIcon="@Icons.Material.Filled.RemoveRedEye" Size="Size.Small" @onclick="() => OnView(context.Id)" /> <MudFab Color="Color.Tertiary" StartIcon="@Icons.Material.Filled.RemoveRedEye" Size="Size.Small" @onclick="(() => OnView(context.Id))"/>
<MudFab Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Delete" Size="Size.Small" @onclick="() => OnDelete(context)" /> <MudFab Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Delete" Size="Size.Small" @onclick="() => OnDelete(context)" />
} }
else else

@ -31,6 +31,9 @@ namespace HeartTrack.Pages
[Inject] [Inject]
public NavigationManager NavigationManager { get; set; } public NavigationManager NavigationManager { get; set; }
[Inject]
private ISnackbar Snackbar { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender) protected override async Task OnAfterRenderAsync(bool firstRender)
{ {
// Do not treat this action if is not the first render // Do not treat this action if is not the first render
@ -71,11 +74,10 @@ namespace HeartTrack.Pages
private async void OnClose(int id) private async void OnClose(int id)
{ {
await TicketService.Close(id); await TicketService.Close(id);
// Reload the page
NavigationManager.NavigateTo("tickets", true); NavigationManager.NavigateTo("tickets", true);
Snackbar.Add("Ticket fermé !");
} }
private void OnView(int id) private void OnView(int id)

@ -13,9 +13,7 @@
<p> <p>
Description: @ticket.Description Description: @ticket.Description
</p> </p>
<p>
Urgence: @ticket.Urgence
</p>
<p> <p>
Status: @ticket.isCheck Status: @ticket.isCheck
</p> </p>
<MudButton @OnClick="OnNavigateOnReturnClicked">Return</MudButton>

@ -31,9 +31,13 @@ namespace HeartTrack.Pages
Username = item.Username, Username = item.Username,
Contexte = item.Contexte, Contexte = item.Contexte,
Description = item.Description, Description = item.Description,
Urgence = item.Urgence,
isCheck = item.isCheck isCheck = item.isCheck
}; };
} }
private void OnNavigateOnReturnClicked()
{
NavigationManager.NavigateTo("/tickets", true);
}
} }
} }

@ -10,11 +10,23 @@ using HeartTrack.Services.TicketDataService;
using MudBlazor.Services; using MudBlazor.Services;
using HeartTrack.Services.ActivityDataServiceFactice; using HeartTrack.Services.ActivityDataServiceFactice;
using HeartTrack.Services.TicketDataServiceFactice; using HeartTrack.Services.TicketDataServiceFactice;
using MudBlazor;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
// Add Badge Component services // 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. // Add services to the container.
builder.Services.AddRazorPages(); builder.Services.AddRazorPages();

@ -17,20 +17,12 @@
<span class="navbat-toggler-icon"></span> <span class="navbat-toggler-icon"></span>
</MudIconButton> </MudIconButton>
<MudSpacer /> <MudSpacer />
<MudIconButton Icon="@Icons.Material.Filled.ManageAccounts" Color="Color.Inherit" Edge="Edge.End" @onclick="ToggleProfilMenu"/> <CultureSelector></CultureSelector>
<MudMenu Icon="@Icons.Material.Filled.AccountCircle" Color="Color.Inherit" Edge="Edge.End">
<MudMenuItem>Profile</MudMenuItem>
<MudButton type="button" class="btn btn-link ml-md-auto">Logout</MudButton>
</MudMenu>
</MudAppBar> </MudAppBar>
@* <div class="top-row px-4 auth">
@* <div class="container-fluid toggler-container">
<button title="Navigation menu" class="navbar-toggler custom-toggler" @onclick="ToggleNavMenu">
<span class="navbat-toggler-icon"></span>
</button>
</div> *@
@* Messages, notifs et pp compte à mettre *@
@* <div class="top-row px-4">
<CultureSelector />
<button type="button" class="btn btn-link ml-md-auto" @onclick="@LogoutClick">Logout</button>
</div>
</div> *@
<article class="content px-4"> <article class="content px-4">
@Body @Body

@ -5,8 +5,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 2, "id": 2,
@ -14,8 +13,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 3, "id": 3,
@ -23,8 +21,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": false
}, },
{ {
"id": 4, "id": 4,
@ -32,8 +29,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": false
}, },
{ {
"id": 5, "id": 5,
@ -41,8 +37,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 6, "id": 6,
@ -50,8 +45,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": false
}, },
{ {
"id": 7, "id": 7,
@ -59,8 +53,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 8, "id": 8,
@ -68,8 +61,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 9, "id": 9,
@ -78,7 +70,6 @@
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description",
"urgence": false
}, },
{ {
"id": 10, "id": 10,
@ -86,8 +77,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 11, "id": 11,
@ -95,8 +85,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": false
}, },
{ {
"id": 12, "id": 12,
@ -104,8 +93,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 13, "id": 13,
@ -113,8 +101,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 14, "id": 14,
@ -122,8 +109,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 15, "id": 15,
@ -131,8 +117,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": false
}, },
{ {
"id": 16, "id": 16,
@ -140,8 +125,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 17, "id": 17,
@ -149,8 +133,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": false
}, },
{ {
"id": 18, "id": 18,
@ -158,8 +141,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 19, "id": 19,
@ -167,8 +149,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 20, "id": 20,
@ -176,8 +157,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 21, "id": 21,
@ -185,8 +165,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
}, },
{ {
"id": 22, "id": 22,
@ -194,8 +173,7 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": false
}, },
{ {
"id": 23, "id": 23,
@ -203,7 +181,6 @@
"nom": "Doe", "nom": "Doe",
"prenom": "John", "prenom": "John",
"contexte": "Jvais dire wallah", "contexte": "Jvais dire wallah",
"description": "Wallah c`est la description", "description": "Wallah c`est la description"
"urgence": true
} }
] ]

@ -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
}
]
Loading…
Cancel
Save