commit 430cdbe677590616613c7377cb151db9adadc9d1
Author: Dominik Chlouba <dchlouba@students.zcu.cz>
Date:   Mon May 24 23:25:06 2021 +0200

    Bug and UI fixes, removing areas, definitions and goals, authorize view restrictions

diff --git a/src/Core/Application/Leuze.Core.Application.UI/App.razor b/src/Core/Application/Leuze.Core.Application.UI/App.razor
index 85c5ef7..4b252ba 100644
--- a/src/Core/Application/Leuze.Core.Application.UI/App.razor
+++ b/src/Core/Application/Leuze.Core.Application.UI/App.razor
@@ -5,7 +5,7 @@
         <Found Context="routeData">
             <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
                 <NotAuthorized>
-                    <p>Nemáte potřebná oprávnění</p>
+                    <RedirectToLogin/>
                 </NotAuthorized>
                 <Authorizing>
                     <p>Just checking with the boss you can come in.</p>
diff --git a/src/Core/Application/Leuze.Core.Application.UI/Components/Login/Form.razor b/src/Core/Application/Leuze.Core.Application.UI/Components/Login/Form.razor
index 1314c89..85ac69d 100644
--- a/src/Core/Application/Leuze.Core.Application.UI/Components/Login/Form.razor
+++ b/src/Core/Application/Leuze.Core.Application.UI/Components/Login/Form.razor
@@ -101,25 +101,17 @@
     height: 24px;
 </Styled>
 
-<form @onsubmit="Login" class="@_form">
+<form @onsubmit="Change" class="@_form">
     <div class="@_row">
-        <label class="@_label">@T["Email"]</label>
-        <input class="@_input" type="email" @bind-value="Email" />
+        <label class="@_label">@T["Password"]</label>
+        <input class="@_input" type="password" @bind-value="Password" />
     </div>
     <div class="@_row">
         <label class="@_label">@T["Password"]</label>
-        <input class="@_input" type="password" @bind-value="Password" />
+        <input class="@_input" type="password" @bind-value="PasswordAgain" />
     </div>
     <p>@Error</p>
