From abd2f6e6b45a86792a178075166dae12e708d867 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Fri, 2 Aug 2019 15:58:20 -0400 Subject: [PATCH 01/13] Update README.md --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index f17fa9b2..cdf0a384 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,42 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera 5. Download or Clone the Oqtane source code to your local system. Open the **Oqtane.sln** solution file. If you want to develop using **server-side** Blazor ( which includes a full debugging experience in Visual Studio ) you should choose to Build the solution using the default Debug configuration. If you want to develop using **client-side** Blazor ( WebAssembly ) you should first choose the "Wasm" configuration option in the Visual Studio toolbar and then Build. +# Roadmap +This project is a work in progress and the schedule for implementing the items identified below is dependent upon the availability of community members who are able to assist. + +Security +- Need ability to associate a User to a Site and restrict access +- Need ability to manage Roles and association to Users +- Need ability to manage Permissions + - a permission UI component for pages/modules + - may also need to include Permission table schema similar to DNN +- Need ability to manage Authorization ( will need to be custom so that permissions set by user are observed at API level ) +- Need audit fields ( ie. CreatedBy, CreateOn, etc… ) on all core tables +- Logging + +Design +- Need modern Admin UI theme +- Need to cleanly separate site.css +- CSS registration for modules and skins + +Packaging +- Need ability to package/install Modules +- Need ability to package/install Themes + +Admin +- Need fully functional administrative modules for all core entities ( user, role, site, etc… ) +- Need ability to create a new Site and auto provision Admin pages/modules +- Need ability to soft delete core entities +- Drag and Drop modules + +Upgrade +- Need ability to upgrade application seamlessly +- integrated store/catalog of extensions +- auto update - provide url to check for updates, perhaps even download in background - core and extensions + +Multi-Tenant +- Need ability to provision a new tenant DB + # Background Oqtane was created by [Shaun Walker](https://www.linkedin.com/in/shaunbrucewalker/) and is inspired by the DotNetNuke web application framework. Initially created as a proof of concept, Oqtane is a native Blazor application written from the ground up using modern .NET Core technology. It is a modular framework offering a fully dynamic page compositing model, multi-site support, designer friendly templates ( skins ), and extensibility via third party modules. From e8b5e2f0b2acede38b73fea59394c87c45bdcef5 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Fri, 2 Aug 2019 16:08:05 -0400 Subject: [PATCH 02/13] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index cdf0a384..ba345b83 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,9 @@ Upgrade Multi-Tenant - Need ability to provision a new tenant DB +Database +- Need ability to run on SQLite + # Background Oqtane was created by [Shaun Walker](https://www.linkedin.com/in/shaunbrucewalker/) and is inspired by the DotNetNuke web application framework. Initially created as a proof of concept, Oqtane is a native Blazor application written from the ground up using modern .NET Core technology. It is a modular framework offering a fully dynamic page compositing model, multi-site support, designer friendly templates ( skins ), and extensibility via third party modules. From 7ff1eb9081cb8290cce70ee5e4181a03d30706d3 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Fri, 2 Aug 2019 16:12:22 -0400 Subject: [PATCH 03/13] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ba345b83..3b748921 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Security - Need ability to manage Authorization ( will need to be custom so that permissions set by user are observed at API level ) - Need audit fields ( ie. CreatedBy, CreateOn, etc… ) on all core tables - Logging +- Support for friendly Page Not Found handling Design - Need modern Admin UI theme From e00ce5cd905dfd7b4d11026a9474a4424c24768f Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Sat, 3 Aug 2019 15:09:49 -0400 Subject: [PATCH 04/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b748921..eea4fd37 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ At this point Oqtane offers a minimum of desired functionality and is not recomm # Example Screenshots -A simplistic login flow ( note that a full authentication story has not been implemented at this point ): +A seamless login flow utilizing .NET Core Identity services: ![Login](https://github.com/oqtane/framework/blob/master/screenshot1.png?raw=true "Login") From 62b5ea77b34d060b8c7aaf0ac1e64e41c9f4834f Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Mon, 5 Aug 2019 11:31:17 -0400 Subject: [PATCH 05/13] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index eea4fd37..581df7e2 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,7 @@ Security - Need ability to manage Permissions - a permission UI component for pages/modules - may also need to include Permission table schema similar to DNN -- Need ability to manage Authorization ( will need to be custom so that permissions set by user are observed at API level ) -- Need audit fields ( ie. CreatedBy, CreateOn, etc… ) on all core tables +- Need ability to manage Authorization ( will need to be custom so that permissions set by user are observed at API level ) - Logging - Support for friendly Page Not Found handling From ea70c047739831f752c2184aab6234a2c3d34c19 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Wed, 14 Aug 2019 13:35:05 -0400 Subject: [PATCH 06/13] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 581df7e2..937e4c1e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera **To get started with Oqtane:** - 1. Oqtane is currently compatible with **[.NET Core 3.0 Preview 6 SDK (3.0.0-preview6.19307.2)](https://dotnet.microsoft.com/download/dotnet-core/3.0)**. Microsoft continues to release new versions of .NET Core 3.0 on a regular basis and we do our best to keep up; however, for the best results you should use the most compatible .NET Core 3.0 version. + 1. Oqtane is currently compatible with **[.NET Core 3.0 Preview 8 SDK (3.0.0-preview8.19405.7)](https://dotnet.microsoft.com/download/dotnet-core/3.0)**. Microsoft continues to release new versions of .NET Core 3.0 on a regular basis and we do our best to keep up; however, for the best results you should use the most compatible .NET Core 3.0 version. 2. Install the latest **Preview** edition of [Visual Studio 2019](https://visualstudio.com/preview) with the **ASP.NET and web development** workload. @@ -21,7 +21,6 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera This project is a work in progress and the schedule for implementing the items identified below is dependent upon the availability of community members who are able to assist. Security -- Need ability to associate a User to a Site and restrict access - Need ability to manage Roles and association to Users - Need ability to manage Permissions - a permission UI component for pages/modules From 49625bd5943392a4cc03ecf6e1968de29c4cb70f Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Wed, 14 Aug 2019 13:37:59 -0400 Subject: [PATCH 07/13] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 937e4c1e..b52d1fc4 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ Admin - Need fully functional administrative modules for all core entities ( user, role, site, etc… ) - Need ability to create a new Site and auto provision Admin pages/modules - Need ability to soft delete core entities +- Re-ordering of modules in panes - Drag and Drop modules Upgrade From b95db2248b422e51e2c0886286036640be68f393 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Mon, 19 Aug 2019 14:28:44 -0400 Subject: [PATCH 08/13] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b52d1fc4..6ade6af8 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera 4. Enable Visual Studio to use preview SDKs: Open **Tools** > **Options** in the menu bar. Open the **Environment** node. Open the **Preview Features** tab. Check the box for **Use previews of the .NET Core SDK**. Select **OK**. 5. Download or Clone the Oqtane source code to your local system. Open the **Oqtane.sln** solution file. If you want to develop using **server-side** Blazor ( which includes a full debugging experience in Visual Studio ) you should choose to Build the solution using the default Debug configuration. If you want to develop using **client-side** Blazor ( WebAssembly ) you should first choose the "Wasm" configuration option in the Visual Studio toolbar and then Build. + + NOTE: If you have already installed a previous version of Oqtane and you wish to install a newer version, there is currently no upgrade path from one version to the next. The recommended upgrade approach is to get the latest code and build it, and then reset the DefaultConnection value to "" in the appsettings.json file in the Oqtane.server project. # Roadmap This project is a work in progress and the schedule for implementing the items identified below is dependent upon the availability of community members who are able to assist. From c93b34ea823ffb6dfeec6638f85b484ff46abc70 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Mon, 19 Aug 2019 14:29:48 -0400 Subject: [PATCH 09/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ade6af8..dbe47669 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera 5. Download or Clone the Oqtane source code to your local system. Open the **Oqtane.sln** solution file. If you want to develop using **server-side** Blazor ( which includes a full debugging experience in Visual Studio ) you should choose to Build the solution using the default Debug configuration. If you want to develop using **client-side** Blazor ( WebAssembly ) you should first choose the "Wasm" configuration option in the Visual Studio toolbar and then Build. - NOTE: If you have already installed a previous version of Oqtane and you wish to install a newer version, there is currently no upgrade path from one version to the next. The recommended upgrade approach is to get the latest code and build it, and then reset the DefaultConnection value to "" in the appsettings.json file in the Oqtane.server project. + NOTE: If you have already installed a previous version of Oqtane and you wish to install a newer version, there is currently no upgrade path from one version to the next. The recommended upgrade approach is to get the latest code and build it, and then reset the DefaultConnection value to "" in the appsettings.json file in the Oqtane.server project. This will trigger a re-install when you run the application which will execute the latest database scripts. # Roadmap This project is a work in progress and the schedule for implementing the items identified below is dependent upon the availability of community members who are able to assist. From fca868781d55550704d7d52ba2527a089254665f Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Tue, 27 Aug 2019 17:17:44 -0400 Subject: [PATCH 10/13] Update README.md --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index dbe47669..0cd3f03e 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,7 @@ Oqtane uses Blazor, a new web framework for .NET Core that lets you build intera This project is a work in progress and the schedule for implementing the items identified below is dependent upon the availability of community members who are able to assist. Security -- Need ability to manage Roles and association to Users -- Need ability to manage Permissions - - a permission UI component for pages/modules - - may also need to include Permission table schema similar to DNN -- Need ability to manage Authorization ( will need to be custom so that permissions set by user are observed at API level ) - Logging -- Support for friendly Page Not Found handling Design - Need modern Admin UI theme @@ -41,6 +35,7 @@ Packaging - Need ability to package/install Themes Admin +- Need a permission grid UI component for pages/modules - Need fully functional administrative modules for all core entities ( user, role, site, etc… ) - Need ability to create a new Site and auto provision Admin pages/modules - Need ability to soft delete core entities From 503bfff6e9d842046795d935e20c83f4bc6cf908 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Fri, 30 Aug 2019 10:07:14 -0400 Subject: [PATCH 11/13] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0cd3f03e..25a528fd 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ Packaging - Need ability to package/install Themes Admin -- Need a permission grid UI component for pages/modules - Need fully functional administrative modules for all core entities ( user, role, site, etc… ) - Need ability to create a new Site and auto provision Admin pages/modules - Need ability to soft delete core entities From d1faa0ee5ff28c2db10d1c6098800a93b1da9c58 Mon Sep 17 00:00:00 2001 From: Emanuele Filardo Date: Sun, 15 Sep 2019 12:21:32 +0200 Subject: [PATCH 12/13] Initial migration --- Oqtane.Client/Modules/Admin/Login/Index.razor | 10 ++++----- .../Modules/Admin/ModuleDefinitions/Add.razor | 4 ++-- .../Modules/Admin/ModuleSettings/Index.razor | 6 +++--- Oqtane.Client/Modules/Admin/Pages/Add.razor | 10 ++++----- .../Modules/Admin/Pages/Delete.razor | 8 +++---- Oqtane.Client/Modules/Admin/Pages/Edit.razor | 10 ++++----- .../Modules/Admin/Profile/Index.razor | 14 ++++++------- .../Modules/Admin/Register/Index.razor | 10 ++++----- Oqtane.Client/Modules/Admin/Sites/Add.razor | 6 +++--- .../Modules/Controls/PermissionGrid.razor | 2 +- Oqtane.Client/Modules/Counter/Index.razor | 2 +- Oqtane.Client/Modules/HtmlText/Edit.razor | 10 ++++----- Oqtane.Client/Modules/HtmlText/Index.razor | 4 ++-- .../HtmlText/Services/HtmlTextService.cs | 8 +++---- Oqtane.Client/Oqtane.Client.csproj | 21 +++++++++++-------- .../IdentityAuthenticationStateProvider.cs | 11 +++++----- Oqtane.Client/Services/AliasService.cs | 8 +++---- Oqtane.Client/Services/FileService.cs | 8 +++---- .../Interfaces/InstallationService.cs | 8 +++---- .../Services/ModuleDefinitionService.cs | 8 +++---- Oqtane.Client/Services/ModuleService.cs | 8 +++---- Oqtane.Client/Services/PageModuleService.cs | 8 +++---- Oqtane.Client/Services/PageService.cs | 8 +++---- Oqtane.Client/Services/ProfileService.cs | 8 +++---- Oqtane.Client/Services/RoleService.cs | 8 +++---- Oqtane.Client/Services/SettingService.cs | 8 +++---- Oqtane.Client/Services/SiteService.cs | 8 +++---- Oqtane.Client/Services/TenantService.cs | 8 +++---- Oqtane.Client/Services/ThemeService.cs | 8 +++---- Oqtane.Client/Services/UserRoleService.cs | 8 +++---- Oqtane.Client/Services/UserService.cs | 8 +++---- Oqtane.Client/Shared/Installer.razor | 10 ++++----- Oqtane.Client/Shared/Interop.cs | 8 +++---- Oqtane.Client/Shared/SiteRouter.razor | 14 ++++++------- .../Themes/Controls/ControlPanel.razor | 8 +++---- Oqtane.Client/Themes/Controls/Login.razor | 10 ++++----- .../Themes/Controls/ModuleActions.razor | 6 +++--- Oqtane.Client/Themes/Controls/Profile.razor | 11 +++++----- Oqtane.Server/Oqtane.Server.csproj | 15 +++++++------ Oqtane.Server/Pages/_Host.cshtml | 2 +- Oqtane.Server/Startup.cs | 4 ++-- Oqtane.Shared/Oqtane.Shared.csproj | 7 +++---- 42 files changed, 177 insertions(+), 174 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/Login/Index.razor b/Oqtane.Client/Modules/Admin/Login/Index.razor index 2f24c684..dd71ce89 100644 --- a/Oqtane.Client/Modules/Admin/Login/Index.razor +++ b/Oqtane.Client/Modules/Admin/Login/Index.razor @@ -7,7 +7,7 @@ @using Oqtane.Shared @namespace Oqtane.Modules.Admin.Login @inherits ModuleBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IJSRuntime jsRuntime @inject IUserService UserService @inject IServiceProvider ServiceProvider @@ -36,8 +36,8 @@ - - + + @@ -88,7 +88,7 @@ { authstateprovider.NotifyAuthenticationChanged(); PageState.Reload = Constants.ReloadSite; - UriHelper.NavigateTo(NavigateUrl(ReturnUrl)); + NavigationManager.NavigateTo(NavigateUrl(ReturnUrl)); } else { @@ -100,6 +100,6 @@ private void Cancel() { string ReturnUrl = PageState.QueryString["returnurl"]; - UriHelper.NavigateTo(ReturnUrl); + NavigationManager.NavigateTo(ReturnUrl); } } diff --git a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor index 49980307..1de211df 100644 --- a/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor +++ b/Oqtane.Client/Modules/Admin/ModuleDefinitions/Add.razor @@ -5,7 +5,7 @@ @using Oqtane.Shared @namespace Oqtane.Modules.Admin.ModuleDefinitions @inherits ModuleBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IFileService FileService @inject IModuleDefinitionService ModuleDefinitionService @@ -45,6 +45,6 @@ else { await ModuleDefinitionService.InstallModulesAsync(); PageState.Reload = Constants.ReloadApplication; - UriHelper.NavigateTo(NavigateUrl()); + NavigationManager.NavigateTo(NavigateUrl()); } } diff --git a/Oqtane.Client/Modules/Admin/ModuleSettings/Index.razor b/Oqtane.Client/Modules/Admin/ModuleSettings/Index.razor index b57abb63..90427170 100644 --- a/Oqtane.Client/Modules/Admin/ModuleSettings/Index.razor +++ b/Oqtane.Client/Modules/Admin/ModuleSettings/Index.razor @@ -7,7 +7,7 @@ @using Oqtane.Modules.Controls @namespace Oqtane.Modules.Admin.ModuleSettings @inherits ModuleBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IThemeService ThemeService @inject IModuleService ModuleService @inject IPageModuleService PageModuleService @@ -64,7 +64,7 @@ @DynamicComponent - + Cancel @@ -121,7 +121,7 @@ } PageState.Reload = Constants.ReloadPage; - UriHelper.NavigateTo(NavigateUrl()); + NavigationManager.NavigateTo(NavigateUrl()); } } diff --git a/Oqtane.Client/Modules/Admin/Pages/Add.razor b/Oqtane.Client/Modules/Admin/Pages/Add.razor index f67b9184..bb104aae 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Add.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Add.razor @@ -7,7 +7,7 @@ @using Oqtane.Security @namespace Oqtane.Modules.Admin.Pages @inherits ModuleBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IPageService PageService @inject IThemeService ThemeService @@ -27,7 +27,7 @@ - @foreach (Page page in pages) { @@ -129,7 +129,7 @@ - + Cancel @code { @@ -176,7 +176,7 @@ } } - private void ParentChanged(UIChangeEventArgs e) + private void ParentChanged(ChangeEventArgs e) { try { @@ -254,7 +254,7 @@ await PageService.UpdatePageOrderAsync(page.SiteId, page.ParentId); PageState.Reload = Constants.ReloadSite; - UriHelper.NavigateTo(NavigateUrl()); + NavigationManager.NavigateTo(NavigateUrl()); } catch (Exception ex) { diff --git a/Oqtane.Client/Modules/Admin/Pages/Delete.razor b/Oqtane.Client/Modules/Admin/Pages/Delete.razor index 932597c9..c6e61d21 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Delete.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Delete.razor @@ -7,7 +7,7 @@ @using Oqtane.Security @namespace Oqtane.Modules.Admin.Pages @inherits ModuleBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IPageService PageService @inject IThemeService ThemeService @@ -111,7 +111,7 @@ - + Cancel

