Page:
@@ -77,6 +88,7 @@
private Dictionary _containers;
private string _title;
private string _containerType;
+ private string _allPages = "false";
private string _permissionNames = "";
private string _permissions;
private string _pageId;
@@ -95,6 +107,7 @@
_title = ModuleState.Title;
_containers = ThemeService.GetContainerTypes(await ThemeService.GetThemesAsync());
_containerType = ModuleState.ContainerType;
+ _allPages = ModuleState.AllPages.ToString();
_permissions = ModuleState.Permissions;
_permissionNames = ModuleState.ModuleDefinition.PermissionNames;
_pageId = ModuleState.PageId.ToString();
@@ -120,18 +133,18 @@
private async Task SaveModule()
{
- var module = ModuleState;
- module.Permissions = _permissionGrid.GetPermissions();
- await ModuleService.UpdateModuleAsync(module);
-
var pagemodule = await PageModuleService.GetPageModuleAsync(ModuleState.PageModuleId);
pagemodule.PageId = int.Parse(_pageId);
pagemodule.Title = _title;
pagemodule.ContainerType = _containerType;
-
await PageModuleService.UpdatePageModuleAsync(pagemodule);
await PageModuleService.UpdatePageModuleOrderAsync(pagemodule.PageId, pagemodule.Pane);
+ var module = ModuleState;
+ module.AllPages = bool.Parse(_allPages);
+ module.Permissions = _permissionGrid.GetPermissions();
+ await ModuleService.UpdateModuleAsync(module);
+
if (_settingsModuleType != null)
{
var moduleType = Type.GetType(ModuleState.ModuleType);
diff --git a/Oqtane.Client/Modules/Admin/Upgrade/Index.razor b/Oqtane.Client/Modules/Admin/Upgrade/Index.razor
index 2aa2ce86..f2e2e709 100644
--- a/Oqtane.Client/Modules/Admin/Upgrade/Index.razor
+++ b/Oqtane.Client/Modules/Admin/Upgrade/Index.razor
@@ -11,29 +11,27 @@
@if (_upgradeavailable)
{
-
- @("Framework") @_package.Version await Download(Constants.PackageId, Constants.Version))>Download
+
+ @("Framework") @_package.Version await Download(Constants.PackageId, Constants.Version))>Upgrade
}
else
{
}
- @if (_upgradeavailable)
- {
- Framework:
+ Framework:
+ Install
- }
}
diff --git a/Oqtane.Client/Modules/Controls/ActionDialog.razor b/Oqtane.Client/Modules/Controls/ActionDialog.razor
index 08b2d77d..0ee455d7 100644
--- a/Oqtane.Client/Modules/Controls/ActionDialog.razor
+++ b/Oqtane.Client/Modules/Controls/ActionDialog.razor
@@ -1,6 +1,6 @@
@namespace Oqtane.Modules.Controls
@inherits ModuleBase
-
+@attribute [OqtaneIgnore]
@if (_visible)
{
diff --git a/Oqtane.Client/Modules/Controls/ActionLink.razor b/Oqtane.Client/Modules/Controls/ActionLink.razor
index cf588579..97fd0a0e 100644
--- a/Oqtane.Client/Modules/Controls/ActionLink.razor
+++ b/Oqtane.Client/Modules/Controls/ActionLink.razor
@@ -1,5 +1,6 @@
@namespace Oqtane.Modules.Controls
-@inherits ModuleBase
+@inherits ModuleBase
+@attribute [OqtaneIgnore]
@inject IUserService UserService
@if (_authorized)
diff --git a/Oqtane.Client/Modules/Controls/AuditInfo.razor b/Oqtane.Client/Modules/Controls/AuditInfo.razor
index 75079c6c..7c081d3f 100644
--- a/Oqtane.Client/Modules/Controls/AuditInfo.razor
+++ b/Oqtane.Client/Modules/Controls/AuditInfo.razor
@@ -1,5 +1,6 @@
@namespace Oqtane.Modules.Controls
-@inherits ModuleBase
+@inherits ModuleBase
+@attribute [OqtaneIgnore]
@if (_text != string.Empty)
{
diff --git a/Oqtane.Client/Modules/Controls/FileManager.razor b/Oqtane.Client/Modules/Controls/FileManager.razor
index 0519e1b5..8dc70ffb 100644
--- a/Oqtane.Client/Modules/Controls/FileManager.razor
+++ b/Oqtane.Client/Modules/Controls/FileManager.razor
@@ -1,5 +1,6 @@
@namespace Oqtane.Modules.Controls
-@inherits ModuleBase
+@inherits ModuleBase
+@attribute [OqtaneIgnore]
@inject IFolderService FolderService
@inject IFileService FileService
@inject IJSRuntime JsRuntime
diff --git a/Oqtane.Client/Modules/Controls/Label.razor b/Oqtane.Client/Modules/Controls/Label.razor
index 0826e0cb..e57d01ec 100644
--- a/Oqtane.Client/Modules/Controls/Label.razor
+++ b/Oqtane.Client/Modules/Controls/Label.razor
@@ -1,5 +1,6 @@
@namespace Oqtane.Modules.Controls
-@inherits ModuleBase
+@inherits ModuleBase
+@attribute [OqtaneIgnore]
@if (!string.IsNullOrEmpty(HelpText))
{
@@ -41,4 +42,4 @@ else
_openLabel += ">";
}
-}
\ No newline at end of file
+}
diff --git a/Oqtane.Client/Modules/Controls/ModuleMessage.razor b/Oqtane.Client/Modules/Controls/ModuleMessage.razor
index 67f3f50d..5e00cb76 100644
--- a/Oqtane.Client/Modules/Controls/ModuleMessage.razor
+++ b/Oqtane.Client/Modules/Controls/ModuleMessage.razor
@@ -1,5 +1,6 @@
@namespace Oqtane.Modules.Controls
-@inherits ModuleBase
+@inherits ModuleBase
+@attribute [OqtaneIgnore]
@if (!string.IsNullOrEmpty(_message))
{
diff --git a/Oqtane.Client/Modules/Controls/Pager.razor b/Oqtane.Client/Modules/Controls/Pager.razor
index 184eaa8a..ff7e13ee 100644
--- a/Oqtane.Client/Modules/Controls/Pager.razor
+++ b/Oqtane.Client/Modules/Controls/Pager.razor
@@ -1,6 +1,8 @@
@namespace Oqtane.Modules.Controls
@inherits ModuleBase
-@typeparam TableItem
+@attribute [OqtaneIgnore]
+@typeparam TableItem
+
@if(Format == "Table")
@@ -209,4 +211,4 @@
UpdateList(_page);
}
-}
\ No newline at end of file
+}
diff --git a/Oqtane.Client/Modules/Controls/PermissionGrid.razor b/Oqtane.Client/Modules/Controls/PermissionGrid.razor
index 543403f2..90954bbe 100644
--- a/Oqtane.Client/Modules/Controls/PermissionGrid.razor
+++ b/Oqtane.Client/Modules/Controls/PermissionGrid.razor
@@ -1,5 +1,6 @@
@namespace Oqtane.Modules.Controls
-@inherits ModuleBase
+@inherits ModuleBase
+@attribute [OqtaneIgnore]
@inject IRoleService RoleService
@inject IUserService UserService
diff --git a/Oqtane.Client/Modules/Controls/RichTextEditor.razor b/Oqtane.Client/Modules/Controls/RichTextEditor.razor
index 36368c5a..47df0248 100644
--- a/Oqtane.Client/Modules/Controls/RichTextEditor.razor
+++ b/Oqtane.Client/Modules/Controls/RichTextEditor.razor
@@ -1,28 +1,82 @@
@namespace Oqtane.Modules.Controls
@inherits ModuleBase
+@attribute [OqtaneIgnore]
@inject IJSRuntime JsRuntime
-@if (_filemanagervisible)
-{
-
- @((MarkupString)_message)
-
-}
-
- Insert Image
- @if (_filemanagervisible)
- {
- @((MarkupString)" ")
- Close
- }
-
-
-
-
- @ToolbarContent
-
-
-
+
+
+
+
+ @if (_filemanagervisible)
+ {
+
+ @((MarkupString)_message)
+
+ }
+
+ Synchronize Content
+ Insert Image
+ @if (_filemanagervisible)
+ {
+ @((MarkupString)" ")
+ Close
+ }
+
+
+
+
+ @if (ToolbarContent != null)
+ {
+ @ToolbarContent
+ }
+ else
+ {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+
+
+
+
+
+
+
+
+ Synchronize Content
+
+ @if (ReadOnly)
+ {
+
+ }
+ else
+ {
+
+ }
+
+
@@ -31,10 +85,12 @@
private ElementReference _toolBar;
private bool _filemanagervisible = false;
private FileManager _fileManager;
+ private string _content = string.Empty;
+ private string _original = string.Empty;
private string _message = string.Empty;
[Parameter]
- public RenderFragment ToolbarContent { get; set; }
+ public string Content { get; set; }
[Parameter]
public bool ReadOnly { get; set; } = false;
@@ -42,12 +98,21 @@
[Parameter]
public string Placeholder { get; set; } = "Enter Your Content...";
+ // parameters only applicable to rich text editor
+ [Parameter]
+ public RenderFragment ToolbarContent { get; set; }
+
[Parameter]
public string Theme { get; set; } = "snow";
[Parameter]
public string DebugLevel { get; set; } = "info";
+ protected override void OnInitialized()
+ {
+ _content = Content; // raw HTML
+ }
+
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
@@ -60,42 +125,57 @@
Placeholder,
Theme,
DebugLevel);
+
+ await RichTextEditorInterop.LoadEditorContent(
+ JsRuntime,
+ _editorElement, Content);
+
+ // preserve a copy of the rich text content ( Quill sanitizes content so we need to retrieve it from the editor )
+ _original = await RichTextEditorInterop.GetHtml(
+ JsRuntime,
+ _editorElement);
}
}
- public async Task
GetText()
+ public void CloseFileManager()
{
- return await RichTextEditorInterop.GetText(
+ _filemanagervisible = false;
+ _message = string.Empty;
+ StateHasChanged();
+ }
+
+ public async Task RefreshRichText()
+ {
+ await RichTextEditorInterop.LoadEditorContent(
+ JsRuntime,
+ _editorElement, _content);
+ }
+
+ public async Task RefreshRawHtml()
+ {
+ _content = await RichTextEditorInterop.GetHtml(
JsRuntime,
_editorElement);
+ StateHasChanged();
}
public async Task GetHtml()
{
- return await RichTextEditorInterop.GetHtml(
- JsRuntime,
- _editorElement);
- }
+ // get rich text content
+ string content = await RichTextEditorInterop.GetHtml(
+ JsRuntime,
+ _editorElement);
- public async Task GetContent()
- {
- return await RichTextEditorInterop.GetContent(
- JsRuntime,
- _editorElement);
- }
-
- public async Task LoadContent(string content)
- {
- await RichTextEditorInterop.LoadEditorContent(
- JsRuntime,
- _editorElement, content);
- }
-
- public async Task EnableEditor(bool mode)
- {
- await RichTextEditorInterop.EnableEditor(
- JsRuntime,
- _editorElement, mode);
+ if (_original != content)
+ {
+ // rich text content has changed - return it
+ return content;
+ }
+ else
+ {
+ // return raw html content
+ return _content;
+ }
}
public async Task InsertImage()
@@ -121,16 +201,28 @@
_filemanagervisible = true;
_message = string.Empty;
}
-
StateHasChanged();
}
- public void CloseFileManager()
+ // other rich text editor methods which can be used by developers
+ public async Task GetText()
{
- _filemanagervisible = false;
- _message = string.Empty;
-
- StateHasChanged();
+ return await RichTextEditorInterop.GetText(
+ JsRuntime,
+ _editorElement);
}
+ public async Task GetContent()
+ {
+ return await RichTextEditorInterop.GetContent(
+ JsRuntime,
+ _editorElement);
+ }
+
+ public async Task EnableEditor(bool mode)
+ {
+ await RichTextEditorInterop.EnableEditor(
+ JsRuntime,
+ _editorElement, mode);
+ }
}
diff --git a/Oqtane.Client/UI/RichTextEditorInterop.cs b/Oqtane.Client/Modules/Controls/RichTextEditorInterop.cs
similarity index 98%
rename from Oqtane.Client/UI/RichTextEditorInterop.cs
rename to Oqtane.Client/Modules/Controls/RichTextEditorInterop.cs
index 54536005..1f590f8a 100644
--- a/Oqtane.Client/UI/RichTextEditorInterop.cs
+++ b/Oqtane.Client/Modules/Controls/RichTextEditorInterop.cs
@@ -2,7 +2,7 @@
using Microsoft.JSInterop;
using System.Threading.Tasks;
-namespace Oqtane.UI
+namespace Oqtane.Modules.Controls
{
public static class RichTextEditorInterop
{
diff --git a/Oqtane.Client/Modules/Controls/Section.razor b/Oqtane.Client/Modules/Controls/Section.razor
index 6921f933..4f33b42f 100644
--- a/Oqtane.Client/Modules/Controls/Section.razor
+++ b/Oqtane.Client/Modules/Controls/Section.razor
@@ -1,5 +1,6 @@
@namespace Oqtane.Modules.Controls
-@inherits ModuleBase
+@inherits ModuleBase
+@attribute [OqtaneIgnore]
diff --git a/Oqtane.Client/Modules/Controls/TabPanel.razor b/Oqtane.Client/Modules/Controls/TabPanel.razor
index d09ff53f..bd89ab59 100644
--- a/Oqtane.Client/Modules/Controls/TabPanel.razor
+++ b/Oqtane.Client/Modules/Controls/TabPanel.razor
@@ -1,5 +1,6 @@
@namespace Oqtane.Modules.Controls
-@inherits ModuleBase
+@inherits ModuleBase
+@attribute [OqtaneIgnore]
@if (Name == Parent.ActiveTab)
{
diff --git a/Oqtane.Client/Modules/Controls/TabStrip.razor b/Oqtane.Client/Modules/Controls/TabStrip.razor
index 4f0b872f..8d8d3838 100644
--- a/Oqtane.Client/Modules/Controls/TabStrip.razor
+++ b/Oqtane.Client/Modules/Controls/TabStrip.razor
@@ -1,5 +1,6 @@
@namespace Oqtane.Modules.Controls
-@inherits ModuleBase
+@inherits ModuleBase
+@attribute [OqtaneIgnore]
diff --git a/Oqtane.Client/Modules/HtmlText/Edit.razor b/Oqtane.Client/Modules/HtmlText/Edit.razor
index ab0f1feb..9df38687 100644
--- a/Oqtane.Client/Modules/HtmlText/Edit.razor
+++ b/Oqtane.Client/Modules/HtmlText/Edit.razor
@@ -7,111 +7,48 @@
@inject HttpClient http
@inject SiteState sitestate
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- @if (!RichTextEditorMode)
- {
- Rich Text Editor
- }
- else
- {
- Raw HTML Editor
- }
- Save
- Cancel
-
-
-
-
+@if (_content != null)
+{
+
+
Save
+
Cancel
+ @if (!string.IsNullOrEmpty(_content))
+ {
+
+
+ }
+}
@code {
- private string _visibleText = "d-none";
- private string _visibleRich;
- private bool _richTextEditorMode;
private RichTextEditor RichTextEditorHtml;
- private string content;
- private string createdby;
- private DateTime createdon;
- private string modifiedby;
- private DateTime modifiedon;
+ private string _content = null;
+ private string _createdby;
+ private DateTime _createdon;
+ private string _modifiedby;
+ private DateTime _modifiedon;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Edit;
public override string Title => "Edit Html/Text";
- public bool RichTextEditorMode
- {
- get => _richTextEditorMode;
- set
- {
- _richTextEditorMode = value;
-
- if (_richTextEditorMode)
- {
- _visibleText = "d-none";
- _visibleRich = string.Empty;
- }
- else
- {
- _visibleText = string.Empty;
- _visibleRich = "d-none";
- }
- }
- }
-
- protected override async Task OnAfterRenderAsync(bool firstRender)
+ protected override async Task OnInitializedAsync()
{
try
{
- if (firstRender)
+ var htmltextservice = new HtmlTextService(http, sitestate);
+ var htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
+ if (htmltext != null)
{
- if (content == null)
- {
- RichTextEditorMode = true;
- await LoadText();
- }
+ _content = htmltext.Content;
+ _content = _content.Replace(Constants.ContentUrl, "/" + PageState.Alias.AliasId.ToString() + Constants.ContentUrl);
+ _createdby = htmltext.CreatedBy;
+ _createdon = htmltext.CreatedOn;
+ _modifiedby = htmltext.ModifiedBy;
+ _modifiedon = htmltext.ModifiedOn;
+ }
+ else
+ {
+ _content = string.Empty;
}
}
catch (Exception ex)
@@ -121,48 +58,10 @@
}
}
- private async Task LoadText()
- {
- var htmltextservice = new HtmlTextService(http, sitestate);
- var htmltext = await htmltextservice.GetHtmlTextAsync(ModuleState.ModuleId);
- if (htmltext != null)
- {
- content = htmltext.Content;
- createdby = htmltext.CreatedBy;
- createdon = htmltext.CreatedOn;
- modifiedby = htmltext.ModifiedBy;
- modifiedon = htmltext.ModifiedOn;
-
- if (RichTextEditorMode)
- {
- await RichTextEditorHtml.LoadContent(content);
- StateHasChanged();
- }
- }
- }
-
- private async Task RichTextEditor()
- {
- RichTextEditorMode = true;
- await RichTextEditorHtml.LoadContent(content);
- StateHasChanged();
- }
-
- private async Task RawHtmlEditor()
- {
- content = await this.RichTextEditorHtml.GetHtml();
- RichTextEditorMode = false;
- StateHasChanged();
- }
-
private async Task SaveContent()
{
- if (RichTextEditorMode)
- {
- content = await RichTextEditorHtml.GetHtml();
- }
-
- content = content.Replace(((PageState.Alias.Path == string.Empty) ? "/~" : PageState.Alias.Path) + Constants.ContentUrl, Constants.ContentUrl);
+ string content = await RichTextEditorHtml.GetHtml();
+ content = content.Replace("/" + PageState.Alias.AliasId.ToString() + Constants.ContentUrl, Constants.ContentUrl);
try
{
@@ -180,7 +79,7 @@
htmltext.Content = content;
await htmltextservice.AddHtmlTextAsync(htmltext);
}
-
+
await logger.LogInformation("Html/Text Content Saved {HtmlText}", htmltext);
NavigationManager.NavigateTo(NavigateUrl());
}
@@ -190,5 +89,4 @@
AddModuleMessage("Error Saving Content", MessageType.Error);
}
}
-
}
diff --git a/Oqtane.Client/Modules/HtmlText/Index.razor b/Oqtane.Client/Modules/HtmlText/Index.razor
index e04ffbf2..c76afa02 100644
--- a/Oqtane.Client/Modules/HtmlText/Index.razor
+++ b/Oqtane.Client/Modules/HtmlText/Index.razor
@@ -30,7 +30,7 @@
if (htmltext != null)
{
content = htmltext.Content;
- content = content.Replace(Constants.ContentUrl, ((PageState.Alias.Path == "") ? "/~" : PageState.Alias.Path) + Constants.ContentUrl);
+ content = content.Replace(Constants.ContentUrl, "/" + PageState.Alias.AliasId.ToString() + Constants.ContentUrl);
}
}
catch (Exception ex)
diff --git a/Oqtane.Client/Oqtane.Client.csproj b/Oqtane.Client/Oqtane.Client.csproj
index f19dac81..6bb2f064 100644
--- a/Oqtane.Client/Oqtane.Client.csproj
+++ b/Oqtane.Client/Oqtane.Client.csproj
@@ -6,7 +6,7 @@
7.3
3.0
Debug;Release
-
0.9.0
+
0.9.1
Oqtane
Shaun Walker
.NET Foundation
diff --git a/Oqtane.Client/Services/ServiceBase.cs b/Oqtane.Client/Services/ServiceBase.cs
index 742bd3fa..57bad2b7 100644
--- a/Oqtane.Client/Services/ServiceBase.cs
+++ b/Oqtane.Client/Services/ServiceBase.cs
@@ -82,7 +82,6 @@ namespace Oqtane.Services
var result = await response.Content.ReadFromJsonAsync
();
return result;
}
-
return default;
}
@@ -121,6 +120,8 @@ namespace Oqtane.Services
if (response.StatusCode != HttpStatusCode.NoContent && response.StatusCode != HttpStatusCode.NotFound)
{
//TODO: Log errors here
+
+ Console.WriteLine($"Request: {response.RequestMessage.RequestUri}");
Console.WriteLine($"Response status: {response.StatusCode} {response.ReasonPhrase}");
}
diff --git a/Oqtane.Client/Themes/BlazorTheme/Container.razor b/Oqtane.Client/Themes/BlazorTheme/Container.razor
index d286aef0..e62bc207 100644
--- a/Oqtane.Client/Themes/BlazorTheme/Container.razor
+++ b/Oqtane.Client/Themes/BlazorTheme/Container.razor
@@ -2,7 +2,9 @@
@inherits ContainerBase
diff --git a/Oqtane.Client/Themes/BlazorTheme/Default.razor b/Oqtane.Client/Themes/BlazorTheme/Default.razor
index 7d9301e2..ecd3596e 100644
--- a/Oqtane.Client/Themes/BlazorTheme/Default.razor
+++ b/Oqtane.Client/Themes/BlazorTheme/Default.razor
@@ -7,15 +7,7 @@
diff --git a/Oqtane.Client/Themes/Controls/Breadcrumbs.razor b/Oqtane.Client/Themes/Controls/Breadcrumbs.razor
index 7175f85d..310132f5 100644
--- a/Oqtane.Client/Themes/Controls/Breadcrumbs.razor
+++ b/Oqtane.Client/Themes/Controls/Breadcrumbs.razor
@@ -1,26 +1,33 @@
@namespace Oqtane.Themes.Controls
-@inherits ThemeControlBase
+@inherits ThemeControlBase
+@attribute [OqtaneIgnore]
@if (BreadCrumbPages.Any())
{
-
- @foreach (var p in BreadCrumbPages)
- {
-
- @p.Name
-
- }
-
+
+
+ @foreach (var p in BreadCrumbPages)
+ {
+ if (p.PageId == PageState.Page.PageId)
+ {
+
+ @p.Name
+
+ }
+ else
+ {
+
+ @p.Name
+
+ }
+ }
+
+
}
@code {
protected IEnumerable
BreadCrumbPages => GetBreadCrumbPages().Reverse().ToList();
-
- protected string ActiveClass(Page page)
- {
- return (page.PageId == PageState.Page.PageId) ? " active" : string.Empty;
- }
private IEnumerable GetBreadCrumbPages()
{
diff --git a/Oqtane.Client/Themes/Controls/ControlPanel.razor b/Oqtane.Client/Themes/Controls/ControlPanel.razor
index fe9e5486..ec463657 100644
--- a/Oqtane.Client/Themes/Controls/ControlPanel.razor
+++ b/Oqtane.Client/Themes/Controls/ControlPanel.razor
@@ -1,6 +1,6 @@
@namespace Oqtane.Themes.Controls
-@using Oqtane.Enums
-@inherits ThemeControlBase
+@inherits ThemeControlBase
+@attribute [OqtaneIgnore]
@inject NavigationManager NavigationManager
@inject IUserService UserService
@inject IModuleDefinitionService ModuleDefinitionService
@@ -16,7 +16,7 @@