-    <button @onclick="Login" class="@_button" @onkeypress:preventDefault>@T["Login"]</button>
-    <div class="@_or">
-        <div class="@_orText">@T["Or"]</div>
-    </div>
-    <div class="@_adWrapper">
-        <a href="MicrosoftIdentity/Account/SignIn">
-            <img class="@_microsoft" src="/Resources/Icons/microsoft-logo.svg" />
-        </a>
-    </div>
+    <button @onclick="Change" class="@_button" @onkeypress:preventDefault>@T["Change"]</button>
 </form>
 
 @code {
@@ -133,17 +125,19 @@
     private string _adWrapper = null!;
     private string _microsoft = null!;
 
-    private string Email { get; set; } = string.Empty;
     private string Password { get; set; } = string.Empty;
+    private string PasswordAgain { get; set; } = string.Empty;
 
     private string Error { get; set; } = string.Empty;
 
-    private async Task Login()
+    private async Task Change()
     {
-        var result = await _mediator.Send(new VerifyLocalUser.Command(Email, Password));
+        /*var result = await _mediator.Send(new VerifyLocalUser.Command(Email, Password));
 
         if (!result.IsSuccess) Error = result.Errors.First();
-        else _navManager.NavigateTo("/");
+        else _navManager.NavigateTo("/");*/
+
+        //TODO: Change password
 
     }
 
diff --git a/src/Core/Application/Leuze.Core.Application.UI/Shared/NavMenu.razor b/src/Core/Application/Leuze.Core.Application.UI/Shared/NavMenu.razor
index e463655..39dd571 100644
--- a/src/Core/Application/Leuze.Core.Application.UI/Shared/NavMenu.razor
+++ b/src/Core/Application/Leuze.Core.Application.UI/Shared/NavMenu.razor
@@ -6,24 +6,30 @@
                 <span>Přehled</span>
             </div>
         </NavLink>
-        <NavLink href="/goals">
-            <div class="item">
-                <img src="/Resources/Icons/clipboard-list-check.svg" class="item_icon nav_icon_2" />
-                <span>Správa cílů</span>
-            </div>
-        </NavLink>
-        <NavLink href="/my-goals">
-            <div class="item">
-                <img src="/Resources/Icons/clipboard-list-check.svg" class="item_icon nav_icon_2" />
-                <span>Mé cíle</span>
-            </div>
-        </NavLink>
-        <NavLink href="/users">
-            <div class="item">
-                <img src="/Resources/Icons/user.svg" class="item_icon nav_icon_3" />
-                <span>Uživatelé</span>
-            </div>
-        </NavLink>
+        <AuthorizeView Roles="Admin, TL">
+            <NavLink href="/goals">
+                <div class="item">
+                    <img src="/Resources/Icons/clipboard-list-check.svg" class="item_icon nav_icon_2" />
+                    <span>Správa cílů</span>
+                </div>
+            </NavLink>
+        </AuthorizeView>
+        <AuthorizeView Roles="TL, MA">
+            <NavLink href="/my-goals">
+                <div class="item">
+                    <img src="/Resources/Icons/clipboard-list-check.svg" class="item_icon nav_icon_2" />
+                    <span>Mé cíle</span>
+                </div>
+            </NavLink>
+        </AuthorizeView>
+        <AuthorizeView Roles="Admin">
+            <NavLink href="/users">
+                <div class="item">
+                    <img src="/Resources/Icons/user.svg" class="item_icon nav_icon_3" />
+                    <span>Uživatelé</span>
+                </div>
+            </NavLink>
+        </AuthorizeView>
     </nav>
 </aside>
 
diff --git a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalDefinitionDetail.razor b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalDefinitionDetail.razor
index cc6cafe..b119289 100644
--- a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalDefinitionDetail.razor
+++ b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalDefinitionDetail.razor
@@ -1,8 +1,9 @@
 ﻿@page "/goals/detail/{Id:guid}"
-@attribute [Authorize]
+@attribute [Authorize(Roles = "TL,MA")]
 @layout MainLayout
 @inject IMediator _mediator
-@inject IStringLocalizer<GoalDefinitionDetail> T 
+@inject IJSRuntime JsRuntime
+@inject IStringLocalizer<GoalDefinitionDetail> T
 
 <div class="section_header">
     <div>
@@ -21,46 +22,39 @@
 </div>
 @if (Goals is not null)
 {
-    <table class="actions" style="width:100%">
-        <tr>
-            <th>@T["Name"]</th>
-            <th>@T["CreatedBy"]</th>
-            <th>@T["ResultUser"]</th>
-            <th>@T["ResultSenior"]</th>
-            <th>@T["Actions"]</th>
-        </tr>
-        @foreach (var range in Goals)
-        {
-            <tr>
-                <td>@range.Name</td>
-                <td>@range.Creator.Name</td>
-                <td>@range.PercentileUser</td>
-                <td>@range.PercentileFinal</td>
-                <td>
-                    <div class="flex">
-                        <div></div>
-                        <div @onclick='() => SetDetailId(range.Id)'>
-                            <i class="fal fa-eye"></i>
-                            @T["Open"]
-                        </div>
-                        <div>
-                            <i class="fal fa-edit"></i>
-                            @T["Edit"]
-                        </div>
-                        <div>
-                            <i class="fal fa-trash"></i>
-                            @T["Remove"]
-                        </div>
-                    </div>
-                </td>
-            </tr>
-        }
-    </table>
-}
-else
-{
-<div>@T["Loading"]</div>
-}
+<table class="actions" style="width:100%">
+    <tr>
+        <th>@T["Name"]</th>
+        <th>@T["CreatedBy"]</th>
+        <th>@T["ResultUser"]</th>
+        <th>@T["ResultSenior"]</th>
+        <th>@T["Actions"]</th>
+    </tr>
+    @foreach (var range in Goals)
+    {
+<tr>
+    <td>@range.Name</td>
+    <td>@range.Creator.Name</td>
+    <td>@range.PercentileUser</td>
+    <td>@range.PercentileFinal</td>
+    <td>
+        <div class="flex">
+            <div></div>
+            <div @onclick='() => SetDetailId(range.Id)'>
+                <i class="fal fa-eye"></i>
+                @T["Open"]
+            </div>
+            <div @onclick="() => RemoveGoal(range.Id)">
+                <i class="fal fa-trash"></i>
+                @T["Remove"]
+            </div>
+        </div>
+    </td>
+</tr>}
+</table> }
+            else
+            {
+<div>@T["Loading"]</div>}
 
 <Leuze.Modules.Goal.Application.UI.Pages.Components.GoalDetailAside Show="DetailId != default(Guid)" DetailId="DetailId" CloseAside="CloseDetailAside" />
 <Leuze.Modules.Goal.Application.UI.Pages.Components.CreateGoalAside Show="ShowCreate" DefinitionId="Id" CloseAside="CloseCreateAside" LoadGoalsInDefinitionView="GetGoals" />
