-
Notifications
You must be signed in to change notification settings - Fork 3
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
11 changed files
with
125 additions
and
95 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using KratosSelfService.Models; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.ViewComponents; | ||
|
||
namespace KratosSelfService.ViewComponents; | ||
|
||
public class KratosUi : ViewComponent | ||
{ | ||
public async Task<ViewViewComponentResult> InvokeAsync(KratosUiModel model) | ||
{ | ||
return View("Default", model); | ||
} | ||
} |
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,13 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Mvc.ViewComponents; | ||
using Ory.Kratos.Client.Model; | ||
|
||
namespace KratosSelfService.ViewComponents; | ||
|
||
public class KratosUiTextMessages : ViewComponent | ||
{ | ||
public async Task<ViewViewComponentResult> InvokeAsync(List<KratosUiText>? model) | ||
{ | ||
return View("Default", model); | ||
} | ||
} |
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
30 changes: 30 additions & 0 deletions
30
KratosSelfService/Views/Shared/Components/KratosUi/Default.cshtml
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 @@ | ||
@model KratosUiModel | ||
|
||
@{ | ||
// this component is used by all flows except the settings flow | ||
var allGroups = Model.ui.Nodes | ||
.GroupBy(node => node.Group).ToList(); | ||
var defaultNodes = allGroups | ||
.First(group => group.Key == KratosUiNode.GroupEnum.Default) | ||
.ToArray(); | ||
var groups = allGroups | ||
.Where(group => group.Key != KratosUiNode.GroupEnum.Default) | ||
.ToArray(); | ||
} | ||
|
||
@foreach (var group in groups) | ||
{ | ||
<form class="mb-3" action="@Model.ui.Action" method="@Model.ui.Method"> | ||
@foreach (var node in defaultNodes) | ||
{ | ||
var model = new KratosUiNodeModel(node, Model.flowType, Model.forgotPasswordUrl); | ||
@await Component.InvokeAsync("KratosUiNodeInput", model) | ||
} | ||
@foreach (var node in group) | ||
{ | ||
var model = new KratosUiNodeModel(node, Model.flowType, Model.forgotPasswordUrl); | ||
@await Component.InvokeAsync("KratosUiNodeInput", model) | ||
} | ||
</form> | ||
} |
9 changes: 9 additions & 0 deletions
9
KratosSelfService/Views/Shared/Components/KratosUiTextMessages/Default.cshtml
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,9 @@ | ||
@model List<KratosUiText>? | ||
|
||
@if (Model != null) | ||
{ | ||
foreach (var message in Model) | ||
{ | ||
@await Component.InvokeAsync("KratosUiTextMessage", message) | ||
} | ||
} |
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