Revize 6391f3f2
Přidáno uživatelem Dominik Chlouba před téměř 4 roky(ů)
src/Core/Application/Leuze.Core.Application.UI/Shared/NavMenu.razor | ||
---|---|---|
12 | 12 |
<span>Správa cílů</span> |
13 | 13 |
</div> |
14 | 14 |
</NavLink> |
15 |
<NavLink href="/my-goals"> |
|
16 |
<div class="item"> |
|
17 |
<img src="/Resources/Icons/clipboard-list-check.svg" class="item_icon nav_icon_2" /> |
|
18 |
<span>Mé cíle</span> |
|
19 |
</div> |
|
20 |
</NavLink> |
|
15 | 21 |
<NavLink href="/users"> |
16 | 22 |
<div class="item"> |
17 | 23 |
<img src="/Resources/Icons/user.svg" class="item_icon nav_icon_3" /> |
18 | 24 |
<span>Uživatelé</span> |
19 | 25 |
</div> |
20 | 26 |
</NavLink> |
21 |
</nav> |
|
27 |
</nav>
|
|
22 | 28 |
</aside> |
23 | 29 |
|
24 | 30 |
<Styled @bind-Classname="@_aside"> |
src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Class1.cs | ||
---|---|---|
1 |
using System; |
|
2 |
|
|
3 |
namespace Leuze.Modules.Goal.Application.UI |
|
4 |
{ |
|
5 |
public class Class1 |
|
6 |
{ |
|
7 |
} |
|
8 |
} |
src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/GoalUIExtension.cs | ||
---|---|---|
1 |
using ExtCore.Infrastructure; |
|
2 |
|
|
3 |
namespace Leuze.Modules.Goal.Application.UI |
|
4 |
{ |
|
5 |
/// <summary> |
|
6 |
/// |
|
7 |
/// </summary> |
|
8 |
public class CoreUIExtension : ExtensionBase |
|
9 |
{ |
|
10 |
/// <summary> |
|
11 |
/// |
|
12 |
/// </summary> |
|
13 |
public override string Name => "Goals UI Extension"; |
|
14 |
} |
|
15 |
} |
src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Leuze.Modules.Goal.Application.UI.csproj | ||
---|---|---|
1 |
<Project Sdk="Microsoft.NET.Sdk"> |
|
1 |
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
2 | 2 |
|
3 | 3 |
<PropertyGroup> |
4 | 4 |
<AssemblyName>Leuze.Modules.Goal.Application.UI</AssemblyName> |
... | ... | |
9 | 9 |
|
10 | 10 |
<PropertyGroup> |
11 | 11 |
<TargetFramework>net5.0</TargetFramework> |
12 |
<OutputType>Library</OutputType> |
|
12 | 13 |
<Nullable>enable</Nullable> |
13 | 14 |
<GenerateDocumentationFile>true</GenerateDocumentationFile> |
14 | 15 |
</PropertyGroup> |
15 | 16 |
|
16 | 17 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
17 | 18 |
<OutputPath>..\..\..\..\Presentation\Leuze.Modules\</OutputPath> |
18 |
<DocumentationFile>..\..\..\..\docs\Leuze.Modules.Goal.Application.UI.xml</DocumentationFile> |
|
19 |
<DocumentationFile>..\..\..\..\..\docs\Leuze.Modules.Goal.Application.UI.xml</DocumentationFile>
|
|
19 | 20 |
</PropertyGroup> |
20 | 21 |
|
21 | 22 |
<ItemGroup> |
... | ... | |
23 | 24 |
<ProjectReference Include="..\Leuze.Modules.Goal.Application\Leuze.Modules.Goal.Application.csproj" /> |
24 | 25 |
</ItemGroup> |
25 | 26 |
|
27 |
<ItemGroup> |
|
28 |
<Folder Include="Pages\Components\" /> |
|
29 |
</ItemGroup> |
|
30 |
|
|
26 | 31 |
</Project> |
src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/GoalDefinitionDetail.razor | ||
---|---|---|
1 |
@page "/goal/detail" |
|
2 |
<div class="section_header"> |
|
3 |
<h2>Mé definice cílů</h2> |
|
4 |
</div> |
|
5 |
<div>From - to</div> |
|
6 |
<section> |
|
7 |
<div class="goal_def_item goal_item_closed"> |
|
8 |
<div class="goal_def_name">Název cíle</div> |
|
9 |
<div class="goal_def_bottom"> |
|
10 |
<div class="goal_creator"> |
|
11 |
<span>David Vytvořílek</span> |
|
12 |
<span>3. 5. 2021</span> |
|
13 |
</div> |
|
14 |
<div class="goal_percentile"> |
|
15 |
<span>80%</span> |
|
16 |
<span>150%</span> |
|
17 |
</div> |
|
18 |
</div> |
|
19 |
</div> |
|
20 |
</section> |
|
21 |
<aside class="goal_detail"> |
|
22 |
<div class="goal_detail_header"> |
|
23 |
Tools budou zde |
|
24 |
</div> |
|
25 |
<div class="goal_detail_body"> |
|
26 |
<div class="goal_detail_area"> |
|
27 |
<input class="goal_name" type="text" placeholder="Zadejte název cíle" /> |
|
28 |
<div class="goal_description_title">Popis cíle</div> |
|
29 |
<textarea class="goal_description" placeholder="Vyplňte popis cíle"></textarea> |
|
30 |
</div> |
|
31 |
<div class="goal_communication_area"> |
|
32 |
<div class="goal_communication_item"> |
|
33 |
Dominik Chlouba vytvořil tento cíl. <span class="date">3. 5. 2021</span> |
|
34 |
</div> |
|
35 |
<div class="goal_communication_item"> |
|
36 |
<div class="item_tool"> |
|
37 |
<div>Dominik Chlouba přidal komentář. <span class="date">3. 5. 2021</span></div> |
|
38 |
<div>Edit Smazat</div> |
|
39 |
</div> |
|
40 |
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</p> |
|
41 |
</div> |
|
42 |
<div class="goal_communication_item"> |
|
43 |
Dominik Chlouba aktualizoval popis cíle. <span class="date">3. 5. 2021</span> |
|
44 |
</div> |
|
45 |
<div class="goal_communication_item"> |
|
46 |
Dominik Chlouba aktualizoval popis cíle. <span class="date">3. 5. 2021</span> |
|
47 |
</div> |
|
48 |
<div class="goal_communication_item"> |
|
49 |
Dominik Chlouba aktualizoval popis cíle. <span class="date">3. 5. 2021</span> |
|
50 |
</div> |
|
51 |
<div class="goal_communication_item"> |
|
52 |
Dominik Chlouba aktualizoval popis cíle. <span class="date">3. 5. 2021</span> |
|
53 |
</div> |
|
54 |
<div class="goal_communication_item"> |
|
55 |
Dominik Chlouba aktualizoval popis cíle. <span class="date">3. 5. 2021</span> |
|
56 |
</div> |
|
57 |
</div> |
|
58 |
</div> |
|
59 |
<div class="goal_detail_footer"> |
|
60 |
<textarea placeholder="Přidat soukromý či veřejný komentář"></textarea> |
|
61 |
<div class="goal_comment_tools"> |
|
62 |
<select> |
|
63 |
<option value="private">Soukromý</option> |
|
64 |
<option value="public">Veřejný</option> |
|
65 |
</select> |
|
66 |
<button>Přidat komentář</button> |
|
67 |
</div> |
|
68 |
</div> |
|
69 |
</aside> |
|
70 |
<BlazorStyled.Styled> |
|
71 |
.section_header { |
|
72 |
display: flex; |
|
73 |
justify-content: space-between; |
|
74 |
align-items: center; |
|
75 |
} |
|
76 |
.section_header h2 { |
|
77 |
color: #111111; |
|
78 |
font-size: 36px; |
|
79 |
margin: 0; |
|
80 |
} |
|
81 |
</BlazorStyled.Styled> |
|
82 |
<BlazorStyled.Styled> |
|
83 |
.goal_detail { |
|
84 |
width: 500px; |
|
85 |
height: 100%; |
|
86 |
position: fixed; |
|
87 |
top: 0; |
|
88 |
right: 0; |
|
89 |
background-color: white; |
|
90 |
-webkit-box-shadow: 0 0 5px 0 rgba(0,0,0,0.05); |
|
91 |
-moz-box-shadow: 0 0 5px 0 rgba(0,0,0,0.05); |
|
92 |
box-shadow: 0 0 5px 0 rgba(0,0,0,0.05); |
|
93 |
} |
|
94 |
|
|
95 |
.goal_detail_header { |
|
96 |
padding: 12px 24px; |
|
97 |
border-bottom: 1px solid #11111122; |
|
98 |
height: 26px; |
|
99 |
display: grid; |
|
100 |
align-items: center; |
|
101 |
} |
|
102 |
|
|
103 |
.goal_detail_body { |
|
104 |
padding: 0 0 12px 0; |
|
105 |
height: calc(100% - 143px - 50px - 12px); |
|
106 |
overflow-y: auto; |
|
107 |
background-color: #F6F8F9; |
|
108 |
overflow-x: hidden; |
|
109 |
} |
|
110 |
.goal_detail_area { |
|
111 |
background-color: white; |
|
112 |
padding-top: 12px; |
|
113 |
} |
|
114 |
.goal_detail_body .goal_name { |
|
115 |
padding: 8px 12px; |
|
116 |
border: 1px solid white; |
|
117 |
width: calc(100% - 24px); |
|
118 |
outline: none; |
|
119 |
margin: 12px 24px 12px 24px; |
|
120 |
} |
|
121 |
.goal_detail_body .goal_description { |
|
122 |
padding: 8px 12px; |
|
123 |
border: 1px solid white; |
|
124 |
width: calc(100% - 24px); |
|
125 |
outline: none; |
|
126 |
margin: 12px 24px 24px 24px; |
|
127 |
} |
|
128 |
.goal_detail_body .goal_description_title { |
|
129 |
margin: 0 24px; |
|
130 |
} |
|
131 |
.goal_detail_body .goal_name:hover, .goal_detail_body .goal_description:hover { |
|
132 |
border: 1px solid #EEEEEE; |
|
133 |
} |
|
134 |
.goal_detail_body .goal_name:focus, .goal_detail_body .goal_description:focus { |
|
135 |
border: 1px solid #A8A8A8; |
|
136 |
} |
|
137 |
|
|
138 |
.goal_communication_area { |
|
139 |
padding: 12px 0; |
|
140 |
} |
|
141 |
.goal_communication_area .goal_communication_item { |
|
142 |
background-color: #F6F8F9; |
|
143 |
padding: 12px 0; |
|
144 |
margin: 0 24px; |
|
145 |
} |
|
146 |
.goal_communication_area .goal_communication_item span.date { |
|
147 |
color: #A8A8A8; |
|
148 |
} |
|
149 |
.goal_communication_area .goal_communication_item .item_tool { |
|
150 |
display: flex; |
|
151 |
justify-content: space-between; |
|
152 |
align-items: center; |
|
153 |
} |
|
154 |
.goal_communication_area .goal_communication_item:not(:last-child) { |
|
155 |
border-bottom: 1px solid #11111122; |
|
156 |
} |
|
157 |
|
|
158 |
.goal_detail_footer{ |
|
159 |
background-color: #F6F8F9; |
|
160 |
padding: 24px; |
|
161 |
border-top: 1px solid #11111122; |
|
162 |
height: 94px; |
|
163 |
} |
|
164 |
.goal_detail_footer textarea{ |
|
165 |
border-radius: 4px; |
|
166 |
border: 1px solid gray; |
|
167 |
resize: none; |
|
168 |
padding: 8px 12px; |
|
169 |
height: 50px; |
|
170 |
width: calc(100% - 26px); |
|
171 |
margin-bottom: 12px; |
|
172 |
} |
|
173 |
.goal_detail_footer .goal_comment_tools { |
|
174 |
display: flex; |
|
175 |
justify-content: space-between; |
|
176 |
align-items: center; |
|
177 |
} |
|
178 |
.goal_detail_footer .goal_comment_tools select { |
|
179 |
border: none; |
|
180 |
outline: none; |
|
181 |
background-color: #F6F8F9; |
|
182 |
} |
|
183 |
.goal_detail_footer .goal_comment_tools button { |
|
184 |
|
|
185 |
} |
|
186 |
</BlazorStyled.Styled> |
|
187 |
|
|
188 |
@code { |
|
189 |
|
|
190 |
} |
src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/Pages/MyGoalDefinition.razor | ||
---|---|---|
1 |
@page "/my-goals" |
|
2 |
<div class="section_header"> |
|
3 |
<h2>Mé definice cílů</h2> |
|
4 |
</div> |
|
5 |
<section> |
|
6 |
<Microsoft.AspNetCore.Components.Routing.NavLink href="/goal/detail"> |
|
7 |
<div class="goal_def_item goal_item_closed"> |
|
8 |
<div class="goal_def_name">Název definice</div> |
|
9 |
<div class="goal_def_bottom"> |
|
10 |
<div class="goal_def_date"> |
|
11 |
<span>From - to</span> |
|
12 |
</div> |
|
13 |
<div class="goal_def_vari">VARI value</div> |
|
14 |
</div> |
|
15 |
</div> |
|
16 |
</Microsoft.AspNetCore.Components.Routing.NavLink> |
|
17 |
</section> |
|
18 |
<BlazorStyled.Styled> |
|
19 |
.section_header { |
|
20 |
display: flex; |
|
21 |
justify-content: space-between; |
|
22 |
align-items: center; |
|
23 |
} |
|
24 |
.section_header h2 { |
|
25 |
color: #111111; |
|
26 |
font-size: 36px; |
|
27 |
margin: 0; |
|
28 |
} |
|
29 |
</BlazorStyled.Styled> |
|
30 |
<BlazorStyled.Styled> |
|
31 |
.goal_def_item { |
|
32 |
-webkit-box-shadow: 0 0 5px 0 rgba(0,0,0,0.05); |
|
33 |
-moz-box-shadow: 0 0 5px 0 rgba(0,0,0,0.05); |
|
34 |
box-shadow: 0 0 5px 0 rgba(0,0,0,0.05); |
|
35 |
padding: 12px 24px; |
|
36 |
border-radius: 4px; |
|
37 |
width: calc(100% - 48px); |
|
38 |
transition: .25s transform; |
|
39 |
cursor: pointer; |
|
40 |
} |
|
41 |
.goal_def_item:hover { |
|
42 |
transform: scale(1.005); |
|
43 |
} |
|
44 |
.goal_item_closed{ |
|
45 |
opacity: .5; |
|
46 |
border: 1px solid #00000088; |
|
47 |
} |
|
48 |
.goal_def_name { |
|
49 |
font-size: 18px; |
|
50 |
font-weight: 700; |
|
51 |
color: #111111; |
|
52 |
font-family: 'Arial'; |
|
53 |
} |
|
54 |
.goal_def_bottom { |
|
55 |
display: flex; |
|
56 |
justify-content: space-between; |
|
57 |
align-items: center; |
|
58 |
} |
|
59 |
</BlazorStyled.Styled> |
|
60 |
|
|
61 |
@code { |
|
62 |
|
|
63 |
} |
src/Modules/Goal/Application/Leuze.Modules.Goal.Application.UI/_Imports.razor | ||
---|---|---|
1 |
|
src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/Goals/Commands/CreateGoal.cs | ||
---|---|---|
1 | 1 |
using Leuze.Core.Application.CQRS; |
2 |
using Leuze.Core.Domain.Domains.Users.Services.Abstractions;
|
|
2 |
using Leuze.Core.Domain.Repositories;
|
|
3 | 3 |
using Leuze.Modules.Goal.Domain.Domains; |
4 | 4 |
using Leuze.Modules.Goal.Domain.Repositories; |
5 |
using Microsoft.AspNetCore.Components.Authorization; |
|
5 | 6 |
using System; |
6 | 7 |
using System.Collections.Generic; |
7 | 8 |
using System.Linq; |
9 |
using System.Security.Claims; |
|
8 | 10 |
using System.Text; |
9 | 11 |
using System.Threading; |
10 | 12 |
using System.Threading.Tasks; |
... | ... | |
22 | 24 |
{ |
23 | 25 |
private readonly IGoalItemRepository _goalItemRepo; |
24 | 26 |
private readonly IGoalDefinitionRepository _goalDefinitionRepo; |
25 |
private readonly IDomainUserProvider _domainUserProvider; |
|
27 |
private readonly AuthenticationStateProvider _authenticationStateProvider; |
|
28 |
private readonly IDomainUserRepository _domainUserRepository; |
|
26 | 29 |
|
27 |
public Handler(IGoalItemRepository goalItemRepo, IGoalDefinitionRepository goalDefinitionRepo, IDomainUserProvider domainuserProvider) |
|
30 |
public Handler(IGoalItemRepository goalItemRepo, IGoalDefinitionRepository goalDefinitionRepo, |
|
31 |
AuthenticationStateProvider authenticationStateProvider, IDomainUserRepository domainUserRepository) |
|
28 | 32 |
{ |
29 | 33 |
_goalItemRepo = goalItemRepo; |
30 | 34 |
_goalDefinitionRepo = goalDefinitionRepo; |
31 |
_domainUserProvider = domainuserProvider; |
|
35 |
_authenticationStateProvider = authenticationStateProvider; |
|
36 |
_domainUserRepository = domainUserRepository; |
|
32 | 37 |
} |
33 | 38 |
|
34 | 39 |
public async Task<RequestResponse<Response>> Handle(Command request, CancellationToken cancellationToken) |
35 | 40 |
{ |
36 | 41 |
//TODO: user muze byt null, ale to my nechceme!!! |
37 |
var user = await _domainUserProvider.GetCurrentUserAsync(); |
|
42 |
var state = await _authenticationStateProvider.GetAuthenticationStateAsync(); |
|
43 |
var id = Guid.Parse(state.User!.FindFirst(ClaimTypes.NameIdentifier)!.Value); |
|
44 |
var user = await _domainUserRepository.GetByIdAsync(id); |
|
38 | 45 |
var goalDef = await _goalDefinitionRepo.GetByIdAsync(request.GoalDefinitionId); |
39 | 46 |
|
40 | 47 |
if(goalDef == null) |
src/Modules/Goal/Application/Leuze.Modules.Goal.Application/Leuze.Modules.Goal.Application.csproj | ||
---|---|---|
15 | 15 |
|
16 | 16 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
17 | 17 |
<OutputPath>..\..\..\..\Presentation\Leuze.Modules\</OutputPath> |
18 |
<DocumentationFile>..\..\..\..\docs\Leuze.Modules.Goal.Application.xml</DocumentationFile> |
|
18 |
<DocumentationFile>..\..\..\..\..\docs\Leuze.Modules.Goal.Application.xml</DocumentationFile>
|
|
19 | 19 |
</PropertyGroup> |
20 | 20 |
|
21 | 21 |
<ItemGroup> |
src/Modules/Goal/Domain/Leuze.Modules.Goal.Domain/Leuze.Modules.Goal.Domain.csproj | ||
---|---|---|
15 | 15 |
|
16 | 16 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
17 | 17 |
<OutputPath>..\..\..\..\Presentation\Leuze.Modules\</OutputPath> |
18 |
<DocumentationFile>..\..\..\..\docs\Leuze.Modules.Goal.Domain.xml</DocumentationFile> |
|
18 |
<DocumentationFile>..\..\..\..\..\docs\Leuze.Modules.Goal.Domain.xml</DocumentationFile>
|
|
19 | 19 |
</PropertyGroup> |
20 | 20 |
|
21 | 21 |
<ItemGroup> |
src/Modules/Goal/Infrastructure/Leuze.Modules.Goal.Infrastructure.Persistence/DependencyInjection.cs | ||
---|---|---|
1 | 1 |
using ExtCore.Infrastructure.Actions; |
2 |
using Leuze.Core.Infrastructure.Persistence.Extensions;
|
|
2 |
using Leuze.Modules.Goal.Infrastructure.Persistence.Extensions;
|
|
3 | 3 |
using Microsoft.AspNetCore.Builder; |
4 | 4 |
using Microsoft.Extensions.DependencyInjection; |
5 | 5 |
using System; |
... | ... | |
42 | 42 |
/// </summary> |
43 | 43 |
/// <param name="applicationBuilder"></param> |
44 | 44 |
/// <param name="serviceProvider"></param> |
45 |
public void Execute(IApplicationBuilder applicationBuilder, IServiceProvider serviceProvider) => applicationBuilder.MigrateDatabase(); |
|
45 |
public void Execute(IApplicationBuilder applicationBuilder, IServiceProvider serviceProvider) |
|
46 |
{ |
|
47 |
|
|
48 |
} |
|
46 | 49 |
} |
47 | 50 |
} |
src/Modules/Goal/Infrastructure/Leuze.Modules.Goal.Infrastructure.Persistence/Leuze.Modules.Goal.Infrastructure.Persistence.csproj | ||
---|---|---|
15 | 15 |
|
16 | 16 |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
17 | 17 |
<OutputPath>..\..\..\..\Presentation\Leuze.Modules\</OutputPath> |
18 |
<DocumentationFile>..\..\..\..\docs\Leuze.Modules.Goal.Infrastructure.Persistence.xml</DocumentationFile> |
|
18 |
<DocumentationFile>..\..\..\..\..\docs\Leuze.Modules.Goal.Infrastructure.Persistence.xml</DocumentationFile>
|
|
19 | 19 |
</PropertyGroup> |
20 | 20 |
|
21 | 21 |
<ItemGroup> |
tests/Core/Leuze.Tests.Core/LoginTests.cs | ||
---|---|---|
1 | 1 |
using System; |
2 | 2 |
using System.Threading.Tasks; |
3 | 3 |
using FluentAssertions; |
4 |
using Leuze.Core.Application.CQRS.Auth.Commads; |
|
4 |
using Leuze.Core.Application.CQRS.Auth.Commands;
|
|
5 | 5 |
using Leuze.Core.Application.Identity; |
6 |
using Leuze.Core.Domain.Repositories; |
|
7 |
using Leuze.Core.Infrastructure.Persistence.Repository; |
|
8 | 6 |
using Leuze.Tests.Configuration; |
9 | 7 |
using MediatR; |
10 |
using Microsoft.AspNetCore.Http; |
|
11 |
using Microsoft.AspNetCore.Identity.UI.V4.Pages.Internal.Account.Manage; |
|
12 | 8 |
using Microsoft.Extensions.DependencyInjection; |
13 | 9 |
using Xunit; |
14 | 10 |
|
Také k dispozici: Unified diff
Basic skeleton of goals fe pages
refs #8725 @1.2548h