Skip to content

Commit

Permalink
IPageLinkGenerator used instead of deprecated IPageUrlGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielJurcaBS committed Oct 14, 2024
1 parent fa053d1 commit dd8d83d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ internal class ZapierApiKeyListingPage : ListingPage
private readonly IInfoProvider<ApiKeyInfo> apiKeyInfoProvider;
private readonly IAuthenticatedUserAccessor userAccessor;
private readonly IUserInfoProvider userProvider;
private readonly IPageUrlGenerator pageUrlGenerator;
private readonly IPageLinkGenerator pageLinkGenerator;


public ZapierApiKeyListingPage(IInfoProvider<ApiKeyInfo> apiKeyInfoProvider, IAuthenticatedUserAccessor userAccessor, IUserInfoProvider userProvider, IPageUrlGenerator pageUrlGenerator)
public ZapierApiKeyListingPage(IInfoProvider<ApiKeyInfo> apiKeyInfoProvider, IAuthenticatedUserAccessor userAccessor, IUserInfoProvider userProvider, IPageLinkGenerator pageLinkGenerator)
{
this.apiKeyInfoProvider = apiKeyInfoProvider;
this.userAccessor = userAccessor;
this.userProvider = userProvider;
this.pageUrlGenerator = pageUrlGenerator;
this.pageLinkGenerator = pageLinkGenerator;
}


Expand Down Expand Up @@ -91,6 +91,9 @@ public async Task<INavigateResponse> Generate(CancellationToken _)
apiKeyInfoProvider.Set(apiKeyInfo);

transaction.Commit();
return NavigateTo(pageUrlGenerator.GenerateUrl<ZapierNewApiKeyPage>(apiKeyInfo.ApiKeyID.ToString()));
return NavigateTo(pageLinkGenerator.GetPath<ZapierNewApiKeyPage>(new PageParameterValues
{
{ typeof(ZapierApiKeyEditSection), apiKeyInfo.ApiKeyID }
}));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Kentico.Xperience.Zapier.Admin.UIPages;
internal class ZapierNewApiKeyPage : InfoEditPage<ApiKeyInfo>
{
private readonly IInfoProvider<ApiKeyInfo> apiKeyInfoProvider;
private readonly IPageUrlGenerator pageUrlGenerator;
private readonly IPageLinkGenerator pageLinkGenerator;
private readonly IZapierTokenManager tokenManager;


Expand All @@ -34,11 +34,11 @@ internal class ZapierNewApiKeyPage : InfoEditPage<ApiKeyInfo>
protected override bool RefetchAll => true;


public ZapierNewApiKeyPage(IFormComponentMapper formComponentMapper, IFormDataBinder formDataBinder, IInfoProvider<ApiKeyInfo> apiKeyInfoProvider, IPageUrlGenerator pageUrlGenerator, IZapierTokenManager tokenManager)
public ZapierNewApiKeyPage(IFormComponentMapper formComponentMapper, IFormDataBinder formDataBinder, IInfoProvider<ApiKeyInfo> apiKeyInfoProvider, IPageLinkGenerator pageLinkGenerator, IZapierTokenManager tokenManager)
: base(formComponentMapper, formDataBinder)
{
this.apiKeyInfoProvider = apiKeyInfoProvider;
this.pageUrlGenerator = pageUrlGenerator;
this.pageLinkGenerator = pageLinkGenerator;
this.tokenManager = tokenManager;
}

Expand Down Expand Up @@ -67,7 +67,7 @@ public override async Task ConfigurePage()

protected override async Task<ICommandResponse> SubmitInternal(FormSubmissionCommandArguments args, ICollection<IFormItem> items, IFormFieldValueProvider formFieldValueProvider)
{
string navigationUrl = pageUrlGenerator.GenerateUrl<ZapierApiKeyListingPage>();
string navigationUrl = pageLinkGenerator.GetPath<ZapierApiKeyListingPage>();
return await Task.FromResult(NavigateTo(navigationUrl, RefetchAll));
}

Expand Down

0 comments on commit dd8d83d

Please sign in to comment.