Skip to content

Commit a801197

Browse files
authored
Merge pull request #413 from MangoInstantMessenger/validation-flow
Validation flow
2 parents 10b035c + afec9af commit a801197

255 files changed

Lines changed: 10729 additions & 24292 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ root = true
33
# noinspection EditorConfigKeyCorrectness
44
[*.cs]
55
dotnet_diagnostic.CA1824.severity = warning
6+
7+
# code format
68
dotnet_diagnostic.IDE0005.severity = warning
9+
710
dotnet_diagnostic.CA1707.severity = warning
811
dotnet_diagnostic.CA1822.severity = warning
912
dotnet_diagnostic.CA1416.severity = warning
1013
dotnet_diagnostic.IDE0072.severity = warning
1114
dotnet_diagnostic.IDE0270.severity = warning
15+
dotnet_diagnostic.CA1825.severity = warning
16+
17+
# explicit type
18+
dotnet_diagnostic.IDE0007.severity = warning
1219

1320
# populate switch
1421
dotnet_diagnostic.IDE0010.severity = warning

.github/workflows/build-angular.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ on:
1414
jobs:
1515
build-angular:
1616
name: Build Angular
17-
runs-on: 'ubuntu-latest'
17+
runs-on: ${{ matrix.environment }}
18+
strategy:
19+
matrix:
20+
environment:
21+
- ubuntu-latest
22+
- windows-latest
1823

1924
steps:
2025
- name: 'Checkout'
@@ -26,17 +31,29 @@ jobs:
2631
node-version: '16.x'
2732
cache: 'npm'
2833
cache-dependency-path: 'MangoAPI.Client/package-lock.json'
29-
30-
- name: Npm ci
34+
35+
- name: 'Print current node version'
36+
run: node -v
37+
38+
- name: 'Print current npm version'
39+
run: npm -v
40+
41+
- name: 'Npm ci'
3142
working-directory: './MangoAPI.Client'
3243
run: npm ci
33-
34-
- name: Npm build prod
44+
45+
- name: 'Install angular cli 15.2.2'
46+
run: npm install -g @angular/cli@15.2.2
47+
48+
- name: 'Print current angular cli version'
49+
run: ng version
50+
51+
- name: 'Angular build'
3552
working-directory: './MangoAPI.Client'
36-
run: npm run build --production
53+
run: ng build
3754

38-
- name: Drop artifact
55+
- name: 'Drop artifact'
3956
uses: actions/upload-artifact@v3
4057
with:
41-
name: 'angular-build'
58+
name: 'angular-build-${{ matrix.environment }}'
4259
path: './MangoAPI.Presentation/wwwroot'

.github/workflows/build-test-coverage-dotnet.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ jobs:
4646
- name: Build .NET Project
4747
run: |
4848
dotnet build --no-restore /p:ContinuousIntegrationBuild=true --configuration Release
49+
50+
- name: Run unit tests
51+
run: |
52+
dotnet test MangoAPI.UnitTests/MangoAPI.UnitTests.csproj --configuration Release --no-build
53+
env:
54+
CollectCoverage: true
55+
CoverletOutputFormat: lcov
56+
ThresholdStat: total
57+
ThresholdType: Line
58+
CoverletOutput: TestResults/
4959

5060
- name: Install and Run Azurite
5161
shell: bash

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ AuthWorkingDirectory/
3838
CngWorkingDirectory/
3939
OpenSslWorkingDirectory/
4040
wwwroot/
41+
dist/
4142

4243
# sonar scanner
4344
MangoAPI.Client/.scannerwork/*
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using MangoAPI.Domain.Entities;
2+
3+
namespace MangoAPI.Application.Interfaces;
4+
5+
public interface IPasswordService
6+
{
7+
bool ValidateCredentials(UserEntity user, string currentPassword);
8+
9+
UserEntity ChangePassword(UserEntity user, string newPassword);
10+
}

MangoAPI.Application/Interfaces/ISignInManagerService.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

MangoAPI.Application/Interfaces/IUserManagerService.cs

Lines changed: 0 additions & 16 deletions
This file was deleted.

MangoAPI.Application/MangoAPI.Application.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<ProjectReference Include="..\MangoAPI.Domain\MangoAPI.Domain.csproj"/>
12+
<ProjectReference Include="..\MangoAPI.Domain\MangoAPI.Domain.csproj" />
1313
</ItemGroup>
1414
</Project>

MangoAPI.Application/Services/AvatarService.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ public class AvatarService : IAvatarService
2424
"animetyanpic14.jpg",
2525
"animetyanpic15.jpg",
2626
"animetyanpic16.jpg",
27-
"animetyanpic17.jpg"
27+
"animetyanpic17.jpg",
28+
"animetyanpic18.jpg",
29+
"animetyanpic19.jpg",
30+
"animetyanpic20.jpg",
31+
"animetyanpic21.jpg",
32+
"animetyanpic22.jpg",
2833
};
2934

3035
public string GetRandomAvatar()

MangoAPI.Application/Services/CorrelationContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public Guid GetUserId()
1919
{
2020
var context = httpContextAccessor.HttpContext;
2121

22-
var correlationContextUserId = context.User.FindFirstValue(JwtRegisteredClaimNames.Jti);
22+
var correlationContextUserId = context?.User.FindFirstValue(JwtRegisteredClaimNames.Jti);
2323

2424
var parsed = Guid.TryParse(correlationContextUserId, out var parsedUserId);
2525

0 commit comments

Comments
 (0)