fix #5005 - adds versioning (ie. fingerprinting) for static assets - core, modules, and themes.
This commit is contained in:
@ -65,7 +65,7 @@ namespace Oqtane.Models
|
||||
public string Categories { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Version information of this Module based on the DLL / NuGet package.
|
||||
/// Version information of this Module based on the information stored in its assembly
|
||||
/// </summary>
|
||||
public string Version { get; set; }
|
||||
|
||||
@ -144,6 +144,9 @@ namespace Oqtane.Models
|
||||
[NotMapped]
|
||||
public bool IsPortable { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string Hash { get; set; }
|
||||
|
||||
#region Deprecated Properties
|
||||
|
||||
[Obsolete("The Permissions property is deprecated. Use PermissionList instead", false)]
|
||||
|
@ -83,7 +83,21 @@ namespace Oqtane.Models
|
||||
/// </summary>
|
||||
public string Namespace { get; set; }
|
||||
|
||||
public Resource Clone(ResourceLevel level, string name)
|
||||
/// <summary>
|
||||
/// The version of the theme or module that declared the resource - only used in SiteRouter
|
||||
/// </summary>
|
||||
public string Version
|
||||
{
|
||||
set
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value) && !string.IsNullOrEmpty(Url) && !Url.Contains("?"))
|
||||
{
|
||||
Url += "?v=" + value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Resource Clone(ResourceLevel level, string name, string version)
|
||||
{
|
||||
var resource = new Resource();
|
||||
resource.ResourceType = ResourceType;
|
||||
@ -106,6 +120,7 @@ namespace Oqtane.Models
|
||||
}
|
||||
resource.Level = level;
|
||||
resource.Namespace = name;
|
||||
resource.Version = version;
|
||||
return resource;
|
||||
}
|
||||
|
||||
|
@ -187,6 +187,12 @@ namespace Oqtane.Models
|
||||
[NotMapped]
|
||||
public List<Theme> Themes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// hash code for static assets
|
||||
/// </summary>
|
||||
[NotMapped]
|
||||
public string Hash { get; set; }
|
||||
|
||||
public Site Clone()
|
||||
{
|
||||
return new Site
|
||||
@ -227,7 +233,8 @@ namespace Oqtane.Models
|
||||
Settings = Settings.ToDictionary(setting => setting.Key, setting => setting.Value),
|
||||
Pages = Pages.ConvertAll(page => page.Clone()),
|
||||
Languages = Languages.ConvertAll(language => language.Clone()),
|
||||
Themes = Themes
|
||||
Themes = Themes,
|
||||
Hash = Hash
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -40,10 +40,13 @@ namespace Oqtane.Models
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
// additional ITheme properties
|
||||
[NotMapped]
|
||||
/// <summary>
|
||||
/// Version information of this Theme based on the information stored in its assembly
|
||||
/// </summary>
|
||||
public string Version { get; set; }
|
||||
|
||||
// additional ITheme properties
|
||||
|
||||
[NotMapped]
|
||||
public string Owner { get; set; }
|
||||
|
||||
@ -78,17 +81,25 @@ namespace Oqtane.Models
|
||||
// internal properties
|
||||
[NotMapped]
|
||||
public int SiteId { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string AssemblyName { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public List<ThemeControl> Themes { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public List<ThemeControl> Containers { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string Template { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string Hash { get; set; }
|
||||
|
||||
#region Obsolete Properties
|
||||
|
||||
[Obsolete("This property is obsolete. Use Themes instead.", false)]
|
||||
|
Reference in New Issue
Block a user