@@ -174,53 +168,58 @@ else
     }
 </BlazorStyled.Styled>
 
-@code {
+@code { [Parameter]
+            public Guid Id { get; set; }
 
-    [Parameter]
-    public Guid Id { get; set; }
+            private GoalDefinition _definition = GoalDefinition.Default();
 
-    private GoalDefinition _definition = GoalDefinition.Default();
+            public List<GoalItem> Goals { get; set; } = new();
 
-    public List<GoalItem> Goals { get; set; } = new();
+            public Guid DetailId { get; set; } = default(Guid);
 
-    public Guid DetailId { get; set; } = default(Guid);
+            public bool ShowCreate { get; set; } = false;
 
-    public bool ShowCreate { get; set; } = false;
+            private void SetDetailId(Guid id) => DetailId = id;
 
-    private void SetDetailId(Guid id) => DetailId = id;
+            private void CloseDetailAside() => DetailId = default(Guid);
 
-    private void CloseDetailAside() => DetailId = default(Guid);
+            private void OpenCreateAside() => ShowCreate = true;
 
-    private void OpenCreateAside() => ShowCreate = true;
+            private void CloseCreateAside() => ShowCreate = false;
 
-    private void CloseCreateAside() => ShowCreate = false;
+            private async Task GetDefinitionInfo()
+            {
+                var response = await _mediator.Send(new GetGoalDefinitionById.Query(Id));
 
-    private async Task GetDefinitionInfo()
-    {
-        var response = await _mediator.Send(new GetGoalDefinitionById.Query(Id));
+                if (response.IsSuccess)
+                {
+                    _definition = response.Result.item;
+                }
+            }
 
-        if (response.IsSuccess)
-        {
-            _definition = response.Result.item;
-        }
-    }
+            private async Task RemoveGoal(Guid id)
+            {
+                bool confirmed = await JsRuntime.InvokeAsync<bool>("confirm", "Are you sure?");
+                if (confirmed)
+                {
+                    var response = await _mediator.Send(new RemoveGoal.Command(id));
+                    await GetGoals();
+                }
+            }
 
-    private async Task GetGoals()
-    {
-        var response = await _mediator.Send(new GetGoalsForDefinition.Query(Id));
-
-        if (response.IsSuccess)
-        {
-            Goals = response.Result.list;
-        }
-    }
-
-    protected async override Task OnInitializedAsync()
-    {
-        await base.OnInitializedAsync();
-        await GetDefinitionInfo();
-        await GetGoals();
-    }
+            private async Task GetGoals()
+            {
+                var response = await _mediator.Send(new GetGoalsForDefinition.Query(Id));
 
+                if (response.IsSuccess)
+                {
+                    Goals = response.Result.list;
+                }
+            }
 
-}
+            protected async override Task OnInitializedAsync()
+            {
+                await base.OnInitializedAsync();
+                await GetDefinitionInfo();
+                await GetGoals();
+            } }
diff --git a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalRanges.razor b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalRanges.razor
index 5119e12..2defae1 100644
--- a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalRanges.razor
+++ b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalRanges.razor
@@ -1,9 +1,10 @@
 ﻿@page "/goals"
 @attribute [Authorize]
 @layout MainLayout