@@ -181,11 +181,11 @@ PageState.Reload = Constants.ReloadSite; if (PageState.Page.Name == "Page Management") { - UriHelper.NavigateTo(NavigateUrl()); + NavigationManager.NavigateTo(NavigateUrl()); } else { - UriHelper.NavigateTo(NavigateUrl("")); + NavigationManager.NavigateTo(NavigateUrl("")); } } catch (Exception ex) diff --git a/Oqtane.Client/Modules/Admin/Pages/Edit.razor b/Oqtane.Client/Modules/Admin/Pages/Edit.razor index ad5ee932..831d84da 100644 --- a/Oqtane.Client/Modules/Admin/Pages/Edit.razor +++ b/Oqtane.Client/Modules/Admin/Pages/Edit.razor @@ -7,7 +7,7 @@ @using Oqtane.Security @namespace Oqtane.Modules.Admin.Pages @inherits ModuleBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IPageService PageService @inject IThemeService ThemeService @@ -35,7 +35,7 @@ - @foreach (Page page in pages) { @@ -138,7 +138,7 @@ - + Cancel

@@ -215,7 +215,7 @@ } } - private void ParentChanged(UIChangeEventArgs e) + private void ParentChanged(ChangeEventArgs e) { try { @@ -298,7 +298,7 @@ await PageService.UpdatePageOrderAsync(page.SiteId, currentparentid); PageState.Reload = Constants.ReloadSite; - UriHelper.NavigateTo(NavigateUrl()); + NavigationManager.NavigateTo(NavigateUrl()); } catch (Exception ex) { diff --git a/Oqtane.Client/Modules/Admin/Profile/Index.razor b/Oqtane.Client/Modules/Admin/Profile/Index.razor index 3aebe474..937c96b8 100644 --- a/Oqtane.Client/Modules/Admin/Profile/Index.razor +++ b/Oqtane.Client/Modules/Admin/Profile/Index.razor @@ -5,7 +5,7 @@ @using Oqtane.Services @namespace Oqtane.Modules.Admin.Profile @inherits ModuleBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IUserService UserService @inject IProfileService ProfileService @inject ISettingService SettingService @@ -49,13 +49,13 @@ - + } - - + +

} @@ -107,7 +107,7 @@ await UserService.UpdateUserAsync(user); await SettingService.UpdateUserSettingsAsync(settings, PageState.User.UserId); - UriHelper.NavigateTo(""); + NavigationManager.NavigateTo(""); } catch (Exception ex) { @@ -117,10 +117,10 @@ private void Cancel() { - UriHelper.NavigateTo(NavigateUrl("")); + NavigationManager.NavigateTo(NavigateUrl("")); } - private void ProfileChanged(UIChangeEventArgs e, string SettingName) + private void ProfileChanged(ChangeEventArgs e, string SettingName) { string value = (string)e.Value; settings = SettingService.SetSetting(settings, SettingName, value); diff --git a/Oqtane.Client/Modules/Admin/Register/Index.razor b/Oqtane.Client/Modules/Admin/Register/Index.razor index c9708440..3158e17a 100644 --- a/Oqtane.Client/Modules/Admin/Register/Index.razor +++ b/Oqtane.Client/Modules/Admin/Register/Index.razor @@ -4,7 +4,7 @@ @using Oqtane.Services @namespace Oqtane.Modules.Admin.Register @inherits ModuleBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IUserService UserService
@@ -16,8 +16,8 @@
- - + + @code { @@ -36,11 +36,11 @@ user.IsHost = false; user.Password = Password; await UserService.AddUserAsync(user); - UriHelper.NavigateTo(""); + NavigationManager.NavigateTo(""); } private void Cancel() { - UriHelper.NavigateTo(NavigateUrl("")); // navigate to home + NavigationManager.NavigateTo(NavigateUrl("")); // navigate to home } } diff --git a/Oqtane.Client/Modules/Admin/Sites/Add.razor b/Oqtane.Client/Modules/Admin/Sites/Add.razor index f71372b9..69ab9902 100644 --- a/Oqtane.Client/Modules/Admin/Sites/Add.razor +++ b/Oqtane.Client/Modules/Admin/Sites/Add.razor @@ -6,7 +6,7 @@ @using Oqtane.Security @namespace Oqtane.Modules.Admin.Sites @inherits ModuleBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject ITenantService TenantService @inject IAliasService AliasService @inject ISiteService SiteService @@ -58,7 +58,7 @@ else - + Cancel } @@ -113,6 +113,6 @@ else await PageService.AddPageAsync(p); - UriHelper.NavigateTo(url, true); + NavigationManager.NavigateTo(url, true); } } diff --git a/Oqtane.Client/Modules/Controls/PermissionGrid.razor b/Oqtane.Client/Modules/Controls/PermissionGrid.razor index 0174d1fa..d05c3c2a 100644 --- a/Oqtane.Client/Modules/Controls/PermissionGrid.razor +++ b/Oqtane.Client/Modules/Controls/PermissionGrid.razor @@ -70,7 +70,7 @@ - + diff --git a/Oqtane.Client/Modules/Counter/Index.razor b/Oqtane.Client/Modules/Counter/Index.razor index 9b1ef774..32d3625c 100644 --- a/Oqtane.Client/Modules/Counter/Index.razor +++ b/Oqtane.Client/Modules/Counter/Index.razor @@ -3,7 +3,7 @@ @inherits ModuleBase Current count: @currentCount
- +

diff --git a/Oqtane.Client/Modules/HtmlText/Edit.razor b/Oqtane.Client/Modules/HtmlText/Edit.razor index 2ba17971..8dd8140d 100644 --- a/Oqtane.Client/Modules/HtmlText/Edit.razor +++ b/Oqtane.Client/Modules/HtmlText/Edit.razor @@ -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 @@ - + Cancel

@@ -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) { diff --git a/Oqtane.Client/Modules/HtmlText/Index.razor b/Oqtane.Client/Modules/HtmlText/Index.razor index c27172b1..e7e372b9 100644 --- a/Oqtane.Client/Modules/HtmlText/Index.razor +++ b/Oqtane.Client/Modules/HtmlText/Index.razor @@ -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) { diff --git a/Oqtane.Client/Modules/HtmlText/Services/HtmlTextService.cs b/Oqtane.Client/Modules/HtmlText/Services/HtmlTextService.cs index e2849879..389babf9 100644 --- a/Oqtane.Client/Modules/HtmlText/Services/HtmlTextService.cs +++ b/Oqtane.Client/Modules/HtmlText/Services/HtmlTextService.cs @@ -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 GetHtmlTextAsync(int ModuleId) diff --git a/Oqtane.Client/Oqtane.Client.csproj b/Oqtane.Client/Oqtane.Client.csproj index 63384937..e031ac11 100644 --- a/Oqtane.Client/Oqtane.Client.csproj +++ b/Oqtane.Client/Oqtane.Client.csproj @@ -1,13 +1,12 @@  - netstandard2.0 - Exe - + netcoreapp3.0 + + 3.0 Debug;Release;Wasm 0.0.1 @@ -25,15 +24,19 @@ TRACE;WASM - + - - - + + + + + + false + diff --git a/Oqtane.Client/Providers/IdentityAuthenticationStateProvider.cs b/Oqtane.Client/Providers/IdentityAuthenticationStateProvider.cs index c02016a5..0a83b3c4 100644 --- a/Oqtane.Client/Providers/IdentityAuthenticationStateProvider.cs +++ b/Oqtane.Client/Providers/IdentityAuthenticationStateProvider.cs @@ -3,6 +3,7 @@ using System.Net.Http; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Authorization; using Oqtane.Models; using Oqtane.Services; using Oqtane.Shared; @@ -11,20 +12,20 @@ namespace Oqtane.Providers { public class IdentityAuthenticationStateProvider : AuthenticationStateProvider { - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; private readonly SiteState sitestate; - public IdentityAuthenticationStateProvider(IUriHelper urihelper, SiteState sitestate) + public IdentityAuthenticationStateProvider(NavigationManager NavigationManager, SiteState sitestate) { - this.urihelper = urihelper; + this.NavigationManager = NavigationManager; this.sitestate = sitestate; } public override async Task GetAuthenticationStateAsync() { - // hack: create a new HttpClient rather than relying on the registered service as the AuthenticationStateProvider is initialized prior to IUriHelper ( https://github.com/aspnet/AspNetCore/issues/11867 ) + // hack: create a new HttpClient rather than relying on the registered service as the AuthenticationStateProvider is initialized prior to NavigationManager ( https://github.com/aspnet/AspNetCore/issues/11867 ) HttpClient http = new HttpClient(); - string apiurl = ServiceBase.CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "User") + "/authenticate"; + string apiurl = ServiceBase.CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "User") + "/authenticate"; User user = await http.GetJsonAsync(apiurl); ClaimsIdentity identity = new ClaimsIdentity(); diff --git a/Oqtane.Client/Services/AliasService.cs b/Oqtane.Client/Services/AliasService.cs index f1b22cb3..10d24df8 100644 --- a/Oqtane.Client/Services/AliasService.cs +++ b/Oqtane.Client/Services/AliasService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public AliasService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public AliasService(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(), "Alias"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Alias"); } } public async Task> GetAliasesAsync() diff --git a/Oqtane.Client/Services/FileService.cs b/Oqtane.Client/Services/FileService.cs index 57eddcc2..5bb68325 100644 --- a/Oqtane.Client/Services/FileService.cs +++ b/Oqtane.Client/Services/FileService.cs @@ -8,19 +8,19 @@ namespace Oqtane.Services public class FileService : ServiceBase, IFileService { private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; private readonly IJSRuntime jsRuntime; - public FileService(SiteState sitestate, IUriHelper urihelper, IJSRuntime jsRuntime) + public FileService(SiteState sitestate, NavigationManager NavigationManager, IJSRuntime jsRuntime) { this.sitestate = sitestate; - this.urihelper = urihelper; + this.NavigationManager = NavigationManager; this.jsRuntime = jsRuntime; } private string apiurl { - get { return CreateApiUrl(sitestate.Alias, urihelper.GetAbsoluteUri(), "File"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "File"); } } public async Task UploadFilesAsync(string Folder) diff --git a/Oqtane.Client/Services/Interfaces/InstallationService.cs b/Oqtane.Client/Services/Interfaces/InstallationService.cs index 399140ef..e198e1b4 100644 --- a/Oqtane.Client/Services/Interfaces/InstallationService.cs +++ b/Oqtane.Client/Services/Interfaces/InstallationService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public InstallationService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public InstallationService(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(), "Installation"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Installation"); } } public async Task IsInstalled() diff --git a/Oqtane.Client/Services/ModuleDefinitionService.cs b/Oqtane.Client/Services/ModuleDefinitionService.cs index 6ddde8af..1db1cd83 100644 --- a/Oqtane.Client/Services/ModuleDefinitionService.cs +++ b/Oqtane.Client/Services/ModuleDefinitionService.cs @@ -14,18 +14,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public ModuleDefinitionService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public ModuleDefinitionService(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(), "ModuleDefinition"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "ModuleDefinition"); } } public async Task> GetModuleDefinitionsAsync() diff --git a/Oqtane.Client/Services/ModuleService.cs b/Oqtane.Client/Services/ModuleService.cs index 8fa12e89..40162015 100644 --- a/Oqtane.Client/Services/ModuleService.cs +++ b/Oqtane.Client/Services/ModuleService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public ModuleService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public ModuleService(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(), "Module"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Module"); } } public async Task> GetModulesAsync(int PageId) diff --git a/Oqtane.Client/Services/PageModuleService.cs b/Oqtane.Client/Services/PageModuleService.cs index 146b7687..d4af4fa6 100644 --- a/Oqtane.Client/Services/PageModuleService.cs +++ b/Oqtane.Client/Services/PageModuleService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public PageModuleService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public PageModuleService(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(), "PageModule"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "PageModule"); } } public async Task> GetPageModulesAsync() diff --git a/Oqtane.Client/Services/PageService.cs b/Oqtane.Client/Services/PageService.cs index e23ea0f1..78253b72 100644 --- a/Oqtane.Client/Services/PageService.cs +++ b/Oqtane.Client/Services/PageService.cs @@ -13,18 +13,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public PageService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public PageService(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(), "Page"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Page"); } } public async Task> GetPagesAsync(int SiteId) diff --git a/Oqtane.Client/Services/ProfileService.cs b/Oqtane.Client/Services/ProfileService.cs index 4024c143..ecb8bbef 100644 --- a/Oqtane.Client/Services/ProfileService.cs +++ b/Oqtane.Client/Services/ProfileService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public ProfileService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public ProfileService(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(), "Profile"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Profile"); } } public async Task> GetProfilesAsync() diff --git a/Oqtane.Client/Services/RoleService.cs b/Oqtane.Client/Services/RoleService.cs index 8f770e78..b87e609f 100644 --- a/Oqtane.Client/Services/RoleService.cs +++ b/Oqtane.Client/Services/RoleService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public RoleService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public RoleService(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(), "Role"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Role"); } } public async Task> GetRolesAsync() diff --git a/Oqtane.Client/Services/SettingService.cs b/Oqtane.Client/Services/SettingService.cs index f36b4d67..c74e48e6 100644 --- a/Oqtane.Client/Services/SettingService.cs +++ b/Oqtane.Client/Services/SettingService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public SettingService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public SettingService(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(), "Setting"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Setting"); } } public async Task> GetHostSettingsAsync() diff --git a/Oqtane.Client/Services/SiteService.cs b/Oqtane.Client/Services/SiteService.cs index 2ca7139b..194ce482 100644 --- a/Oqtane.Client/Services/SiteService.cs +++ b/Oqtane.Client/Services/SiteService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public SiteService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public SiteService(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(), "Site"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Site"); } } public async Task> GetSitesAsync() diff --git a/Oqtane.Client/Services/TenantService.cs b/Oqtane.Client/Services/TenantService.cs index 4da871fb..92110518 100644 --- a/Oqtane.Client/Services/TenantService.cs +++ b/Oqtane.Client/Services/TenantService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public TenantService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public TenantService(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(), "Tenant"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Tenant"); } } public async Task> GetTenantsAsync() diff --git a/Oqtane.Client/Services/ThemeService.cs b/Oqtane.Client/Services/ThemeService.cs index a38a9e28..84fa66bf 100644 --- a/Oqtane.Client/Services/ThemeService.cs +++ b/Oqtane.Client/Services/ThemeService.cs @@ -14,18 +14,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public ThemeService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public ThemeService(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(), "Theme"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "Theme"); } } public async Task> GetThemesAsync() diff --git a/Oqtane.Client/Services/UserRoleService.cs b/Oqtane.Client/Services/UserRoleService.cs index b84a8450..baa44836 100644 --- a/Oqtane.Client/Services/UserRoleService.cs +++ b/Oqtane.Client/Services/UserRoleService.cs @@ -12,18 +12,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public UserRoleService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public UserRoleService(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(), "UserRole"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "UserRole"); } } public async Task> GetUserRolesAsync() diff --git a/Oqtane.Client/Services/UserService.cs b/Oqtane.Client/Services/UserService.cs index ab736094..2343d6cf 100644 --- a/Oqtane.Client/Services/UserService.cs +++ b/Oqtane.Client/Services/UserService.cs @@ -13,18 +13,18 @@ namespace Oqtane.Services { private readonly HttpClient http; private readonly SiteState sitestate; - private readonly IUriHelper urihelper; + private readonly NavigationManager NavigationManager; - public UserService(HttpClient http, SiteState sitestate, IUriHelper urihelper) + public UserService(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(), "User"); } + get { return CreateApiUrl(sitestate.Alias, NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri, "User"); } } public async Task> GetUsersAsync(int SiteId) diff --git a/Oqtane.Client/Shared/Installer.razor b/Oqtane.Client/Shared/Installer.razor index de2bf1b4..08100625 100644 --- a/Oqtane.Client/Shared/Installer.razor +++ b/Oqtane.Client/Shared/Installer.razor @@ -2,7 +2,7 @@ @using Oqtane.Models @using Oqtane.Shared @namespace Oqtane.Shared -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IInstallationService InstallationService @inject IUserService UserService @@ -50,7 +50,7 @@ - @@ -104,7 +104,7 @@
-

+

@((MarkupString)@Message)
@@ -124,7 +124,7 @@ private string IntegratedSecurityDisplay = "display:none;"; private string LoadingDisplay = "display:none;"; - private void SetIntegratedSecurity(UIChangeEventArgs e) + private void SetIntegratedSecurity(ChangeEventArgs e) { if (Convert.ToBoolean(e.Value)) { @@ -173,7 +173,7 @@ user.Password = HostPassword; user = await UserService.AddUserAsync(user); - UriHelper.NavigateTo("", true); + NavigationManager.NavigateTo("", true); } else { diff --git a/Oqtane.Client/Shared/Interop.cs b/Oqtane.Client/Shared/Interop.cs index 86430083..15534ca1 100644 --- a/Oqtane.Client/Shared/Interop.cs +++ b/Oqtane.Client/Shared/Interop.cs @@ -28,7 +28,7 @@ namespace Oqtane.Shared } } - public Task GetCookie(string name) + public ValueTask GetCookie(string name) { try { @@ -38,7 +38,7 @@ namespace Oqtane.Shared } catch { - return Task.FromResult(string.Empty); + return new ValueTask(Task.FromResult(string.Empty)); } } @@ -57,7 +57,7 @@ namespace Oqtane.Shared } } - public Task GetElementByName(string name) + public ValueTask GetElementByName(string name) { try { @@ -67,7 +67,7 @@ namespace Oqtane.Shared } catch { - return Task.FromResult(string.Empty); + return new ValueTask(Task.FromResult(string.Empty)); } } diff --git a/Oqtane.Client/Shared/SiteRouter.razor b/Oqtane.Client/Shared/SiteRouter.razor index 779de435..da4f4e7e 100644 --- a/Oqtane.Client/Shared/SiteRouter.razor +++ b/Oqtane.Client/Shared/SiteRouter.razor @@ -6,13 +6,13 @@ @using System.Collections.Generic @using Oqtane.Shared @using Oqtane.Security +@using Microsoft.AspNetCore.Components.Authorization @using Microsoft.AspNetCore.Components.Routing @namespace Oqtane.Shared @inject AuthenticationStateProvider AuthenticationStateProvider @inject SiteState SiteState -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject INavigationInterception NavigationInterception -@inject IComponentContext ComponentContext @inject IAliasService AliasService @inject ITenantService TenantService @inject ISiteService SiteService @@ -41,8 +41,8 @@ protected override void OnInitialized() { - _absoluteUri = UriHelper.GetAbsoluteUri(); - UriHelper.OnLocationChanged += OnLocationChanged; + _absoluteUri = NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri; + NavigationManager.LocationChanged += LocationChanged; DynamicComponent = builder => { @@ -56,7 +56,7 @@ public void Dispose() { - UriHelper.OnLocationChanged -= OnLocationChanged; + NavigationManager.LocationChanged -= LocationChanged; } protected override async Task OnParametersSetAsync() @@ -268,7 +268,7 @@ } } - private async void OnLocationChanged(object sender, LocationChangedEventArgs args) + private async void LocationChanged(object sender, LocationChangedEventArgs args) { _absoluteUri = args.Location; await Refresh(); @@ -276,7 +276,7 @@ Task IHandleAfterRender.OnAfterRenderAsync() { - if (!_navigationInterceptionEnabled && ComponentContext.IsConnected) + if (!_navigationInterceptionEnabled) { _navigationInterceptionEnabled = true; return NavigationInterception.EnableNavigationInterceptionAsync(); diff --git a/Oqtane.Client/Themes/Controls/ControlPanel.razor b/Oqtane.Client/Themes/Controls/ControlPanel.razor index 59541741..f9c8d217 100644 --- a/Oqtane.Client/Themes/Controls/ControlPanel.razor +++ b/Oqtane.Client/Themes/Controls/ControlPanel.razor @@ -6,7 +6,7 @@ @using Oqtane.Security @namespace Oqtane.Themes.Controls @inherits ThemeObjectBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IUserService UserService @inject IModuleDefinitionService ModuleDefinitionService @inject IThemeService ThemeService @@ -68,7 +68,7 @@ }
- + @@ -140,7 +140,7 @@ await PageModuleService.UpdatePageModuleOrderAsync(pagemodule.PageId, pagemodule.Pane); PageState.Reload = Constants.ReloadPage; - UriHelper.NavigateTo(NavigateUrl()); + NavigationManager.NavigateTo(NavigateUrl()); } } @@ -180,7 +180,7 @@ PageState.DesignMode = true; } PageState.Reload = Constants.ReloadPage; - UriHelper.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + PageState.EditMode.ToString().ToLower())); + NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "edit=" + PageState.EditMode.ToString().ToLower())); } } } \ No newline at end of file diff --git a/Oqtane.Client/Themes/Controls/Login.razor b/Oqtane.Client/Themes/Controls/Login.razor index 93c59bb1..4d2337ed 100644 --- a/Oqtane.Client/Themes/Controls/Login.razor +++ b/Oqtane.Client/Themes/Controls/Login.razor @@ -5,7 +5,7 @@ @using Microsoft.JSInterop @namespace Oqtane.Themes.Controls @inherits ThemeObjectBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IUserService UserService @inject IJSRuntime jsRuntime @inject IServiceProvider ServiceProvider @@ -15,10 +15,10 @@ ... - + - + @@ -31,7 +31,7 @@ { returnurl += "/" + PageState.Page.Path; } - UriHelper.NavigateTo("login?returnurl=" + returnurl); + NavigationManager.NavigateTo("login?returnurl=" + returnurl); } private async Task LogoutUser() @@ -52,7 +52,7 @@ // client-side Blazor authstateprovider.NotifyAuthenticationChanged(); PageState.Reload = Constants.ReloadSite; - UriHelper.NavigateTo(NavigateUrl(PageState.Page.Path, "logout")); + NavigationManager.NavigateTo(NavigateUrl(PageState.Page.Path, "logout")); } } } diff --git a/Oqtane.Client/Themes/Controls/ModuleActions.razor b/Oqtane.Client/Themes/Controls/ModuleActions.razor index a83f6ddd..5e0d8029 100644 --- a/Oqtane.Client/Themes/Controls/ModuleActions.razor +++ b/Oqtane.Client/Themes/Controls/ModuleActions.razor @@ -5,7 +5,7 @@ @using Oqtane.Security @namespace Oqtane.Themes.Controls @inherits ContainerBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager @inject IUserService UserService @inject IPageModuleService PageModuleService @@ -16,7 +16,7 @@ @@ -104,7 +104,7 @@ break; } PageState.Reload = Constants.ReloadPage; - UriHelper.NavigateTo(url); + NavigationManager.NavigateTo(url); } } diff --git a/Oqtane.Client/Themes/Controls/Profile.razor b/Oqtane.Client/Themes/Controls/Profile.razor index c9667a01..03ed2b32 100644 --- a/Oqtane.Client/Themes/Controls/Profile.razor +++ b/Oqtane.Client/Themes/Controls/Profile.razor @@ -1,17 +1,18 @@ @using Oqtane.Themes +@using Microsoft.AspNetCore.Components.Authorization @namespace Oqtane.Themes.Controls @inherits ThemeObjectBase -@inject IUriHelper UriHelper +@inject NavigationManager NavigationManager ... - + - + @@ -20,12 +21,12 @@ private void RegisterUser() { - UriHelper.NavigateTo(NavigateUrl("register")); + NavigationManager.NavigateTo(NavigateUrl("register")); } private void UpdateProfile() { - UriHelper.NavigateTo(NavigateUrl("profile")); + NavigationManager.NavigateTo(NavigateUrl("profile")); } } diff --git a/Oqtane.Server/Oqtane.Server.csproj b/Oqtane.Server/Oqtane.Server.csproj index 540d0f80..55f2106e 100644 --- a/Oqtane.Server/Oqtane.Server.csproj +++ b/Oqtane.Server/Oqtane.Server.csproj @@ -2,11 +2,10 @@ netcoreapp3.0 - 7.3 - + true Debug;Release;Wasm 0.0.1 @@ -38,11 +37,11 @@ - - - - - + + + + + diff --git a/Oqtane.Server/Pages/_Host.cshtml b/Oqtane.Server/Pages/_Host.cshtml index 30862539..b8e8ccf7 100644 --- a/Oqtane.Server/Pages/_Host.cshtml +++ b/Oqtane.Server/Pages/_Host.cshtml @@ -15,7 +15,7 @@ @(Html.AntiForgeryToken()) - @(await Html.RenderComponentAsync()) + @(await Html.RenderComponentAsync(RenderMode.Server)) diff --git a/Oqtane.Server/Startup.cs b/Oqtane.Server/Startup.cs index e8fa612b..6f6ddf7a 100644 --- a/Oqtane.Server/Startup.cs +++ b/Oqtane.Server/Startup.cs @@ -56,7 +56,7 @@ namespace Oqtane.Server services.AddScoped(s => { // creating the URI helper needs to wait until the JS Runtime is initialized, so defer it. - var uriHelper = s.GetRequiredService(); + var NavigationManager = s.GetRequiredService(); var httpContextAccessor = s.GetRequiredService(); var authToken = httpContextAccessor.HttpContext.Request.Cookies[".AspNetCore.Identity.Application"]; var client = new HttpClient(new HttpClientHandler { UseCookies = false }); @@ -64,7 +64,7 @@ namespace Oqtane.Server { client.DefaultRequestHeaders.Add("Cookie", ".AspNetCore.Identity.Application=" + authToken); } - client.BaseAddress = new Uri(uriHelper.GetBaseUri()); + client.BaseAddress = new Uri(NavigationManager.ToAbsoluteUri(NavigationManager.Uri).AbsoluteUri); return client; }); } diff --git a/Oqtane.Shared/Oqtane.Shared.csproj b/Oqtane.Shared/Oqtane.Shared.csproj index 5f73f172..08c5ff79 100644 --- a/Oqtane.Shared/Oqtane.Shared.csproj +++ b/Oqtane.Shared/Oqtane.Shared.csproj @@ -1,8 +1,7 @@  - netstandard2.0 - 7.3 + netstandard2.1 Debug;Release;Wasm 0.0.1 Oqtane @@ -21,8 +20,8 @@ - - + + From 952336735a910f530398a60e9af2b016e4f116b0 Mon Sep 17 00:00:00 2001 From: Emanuele Filardo Date: Sun, 15 Sep 2019 20:16:36 +0200 Subject: [PATCH 13/13] fix for WASM --- Oqtane.Client/Startup.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Oqtane.Client/Startup.cs b/Oqtane.Client/Startup.cs index fbb94e81..8698416e 100644 --- a/Oqtane.Client/Startup.cs +++ b/Oqtane.Client/Startup.cs @@ -10,6 +10,7 @@ using Oqtane.Modules; using Oqtane.Shared; using Oqtane.Providers; using Microsoft.AspNetCore.Blazor.Http; +using Microsoft.AspNetCore.Components.Authorization; namespace Oqtane.Client {