fixes #5 : should block all possible attemps to delete order after locking
also redirects from edit page to list when locked
This commit is contained in:
parent
b0d1d5c7cc
commit
157b426ce9
2 changed files with 21 additions and 2 deletions
|
|
@ -61,6 +61,10 @@
|
||||||
{
|
{
|
||||||
<button @onclick="ShowDeleteConfirmation"> 🗑 Delete </button>
|
<button @onclick="ShowDeleteConfirmation"> 🗑 Delete </button>
|
||||||
}
|
}
|
||||||
|
else if (GlobalStuffService.OrdersLocked)
|
||||||
|
{
|
||||||
|
<p>Orders have been locked!</p>
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -127,10 +131,10 @@
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
.priority-slider-container{
|
.priority-slider-container {
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction:row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
font-size: 0.75em;
|
font-size: 0.75em;
|
||||||
|
|
@ -166,6 +170,16 @@
|
||||||
{
|
{
|
||||||
Navigation.NavigateTo("/orderlist", true);
|
Navigation.NavigateTo("/orderlist", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EventHandler NavigateOnLock = async (sender, eventArgs) =>
|
||||||
|
{
|
||||||
|
if (GlobalStuffService.OrdersLocked)
|
||||||
|
{
|
||||||
|
Navigation.NavigateTo("/orderlist", true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
GlobalStuffService.OnLockOrMessageChange += NavigateOnLock;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormSubmitted(EditContext editContext)
|
void FormSubmitted(EditContext editContext)
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,11 @@ namespace PizzaBot.Services
|
||||||
|
|
||||||
public void DeleteById(int id)
|
public void DeleteById(int id)
|
||||||
{
|
{
|
||||||
|
if (_globalStuffService.OrdersLocked)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var request = _context.Requests.Find(id);
|
var request = _context.Requests.Find(id);
|
||||||
var result = _context.Results.Find(id);
|
var result = _context.Results.Find(id);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue