Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
@@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
@if (_style == MessageStyle.Toast)
|
@if (_style == MessageStyle.Toast)
|
||||||
{
|
{
|
||||||
<div class="app-modulemessage-toast bottom-0 end-0">
|
<div class="app-modulemessage-toast bottom-0 end-0" @key="DateTime.UtcNow">
|
||||||
<div class="@_classname alert-dismissible fade show mb-3" role="alert">
|
<div class="@_classname alert-dismissible fade show mb-3 rounded-end-0" role="alert">
|
||||||
@((MarkupString)Message)
|
@((MarkupString)Message)
|
||||||
@if (Type == MessageType.Error && PageState != null && UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
|
@if (Type == MessageType.Error && PageState != null && UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -118,7 +118,7 @@
|
|||||||
|
|
||||||
public void AddModuleMessage(string message, MessageType type, string position, MessageStyle style)
|
public void AddModuleMessage(string message, MessageType type, string position, MessageStyle style)
|
||||||
{
|
{
|
||||||
if (message != _messageContent || type != _messageType || position != _messagePosition || style != _messageStyle)
|
if (message != _messageContent || type != _messageType || position != _messagePosition || style != _messageStyle || style == MessageStyle.Toast)
|
||||||
{
|
{
|
||||||
_messageContent = message;
|
_messageContent = message;
|
||||||
_messageType = type;
|
_messageType = type;
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ namespace Oqtane.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/<controller>/5?siteid=x
|
// DELETE api/<controller>/5?siteid=x
|
||||||
[HttpDelete("{themename}")]
|
[HttpDelete("{id}")]
|
||||||
[Authorize(Roles = RoleNames.Host)]
|
[Authorize(Roles = RoleNames.Host)]
|
||||||
public void Delete(int id, int siteid)
|
public void Delete(int id, int siteid)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,15 +7,11 @@ using Oqtane.Infrastructure.SiteTemplates;
|
|||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
using Oqtane.Repository;
|
using Oqtane.Repository;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using Oqtane.UI;
|
|
||||||
using Org.BouncyCastle.Pqc.Crypto.Lms;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.Metadata;
|
|
||||||
using System.Runtime.Serialization;
|
|
||||||
|
|
||||||
namespace Oqtane.Infrastructure
|
namespace Oqtane.Infrastructure
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,8 +13,10 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Remove="wwwroot\Modules\Templates\**" />
|
<Compile Remove="wwwroot\Modules\Templates\**" />
|
||||||
<Compile Remove="wwwroot\Themes\Templates\**" />
|
<Compile Remove="wwwroot\Themes\Templates\**" />
|
||||||
|
<Compile Remove="wwwroot\_content\*\**" />
|
||||||
<Content Remove="wwwroot\Modules\Templates\**" />
|
<Content Remove="wwwroot\Modules\Templates\**" />
|
||||||
<Content Remove="wwwroot\Themes\Templates\**" />
|
<Content Remove="wwwroot\Themes\Templates\**" />
|
||||||
|
<Content Remove="wwwroot\_content\*\**" />
|
||||||
<EmbeddedResource Remove="wwwroot\Modules\Templates\**" />
|
<EmbeddedResource Remove="wwwroot\Modules\Templates\**" />
|
||||||
<EmbeddedResource Remove="wwwroot\Themes\Templates\**" />
|
<EmbeddedResource Remove="wwwroot\Themes\Templates\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ namespace Oqtane.Repository
|
|||||||
var attribute = (SiteMigrationAttribute)Attribute.GetCustomAttribute(type, typeof(SiteMigrationAttribute));
|
var attribute = (SiteMigrationAttribute)Attribute.GetCustomAttribute(type, typeof(SiteMigrationAttribute));
|
||||||
if (attribute.AliasName == "*" || attribute.AliasName == alias.Name)
|
if (attribute.AliasName == "*" || attribute.AliasName == alias.Name)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(site.Version) || Version.Parse(attribute.Version) > Version.Parse(site.Version))
|
if (string.IsNullOrEmpty(site.Version) || attribute.Version == "*" || Version.Parse(attribute.Version) > Version.Parse(site.Version))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -176,14 +176,14 @@ namespace Oqtane.Repository
|
|||||||
if (obj != null)
|
if (obj != null)
|
||||||
{
|
{
|
||||||
obj.Up(site, alias);
|
obj.Up(site, alias);
|
||||||
_logger.Log(LogLevel.Information, "Site Migration", LogFunction.Other, "Site Migrated Successfully To Version {version} For {Alias}", version, alias.Name);
|
_logger.Log(LogLevel.Information, "Site Migration", LogFunction.Other, "Site Migrated Successfully For {Alias} And Version {version}", alias.Name, attribute.Version);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.Log(LogLevel.Error, "Site Migration", LogFunction.Other, ex, "An Error Occurred Executing Site Migration {Type} For {Alias} And Version {Version}", type, alias.Name, version);
|
_logger.Log(LogLevel.Error, "Site Migration", LogFunction.Other, ex, "An Error Occurred Executing Site Migration {Type} For {Alias} And Version {Version}", type, alias.Name, attribute.Version);
|
||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(version) || Version.Parse(attribute.Version) > Version.Parse(version))
|
if (attribute.Version != "*" && (string.IsNullOrEmpty(version) || Version.Parse(attribute.Version) > Version.Parse(version)))
|
||||||
{
|
{
|
||||||
version = attribute.Version;
|
version = attribute.Version;
|
||||||
}
|
}
|
||||||
@@ -490,7 +490,27 @@ namespace Oqtane.Repository
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var module = _moduleRepository.AddModule(pageModule.Module);
|
Module module = null;
|
||||||
|
if (pageTemplateModule.FromPagePath != "")
|
||||||
|
{
|
||||||
|
// used for modules shared across pages
|
||||||
|
var pagePath = pageTemplateModule.FromPagePath;
|
||||||
|
pagePath = (pagePath.ToLower() == "home") ? "" : pagePath;
|
||||||
|
pagePath = (pagePath == "/") ? "" : pagePath;
|
||||||
|
if (pages.Any(item => item.Path.ToLower() == pagePath.ToLower()))
|
||||||
|
{
|
||||||
|
var pageId = pages.First(item => item.Path.ToLower() == pagePath.ToLower()).PageId;
|
||||||
|
if (pageModules.Any(item => item.PageId == pageId && item.Module.ModuleDefinitionName == pageTemplateModule.ModuleDefinitionName && item.Title.ToLower() == pageTemplateModule.Title.ToLower()))
|
||||||
|
{
|
||||||
|
module = pageModules.FirstOrDefault(item => item.PageId == pageId && item.Module.ModuleDefinitionName == pageTemplateModule.ModuleDefinitionName && item.Title.ToLower() == pageTemplateModule.Title.ToLower()).Module;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (module == null)
|
||||||
|
{
|
||||||
|
module = _moduleRepository.AddModule(pageModule.Module);
|
||||||
|
}
|
||||||
|
|
||||||
pageModule.ModuleId = module.ModuleId;
|
pageModule.ModuleId = module.ModuleId;
|
||||||
pageModule.Module = null; // remove tracking
|
pageModule.Module = null; // remove tracking
|
||||||
_pageModuleRepository.AddPageModule(pageModule);
|
_pageModuleRepository.AddPageModule(pageModule);
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ namespace Oqtane.Models
|
|||||||
};
|
};
|
||||||
Settings = new List<Setting>();
|
Settings = new List<Setting>();
|
||||||
Content = "";
|
Content = "";
|
||||||
|
FromPagePath = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ModuleDefinitionName { get; set; }
|
public string ModuleDefinitionName { get; set; }
|
||||||
@@ -118,6 +119,7 @@ namespace Oqtane.Models
|
|||||||
public List<Permission> PermissionList { get; set; }
|
public List<Permission> PermissionList { get; set; }
|
||||||
public List<Setting> Settings { get; set; }
|
public List<Setting> Settings { get; set; }
|
||||||
public string Content { get; set; }
|
public string Content { get; set; }
|
||||||
|
public string FromPagePath { get; set; } // for modules shared across pages
|
||||||
|
|
||||||
[Obsolete("The ModulePermissions property is deprecated. Use PermissionList instead", false)]
|
[Obsolete("The ModulePermissions property is deprecated. Use PermissionList instead", false)]
|
||||||
public string ModulePermissions
|
public string ModulePermissions
|
||||||
|
|||||||
Reference in New Issue
Block a user