+@inject IJSRuntime JsRuntime
 @inject IMediator _mediator
-@inject NavigationManager _nav 
-@inject IStringLocalizer<GoalRanges> T 
+@inject NavigationManager _nav
+@inject IStringLocalizer<GoalRanges> T
 
 <div class="section_header">
     <h2>@T["Title"]</h2>
@@ -14,60 +15,57 @@
 </div>
 @if (Ranges is not null)
 {
-    <table class="actions" style="width:100%">
-        <tr>
-            <th>@T["Start"]</th>
-            <th>@T["End"]</th>
-            <th>@T["Result"]</th>
-            <th>@T["Actions"]</th>
-        </tr>
-        @foreach (var range in Ranges)
-        {
-            <tr>
-                <td>@range.From.ToShortDateString()</td>
-                <td>@range.To.ToShortDateString()</td>
-                <td>@(range.VariCompanySuccess ?? 0)</td>
-                <td>
-                    <div class="flex">
-                        <div>
-                            <i class="fal fa-download"></i>
-                            @T["Export"]
-                        </div>
-                        <div @onclick='() => _nav.NavigateTo($"/goals/overview/{range.Id}")'>
-                            <i class="fal fa-eye"></i>
-                            @T["Open"]
-                        </div>
-                        <div @onclick="() => OpenAside(range.Id)">
-                            <i class="fal fa-edit"></i>
-                            @T["Edit"]
-                        </div>
-                        <div>
-                            <i class="fal fa-trash"></i>
-                            @T["Remove"]
-                        </div>
-                    </div>
-                </td>
-            </tr>
-        }
-    </table>
-    @if (Ranges.Count > 0)
+<table class="actions" style="width:100%">
+    <tr>
+        <th>@T["Start"]</th>
+        <th>@T["End"]</th>
+        <th>@T["Result"]</th>
+        <th>@T["Actions"]</th>
+    </tr>
+    @foreach (var range in Ranges)
     {
-        <!--<div class="pagination">
-            <div class="left">
-                <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-double-left.svg" /></button>
-                <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-left.svg" /></button>
-                <input type="number" @bind-value="PageNumber" />
-                <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-right.svg" /></button>
-                <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-double-right.svg" /></button>
+<tr>
+    <td>@range.From.ToShortDateString()</td>
+    <td>@range.To.ToShortDateString()</td>
+    <td>@(range.VariCompanySuccess ?? 0)</td>
+    <td>
+        <div class="flex">
+            <div>
+                <i class="fal fa-download"></i>
+                @T["Export"]
             </div>
-            <div class="right">@T["Show"] <b>@Ranges.Count @T["From"] @Total</b></div>
-        </div>-->
-    }
-}
-else
-{
-    <div>Loading...</div>
-}
+
+                <div @onclick='() => _nav.NavigateTo($"/goals/overview/{range.Id}")'>
+                    <i class="fal fa-eye"></i>
+                    @T["Open"]
+                </div>
+                <div @onclick="() => OpenAside(range.Id)">
+                    <i class="fal fa-edit"></i>
+                    @T["Edit"]
+                </div>
+                <div @onclick="() => RemoveArea(range.Id)">
+                    <i class="fal fa-trash"></i>
+                    @T["Remove"]
+                </div>
+        </div>
+    </td>
+</tr>}
+</table>
+                @if (Ranges.Count > 0)
+                {
+<!--<div class="pagination">
+    <div class="left">
+        <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-double-left.svg" /></button>
+        <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-left.svg" /></button>
+        <input type="number" @bind-value="PageNumber" />
+        <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-right.svg" /></button>
+        <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-double-right.svg" /></button>
+    </div>
+    <div class="right">@T["Show"] <b>@Ranges.Count @T["From"] @Total</b></div>
+</div>-->} }
+                            else
+                            {
+                <div>Loading...</div>}
 <Leuze.Modules.Goal.Application.UI.Pages.Components.CreateDefinitionRangeAside Show="ShowAside" AsideId="AsideId" LoadAreasInView="LoadAreas" CloseAside="CloseAside" />
 
 <BlazorStyled.Styled>
@@ -181,41 +179,47 @@ else
     }
 </BlazorStyled.Styled>
 
-@code {
-
-    [Parameter]
-    public string Id { get; set; } = null!;
+@code { [Parameter]
+            public string Id { get; set; } = null!;
 
-    private List<GlobalDefinitionArea> Ranges { get; set; } = new() { };
+            private List<GlobalDefinitionArea> Ranges { get; set; } = new() { };
 
-    private int PageNumber { get; set; } = 1;
+            private int PageNumber { get; set; } = 1;
 
-    private int PageSize { get; set; } = 12;
+            private int PageSize { get; set; } = 12;
 
-    private int Total { get; set; } = 0;
+            private int Total { get; set; } = 0;
 
-    private Guid AsideId { get; set; } = default(Guid);
+            private Guid AsideId { get; set; } = default(Guid);
 
-    private bool ShowAside { get; set; } = false;
+            private bool ShowAside { get; set; } = false;
 
-    private void OpenAside(Guid id) => (AsideId, ShowAside) = (id, true);
+            private void OpenAside(Guid id) => (AsideId, ShowAside) = (id, true);
 
-    private void CloseAside() => (AsideId, ShowAside) = (default(Guid), false);
+            private void CloseAside() => (AsideId, ShowAside) = (default(Guid), false);
 
-    private async Task LoadAreas()
-    {
-        var response = await _mediator.Send(new GetAllAreas.Query());
+            private async Task LoadAreas()
+            {
+                var response = await _mediator.Send(new GetAllAreas.Query());
 
-        if (response.IsSuccess)
-        {
-            Ranges = response.Result.list;
-        }
-    }
+                if (response.IsSuccess)
+                {
+                    Ranges = response.Result.list;
+                }
+            }
 
-    protected async override Task OnInitializedAsync()
-    {
-        await base.OnInitializedAsync();
-        await LoadAreas();
-    }
+            private async Task RemoveArea(Guid id)
+            {
+                bool confirmed = await JsRuntime.InvokeAsync<bool>("confirm", "Are you sure?");
+                if (confirmed)
+                {
+                    var response = await _mediator.Send(new RemoveArea.Command(id));
+                    await LoadAreas();
+                }
+            }
 
-}
+            protected async override Task OnInitializedAsync()
+            {
+                await base.OnInitializedAsync();
+                await LoadAreas();
+            } }
diff --git a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalsManagement.razor b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalsManagement.razor
index 7a9961a..d73be0a 100644
--- a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalsManagement.razor
+++ b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalsManagement.razor
@@ -3,7 +3,8 @@
 @layout MainLayout
 @inject IMediator _mediator
 @inject NavigationManager _nav
-@inject IStringLocalizer<GoalsManagement> T 
+@inject IJSRuntime JsRuntime
+@inject IStringLocalizer<GoalsManagement> T
 
 <div class="section_header">
     <h2>@T["Title"]</h2>
@@ -12,64 +13,65 @@
             <i class="fal fa-layer-plus"></i>
             <span>@T["InitAll"]</span>
         </button>
