Merge remote-tracking branch 'origin/v8/dev' into v8/feature/AB4550-segments-ui-variant-picker

This commit is contained in:
Niels Lyngsø
2020-04-16 07:52:43 +02:00
75 changed files with 864 additions and 1143 deletions
+3
View File
@@ -100,6 +100,9 @@ src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/loader.dev.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/main.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/app.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/canvasdesigner.*.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/navigation.controller.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/main.controller.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/utilities.js
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.js
+1 -1
View File
@@ -25,7 +25,7 @@
not want this to happen as the alpha of the next major is, really, the next major already.
-->
<dependency id="UmbracoCms.Core" version="[$version$]" />
<dependency id="ClientDependency" version="[1.9.8,1.999999)" />
<dependency id="ClientDependency" version="[1.9.9,1.999999)" />
<dependency id="ClientDependency-Mvc5" version="[1.9.3,1.999999)" />
<dependency id="CSharpTest.Net.Collections" version="[14.906.1403.1082,14.999999)" />
<dependency id="Examine" version="[1.0.2,1.999999)" />
+3 -1
View File
@@ -22,6 +22,8 @@
# get NuGet
$cache = 4
$nuget = "$scriptTemp\nuget.exe"
# ensure the correct NuGet-source is used. This one is used by Umbraco
$nugetsourceUmbraco = "https://www.myget.org/F/umbracocore/api/v3/index.json"
if (-not $local)
{
$source = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
@@ -61,7 +63,7 @@
# get the build system
if (-not $local)
{
$params = "-OutputDirectory", $scriptTemp, "-Verbosity", "quiet", "-PreRelease"
$params = "-OutputDirectory", $scriptTemp, "-Verbosity", "quiet", "-PreRelease", "-Source", $nugetsourceUmbraco
&$nuget install Umbraco.Build @params
if (-not $?) { throw "Failed to download Umbraco.Build." }
}
+4 -1
View File
@@ -375,11 +375,14 @@
})
$nugetsourceUmbraco = "https://api.nuget.org/v3/index.json"
$ubuild.DefineMethod("RestoreNuGet",
{
Write-Host "Restore NuGet"
Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log"
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" > "$($this.BuildTemp)\nuget.restore.log"
$params = "-Source", $nugetsourceUmbraco
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" > "$($this.BuildTemp)\nuget.restore.log" @params
if (-not $?) { throw "Failed to restore NuGet packages." }
})
+12 -14
View File
@@ -37,23 +37,13 @@ namespace Umbraco.Core.Cache
/// <inheritdoc />
public object Get(string key, Func<object> factory, TimeSpan? timeout, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null)
{
CacheDependency dependency = null;
if (dependentFiles != null && dependentFiles.Any())
{
dependency = new CacheDependency(dependentFiles);
}
return Get(key, factory, timeout, isSliding, priority, removedCallback, dependency);
return GetInternal(key, factory, timeout, isSliding, priority, removedCallback, dependentFiles);
}
/// <inheritdoc />
public void Insert(string key, Func<object> factory, TimeSpan? timeout = null, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null)
{
CacheDependency dependency = null;
if (dependentFiles != null && dependentFiles.Any())
{
dependency = new CacheDependency(dependentFiles);
}
Insert(key, factory, timeout, isSliding, priority, removedCallback, dependency);
InsertInternal(key, factory, timeout, isSliding, priority, removedCallback, dependentFiles);
}
#region Dictionary
@@ -103,7 +93,7 @@ namespace Umbraco.Core.Cache
#endregion
private object Get(string key, Func<object> factory, TimeSpan? timeout, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, CacheDependency dependency = null)
private object GetInternal(string key, Func<object> factory, TimeSpan? timeout, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null)
{
key = GetCacheKey(key);
@@ -163,6 +153,10 @@ namespace Umbraco.Core.Cache
var sliding = isSliding == false ? System.Web.Caching.Cache.NoSlidingExpiration : (timeout ?? System.Web.Caching.Cache.NoSlidingExpiration);
lck.UpgradeToWriteLock();
// create a cache dependency if one is needed.
var dependency = dependentFiles != null && dependentFiles.Length > 0 ? new CacheDependency(dependentFiles) : null;
//NOTE: 'Insert' on System.Web.Caching.Cache actually does an add or update!
_cache.Insert(key, result, dependency, absolute, sliding, priority, removedCallback);
}
@@ -180,7 +174,7 @@ namespace Umbraco.Core.Cache
return value;
}
private void Insert(string cacheKey, Func<object> getCacheItem, TimeSpan? timeout = null, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, CacheDependency dependency = null)
private void InsertInternal(string cacheKey, Func<object> getCacheItem, TimeSpan? timeout = null, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null)
{
// NOTE - here also we must insert a Lazy<object> but we can evaluate it right now
// and make sure we don't store a null value.
@@ -197,6 +191,10 @@ namespace Umbraco.Core.Cache
try
{
_locker.EnterWriteLock();
// create a cache dependency if one is needed.
var dependency = dependentFiles != null && dependentFiles.Length > 0 ? new CacheDependency(dependentFiles) : null;
//NOTE: 'Insert' on System.Web.Caching.Cache actually does an add or update!
_cache.Insert(cacheKey, result, dependency, absolute, sliding, priority, removedCallback);
}
+2
View File
@@ -28,8 +28,10 @@ namespace Umbraco.Core
public const string UnknownUserName = "SYTEM";
public const string AdminGroupAlias = "admin";
public const string EditorGroupAlias = "editor";
public const string SensitiveDataGroupAlias = "sensitiveData";
public const string TranslatorGroupAlias = "translator";
public const string WriterGroupAlias = "writer";
public const string BackOfficeAuthenticationType = "UmbracoBackOffice";
public const string BackOfficeExternalAuthenticationType = "UmbracoExternalCookie";
@@ -171,8 +171,8 @@ namespace Umbraco.Core.Migrations.Install
private void CreateUserGroupData()
{
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 1, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.AdminGroupAlias, Name = "Administrators", DefaultPermissions = "CADMOSKTPIURZ:5F7ï", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-medal" });
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 2, StartMediaId = -1, StartContentId = -1, Alias = "writer", Name = "Writers", DefaultPermissions = "CAH:F", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-edit" });
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 3, StartMediaId = -1, StartContentId = -1, Alias = "editor", Name = "Editors", DefaultPermissions = "CADMOSKTPUZ:5Fï", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-tools" });
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 2, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.WriterGroupAlias, Name = "Writers", DefaultPermissions = "CAH:F", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-edit" });
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 3, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.EditorGroupAlias, Name = "Editors", DefaultPermissions = "CADMOSKTPUZ:5Fï", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-tools" });
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 4, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.TranslatorGroupAlias, Name = "Translators", DefaultPermissions = "AF", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-globe" });
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 5, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.SensitiveDataGroupAlias, Name = "Sensitive data", DefaultPermissions = "", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-lock" });
}
@@ -166,6 +166,7 @@ namespace Umbraco.Core.Migrations.Upgrade
.As("{0576E786-5C30-4000-B969-302B61E90CA3}");
To<FixLanguageIsoCodeLength>("{48AD6CCD-C7A4-4305-A8AB-38728AD23FC5}");
To<AddPackagesSectionAccess>("{DF470D86-E5CA-42AC-9780-9D28070E25F9}");
// finish migrating from v7 - recreate all keys and indexes
To<CreateKeysAndIndexes>("{3F9764F5-73D0-4D45-8804-1240A66E43A2}");
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
{
public class AddPackagesSectionAccess : MigrationBase
{
public AddPackagesSectionAccess(IMigrationContext context)
: base(context)
{ }
public override void Migrate()
{
// Any user group which had access to the Developer section should have access to Packages
Database.Execute($@"
insert into {Constants.DatabaseSchema.Tables.UserGroup2App}
select userGroupId, '{Constants.Applications.Packages}'
from {Constants.DatabaseSchema.Tables.UserGroup2App}
where app='developer'");
}
}
}
+3 -2
View File
@@ -81,9 +81,10 @@ namespace Umbraco.Core.Models
if (propertyInfo.PropertyType.IsGenericType
&& (propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(IEnumerable<>)
|| propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(ICollection<>)
|| propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(IList<>)))
|| propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(IList<>)
|| propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(IReadOnlyCollection<>)))
{
//if it is a IEnumerable<>, IList<T> or ICollection<> we'll use a List<>
//if it is a IEnumerable<>, IReadOnlyCollection<T>, IList<T> or ICollection<> we'll use a List<> since it implements them all
var genericType = typeof(List<>).MakeGenericType(propertyInfo.PropertyType.GetGenericArguments());
return new ClonePropertyInfo(propertyInfo) { GenericListType = genericType };
}
+27 -1
View File
@@ -50,7 +50,7 @@ namespace Umbraco.Core.Models
/// <summary>
/// Represents a property value.
/// </summary>
public class PropertyValue
public class PropertyValue : IDeepCloneable, IEquatable<PropertyValue>
{
// TODO: Either we allow change tracking at this class level, or we add some special change tracking collections to the Property
// class to deal with change tracking which variants have changed
@@ -95,6 +95,32 @@ namespace Umbraco.Core.Models
/// </summary>
public PropertyValue Clone()
=> new PropertyValue { _culture = _culture, _segment = _segment, PublishedValue = PublishedValue, EditedValue = EditedValue };
public object DeepClone() => Clone();
public override bool Equals(object obj)
{
return Equals(obj as PropertyValue);
}
public bool Equals(PropertyValue other)
{
return other != null &&
_culture == other._culture &&
_segment == other._segment &&
EqualityComparer<object>.Default.Equals(EditedValue, other.EditedValue) &&
EqualityComparer<object>.Default.Equals(PublishedValue, other.PublishedValue);
}
public override int GetHashCode()
{
var hashCode = 1885328050;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(_culture);
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(_segment);
hashCode = hashCode * -1521134295 + EqualityComparer<object>.Default.GetHashCode(EditedValue);
hashCode = hashCode * -1521134295 + EqualityComparer<object>.Default.GetHashCode(PublishedValue);
return hashCode;
}
}
private static readonly DelegateEqualityComparer<object> PropertyValueComparer = new DelegateEqualityComparer<object>(
@@ -23,5 +23,12 @@
/// Gets the segment.
/// </summary>
public string Segment { get; }
/// <summary>
/// Gets the segment for the content item
/// </summary>
/// <param name="contentId"></param>
/// <returns></returns>
public virtual string GetSegment(int contentId) => Segment;
}
}
@@ -3,13 +3,32 @@
public static class VariationContextAccessorExtensions
{
public static void ContextualizeVariation(this IVariationContextAccessor variationContextAccessor, ContentVariation variations, ref string culture, ref string segment)
=> variationContextAccessor.ContextualizeVariation(variations, null, ref culture, ref segment);
public static void ContextualizeVariation(this IVariationContextAccessor variationContextAccessor, ContentVariation variations, int contentId, ref string culture, ref string segment)
=> variationContextAccessor.ContextualizeVariation(variations, (int?)contentId, ref culture, ref segment);
private static void ContextualizeVariation(this IVariationContextAccessor variationContextAccessor, ContentVariation variations, int? contentId, ref string culture, ref string segment)
{
if (culture != null && segment != null) return;
// use context values
var publishedVariationContext = variationContextAccessor?.VariationContext;
if (culture == null) culture = variations.VariesByCulture() ? publishedVariationContext?.Culture : "";
if (segment == null) segment = variations.VariesBySegment() ? publishedVariationContext?.Segment : "";
if (segment == null)
{
if (variations.VariesBySegment())
{
segment = contentId == null
? publishedVariationContext?.Segment
: publishedVariationContext?.GetSegment(contentId.Value);
}
else
{
segment = "";
}
}
}
}
}
@@ -25,8 +25,17 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
path = path.EnsureEndsWith(".css");
if (FileSystem.FileExists(path) == false)
// if the css directory is changed, references to the old path can still exist (ie in RTE config)
// these old references will throw an error, which breaks the RTE
// try-catch here makes the request fail silently, and allows RTE to load correctly
try
{
if (FileSystem.FileExists(path) == false)
return null;
} catch
{
return null;
}
// content will be lazy-loaded when required
var created = FileSystem.GetCreated(path).UtcDateTime;
@@ -11,6 +11,9 @@ namespace Umbraco.Core.Services
IEnumerable<string> GetAllRoles();
IEnumerable<string> GetAllRoles(int memberId);
IEnumerable<string> GetAllRoles(string username);
IEnumerable<int> GetAllRolesIds();
IEnumerable<int> GetAllRolesIds(int memberId);
IEnumerable<int> GetAllRolesIds(string username);
IEnumerable<T> GetMembersInRole(string roleName);
IEnumerable<T> FindMembersInRole(string roleName, string usernameToMatch, StringPropertyMatchType matchType = StringPropertyMatchType.StartsWith);
bool DeleteRole(string roleName, bool throwIfBeingUsed);
@@ -331,7 +331,7 @@ namespace Umbraco.Core.Services.Implement
saveEventArgs.CanCancel = false;
scope.Events.Dispatch(Saved, this, saveEventArgs);
}
if (withIdentity == false)
return;
@@ -816,8 +816,8 @@ namespace Umbraco.Core.Services.Implement
{
//trimming username and email to make sure we have no trailing space
member.Username = member.Username.Trim();
member.Email = member.Email.Trim();
member.Email = member.Email.Trim();
using (var scope = ScopeProvider.CreateScope())
{
var saveEventArgs = new SaveEventArgs<IMember>(member);
@@ -971,6 +971,35 @@ namespace Umbraco.Core.Services.Implement
}
}
public IEnumerable<int> GetAllRolesIds()
{
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
{
scope.ReadLock(Constants.Locks.MemberTree);
return _memberGroupRepository.GetMany().Select(x => x.Id).Distinct();
}
}
public IEnumerable<int> GetAllRolesIds(int memberId)
{
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
{
scope.ReadLock(Constants.Locks.MemberTree);
var result = _memberGroupRepository.GetMemberGroupsForMember(memberId);
return result.Select(x => x.Id).Distinct();
}
}
public IEnumerable<int> GetAllRolesIds(string username)
{
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
{
scope.ReadLock(Constants.Locks.MemberTree);
var result = _memberGroupRepository.GetMemberGroupsForMember(username);
return result.Select(x => x.Id).Distinct();
}
}
public IEnumerable<IMember> GetMembersInRole(string roleName)
{
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
@@ -1241,7 +1270,7 @@ namespace Umbraco.Core.Services.Implement
/// Exports a member.
/// </summary>
/// <remarks>
/// This is internal for now and is used to export a member in the member editor,
/// This is internal for now and is used to export a member in the member editor,
/// it will raise an event so that auditing logs can be created.
/// </remarks>
internal MemberExportModel ExportMember(Guid key)
@@ -372,7 +372,7 @@ namespace Umbraco.Core.Services.Implement
/// <returns></returns>
public string GetDefaultMemberType()
{
return "writer";
return Constants.Security.WriterGroupAlias;
}
/// <summary>
+15
View File
@@ -79,6 +79,21 @@ namespace Umbraco.Core
}
/// <summary>
/// Determines the extension of the path or URL
/// </summary>
/// <param name="file"></param>
/// <returns>Extension of the file</returns>
public static string GetFileExtension(this string file)
{
//Find any characters between the last . and the start of a query string or the end of the string
const string pattern = @"(?<extension>\.[^\.\?]+)(\?.*|$)";
var match = Regex.Match(file, pattern);
return match.Success
? match.Groups["extension"].Value
: string.Empty;
}
/// <summary>
/// Based on the input string, this will detect if the string is a JS path or a JS snippet.
/// If a path cannot be determined, then it is assumed to be a snippet the original text is returned
+1
View File
@@ -256,6 +256,7 @@
<Compile Include="Manifest\ManifestFilterCollectionBuilder.cs" />
<Compile Include="Mapping\MapperContext.cs" />
<Compile Include="Migrations\Upgrade\Common\DeleteKeysAndIndexes.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\AddPackagesSectionAccess.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\DataTypes\ContentPickerPreValueMigrator.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\DataTypes\DecimalPreValueMigrator.cs" />
<Compile Include="Migrations\Upgrade\V_8_0_0\DataTypes\IPreValueMigrator.cs" />
+1 -1
View File
@@ -96,7 +96,7 @@ namespace Umbraco.Tests.Cache
return "";
});
Assert.AreEqual(counter, 1);
Assert.AreEqual(1, counter);
}
@@ -16,7 +16,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public void EmailAddress()
{
Assert.AreEqual(SettingsSection.Content.NotificationEmailAddress, "robot@umbraco.dk");
Assert.AreEqual("robot@umbraco.dk", SettingsSection.Content.NotificationEmailAddress);
}
[Test]
public virtual void DisableHtmlEmail()
@@ -27,17 +27,17 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
[Test]
public virtual void Can_Set_Multiple()
{
Assert.AreEqual(SettingsSection.Content.Error404Collection.Count(), 3);
Assert.AreEqual(SettingsSection.Content.Error404Collection.ElementAt(0).Culture, "default");
Assert.AreEqual(SettingsSection.Content.Error404Collection.ElementAt(0).ContentId, 1047);
Assert.AreEqual(3, SettingsSection.Content.Error404Collection.Count());
Assert.AreEqual("default", SettingsSection.Content.Error404Collection.ElementAt(0).Culture);
Assert.AreEqual(1047, SettingsSection.Content.Error404Collection.ElementAt(0).ContentId);
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(0).HasContentId);
Assert.IsFalse(SettingsSection.Content.Error404Collection.ElementAt(0).HasContentKey);
Assert.AreEqual(SettingsSection.Content.Error404Collection.ElementAt(1).Culture, "en-US");
Assert.AreEqual(SettingsSection.Content.Error404Collection.ElementAt(1).ContentXPath, "$site/error [@name = 'error']");
Assert.AreEqual("en-US", SettingsSection.Content.Error404Collection.ElementAt(1).Culture);
Assert.AreEqual("$site/error [@name = 'error']", SettingsSection.Content.Error404Collection.ElementAt(1).ContentXPath);
Assert.IsFalse(SettingsSection.Content.Error404Collection.ElementAt(1).HasContentId);
Assert.IsFalse(SettingsSection.Content.Error404Collection.ElementAt(1).HasContentKey);
Assert.AreEqual(SettingsSection.Content.Error404Collection.ElementAt(2).Culture, "en-UK");
Assert.AreEqual(SettingsSection.Content.Error404Collection.ElementAt(2).ContentKey, new Guid("8560867F-B88F-4C74-A9A4-679D8E5B3BFC"));
Assert.AreEqual("en-UK", SettingsSection.Content.Error404Collection.ElementAt(2).Culture);
Assert.AreEqual(new Guid("8560867F-B88F-4C74-A9A4-679D8E5B3BFC"), SettingsSection.Content.Error404Collection.ElementAt(2).ContentKey);
Assert.IsTrue(SettingsSection.Content.Error404Collection.ElementAt(2).HasContentKey);
Assert.IsFalse(SettingsSection.Content.Error404Collection.ElementAt(2).HasContentId);
}
@@ -47,23 +47,23 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
{
Assert.IsTrue(SettingsSection.Content.ImageFileTypes.All(x => "jpeg,jpg,gif,bmp,png,tiff,tif".Split(',').Contains(x)));
}
[Test]
public virtual void ImageAutoFillProperties()
{
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.Count(), 2);
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).Alias, "umbracoFile");
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).WidthFieldAlias, "umbracoWidth");
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).HeightFieldAlias, "umbracoHeight");
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).LengthFieldAlias, "umbracoBytes");
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).ExtensionFieldAlias, "umbracoExtension");
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).Alias, "umbracoFile2");
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).WidthFieldAlias, "umbracoWidth2");
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).HeightFieldAlias, "umbracoHeight2");
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).LengthFieldAlias, "umbracoBytes2");
Assert.AreEqual(SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).ExtensionFieldAlias, "umbracoExtension2");
Assert.AreEqual(2, SettingsSection.Content.ImageAutoFillProperties.Count());
Assert.AreEqual("umbracoFile", SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).Alias);
Assert.AreEqual("umbracoWidth", SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).WidthFieldAlias);
Assert.AreEqual("umbracoHeight", SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).HeightFieldAlias);
Assert.AreEqual("umbracoBytes", SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).LengthFieldAlias);
Assert.AreEqual("umbracoExtension", SettingsSection.Content.ImageAutoFillProperties.ElementAt(0).ExtensionFieldAlias);
Assert.AreEqual("umbracoFile2", SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).Alias);
Assert.AreEqual("umbracoWidth2", SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).WidthFieldAlias);
Assert.AreEqual("umbracoHeight2", SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).HeightFieldAlias);
Assert.AreEqual("umbracoBytes2", SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).LengthFieldAlias);
Assert.AreEqual("umbracoExtension2", SettingsSection.Content.ImageAutoFillProperties.ElementAt(1).ExtensionFieldAlias);
}
[Test]
public void PreviewBadge()
{
@@ -116,7 +116,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings
Debug.WriteLine("AllowedContainsExtension: {0}", allowedContainsExtension);
Debug.WriteLine("DisallowedContainsExtension: {0}", disallowedContainsExtension);
Assert.AreEqual(SettingsSection.Content.IsFileAllowedForUpload(extension), expected);
Assert.AreEqual(expected, SettingsSection.Content.IsFileAllowedForUpload(extension));
}
}
}
@@ -16,7 +16,7 @@ namespace Umbraco.Tests.CoreThings
var xmlNode = cdata.GetXmlNode(xdoc);
Assert.AreEqual(xmlNode.InnerText, "hello world");
Assert.AreEqual("hello world", xmlNode.InnerText);
}
[Test]
@@ -27,7 +27,7 @@ namespace Umbraco.Tests.CoreThings
var xmlNode = cdata.GetXmlNode(xdoc);
Assert.AreEqual(xmlNode.InnerText, "hello world");
Assert.AreEqual("hello world", xmlNode.InnerText);
}
[Test]
@@ -41,7 +41,7 @@ namespace Umbraco.Tests.CoreThings
var xmlNode = cdata.GetXmlNode(xdoc);
Assert.AreEqual(xmlNode.InnerText, "hello world");
Assert.AreEqual("hello world", xmlNode.InnerText);
Assert.AreEqual(xml, xdoc.OuterXml);
}
}
+40 -33
View File
@@ -24,7 +24,6 @@ using Umbraco.Web.PropertyEditors;
namespace Umbraco.Tests.Models
{
[TestFixture]
public class ContentTests : UmbracoTestBase
{
@@ -42,7 +41,7 @@ namespace Umbraco.Tests.Models
// all this is required so we can validate properties...
var editor = new TextboxPropertyEditor(Mock.Of<ILogger>()) { Alias = "test" };
Composition.Register(_ => new DataEditorCollection(new [] { editor }));
Composition.Register(_ => new DataEditorCollection(new[] { editor }));
Composition.Register<PropertyEditorCollection>();
var dataType = Mock.Of<IDataType>();
Mock.Get(dataType).Setup(x => x.Configuration).Returns(() => new object());
@@ -55,7 +54,7 @@ namespace Umbraco.Tests.Models
var mediaTypeService = Mock.Of<IMediaTypeService>();
var memberTypeService = Mock.Of<IMemberTypeService>();
Composition.Register(_ => ServiceContext.CreatePartial(dataTypeService: dataTypeService, contentTypeBaseServiceProvider: new ContentTypeBaseServiceProvider(_contentTypeService, mediaTypeService, memberTypeService)));
}
[Test]
@@ -458,7 +457,7 @@ namespace Umbraco.Tests.Models
Assert.IsTrue(prop.WasPropertyDirty("Id"));
}
Assert.IsTrue(content.WasPropertyDirty("CultureInfos"));
foreach(var culture in content.CultureInfos)
foreach (var culture in content.CultureInfos)
{
Assert.IsTrue(culture.WasDirty());
Assert.IsTrue(culture.WasPropertyDirty("Name"));
@@ -539,7 +538,7 @@ namespace Umbraco.Tests.Models
var content = MockedContent.CreateTextpageContent(contentType, "Textpage", -1);
// Act
content.PropertyValues(new { title = "This is the new title"});
content.PropertyValues(new { title = "This is the new title" });
// Assert
Assert.That(content.Properties.Any(), Is.True);
@@ -603,13 +602,13 @@ namespace Umbraco.Tests.Models
// Act
contentType.PropertyGroups["Content"].PropertyTypes.Add(new PropertyType("test", ValueStorageType.Ntext, "subtitle")
{
Name = "Subtitle",
Description = "Optional subtitle",
Mandatory = false,
SortOrder = 3,
DataTypeId = -88
});
{
Name = "Subtitle",
Description = "Optional subtitle",
Mandatory = false,
SortOrder = 3,
DataTypeId = -88
});
// Assert
Assert.That(contentType.PropertyGroups["Content"].PropertyTypes.Count, Is.EqualTo(3));
@@ -626,9 +625,13 @@ namespace Umbraco.Tests.Models
// Act
var propertyType = new PropertyType("test", ValueStorageType.Ntext, "subtitle")
{
Name = "Subtitle", Description = "Optional subtitle", Mandatory = false, SortOrder = 3, DataTypeId = -88
};
{
Name = "Subtitle",
Description = "Optional subtitle",
Mandatory = false,
SortOrder = 3,
DataTypeId = -88
};
contentType.PropertyGroups["Content"].PropertyTypes.Add(propertyType);
var newProperty = new Property(propertyType);
newProperty.SetValue("This is a subtitle Test");
@@ -650,14 +653,14 @@ namespace Umbraco.Tests.Models
// Act
var propertyType = new PropertyType("test", ValueStorageType.Ntext, "subtitle")
{
Name = "Subtitle",
Description = "Optional subtitle",
Mandatory = false,
SortOrder = 3,
DataTypeId = -88
};
var propertyGroup = new PropertyGroup(true) { Name = "Test Group", SortOrder = 3};
{
Name = "Subtitle",
Description = "Optional subtitle",
Mandatory = false,
SortOrder = 3,
DataTypeId = -88
};
var propertyGroup = new PropertyGroup(true) { Name = "Test Group", SortOrder = 3 };
propertyGroup.PropertyTypes.Add(propertyType);
contentType.PropertyGroups.Add(propertyGroup);
var newProperty = new Property(propertyType);
@@ -681,9 +684,13 @@ namespace Umbraco.Tests.Models
// Act - note that the PropertyType's properties like SortOrder is not updated through the Content object
var propertyType = new PropertyType("test", ValueStorageType.Ntext, "title")
{
Name = "Title", Description = "Title description added", Mandatory = false, SortOrder = 10, DataTypeId = -88
};
{
Name = "Title",
Description = "Title description added",
Mandatory = false,
SortOrder = 10,
DataTypeId = -88
};
content.Properties.Add(new Property(propertyType));
// Assert
@@ -911,13 +918,13 @@ namespace Umbraco.Tests.Models
// Act
var propertyType = new PropertyType("test", ValueStorageType.Ntext, "subtitle")
{
Name = "Subtitle",
Description = "Optional subtitle",
Mandatory = false,
SortOrder = 3,
DataTypeId = -88
};
{
Name = "Subtitle",
Description = "Optional subtitle",
Mandatory = false,
SortOrder = 3,
DataTypeId = -88
};
contentType.PropertyGroups["Content"].PropertyTypes.Add(propertyType);
// Assert
+63
View File
@@ -0,0 +1,63 @@
using System;
using System.Linq;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Tests.Testing;
namespace Umbraco.Tests.Models
{
[TestFixture]
public class PropertyTests : UmbracoTestBase
{
[Test]
public void Can_Deep_Clone()
{
// needs to be within collection to support publishing
var ptCollection = new PropertyTypeCollection(true, new[] {new PropertyType("TestPropertyEditor", ValueStorageType.Nvarchar, "test")
{
Id = 3,
CreateDate = DateTime.Now,
DataTypeId = 5,
PropertyEditorAlias = "propTest",
Description = "testing",
Key = Guid.NewGuid(),
Mandatory = true,
Name = "Test",
PropertyGroupId = new Lazy<int>(() => 11),
SortOrder = 9,
UpdateDate = DateTime.Now,
ValidationRegExp = "xxxx",
ValueStorageType = ValueStorageType.Nvarchar
}});
var property = new Property(123, ptCollection[0])
{
CreateDate = DateTime.Now,
Id = 4,
Key = Guid.NewGuid(),
UpdateDate = DateTime.Now
};
property.SetValue("hello");
property.PublishValues();
var clone = (Property)property.DeepClone();
Assert.AreNotSame(clone, property);
Assert.AreNotSame(clone.Values, property.Values);
Assert.AreNotSame(property.PropertyType, clone.PropertyType);
for (int i = 0; i < property.Values.Count; i++)
{
Assert.AreNotSame(property.Values.ElementAt(i), clone.Values.ElementAt(i));
}
//This double verifies by reflection
var allProps = clone.GetType().GetProperties();
foreach (var propertyInfo in allProps)
{
Assert.AreEqual(propertyInfo.GetValue(clone, null), propertyInfo.GetValue(property, null));
}
}
}
}
@@ -1693,7 +1693,7 @@ namespace Umbraco.Tests.Persistence
{
Assert.IsTrue(testReader.Read());
Assert.AreEqual(testReader.Depth, 0);
Assert.AreEqual(0, testReader.Depth);
}
}
@@ -2067,7 +2067,7 @@ namespace Umbraco.Tests.Persistence
{
Assert.IsTrue(testReader.Read());
Assert.AreEqual(testReader.RecordsAffected, -1);
Assert.AreEqual(-1, testReader.RecordsAffected);
}
}
@@ -294,15 +294,13 @@ namespace Umbraco.Tests.Persistence.Repositories
stylesheet = repository.Get("missing.css");
Assert.IsNull(stylesheet);
// fixed in 7.3 - 7.2.8 used to...
Assert.Throws<UnauthorizedAccessException>(() =>
{
stylesheet = repository.Get("\\test-path-4.css"); // outside the filesystem, does not exist
});
Assert.Throws<UnauthorizedAccessException>(() =>
{
stylesheet = repository.Get("../packages.config"); // outside the filesystem, exists
});
// #7713 changes behaviour to return null when outside the filesystem
// to accomodate changing the CSS path and not flooding the backoffice with errors
stylesheet = repository.Get("\\test-path-4.css"); // outside the filesystem, does not exist
Assert.IsNull(stylesheet);
stylesheet = repository.Get("../packages.config"); // outside the filesystem, exists
Assert.IsNull(stylesheet);
}
}
@@ -1,9 +1,7 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
@@ -27,7 +25,6 @@ using Umbraco.Web.Cache;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.PublishedCache.NuCache;
using Umbraco.Web.PublishedCache.NuCache.DataSource;
using Umbraco.Web.PublishedCache.NuCache.Snap;
namespace Umbraco.Tests.PublishedContent
{
@@ -1312,6 +1309,18 @@ namespace Umbraco.Tests.PublishedContent
AssertLinkedNode(child3.contentNode, 1, 3, -1, -1, -1);
}
[Test]
public void MultipleCacheIteration()
{
//see https://github.com/umbraco/Umbraco-CMS/issues/7798
this.Init(this.GetInvariantKits());
var snapshot = this._snapshotService.CreatePublishedSnapshot(previewToken: null);
this._snapshotAccessor.PublishedSnapshot = snapshot;
var items = snapshot.Content.GetByXPath("/root/itype");
Assert.AreEqual(items.Count(), items.Count());
}
private void AssertLinkedNode(ContentNode node, int parent, int prevSibling, int nextSibling, int firstChild, int lastChild)
{
Assert.AreEqual(parent, node.ParentContentId);
@@ -1811,7 +1811,7 @@ namespace Umbraco.Tests.Services
ServiceContext.ContentService.Save(content2, Constants.Security.SuperUserId);
Assert.IsTrue(ServiceContext.ContentService.SaveAndPublish(content2, userId: 0).Success);
var editorGroup = ServiceContext.UserService.GetUserGroupByAlias("editor");
var editorGroup = ServiceContext.UserService.GetUserGroupByAlias(Constants.Security.EditorGroupAlias);
editorGroup.StartContentId = content1.Id;
ServiceContext.UserService.Save(editorGroup);
@@ -1890,6 +1890,49 @@ namespace Umbraco.Tests.Services
//Assert.AreNotEqual(content.Name, copy.Name);
}
[Test]
public void Can_Copy_And_Modify_Content_With_Events()
{
// see https://github.com/umbraco/Umbraco-CMS/issues/5513
TypedEventHandler<IContentService, CopyEventArgs<IContent>> copying = (sender, args) =>
{
args.Copy.SetValue("title", "1");
args.Original.SetValue("title", "2");
};
TypedEventHandler<IContentService, CopyEventArgs<IContent>> copied = (sender, args) =>
{
var copyVal = args.Copy.GetValue<string>("title");
var origVal = args.Original.GetValue<string>("title");
Assert.AreEqual("1", copyVal);
Assert.AreEqual("2", origVal);
};
try
{
var contentService = ServiceContext.ContentService;
ContentService.Copying += copying;
ContentService.Copied += copied;
var contentType = MockedContentTypes.CreateSimpleContentType();
ServiceContext.ContentTypeService.Save(contentType);
var content = MockedContent.CreateSimpleContent(contentType);
content.SetValue("title", "New Value");
contentService.Save(content);
var copy = contentService.Copy(content, content.ParentId, false, Constants.Security.SuperUserId);
Assert.AreEqual("1", copy.GetValue("title"));
}
finally
{
ContentService.Copying -= copying;
ContentService.Copied -= copied;
}
}
[Test]
public void Can_Copy_Recursive()
{
@@ -197,7 +197,17 @@ namespace Umbraco.Tests.Services
Assert.AreEqual(3, found.Count());
}
[Test]
public void Can_Get_All_Roles_IDs()
{
ServiceContext.MemberService.AddRole("MyTestRole1");
ServiceContext.MemberService.AddRole("MyTestRole2");
ServiceContext.MemberService.AddRole("MyTestRole3");
var found = ServiceContext.MemberService.GetAllRolesIds();
Assert.AreEqual(3, found.Count());
}
[Test]
public void Can_Get_All_Roles_By_Member_Id()
{
@@ -216,7 +226,24 @@ namespace Umbraco.Tests.Services
Assert.AreEqual(2, memberRoles.Count());
}
[Test]
public void Can_Get_All_Roles_Ids_By_Member_Id()
{
IMemberType memberType = MockedContentTypes.CreateSimpleMemberType();
ServiceContext.MemberTypeService.Save(memberType);
IMember member = MockedMember.CreateSimpleMember(memberType, "test", "test@test.com", "pass", "test");
ServiceContext.MemberService.Save(member);
ServiceContext.MemberService.AddRole("MyTestRole1");
ServiceContext.MemberService.AddRole("MyTestRole2");
ServiceContext.MemberService.AddRole("MyTestRole3");
ServiceContext.MemberService.AssignRoles(new[] { member.Id }, new[] { "MyTestRole1", "MyTestRole2" });
var memberRoles = ServiceContext.MemberService.GetAllRolesIds(member.Id);
Assert.AreEqual(2, memberRoles.Count());
}
[Test]
public void Can_Get_All_Roles_By_Member_Username()
{
@@ -70,6 +70,24 @@ namespace Umbraco.Tests.Strings
Assert.AreEqual(stripped, result);
}
[TestCase("../wtf.js?x=wtf", ".js")]
[TestCase(".htaccess", ".htaccess")]
[TestCase("path/to/file/image.png", ".png")]
[TestCase("c:\\abc\\def\\ghi.jkl", ".jkl")]
[TestCase("/root/folder.name/file.ext", ".ext")]
[TestCase("http://www.domain.com/folder/name/file.txt", ".txt")]
[TestCase("i/don't\\have\\an/extension", "")]
[TestCase("https://some.where/path/to/file.ext?query=this&more=that", ".ext")]
[TestCase("double_query.string/file.ext?query=abc?something.else", ".ext")]
[TestCase("test.tar.gz", ".gz")]
[TestCase("wierd.file,but._legal", "._legal")]
[TestCase("one_char.x", ".x")]
public void Get_File_Extension(string input, string result)
{
var extension = input.GetFileExtension();
Assert.AreEqual(result, extension);
}
[TestCase("'+alert(1234)+'", "+alert1234+")]
[TestCase("'+alert(56+78)+'", "+alert56+78+")]
[TestCase("{{file}}", "file")]
+1
View File
@@ -142,6 +142,7 @@
<Compile Include="Models\CultureImpactTests.cs" />
<Compile Include="Models\ImageProcessorImageUrlGeneratorTest.cs" />
<Compile Include="Models\PathValidationTests.cs" />
<Compile Include="Models\PropertyTests.cs" />
<Compile Include="Models\VariationTests.cs" />
<Compile Include="Persistence\Mappers\MapperTestBase.cs" />
<Compile Include="Persistence\Repositories\DocumentRepositoryTest.cs" />
@@ -27,7 +27,7 @@ namespace Umbraco.Tests.Web.AngularIntegration
string cookieToken, headerToken;
AngularAntiForgeryHelper.GetTokens(out cookieToken, out headerToken);
Assert.AreEqual(true, AngularAntiForgeryHelper.ValidateTokens(cookieToken, headerToken));
Assert.IsTrue(AngularAntiForgeryHelper.ValidateTokens(cookieToken, headerToken));
}
}
@@ -45,7 +45,7 @@ namespace Umbraco.Tests.Web.AngularIntegration
string cookieToken, headerToken;
AngularAntiForgeryHelper.GetTokens(out cookieToken, out headerToken);
Assert.AreEqual(true, AngularAntiForgeryHelper.ValidateTokens(cookieToken, headerToken));
Assert.IsTrue(AngularAntiForgeryHelper.ValidateTokens(cookieToken, headerToken));
}
}
+2 -2
View File
@@ -19,10 +19,10 @@
"tinyMCE": false,
"FileReader": false,
"Umbraco": false,
"Utilities": false,
"window": false,
"LazyLoad": false,
"ActiveXObject": false,
"Bloodhound": false
}
}
}
+2 -2
View File
@@ -28,9 +28,9 @@ module.exports = {
installer: { files: "./src/installer/**/*.js", out: "umbraco.installer.js" },
filters: { files: "./src/common/filters/**/*.js", out: "umbraco.filters.js" },
resources: { files: "./src/common/resources/**/*.js", out: "umbraco.resources.js" },
services: { files: "./src/common/services/**/*.js", out: "umbraco.services.js" },
services: { files: ["./src/common/services/**/*.js", "./src/utilities.js"], out: "umbraco.services.js" },
security: { files: "./src/common/interceptors/**/*.js", out: "umbraco.interceptors.js" },
//the controllers for views
controllers: {
files: [
+176 -78
View File
@@ -876,9 +876,9 @@
},
"dependencies": {
"acorn": {
"version": "5.7.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz",
"integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==",
"version": "5.7.4",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz",
"integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==",
"dev": true
},
"source-map": {
@@ -1035,9 +1035,9 @@
"integrity": "sha512-M1JtZctO2Zg+1qeGUFZXtYKsyaRptqQtqpVzlj80I0NzGW9MF3um0DBuizIvQlrPYUlTdm+wcOPZpZoerkxQdA=="
},
"acorn": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz",
"integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==",
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz",
"integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==",
"dev": true
},
"acorn-jsx": {
@@ -1806,7 +1806,8 @@
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
"integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",
"dev": true
"dev": true,
"optional": true
},
"base64id": {
"version": "1.0.0",
@@ -2053,6 +2054,7 @@
"resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz",
"integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==",
"dev": true,
"optional": true,
"requires": {
"p-finally": "^1.0.0"
}
@@ -2094,6 +2096,7 @@
"resolved": "http://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
"integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==",
"dev": true,
"optional": true,
"requires": {
"readable-stream": "^2.3.5",
"safe-buffer": "^5.1.1"
@@ -2103,13 +2106,15 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
"dev": true,
"optional": true
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"optional": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
@@ -2122,9 +2127,10 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "~5.1.0"
}
@@ -2259,6 +2265,7 @@
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz",
"integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==",
"dev": true,
"optional": true,
"requires": {
"base64-js": "^1.0.2",
"ieee754": "^1.1.4"
@@ -2284,7 +2291,8 @@
"version": "0.2.13",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
"integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
"dev": true
"dev": true,
"optional": true
},
"buffer-equal": {
"version": "1.0.0",
@@ -2416,7 +2424,7 @@
},
"callsites": {
"version": "2.0.0",
"resolved": "http://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz",
"integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=",
"dev": true
},
@@ -2475,6 +2483,7 @@
"resolved": "https://registry.npmjs.org/caw/-/caw-2.0.1.tgz",
"integrity": "sha512-Cg8/ZSBEa8ZVY9HspcGUYaK63d/bN7rqS3CYCzEGUxuYv6UlmcjzDUz2fCFFHyTvUW5Pk0I+3hkA3iXlIj6guA==",
"dev": true,
"optional": true,
"requires": {
"get-proxy": "^2.0.0",
"isurl": "^1.0.0-alpha5",
@@ -2730,7 +2739,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
@@ -2745,7 +2754,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@@ -2908,6 +2917,7 @@
"resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz",
"integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=",
"dev": true,
"optional": true,
"requires": {
"graceful-readlink": ">= 1.0.0"
}
@@ -2956,7 +2966,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
@@ -2971,7 +2981,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@@ -3002,6 +3012,7 @@
"resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz",
"integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==",
"dev": true,
"optional": true,
"requires": {
"ini": "^1.3.4",
"proto-list": "~1.2.1"
@@ -3057,6 +3068,7 @@
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "5.1.2"
}
@@ -3460,6 +3472,7 @@
"resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.0.tgz",
"integrity": "sha1-eu3YVCflqS2s/lVnSnxQXpbQH50=",
"dev": true,
"optional": true,
"requires": {
"decompress-tar": "^4.0.0",
"decompress-tarbz2": "^4.0.0",
@@ -3476,6 +3489,7 @@
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
"integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
"dev": true,
"optional": true,
"requires": {
"pify": "^3.0.0"
},
@@ -3484,7 +3498,8 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
"dev": true
"dev": true,
"optional": true
}
}
}
@@ -3495,6 +3510,7 @@
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz",
"integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=",
"dev": true,
"optional": true,
"requires": {
"mimic-response": "^1.0.0"
}
@@ -3504,6 +3520,7 @@
"resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz",
"integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==",
"dev": true,
"optional": true,
"requires": {
"file-type": "^5.2.0",
"is-stream": "^1.1.0",
@@ -3514,7 +3531,8 @@
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz",
"integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=",
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -3523,6 +3541,7 @@
"resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz",
"integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==",
"dev": true,
"optional": true,
"requires": {
"decompress-tar": "^4.1.0",
"file-type": "^6.1.0",
@@ -3535,7 +3554,8 @@
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz",
"integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==",
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -3544,6 +3564,7 @@
"resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz",
"integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==",
"dev": true,
"optional": true,
"requires": {
"decompress-tar": "^4.1.1",
"file-type": "^5.2.0",
@@ -3554,7 +3575,8 @@
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz",
"integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=",
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -3563,6 +3585,7 @@
"resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz",
"integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=",
"dev": true,
"optional": true,
"requires": {
"file-type": "^3.8.0",
"get-stream": "^2.2.0",
@@ -3574,13 +3597,15 @@
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
"integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=",
"dev": true
"dev": true,
"optional": true
},
"get-stream": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz",
"integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=",
"dev": true,
"optional": true,
"requires": {
"object-assign": "^4.0.1",
"pinkie-promise": "^2.0.0"
@@ -3590,7 +3615,8 @@
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -3855,7 +3881,8 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -3872,7 +3899,8 @@
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
"integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=",
"dev": true
"dev": true,
"optional": true
},
"duplexify": {
"version": "3.7.1",
@@ -3894,7 +3922,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
@@ -3909,7 +3937,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@@ -4475,6 +4503,7 @@
"resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
"integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
"dev": true,
"optional": true,
"requires": {
"cross-spawn": "^5.0.1",
"get-stream": "^3.0.0",
@@ -4490,6 +4519,7 @@
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
"integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
"dev": true,
"optional": true,
"requires": {
"lru-cache": "^4.0.1",
"shebang-command": "^1.2.0",
@@ -4629,6 +4659,7 @@
"resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz",
"integrity": "sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==",
"dev": true,
"optional": true,
"requires": {
"mime-db": "^1.28.0"
}
@@ -4638,6 +4669,7 @@
"resolved": "https://registry.npmjs.org/ext-name/-/ext-name-5.0.0.tgz",
"integrity": "sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ==",
"dev": true,
"optional": true,
"requires": {
"ext-list": "^2.0.0",
"sort-keys-length": "^1.0.0"
@@ -4919,6 +4951,7 @@
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
"integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
"dev": true,
"optional": true,
"requires": {
"pend": "~1.2.0"
}
@@ -4957,13 +4990,15 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz",
"integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=",
"dev": true
"dev": true,
"optional": true
},
"filenamify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/filenamify/-/filenamify-2.1.0.tgz",
"integrity": "sha512-ICw7NTT6RsDp2rnYKVd8Fu4cr6ITzGy3+u4vUujPkabyaz+03F24NWEX7fs5fp+kBonlaqPH8fAO2NM+SXt/JA==",
"dev": true,
"optional": true,
"requires": {
"filename-reserved-regex": "^2.0.0",
"strip-outer": "^1.0.0",
@@ -5313,7 +5348,8 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha1-a+Dem+mYzhavivwkSXue6bfM2a0=",
"dev": true
"dev": true,
"optional": true
},
"fs-extra": {
"version": "1.0.0",
@@ -5379,7 +5415,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@@ -5400,12 +5437,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -5420,17 +5459,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -5547,7 +5589,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@@ -5559,6 +5602,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -5573,6 +5617,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -5580,12 +5625,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -5604,6 +5651,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -5684,7 +5732,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -5696,6 +5745,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@@ -5781,7 +5831,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -5817,6 +5868,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -5836,6 +5888,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -5879,12 +5932,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -5911,6 +5966,7 @@
"resolved": "https://registry.npmjs.org/get-proxy/-/get-proxy-2.1.0.tgz",
"integrity": "sha512-zmZIaQTWnNQb4R4fJUEp/FC51eZsc6EkErspy3xtIYStaq8EB/hDIWipxsal+E8rz0qD7f2sL/NA9Xee4RInJw==",
"dev": true,
"optional": true,
"requires": {
"npm-conf": "^1.1.0"
}
@@ -5919,13 +5975,15 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
"integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
"dev": true
"dev": true,
"optional": true
},
"get-stream": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
"integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=",
"dev": true
"dev": true,
"optional": true
},
"get-value": {
"version": "2.0.6",
@@ -6240,7 +6298,8 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
"dev": true
"dev": true,
"optional": true
},
"growly": {
"version": "1.3.0",
@@ -6547,7 +6606,7 @@
},
"kind-of": {
"version": "1.1.0",
"resolved": "http://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
"integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=",
"dev": true
},
@@ -6712,9 +6771,9 @@
},
"dependencies": {
"acorn": {
"version": "5.7.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz",
"integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==",
"version": "5.7.4",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz",
"integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==",
"dev": true
},
"source-map": {
@@ -6759,7 +6818,7 @@
},
"chalk": {
"version": "1.1.3",
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
@@ -6835,7 +6894,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
@@ -6856,7 +6915,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@@ -7059,7 +7118,8 @@
"version": "1.4.2",
"resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz",
"integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw==",
"dev": true
"dev": true,
"optional": true
},
"has-symbols": {
"version": "1.0.0",
@@ -7072,6 +7132,7 @@
"resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz",
"integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==",
"dev": true,
"optional": true,
"requires": {
"has-symbol-support-x": "^1.4.1"
}
@@ -7272,7 +7333,8 @@
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==",
"dev": true
"dev": true,
"optional": true
},
"ignore": {
"version": "4.0.6",
@@ -7402,6 +7464,7 @@
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz",
"integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=",
"dev": true,
"optional": true,
"requires": {
"repeating": "^2.0.0"
}
@@ -7723,6 +7786,7 @@
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz",
"integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=",
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -7775,7 +7839,8 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz",
"integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=",
"dev": true
"dev": true,
"optional": true
},
"is-negated-glob": {
"version": "1.0.0",
@@ -7813,13 +7878,15 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz",
"integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=",
"dev": true
"dev": true,
"optional": true
},
"is-plain-obj": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
"integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=",
"dev": true
"dev": true,
"optional": true
},
"is-plain-object": {
"version": "2.0.4",
@@ -7883,7 +7950,8 @@
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz",
"integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==",
"dev": true
"dev": true,
"optional": true
},
"is-stream": {
"version": "1.1.0",
@@ -7986,6 +8054,7 @@
"resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz",
"integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==",
"dev": true,
"optional": true,
"requires": {
"has-to-string-tag-x": "^1.2.0",
"is-object": "^1.0.1"
@@ -8433,7 +8502,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
@@ -8448,7 +8517,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@@ -8803,7 +8872,8 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
"integrity": "sha1-b54wtHCE2XGnyCD/FabFFnt0wm8=",
"dev": true
"dev": true,
"optional": true
},
"lpad-align": {
"version": "1.1.2",
@@ -8873,7 +8943,8 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
"integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
"dev": true
"dev": true,
"optional": true
},
"map-visit": {
"version": "1.0.0",
@@ -9029,7 +9100,8 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
"integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==",
"dev": true
"dev": true,
"optional": true
},
"minimatch": {
"version": "3.0.4",
@@ -12331,6 +12403,7 @@
"resolved": "https://registry.npmjs.org/npm-conf/-/npm-conf-1.1.3.tgz",
"integrity": "sha512-Yic4bZHJOt9RCFbRP3GgpqhScOY4HH3V2P8yBj6CeYq118Qr+BLXqT2JvpJ00mryLESpgOxf5XlFv4ZjXxLScw==",
"dev": true,
"optional": true,
"requires": {
"config-chain": "^1.1.11",
"pify": "^3.0.0"
@@ -12340,7 +12413,8 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -12349,6 +12423,7 @@
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
"dev": true,
"optional": true,
"requires": {
"path-key": "^2.0.0"
}
@@ -12704,7 +12779,8 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
"dev": true
"dev": true,
"optional": true
},
"p-is-promise": {
"version": "1.1.0",
@@ -12741,6 +12817,7 @@
"resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-1.2.1.tgz",
"integrity": "sha1-XrOzU7f86Z8QGhA4iAuwVOu+o4Y=",
"dev": true,
"optional": true,
"requires": {
"p-finally": "^1.0.0"
}
@@ -12972,7 +13049,7 @@
},
"pify": {
"version": "2.3.0",
"resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true
},
@@ -13464,7 +13541,8 @@
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
"integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk=",
"dev": true
"dev": true,
"optional": true
},
"prr": {
"version": "1.0.1",
@@ -13646,7 +13724,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
@@ -13661,7 +13739,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@@ -13820,6 +13898,7 @@
"resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz",
"integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=",
"dev": true,
"optional": true,
"requires": {
"is-finite": "^1.0.0"
}
@@ -14071,7 +14150,7 @@
},
"chalk": {
"version": "1.1.3",
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
@@ -14093,7 +14172,7 @@
},
"kind-of": {
"version": "1.1.0",
"resolved": "http://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz",
"integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=",
"dev": true
},
@@ -14159,6 +14238,7 @@
"resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz",
"integrity": "sha1-z+kXyz0nS8/6x5J1ivUxc+sfq9w=",
"dev": true,
"optional": true,
"requires": {
"commander": "~2.8.1"
}
@@ -14561,6 +14641,7 @@
"resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz",
"integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=",
"dev": true,
"optional": true,
"requires": {
"is-plain-obj": "^1.0.0"
}
@@ -14570,6 +14651,7 @@
"resolved": "https://registry.npmjs.org/sort-keys-length/-/sort-keys-length-1.0.1.tgz",
"integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=",
"dev": true,
"optional": true,
"requires": {
"sort-keys": "^1.0.0"
}
@@ -14678,7 +14760,7 @@
},
"chalk": {
"version": "1.1.3",
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"optional": true,
@@ -14894,6 +14976,7 @@
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz",
"integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==",
"dev": true,
"optional": true,
"requires": {
"is-natural-number": "^4.0.1"
}
@@ -14902,7 +14985,8 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"dev": true
"dev": true,
"optional": true
},
"strip-indent": {
"version": "1.0.1",
@@ -14925,6 +15009,7 @@
"resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz",
"integrity": "sha1-sv0qv2YEudHmATBXGV34Nrip1jE=",
"dev": true,
"optional": true,
"requires": {
"escape-string-regexp": "^1.0.2"
}
@@ -15044,6 +15129,7 @@
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz",
"integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==",
"dev": true,
"optional": true,
"requires": {
"bl": "^1.0.0",
"buffer-alloc": "^1.2.0",
@@ -15058,13 +15144,15 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
"dev": true,
"optional": true
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"optional": true,
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
@@ -15080,6 +15168,7 @@
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "~5.1.0"
}
@@ -15090,13 +15179,15 @@
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz",
"integrity": "sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0=",
"dev": true
"dev": true,
"optional": true
},
"tempfile": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/tempfile/-/tempfile-2.0.0.tgz",
"integrity": "sha1-awRGhWqbERTRhW/8vlCczLCXcmU=",
"dev": true,
"optional": true,
"requires": {
"temp-dir": "^1.0.0",
"uuid": "^3.0.1"
@@ -15144,7 +15235,7 @@
},
"readable-stream": {
"version": "2.3.6",
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
@@ -15159,7 +15250,7 @@
},
"string_decoder": {
"version": "1.1.1",
"resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
@@ -15197,7 +15288,8 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz",
"integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=",
"dev": true
"dev": true,
"optional": true
},
"timers-ext": {
"version": "0.1.7",
@@ -15254,7 +15346,8 @@
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz",
"integrity": "sha1-STvUj2LXxD/N7TE6A9ytsuEhOoA=",
"dev": true
"dev": true,
"optional": true
},
"to-fast-properties": {
"version": "2.0.0",
@@ -15349,6 +15442,7 @@
"resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz",
"integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=",
"dev": true,
"optional": true,
"requires": {
"escape-string-regexp": "^1.0.2"
}
@@ -15370,6 +15464,7 @@
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.0.1"
}
@@ -15485,6 +15580,7 @@
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz",
"integrity": "sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg==",
"dev": true,
"optional": true,
"requires": {
"buffer": "^5.2.1",
"through": "^2.3.8"
@@ -15685,7 +15781,8 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz",
"integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=",
"dev": true
"dev": true,
"optional": true
},
"use": {
"version": "3.1.1",
@@ -16104,6 +16201,7 @@
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
"integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
"dev": true,
"optional": true,
"requires": {
"buffer-crc32": "~0.2.3",
"fd-slicer": "~1.1.0"
+1 -1
View File
@@ -50,7 +50,7 @@
"@babel/core": "7.6.4",
"@babel/preset-env": "7.6.3",
"autoprefixer": "9.6.5",
"caniuse-lite": "^1.0.30001002",
"caniuse-lite": "^1.0.30001037",
"cssnano": "4.1.10",
"fs": "0.0.2",
"gulp": "4.0.2",
@@ -12,26 +12,25 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
var sectionItemsWidth = [];
var evts = [];
var maxSections = 8;
//setup scope vars
scope.maxSections = maxSections;
scope.overflowingSections = 0;
scope.sections = [];
scope.visibleSections = 0;
scope.currentSection = appState.getSectionState("currentSection");
scope.showTray = false; //appState.getGlobalState("showTray");
scope.showTray = false;
scope.stickyNavigation = appState.getGlobalState("stickyNavigation");
scope.needTray = false;
function loadSections() {
sectionService.getSectionsForUser()
.then(function (result) {
scope.sections = result;
scope.visibleSections = scope.sections.length;
// store the width of each section so we can hide/show them based on browser width
// we store them because the sections get removed from the dom and then we
// can't tell when to show them gain
$timeout(function () {
$("#applications .sections li").each(function (index) {
$("#applications .sections li:not(:last)").each(function (index) {
sectionItemsWidth.push($(this).outerWidth());
});
});
@@ -42,25 +41,22 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
function calculateWidth() {
$timeout(function () {
//total width minus room for avatar, search, and help icon
var windowWidth = $(window).width() - 150;
var containerWidth = $(".umb-app-header").outerWidth() - $(".umb-app-header__actions").outerWidth();
var trayToggleWidth = $("#applications .sections li.expand").outerWidth();
var sectionsWidth = 0;
scope.totalSections = scope.sections.length;
scope.maxSections = maxSections;
scope.overflowingSections = scope.maxSections - scope.totalSections;
scope.needTray = scope.sections.length > scope.maxSections;
// detect how many sections we can show on the screen
for (var i = 0; i < sectionItemsWidth.length; i++) {
var sectionItemWidth = sectionItemsWidth[i];
sectionsWidth += sectionItemWidth;
if (sectionsWidth > windowWidth) {
scope.needTray = true;
scope.maxSections = i - 1;
scope.overflowingSections = scope.maxSections - scope.totalSections;
break;
if (sectionsWidth + trayToggleWidth > containerWidth) {
scope.visibleSections = i;
return;
}
}
scope.visibleSections = scope.sections.length;
});
}
@@ -134,14 +130,9 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
};
scope.currentSectionInOverflow = function () {
if (scope.overflowingSections === 0) {
return false;
}
var currentSection = scope.sections.filter(s => s.alias === scope.currentSection);
return (scope.sections.indexOf(currentSection[0]) >= scope.maxSections);
return currentSection.length > 0 && scope.sections.indexOf(currentSection[0]) > scope.visibleSections - 1;
};
loadSections();
@@ -178,11 +178,11 @@ function angularHelper($q) {
$valid: true,
$submitted: false,
$pending: undefined,
$addControl: angular.noop,
$removeControl: angular.noop,
$setValidity: angular.noop,
$setDirty: angular.noop,
$setPristine: angular.noop,
$addControl: Utilities.noop,
$removeControl: Utilities.noop,
$setValidity: Utilities.noop,
$setDirty: Utilities.noop,
$setPristine: Utilities.noop,
$name: formName
};
}
@@ -578,30 +578,12 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
if (args.action.metaData["actionView"]) {
templateUrl = args.action.metaData["actionView"];
}
else {
//by convention we will look into the /views/{treetype}/{action}.html
// for example: /views/content/create.html
//we will also check for a 'packageName' for the current tree, if it exists then the convention will be:
// for example: /App_Plugins/{mypackage}/backoffice/{treetype}/create.html
else {
var treeAlias = treeService.getTreeAlias(args.node);
var packageTreeFolder = treeService.getTreePackageFolder(treeAlias);
if (!treeAlias) {
throw "Could not get tree alias for node " + args.node.id;
}
if (packageTreeFolder) {
templateUrl = Umbraco.Sys.ServerVariables.umbracoSettings.appPluginsPath +
"/" + packageTreeFolder +
"/backoffice/" + treeAlias + "/" + args.action.alias + ".html";
}
else {
templateUrl = "views/" + treeAlias + "/" + args.action.alias + ".html";
}
}
templateUrl = this.getTreeTemplateUrl(treeAlias, args.action.alias);
}
setMode("dialog");
@@ -611,6 +593,31 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
}
},
/**
* @ngdoc method
* @name umbraco.services.navigationService#getTreeTemplateUrl
* @methodOf umbraco.services.navigationService
*
* @param {string} treeAlias the alias of the tree to look up
* @param {string} action the view file name
* @description
* creates the templateUrl based on treeAlias and action
* by convention we will look into the /views/{treetype}/{action}.html
* for example: /views/content/create.html
* we will also check for a 'packageName' for the current tree, if it exists then the convention will be:
* for example: /App_Plugins/{mypackage}/backoffice/{treetype}/create.html
*/
getTreeTemplateUrl: function(treeAlias, action) {
var packageTreeFolder = treeService.getTreePackageFolder(treeAlias);
if (packageTreeFolder) {
return Umbraco.Sys.ServerVariables.umbracoSettings.appPluginsPath +
"/" + packageTreeFolder +
"/backoffice/" + treeAlias + "/" + action + ".html";
}
else {
return "views/" + treeAlias + "/" + action + ".html";
}
},
/**
* @ngdoc method
@@ -365,12 +365,23 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe
},
/**
* @ngdoc method
* @name umbraco.resources.contentResource#downloadFile
* @methodOf umbraco.resources.contentResource
*
* @description
* Downloads a file to the client using AJAX/XHR
* Based on an implementation here: web.student.tuwien.ac.at/~e0427417/jsdownload.html
* See https://stackoverflow.com/a/24129082/694494
*
* @param {string} httpPath the path (url) to the resource being downloaded
* @returns {Promise} http promise object.
*/
downloadFile : function (httpPath) {
/**
* Based on an implementation here: web.student.tuwien.ac.at/~e0427417/jsdownload.html
* See https://stackoverflow.com/a/24129082/694494
*/
// Use an arraybuffer
return $http.get(httpPath, { responseType: 'arraybuffer' })
.then(function (response) {
@@ -2,17 +2,16 @@ angular.module("umbraco.install").factory('installerService', function ($rootSco
var _status = {
index: 0,
current: undefined,
steps: undefined,
current: null,
steps: null,
loading: true,
progress: "100%"
};
var factTimer = undefined;
var factTimer;
var _installerModel = {
installId: undefined,
instructions: {
}
installId: null,
instructions: {}
};
//add to umbraco installer facts here
@@ -304,7 +303,7 @@ angular.module("umbraco.install").factory('installerService', function ($rootSco
},
switchToFeedback : function(){
service.status.current = undefined;
service.status.current = null;
service.status.loading = true;
service.status.configuring = false;
@@ -320,11 +319,11 @@ angular.module("umbraco.install").factory('installerService', function ($rootSco
switchToConfiguration : function(){
service.status.loading = false;
service.status.configuring = true;
service.status.feedback = undefined;
service.status.fact = undefined;
service.status.feedback = null;
service.status.fact = null;
if(factTimer){
clearInterval(factTimer);
if (factTimer) {
clearInterval(factTimer);
}
},
@@ -335,8 +334,8 @@ angular.module("umbraco.install").factory('installerService', function ($rootSco
service.status.feedback = "Redirecting you to Umbraco, please wait";
service.status.loading = false;
if(factTimer){
clearInterval(factTimer);
if (factTimer) {
clearInterval(factTimer);
}
$timeout(function(){
@@ -4,18 +4,19 @@ angular.module("umbraco.install").controller("Umbraco.Installer.DataBaseControll
$scope.invalidDbDns = false;
$scope.dbs = [
{ name: 'Microsoft SQL Server Compact (SQL CE)', id: 0},
{ name: 'Microsoft SQL Server', id: 1},
{ name: 'Microsoft SQL Server Compact (SQL CE)', id: 0 },
{ name: 'Microsoft SQL Server', id: 1 },
{ name: 'Microsoft SQL Azure', id: 3 },
{ name: 'Custom connection string', id: -1}
{ name: 'Custom connection string', id: -1 }
];
if ( installerService.status.current.model.dbType === undefined ) {
if (angular.isUndefined(installerService.status.current.model.dbType) || installerService.status.current.model.dbType === null) {
installerService.status.current.model.dbType = 0;
}
$scope.validateAndForward = function(){
if ( !$scope.checking && this.myForm.$valid ) {
$scope.validateAndForward = function() {
if (!$scope.checking && this.myForm.$valid)
{
$scope.checking = true;
$scope.invalidDbDns = false;
@@ -23,9 +24,9 @@ angular.module("umbraco.install").controller("Umbraco.Installer.DataBaseControll
$http.post(
Umbraco.Sys.ServerVariables.installApiBaseUrl + "PostValidateDatabaseConnection",
model ).then( function( response ) {
model).then(function(response) {
if ( response.data === true ) {
if (response.data === true) {
installerService.forward();
}
else {
@@ -1,5 +1,4 @@
angular.module("umbraco.install").controller("Umbraco.Installer.MachineKeyController", function ($scope, installerService) {
$scope.continue = function () {
installerService.status.current.model = true;
@@ -11,4 +10,4 @@
installerService.forward();
};
});
});
@@ -20,8 +20,9 @@
</li>
</ul>
<a href ng-click="setPackageAndContinue('00000000-0000-0000-0000-000000000000')"
class="btn btn-link btn-link-reverse">
<button type="button"
class="btn btn-link btn-link-reverse"
ng-click="setPackageAndContinue('00000000-0000-0000-0000-000000000000')">
No thanks, I do not want to install a starter website
</a>
</button>
</div>
@@ -13,14 +13,14 @@ angular.module("umbraco.install").controller("Umbraco.Install.UserController", f
$scope.passwordPattern = new RegExp(exp);
}
$scope.validateAndInstall = function(){
installerService.install();
$scope.validateAndInstall = function() {
installerService.install();
};
$scope.validateAndForward = function(){
if(this.myForm.$valid){
installerService.forward();
}
if (this.myForm.$valid) {
installerService.forward();
}
};
});
});
@@ -17,15 +17,17 @@
.umb-button-group {
.umb-button__button {
border-radius: @baseBorderRadius;
border-radius: @baseBorderRadius 0 0 @baseBorderRadius;
&:hover {
z-index: 2;
}
}
.umb-button-group__toggle {
border-radius: 0 @baseBorderRadius @baseBorderRadius 0;
border-left: 1px solid rgba(0,0,0,0.09);
margin-left: -2px;
margin-left: -1px;
padding-left: 10px;
padding-right: 10px;
}
}
@@ -11,7 +11,7 @@
cursor: pointer;
position: relative;
user-select: none;
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.16);
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.16);
border-radius: 3px;
}
@@ -1,19 +1,18 @@
/**
/**
* @ngdoc controller
* @name Umbraco.MainController
* @name Umbraco.MainController
* @function
*
* @description
* @description
* The main application controller
*
*/
function MainController($scope, $location, appState, treeService, notificationsService,
userService, historyService, updateChecker, navigationService, eventsService,
tmhDynamicLocale, localStorageService, editorService, overlayService, assetsService, tinyMceAssets) {
//the null is important because we do an explicit bool check on this in the view
$scope.authenticated = null;
$scope.authenticated = null;
$scope.touchDevice = appState.getGlobalState("touchDevice");
$scope.infiniteMode = false;
$scope.overlay = {};
+5 -39
View File
@@ -154,7 +154,7 @@ app.config(function ($routeProvider) {
//This allows us to dynamically change the template for this route since you cannot inject services into the templateUrl method.
template: "<div ng-include='templateUrl'></div>",
//This controller will execute for this route, then we replace the template dynamically based on the current tree.
controller: function ($scope, $routeParams, treeService) {
controller: function ($scope, $routeParams, navigationService) {
if (!$routeParams.method) {
$scope.templateUrl = "views/common/dashboard.html";
@@ -176,24 +176,7 @@ app.config(function ($routeProvider) {
$scope.templateUrl = "views/users/overview.html";
return;
}
// Here we need to figure out if this route is for a user's package tree and if so then we need
// to change it's convention view path to:
// /App_Plugins/{mypackage}/backoffice/{treetype}/{method}.html
// otherwise if it is a core tree we use the core paths:
// views/{treetype}/{method}.html
var packageTreeFolder = treeService.getTreePackageFolder($routeParams.tree);
if (packageTreeFolder) {
$scope.templateUrl = (Umbraco.Sys.ServerVariables.umbracoSettings.appPluginsPath +
"/" + packageTreeFolder +
"/backoffice/" + $routeParams.tree + "/" + $routeParams.method + ".html");
}
else {
$scope.templateUrl = ('views/' + $routeParams.tree + '/' + $routeParams.method + '.html');
}
$scope.templateUrl = navigationService.getTreeTemplateUrl($routeParams.tree, $routeParams.method);
},
reloadOnSearch: false,
resolve: canRoute(true)
@@ -202,30 +185,13 @@ app.config(function ($routeProvider) {
//This allows us to dynamically change the template for this route since you cannot inject services into the templateUrl method.
template: "<div ng-include='templateUrl'></div>",
//This controller will execute for this route, then we replace the template dynamically based on the current tree.
controller: function ($scope, $route, $routeParams, treeService) {
controller: function ($scope, $routeParams, navigationService) {
if (!$routeParams.tree || !$routeParams.method) {
$scope.templateUrl = "views/common/dashboard.html";
return;
}
// Here we need to figure out if this route is for a package tree and if so then we need
// to change it's convention view path to:
// /App_Plugins/{mypackage}/backoffice/{treetype}/{method}.html
// otherwise if it is a core tree we use the core paths:
// views/{treetype}/{method}.html
var packageTreeFolder = treeService.getTreePackageFolder($routeParams.tree);
if (packageTreeFolder) {
$scope.templateUrl = (Umbraco.Sys.ServerVariables.umbracoSettings.appPluginsPath +
"/" + packageTreeFolder +
"/backoffice/" + $routeParams.tree + "/" + $routeParams.method + ".html");
}
else {
$scope.templateUrl = ('views/' + $routeParams.tree + '/' + $routeParams.method + '.html');
}
$scope.templateUrl = navigationService.getTreeTemplateUrl($routeParams.tree, $routeParams.method);
},
reloadOnSearch: false,
reloadOnUrl: false,
@@ -0,0 +1,86 @@
/**
* A friendly utility collection to replace AngularJs' ng-functions
* If it doesn't exist here, it's probably available as vanilla JS
*
* Still carries a dependency on underscore, but if usages of underscore from
* elsewhere in the codebase can instead use these methods, the underscore
* dependency will be nicely abstracted and can be removed/swapped later
*
* This collection is open to extension...
*/
(function (window) {
/**
* Equivalent to angular.noop
*/
const noop = () => { };
/**
* Facade to angular.copy
*/
const copy = val => angular.copy(val);
/**
* Equivalent to angular.isArray
*/
const isArray = val => Array.isArray(val) || val instanceof Array;
/**
* Facade to angular.equals
*/
const equals = (a, b) => angular.equals(a, b);
/**
* Facade to angular.extend
* Use this with Angular objects, for vanilla JS objects, use Object.assign()
*/
const extend = (dst, src) => angular.extend(dst, src);
/**
* Equivalent to angular.isFunction
*/
const isFunction = val => typeof val === 'function';
/**
* Equivalent to angular.isUndefined
*/
const isUndefined = val => typeof val === 'undefined';
/**
* Equivalent to angular.isDefined. Inverts result of const isUndefined
*/
const isDefined = val => !isUndefined(val);
/**
* Equivalent to angular.isString
*/
const isString = val => typeof val === 'string';
/**
* Equivalent to angular.isNumber
*/
const isNumber = val => typeof val === 'number';
/**
* Equivalent to angular.isObject
*/
const isObject = val => val !== null && typeof val === 'object';
let _utilities = {
noop: noop,
copy: copy,
isArray: isArray,
equals: equals,
extend: extend,
isFunction: isFunction,
isUndefined: isUndefined,
isDefined: isDefined,
isString: isString,
isNumber: isNumber,
isObject: isObject
};
if (typeof (window.Utilities) === 'undefined') {
window.Utilities = _utilities;
}
})(window);
@@ -2,7 +2,7 @@
<div id="applications" ng-class="{faded:stickyNavigation}">
<ul class="sections" data-element="sections">
<li data-element="section-{{section.alias}}" ng-repeat="section in sections | limitTo: maxSections" ng-class="{current: section.alias == currentSection}">
<li data-element="section-{{section.alias}}" ng-repeat="section in sections | limitTo: visibleSections" ng-class="{current: section.alias == currentSection}">
<a href="#/{{section.alias}}"
ng-dblclick="sectionDblClick(section)"
ng-click="sectionClick($event, section)"
@@ -11,13 +11,13 @@
</a>
</li>
<li data-element="section-expand" class="expand" ng-class="{ 'open': showTray === true, current: currentSectionInOverflow() }" ng-show="needTray">
<li data-element="section-expand" class="expand" ng-class="{ 'open': showTray === true, current: currentSectionInOverflow() }" ng-show="visibleSections < sections.length">
<a href="#" ng-click="trayClick()" prevent-default>
<span class="section__name"><i></i><i></i><i></i></span>
<span class="section__name">&bull;&bull;&bull;</span>
</a>
<ul id="applications-tray" class="sections-tray shadow-depth-2" ng-if="showTray" on-outside-click="trayClick()">
<li ng-repeat="section in sections | limitTo: overflowingSections" ng-class="{current: section.alias == currentSection}">
<li ng-repeat="section in sections | limitTo: sections.length | limitTo: -(sections.length - visibleSections)" ng-class="{current: section.alias == currentSection}">
<a href="#/{{section.alias}}"
ng-dblclick="sectionDblClick(section)"
ng-click="sectionClick($event, section)"
@@ -325,7 +325,7 @@
/* ---------- SAVE ---------- */
function save() {
saveInternal().then(angular.noop, angular.noop);
saveInternal().then(Utilities.noop, Utilities.noop);
}
/** This internal save method performs the actual saving and returns a promise, not to be bound to any buttons but used by other bound methods */
@@ -15,7 +15,7 @@
packageResource.getAllCreated().then(createdPackages => {
vm.createdPackages = createdPackages;
}, angular.noop);
}, Utilities.noop);
}
@@ -80,7 +80,7 @@
activate: false
});
completeSave(saved);
}, angular.noop);
}, Utilities.noop);
} else {
@@ -9,6 +9,7 @@ angular.module("umbraco")
$element,
eventsService,
editorService,
overlayService,
$interpolate
) {
@@ -320,21 +321,22 @@ angular.module("umbraco")
var title = "";
localizationService.localize("grid_insertControl").then(function (value) {
title = value;
$scope.editorOverlay = {
view: "itempicker",
overlayService.open({
view: "itempicker",
filter: area.$allowedEditors.length > 15,
title: title,
availableItems: area.$allowedEditors,
event: event,
show: true,
submit: function (model) {
submit: function(model) {
if (model.selectedItem) {
$scope.addControl(model.selectedItem, area, index);
$scope.editorOverlay.show = false;
$scope.editorOverlay = null;
overlayService.close();
}
},
close: function() {
overlayService.close();
}
};
});
});
};
@@ -299,11 +299,4 @@
</div>
</div>
<umb-overlay
ng-if="editorOverlay.show"
model="editorOverlay"
view="editorOverlay.view"
position="target">
</umb-overlay>
</div>
@@ -39,8 +39,14 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.RteController",
stylesheetResource.getAll().then(function(stylesheets){
$scope.stylesheets = stylesheets;
_.each($scope.stylesheets, function (stylesheet) {
// if the CSS directory changes, previously assigned stylesheets are retained, but will not be visible
// and will throw a 404 when loading the RTE. Remove them here. Still needs to be saved...
let cssPath = Umbraco.Sys.ServerVariables.umbracoSettings.cssPath;
$scope.model.value.stylesheets = $scope.model.value.stylesheets
.filter(sheet => sheet.startsWith(cssPath));
$scope.stylesheets.forEach(stylesheet => {
// support both current format (full stylesheet path) and legacy format (stylesheet name only)
stylesheet.selected = $scope.model.value.stylesheets.indexOf(stylesheet.path) >= 0 ||$scope.model.value.stylesheets.indexOf(stylesheet.name) >= 0;
});
@@ -168,7 +168,7 @@
extendedSave(saved).then(function(result) {
//if all is good, then reset the form
formHelper.resetForm({ scope: $scope });
}, angular.noop);
}, Utilities.noop);
vm.user = _.omit(saved, "navigation");
//restore
@@ -112,7 +112,7 @@
userGroupsResource.deleteUserGroups(_.pluck(vm.selection, "id")).then(function (data) {
clearSelection();
onInit();
}, angular.noop);
}, Utilities.noop);
overlayService.close();
}
};
@@ -386,7 +386,7 @@
vm.selectedBulkUserGroups = [];
editorService.close();
clearSelection();
}, angular.noop);
}, Utilities.noop);
},
close: function () {
vm.selectedBulkUserGroups = [];
@@ -119,7 +119,7 @@
<span class="caret"></span>
</a>
<umb-dropdown class="pull-right" ng-if="vm.page.showStatusFilter" on-close="vm.page.showStatusFilter = false;">
<umb-dropdown-item ng-repeat="userState in vm.userStatesFilter | filter:{ count: '!0', key: '!All'}" style="padding: 8px 20px 8px 16px;">
<umb-dropdown-item ng-repeat="userState in vm.userStatesFilter | filter:{ key: '!All'}" ng-show="userState.count > 0" style="padding: 8px 20px 8px 16px;">
<umb-checkbox model="userState.selected"
on-change="vm.setUserStatesFilter(userState)"
text="{{ userState.name }} ({{userState.count}})">
+1 -1
View File
@@ -86,7 +86,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CSharpTest.Net.Collections" Version="14.906.1403.1082" />
<PackageReference Include="ClientDependency" Version="1.9.8" />
<PackageReference Include="ClientDependency" Version="1.9.9" />
<PackageReference Include="ClientDependency-Mvc5" Version="1.9.3" />
<PackageReference Include="Examine" Version="1.0.2" />
<PackageReference Include="ImageProcessor.Web" Version="4.10.0.100" />
@@ -1,220 +0,0 @@
/**
* @ngdoc controller
* @name Umbraco.MainController
* @function
*
* @description
* The main application controller
*
*/
function MainController($scope, $location, appState, treeService, notificationsService,
userService, historyService, updateChecker, navigationService, eventsService,
tmhDynamicLocale, localStorageService, editorService, overlayService, assetsService, tinyMceAssets) {
//the null is important because we do an explicit bool check on this in the view
$scope.authenticated = null;
$scope.touchDevice = appState.getGlobalState("touchDevice");
$scope.infiniteMode = false;
$scope.overlay = {};
$scope.drawer = {};
$scope.search = {};
$scope.login = {};
$scope.tabbingActive = false;
// Load TinyMCE assets ahead of time in the background for the user
// To help with first load of the RTE
tinyMceAssets.forEach(function (tinyJsAsset) {
assetsService.loadJs(tinyJsAsset, $scope);
});
// There are a number of ways to detect when a focus state should be shown when using the tab key and this seems to be the simplest solution.
// For more information about this approach, see https://hackernoon.com/removing-that-ugly-focus-ring-and-keeping-it-too-6c8727fefcd2
function handleFirstTab(evt) {
if (evt.keyCode === 9) {
$scope.tabbingActive = true;
$scope.$digest();
window.removeEventListener('keydown', handleFirstTab);
window.addEventListener('mousedown', disableTabbingActive);
}
}
function disableTabbingActive(evt) {
$scope.tabbingActive = false;
$scope.$digest();
window.removeEventListener('mousedown', disableTabbingActive);
window.addEventListener("keydown", handleFirstTab);
}
window.addEventListener("keydown", handleFirstTab);
$scope.removeNotification = function (index) {
notificationsService.remove(index);
};
$scope.closeSearch = function() {
appState.setSearchState("show", false);
};
$scope.showLoginScreen = function(isTimedOut) {
$scope.login.isTimedOut = isTimedOut;
$scope.login.show = true;
};
$scope.hideLoginScreen = function() {
$scope.login.show = false;
};
var evts = [];
//when a user logs out or timesout
evts.push(eventsService.on("app.notAuthenticated", function (evt, data) {
$scope.authenticated = null;
$scope.user = null;
const isTimedOut = data && data.isTimedOut ? true : false;
$scope.showLoginScreen(isTimedOut);
// Remove the localstorage items for tours shown
// Means that when next logged in they can be re-shown if not already dismissed etc
localStorageService.remove("emailMarketingTourShown");
localStorageService.remove("introTourShown");
}));
evts.push(eventsService.on("app.userRefresh", function(evt) {
userService.refreshCurrentUser().then(function(data) {
$scope.user = data;
//Load locale file
if ($scope.user.locale) {
tmhDynamicLocale.set($scope.user.locale);
}
});
}));
//when the app is ready/user is logged in, setup the data
evts.push(eventsService.on("app.ready", function (evt, data) {
$scope.authenticated = data.authenticated;
$scope.user = data.user;
updateChecker.check().then(function (update) {
if (update && update !== "null") {
if (update.type !== "None") {
var notification = {
headline: "Update available",
message: "Click to download",
sticky: true,
type: "info",
url: update.url
};
notificationsService.add(notification);
}
}
});
//if the user has changed we need to redirect to the root so they don't try to continue editing the
//last item in the URL (NOTE: the user id can equal zero, so we cannot just do !data.lastUserId since that will resolve to true)
if (data.lastUserId !== undefined && data.lastUserId !== null && data.lastUserId !== data.user.id) {
var section = appState.getSectionState("currentSection");
if (section) {
//if there's a section already assigned, reload it so the tree is cleared
navigationService.reloadSection(section);
}
$location.path("/").search("");
historyService.removeAll();
treeService.clearCache();
editorService.closeAll();
overlayService.close();
//if the user changed, clearout local storage too - could contain sensitive data
localStorageService.clearAll();
}
//if this is a new login (i.e. the user entered credentials), then clear out local storage - could contain sensitive data
if (data.loginType === "credentials") {
localStorageService.clearAll();
}
//Load locale file
if ($scope.user.locale) {
tmhDynamicLocale.set($scope.user.locale);
}
}));
// events for search
evts.push(eventsService.on("appState.searchState.changed", function (e, args) {
if (args.key === "show") {
$scope.search.show = args.value;
}
}));
// events for drawer
// manage the help dialog by subscribing to the showHelp appState
evts.push(eventsService.on("appState.drawerState.changed", function (e, args) {
// set view
if (args.key === "view") {
$scope.drawer.view = args.value;
}
// set custom model
if (args.key === "model") {
$scope.drawer.model = args.value;
}
// show / hide drawer
if (args.key === "showDrawer") {
$scope.drawer.show = args.value;
}
}));
// events for overlays
evts.push(eventsService.on("appState.overlay", function (name, args) {
$scope.overlay = args;
}));
// events for tours
evts.push(eventsService.on("appState.tour.start", function (name, args) {
$scope.tour = args;
$scope.tour.show = true;
}));
evts.push(eventsService.on("appState.tour.end", function () {
$scope.tour = null;
}));
evts.push(eventsService.on("appState.tour.complete", function () {
$scope.tour = null;
}));
// events for backdrop
evts.push(eventsService.on("appState.backdrop", function (name, args) {
$scope.backdrop = args;
}));
// event for infinite editors
evts.push(eventsService.on("appState.editors.open", function (name, args) {
$scope.infiniteMode = args && args.editors.length > 0 ? true : false;
}));
evts.push(eventsService.on("appState.editors.close", function (name, args) {
$scope.infiniteMode = args && args.editors.length > 0 ? true : false;
}));
//ensure to unregister from all events!
$scope.$on('$destroy', function () {
for (var e in evts) {
eventsService.unsubscribe(evts[e]);
}
});
}
//register it
angular.module('umbraco').controller("Umbraco.MainController", MainController).
config(function (tmhDynamicLocaleProvider) {
//Set url for locale files
tmhDynamicLocaleProvider.localeLocationPattern('lib/angular-i18n/angular-locale_{{locale}}.js');
});
@@ -1,544 +0,0 @@
/**
* @ngdoc controller
* @name Umbraco.NavigationController
* @function
*
* @description
* Handles the section area of the app
*
* @param {navigationService} navigationService A reference to the navigationService
*/
function NavigationController($scope, $rootScope, $location, $log, $q, $routeParams, $timeout, $cookies, treeService, appState, navigationService, keyboardService, historyService, eventsService, angularHelper, languageResource, contentResource, editorState) {
//this is used to trigger the tree to start loading once everything is ready
var treeInitPromise = $q.defer();
$scope.treeApi = {};
//Bind to the main tree events
$scope.onTreeInit = function () {
$scope.treeApi.callbacks.treeNodeExpanded(nodeExpandedHandler);
//when a tree is loaded into a section, we need to put it into appState
$scope.treeApi.callbacks.treeLoaded(function (args) {
appState.setTreeState("currentRootNode", args.tree);
});
//when a tree node is synced this event will fire, this allows us to set the currentNode
$scope.treeApi.callbacks.treeSynced(function (args) {
if (args.activate === undefined || args.activate === true) {
//set the current selected node
appState.setTreeState("selectedNode", args.node);
//when a node is activated, this is the same as clicking it and we need to set the
//current menu item to be this node as well.
//appState.setMenuState("currentNode", args.node);// Niels: No, we are setting it from the dialog.
}
});
//this reacts to the options item in the tree
$scope.treeApi.callbacks.treeOptionsClick(function (args) {
args.event.stopPropagation();
args.event.preventDefault();
//Set the current action node (this is not the same as the current selected node!)
//appState.setMenuState("currentNode", args.node);// Niels: No, we are setting it from the dialog.
if (args.event && args.event.altKey) {
args.skipDefault = true;
}
navigationService.showMenu(args);
});
$scope.treeApi.callbacks.treeNodeAltSelect(function (args) {
args.event.stopPropagation();
args.event.preventDefault();
args.skipDefault = true;
navigationService.showMenu(args);
});
//this reacts to tree items themselves being clicked
//the tree directive should not contain any handling, simply just bubble events
$scope.treeApi.callbacks.treeNodeSelect(function (args) {
var n = args.node;
args.event.stopPropagation();
args.event.preventDefault();
if (n.metaData && n.metaData["jsClickCallback"] && angular.isString(n.metaData["jsClickCallback"]) && n.metaData["jsClickCallback"] !== "") {
//this is a legacy tree node!
var jsPrefix = "javascript:";
var js;
if (n.metaData["jsClickCallback"].startsWith(jsPrefix)) {
js = n.metaData["jsClickCallback"].substr(jsPrefix.length);
}
else {
js = n.metaData["jsClickCallback"];
}
try {
var func = eval(js);
//this is normally not necessary since the eval above should execute the method and will return nothing.
if (func != null && (typeof func === "function")) {
func.call();
}
}
catch (ex) {
$log.error("Error evaluating js callback from legacy tree node: " + ex);
}
}
else if (n.routePath) {
//add action to the history service
historyService.add({ name: n.name, link: n.routePath, icon: n.icon });
//put this node into the tree state
appState.setTreeState("selectedNode", args.node);
//when a node is clicked we also need to set the active menu node to this node
//appState.setMenuState("currentNode", args.node);
//not legacy, lets just set the route value and clear the query string if there is one.
$location.path(n.routePath);
navigationService.clearSearch();
}
else if (n.section) {
$location.path(n.section);
navigationService.clearSearch();
}
navigationService.hideNavigation();
});
return treeInitPromise.promise;
}
//set up our scope vars
$scope.showContextMenuDialog = false;
$scope.showContextMenu = false;
$scope.showSearchResults = false;
$scope.menuDialogTitle = null;
$scope.menuActions = [];
$scope.menuNode = null;
$scope.languages = [];
$scope.selectedLanguage = {};
$scope.page = {};
$scope.page.languageSelectorIsOpen = false;
$scope.currentSection = null;
$scope.customTreeParams = null;
$scope.treeCacheKey = "_";
$scope.showNavigation = appState.getGlobalState("showNavigation");
// tracks all expanded paths so when the language is switched we can resync it with the already loaded paths
var expandedPaths = [];
//trigger search with a hotkey:
keyboardService.bind("ctrl+shift+s", function () {
navigationService.showSearch();
});
//// TODO: remove this it's not a thing
//$scope.selectedId = navigationService.currentId;
var isInit = false;
var evts = [];
//Listen for global state changes
evts.push(eventsService.on("appState.globalState.changed", function (e, args) {
if (args.key === "showNavigation") {
$scope.showNavigation = args.value;
}
}));
//Listen for menu state changes
evts.push(eventsService.on("appState.menuState.changed", function (e, args) {
if (args.key === "showMenuDialog") {
$scope.showContextMenuDialog = args.value;
}
if (args.key === "dialogTemplateUrl") {
$scope.dialogTemplateUrl = args.value;
}
if (args.key === "showMenu") {
$scope.showContextMenu = args.value;
}
if (args.key === "dialogTitle") {
$scope.menuDialogTitle = args.value;
}
if (args.key === "menuActions") {
$scope.menuActions = args.value;
}
if (args.key === "currentNode") {
$scope.menuNode = args.value;
}
}));
//Listen for tree state changes
evts.push(eventsService.on("appState.treeState.changed", function (e, args) {
if (args.key === "currentRootNode") {
//if the changed state is the currentRootNode, determine if this is a full screen app
if (args.value.root && args.value.root.containsTrees === false) {
$rootScope.emptySection = true;
}
else {
$rootScope.emptySection = false;
}
}
}));
//Listen for section state changes
evts.push(eventsService.on("appState.sectionState.changed", function (e, args) {
//section changed
if (args.key === "currentSection" && $scope.currentSection != args.value) {
//before loading the main tree we need to ensure that the nav is ready
navigationService.waitForNavReady().then(() => {
$scope.currentSection = args.value;
//load the tree
configureTreeAndLanguages();
$scope.treeApi.load({ section: $scope.currentSection, customTreeParams: $scope.customTreeParams, cacheKey: $scope.treeCacheKey });
});
}
//show/hide search results
if (args.key === "showSearchResults") {
$scope.showSearchResults = args.value;
}
}));
// Listen for language updates
evts.push(eventsService.on("editors.languages.languageDeleted", function (e, args) {
loadLanguages().then(function (languages) {
$scope.languages = languages;
const defaultCulture = $scope.languages[0].culture;
if (args.language.culture === $scope.selectedLanguage.culture) {
$scope.selectedLanguage = defaultCulture;
if ($scope.languages.length > 1) {
$location.search("mculture", defaultCulture);
} else {
$location.search("mculture", null);
}
var currentEditorState = editorState.getCurrent();
if (currentEditorState && currentEditorState.path) {
$scope.treeApi.syncTree({ path: currentEditorState.path, activate: true });
}
}
});
}));
//Emitted when a language is created or an existing one saved/edited
evts.push(eventsService.on("editors.languages.languageSaved", function (e, args) {
if(args.isNew){
//A new language has been created - reload languages for tree
loadLanguages().then(function (languages) {
$scope.languages = languages;
});
}
else if(args.language.isDefault){
//A language was saved and was set to be the new default (refresh the tree, so its at the top)
loadLanguages().then(function (languages) {
$scope.languages = languages;
});
}
}));
//when a user logs out or timesout
evts.push(eventsService.on("app.notAuthenticated", function () {
$scope.authenticated = false;
}));
//when the application is ready and the user is authorized, setup the data
//this will occur anytime a new user logs in!
evts.push(eventsService.on("app.ready", function (evt, data) {
$scope.authenticated = true;
ensureInit();
}));
// event for infinite editors
evts.push(eventsService.on("appState.editors.open", function (name, args) {
$scope.infiniteMode = args && args.editors.length > 0 ? true : false;
}));
evts.push(eventsService.on("appState.editors.close", function (name, args) {
$scope.infiniteMode = args && args.editors.length > 0 ? true : false;
}));
evts.push(eventsService.on("treeService.removeNode", function (e, args) {
//check to see if the current page has been removed
var currentEditorState = editorState.getCurrent();
if (currentEditorState && currentEditorState.id.toString() === args.node.id.toString()) {
//current page is loaded, so navigate to root
var section = appState.getSectionState("currentSection");
$location.path("/" + section);
}
}));
/**
* Based on the current state of the application, this configures the scope variables that control the main tree and language drop down
*/
function configureTreeAndLanguages() {
//create the custom query string param for this tree, this is currently only relevant for content
if ($scope.currentSection === "content") {
//must use $location here because $routeParams isn't available until after the route change
var mainCulture = $location.search().mculture;
//select the current language if set in the query string
if (mainCulture && $scope.languages && $scope.languages.length > 1) {
var found = _.find($scope.languages, function (l) {
if (mainCulture === true) {
return false;
}
return l.culture.toLowerCase() === mainCulture.toLowerCase();
});
if (found) {
//set the route param
found.active = true;
$scope.selectedLanguage = found;
}
}
var queryParams = {};
if ($scope.selectedLanguage && $scope.selectedLanguage.culture) {
queryParams["culture"] = $scope.selectedLanguage.culture;
}
var queryString = $.param(queryParams); //create the query string from the params object
}
if (queryString) {
$scope.customTreeParams = queryString;
$scope.treeCacheKey = queryString; // this tree uses caching but we need to change it's cache key per lang
}
else {
$scope.treeCacheKey = "_"; // this tree uses caching, there's no lang selected so use the default
}
}
/**
* Called when the app is ready and sets up the navigation (should only be called once)
*/
function ensureInit() {
//only run once ever!
if (isInit) {
return;
}
isInit = true;
var navInit = false;
//$routeParams will be populated after $routeChangeSuccess since this controller is used outside ng-view,
//* we listen for the first route change with a section to setup the navigation.
//* we listen for all route changes to track the current section.
$rootScope.$on('$routeChangeSuccess', function () {
//only continue if there's a section available
if ($routeParams.section) {
if (!navInit) {
navInit = true;
initNav();
}
//keep track of the current section when it changes
if ($scope.currentSection != $routeParams.section) {
appState.setSectionState("currentSection", $routeParams.section);
}
}
});
}
/**
* This loads the language data, if the are no variant content types configured this will return no languages
*/
function loadLanguages() {
return contentResource.allowsCultureVariation().then(function (b) {
if (b === true) {
return languageResource.getAll();
} else {
return $q.when([]); //resolve an empty collection
}
});
}
/**
* Called once during init to initialize the navigation/tree/languages
*/
function initNav() {
// load languages
loadLanguages().then(function (languages) {
$scope.languages = languages;
if ($scope.languages.length > 1) {
//if there's already one set, check if it exists
var currCulture = null;
var mainCulture = $location.search().mculture;
if (mainCulture) {
currCulture = _.find($scope.languages, function (l) {
return l.culture.toLowerCase() === mainCulture.toLowerCase();
});
}
if (!currCulture) {
// no culture in the request, let's look for one in the cookie that's set when changing language
var defaultCulture = $cookies.get("UMB_MCULTURE");
if (!defaultCulture || !_.find($scope.languages, function (l) {
return l.culture.toLowerCase() === defaultCulture.toLowerCase();
})) {
// no luck either, look for the default language
var defaultLang = _.find($scope.languages, function (l) {
return l.isDefault;
});
if (defaultLang) {
defaultCulture = defaultLang.culture;
}
}
$location.search("mculture", defaultCulture ? defaultCulture : null);
}
}
$scope.currentSection = $routeParams.section;
configureTreeAndLanguages();
//resolve the tree promise, set it's property values for loading the tree which will make the tree load
treeInitPromise.resolve({
section: $scope.currentSection,
customTreeParams: $scope.customTreeParams,
cacheKey: $scope.treeCacheKey,
//because angular doesn't return a promise for the resolve method, we need to resort to some hackery, else
//like normal JS promises we could do resolve(...).then()
onLoaded: function () {
//the nav is ready, let the app know
eventsService.emit("app.navigationReady", { treeApi: $scope.treeApi });
}
});
});
}
function nodeExpandedHandler(args) {
//store the reference to the expanded node path
if (args.node) {
treeService._trackExpandedPaths(args.node, expandedPaths);
}
}
$scope.selectLanguage = function (language) {
$location.search("mculture", language.culture);
// add the selected culture to a cookie so the user will log back into the same culture later on (cookie lifetime = one year)
var expireDate = new Date();
expireDate.setDate(expireDate.getDate() + 365);
$cookies.put("UMB_MCULTURE", language.culture, {path: "/", expires: expireDate});
// close the language selector
$scope.page.languageSelectorIsOpen = false;
configureTreeAndLanguages(); //re-bind language to the query string and update the tree params
//reload the tree with it's updated querystring args
$scope.treeApi.load({ section: $scope.currentSection, customTreeParams: $scope.customTreeParams, cacheKey: $scope.treeCacheKey }).then(function () {
//re-sync to currently edited node
var currNode = appState.getTreeState("selectedNode");
//create the list of promises
var promises = [];
//starting with syncing to the currently selected node if there is one
if (currNode) {
var path = treeService.getPath(currNode);
promises.push($scope.treeApi.syncTree({ path: path, activate: true }));
}
// TODO: If we want to keep all paths expanded ... but we need more testing since we need to deal with unexpanding
//for (var i = 0; i < expandedPaths.length; i++) {
// promises.push($scope.treeApi.syncTree({ path: expandedPaths[i], activate: false, forceReload: true }));
//}
//execute them sequentially
// set selected language to active
angular.forEach($scope.languages, function(language){
language.active = false;
});
language.active = true;
angularHelper.executeSequentialPromises(promises);
});
};
//this reacts to the options item in the tree
// TODO: migrate to nav service
// TODO: is this used?
$scope.searchShowMenu = function (ev, args) {
//always skip default
args.skipDefault = true;
navigationService.showMenu(args);
};
// TODO: migrate to nav service
// TODO: is this used?
$scope.searchHide = function () {
navigationService.hideSearch();
};
//the below assists with hiding/showing the tree
var treeActive = false;
//Sets a service variable as soon as the user hovers the navigation with the mouse
//used by the leaveTree method to delay hiding
$scope.enterTree = function (event) {
treeActive = true;
};
// Hides navigation tree, with a short delay, is cancelled if the user moves the mouse over the tree again
$scope.leaveTree = function (event) {
//this is a hack to handle IE touch events which freaks out due to no mouse events so the tree instantly shuts down
if (!event) {
return;
}
closeTree();
};
$scope.onOutsideClick = function() {
closeTree();
};
function closeTree() {
if (!appState.getGlobalState("touchDevice")) {
treeActive = false;
$timeout(function () {
if (!treeActive) {
navigationService.hideTree();
}
}, 300);
}
}
$scope.toggleLanguageSelector = function () {
$scope.page.languageSelectorIsOpen = !$scope.page.languageSelectorIsOpen;
};
//ensure to unregister from all events!
$scope.$on('$destroy', function () {
for (var e in evts) {
eventsService.unsubscribe(evts[e]);
}
});
}
//register it
angular.module('umbraco').controller("Umbraco.NavigationController", NavigationController);
@@ -20,7 +20,7 @@ namespace Umbraco.Web.HealthCheck.NotificationMethods
public EmailNotificationMethod(ILocalizedTextService textService, IRuntimeState runtimeState, ILogger logger)
{
var recipientEmail = Settings["recipientEmail"]?.Value;
var recipientEmail = Settings?["recipientEmail"]?.Value;
if (string.IsNullOrWhiteSpace(recipientEmail))
{
Enabled = false;
+17 -11
View File
@@ -243,21 +243,27 @@ namespace Umbraco.Web
}
}
if (!lengthReached && currentTextLength >= length)
if (!lengthReached)
{
// if the last character added was the first of a two character unicode pair, add the second character
if (Char.IsHighSurrogate((char)ic))
if (currentTextLength == length)
{
var lowSurrogate = tr.Read();
outputtw.Write((char)lowSurrogate);
}
// if the last character added was the first of a two character unicode pair, add the second character
if (char.IsHighSurrogate((char)ic))
{
var lowSurrogate = tr.Read();
outputtw.Write((char)lowSurrogate);
}
// Reached truncate limit.
if (addElipsis)
{
outputtw.Write(hellip);
}
lengthReached = true;
// only add elipsis if current length greater than original length
if (currentTextLength > length)
{
if (addElipsis)
{
outputtw.Write(hellip);
}
lengthReached = true;
}
}
}
+13 -6
View File
@@ -40,12 +40,18 @@ namespace Umbraco.Web.Macros
#region MacroContent cache
// gets this macro content cache identifier
private string GetContentCacheIdentifier(MacroModel model, int pageId)
private string GetContentCacheIdentifier(MacroModel model, int pageId, string cultureName)
{
var id = new StringBuilder();
var alias = model.Alias;
id.AppendFormat("{0}-", alias);
//always add current culture to the key to allow variants to have different cache results
if (!string.IsNullOrEmpty(cultureName))
{
// are there any unusual culture formats we'd need to handle?
id.AppendFormat("{0}-", cultureName);
}
if (model.CacheByPage)
id.AppendFormat("{0}-", pageId);
@@ -190,7 +196,7 @@ namespace Umbraco.Web.Macros
? macroParams[key]?.ToString() ?? string.Empty
: string.Empty;
}
}
}
#endregion
#region Render/Execute
@@ -221,7 +227,8 @@ namespace Umbraco.Web.Macros
foreach (var prop in macro.Properties)
prop.Value = ParseAttribute(pageElements, prop.Value);
macro.CacheIdentifier = GetContentCacheIdentifier(macro, content.Id);
var cultureName = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;
macro.CacheIdentifier = GetContentCacheIdentifier(macro, content.Id, cultureName);
// get the macro from cache if it is there
var macroContent = GetMacroContentFromCache(macro);
@@ -317,7 +324,7 @@ namespace Umbraco.Web.Macros
private Attempt<MacroContent> ExecuteMacroOfType(MacroModel model, IPublishedContent content)
{
if (model == null) throw new ArgumentNullException(nameof(model));
// ensure that we are running against a published node (ie available in XML)
// that may not be the case if the macro is embedded in a RTE of an unpublished document
@@ -453,9 +460,9 @@ namespace Umbraco.Web.Macros
return value;
}
#endregion
}
}
@@ -111,7 +111,7 @@ namespace Umbraco.Web.Models.PublishedContent
var propertyType = content.ContentType.GetPropertyType(alias);
if (propertyType != null)
{
_variationContextAccessor.ContextualizeVariation(propertyType.Variations, ref culture, ref segment);
_variationContextAccessor.ContextualizeVariation(propertyType.Variations, content.Id, ref culture, ref segment);
noValueProperty = content.GetProperty(alias);
}
@@ -168,7 +168,7 @@ namespace Umbraco.Web.Models.PublishedContent
{
culture = null;
segment = null;
_variationContextAccessor.ContextualizeVariation(propertyType.Variations, ref culture, ref segment);
_variationContextAccessor.ContextualizeVariation(propertyType.Variations, content.Id, ref culture, ref segment);
}
property = content?.GetProperty(alias);
@@ -48,7 +48,7 @@ namespace Umbraco.Web.PropertyEditors
internal static bool IsValidFileExtension(string fileName)
{
if (fileName.IndexOf('.') <= 0) return false;
var extension = new FileInfo(fileName).Extension.TrimStart(".");
var extension = fileName.GetFileExtension().TrimStart(".");
return Current.Configs.Settings().Content.IsFileAllowedForUpload(extension);
}
}
@@ -355,6 +355,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
private static IEnumerable<IPublishedContent> GetByXPath(XPathNodeIterator iterator)
{
iterator = iterator.Clone();
while (iterator.MoveNext())
{
var xnav = iterator.Current as NavigableNavigator;
@@ -90,7 +90,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
// determines whether a property has value
public override bool HasValue(string culture = null, string segment = null)
{
_content.VariationContextAccessor.ContextualizeVariation(_variations, ref culture, ref segment);
_content.VariationContextAccessor.ContextualizeVariation(_variations, _content.Id, ref culture, ref segment);
var value = GetSourceValue(culture, segment);
var hasValue = PropertyType.IsValue(value, PropertyValueLevel.Source);
@@ -194,7 +194,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
public override object GetSourceValue(string culture = null, string segment = null)
{
_content.VariationContextAccessor.ContextualizeVariation(_variations, ref culture, ref segment);
_content.VariationContextAccessor.ContextualizeVariation(_variations, _content.Id, ref culture, ref segment);
if (culture == "" && segment == "")
return _sourceValue;
@@ -208,7 +208,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
public override object GetValue(string culture = null, string segment = null)
{
_content.VariationContextAccessor.ContextualizeVariation(_variations, ref culture, ref segment);
_content.VariationContextAccessor.ContextualizeVariation(_variations, _content.Id, ref culture, ref segment);
object value;
lock (_locko)
@@ -229,7 +229,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
public override object GetXPathValue(string culture = null, string segment = null)
{
_content.VariationContextAccessor.ContextualizeVariation(_variations, ref culture, ref segment);
_content.VariationContextAccessor.ContextualizeVariation(_variations, _content.Id, ref culture, ref segment);
lock (_locko)
{
@@ -687,7 +687,7 @@ namespace Umbraco.Web
/// <param name="culture">The specific culture to filter for. If null is used the current culture is used. (Default is null)</param>
/// <returns></returns>
/// <remarks>
/// This can be useful in order to return all nodes in an entire site by a type when combined with TypedContentAtRoot
/// This can be useful in order to return all nodes in an entire site by a type when combined with <see cref="UmbracoHelper.ContentAtRoot"/> or similar.
/// </remarks>
public static IEnumerable<IPublishedContent> DescendantsOrSelfOfType(this IEnumerable<IPublishedContent> parentNodes, string docTypeAlias, string culture = null)
{
@@ -701,7 +701,7 @@ namespace Umbraco.Web
/// <param name="culture">The specific culture to filter for. If null is used the current culture is used. (Default is null)</param>
/// <returns></returns>
/// <remarks>
/// This can be useful in order to return all nodes in an entire site by a type when combined with TypedContentAtRoot
/// This can be useful in order to return all nodes in an entire site by a type when combined with <see cref="UmbracoHelper.ContentAtRoot"/> or similar.
/// </remarks>
public static IEnumerable<T> DescendantsOrSelf<T>(this IEnumerable<IPublishedContent> parentNodes, string culture = null)
where T : class, IPublishedContent
@@ -23,7 +23,7 @@ namespace Umbraco.Web.Security
string[] defaultUserGroups = null,
string defaultCulture = null)
{
_defaultUserGroups = defaultUserGroups ?? new[] { "editor" };
_defaultUserGroups = defaultUserGroups ?? new[] { Constants.Security.EditorGroupAlias };
_autoLinkExternalAccount = autoLinkExternalAccount;
_defaultCulture = defaultCulture ?? Current.Configs.Global().DefaultUILanguage;
}
@@ -32,7 +32,7 @@ namespace Umbraco.Web.Security.Providers
}
private readonly IMemberTypeService _memberTypeService;
private string _defaultMemberTypeAlias = "writer";
private string _defaultMemberTypeAlias = Constants.Security.WriterGroupAlias;
private volatile bool _hasDefaultMember = false;
private static readonly object Locker = new object();
+1 -1
View File
@@ -61,7 +61,7 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ClientDependency" Version="1.9.8" />
<PackageReference Include="ClientDependency" Version="1.9.9" />
<PackageReference Include="CSharpTest.Net.Collections" Version="14.906.1403.1082" />
<PackageReference Include="Examine" Version="1.0.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.8.14" />