-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
113 changed files
with
529 additions
and
953 deletions.
There are no files selected for viewing
40 changes: 0 additions & 40 deletions
40
samples/Corpo.Skeleton/src/Corpo.Skeleton/Features/CurrentAttributes.cs
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
samples/Corpo.Skeleton/src/Corpo.Skeleton/Features/CurrentHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Microsoft.Extensions.Options; | ||
using Miru.Currentable; | ||
using Miru.Userfy; | ||
|
||
namespace Corpo.Skeleton.Features; | ||
|
||
public class CurrentHandler( | ||
Current current, | ||
AppDbContext db, | ||
ICurrentUser currentUser, | ||
IOptions<AppOptions> appOptions) | ||
: ICurrentHandler | ||
{ | ||
private readonly AppOptions _appOptions = appOptions.Value; | ||
|
||
public async Task Handle<TRequest>(TRequest request, CancellationToken ct) | ||
{ | ||
if (current.Loaded == false) | ||
{ | ||
current.IsAuthenticated = currentUser.IsAuthenticated; | ||
|
||
if (currentUser.IsAuthenticated) | ||
{ | ||
current.User = await db.Users.ByIdAsync(currentUser.Id, ct); | ||
} | ||
|
||
current.AppOptions = _appOptions; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 13 additions & 18 deletions
31
samples/Corpo.Skeleton/tests/Corpo.Skeleton.PageTests/Pages/Teams/TeamListPageTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
using Corpo.Skeleton.Domain; | ||
using Corpo.Skeleton.Features.Teams; | ||
using Miru; | ||
using Miru.PageTesting; | ||
using Miru.Testing; | ||
using NUnit.Framework; | ||
|
||
namespace Corpo.Skeleton.PageTests.Pages.Teams | ||
namespace Corpo.Skeleton.PageTests.Pages.Teams; | ||
|
||
public class TeamListPageTest : PageTest | ||
{ | ||
public class TeamListPageTest : PageTest | ||
[Test] | ||
public void Can_list_teams() | ||
{ | ||
[Test] | ||
public void Can_list_teams() | ||
{ | ||
var teams = _.MakeManySaving<Team>(); | ||
var teams = _.MakeMany<Team>(); | ||
_.Save(teams); | ||
|
||
_.Visit<TeamList>(); | ||
_.Visit<TeamList>(); | ||
|
||
_.ShouldHaveText("Teams"); | ||
_.ShouldHaveText("Teams"); | ||
|
||
_.Display<TeamList.Result>(x => | ||
{ | ||
x.ShouldHave(m => m.Teams[0].Name, teams.At(0).Name); | ||
}); | ||
} | ||
_.Display<TeamList.Result>(x => | ||
{ | ||
x.ShouldHave(m => m.Teams[0].Name, teams.At(0).Name); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.