-        <button type="button" @onclick="() => OpenAside(default(Guid))">
-            <i class="fal fa-plus"></i>
-            <span>@T["AddDef"]</span>
-        </button>
+
+        <AuthorizeView Roles="TL">
+            <button type="button" @onclick="() => OpenAside(default(Guid))">
+                <i class="fal fa-plus"></i>
+                <span>@T["AddDef"]</span>
+            </button>
+        </AuthorizeView>
     </div>
 </div>
 @if (Definitions is not null)
 {
-    <table class="actions" style="width:100%">
-        <tr>
-            <th>@T["Name"]</th>
-            <th>@T["User"]</th>
-            <th>@T["CreatedBy"]</th>
-            <th>@T["Actions"]</th>
-        </tr>
-        @foreach (var range in Definitions)
-        {
-            <tr>
-                <td>@range.Name</td>
-                <td>@range.Owner.Name</td>
-                <td>@range.Creator.Name</td>
-                <td>
-                    <div class="flex">
-                        <div @onclick='() => _nav.NavigateTo($"/goals/detail/{range.Id}")'>
-                            <i class="fal fa-eye"></i>
-                            @T["Open"]
-                        </div>
-                        <div @onclick="() => OpenAside(range.Id)">
-                            <i class="fal fa-edit"></i>
-                            @T["Edit"]
-                        </div>
-                        <div>
-                            <i class="fal fa-trash"></i>
-                            @T["Remove"]
-                        </div>
-                    </div>
-                </td>
-            </tr>
-        }
-    </table>
-    @if (Definitions.Count > 0)
+<table class="actions" style="width:100%">
+    <tr>
+        <th>@T["Name"]</th>
+        <th>@T["User"]</th>
+        <th>@T["CreatedBy"]</th>
+        <th>@T["Actions"]</th>
+    </tr>
+    @foreach (var range in Definitions)
     {
-        <!--<div class="pagination">
-            <div class="left">
-                <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-double-left.svg" /></button>
-                <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-left.svg" /></button>
-                <input type="number" @bind-value="PageNumber" />
-                <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-right.svg" /></button>
-                <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-double-right.svg" /></button>
-            </div>
-            <div class="right">@T["Show"] <b>@Ranges.Count @T["From"] @Total</b></div>
-        </div>-->
-    }
-}
-else
-{
-    <div>Loading...</div>
-}
+<tr>
+    <td>@range.Name</td>
+    <td>@range.Owner.Name</td>
+    <td>@range.Creator.Name</td>
+    <td>
+        <div class="flex">
+            <AuthorizeView Roles="TL">
+                <div @onclick='() => _nav.NavigateTo($"/goals/detail/{range.Id}")'>
+                    <i class="fal fa-eye"></i>
+                    @T["Open"]
+                </div>
+                <div @onclick="() => OpenAside(range.Id)">
+                    <i class="fal fa-edit"></i>
+                    @T["Edit"]
+                </div>
+                <div @onclick="() => RemoveDefinition(range.Id)">
+                    <i class="fal fa-trash"></i>
+                    @T["Remove"]
+                </div>
+            </AuthorizeView>
+        </div>
+    </td>
+</tr>}
+</table>
+                @if (Definitions.Count > 0)
+                {
+<!--<div class="pagination">
+    <div class="left">
+        <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-double-left.svg" /></button>
+        <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-left.svg" /></button>
+        <input type="number" @bind-value="PageNumber" />
+        <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-right.svg" /></button>
+        <button class="pagination_button"><img class="pagination_icon" src="/Resources/Icons/chevron-double-right.svg" /></button>
+    </div>
+    <div class="right">@T["Show"] <b>@Ranges.Count @T["From"] @Total</b></div>
+</div>-->} }
+                            else
+                            {
+                <div>Loading...</div>}
 <Leuze.Modules.Goal.Application.UI.Pages.Components.CreateGoalDefinition Show="ShowAside" CloseAside="CloseAside" />
 
 <BlazorStyled.Styled>
@@ -133,7 +135,7 @@ else
     justify-content: right;
     }
     .header_buttons > button:not(:last-child) {
-        margin-right: 12px;
+    margin-right: 12px;
     }
     .flex{
     display: grid;
@@ -191,39 +193,45 @@ else
     }
 </BlazorStyled.Styled>
 
