Skip to content

Commit

Permalink
Release v.14.0.7700.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SFBuild committed Sep 14, 2021
1 parent 8c0bcde commit 60c72f5
Show file tree
Hide file tree
Showing 30 changed files with 1,212 additions and 37,813 deletions.
Binary file modified AssemblyInfoShare/SharedAssemblyInfo.cs
Binary file not shown.
2 changes: 1 addition & 1 deletion Build/FeatherPrecompilation.targets
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<Target Name="PrecompileFeatherRazorFiles"
DependsOnTargets="$(PrecompileFeatherRazorFilesDependsOn)"
Inputs="@(FeatherRazorSrcFiles)"
Outputs="%(FeatherRazorSrcFiles.PackageName).csFilesGenerated">
Outputs="%(FeatherRazorSrcFiles.PackageName).csFilesGenerated" Condition="'$(Language)'!='VB'">

<!-- Please uncomment this in case of using Feather Razor precompilation -->
<RazorCodeGen ProjectRoot="$(MsBuildProjectDirectory)\$(FeatherResourcePackagesFolderName)\%(FeatherRazorSrcFiles.PackageName)\"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@
</ItemGroup>
<ItemGroup>
<Reference Include="Telerik.Sitefinity.Model">
<HintPath>..\packages\Telerik.Sitefinity.Core.13.3.7600\lib\net48\Telerik.Sitefinity.Model.dll</HintPath>
<HintPath>..\packages\Telerik.Sitefinity.Core.14.0.7700\lib\net48\Telerik.Sitefinity.Model.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Sitefinity">
<HintPath>..\packages\Telerik.Sitefinity.Core.13.3.7600\lib\net48\Telerik.Sitefinity.dll</HintPath>
<HintPath>..\packages\Telerik.Sitefinity.Core.14.0.7700\lib\net48\Telerik.Sitefinity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Telerik.Sitefinity.Utilities">
<HintPath>..\packages\Telerik.Sitefinity.Core.13.3.7600\lib\net48\Telerik.Sitefinity.Utilities.dll</HintPath>
<HintPath>..\packages\Telerik.Sitefinity.Core.14.0.7700\lib\net48\Telerik.Sitefinity.Utilities.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Telerik.Sitefinity.Frontend.Data/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<packages>
<package id="Telerik.DataAccess.Core" version="2020.0.428.1" targetFramework="net471" />
<package id="Telerik.DataAccess.Fluent" version="2020.0.428.1" targetFramework="net471" developmentDependency="true" />
<package id="Telerik.Sitefinity.Core" version="13.3.7600" targetFramework="net45" />
<package id="Telerik.Sitefinity.Core" version="14.0.7700" targetFramework="net45" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
using Telerik.Sitefinity.Frontend.Resources;
using Telerik.Sitefinity.Libraries.Model;
using Telerik.Sitefinity.Modules.Libraries;
using Telerik.Sitefinity.Modules.Libraries.ImageProcessing;
using Telerik.Sitefinity.Modules.Libraries.Images;
using Telerik.Sitefinity.Modules.Pages;
using Telerik.Sitefinity.Multisite;
using Telerik.Sitefinity.Pages.Model;
Expand Down Expand Up @@ -196,7 +198,7 @@ internal static void UpdateDefaultTemplateImages(LibrariesManager librariesManag
{
using (var imageStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(iconResource))
{
using (var resourceImage = System.Drawing.Image.FromStream(imageStream))
using (var resourceImage = ImagesHelper.CurrentImageProcessor.GetImageFromStream(imageStream))
{
var resourceImageStream = new MemoryStream();
resourceImage.Save(resourceImageStream, System.Drawing.Imaging.ImageFormat.Png);
Expand Down Expand Up @@ -576,7 +578,7 @@ private Image UploadTemplateImage(LibrariesManager libraryManager, Album templat

using (var imageStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(iconResource))
{
using (var resourceImage = System.Drawing.Image.FromStream(imageStream))
using (var resourceImage = ImagesHelper.CurrentImageProcessor.GetImageFromStream(imageStream))
{
var resourceImageStream = new MemoryStream();
resourceImage.Save(resourceImageStream, System.Drawing.Imaging.ImageFormat.Png);
Expand Down
223 changes: 204 additions & 19 deletions Telerik.Sitefinity.Frontend/Mvc/Helpers/ResourceHelper.cs

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Telerik.Sitefinity.Frontend/Mvc/Helpers/SettingsHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public static string GetMediaSettings(string mediaType)
{
AllowedExensionsSettings = libratiesConfig.Documents.AllowedExensionsSettings,
EnableAllLanguagesSearch = libratiesConfig.EnableAllLanguagesSearch,
EnableSelectedFolderSearch = libratiesConfig.EnableSelectedFolderSearch
EnableSelectedFolderSearch = libratiesConfig.EnableSelectedFolderSearch,
AllowedExensions = libratiesConfig.Documents.AllowedExensions
};
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Telerik.Sitefinity.Configuration;
using Telerik.Sitefinity.Frontend.Mvc.Helpers;
using Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers;
using Telerik.Sitefinity.Frontend.Resources;
using Telerik.Sitefinity.Pages.Model;
using Telerik.Sitefinity.Personalization.Impl.Configuration;
using Telerik.Sitefinity.Personalization.Impl.Web.UI;
Expand Down Expand Up @@ -92,10 +93,10 @@ protected override void Render(HtmlTextWriter writer)
var currentNode = SiteMapBase.GetActualCurrentNode();
if (currentNode != null && currentNode.Framework == PageTemplateFramework.Mvc)
{
var registeredScripts = SystemManager.CurrentHttpContext.Items[ResourceHelper.JsRegisterName] as Dictionary<string, List<string>>;
var registeredScripts = SystemManager.CurrentHttpContext.Items[ResourceHelper.JsRegisterName] as Dictionary<string, List<ResourceItem>>;
if (registeredScripts != null)
{
this.personalizedViewWrapper.LoadedScripts = registeredScripts.SelectMany(p => p.Value);
this.personalizedViewWrapper.LoadedScripts = registeredScripts.SelectMany(p => p.Value.Select(x => x.ResourceKey));
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ public PageRelativePathContextRegion(HttpContextBase context)
if (currentNode != null && !(isFrontendPageEdit.HasValue && isFrontendPageEdit.Value))
{
var nodeUrl = currentNode.Url.StartsWith("~/", StringComparison.Ordinal) ? RouteHelper.ResolveUrl(currentNode.Url, UrlResolveOptions.ApplicationRelative | UrlResolveOptions.AppendTrailingSlash) : currentNode.Url;
var comparisonNodeUrl = nodeUrl.Replace("~", string.Empty);
if (originalWithSlash.StartsWith(nodeUrl, StringComparison.OrdinalIgnoreCase))
{
var newPath = originalWithSlash.Right(originalWithSlash.Length - nodeUrl.Length);

this.context.RewritePath("~/" + newPath);
}
else if (currentNode.IsHomePage() &&
else if (SystemManager.CurrentContext.CurrentSite.Cultures.Length > 1 && originalWithSlash.StartsWith($"~/{SystemManager.CurrentContext.Culture}/", StringComparison.OrdinalIgnoreCase) && originalWithSlash.Contains(comparisonNodeUrl))
{
var newPath = originalWithSlash.Right(originalWithSlash.Length - nodeUrl.Length - SystemManager.CurrentContext.Culture.Name.Length - 1);

this.context.RewritePath("~/" + newPath);
}
else if (currentNode.IsHomePage() &&
RouteHelper.ResolveUrl(SystemManager.CurrentContext.CurrentSite.GetUri().AbsolutePath, UrlResolveOptions.ApplicationRelative | UrlResolveOptions.AppendTrailingSlash) == originalWithSlash)
{
// The request is to the root of the site
Expand Down
71 changes: 27 additions & 44 deletions Telerik.Sitefinity.Frontend/Mvc/Models/ContentModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,25 +278,31 @@ public virtual IEnumerable<IContentLocationInfo> GetLocations()
location.ContentType = this.ContentType;
location.ProviderName = this.GetManager().Provider.Name;

string filterExpression;
switch (this.ContentViewDisplayMode)
{
case ContentViewDisplayMode.Detail:
location.Filters.Add(this.CompileSingleItemFilterExpression(location.ContentType)); ;

return new[] { location };
case ContentViewDisplayMode.Automatic:
filterExpression = this.CompileFilterExpression();
if (this.SelectionMode == SelectionMode.SelectedItems && string.IsNullOrEmpty(this.FilterExpression))
{
var masterIdsList = this.GetMasterIdsFromSelection();
location.Filters.Add(new ItemsSelectionLocationFilter(masterIdsList.Select(x => x.ToString())));
}
else
{
var filterExpression = this.CompileFilterExpression();
if (!string.IsNullOrEmpty(filterExpression))
{
location.Filters.Add(new BasicContentLocationFilter(filterExpression));
}
}
break;
default:
return null;
}

if (!string.IsNullOrEmpty(filterExpression))
{
location.Filters.Add(new BasicContentLocationFilter(filterExpression));
}

return new[] { location };
}

Expand Down Expand Up @@ -591,37 +597,7 @@ protected virtual ContentLocationSingleItemFilter CompileSingleItemFilterExpress
}

var selectedItemGuid = this.selectedItemsIds.Select(id => new Guid(id)).SingleOrDefault();

var items = this.GetItemsQuery();
IQueryable<string> itemIds = new List<string>().AsQueryable();
IQueryable<string> itemMasterIds = new List<string>().AsQueryable();

if (typeof(Content).IsAssignableFrom(itemType))
{
var typedItems = items.OfType<Content>().Where(c => c.Id == selectedItemGuid || c.OriginalContentId == selectedItemGuid);
itemIds = typedItems.Select(n => n.Id.ToString());
itemMasterIds = typedItems.Where(i => i.OriginalContentId != Guid.Empty).Select(n => n.OriginalContentId.ToString());
}
else
{
var typedItems = items.OfType<ILifecycleDataItemGeneric>().Where(c => c.Id == selectedItemGuid || c.OriginalContentId == selectedItemGuid);
itemIds = typedItems.Select(n => n.Id.ToString());
itemMasterIds = typedItems.Where(i => i.OriginalContentId != Guid.Empty).Select(n => n.OriginalContentId.ToString());
}

var itemIdsList = itemIds.Distinct().ToList();

foreach (var item in itemMasterIds.Distinct())
{
if (!itemIds.Contains(item))
{
itemIdsList.Add(item);
}
}

var filter = new ContentLocationSingleItemFilter(itemIdsList);

return filter;
return ContentLocatableViewExtensions.GetSingleItemFilter(selectedItemGuid, itemType, this.GetManager());
}

/// <summary>
Expand Down Expand Up @@ -905,12 +881,7 @@ private bool TryGetTaxonomyFieldName(Guid taxonomyId, out string taxonomyField)
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "It would add too much risk now to change this to property and would not bring much value to code quality and maintenance.")]
protected virtual string GetSelectedItemsFilterExpression()
{
var selectedItemGuids = this.selectedItemsIds.Select(id => new Guid(id));
var masterIds = this.GetItemsQuery()
.OfType<ILifecycleDataItemGeneric>()
.Where(c => selectedItemGuids.Contains(c.Id) || selectedItemGuids.Contains(c.OriginalContentId))
.Select(n => n.OriginalContentId != Guid.Empty ? n.OriginalContentId : n.Id)
.Distinct();
var masterIds = this.GetMasterIdsFromSelection();

var selectedItemConditions = masterIds.Select(id => "Id = {0} OR OriginalContentId = {0}".Arrange(id.ToString("D")));
var selectedItemsFilterExpression = string.Join(" OR ", selectedItemConditions);
Expand All @@ -930,6 +901,18 @@ protected virtual void AddCommonDependencies(IList<CacheDependencyKey> keys, Typ
keys.Add(new CacheDependencyKey() { Type = typeof(Sitefinity.Services.Comments.IThread) });
}

private IEnumerable<Guid> GetMasterIdsFromSelection()
{
var selectedItemGuids = this.selectedItemsIds.Select(id => new Guid(id));
var masterIds = this.GetItemsQuery()
.OfType<ILifecycleDataItemGeneric>()
.Where(c => selectedItemGuids.Contains(c.Id) || selectedItemGuids.Contains(c.OriginalContentId))
.Select(n => n.OriginalContentId != Guid.Empty ? n.OriginalContentId : n.Id)
.Distinct();

return masterIds;
}

private IQueryable<IDataItem> GetRelatedItems(IDataItem relatedItem, int page, ref int? totalCount)
{
var manager = this.GetManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

personalizationService.personalize($scope.model)
.then(function (args) {
$scope.close();
$scope.close(false);
$telerik.$(document).trigger('personalizationDialogClosed', args);
}, onError)
.finally(function () {
Expand All @@ -79,7 +79,7 @@
var canceling = $q.defer();
canceling.promise
.then(function () {
$scope.close();
$scope.close(true);
})
.catch(onError)
.finally(function () {
Expand All @@ -90,12 +90,12 @@
canceling.resolve();
};

$scope.close = function () {
$scope.close = function (fireModalClosedEvent) {
try {
$uibModalInstance.close();
} catch (e) { }

if (typeof ($telerik) !== 'undefined')
if (typeof ($telerik) !== 'undefined' && fireModalClosedEvent)
$telerik.$(document).trigger('modalDialogClosed');

if (typeof CustomEvent == "function") {
Expand Down
23 changes: 17 additions & 6 deletions Telerik.Sitefinity.Frontend/Resources/PackageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Web.Hosting;
using System.Web.Routing;
using Telerik.Sitefinity.Configuration;
using Telerik.Sitefinity.Data;
using Telerik.Sitefinity.HealthMonitoring;
using Telerik.Sitefinity.Modules.Pages;
using Telerik.Sitefinity.Pages.Model;
Expand Down Expand Up @@ -38,9 +39,12 @@ public string GetCurrentPackage()
if (SystemManager.CurrentHttpContext.Items.Contains(PackageManager.CurrentVersionTemplateId))
{
var templateId = SystemManager.CurrentHttpContext.Items[PackageManager.CurrentVersionTemplateId] as string;
packageName = this.GetPackageFromTemplateId(templateId);
if (!packageName.IsNullOrEmpty())
return packageName;
if (Guid.TryParse(templateId, out Guid templateIdParsed) && templateIdParsed != Guid.Empty)
{
packageName = this.GetPackageFromTemplateId(templateId);
if (!packageName.IsNullOrEmpty())
return packageName;
}
}
}

Expand Down Expand Up @@ -126,7 +130,7 @@ protected virtual bool AllowChangePackageAtRuntimeViaQueryString
{
get
{
return Telerik.Sitefinity.Abstractions.AppSettings.CurrentSettings.IsBackend ||
return Telerik.Sitefinity.Abstractions.AppSettings.CurrentSettings.IsBackend ||
Config.Get<Sitefinity.Modules.Pages.Configuration.PagesConfig>().AllowChangePageThemeAtRuntime ||
(SystemManager.CurrentHttpContext.Items[SiteMapBase.CurrentNodeKey] as PageSiteNode) == null;
}
Expand Down Expand Up @@ -218,7 +222,14 @@ private string GetPackageFromNodeId(string nodeId)
return null;

var pageManager = PageManager.GetManager();
var pageNode = pageManager.GetPageNode(id);

PageNode pageNode;

using (new ElevatedModeRegion(pageManager))
{
pageNode = pageManager.GetPageNode(id);
}

var pageData = pageNode.GetPageData();

if (pageData == null)
Expand Down Expand Up @@ -315,7 +326,7 @@ private string GetPackageFromContext()
packageName = SystemManager.CurrentHttpContext.Items[PackageManager.CurrentPackageKey] as string;
}

return packageName;
return packageName;
}

/// <summary>
Expand Down
32 changes: 32 additions & 0 deletions Telerik.Sitefinity.Frontend/Resources/ResourceItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Telerik.Sitefinity.Frontend.Resources
{
/// <summary>
/// This class represents one resource item
/// </summary>
internal class ResourceItem
{
/// <summary>
/// Gets or sets the source of the resource item.
/// </summary>
/// <value>The name of the provider.</value>
public string ResourceKey { get; set; }

/// <summary>
/// Gets or sets the attributes that will be set to the rendered resource.
/// </summary>
/// <value>The attributes that will be set to the rendered resource.</value>
public List<KeyValuePair<string, string>> Attributes { get; set; }

public ResourceItem(string resourceKey, List<KeyValuePair<string, string>> attributes)
{
ResourceKey = resourceKey;
Attributes = attributes;
}
}
}
Loading

0 comments on commit 60c72f5

Please sign in to comment.