Skip to content

Commit

Permalink
fix: PageNr causes exception
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Dec 28, 2023
1 parent 7bc8f24 commit d572ed9
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/Home.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/"
@inject EnvService env
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>Services | OryAdmin</PageTitle>

Expand Down
4 changes: 2 additions & 2 deletions OryAdmin/Components/Pages/Identities/Messages/Index.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/identities/messages"
@attribute [StreamRendering]
@rendermode InteractiveServer
@inject NavigationManager nav

<PageTitle>Message Log | OryAdmin</PageTitle>
Expand Down Expand Up @@ -45,6 +45,6 @@ else
</tbody>
</table>

<Pagination Url="identities/messages" PageNr="@((int)PageNr!)" MaxPageNr="1"/>
<Pagination Url="identities/messages" PageNr="@(PageNr)" MaxPageNr="1"/>
}
}
5 changes: 2 additions & 3 deletions OryAdmin/Components/Pages/Identities/Messages/Index.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ public partial class Index : ComponentBase
private List<KratosMessage> _messages;

[SupplyParameterFromQuery(Name = "page")]
private int? PageNr { get; set; }
// ReSharper disable once AutoPropertyCanBeMadeGetOnly.Local
private int PageNr { get; set; } = 1;

[Inject] private IdentitySchemaService SchemaService { get; set; } = default!;
[Inject] private ApiService ApiService { get; set; } = default!;

protected override async Task OnInitializedAsync()
{
PageNr ??= 1;

// TODO use pagination to support a large amount
_messages = await ApiService.KratosCourier.ListCourierMessagesAsync();

Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/Identities/Messages/View.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/identities/messages/{MessageId}"
@using Ory.Kratos.Client.Model
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>View Message | OryAdmin</PageTitle>

Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/Identities/Schemas/Index.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/identities/schemas"
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>Identity Schemas | OryAdmin</PageTitle>

Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/Identities/Users/Create.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/identities/users/create"
@attribute [StreamRendering]
@rendermode InteractiveServer
@inject NavigationManager nav

<PageTitle>Create Identity | OryAdmin</PageTitle>
Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/Identities/Users/Edit.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/identities/users/{UserId}/edit"
@attribute [StreamRendering]
@rendermode InteractiveServer
@inject NavigationManager nav

<PageTitle>Edit Identity | OryAdmin</PageTitle>
Expand Down
4 changes: 2 additions & 2 deletions OryAdmin/Components/Pages/Identities/Users/Index.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/identities/users"
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>Identities | OryAdmin</PageTitle>

Expand Down Expand Up @@ -49,6 +49,6 @@ else
}
</tbody>
</table>
<Pagination Url="identities/users" PageNr="@((int)PageNr!)" MaxPageNr="1"/>
<Pagination Url="identities/users" PageNr="@(PageNr)" MaxPageNr="1"/>
}
}
5 changes: 2 additions & 3 deletions OryAdmin/Components/Pages/Identities/Users/Index.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ public partial class Index
private bool _isLoading = true;

[SupplyParameterFromQuery(Name = "page")]
private int? PageNr { get; set; }
// ReSharper disable once UnusedAutoPropertyAccessor.Local
private int PageNr { get; set; }

[Inject] private IdentitySchemaService SchemaService { get; set; } = default!;
[Inject] private ApiService ApiService { get; set; } = default!;

protected override async Task OnInitializedAsync()
{
PageNr ??= 1;

// TODO use pagination to support a large amount of identities
_identities = await ApiService.KratosIdentity.ListIdentitiesAsync();

Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/Identities/Users/View.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/identities/users/{UserId}"
@attribute [StreamRendering]
@rendermode InteractiveServer
@inject NavigationManager nav

<PageTitle>View Identity | OryAdmin</PageTitle>
Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/OAuth2/Clients/Create.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/oauth2/clients/create"
@attribute [StreamRendering]
@rendermode InteractiveServer
@inject NavigationManager nav

<PageTitle>Create Client | OryAdmin</PageTitle>
Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/OAuth2/Clients/Edit.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/oauth2/clients/{ClientId}/edit"
@attribute [StreamRendering]
@rendermode InteractiveServer
@inject NavigationManager nav

<PageTitle>Edit Client | OryAdmin</PageTitle>
Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/OAuth2/Clients/Index.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/oauth2/clients"
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>OAuth 2 Clients | OryAdmin</PageTitle>

Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/OAuth2/Clients/Sessions.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/oauth2/clients/{ClientId}/sessions"
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>OAuth 2 Client Sessions | OryAdmin</PageTitle>

Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/OAuth2/Clients/View.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/oauth2/clients/{ClientId}"
@attribute [StreamRendering]
@rendermode InteractiveServer
@inject NavigationManager nav

<PageTitle>View OAuth 2 Client | OryAdmin</PageTitle>
Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/OAuth2/GrantIssuers/Create.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/oauth2/issuers/create"
@attribute [StreamRendering]
@rendermode InteractiveServer
@inject NavigationManager nav

<PageTitle>Trust Grant Issuer | OryAdmin</PageTitle>
Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/OAuth2/GrantIssuers/Index.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/oauth2/issuers"
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>OAuth 2 JWT Grant Issuers | OryAdmin</PageTitle>

Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/OAuth2/Index.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/oauth2"
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>OAuth 2 Information | OryAdmin</PageTitle>
<h1 class="title">OAuth 2 Information</h1>
Expand Down
2 changes: 1 addition & 1 deletion OryAdmin/Components/Pages/Permissions/Index.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/permissions"
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>Permission Namespaces | OryAdmin</PageTitle>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/permissions/{NamespaceName}/create"
@attribute [StreamRendering]
@rendermode InteractiveServer
@inject NavigationManager nav

<PageTitle>Create Relationship | OryAdmin</PageTitle>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/permissions/{NamespaceName}"
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>Relationships | OryAdmin</PageTitle>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/permissions/{NamespaceName}/tree"
@attribute [StreamRendering]
@rendermode InteractiveServer

<PageTitle>Permission Tree | OryAdmin</PageTitle>

Expand Down
1 change: 1 addition & 0 deletions OryAdmin/Components/_Imports.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using OryAdmin
Expand Down

0 comments on commit d572ed9

Please sign in to comment.