-@code {
+@code { [Parameter]
+            public Guid Id { get; set; } = default(Guid);
 
-    [Parameter]
-    public Guid Id { get; set; } = default(Guid);
+            private List<GoalDefinition> Definitions { get; set; } = new();
 
-    private List<GoalDefinition> Definitions { get; set; } = new();
+            private int PageNumber { get; set; } = 1;
 
-    private int PageNumber { get; set; } = 1;
+            private int PageSize { get; set; } = 12;
 
-    private int PageSize { get; set; } = 12;
+            private int Total { get; set; } = 0;
 
-    private int Total { get; set; } = 0;
+            private bool ShowAside { get; set; } = false;
 
-    private bool ShowAside { get; set; } = false;
+            private void OpenAside(Guid id) => (ShowAside) = (true);
 
-    private void OpenAside(Guid id) => (ShowAside) = (true);
+            private void CloseAside() => (ShowAside) = (false);
 
-    private void CloseAside() => (ShowAside) = (false);
+            private async Task GetMyDefinitions()
+            {
+                var response = await _mediator.Send(new GetAllForArea.Query(Id));
 
-    private async Task GetMyDefinitions()
-    {
-        var response = await _mediator.Send(new GetAllForArea.Query(Id));
+                if (response.IsSuccess)
+                {
+                    Definitions = response.Result.list;
+                }
+            }
 
-        if (response.IsSuccess)
-        {
-            Definitions = response.Result.list;
-        }
-    }
-
-    protected async override Task OnInitializedAsync()
-    {
-        await base.OnInitializedAsync();
-        await GetMyDefinitions();
-    }
+            private async Task RemoveDefinition(Guid id)
+            {
+                bool confirmed = await JsRuntime.InvokeAsync<bool>("confirm", "Are you sure?");
+                if (confirmed)
+                {
+                    var response = await _mediator.Send(new RemoveDefinition.Command(id));
+                    await GetMyDefinitions();
+                }
+            }
 
-}
+            protected async override Task OnInitializedAsync()
+            {
+                await base.OnInitializedAsync();
+                await GetMyDefinitions();
+            } }
diff --git a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/_Imports.razor b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/_Imports.razor
index b30e78a..3e2a454 100644
--- a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/_Imports.razor
+++ b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/_Imports.razor
@@ -27,9 +27,9 @@
 @using Leuze.Modules.Goal.Application.CQRS.Goals.Commands
 @using Leuze.Modules.Goal.Application.CQRS.Goals.Queries
 @using Leuze.Modules.Goal.Application.CQRS.GoalDefinitions.Queries
+@using Leuze.Modules.Goal.Application.CQRS.GoalDefinitions.Commands
 @using Leuze.Modules.Goal.Application.CQRS.GoalDefinitionAreas.Commands
 @using Leuze.Modules.Goal.Application.CQRS.GoalDefinitionAreas.Queries
 @using Leuze.Modules.Goal.Domain.Domains
-@using Leuze.Core.Domain.Domains.Users
 @using Microsoft.Extensions.Localization
 @using Microsoft.AspNetCore.Localization
