Initial migration
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
@using Oqtane.Shared;
|
||||
@namespace Oqtane.Modules.HtmlText
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject HttpClient http
|
||||
@inject SiteState sitestate
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-success" @onclick="@SaveContent">Save</button>
|
||||
<button type="button" class="btn btn-success" @onclick="SaveContent">Save</button>
|
||||
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
|
||||
<br />
|
||||
<br />
|
||||
@ -44,7 +44,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, UriHelper);
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
|
||||
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
||||
if (htmltext != null)
|
||||
{
|
||||
@ -65,7 +65,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, UriHelper);
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
|
||||
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
||||
if (htmltext != null)
|
||||
{
|
||||
@ -80,7 +80,7 @@
|
||||
await htmltextservice.AddHtmlTextAsync(htmltext);
|
||||
}
|
||||
PageState.Reload = Constants.ReloadPage;
|
||||
UriHelper.NavigateTo(NavigateUrl());
|
||||
NavigationManager.NavigateTo(NavigateUrl());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
@using Oqtane.Shared;
|
||||
@namespace Oqtane.Modules.HtmlText
|
||||
@inherits ModuleBase
|
||||
@inject IUriHelper UriHelper
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject HttpClient http
|
||||
@inject SiteState sitestate
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, UriHelper);
|
||||
HtmlTextService htmltextservice = new HtmlTextService(http, sitestate, NavigationManager);
|
||||
HtmlTextInfo htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
|
||||
if (htmltext != null)
|
||||
{
|
||||
|
@ -13,18 +13,18 @@ namespace Oqtane.Modules.HtmlText.Services
|
||||
{
|
||||
private readonly HttpClient http;
|
||||
private readonly SiteState sitestate;
|
||||
private readonly IUriHelper urihelper;
|
||||
private readonly NavigationManager NavigationManager;
|
||||
|
||||
public HtmlTextService(HttpClient http, SiteState sitestate, IUriHelper urihelper)
|
||||
public HtmlTextService(HttpClient http, SiteState sitestate, NavigationManager NavigationManager)
|
||||
{
|
||||
this.http = http;
|
||||
this.sitestate = sitestate;
|
||||
this.urihelper = urihelper;
|
||||
this.NavigationManager = NavigationManager;
|
||||
}
|
||||
|
||||
private string apiurl
|
||||
{
|
||||
get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "HtmlText"); }
|
||||
get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "HtmlText"); }
|
||||
}
|
||||
|
||||
public async Task<HtmlTextInfo> GetHtmlTextAsync(int ModuleId)
|
||||
|
Reference in New Issue
Block a user