\ No newline at end of file
diff --git a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/GoalDefinitionAreas/Commands/RemoveArea.cs b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/GoalDefinitionAreas/Commands/RemoveArea.cs
new file mode 100644
index 0000000..eb3f4d3
--- /dev/null
+++ b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/GoalDefinitionAreas/Commands/RemoveArea.cs
@@ -0,0 +1,36 @@
+﻿using Leuze.Core.Application.CQRS;
+using Leuze.Modules.Goal.Domain.Repositories;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Leuze.Modules.Goal.Application.CQRS.GoalDefinitionAreas.Commands
+{
+    public static class RemoveArea
+    {
+
+        public record Command(Guid Id) : IBaseRequest<Response>;
+
+        public record Response();
+
+        public class Handler : IBaseRequestHandler<Command, Response>
+        {
+            private readonly IGlobalDefinitionAreaRepository _repository;
+
+            public Handler(IGlobalDefinitionAreaRepository repository)
+                => (_repository) = (repository);
+
+            public async Task<RequestResponse<Response>> Handle(Command request, CancellationToken cancellationToken)
+            {
+                if (!await _repository.RemoveAsync(request.Id))
+                    return RequestResponse<Response>.CreateErrorResponse($"Area with ID '{request.Id}' not found");
+
+                return RequestResponse<Response>.CreateSuccessResponse(new());
+            }
+        }
+
+    }
+}
diff --git a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/GoalDefinitions/Commands/RemoveDefinition.cs b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/GoalDefinitions/Commands/RemoveDefinition.cs
new file mode 100644
index 0000000..c6e8387
--- /dev/null
+++ b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/GoalDefinitions/Commands/RemoveDefinition.cs
@@ -0,0 +1,33 @@
+﻿using Leuze.Core.Application.CQRS;
+using Leuze.Modules.Goal.Domain.Repositories;
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Leuze.Modules.Goal.Application.CQRS.GoalDefinitions.Commands
+{
+    public static class RemoveDefinition
+    {
+
+        public record Command(Guid Id) : IBaseRequest<Response>;
+
+        public record Response();
+
+        public class Handler : IBaseRequestHandler<Command, Response>
+        {
+            private readonly IGoalDefinitionRepository _repository;
+
+            public Handler(IGoalDefinitionRepository repository)
+                => (_repository) = (repository);
+
+            public async Task<RequestResponse<Response>> Handle(Command request, CancellationToken cancellationToken)
+            {
+                if (!await _repository.RemoveAsync(request.Id))
+                    return RequestResponse<Response>.CreateErrorResponse($"Definition with ID '{request.Id}' not found");
+
+                return RequestResponse<Response>.CreateSuccessResponse(new());
+            }
+        }
+
+    }
+}
diff --git a/src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/Goals/Commands/RemoveGoal.cs b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/Goals/Commands/RemoveGoal.cs
new file mode 100644
index 0000000..06b449b
--- /dev/null
+++ b/src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/Goals/Commands/RemoveGoal.cs
@@ -0,0 +1,33 @@
+﻿using Leuze.Core.Application.CQRS;
+using Leuze.Modules.Goal.Domain.Repositories;
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Leuze.Modules.Goal.Application.CQRS.Goals.Commands
+{
+    public static class RemoveGoal
+    {
+
+        public record Command(Guid Id) : IBaseRequest<Response>;
+
+        public record Response();
+
+        public class Handler : IBaseRequestHandler<Command, Response>
+        {
+            private readonly IGoalItemRepository _repository;
+
+            public Handler(IGoalItemRepository repository)
+                => (_repository) = (repository);
+
+            public async Task<RequestResponse<Response>> Handle(Command request, CancellationToken cancellationToken)
+            {
+                if (!await _repository.RemoveAsync(request.Id))
+                    return RequestResponse<Response>.CreateErrorResponse($"Goal with ID '{request.Id}' not found");
+
+                return RequestResponse<Response>.CreateSuccessResponse(new());
+            }
+        }
+
+    }
+}
diff --git a/tests/Core/Leuze.Tests.Core/RoleTests.cs b/tests/Core/Leuze.Tests.Core/RoleTests.cs
index a405563..743bc64 100644
--- a/tests/Core/Leuze.Tests.Core/RoleTests.cs
+++ b/tests/Core/Leuze.Tests.Core/RoleTests.cs
@@ -38,7 +38,7 @@ namespace Leuze.Tests.Core
             var AuthenticationStateProviderMock = new Mock<AuthenticatedUserProvider>();
             AuthenticationStateProviderMock.Setup(e => e.RequiredUserId).Returns(user.Id);
 
-            var handler = new GetUsersList.Handler(DatabaseFixture.UserManager)
+            //var handler = new GetUsersList.Handler(DatabaseFixture.UserManager);
 
             _semaphore.Release();
         }
