Compare commits
225 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 244ee646b9 | |||
| b487436d93 | |||
| 321b1a3964 | |||
| f6b1971243 | |||
| ab1e412b4b | |||
| 2c866e8326 | |||
| 433563c10b | |||
| 95b91cb55f | |||
| d070b869a3 | |||
| 82bcb8bb8a | |||
| 8cbd0281aa | |||
| 148067f119 | |||
| 9d79577833 | |||
| c24918aeb7 | |||
| f7a814714c | |||
| 3200a7fd1a | |||
| 7983aedf53 | |||
| c31efa3f54 | |||
| c98a98dd71 | |||
| ee3965521d | |||
| 3d90c0d3d7 | |||
| bc60aa1688 | |||
| 5c90043298 | |||
| 0f784151cb | |||
| 681512da8c | |||
| b17770d6c7 | |||
| 745b536f63 | |||
| 738289cd78 | |||
| 77d30e8484 | |||
| 347fb3a90d | |||
| 39bdc1bc78 | |||
| a3dcdb159b | |||
| 9656659ecd | |||
| d679a4e697 | |||
| c81a034c69 | |||
| a519d38b54 | |||
| cf4c09f41f | |||
| bd3096c3ec | |||
| 1bbf104b9f | |||
| 4f1e44d42e | |||
| fa68a9472b | |||
| efb2b744fc | |||
| 9018c4ef79 | |||
| dfce0aa0cb | |||
| 131c9a6fe1 | |||
| 555589ef3b | |||
| b099d35981 | |||
| e3bc3091f7 | |||
| 320ed93b14 | |||
| c71ce7ef2a | |||
| c0ea46c9f1 | |||
| 533443fd25 | |||
| e76658373f | |||
| a77330a592 | |||
| 2f5e9ee8c4 | |||
| f252590a1c | |||
| fa4bdac78a | |||
| e268945077 | |||
| b428fb2211 | |||
| bfc098e5e0 | |||
| d9b58e80fe | |||
| a7a860bbcd | |||
| fa277a4a5d | |||
| 7e1df76db3 | |||
| 9c33e292ae | |||
| 75edd645c6 | |||
| 6adfdbf7dd | |||
| 5453d86a46 | |||
| 6d4146b9c6 | |||
| a93d98933f | |||
| cf28c0ca5e | |||
| 435434b859 | |||
| e93b057a5f | |||
| e8d167faf0 | |||
| ab1322f789 | |||
| 36abb83ff2 | |||
| 0d62e62fda | |||
| d25a01d9c9 | |||
| 1da55e4dde | |||
| c346ec1282 | |||
| 556d4b4c11 | |||
| 7d0d58f7c2 | |||
| a0618f401f | |||
| 34645460fb | |||
| 43b534c3b1 | |||
| bc29b2e235 | |||
| d6c226d41a | |||
| 14d8b634b5 | |||
| c4e41c1df6 | |||
| 788efeb098 | |||
| 71916af49c | |||
| 55e62c01e4 | |||
| fa8dc5ace4 | |||
| 671d99f455 | |||
| d681a84800 | |||
| 440e2a7d56 | |||
| 2f8ec7bd29 | |||
| 5105cf890d | |||
| 88a0f21328 | |||
| cd1ea78825 | |||
| ca4ff98c5f | |||
| 339e1dc94e | |||
| a84c6e9dff | |||
| ba927d1962 | |||
| ee30f10357 | |||
| 478fe51651 | |||
| 5694beafef | |||
| 2a1e9e30ae | |||
| ef5bf29b07 | |||
| 7b521e6857 | |||
| 4135e30834 | |||
| 2b1bf0b966 | |||
| 6bc2ce19f5 | |||
| 67efc1906a | |||
| 8b62d09e64 | |||
| 5c6bbfb423 | |||
| 97ff32245d | |||
| b7549ad644 | |||
| 802fe45614 | |||
| 253a4520b0 | |||
| b6877dc4ce | |||
| 27a031ea12 | |||
| 0e2212bd40 | |||
| 8ee414793f | |||
| 1dddc06ae7 | |||
| 3d253b79e4 | |||
| e7542bc455 | |||
| 43ab5a8e2e | |||
| 05c35b22bd | |||
| f6318fb6f3 | |||
| 17b29357d4 | |||
| 57a766098d | |||
| f78cb8a970 | |||
| def276de01 | |||
| 293b170a56 | |||
| 6ba4efc416 | |||
| 981fb39af6 | |||
| c64f6f894e | |||
| 3e73c2da43 | |||
| 26a8d23039 | |||
| 2632ef740c | |||
| f024dba864 | |||
| 9758851a4b | |||
| 38e56f0fea | |||
| 462baf91e4 | |||
| f1366c7d29 | |||
| baaa9340e4 | |||
| 183a5b5c43 | |||
| 1a0c095f40 | |||
| ffada74aa4 | |||
| f2fc70f731 | |||
| 866b0113e7 | |||
| 06c49daca7 | |||
| 9293008b94 | |||
| dbb9386d22 | |||
| 51ed441b85 | |||
| f566fec665 | |||
| 9d92781a97 | |||
| 123bfe5afe | |||
| 3383d2a2ac | |||
| d9f38a20af | |||
| a91669abc0 | |||
| cc6dfd0c55 | |||
| d4802fcef6 | |||
| 35c3208b77 | |||
| 3b9db8a92f | |||
| 7debe17c58 | |||
| 1bfc1229bd | |||
| f941456af6 | |||
| 828e88e6f2 | |||
| 3d6fd2d785 | |||
| e56881abc6 | |||
| d32991c30a | |||
| 8758f9649b | |||
| 07902e840f | |||
| e807ee7d64 | |||
| 6f0f1ab2c3 | |||
| cd28240172 | |||
| 85ca85fd42 | |||
| 4a10178697 | |||
| ccba7f14a0 | |||
| b797e0d0c5 | |||
| 8220b033f3 | |||
| 6fffc8b45e | |||
| b550b3dde3 | |||
| 7002291c41 | |||
| 51bbf7ceb5 | |||
| 93d9f09fcc | |||
| 42a68cb770 | |||
| 1c2dec00fc | |||
| fcea4c7fdd | |||
| b6ef4bf6b5 | |||
| 82297a6ff1 | |||
| 3bf79f0a23 | |||
| 3f5aa3aa2b | |||
| cc5ac1a84c | |||
| 6373add383 | |||
| 180099b718 | |||
| 65f15125e1 | |||
| f026201c68 | |||
| 640b2c0ee0 | |||
| bef7ad1196 | |||
| 33c6c8b473 | |||
| 0a26e482aa | |||
| d0de54e2d3 | |||
| cbdabaa3b1 | |||
| 65c97040b3 | |||
| a33d7da211 | |||
| f31b6d9c2c | |||
| 367c945b42 | |||
| b962fcdbc3 | |||
| 0f8a13d60a | |||
| 5c1502c806 | |||
| 3cdebf4427 | |||
| 44f2a9e96f | |||
| ae85b7bf2b | |||
| b52c480da3 | |||
| dada91f006 | |||
| 348694d9d4 | |||
| 855e3b3dcc | |||
| 5a8ea4aa41 | |||
| 4bd465f666 | |||
| ad591c07cf | |||
| cd3aaa47ca | |||
| a05cc03254 |
@@ -15,11 +15,11 @@ If you're interested in making changes to Belle make sure to read the [Belle Rea
|
||||
|
||||
**More than 177,000 sites trust Umbraco**
|
||||
|
||||
For the first time on the Microsoft platform a free user and developer friendly CMS that makes it quick and easy to create websites - or a breeze to build complex web applications. Umbraco has award-winning integration capabilities and supports ASP.NET MVC or Web Forms, including User and Custom Controls, out of the box. It's a developers dream and your users will love it too.
|
||||
For the first time on the Microsoft platform, there is a free user and developer friendly CMS that makes it quick and easy to create websites - or a breeze to build complex web applications. Umbraco has award-winning integration capabilities and supports ASP.NET MVC or Web Forms, including User and Custom Controls, out of the box. It's a developer's dream and your users will love it too.
|
||||
|
||||
Used by more than 177,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)) you can be sure that the technology is proven, stable and scales.
|
||||
Used by more than 177,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)), you can be sure that the technology is proven, stable and scales.
|
||||
|
||||
To view more examples please visit [http://umbraco.com/why-umbraco/#caseStudies](http://umbraco.com/why-umbraco/#caseStudies)
|
||||
To view more examples, please visit [http://umbraco.com/why-umbraco/#caseStudies](http://umbraco.com/why-umbraco/#caseStudies)
|
||||
|
||||
## Downloading ##
|
||||
|
||||
@@ -35,6 +35,6 @@ If you want to contribute back to Umbraco you should check out our [guide to con
|
||||
|
||||
## Found a bug? ##
|
||||
|
||||
Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our [online guide for reporting issues](http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature).
|
||||
Another way you can contribute to Umbraco is by providing issue reports. For information on how to submit an issue report refer to our [online guide for reporting issues](http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature).
|
||||
|
||||
To view existing issues please visit [http://issues.umbraco.org](http://issues.umbraco.org)
|
||||
To view existing issues, please visit [http://issues.umbraco.org](http://issues.umbraco.org).
|
||||
|
||||
+2
-2
@@ -175,8 +175,8 @@
|
||||
<!-- Copy SQL CE -->
|
||||
<ItemGroup>
|
||||
<SQLCE4Files
|
||||
Include="..\src\packages\SqlServerCE.4.0.0.0\**\*.*"
|
||||
Exclude="..\src\packages\SqlServerCE.4.0.0.0\lib\**\*;..\src\packages\SqlServerCE.4.0.0.0\**\*.nu*"
|
||||
Include="..\src\packages\SqlServerCE.4.0.0.1\**\*.*"
|
||||
Exclude="..\src\packages\SqlServerCE.4.0.0.1\lib\**\*;..\src\packages\SqlServerCE.4.0.0.1\**\*.nu*"
|
||||
/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
|
||||
7.4.0
|
||||
7.4.1
|
||||
@@ -47,13 +47,15 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net40" />
|
||||
<package id="SqlServerCE" version="4.0.0.1" targetFramework="net45" />
|
||||
</packages>
|
||||
+2
-2
@@ -11,5 +11,5 @@ using System.Resources;
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyFileVersion("7.4.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.4.0")]
|
||||
[assembly: AssemblyFileVersion("7.4.1")]
|
||||
[assembly: AssemblyInformationalVersion("7.4.1")]
|
||||
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
public class UmbracoVersion
|
||||
{
|
||||
private static readonly Version Version = new Version("7.4.0");
|
||||
private static readonly Version Version = new Version("7.4.1");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current version of Umbraco.
|
||||
|
||||
@@ -10,6 +10,12 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
public static class Web
|
||||
{
|
||||
public const string UmbracoContextDataToken = "umbraco-context";
|
||||
public const string UmbracoDataToken = "umbraco";
|
||||
public const string PublishedDocumentRequestDataToken = "umbraco-doc-request";
|
||||
public const string CustomRouteDataToken = "umbraco-custom-route";
|
||||
public const string UmbracoRouteDefinitionDataToken = "umbraco-route-def";
|
||||
|
||||
/// <summary>
|
||||
/// The preview cookie name
|
||||
/// </summary>
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Caching;
|
||||
using System.Web.UI;
|
||||
using Umbraco.Core.Cache;
|
||||
|
||||
namespace Umbraco.Core.Models.PublishedContent
|
||||
@@ -16,6 +13,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
public class PublishedContentType
|
||||
{
|
||||
private readonly PublishedPropertyType[] _propertyTypes;
|
||||
private readonly HashSet<string> _compositionAliases;
|
||||
|
||||
// fast alias-to-index xref containing both the raw alias and its lowercase version
|
||||
private readonly Dictionary<string, int> _indexes = new Dictionary<string, int>();
|
||||
@@ -27,6 +25,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
{
|
||||
Id = contentType.Id;
|
||||
Alias = contentType.Alias;
|
||||
_compositionAliases = new HashSet<string>(contentType.CompositionAliases(), StringComparer.InvariantCultureIgnoreCase);
|
||||
_propertyTypes = contentType.CompositionPropertyTypes
|
||||
.Select(x => new PublishedPropertyType(this, x))
|
||||
.ToArray();
|
||||
@@ -34,10 +33,11 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
}
|
||||
|
||||
// internal so it can be used for unit tests
|
||||
internal PublishedContentType(int id, string alias, IEnumerable<PublishedPropertyType> propertyTypes)
|
||||
internal PublishedContentType(int id, string alias, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes)
|
||||
{
|
||||
Id = id;
|
||||
Alias = alias;
|
||||
_compositionAliases = new HashSet<string>(compositionAliases, StringComparer.InvariantCultureIgnoreCase);
|
||||
_propertyTypes = propertyTypes.ToArray();
|
||||
foreach (var propertyType in _propertyTypes)
|
||||
propertyType.ContentType = this;
|
||||
@@ -45,8 +45,8 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
}
|
||||
|
||||
// create detached content type - ie does not match anything in the DB
|
||||
internal PublishedContentType(string alias, IEnumerable<PublishedPropertyType> propertyTypes)
|
||||
: this (0, alias, propertyTypes)
|
||||
internal PublishedContentType(string alias, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes)
|
||||
: this(0, alias, compositionAliases, propertyTypes)
|
||||
{ }
|
||||
|
||||
private void InitializeIndexes()
|
||||
@@ -63,6 +63,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
|
||||
public int Id { get; private set; }
|
||||
public string Alias { get; private set; }
|
||||
public HashSet<string> CompositionAliases { get { return _compositionAliases; } }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
+11
-1
@@ -20,7 +20,17 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer
|
||||
if (columns.Any(x => x.TableName.InvariantEquals("cmsPropertyTypeGroup") && x.ColumnName.InvariantEquals("parentGroupId")) == false)
|
||||
return;
|
||||
|
||||
Delete.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id").OnTable("cmsPropertyTypeGroup");
|
||||
//This constraing can be based on old aliases, before removing them, check they exist
|
||||
var constraints = SqlSyntax.GetConstraintsPerColumn(Context.Database).Distinct().ToArray();
|
||||
if (constraints.Any(x => x.Item1.InvariantEquals("cmsPropertyTypeGroup") && x.Item3.InvariantEquals("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id")))
|
||||
{
|
||||
Delete.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id").OnTable("cmsPropertyTypeGroup");
|
||||
}
|
||||
if (constraints.Any(x => x.Item1.InvariantEquals("cmsPropertyTypeGroup") && x.Item3.InvariantEquals("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup")))
|
||||
{
|
||||
Delete.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup").OnTable("cmsPropertyTypeGroup");
|
||||
}
|
||||
|
||||
Delete.Column("parentGroupId").FromTable("cmsPropertyTypeGroup");
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace Umbraco.Core.Persistence.SqlSyntax
|
||||
GuidColumnDefinition = "char(36)";
|
||||
|
||||
DefaultValueFormat = "DEFAULT {0}";
|
||||
|
||||
InitColumnTypeMap();
|
||||
}
|
||||
|
||||
public override IEnumerable<string> GetTablesInSchema(Database db)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
|
||||
namespace Umbraco.Core.PropertyEditors.ValueConverters
|
||||
{
|
||||
/// <summary>
|
||||
/// We need this property converter so that we always force the value of a label to be a string
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Without a property converter defined for the label type, the value will be converted with
|
||||
/// the `ConvertUsingDarkMagic` method which will try to parse the value into it's correct type, but this
|
||||
/// can cause issues if the string is detected as a number and then strips leading zeros.
|
||||
/// Example: http://issues.umbraco.org/issue/U4-7929
|
||||
/// </remarks>
|
||||
[DefaultPropertyValueConverter]
|
||||
[PropertyValueType(typeof (string))]
|
||||
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
|
||||
public class LabelValueConverter : PropertyValueConverterBase
|
||||
{
|
||||
public override bool IsConverter(PublishedPropertyType propertyType)
|
||||
{
|
||||
return Constants.PropertyEditors.NoEditAlias.Equals(propertyType.PropertyEditorAlias);
|
||||
}
|
||||
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
|
||||
{
|
||||
return source == null ? string.Empty : source.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,12 @@ namespace Umbraco.Core.Services
|
||||
/// </returns>
|
||||
public Attempt<OperationStatus<ITemplate, OperationStatusType>> CreateTemplateForContentType(string contentTypeAlias, string contentTypeName, int userId = 0)
|
||||
{
|
||||
var template = new Template(contentTypeName, contentTypeAlias);
|
||||
var template = new Template(contentTypeName,
|
||||
//NOTE: We are NOT passing in the content type alias here, we want to use it's name since we don't
|
||||
// want to save template file names as camelCase, the Template ctor will clean the alias as
|
||||
// `alias.ToCleanString(CleanStringType.UnderscoreAlias)` which has been the default.
|
||||
// This fixes: http://issues.umbraco.org/issue/U4-7953
|
||||
contentTypeName);
|
||||
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
|
||||
|
||||
@@ -102,13 +102,13 @@
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data.Entity" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
@@ -478,6 +478,7 @@
|
||||
<Compile Include="PropertyEditors\DecimalValidator.cs" />
|
||||
<Compile Include="PropertyEditors\ValueConverters\GridValueConverter.cs" />
|
||||
<Compile Include="PropertyEditors\ValueConverters\DecimalValueConverter.cs" />
|
||||
<Compile Include="PropertyEditors\ValueConverters\LabelValueConverter.cs" />
|
||||
<Compile Include="PropertyEditors\ValueConverters\ImageCropperValueConverter.cs" />
|
||||
<Compile Include="Publishing\UnPublishedStatusType.cs" />
|
||||
<Compile Include="Publishing\UnPublishStatus.cs" />
|
||||
|
||||
@@ -15,5 +15,5 @@
|
||||
<package id="Owin" version="1.0" targetFramework="net45" />
|
||||
<package id="semver" version="1.1.2" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net4" />
|
||||
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net4" />
|
||||
<package id="SqlServerCE" version="4.0.0.1" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -72,7 +72,7 @@
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="System.Data.SqlServerCe.4.0" />
|
||||
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
|
||||
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
|
||||
<remove invariant="MySql.Data.MySqlClient" />
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
</DbProviderFactories>
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
|
||||
{
|
||||
for (var i = 1; i < 11; i++)
|
||||
{
|
||||
Web.Cache.DistributedCache.Instance.Refresh(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), i);
|
||||
global::Umbraco.Web.Cache.DistributedCache.Instance.Refresh(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), i);
|
||||
}
|
||||
Assert.AreEqual(10, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).IntIdsRefreshed.Count);
|
||||
}
|
||||
@@ -52,7 +52,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
|
||||
{
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
Web.Cache.DistributedCache.Instance.Refresh(
|
||||
global::Umbraco.Web.Cache.DistributedCache.Instance.Refresh(
|
||||
Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"),
|
||||
x => x.Id,
|
||||
new TestObjectWithId{Id = i});
|
||||
@@ -65,7 +65,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
|
||||
{
|
||||
for (var i = 0; i < 11; i++)
|
||||
{
|
||||
Web.Cache.DistributedCache.Instance.Refresh(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), Guid.NewGuid());
|
||||
global::Umbraco.Web.Cache.DistributedCache.Instance.Refresh(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), Guid.NewGuid());
|
||||
}
|
||||
Assert.AreEqual(11, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).GuidIdsRefreshed.Count);
|
||||
}
|
||||
@@ -75,7 +75,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
|
||||
{
|
||||
for (var i = 1; i < 13; i++)
|
||||
{
|
||||
Web.Cache.DistributedCache.Instance.Remove(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), i);
|
||||
global::Umbraco.Web.Cache.DistributedCache.Instance.Remove(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), i);
|
||||
}
|
||||
Assert.AreEqual(12, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).IntIdsRemoved.Count);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
|
||||
{
|
||||
for (var i = 0; i < 13; i++)
|
||||
{
|
||||
Web.Cache.DistributedCache.Instance.RefreshAll(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"));
|
||||
global::Umbraco.Web.Cache.DistributedCache.Instance.RefreshAll(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"));
|
||||
}
|
||||
Assert.AreEqual(13, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).CountOfFullRefreshes);
|
||||
}
|
||||
|
||||
@@ -56,19 +56,19 @@ namespace Umbraco.Tests.Integration
|
||||
ServiceContext.DomainService.Save(new UmbracoDomain("*100112") { DomainName = "*100112", RootContentId = c3.Id, LanguageId = l2.Id });
|
||||
|
||||
var content = c2;
|
||||
var culture = Web.Models.ContentExtensions.GetCulture(null,
|
||||
var culture = global::Umbraco.Web.Models.ContentExtensions.GetCulture(null,
|
||||
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
|
||||
content.Id, content.Path, new Uri("http://domain1.com/"));
|
||||
Assert.AreEqual("en-US", culture.Name);
|
||||
|
||||
content = c2;
|
||||
culture = Web.Models.ContentExtensions.GetCulture(null,
|
||||
culture = global::Umbraco.Web.Models.ContentExtensions.GetCulture(null,
|
||||
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
|
||||
content.Id, content.Path, new Uri("http://domain1.fr/"));
|
||||
Assert.AreEqual("fr-FR", culture.Name);
|
||||
|
||||
content = c4;
|
||||
culture = Web.Models.ContentExtensions.GetCulture(null,
|
||||
culture = global::Umbraco.Web.Models.ContentExtensions.GetCulture(null,
|
||||
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
|
||||
content.Id, content.Path, new Uri("http://domain1.fr/"));
|
||||
Assert.AreEqual("de-DE", culture.Name);
|
||||
@@ -104,13 +104,13 @@ namespace Umbraco.Tests.Integration
|
||||
//ServiceContext.DomainService.Save(new UmbracoDomain("*100112") { DomainName = "*100112", RootContentId = c3.Id, LanguageId = l2.Id });
|
||||
|
||||
var content = c2;
|
||||
var culture = Web.Models.ContentExtensions.GetCulture(null,
|
||||
var culture = Umbraco.Web.Models.ContentExtensions.GetCulture(null,
|
||||
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
|
||||
content.Id, content.Path, new Uri("http://domain1.com/"));
|
||||
Assert.AreEqual("de-DE", culture.Name);
|
||||
|
||||
content = c4;
|
||||
culture = Web.Models.ContentExtensions.GetCulture(null,
|
||||
culture = Umbraco.Web.Models.ContentExtensions.GetCulture(null,
|
||||
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
|
||||
content.Id, content.Path, new Uri("http://domain1.fr/"));
|
||||
Assert.AreEqual("fr-FR", culture.Name);
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
using System;
|
||||
|
||||
using System.Linq;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
using Umbraco.Core.Persistence.Migrations;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
|
||||
namespace Umbraco.Tests.Persistence.SyntaxProvider
|
||||
{
|
||||
[NUnit.Framework.Ignore("This doesn't actually test anything")]
|
||||
//[NUnit.Framework.Ignore("This doesn't actually test anything")]
|
||||
[TestFixture]
|
||||
public class MySqlSyntaxProviderTests
|
||||
public class MySqlSyntaxProviderTests : BaseUsingSqlCeSyntax
|
||||
{
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
@@ -20,6 +23,7 @@ namespace Umbraco.Tests.Persistence.SyntaxProvider
|
||||
}
|
||||
|
||||
[Test]
|
||||
[NUnit.Framework.Ignore]
|
||||
public void Can_Generate_Create_Table_Statement()
|
||||
{
|
||||
var type = typeof(TagRelationshipDto);
|
||||
@@ -48,5 +52,40 @@ namespace Umbraco.Tests.Persistence.SyntaxProvider
|
||||
{
|
||||
SqlSyntaxContext.SqlSyntaxProvider = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void U4_8017()
|
||||
{
|
||||
var logger = Mock.Of<ILogger>();
|
||||
var migration = new TestMigration(SqlSyntaxContext.SqlSyntaxProvider, logger);
|
||||
var context = new MigrationContext(DatabaseProviders.MySql, null, logger);
|
||||
migration.Context = context;
|
||||
migration.Up();
|
||||
var x = context.Expressions;
|
||||
Assert.AreEqual(1, x.Count);
|
||||
var e = x.First().ToString();
|
||||
|
||||
// SQLCE provider *does* use UniqueIdentifier
|
||||
// MySql using GUID...? because InitColumnTypeMap() missing in provider, fixed
|
||||
|
||||
Assert.AreEqual("ALTER TABLE `cmsPropertyTypeGroup` ADD COLUMN `uniqueID` char(36) NOT NULL", e);
|
||||
}
|
||||
|
||||
[Migration("1.0.0", 0, "Test")]
|
||||
private class TestMigration : MigrationBase
|
||||
{
|
||||
public TestMigration(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
{}
|
||||
|
||||
public override void Up()
|
||||
{
|
||||
Create.Column("uniqueID").OnTable("cmsPropertyTypeGroup").AsGuid().NotNullable().WithDefault(SystemMethods.NewGuid);
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,11 +9,12 @@ using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
using Umbraco.Core.Persistence.Migrations.Syntax.Create.Index;
|
||||
using Umbraco.Core.Persistence.Migrations.Syntax.Expressions;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
|
||||
namespace Umbraco.Tests.Persistence.SyntaxProvider
|
||||
{
|
||||
[TestFixture]
|
||||
public class SqlCeSyntaxProviderTests
|
||||
public class SqlCeSyntaxProviderTests : BaseUsingSqlCeSyntax
|
||||
{
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace Umbraco.Tests.PropertyEditors
|
||||
var dataTypeService = new Mock<IDataTypeService>();
|
||||
dataTypeService.Setup(x => x.GetPreValuesCollectionByDataTypeId(It.IsAny<int>())).Returns(new PreValueCollection(Enumerable.Empty<PreValue>()));
|
||||
|
||||
var converter = new Web.PropertyEditors.ValueConverters.ImageCropperValueConverter(dataTypeService.Object);
|
||||
var converter = new Umbraco.Web.PropertyEditors.ValueConverters.ImageCropperValueConverter(dataTypeService.Object);
|
||||
var result = converter.ConvertDataToSource(new PublishedPropertyType("test", 0, "test"), val1, false); // does not use type for conversion
|
||||
|
||||
var resultShouldMatch = val2.SerializeToCropDataSet();
|
||||
|
||||
@@ -234,9 +234,9 @@ namespace Umbraco.Tests.PublishedContent
|
||||
new PublishedPropertyType("prop1", 1, "?"),
|
||||
};
|
||||
|
||||
var contentType1 = new PublishedContentType(1, "ContentType1", props);
|
||||
var contentType2 = new PublishedContentType(2, "ContentType2", props);
|
||||
var contentType2s = new PublishedContentType(3, "ContentType2Sub", props);
|
||||
var contentType1 = new PublishedContentType(1, "ContentType1", Enumerable.Empty<string>(), props);
|
||||
var contentType2 = new PublishedContentType(2, "ContentType2", Enumerable.Empty<string>(), props);
|
||||
var contentType2s = new PublishedContentType(3, "ContentType2Sub", Enumerable.Empty<string>(), props);
|
||||
|
||||
cache.Add(new SolidPublishedContent(contentType1)
|
||||
{
|
||||
|
||||
@@ -355,7 +355,11 @@ namespace Umbraco.Tests.PublishedContent
|
||||
private static readonly PublishedPropertyType Default = new PublishedPropertyType("*", 0, "?");
|
||||
|
||||
public AutoPublishedContentType(int id, string alias, IEnumerable<PublishedPropertyType> propertyTypes)
|
||||
: base(id, alias, propertyTypes)
|
||||
: base(id, alias, Enumerable.Empty<string>(), propertyTypes)
|
||||
{ }
|
||||
|
||||
public AutoPublishedContentType(int id, string alias, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes)
|
||||
: base(id, alias, compositionAliases, propertyTypes)
|
||||
{ }
|
||||
|
||||
public override PublishedPropertyType GetPropertyType(string alias)
|
||||
|
||||
@@ -50,7 +50,8 @@ namespace Umbraco.Tests.PublishedContent
|
||||
new PublishedPropertyType("content", 0, Constants.PropertyEditors.TinyMCEAlias),
|
||||
new PublishedPropertyType("testRecursive", 0, "?"),
|
||||
};
|
||||
var type = new AutoPublishedContentType(0, "anything", propertyTypes);
|
||||
var compositionAliases = new[] {"MyCompositionAlias"};
|
||||
var type = new AutoPublishedContentType(0, "anything", compositionAliases, propertyTypes);
|
||||
PublishedContentType.GetPublishedContentTypeCallback = (alias) => type;
|
||||
}
|
||||
|
||||
@@ -468,6 +469,16 @@ namespace Umbraco.Tests.PublishedContent
|
||||
Assert.IsNull(doc.FirstChild<IPublishedContent>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsComposedOf()
|
||||
{
|
||||
var doc = GetNode(1173);
|
||||
|
||||
var isComposedOf = doc.IsComposedOf("MyCompositionAlias");
|
||||
|
||||
Assert.IsTrue(isComposedOf);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void HasProperty()
|
||||
{
|
||||
@@ -475,8 +486,7 @@ namespace Umbraco.Tests.PublishedContent
|
||||
|
||||
var hasProp = doc.HasProperty(Constants.Conventions.Content.UrlAlias);
|
||||
|
||||
Assert.AreEqual(true, (bool)hasProp);
|
||||
|
||||
Assert.IsTrue(hasProp);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -380,7 +380,7 @@ namespace Umbraco.Tests.Routing
|
||||
var content = umbracoContext.ContentCache.GetById(nodeId);
|
||||
Assert.IsNotNull(content);
|
||||
|
||||
var culture = Web.Models.ContentExtensions.GetCulture(umbracoContext, domainService, ServiceContext.LocalizationService, null, content.Id, content.Path, new Uri(currentUrl));
|
||||
var culture = global::Umbraco.Web.Models.ContentExtensions.GetCulture(umbracoContext, domainService, ServiceContext.LocalizationService, null, content.Id, content.Path, new Uri(currentUrl));
|
||||
Assert.AreEqual(expectedCulture, culture.Name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Web;
|
||||
using Microsoft.Owin;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Profiling;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Web.Security;
|
||||
using Umbraco.Web.Security.Identity;
|
||||
|
||||
namespace Umbraco.Tests.Security
|
||||
{
|
||||
[TestFixture]
|
||||
public class BackOfficeCookieManagerTests
|
||||
{
|
||||
[Test]
|
||||
public void ShouldAuthenticateRequest_When_Not_Configured()
|
||||
{
|
||||
//should force app ctx to show not-configured
|
||||
ConfigurationManager.AppSettings.Set("umbracoConfigurationStatus", "");
|
||||
|
||||
var dbCtx = new Mock<DatabaseContext>(Mock.Of<IDatabaseFactory>(), Mock.Of<ILogger>(), Mock.Of<ISqlSyntaxProvider>(), "test");
|
||||
dbCtx.Setup(x => x.IsDatabaseConfigured).Returns(false);
|
||||
|
||||
var appCtx = new ApplicationContext(
|
||||
dbCtx.Object,
|
||||
MockHelper.GetMockedServiceContext(),
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
|
||||
var umbCtx = UmbracoContext.CreateContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
|
||||
Mock.Of<IUmbracoSettingsSection>(), new List<IUrlProvider>(), false);
|
||||
|
||||
var mgr = new BackOfficeCookieManager(Mock.Of<IUmbracoContextAccessor>(accessor => accessor.Value == umbCtx));
|
||||
|
||||
var result = mgr.ShouldAuthenticateRequest(Mock.Of<IOwinContext>(), new Uri("http://localhost/umbraco"));
|
||||
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldAuthenticateRequest_When_Configured()
|
||||
{
|
||||
var dbCtx = new Mock<DatabaseContext>(Mock.Of<IDatabaseFactory>(), Mock.Of<ILogger>(), Mock.Of<ISqlSyntaxProvider>(), "test");
|
||||
dbCtx.Setup(x => x.IsDatabaseConfigured).Returns(true);
|
||||
|
||||
var appCtx = new ApplicationContext(
|
||||
dbCtx.Object,
|
||||
MockHelper.GetMockedServiceContext(),
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
|
||||
var umbCtx = UmbracoContext.CreateContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
|
||||
Mock.Of<IUmbracoSettingsSection>(), new List<IUrlProvider>(), false);
|
||||
|
||||
var mgr = new BackOfficeCookieManager(Mock.Of<IUmbracoContextAccessor>(accessor => accessor.Value == umbCtx));
|
||||
|
||||
var request = new Mock<OwinRequest>();
|
||||
request.Setup(owinRequest => owinRequest.Uri).Returns(new Uri("http://localhost/umbraco"));
|
||||
|
||||
var result = mgr.ShouldAuthenticateRequest(
|
||||
Mock.Of<IOwinContext>(context => context.Request == request.Object),
|
||||
new Uri("http://localhost/umbraco"));
|
||||
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
//TODO : Write remaining tests for `ShouldAuthenticateRequest`
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Text;
|
||||
@@ -9,6 +8,7 @@ using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Security;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Tests.Security
|
||||
{
|
||||
|
||||
@@ -75,6 +75,10 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
@@ -94,6 +98,10 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Semver">
|
||||
<HintPath>..\packages\semver.1.1.2\lib\net45\Semver.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -102,13 +110,13 @@
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.Entity.Design" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
@@ -167,10 +175,10 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AngularIntegration\AngularAntiForgeryTests.cs" />
|
||||
<Compile Include="AngularIntegration\ContentModelSerializationTests.cs" />
|
||||
<Compile Include="AngularIntegration\JsInitializationTests.cs" />
|
||||
<Compile Include="AngularIntegration\ServerVariablesParserTests.cs" />
|
||||
<Compile Include="Web\AngularIntegration\AngularAntiForgeryTests.cs" />
|
||||
<Compile Include="Web\AngularIntegration\ContentModelSerializationTests.cs" />
|
||||
<Compile Include="Web\AngularIntegration\JsInitializationTests.cs" />
|
||||
<Compile Include="Web\AngularIntegration\ServerVariablesParserTests.cs" />
|
||||
<Compile Include="ApplicationContextTests.cs" />
|
||||
<Compile Include="AttemptTests.cs" />
|
||||
<Compile Include="Cache\CacheRefresherTests.cs" />
|
||||
@@ -180,12 +188,12 @@
|
||||
<Compile Include="Cache\FullDataSetCachePolicyTests.cs" />
|
||||
<Compile Include="Cache\SingleItemsOnlyCachePolicyTests.cs" />
|
||||
<Compile Include="Collections\DeepCloneableListTests.cs" />
|
||||
<Compile Include="Controllers\BackOfficeControllerUnitTests.cs" />
|
||||
<Compile Include="Web\Controllers\BackOfficeControllerUnitTests.cs" />
|
||||
<Compile Include="DelegateExtensionsTests.cs" />
|
||||
<Compile Include="Logging\AsyncRollingFileAppenderTest.cs" />
|
||||
<Compile Include="Logging\DebugAppender.cs" />
|
||||
<Compile Include="Logging\ParallelForwarderTest.cs" />
|
||||
<Compile Include="Mvc\RenderIndexActionSelectorAttributeTests.cs" />
|
||||
<Compile Include="Web\Mvc\RenderIndexActionSelectorAttributeTests.cs" />
|
||||
<Compile Include="Persistence\Repositories\AuditRepositoryTest.cs" />
|
||||
<Compile Include="Persistence\Repositories\DomainRepositoryTest.cs" />
|
||||
<Compile Include="Persistence\Repositories\PartialViewRepositoryTests.cs" />
|
||||
@@ -195,6 +203,7 @@
|
||||
<Compile Include="Resolvers\ResolverBaseTest.cs" />
|
||||
<Compile Include="Routing\RoutesCacheTests.cs" />
|
||||
<Compile Include="Routing\UrlRoutingTestBase.cs" />
|
||||
<Compile Include="Security\BackOfficeCookieManagerTests.cs" />
|
||||
<Compile Include="Security\UmbracoBackOfficeIdentityTests.cs" />
|
||||
<Compile Include="Services\ContentTypeServiceExtensionsTests.cs" />
|
||||
<Compile Include="Services\PublicAccessServiceTests.cs" />
|
||||
@@ -235,8 +244,8 @@
|
||||
<Compile Include="Models\UmbracoEntityTests.cs" />
|
||||
<Compile Include="Models\UserTests.cs" />
|
||||
<Compile Include="Models\UserTypeTests.cs" />
|
||||
<Compile Include="Mvc\SurfaceControllerTests.cs" />
|
||||
<Compile Include="Mvc\UmbracoViewPageTests.cs" />
|
||||
<Compile Include="Web\Mvc\SurfaceControllerTests.cs" />
|
||||
<Compile Include="Web\Mvc\UmbracoViewPageTests.cs" />
|
||||
<Compile Include="BootManagers\CoreBootManagerTests.cs" />
|
||||
<Compile Include="BootManagers\WebBootManagerTests.cs" />
|
||||
<Compile Include="Cache\ObjectCacheProviderTests.cs" />
|
||||
@@ -311,9 +320,9 @@
|
||||
<Compile Include="Configurations\UmbracoSettings\ViewstateMoverModuleElementTests.cs" />
|
||||
<Compile Include="Configurations\UmbracoSettings\WebRoutingElementDefaultTests.cs" />
|
||||
<Compile Include="Configurations\UmbracoSettings\WebRoutingElementTests.cs" />
|
||||
<Compile Include="Controllers\WebApiEditors\ContentControllerUnitTests.cs" />
|
||||
<Compile Include="Controllers\WebApiEditors\FilterAllowedOutgoingContentAttributeTests.cs" />
|
||||
<Compile Include="Controllers\WebApiEditors\MediaControllerUnitTests.cs" />
|
||||
<Compile Include="Web\Controllers\WebApiEditors\ContentControllerUnitTests.cs" />
|
||||
<Compile Include="Web\Controllers\WebApiEditors\FilterAllowedOutgoingContentAttributeTests.cs" />
|
||||
<Compile Include="Web\Controllers\WebApiEditors\MediaControllerUnitTests.cs" />
|
||||
<Compile Include="CoreXml\FrameworkXmlTests.cs" />
|
||||
<Compile Include="DynamicsAndReflection\QueryableExtensionTests.cs" />
|
||||
<Compile Include="DynamicsAndReflection\ExtensionMethodFinderTests.cs" />
|
||||
@@ -323,8 +332,8 @@
|
||||
<Compile Include="Migrations\Upgrades\ValidateV7UpgradeTest.cs" />
|
||||
<Compile Include="Models\ContentExtensionsTests.cs" />
|
||||
<Compile Include="Models\UserExtensionsTests.cs" />
|
||||
<Compile Include="Mvc\MergeParentContextViewDataAttributeTests.cs" />
|
||||
<Compile Include="Mvc\ViewDataDictionaryExtensionTests.cs" />
|
||||
<Compile Include="Web\Mvc\MergeParentContextViewDataAttributeTests.cs" />
|
||||
<Compile Include="Web\Mvc\ViewDataDictionaryExtensionTests.cs" />
|
||||
<Compile Include="Persistence\PetaPocoExtensionsTest.cs" />
|
||||
<Compile Include="Persistence\Querying\ContentTypeSqlMappingTests.cs" />
|
||||
<Compile Include="Persistence\Repositories\MacroRepositoryTest.cs" />
|
||||
@@ -421,7 +430,7 @@
|
||||
<Compile Include="PublishedContent\PublishedContentTests.cs" />
|
||||
<Compile Include="PublishedContent\PublishedMediaTests.cs" />
|
||||
<Compile Include="HashCodeCombinerTests.cs" />
|
||||
<Compile Include="Mvc\HtmlHelperExtensionMethodsTests.cs" />
|
||||
<Compile Include="Web\Mvc\HtmlHelperExtensionMethodsTests.cs" />
|
||||
<Compile Include="IO\IOHelperTest.cs" />
|
||||
<Compile Include="LibraryTests.cs" />
|
||||
<Compile Include="PropertyEditors\PropertyEditorValueConverterTests.cs" />
|
||||
@@ -506,7 +515,7 @@
|
||||
<DependentUpon>ImportResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Services\ThreadSafetyServiceTest.cs" />
|
||||
<Compile Include="Controllers\PluginControllerAreaTests.cs" />
|
||||
<Compile Include="Web\Controllers\PluginControllerAreaTests.cs" />
|
||||
<Compile Include="Cache\DistributedCache\DistributedCacheTests.cs" />
|
||||
<Compile Include="Templates\MasterPageHelperTests.cs" />
|
||||
<Compile Include="TestHelpers\BaseDatabaseFactoryTest.cs" />
|
||||
@@ -570,6 +579,7 @@
|
||||
<Compile Include="Plugins\TypeFinderTests.cs" />
|
||||
<Compile Include="Routing\UmbracoModuleTests.cs" />
|
||||
<Compile Include="VersionExtensionTests.cs" />
|
||||
<Compile Include="Web\WebExtensionMethodTests.cs" />
|
||||
<Compile Include="XmlExtensionsTests.cs" />
|
||||
<Compile Include="XmlHelperTests.cs" />
|
||||
</ItemGroup>
|
||||
@@ -739,11 +749,16 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /D
|
||||
xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\x86\*.* "$(TargetDir)x86\" /Y /F /E /D</PostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /I /C /D
|
||||
xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\" /Y /F /E /I /C /D</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
|
||||
+2
-11
@@ -1,20 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Security.Claims;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Security;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Web.WebApi.Filters;
|
||||
|
||||
namespace Umbraco.Tests.AngularIntegration
|
||||
namespace Umbraco.Tests.Web.AngularIntegration
|
||||
{
|
||||
[TestFixture]
|
||||
public class AngularAntiForgeryTests
|
||||
+77
-80
@@ -1,80 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
namespace Umbraco.Tests.AngularIntegration
|
||||
{
|
||||
[TestFixture]
|
||||
public class ContentModelSerializationTests
|
||||
{
|
||||
[Test]
|
||||
public void Content_Display_To_Json()
|
||||
{
|
||||
//create 3 tabs with 3 properties each
|
||||
var tabs = new List<Tab<ContentPropertyDisplay>>();
|
||||
for (var tabIndex = 0; tabIndex < 3; tabIndex ++)
|
||||
{
|
||||
var props = new List<ContentPropertyDisplay>();
|
||||
for (var propertyIndex = 0; propertyIndex < 3; propertyIndex ++)
|
||||
{
|
||||
props.Add(new ContentPropertyDisplay
|
||||
{
|
||||
Alias = "property" + propertyIndex,
|
||||
Label = "Property " + propertyIndex,
|
||||
Id = propertyIndex,
|
||||
Value = "value" + propertyIndex,
|
||||
Config = new Dictionary<string, object> {{ propertyIndex.ToInvariantString(), "value" }},
|
||||
Description = "Description " + propertyIndex,
|
||||
View = "~/Views/View" + propertyIndex,
|
||||
HideLabel = false
|
||||
});
|
||||
}
|
||||
tabs.Add(new Tab<ContentPropertyDisplay>()
|
||||
{
|
||||
Alias = "Tab" + tabIndex,
|
||||
Label = "Tab" + tabIndex,
|
||||
Properties = props
|
||||
});
|
||||
}
|
||||
|
||||
var displayModel = new ContentItemDisplay
|
||||
{
|
||||
Id = 1234,
|
||||
Name = "Test",
|
||||
Tabs = tabs
|
||||
};
|
||||
|
||||
var json = JsonConvert.SerializeObject(displayModel);
|
||||
|
||||
var jObject = JObject.Parse(json);
|
||||
|
||||
Assert.AreEqual("1234", jObject["id"].ToString());
|
||||
Assert.AreEqual("Test", jObject["name"].ToString());
|
||||
Assert.AreEqual(3, jObject["tabs"].Count());
|
||||
for (var tab = 0; tab < jObject["tabs"].Count(); tab++)
|
||||
{
|
||||
Assert.AreEqual("Tab" + tab, jObject["tabs"][tab]["alias"].ToString());
|
||||
Assert.AreEqual("Tab" + tab, jObject["tabs"][tab]["label"].ToString());
|
||||
Assert.AreEqual(3, jObject["tabs"][tab]["properties"].Count());
|
||||
for (var prop = 0; prop < jObject["tabs"][tab]["properties"].Count(); prop++)
|
||||
{
|
||||
Assert.AreEqual("property" + prop, jObject["tabs"][tab]["properties"][prop]["alias"].ToString());
|
||||
Assert.AreEqual("Property " + prop, jObject["tabs"][tab]["properties"][prop]["label"].ToString());
|
||||
Assert.AreEqual(prop, jObject["tabs"][tab]["properties"][prop]["id"].Value<int>());
|
||||
Assert.AreEqual("value" + prop, jObject["tabs"][tab]["properties"][prop]["value"].ToString());
|
||||
Assert.AreEqual("{\"" + prop + "\":\"value\"}", jObject["tabs"][tab]["properties"][prop]["config"].ToString(Formatting.None));
|
||||
Assert.AreEqual("Description " + prop, jObject["tabs"][tab]["properties"][prop]["description"].ToString());
|
||||
Assert.AreEqual(false, jObject["tabs"][tab]["properties"][prop]["hideLabel"].Value<bool>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
namespace Umbraco.Tests.Web.AngularIntegration
|
||||
{
|
||||
[TestFixture]
|
||||
public class ContentModelSerializationTests
|
||||
{
|
||||
[Test]
|
||||
public void Content_Display_To_Json()
|
||||
{
|
||||
//create 3 tabs with 3 properties each
|
||||
var tabs = new List<Tab<ContentPropertyDisplay>>();
|
||||
for (var tabIndex = 0; tabIndex < 3; tabIndex ++)
|
||||
{
|
||||
var props = new List<ContentPropertyDisplay>();
|
||||
for (var propertyIndex = 0; propertyIndex < 3; propertyIndex ++)
|
||||
{
|
||||
props.Add(new ContentPropertyDisplay
|
||||
{
|
||||
Alias = "property" + propertyIndex,
|
||||
Label = "Property " + propertyIndex,
|
||||
Id = propertyIndex,
|
||||
Value = "value" + propertyIndex,
|
||||
Config = new Dictionary<string, object> {{ propertyIndex.ToInvariantString(), "value" }},
|
||||
Description = "Description " + propertyIndex,
|
||||
View = "~/Views/View" + propertyIndex,
|
||||
HideLabel = false
|
||||
});
|
||||
}
|
||||
tabs.Add(new Tab<ContentPropertyDisplay>()
|
||||
{
|
||||
Alias = "Tab" + tabIndex,
|
||||
Label = "Tab" + tabIndex,
|
||||
Properties = props
|
||||
});
|
||||
}
|
||||
|
||||
var displayModel = new ContentItemDisplay
|
||||
{
|
||||
Id = 1234,
|
||||
Name = "Test",
|
||||
Tabs = tabs
|
||||
};
|
||||
|
||||
var json = JsonConvert.SerializeObject(displayModel);
|
||||
|
||||
var jObject = JObject.Parse(json);
|
||||
|
||||
Assert.AreEqual("1234", jObject["id"].ToString());
|
||||
Assert.AreEqual("Test", jObject["name"].ToString());
|
||||
Assert.AreEqual(3, jObject["tabs"].Count());
|
||||
for (var tab = 0; tab < jObject["tabs"].Count(); tab++)
|
||||
{
|
||||
Assert.AreEqual("Tab" + tab, jObject["tabs"][tab]["alias"].ToString());
|
||||
Assert.AreEqual("Tab" + tab, jObject["tabs"][tab]["label"].ToString());
|
||||
Assert.AreEqual(3, jObject["tabs"][tab]["properties"].Count());
|
||||
for (var prop = 0; prop < jObject["tabs"][tab]["properties"].Count(); prop++)
|
||||
{
|
||||
Assert.AreEqual("property" + prop, jObject["tabs"][tab]["properties"][prop]["alias"].ToString());
|
||||
Assert.AreEqual("Property " + prop, jObject["tabs"][tab]["properties"][prop]["label"].ToString());
|
||||
Assert.AreEqual(prop, jObject["tabs"][tab]["properties"][prop]["id"].Value<int>());
|
||||
Assert.AreEqual("value" + prop, jObject["tabs"][tab]["properties"][prop]["value"].ToString());
|
||||
Assert.AreEqual("{\"" + prop + "\":\"value\"}", jObject["tabs"][tab]["properties"][prop]["config"].ToString(Formatting.None));
|
||||
Assert.AreEqual("Description " + prop, jObject["tabs"][tab]["properties"][prop]["description"].ToString());
|
||||
Assert.AreEqual(false, jObject["tabs"][tab]["properties"][prop]["hideLabel"].Value<bool>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+36
-41
@@ -1,41 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using NUnit.Framework;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Umbraco.Core.Manifest;
|
||||
using Umbraco.Web.UI.JavaScript;
|
||||
|
||||
namespace Umbraco.Tests.AngularIntegration
|
||||
{
|
||||
[TestFixture]
|
||||
public class JsInitializationTests
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void Get_Default_Init()
|
||||
{
|
||||
var init = JsInitialization.GetDefaultInitialization();
|
||||
Assert.IsTrue(init.Any());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Parse_Main()
|
||||
{
|
||||
var result = JsInitialization.ParseMain(new[] {"[World]", "Hello" });
|
||||
|
||||
Assert.AreEqual(@"LazyLoad.js([World], function () {
|
||||
//we need to set the legacy UmbClientMgr path
|
||||
UmbClientMgr.setUmbracoPath('Hello');
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
angular.bootstrap(document, ['umbraco']);
|
||||
|
||||
});
|
||||
});", result);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Web.UI.JavaScript;
|
||||
|
||||
namespace Umbraco.Tests.Web.AngularIntegration
|
||||
{
|
||||
[TestFixture]
|
||||
public class JsInitializationTests
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void Get_Default_Init()
|
||||
{
|
||||
var init = JsInitialization.GetDefaultInitialization();
|
||||
Assert.IsTrue(init.Any());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Parse_Main()
|
||||
{
|
||||
var result = JsInitialization.ParseMain(new[] {"[World]", "Hello" });
|
||||
|
||||
Assert.AreEqual(@"LazyLoad.js([World], function () {
|
||||
//we need to set the legacy UmbClientMgr path
|
||||
UmbClientMgr.setUmbracoPath('Hello');
|
||||
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
angular.bootstrap(document, ['umbraco']);
|
||||
|
||||
});
|
||||
});".StripWhitespace(), result.StripWhitespace());
|
||||
}
|
||||
}
|
||||
}
|
||||
+33
-32
@@ -1,33 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Web.UI.JavaScript;
|
||||
|
||||
namespace Umbraco.Tests.AngularIntegration
|
||||
{
|
||||
[TestFixture]
|
||||
public class ServerVariablesParserTests
|
||||
{
|
||||
|
||||
|
||||
[Test]
|
||||
public void Parse()
|
||||
{
|
||||
var d = new Dictionary<string, object>();
|
||||
d.Add("test1", "Test 1");
|
||||
d.Add("test2", "Test 2");
|
||||
d.Add("test3", "Test 3");
|
||||
d.Add("test4", "Test 4");
|
||||
d.Add("test5", "Test 5");
|
||||
|
||||
var output = ServerVariablesParser.Parse(d);
|
||||
|
||||
Assert.IsTrue(output.Contains(@"Umbraco.Sys.ServerVariables = {
|
||||
""test1"": ""Test 1"",
|
||||
""test2"": ""Test 2"",
|
||||
""test3"": ""Test 3"",
|
||||
""test4"": ""Test 4"",
|
||||
""test5"": ""Test 5""
|
||||
} ;"));
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Web.UI.JavaScript;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Umbraco.Tests.Web.AngularIntegration
|
||||
{
|
||||
[TestFixture]
|
||||
public class ServerVariablesParserTests
|
||||
{
|
||||
|
||||
|
||||
[Test]
|
||||
public void Parse()
|
||||
{
|
||||
var d = new Dictionary<string, object>();
|
||||
d.Add("test1", "Test 1");
|
||||
d.Add("test2", "Test 2");
|
||||
d.Add("test3", "Test 3");
|
||||
d.Add("test4", "Test 4");
|
||||
d.Add("test5", "Test 5");
|
||||
|
||||
var output = ServerVariablesParser.Parse(d).StripWhitespace();
|
||||
|
||||
Assert.IsTrue(output.Contains(@"Umbraco.Sys.ServerVariables = {
|
||||
""test1"": ""Test 1"",
|
||||
""test2"": ""Test 2"",
|
||||
""test3"": ""Test 3"",
|
||||
""test4"": ""Test 4"",
|
||||
""test5"": ""Test 5""
|
||||
} ;".StripWhitespace()));
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Web.Editors;
|
||||
|
||||
namespace Umbraco.Tests.Controllers
|
||||
namespace Umbraco.Tests.Web.Controllers
|
||||
{
|
||||
[TestFixture]
|
||||
public class BackOfficeControllerUnitTests
|
||||
+1
-1
@@ -4,7 +4,7 @@ using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace Umbraco.Tests.Controllers
|
||||
namespace Umbraco.Tests.Web.Controllers
|
||||
{
|
||||
[TestFixture]
|
||||
public class PluginControllerAreaTests : BaseWebTest
|
||||
+366
-366
@@ -1,366 +1,366 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Editors;
|
||||
|
||||
namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
{
|
||||
[TestFixture]
|
||||
public class ContentControllerUnitTests
|
||||
{
|
||||
[Test]
|
||||
public void Access_Allowed_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, contentService, 1234);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Throws_Exception_When_No_Content_Found()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(0)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>();
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act/assert
|
||||
Assert.Throws<HttpResponseException>(() => ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F' }));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(9876);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>();
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A", "B", "C" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_Allowed_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A", "F", "C" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Root_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -1);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Recycle_Bin_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -20);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Recycle_Bin_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(1234);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -20);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Root_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(1234);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -1);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Root_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, -1)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -1, new[] { 'A'});
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Root_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, -1)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -1, new[] { 'B'});
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Recycle_Bin_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, -20)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -20, new[] { 'A'});
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Recycle_Bin_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, -20)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -20, new[] { 'B'});
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//NOTE: The below self hosted stuff does work so need to get some tests written. Some are not possible atm because
|
||||
// of the legacy SQL calls like checking permissions.
|
||||
|
||||
//[TestFixture]
|
||||
//public class ContentControllerHostedTests : BaseRoutingTest
|
||||
//{
|
||||
|
||||
// protected override DatabaseBehavior DatabaseTestBehavior
|
||||
// {
|
||||
// get { return DatabaseBehavior.NoDatabasePerFixture; }
|
||||
// }
|
||||
|
||||
// public override void TearDown()
|
||||
// {
|
||||
// base.TearDown();
|
||||
// UmbracoAuthorizeAttribute.Enable = true;
|
||||
// UmbracoApplicationAuthorizeAttribute.Enable = true;
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Tests to ensure that the response filter works so that any items the user
|
||||
// /// doesn't have access to are removed
|
||||
// /// </summary>
|
||||
// [Test]
|
||||
// public async void Get_By_Ids_Response_Filtered()
|
||||
// {
|
||||
// UmbracoAuthorizeAttribute.Enable = false;
|
||||
// UmbracoApplicationAuthorizeAttribute.Enable = false;
|
||||
|
||||
// var baseUrl = string.Format("http://{0}:9876", Environment.MachineName);
|
||||
// var url = baseUrl + "/api/Content/GetByIds?ids=1&ids=2";
|
||||
|
||||
// var routingCtx = GetRoutingContext(url, 1234, null, true);
|
||||
|
||||
// var config = new HttpSelfHostConfiguration(baseUrl);
|
||||
// using (var server = new HttpSelfHostServer(config))
|
||||
// {
|
||||
// var route = config.Routes.MapHttpRoute("test", "api/Content/GetByIds",
|
||||
// new
|
||||
// {
|
||||
// controller = "Content",
|
||||
// action = "GetByIds",
|
||||
// id = RouteParameter.Optional
|
||||
// });
|
||||
// route.DataTokens["Namespaces"] = new string[] { "Umbraco.Web.Editors" };
|
||||
|
||||
// var client = new HttpClient(server);
|
||||
|
||||
// var request = new HttpRequestMessage
|
||||
// {
|
||||
// RequestUri = new Uri(url),
|
||||
// Method = HttpMethod.Get
|
||||
// };
|
||||
|
||||
// var result = await client.SendAsync(request);
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
//}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Editors;
|
||||
|
||||
namespace Umbraco.Tests.Web.Controllers.WebApiEditors
|
||||
{
|
||||
[TestFixture]
|
||||
public class ContentControllerUnitTests
|
||||
{
|
||||
[Test]
|
||||
public void Access_Allowed_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, contentService, 1234);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Throws_Exception_When_No_Content_Found()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(0)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>();
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act/assert
|
||||
Assert.Throws<HttpResponseException>(() => ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F' }));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(9876);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>();
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A", "B", "C" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_Allowed_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var contentMock = new Mock<IContent>();
|
||||
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
|
||||
var content = contentMock.Object;
|
||||
var contentServiceMock = new Mock<IContentService>();
|
||||
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
|
||||
var contentService = contentServiceMock.Object;
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A", "F", "C" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Root_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -1);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Recycle_Bin_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -20);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Recycle_Bin_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(1234);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -20);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Root_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(1234);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -1);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Root_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, -1)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -1, new[] { 'A'});
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Root_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, -1)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -1, new[] { 'B'});
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Recycle_Bin_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, -20)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -20, new[] { 'A'});
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Recycle_Bin_By_Permission()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1234, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, -20)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -20, new[] { 'B'});
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//NOTE: The below self hosted stuff does work so need to get some tests written. Some are not possible atm because
|
||||
// of the legacy SQL calls like checking permissions.
|
||||
|
||||
//[TestFixture]
|
||||
//public class ContentControllerHostedTests : BaseRoutingTest
|
||||
//{
|
||||
|
||||
// protected override DatabaseBehavior DatabaseTestBehavior
|
||||
// {
|
||||
// get { return DatabaseBehavior.NoDatabasePerFixture; }
|
||||
// }
|
||||
|
||||
// public override void TearDown()
|
||||
// {
|
||||
// base.TearDown();
|
||||
// UmbracoAuthorizeAttribute.Enable = true;
|
||||
// UmbracoApplicationAuthorizeAttribute.Enable = true;
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Tests to ensure that the response filter works so that any items the user
|
||||
// /// doesn't have access to are removed
|
||||
// /// </summary>
|
||||
// [Test]
|
||||
// public async void Get_By_Ids_Response_Filtered()
|
||||
// {
|
||||
// UmbracoAuthorizeAttribute.Enable = false;
|
||||
// UmbracoApplicationAuthorizeAttribute.Enable = false;
|
||||
|
||||
// var baseUrl = string.Format("http://{0}:9876", Environment.MachineName);
|
||||
// var url = baseUrl + "/api/Content/GetByIds?ids=1&ids=2";
|
||||
|
||||
// var routingCtx = GetRoutingContext(url, 1234, null, true);
|
||||
|
||||
// var config = new HttpSelfHostConfiguration(baseUrl);
|
||||
// using (var server = new HttpSelfHostServer(config))
|
||||
// {
|
||||
// var route = config.Routes.MapHttpRoute("test", "api/Content/GetByIds",
|
||||
// new
|
||||
// {
|
||||
// controller = "Content",
|
||||
// action = "GetByIds",
|
||||
// id = RouteParameter.Optional
|
||||
// });
|
||||
// route.DataTokens["Namespaces"] = new string[] { "Umbraco.Web.Editors" };
|
||||
|
||||
// var client = new HttpClient(server);
|
||||
|
||||
// var request = new HttpRequestMessage
|
||||
// {
|
||||
// RequestUri = new Uri(url),
|
||||
// Method = HttpMethod.Get
|
||||
// };
|
||||
|
||||
// var result = await client.SendAsync(request);
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
//}
|
||||
}
|
||||
+135
-135
@@ -1,136 +1,136 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Net.Http.Headers;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
using Umbraco.Web.WebApi.Filters;
|
||||
|
||||
namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
{
|
||||
[TestFixture]
|
||||
public class FilterAllowedOutgoingContentAttributeTests
|
||||
{
|
||||
[Test]
|
||||
public void GetValueFromResponse_Already_EnumerableContent()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
|
||||
var val = new List<ContentItemBasic>() {new ContentItemBasic()};
|
||||
var result = att.GetValueFromResponse(
|
||||
new ObjectContent(typeof (IEnumerable<ContentItemBasic>),
|
||||
val,
|
||||
new JsonMediaTypeFormatter(),
|
||||
new MediaTypeHeaderValue("html/text")));
|
||||
|
||||
Assert.AreEqual(val, result);
|
||||
Assert.AreEqual(1, ((IEnumerable<ContentItemBasic>)result).Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetValueFromResponse_From_Property()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>), "MyList");
|
||||
var val = new List<ContentItemBasic>() { new ContentItemBasic() };
|
||||
var container = new MyTestClass() {MyList = val};
|
||||
|
||||
var result = att.GetValueFromResponse(
|
||||
new ObjectContent(typeof(MyTestClass),
|
||||
container,
|
||||
new JsonMediaTypeFormatter(),
|
||||
new MediaTypeHeaderValue("html/text")));
|
||||
|
||||
Assert.AreEqual(val, result);
|
||||
Assert.AreEqual(1, ((IEnumerable<ContentItemBasic>)result).Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetValueFromResponse_Returns_Null_Not_Found_Property()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>), "DontFind");
|
||||
var val = new List<ContentItemBasic>() { new ContentItemBasic() };
|
||||
var container = new MyTestClass() { MyList = val };
|
||||
|
||||
var result = att.GetValueFromResponse(
|
||||
new ObjectContent(typeof(MyTestClass),
|
||||
container,
|
||||
new JsonMediaTypeFormatter(),
|
||||
new MediaTypeHeaderValue("html/text")));
|
||||
|
||||
Assert.AreEqual(null, result);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Filter_On_Start_Node()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
|
||||
var list = new List<dynamic>();
|
||||
var path = "";
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
if (i > 0 && path.EndsWith(",") == false)
|
||||
{
|
||||
path += ",";
|
||||
}
|
||||
path += i.ToInvariantString();
|
||||
list.Add(new ContentItemBasic { Id = i, Name = "Test" + i, ParentId = i, Path = path });
|
||||
}
|
||||
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(5);
|
||||
var user = userMock.Object;
|
||||
|
||||
att.FilterBasedOnStartNode(list, user);
|
||||
|
||||
Assert.AreEqual(5, list.Count);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Filter_On_Permissions()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
|
||||
var list = new List<dynamic>();
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
list.Add(new ContentItemBasic{Id = i, Name = "Test" + i, ParentId = -1});
|
||||
}
|
||||
var ids = list.Select(x => (int)x.Id).ToArray();
|
||||
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
//we're only assigning 3 nodes browse permissions so that is what we expect as a result
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1, new string[]{ "F" }),
|
||||
new EntityPermission(9, 2, new string[]{ "F" }),
|
||||
new EntityPermission(9, 3, new string[]{ "F" }),
|
||||
new EntityPermission(9, 4, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, ids)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
att.FilterBasedOnPermissions(list, user, userService);
|
||||
|
||||
Assert.AreEqual(3, list.Count);
|
||||
Assert.AreEqual(1, list.ElementAt(0).Id);
|
||||
Assert.AreEqual(2, list.ElementAt(1).Id);
|
||||
Assert.AreEqual(3, list.ElementAt(2).Id);
|
||||
}
|
||||
|
||||
private class MyTestClass
|
||||
{
|
||||
public IEnumerable<ContentItemBasic> MyList { get; set; }
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Net.Http.Headers;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
using Umbraco.Web.WebApi.Filters;
|
||||
|
||||
namespace Umbraco.Tests.Web.Controllers.WebApiEditors
|
||||
{
|
||||
[TestFixture]
|
||||
public class FilterAllowedOutgoingContentAttributeTests
|
||||
{
|
||||
[Test]
|
||||
public void GetValueFromResponse_Already_EnumerableContent()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
|
||||
var val = new List<ContentItemBasic>() {new ContentItemBasic()};
|
||||
var result = att.GetValueFromResponse(
|
||||
new ObjectContent(typeof (IEnumerable<ContentItemBasic>),
|
||||
val,
|
||||
new JsonMediaTypeFormatter(),
|
||||
new MediaTypeHeaderValue("html/text")));
|
||||
|
||||
Assert.AreEqual(val, result);
|
||||
Assert.AreEqual(1, ((IEnumerable<ContentItemBasic>)result).Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetValueFromResponse_From_Property()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>), "MyList");
|
||||
var val = new List<ContentItemBasic>() { new ContentItemBasic() };
|
||||
var container = new MyTestClass() {MyList = val};
|
||||
|
||||
var result = att.GetValueFromResponse(
|
||||
new ObjectContent(typeof(MyTestClass),
|
||||
container,
|
||||
new JsonMediaTypeFormatter(),
|
||||
new MediaTypeHeaderValue("html/text")));
|
||||
|
||||
Assert.AreEqual(val, result);
|
||||
Assert.AreEqual(1, ((IEnumerable<ContentItemBasic>)result).Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetValueFromResponse_Returns_Null_Not_Found_Property()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>), "DontFind");
|
||||
var val = new List<ContentItemBasic>() { new ContentItemBasic() };
|
||||
var container = new MyTestClass() { MyList = val };
|
||||
|
||||
var result = att.GetValueFromResponse(
|
||||
new ObjectContent(typeof(MyTestClass),
|
||||
container,
|
||||
new JsonMediaTypeFormatter(),
|
||||
new MediaTypeHeaderValue("html/text")));
|
||||
|
||||
Assert.AreEqual(null, result);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Filter_On_Start_Node()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
|
||||
var list = new List<dynamic>();
|
||||
var path = "";
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
if (i > 0 && path.EndsWith(",") == false)
|
||||
{
|
||||
path += ",";
|
||||
}
|
||||
path += i.ToInvariantString();
|
||||
list.Add(new ContentItemBasic { Id = i, Name = "Test" + i, ParentId = i, Path = path });
|
||||
}
|
||||
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(5);
|
||||
var user = userMock.Object;
|
||||
|
||||
att.FilterBasedOnStartNode(list, user);
|
||||
|
||||
Assert.AreEqual(5, list.Count);
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Filter_On_Permissions()
|
||||
{
|
||||
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
|
||||
var list = new List<dynamic>();
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
list.Add(new ContentItemBasic{Id = i, Name = "Test" + i, ParentId = -1});
|
||||
}
|
||||
var ids = list.Select(x => (int)x.Id).ToArray();
|
||||
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartContentId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
var userServiceMock = new Mock<IUserService>();
|
||||
//we're only assigning 3 nodes browse permissions so that is what we expect as a result
|
||||
var permissions = new List<EntityPermission>
|
||||
{
|
||||
new EntityPermission(9, 1, new string[]{ "F" }),
|
||||
new EntityPermission(9, 2, new string[]{ "F" }),
|
||||
new EntityPermission(9, 3, new string[]{ "F" }),
|
||||
new EntityPermission(9, 4, new string[]{ "A" })
|
||||
};
|
||||
userServiceMock.Setup(x => x.GetPermissions(user, ids)).Returns(permissions);
|
||||
var userService = userServiceMock.Object;
|
||||
|
||||
att.FilterBasedOnPermissions(list, user, userService);
|
||||
|
||||
Assert.AreEqual(3, list.Count);
|
||||
Assert.AreEqual(1, list.ElementAt(0).Id);
|
||||
Assert.AreEqual(2, list.ElementAt(1).Id);
|
||||
Assert.AreEqual(3, list.ElementAt(2).Id);
|
||||
}
|
||||
|
||||
private class MyTestClass
|
||||
{
|
||||
public IEnumerable<ContentItemBasic> MyList { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
+141
-141
@@ -1,142 +1,142 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Editors;
|
||||
|
||||
namespace Umbraco.Tests.Controllers.WebApiEditors
|
||||
{
|
||||
[TestFixture]
|
||||
public class MediaControllerUnitTests
|
||||
{
|
||||
[Test]
|
||||
public void Access_Allowed_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var mediaMock = new Mock<IMedia>();
|
||||
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
|
||||
var media = mediaMock.Object;
|
||||
var mediaServiceMock = new Mock<IMediaService>();
|
||||
mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media);
|
||||
var mediaService = mediaServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Throws_Exception_When_No_Media_Found()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var mediaMock = new Mock<IMedia>();
|
||||
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
|
||||
var media = mediaMock.Object;
|
||||
var mediaServiceMock = new Mock<IMediaService>();
|
||||
mediaServiceMock.Setup(x => x.GetById(0)).Returns(media);
|
||||
var mediaService = mediaServiceMock.Object;
|
||||
|
||||
//act/assert
|
||||
Assert.Throws<HttpResponseException>(() => MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(9876);
|
||||
var user = userMock.Object;
|
||||
var mediaMock = new Mock<IMedia>();
|
||||
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
|
||||
var media = mediaMock.Object;
|
||||
var mediaServiceMock = new Mock<IMediaService>();
|
||||
mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media);
|
||||
var mediaService = mediaServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Root_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -1);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Root_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(1234);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -1);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Recycle_Bin_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -21);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Recycle_Bin_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(1234);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -21);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using System.Web.Http;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Editors;
|
||||
|
||||
namespace Umbraco.Tests.Web.Controllers.WebApiEditors
|
||||
{
|
||||
[TestFixture]
|
||||
public class MediaControllerUnitTests
|
||||
{
|
||||
[Test]
|
||||
public void Access_Allowed_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var mediaMock = new Mock<IMedia>();
|
||||
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
|
||||
var media = mediaMock.Object;
|
||||
var mediaServiceMock = new Mock<IMediaService>();
|
||||
mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media);
|
||||
var mediaService = mediaServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Throws_Exception_When_No_Media_Found()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
var mediaMock = new Mock<IMedia>();
|
||||
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
|
||||
var media = mediaMock.Object;
|
||||
var mediaServiceMock = new Mock<IMediaService>();
|
||||
mediaServiceMock.Setup(x => x.GetById(0)).Returns(media);
|
||||
var mediaService = mediaServiceMock.Object;
|
||||
|
||||
//act/assert
|
||||
Assert.Throws<HttpResponseException>(() => MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(9);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(9876);
|
||||
var user = userMock.Object;
|
||||
var mediaMock = new Mock<IMedia>();
|
||||
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
|
||||
var media = mediaMock.Object;
|
||||
var mediaServiceMock = new Mock<IMediaService>();
|
||||
mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media);
|
||||
var mediaService = mediaServiceMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Root_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -1);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Root_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(1234);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -1);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Access_To_Recycle_Bin_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(-1);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -21);
|
||||
|
||||
//assert
|
||||
Assert.IsTrue(result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void No_Access_To_Recycle_Bin_By_Path()
|
||||
{
|
||||
//arrange
|
||||
var userMock = new Mock<IUser>();
|
||||
userMock.Setup(u => u.Id).Returns(0);
|
||||
userMock.Setup(u => u.StartMediaId).Returns(1234);
|
||||
var user = userMock.Object;
|
||||
|
||||
//act
|
||||
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -21);
|
||||
|
||||
//assert
|
||||
Assert.IsFalse(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@ using System.Web.Mvc;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Web;
|
||||
|
||||
namespace Umbraco.Tests.Mvc
|
||||
namespace Umbraco.Tests.Web.Mvc
|
||||
{
|
||||
[TestFixture]
|
||||
public class HtmlHelperExtensionMethodsTests
|
||||
+85
-85
@@ -1,86 +1,86 @@
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace Umbraco.Tests.Mvc
|
||||
{
|
||||
[TestFixture]
|
||||
public class MergeParentContextViewDataAttributeTests
|
||||
{
|
||||
[Test]
|
||||
public void Ensure_All_Ancestor_ViewData_Is_Merged()
|
||||
{
|
||||
var http = new FakeHttpContextFactory("http://localhost");
|
||||
|
||||
//setup an heirarchy
|
||||
var rootViewCtx = new ViewContext {Controller = new MyController(), RequestContext = http.RequestContext, ViewData = new ViewDataDictionary()};
|
||||
var parentViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, RouteData = new RouteData(), ViewData = new ViewDataDictionary() };
|
||||
parentViewCtx.RouteData.DataTokens.Add("ParentActionViewContext", rootViewCtx);
|
||||
var controllerCtx = new ControllerContext(http.RequestContext, new MyController()) {RouteData = new RouteData()};
|
||||
controllerCtx.RouteData.DataTokens.Add("ParentActionViewContext", parentViewCtx);
|
||||
|
||||
//set up the view data
|
||||
controllerCtx.Controller.ViewData["Test1"] = "Test1";
|
||||
controllerCtx.Controller.ViewData["Test2"] = "Test2";
|
||||
controllerCtx.Controller.ViewData["Test3"] = "Test3";
|
||||
parentViewCtx.ViewData["Test4"] = "Test4";
|
||||
parentViewCtx.ViewData["Test5"] = "Test5";
|
||||
parentViewCtx.ViewData["Test6"] = "Test6";
|
||||
rootViewCtx.ViewData["Test7"] = "Test7";
|
||||
rootViewCtx.ViewData["Test8"] = "Test8";
|
||||
rootViewCtx.ViewData["Test9"] = "Test9";
|
||||
|
||||
var filter = new ResultExecutingContext(controllerCtx, new ContentResult()) {RouteData = controllerCtx.RouteData};
|
||||
var att = new MergeParentContextViewDataAttribute();
|
||||
|
||||
Assert.IsTrue(filter.IsChildAction);
|
||||
att.OnResultExecuting(filter);
|
||||
|
||||
Assert.AreEqual(9, controllerCtx.Controller.ViewData.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Ensure_All_Ancestor_ViewData_Is_Merged_Without_Data_Loss()
|
||||
{
|
||||
var http = new FakeHttpContextFactory("http://localhost");
|
||||
|
||||
//setup an heirarchy
|
||||
var rootViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, ViewData = new ViewDataDictionary() };
|
||||
var parentViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, RouteData = new RouteData(), ViewData = new ViewDataDictionary() };
|
||||
parentViewCtx.RouteData.DataTokens.Add("ParentActionViewContext", rootViewCtx);
|
||||
var controllerCtx = new ControllerContext(http.RequestContext, new MyController()) { RouteData = new RouteData() };
|
||||
controllerCtx.RouteData.DataTokens.Add("ParentActionViewContext", parentViewCtx);
|
||||
|
||||
//set up the view data with overlapping keys
|
||||
controllerCtx.Controller.ViewData["Test1"] = "Test1";
|
||||
controllerCtx.Controller.ViewData["Test2"] = "Test2";
|
||||
controllerCtx.Controller.ViewData["Test3"] = "Test3";
|
||||
parentViewCtx.ViewData["Test2"] = "Test4";
|
||||
parentViewCtx.ViewData["Test3"] = "Test5";
|
||||
parentViewCtx.ViewData["Test4"] = "Test6";
|
||||
rootViewCtx.ViewData["Test3"] = "Test7";
|
||||
rootViewCtx.ViewData["Test4"] = "Test8";
|
||||
rootViewCtx.ViewData["Test5"] = "Test9";
|
||||
|
||||
var filter = new ResultExecutingContext(controllerCtx, new ContentResult()) { RouteData = controllerCtx.RouteData };
|
||||
var att = new MergeParentContextViewDataAttribute();
|
||||
|
||||
Assert.IsTrue(filter.IsChildAction);
|
||||
att.OnResultExecuting(filter);
|
||||
|
||||
Assert.AreEqual(5, controllerCtx.Controller.ViewData.Count);
|
||||
Assert.AreEqual("Test1", controllerCtx.Controller.ViewData["Test1"]);
|
||||
Assert.AreEqual("Test2", controllerCtx.Controller.ViewData["Test2"]);
|
||||
Assert.AreEqual("Test3", controllerCtx.Controller.ViewData["Test3"]);
|
||||
Assert.AreEqual("Test6", controllerCtx.Controller.ViewData["Test4"]);
|
||||
Assert.AreEqual("Test9", controllerCtx.Controller.ViewData["Test5"]);
|
||||
}
|
||||
|
||||
internal class MyController : Controller
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace Umbraco.Tests.Web.Mvc
|
||||
{
|
||||
[TestFixture]
|
||||
public class MergeParentContextViewDataAttributeTests
|
||||
{
|
||||
[Test]
|
||||
public void Ensure_All_Ancestor_ViewData_Is_Merged()
|
||||
{
|
||||
var http = new FakeHttpContextFactory("http://localhost");
|
||||
|
||||
//setup an heirarchy
|
||||
var rootViewCtx = new ViewContext {Controller = new MyController(), RequestContext = http.RequestContext, ViewData = new ViewDataDictionary()};
|
||||
var parentViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, RouteData = new RouteData(), ViewData = new ViewDataDictionary() };
|
||||
parentViewCtx.RouteData.DataTokens.Add("ParentActionViewContext", rootViewCtx);
|
||||
var controllerCtx = new ControllerContext(http.RequestContext, new MyController()) {RouteData = new RouteData()};
|
||||
controllerCtx.RouteData.DataTokens.Add("ParentActionViewContext", parentViewCtx);
|
||||
|
||||
//set up the view data
|
||||
controllerCtx.Controller.ViewData["Test1"] = "Test1";
|
||||
controllerCtx.Controller.ViewData["Test2"] = "Test2";
|
||||
controllerCtx.Controller.ViewData["Test3"] = "Test3";
|
||||
parentViewCtx.ViewData["Test4"] = "Test4";
|
||||
parentViewCtx.ViewData["Test5"] = "Test5";
|
||||
parentViewCtx.ViewData["Test6"] = "Test6";
|
||||
rootViewCtx.ViewData["Test7"] = "Test7";
|
||||
rootViewCtx.ViewData["Test8"] = "Test8";
|
||||
rootViewCtx.ViewData["Test9"] = "Test9";
|
||||
|
||||
var filter = new ResultExecutingContext(controllerCtx, new ContentResult()) {RouteData = controllerCtx.RouteData};
|
||||
var att = new MergeParentContextViewDataAttribute();
|
||||
|
||||
Assert.IsTrue(filter.IsChildAction);
|
||||
att.OnResultExecuting(filter);
|
||||
|
||||
Assert.AreEqual(9, controllerCtx.Controller.ViewData.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Ensure_All_Ancestor_ViewData_Is_Merged_Without_Data_Loss()
|
||||
{
|
||||
var http = new FakeHttpContextFactory("http://localhost");
|
||||
|
||||
//setup an heirarchy
|
||||
var rootViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, ViewData = new ViewDataDictionary() };
|
||||
var parentViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, RouteData = new RouteData(), ViewData = new ViewDataDictionary() };
|
||||
parentViewCtx.RouteData.DataTokens.Add("ParentActionViewContext", rootViewCtx);
|
||||
var controllerCtx = new ControllerContext(http.RequestContext, new MyController()) { RouteData = new RouteData() };
|
||||
controllerCtx.RouteData.DataTokens.Add("ParentActionViewContext", parentViewCtx);
|
||||
|
||||
//set up the view data with overlapping keys
|
||||
controllerCtx.Controller.ViewData["Test1"] = "Test1";
|
||||
controllerCtx.Controller.ViewData["Test2"] = "Test2";
|
||||
controllerCtx.Controller.ViewData["Test3"] = "Test3";
|
||||
parentViewCtx.ViewData["Test2"] = "Test4";
|
||||
parentViewCtx.ViewData["Test3"] = "Test5";
|
||||
parentViewCtx.ViewData["Test4"] = "Test6";
|
||||
rootViewCtx.ViewData["Test3"] = "Test7";
|
||||
rootViewCtx.ViewData["Test4"] = "Test8";
|
||||
rootViewCtx.ViewData["Test5"] = "Test9";
|
||||
|
||||
var filter = new ResultExecutingContext(controllerCtx, new ContentResult()) { RouteData = controllerCtx.RouteData };
|
||||
var att = new MergeParentContextViewDataAttribute();
|
||||
|
||||
Assert.IsTrue(filter.IsChildAction);
|
||||
att.OnResultExecuting(filter);
|
||||
|
||||
Assert.AreEqual(5, controllerCtx.Controller.ViewData.Count);
|
||||
Assert.AreEqual("Test1", controllerCtx.Controller.ViewData["Test1"]);
|
||||
Assert.AreEqual("Test2", controllerCtx.Controller.ViewData["Test2"]);
|
||||
Assert.AreEqual("Test3", controllerCtx.Controller.ViewData["Test3"]);
|
||||
Assert.AreEqual("Test6", controllerCtx.Controller.ViewData["Test4"]);
|
||||
Assert.AreEqual("Test9", controllerCtx.Controller.ViewData["Test5"]);
|
||||
}
|
||||
|
||||
internal class MyController : Controller
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@ using Umbraco.Web.Mvc;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace Umbraco.Tests.Mvc
|
||||
namespace Umbraco.Tests.Web.Mvc
|
||||
{
|
||||
[TestFixture]
|
||||
public class RenderIndexActionSelectorAttributeTests
|
||||
+2
-5
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.CodeDom;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
@@ -12,7 +11,6 @@ using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Dictionary;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.ObjectResolution;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Profiling;
|
||||
@@ -20,11 +18,10 @@ using Umbraco.Core.Services;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Mvc;
|
||||
using Umbraco.Web.PublishedCache;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace Umbraco.Tests.Mvc
|
||||
namespace Umbraco.Tests.Web.Mvc
|
||||
{
|
||||
[TestFixture]
|
||||
public class SurfaceControllerTests
|
||||
@@ -165,7 +162,7 @@ namespace Umbraco.Tests.Mvc
|
||||
};
|
||||
|
||||
var routeData = new RouteData();
|
||||
routeData.DataTokens.Add("umbraco-route-def", routeDefinition);
|
||||
routeData.DataTokens.Add(Umbraco.Core.Constants.Web.UmbracoRouteDefinitionDataToken, routeDefinition);
|
||||
|
||||
var ctrl = new TestSurfaceController(umbCtx, new UmbracoHelper());
|
||||
ctrl.ControllerContext = new ControllerContext(contextBase, routeData, ctrl);
|
||||
+8
-12
@@ -1,27 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using System.Xml;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using umbraco.BusinessLogic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Profiling;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Security;
|
||||
using umbraco.BusinessLogic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Tests.PublishedContent;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Tests.TestHelpers.Stubs;
|
||||
using Umbraco.Web;
|
||||
@@ -30,8 +25,9 @@ using Umbraco.Web.Mvc;
|
||||
using Umbraco.Web.PublishedCache;
|
||||
using Umbraco.Web.PublishedCache.XmlPublishedCache;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace Umbraco.Tests.Mvc
|
||||
namespace Umbraco.Tests.Web.Mvc
|
||||
{
|
||||
[TestFixture]
|
||||
public class UmbracoViewPageTests
|
||||
@@ -445,7 +441,7 @@ namespace Umbraco.Tests.Mvc
|
||||
|
||||
var context = new ViewContext();
|
||||
context.RouteData = new RouteData();
|
||||
context.RouteData.DataTokens.Add("umbraco-context", umbracoContext);
|
||||
context.RouteData.DataTokens.Add(Umbraco.Core.Constants.Web.UmbracoContextDataToken, umbracoContext);
|
||||
|
||||
return context;
|
||||
}
|
||||
+40
-42
@@ -1,42 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace Umbraco.Tests.Mvc
|
||||
{
|
||||
[TestFixture]
|
||||
public class ViewDataDictionaryExtensionTests
|
||||
{
|
||||
[Test]
|
||||
public void Merge_View_Data()
|
||||
{
|
||||
var source = new ViewDataDictionary();
|
||||
var dest = new ViewDataDictionary();
|
||||
source.Add("Test1", "Test1");
|
||||
dest.Add("Test2", "Test2");
|
||||
|
||||
dest.MergeViewDataFrom(source);
|
||||
|
||||
Assert.AreEqual(2, dest.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Merge_View_Data_Retains_Destination_Values()
|
||||
{
|
||||
var source = new ViewDataDictionary();
|
||||
var dest = new ViewDataDictionary();
|
||||
source.Add("Test1", "Test1");
|
||||
dest.Add("Test1", "MyValue");
|
||||
dest.Add("Test2", "Test2");
|
||||
|
||||
dest.MergeViewDataFrom(source);
|
||||
|
||||
Assert.AreEqual(2, dest.Count);
|
||||
Assert.AreEqual("MyValue", dest["Test1"]);
|
||||
Assert.AreEqual("Test2", dest["Test2"]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System.Web.Mvc;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace Umbraco.Tests.Web.Mvc
|
||||
{
|
||||
[TestFixture]
|
||||
public class ViewDataDictionaryExtensionTests
|
||||
{
|
||||
[Test]
|
||||
public void Merge_View_Data()
|
||||
{
|
||||
var source = new ViewDataDictionary();
|
||||
var dest = new ViewDataDictionary();
|
||||
source.Add("Test1", "Test1");
|
||||
dest.Add("Test2", "Test2");
|
||||
|
||||
dest.MergeViewDataFrom(source);
|
||||
|
||||
Assert.AreEqual(2, dest.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Merge_View_Data_Retains_Destination_Values()
|
||||
{
|
||||
var source = new ViewDataDictionary();
|
||||
var dest = new ViewDataDictionary();
|
||||
source.Add("Test1", "Test1");
|
||||
dest.Add("Test1", "MyValue");
|
||||
dest.Add("Test2", "Test2");
|
||||
|
||||
dest.MergeViewDataFrom(source);
|
||||
|
||||
Assert.AreEqual(2, dest.Count);
|
||||
Assert.AreEqual("MyValue", dest["Test1"]);
|
||||
Assert.AreEqual("Test2", dest["Test2"]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Profiling;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Mvc;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Web.Security;
|
||||
|
||||
namespace Umbraco.Tests.Web
|
||||
{
|
||||
[TestFixture]
|
||||
public class WebExtensionMethodTests
|
||||
{
|
||||
|
||||
[Test]
|
||||
public void UmbracoContextExtensions_GetUmbracoContext()
|
||||
{
|
||||
var appCtx = new ApplicationContext(
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
var umbCtx = UmbracoContext.CreateContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
|
||||
Mock.Of<IUmbracoSettingsSection>(),
|
||||
new List<IUrlProvider>(),
|
||||
false);
|
||||
var items = new Dictionary<object, object>()
|
||||
{
|
||||
{UmbracoContext.HttpContextItemName, umbCtx}
|
||||
};
|
||||
var http = new Mock<HttpContextBase>();
|
||||
http.Setup(x => x.Items).Returns(items);
|
||||
|
||||
var result = http.Object.GetUmbracoContext();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreSame(umbCtx, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RouteDataExtensions_GetUmbracoContext()
|
||||
{
|
||||
var appCtx = new ApplicationContext(
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
var umbCtx = UmbracoContext.CreateContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
|
||||
Mock.Of<IUmbracoSettingsSection>(),
|
||||
new List<IUrlProvider>(),
|
||||
false);
|
||||
var r1 = new RouteData();
|
||||
r1.DataTokens.Add(Core.Constants.Web.UmbracoContextDataToken, umbCtx);
|
||||
|
||||
var result = r1.GetUmbracoContext();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreSame(umbCtx, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ControllerContextExtensions_GetUmbracoContext_From_RouteValues()
|
||||
{
|
||||
var appCtx = new ApplicationContext(
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
var umbCtx = UmbracoContext.CreateContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
|
||||
Mock.Of<IUmbracoSettingsSection>(),
|
||||
new List<IUrlProvider>(),
|
||||
false);
|
||||
|
||||
var r1 = new RouteData();
|
||||
r1.DataTokens.Add(Core.Constants.Web.UmbracoContextDataToken, umbCtx);
|
||||
var ctx1 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r1, new MyController()));
|
||||
var r2 = new RouteData();
|
||||
r2.DataTokens.Add("ParentActionViewContext", ctx1);
|
||||
var ctx2 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r2, new MyController()));
|
||||
var r3 = new RouteData();
|
||||
r3.DataTokens.Add("ParentActionViewContext", ctx2);
|
||||
var ctx3 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r3, new MyController()));
|
||||
|
||||
var result = ctx3.GetUmbracoContext();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreSame(umbCtx, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ControllerContextExtensions_GetUmbracoContext_From_HttpContext()
|
||||
{
|
||||
var appCtx = new ApplicationContext(
|
||||
CacheHelper.CreateDisabledCacheHelper(),
|
||||
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
|
||||
var umbCtx = UmbracoContext.CreateContext(
|
||||
Mock.Of<HttpContextBase>(),
|
||||
appCtx,
|
||||
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
|
||||
Mock.Of<IUmbracoSettingsSection>(),
|
||||
new List<IUrlProvider>(),
|
||||
false);
|
||||
var items = new Dictionary<object, object>()
|
||||
{
|
||||
{UmbracoContext.HttpContextItemName, umbCtx}
|
||||
};
|
||||
var http = new Mock<HttpContextBase>();
|
||||
http.Setup(x => x.Items).Returns(items);
|
||||
|
||||
var r1 = new RouteData();
|
||||
var ctx1 = CreateViewContext(new ControllerContext(http.Object, r1, new MyController()));
|
||||
var r2 = new RouteData();
|
||||
r2.DataTokens.Add("ParentActionViewContext", ctx1);
|
||||
var ctx2 = CreateViewContext(new ControllerContext(http.Object, r2, new MyController()));
|
||||
var r3 = new RouteData();
|
||||
r3.DataTokens.Add("ParentActionViewContext", ctx2);
|
||||
var ctx3 = CreateViewContext(new ControllerContext(http.Object, r3, new MyController()));
|
||||
|
||||
var result = ctx3.GetUmbracoContext();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreSame(umbCtx, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ControllerContextExtensions_GetDataTokenInViewContextHierarchy()
|
||||
{
|
||||
var r1 = new RouteData();
|
||||
r1.DataTokens.Add("hello", "world");
|
||||
var ctx1 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r1, new MyController()));
|
||||
var r2 = new RouteData();
|
||||
r2.DataTokens.Add("ParentActionViewContext", ctx1);
|
||||
var ctx2 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r2, new MyController()));
|
||||
var r3 = new RouteData();
|
||||
r3.DataTokens.Add("ParentActionViewContext", ctx2);
|
||||
var ctx3 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r3, new MyController()));
|
||||
|
||||
var result = ctx3.GetDataTokenInViewContextHierarchy("hello");
|
||||
|
||||
Assert.IsNotNull(result as string);
|
||||
Assert.AreEqual((string)result, "world");
|
||||
}
|
||||
|
||||
private ViewContext CreateViewContext(ControllerContext ctx)
|
||||
{
|
||||
return new ViewContext(ctx, Mock.Of<IView>(),
|
||||
new ViewDataDictionary(), new TempDataDictionary(), new StringWriter());
|
||||
}
|
||||
|
||||
private class MyController : Controller
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,13 +13,15 @@
|
||||
<package id="Microsoft.AspNet.WebApi.SelfHost" version="4.0.30506.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
|
||||
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="Moq" version="4.1.1309.0919" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
|
||||
<package id="NUnit" version="2.6.2" targetFramework="net45" />
|
||||
<package id="Owin" version="1.0" targetFramework="net45" />
|
||||
<package id="Selenium.WebDriver" version="2.32.0" targetFramework="net45" />
|
||||
<package id="semver" version="1.1.2" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
|
||||
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net45" />
|
||||
<package id="SqlServerCE" version="4.0.0.1" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"env": {
|
||||
"env": {
|
||||
"browser": true
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
],
|
||||
|
||||
"rules": {
|
||||
"eqeqeq": 2,
|
||||
"eqeqeq": 2,
|
||||
"curly": 2,
|
||||
|
||||
"no-unused-vars": 1,
|
||||
@@ -18,8 +18,8 @@
|
||||
"dot-notation": 1,
|
||||
|
||||
"no-use-before-define": 0,
|
||||
"angular/ng_controller_as": 1,
|
||||
"angular/ng_controller_as_vm": 1,
|
||||
"angular/ng_controller_as": 1,
|
||||
"angular/ng_controller_as_vm": 1,
|
||||
|
||||
|
||||
"strict": 0,
|
||||
@@ -32,8 +32,8 @@
|
||||
"comma-spacing": 0,
|
||||
"no-trailing-spaces": 0,
|
||||
"eol-last": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
"camelcase": 0
|
||||
"no-underscore-dangle": 0,
|
||||
"camelcase": 0
|
||||
},
|
||||
|
||||
"globals": {
|
||||
@@ -50,4 +50,4 @@
|
||||
"Bloodhound", false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,6 +361,12 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
|
||||
rootScope : function(){
|
||||
return getRootScope();
|
||||
},
|
||||
|
||||
reloadLocation: function() {
|
||||
var injector = getRootInjector();
|
||||
var $route = injector.get("$route");
|
||||
$route.reload();
|
||||
},
|
||||
|
||||
closeModalWindow: function(rVal) {
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"grunt-ngdocs": "~0.1.2",
|
||||
"grunt-open": "~0.2.0",
|
||||
"grunt-postcss": "~0.6.0",
|
||||
"grunt-recess": "~0.3",
|
||||
"grunt-recess": "~1.0.1",
|
||||
"karma": "~0.9",
|
||||
"karma-chrome-launcher": "0.0.2",
|
||||
"karma-coffee-preprocessor": "0.0.1",
|
||||
|
||||
+84
-2
@@ -3,11 +3,93 @@
|
||||
* @name umbraco.directives.directive:umbNavigation
|
||||
* @restrict E
|
||||
**/
|
||||
function umbNavigationDirective() {
|
||||
function umbNavigationDirective(appState, $location) {
|
||||
return {
|
||||
restrict: "E", // restrict to an element
|
||||
replace: true, // replace the html element with the template
|
||||
templateUrl: 'views/components/application/umb-navigation.html'
|
||||
templateUrl: 'views/components/application/umb-navigation.html',
|
||||
link: function (scope, element, attr, ctrl) {
|
||||
|
||||
scope.showTreeNavigation = appState.getGlobalState("showNavigation");
|
||||
|
||||
scope.searchClick = function() {
|
||||
scope.searchOverlay = {
|
||||
view: "search",
|
||||
show: true,
|
||||
submit: function(model) {
|
||||
$location.path(model.selectedItem.editorPath);
|
||||
scope.searchOverlay.show = false;
|
||||
scope.searchOverlay = null;
|
||||
},
|
||||
close: function(oldModel) {
|
||||
scope.searchOverlay.show = false;
|
||||
scope.searchOverlay = null;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
scope.avatarClick = function(){
|
||||
|
||||
if(scope.helpDialog) {
|
||||
closeHelpDialog();
|
||||
}
|
||||
|
||||
if(!scope.userDialog) {
|
||||
scope.userDialog = {
|
||||
view: "user",
|
||||
show: true,
|
||||
close: function(oldModel) {
|
||||
closeUserDialog();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
closeUserDialog();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function closeUserDialog() {
|
||||
scope.userDialog.show = false;
|
||||
scope.userDialog = null;
|
||||
}
|
||||
|
||||
scope.helpClick = function(){
|
||||
|
||||
if(scope.userDialog) {
|
||||
closeUserDialog();
|
||||
}
|
||||
|
||||
if(!scope.helpDialog) {
|
||||
scope.helpDialog = {
|
||||
view: "help",
|
||||
show: true,
|
||||
close: function(oldModel) {
|
||||
closeHelpDialog();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
closeHelpDialog();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
function closeHelpDialog() {
|
||||
scope.helpDialog.show = false;
|
||||
scope.helpDialog = null;
|
||||
}
|
||||
|
||||
|
||||
scope.showTree = function () {
|
||||
scope.showTreeNavigation = appState.getGlobalState("showNavigation");
|
||||
if(scope.showTreeNavigation === true) {
|
||||
appState.setGlobalState("showNavigation", false);
|
||||
} else {
|
||||
appState.setGlobalState("showNavigation", true);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+14
-55
@@ -11,7 +11,7 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
|
||||
link: function (scope, element, attr, ctrl) {
|
||||
|
||||
//setup scope vars
|
||||
scope.maxSections = 7;
|
||||
scope.maxSections = 5;
|
||||
scope.overflowingSections = 0;
|
||||
scope.sections = [];
|
||||
scope.currentSection = appState.getSectionState("currentSection");
|
||||
@@ -34,16 +34,25 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
|
||||
sectionResource.getSections()
|
||||
.then(function (result) {
|
||||
scope.sections = result;
|
||||
calculateHeight();
|
||||
|
||||
// hide overflowing sections
|
||||
scope.totalSections = scope.sections.length;
|
||||
|
||||
if(scope.totalSections > scope.maxSections){
|
||||
scope.needTray = true;
|
||||
scope.overflowingSections = scope.maxSections - scope.totalSections;
|
||||
}
|
||||
|
||||
// calculateHeight();
|
||||
});
|
||||
}
|
||||
|
||||
function calculateHeight(){
|
||||
$timeout(function(){
|
||||
//total height minus room for avatar and help icon
|
||||
var height = $(window).height()-200;
|
||||
var height = $(window).width();
|
||||
scope.totalSections = scope.sections.length;
|
||||
scope.maxSections = Math.floor(height / 70);
|
||||
scope.maxSections = Math.floor(width / 70);
|
||||
scope.needTray = false;
|
||||
|
||||
if(scope.totalSections > scope.maxSections){
|
||||
@@ -84,57 +93,7 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
|
||||
});
|
||||
|
||||
//on page resize
|
||||
window.onresize = calculateHeight;
|
||||
|
||||
scope.avatarClick = function(){
|
||||
|
||||
if(scope.helpDialog) {
|
||||
closeHelpDialog();
|
||||
}
|
||||
|
||||
if(!scope.userDialog) {
|
||||
scope.userDialog = {
|
||||
view: "user",
|
||||
show: true,
|
||||
close: function(oldModel) {
|
||||
closeUserDialog();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
closeUserDialog();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function closeUserDialog() {
|
||||
scope.userDialog.show = false;
|
||||
scope.userDialog = null;
|
||||
}
|
||||
|
||||
scope.helpClick = function(){
|
||||
|
||||
if(scope.userDialog) {
|
||||
closeUserDialog();
|
||||
}
|
||||
|
||||
if(!scope.helpDialog) {
|
||||
scope.helpDialog = {
|
||||
view: "help",
|
||||
show: true,
|
||||
close: function(oldModel) {
|
||||
closeHelpDialog();
|
||||
}
|
||||
};
|
||||
} else {
|
||||
closeHelpDialog();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function closeHelpDialog() {
|
||||
scope.helpDialog.show = false;
|
||||
scope.helpDialog = null;
|
||||
}
|
||||
// window.onresize = calculateHeight;
|
||||
|
||||
scope.sectionClick = function (event, section) {
|
||||
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function TreeNavigation(appState) {
|
||||
|
||||
function link(scope, el, attr, ctrl) {
|
||||
scope.showTreeNavigation = false;
|
||||
scope.currentSection = appState.getSectionState("currentSection");
|
||||
|
||||
scope.$watch(function(){
|
||||
return appState.getGlobalState("showNavigation");
|
||||
}, function (newValue) {
|
||||
scope.showTreeNavigation = newValue;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
var directive = {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/application/umb-tree-navigation.html',
|
||||
link: link
|
||||
};
|
||||
|
||||
return directive;
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbTreeNavigation', TreeNavigation);
|
||||
|
||||
})();
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function EditorSubView() {
|
||||
|
||||
var directive = {
|
||||
transclude: true,
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/editor/subview/umb-editor-sub-view.html'
|
||||
};
|
||||
|
||||
return directive;
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbEditorSubView', EditorSubView);
|
||||
|
||||
})();
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function EditorSubViewContainer() {
|
||||
|
||||
var directive = {
|
||||
transclude: true,
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/editor/subview/umb-editor-sub-view-container.html'
|
||||
};
|
||||
|
||||
return directive;
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbEditorSubViewContainer', EditorSubViewContainer);
|
||||
|
||||
})();
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function EditorSubViewContent() {
|
||||
|
||||
var directive = {
|
||||
transclude: true,
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/editor/subview/umb-editor-sub-view-content.html'
|
||||
};
|
||||
|
||||
return directive;
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbEditorSubViewContent', EditorSubViewContent);
|
||||
|
||||
})();
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function EditorSubViewHeader() {
|
||||
|
||||
var directive = {
|
||||
transclude: true,
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/editor/subview/umb-editor-sub-view-header.html'
|
||||
};
|
||||
|
||||
return directive;
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbEditorSubViewHeader', EditorSubViewHeader);
|
||||
|
||||
})();
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function EditorSubViewSidebar() {
|
||||
|
||||
var directive = {
|
||||
transclude: true,
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/editor/subview/umb-editor-sub-view-sidebar.html'
|
||||
};
|
||||
|
||||
return directive;
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbEditorSubViewSidebar', EditorSubViewSidebar);
|
||||
|
||||
})();
|
||||
+77
-1
@@ -1,10 +1,25 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function EditorHeaderDirective(iconHelper) {
|
||||
function EditorHeaderDirective(iconHelper, variationsHelper) {
|
||||
|
||||
function link(scope, el, attr, ctrl) {
|
||||
|
||||
scope.showVariationsQuickSwitchToggle = false;
|
||||
scope.showVariationsQuickSwitch = false;
|
||||
|
||||
function activate() {
|
||||
showVariationsQuickSwitch(scope.variations);
|
||||
}
|
||||
|
||||
function showVariationsQuickSwitch(variations) {
|
||||
if(variations && variations.length > 1 || variations && variations.length === 1 && variations[0].variations && variations[0].variations.length > 0) {
|
||||
scope.showVariationsQuickSwitchToggle = true;
|
||||
} else {
|
||||
scope.showVariationsQuickSwitchToggle = false;
|
||||
}
|
||||
}
|
||||
|
||||
scope.openIconPicker = function() {
|
||||
scope.dialogModel = {
|
||||
view: "iconpicker",
|
||||
@@ -24,6 +39,62 @@
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
scope.toggleVariationsQuickSwitch = function() {
|
||||
scope.showVariationsQuickSwitch = !scope.showVariationsQuickSwitch;
|
||||
};
|
||||
|
||||
scope.hideVariationsQuickSwitch = function() {
|
||||
scope.showVariationsQuickSwitch = false;
|
||||
};
|
||||
|
||||
scope.toggleSubItems = function(item, $event) {
|
||||
item.showSubItems = !item.showSubItems;
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
|
||||
};
|
||||
|
||||
scope.selectItem = function(item) {
|
||||
if(scope.onSelectItem) {
|
||||
|
||||
for(var i = 0; i < scope.variations.length; i++) {
|
||||
var language = scope.variations[i];
|
||||
language.active = false;
|
||||
|
||||
if(language.variations && language.variations.length > 0) {
|
||||
for(var variationIndex = 0; variationIndex < language.variations.length; variationIndex++) {
|
||||
var variation = language.variations[variationIndex];
|
||||
variation.active = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// set selected item to active
|
||||
item.active = true;
|
||||
|
||||
scope.onSelectItem(item);
|
||||
scope.showVariationsQuickSwitch = false;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
scope.openInSplitView = function(item, $event) {
|
||||
if(scope.onOpenInSplitView) {
|
||||
scope.onOpenInSplitView(item);
|
||||
scope.showVariationsQuickSwitch = false;
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
||||
scope.$watch('variations', function(newValue, oldValue){
|
||||
showVariationsQuickSwitch(newValue);
|
||||
}, true);
|
||||
|
||||
activate();
|
||||
|
||||
}
|
||||
|
||||
var directive = {
|
||||
@@ -37,6 +108,11 @@
|
||||
actions: "=",
|
||||
name: "=",
|
||||
nameLocked: "=",
|
||||
variation: "=",
|
||||
language: "=",
|
||||
variations: "=",
|
||||
onSelectItem: "=",
|
||||
onOpenInSplitView: "=",
|
||||
menu: "=",
|
||||
icon: "=",
|
||||
hideIcon: "@",
|
||||
|
||||
+32
@@ -6,10 +6,21 @@
|
||||
function link(scope, el, attr, ctrl) {
|
||||
|
||||
scope.showNavigation = true;
|
||||
scope.showDropdown = false;
|
||||
scope.maxNavigationItems = 5;
|
||||
scope.overflowingNavigationsItems = 0;
|
||||
scope.needDropdown = false;
|
||||
|
||||
scope.clickNavigationItem = function(selectedItem) {
|
||||
|
||||
setItemToActive(selectedItem);
|
||||
|
||||
runItemAction(selectedItem);
|
||||
|
||||
if(scope.showDropdown) {
|
||||
scope.closeDropdown();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function runItemAction(selectedItem) {
|
||||
@@ -40,8 +51,29 @@
|
||||
scope.showNavigation = false;
|
||||
}
|
||||
|
||||
hideOverflowingNavigationItems();
|
||||
|
||||
}
|
||||
|
||||
function hideOverflowingNavigationItems() {
|
||||
|
||||
scope.totalNavigationItems = scope.navigation.length;
|
||||
|
||||
if(scope.totalNavigationItems > scope.maxNavigationItems){
|
||||
scope.needDropdown = true;
|
||||
scope.overflowingNavigationsItems = scope.maxNavigationItems - scope.totalNavigationItems;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
scope.toggleDropdown = function() {
|
||||
scope.showDropdown = !scope.showDropdown;
|
||||
};
|
||||
|
||||
scope.closeDropdown = function() {
|
||||
scope.showDropdown = false;
|
||||
};
|
||||
|
||||
activate();
|
||||
|
||||
}
|
||||
|
||||
+1
-28
@@ -3,32 +3,6 @@
|
||||
|
||||
function EditorSubViewsDirective() {
|
||||
|
||||
function link(scope, el, attr, ctrl) {
|
||||
|
||||
scope.activeView = {};
|
||||
|
||||
// set toolbar from selected navigation item
|
||||
function setActiveView(items) {
|
||||
|
||||
for (var index = 0; index < items.length; index++) {
|
||||
|
||||
var item = items[index];
|
||||
|
||||
if (item.active && item.view) {
|
||||
scope.activeView = item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// watch for navigation changes
|
||||
scope.$watch('subViews', function(newValue, oldValue) {
|
||||
if (newValue) {
|
||||
setActiveView(newValue);
|
||||
}
|
||||
}, true);
|
||||
|
||||
}
|
||||
|
||||
var directive = {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
@@ -36,8 +10,7 @@
|
||||
scope: {
|
||||
subViews: "=",
|
||||
model: "="
|
||||
},
|
||||
link: link
|
||||
}
|
||||
};
|
||||
|
||||
return directive;
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function EditorToolbar() {
|
||||
|
||||
var directive = {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
templateUrl: 'views/components/editor/umb-editor-toolbar.html'
|
||||
};
|
||||
|
||||
return directive;
|
||||
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbEditorToolbar', EditorToolbar);
|
||||
|
||||
})();
|
||||
+41
-5
@@ -14,7 +14,8 @@ angular.module("umbraco.directives")
|
||||
templateUrl: 'views/components/imaging/umb-image-gravity.html',
|
||||
scope: {
|
||||
src: '=',
|
||||
center: "="
|
||||
center: "=",
|
||||
onImageLoaded: "="
|
||||
},
|
||||
link: function(scope, element, attrs) {
|
||||
|
||||
@@ -26,6 +27,8 @@ angular.module("umbraco.directives")
|
||||
top: 0
|
||||
};
|
||||
|
||||
scope.loaded = false;
|
||||
|
||||
//elements
|
||||
var $viewport = element.find(".viewport");
|
||||
var $image = element.find("img");
|
||||
@@ -42,6 +45,19 @@ angular.module("umbraco.directives")
|
||||
};
|
||||
};
|
||||
|
||||
scope.setFocalPoint = function(event) {
|
||||
|
||||
scope.$emit("imageFocalPointStart");
|
||||
|
||||
var offsetX = event.offsetX - 10;
|
||||
var offsetY = event.offsetY - 10;
|
||||
|
||||
calculateGravity(offsetX, offsetY);
|
||||
|
||||
lazyEndEvent();
|
||||
|
||||
};
|
||||
|
||||
var setDimensions = function(){
|
||||
scope.dimensions.width = $image.width();
|
||||
scope.dimensions.height = $image.height();
|
||||
@@ -54,9 +70,9 @@ angular.module("umbraco.directives")
|
||||
}
|
||||
};
|
||||
|
||||
var calculateGravity = function(){
|
||||
scope.dimensions.left = $overlay[0].offsetLeft;
|
||||
scope.dimensions.top = $overlay[0].offsetTop;
|
||||
var calculateGravity = function(offsetX, offsetY){
|
||||
scope.dimensions.left = offsetX;
|
||||
scope.dimensions.top = offsetY;
|
||||
|
||||
scope.center.left = (scope.dimensions.left+10) / scope.dimensions.width;
|
||||
scope.center.top = (scope.dimensions.top+10) / scope.dimensions.height;
|
||||
@@ -80,7 +96,9 @@ angular.module("umbraco.directives")
|
||||
},
|
||||
stop: function() {
|
||||
scope.$apply(function(){
|
||||
calculateGravity();
|
||||
var offsetX = $overlay[0].offsetLeft;
|
||||
var offsetY = $overlay[0].offsetTop;
|
||||
calculateGravity(offsetX, offsetY);
|
||||
});
|
||||
|
||||
lazyEndEvent();
|
||||
@@ -91,8 +109,26 @@ angular.module("umbraco.directives")
|
||||
$image.load(function(){
|
||||
$timeout(function(){
|
||||
setDimensions();
|
||||
scope.loaded = true;
|
||||
scope.onImageLoaded();
|
||||
});
|
||||
});
|
||||
|
||||
$(window).on('resize.umbImageGravity', function(){
|
||||
scope.$apply(function(){
|
||||
$timeout(function(){
|
||||
setDimensions();
|
||||
});
|
||||
var offsetX = $overlay[0].offsetLeft;
|
||||
var offsetY = $overlay[0].offsetTop;
|
||||
calculateGravity(offsetX, offsetY);
|
||||
});
|
||||
});
|
||||
|
||||
scope.$on('$destroy', function() {
|
||||
$(window).off('.umbImageGravity');
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
+2
@@ -26,6 +26,7 @@ angular.module("umbraco.directives")
|
||||
link: function(scope, element, attrs) {
|
||||
//// INIT /////
|
||||
var $image = element.find("img");
|
||||
scope.loaded = false;
|
||||
|
||||
$image.load(function(){
|
||||
$timeout(function(){
|
||||
@@ -52,6 +53,7 @@ angular.module("umbraco.directives")
|
||||
}
|
||||
|
||||
setPreviewStyle();
|
||||
scope.loaded = true;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
+70
-4
@@ -11,22 +11,88 @@ angular.module("umbraco.directives")
|
||||
},
|
||||
transclude: true,
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
replace: true,
|
||||
templateUrl: 'views/components/property/umb-property.html',
|
||||
link: function(scope) {
|
||||
scope.propertyAlias = Umbraco.Sys.ServerVariables.isDebuggingEnabled === true ? scope.property.alias : null;
|
||||
scope.showDropdown = false;
|
||||
scope.selectedVariation = {};
|
||||
scope.variations = [
|
||||
{
|
||||
name: "Danish",
|
||||
master: true,
|
||||
selected: true
|
||||
},
|
||||
{
|
||||
name: "German"
|
||||
},
|
||||
{
|
||||
name: "Spanish"
|
||||
},
|
||||
{
|
||||
name: "Finnish"
|
||||
},
|
||||
{
|
||||
name: "Albanian"
|
||||
},
|
||||
{
|
||||
name: "Russian"
|
||||
},
|
||||
{
|
||||
name: "Norwegian"
|
||||
},
|
||||
{
|
||||
name: "Swedish"
|
||||
}
|
||||
];
|
||||
|
||||
function activate() {
|
||||
|
||||
for(var i = 0; i < scope.variations.length; i++ ) {
|
||||
var variation = scope.variations[i];
|
||||
if(variation.selected) {
|
||||
scope.property.variation = variation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scope.toggleDropdown = function() {
|
||||
scope.showDropdown = !scope.showDropdown;
|
||||
};
|
||||
|
||||
scope.closeDropdown = function() {
|
||||
scope.showDropdown = false;
|
||||
};
|
||||
|
||||
scope.editContent = function() {
|
||||
scope.property.variation = null;
|
||||
scope.showDropdown = false;
|
||||
};
|
||||
|
||||
scope.syncContent = function(selectedVariation) {
|
||||
for(var i = 0; i < scope.variations.length; i++ ) {
|
||||
var variation = scope.variations[i];
|
||||
variation.selected = false;
|
||||
}
|
||||
selectedVariation.selected = true;
|
||||
scope.property.variation = selectedVariation;
|
||||
scope.showDropdown = false;
|
||||
};
|
||||
|
||||
activate();
|
||||
|
||||
},
|
||||
//Define a controller for this directive to expose APIs to other directives
|
||||
controller: function ($scope, $timeout) {
|
||||
|
||||
|
||||
var self = this;
|
||||
|
||||
//set the API properties/methods
|
||||
|
||||
|
||||
self.property = $scope.property;
|
||||
self.setPropertyError = function(errorMsg) {
|
||||
$scope.property.propertyErrorMessage = errorMsg;
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
+4
-3
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @ngdoc directive
|
||||
* @function
|
||||
* @name umbraco.directives.directive:umbPropertyEditor
|
||||
* @name umbraco.directives.directive:umbPropertyEditor
|
||||
* @requires formController
|
||||
* @restrict E
|
||||
**/
|
||||
@@ -14,10 +14,10 @@ var _umbPropertyEditor = function (umbPropEditorHelper) {
|
||||
isPreValue: "@",
|
||||
preview: "@"
|
||||
},
|
||||
|
||||
|
||||
require: "^form",
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
replace: true,
|
||||
templateUrl: 'views/components/property/umb-property-editor.html',
|
||||
link: function (scope, element, attrs, ctrl) {
|
||||
|
||||
@@ -33,6 +33,7 @@ var _umbPropertyEditor = function (umbPropEditorHelper) {
|
||||
scope.$watch("model.view", function(val){
|
||||
scope.propertyEditorView = umbPropEditorHelper.getViewPath(scope.model.view, scope.isPreValue);
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
el.find("a:first").tab('show');
|
||||
|
||||
//enable the tab drop
|
||||
el.tabdrop();
|
||||
//el.tabdrop();
|
||||
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
scope.$on('$destroy', function () {
|
||||
|
||||
//ensure to destroy tabdrop (unbinds window resize listeners)
|
||||
el.tabdrop("destroy");
|
||||
//el.tabdrop("destroy");
|
||||
|
||||
unbindModelWatch();
|
||||
|
||||
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function Variations(iconHelper) {
|
||||
|
||||
function link(scope, el, attr, ctrl) {
|
||||
|
||||
scope.newVariation = {};
|
||||
|
||||
scope.segments = [
|
||||
{
|
||||
name: "Mobile",
|
||||
id: 1
|
||||
},
|
||||
{
|
||||
name: "Tablet",
|
||||
id: 2
|
||||
},
|
||||
{
|
||||
name: "Email Subscriber",
|
||||
id: 3
|
||||
},
|
||||
{
|
||||
name: "Email Campagin March 2016",
|
||||
id: 4
|
||||
},
|
||||
{
|
||||
name: "Codegarden Attendees",
|
||||
id: 5
|
||||
},
|
||||
{
|
||||
name: "Codegarden Attendees from abroad",
|
||||
id: 6
|
||||
}
|
||||
];
|
||||
|
||||
scope.variationsSortableOptions = {
|
||||
distance: 10,
|
||||
tolerance: "pointer",
|
||||
opacity: 0.7,
|
||||
scroll: true,
|
||||
cursor: "move",
|
||||
zIndex: 6000
|
||||
};
|
||||
|
||||
scope.showNewVariation = function(language) {
|
||||
language.showNewVariation = true;
|
||||
};
|
||||
|
||||
scope.hideNewVariation = function(language) {
|
||||
language.showNewVariation = false;
|
||||
};
|
||||
|
||||
scope.toggleEditVariation = function(selectedVariation) {
|
||||
selectedVariation.editVariation = !selectedVariation.editVariation;
|
||||
};
|
||||
|
||||
scope.createNewVariation = function(newVariation, language) {
|
||||
|
||||
var variation = angular.copy(language);
|
||||
variation.variationName = newVariation.name;
|
||||
variation.variationDescription = newVariation.description;
|
||||
variation.segments = newVariation.segments;
|
||||
variation.active = false;
|
||||
|
||||
language.variations.unshift(variation);
|
||||
|
||||
language.showNewVariation = false;
|
||||
|
||||
scope.newVariation = {
|
||||
name: "",
|
||||
description: "",
|
||||
segments: []
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
scope.saveVariation = function(variation, language) {
|
||||
variation.editVariation = false;
|
||||
};
|
||||
|
||||
scope.deleteVariation = function(variation, language) {
|
||||
var index = language.variations.indexOf(variation);
|
||||
language.variations.splice(index, 1);
|
||||
};
|
||||
|
||||
scope.hideEditVariation = function(variation) {
|
||||
variation.editVariation = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
var directive = {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
templateUrl: 'views/components/umb-variations.html',
|
||||
scope: {
|
||||
variations: "=",
|
||||
onClickVariation: "=",
|
||||
onSaveVariation: "=",
|
||||
onCloneVariation: "=",
|
||||
onDeleteVariation: "="
|
||||
},
|
||||
link: link
|
||||
};
|
||||
|
||||
return directive;
|
||||
}
|
||||
|
||||
angular.module('umbraco.directives').directive('umbVariations', Variations);
|
||||
|
||||
})();
|
||||
@@ -55,7 +55,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
|
||||
|
||||
var deferred = $q.defer();
|
||||
|
||||
if (!args.scope.busy && formHelper.submitForm({ scope: args.scope, statusMessage: args.statusMessage })) {
|
||||
if (!args.scope.busy && formHelper.submitForm({ scope: args.scope, statusMessage: args.statusMessage, action: args.action })) {
|
||||
|
||||
args.scope.busy = true;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ function formHelper(angularHelper, serverValidationManager, $timeout, notificati
|
||||
}
|
||||
|
||||
//the first thing any form must do is broadcast the formSubmitting event
|
||||
args.scope.$broadcast("formSubmitting", { scope: args.scope });
|
||||
args.scope.$broadcast("formSubmitting", { scope: args.scope, action: args.action });
|
||||
|
||||
//then check if the form is valid
|
||||
if (!args.skipValidation) {
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function variationsHelper() {
|
||||
|
||||
var variations = [];
|
||||
|
||||
/*
|
||||
var variations = [
|
||||
{
|
||||
language: "Danish",
|
||||
master: true,
|
||||
published: true,
|
||||
variations: [
|
||||
{
|
||||
name: "Mobile",
|
||||
description: "Danish content for mobile",
|
||||
published: true,
|
||||
segments: [
|
||||
{
|
||||
name: "Mobile"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
language: "Dutch",
|
||||
published: true,
|
||||
variations: [
|
||||
{
|
||||
name: "Mobile",
|
||||
description: "Dutch content for mobile",
|
||||
segments: [
|
||||
{
|
||||
name: "Mobile"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
language: "English (United States)",
|
||||
published: true,
|
||||
variations: [
|
||||
{
|
||||
name: "Mobile",
|
||||
description: "English content for mobile",
|
||||
published: true,
|
||||
segments: [
|
||||
{
|
||||
name: "Mobile"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Job campaign: Front-end developer",
|
||||
description: "Landing page for job thing 1",
|
||||
published: true,
|
||||
segments: [
|
||||
{
|
||||
name: "Front-end developer"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Job campaign: Back-end developer",
|
||||
description: "Landing page for job thing 2",
|
||||
published: true,
|
||||
segments: [
|
||||
{
|
||||
name: "Back-end developer"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
language: "German",
|
||||
published: true
|
||||
},
|
||||
{
|
||||
language: "Italian",
|
||||
published: true
|
||||
},
|
||||
{
|
||||
language: "Spanish",
|
||||
published: false
|
||||
},
|
||||
{
|
||||
language: "Swedish",
|
||||
published: false
|
||||
}
|
||||
];
|
||||
*/
|
||||
|
||||
function setMaster(master) {
|
||||
variations = [];
|
||||
master.master = true;
|
||||
variations.push(master);
|
||||
}
|
||||
|
||||
function getVariations() {
|
||||
return variations;
|
||||
}
|
||||
|
||||
function createVariation(variation) {
|
||||
var newVariation = angular.copy(variation);
|
||||
newVariation.master = false;
|
||||
variations.push(newVariation);
|
||||
}
|
||||
|
||||
function saveVariation(updatedVariation) {
|
||||
|
||||
for(var i = 0; i < variations.length; i++) {
|
||||
|
||||
var variation = variations[i];
|
||||
|
||||
if(variation.id === updatedVariation) {
|
||||
variation.name = updatedVariation.name;
|
||||
variation.description = updatedVariation.description;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cloneVariation(variation) {
|
||||
var variationClone = angular.copy(variation);
|
||||
variationClone.master = false;
|
||||
variationClone.published = false;
|
||||
variations.push(variationClone);
|
||||
}
|
||||
|
||||
function deleteVariation(variation, event, index) {
|
||||
variations.splice(index, 1);
|
||||
}
|
||||
|
||||
var service = {
|
||||
setMaster: setMaster,
|
||||
getVariations: getVariations,
|
||||
createVariation: createVariation,
|
||||
saveVariation: saveVariation,
|
||||
cloneVariation: cloneVariation,
|
||||
deleteVariation: deleteVariation
|
||||
};
|
||||
|
||||
return service;
|
||||
|
||||
}
|
||||
|
||||
|
||||
angular.module('umbraco.services').factory('variationsHelper', variationsHelper);
|
||||
|
||||
})();
|
||||
@@ -8,7 +8,7 @@
|
||||
* The main application controller
|
||||
*
|
||||
*/
|
||||
function MainController($scope, $rootScope, $location, $routeParams, $timeout, $http, $log, appState, treeService, notificationsService, userService, navigationService, historyService, updateChecker, assetsService, eventsService, umbRequestHelper, tmhDynamicLocale) {
|
||||
function MainController($scope, $rootScope, $location, $routeParams, $timeout, $http, $log, appState, treeService, notificationsService, userService, navigationService, historyService, updateChecker, assetsService, eventsService, umbRequestHelper, tmhDynamicLocale, $templateCache) {
|
||||
|
||||
//the null is important because we do an explicit bool check on this in the view
|
||||
//the avatar is by default the umbraco logo
|
||||
@@ -19,7 +19,7 @@ function MainController($scope, $rootScope, $location, $routeParams, $timeout, $
|
||||
{ value: "assets/img/application/logo@3x.png" }
|
||||
];
|
||||
$scope.touchDevice = appState.getGlobalState("touchDevice");
|
||||
|
||||
$scope.splitView = {};
|
||||
|
||||
$scope.removeNotification = function (index) {
|
||||
notificationsService.remove(index);
|
||||
@@ -126,6 +126,28 @@ function MainController($scope, $rootScope, $location, $routeParams, $timeout, $
|
||||
};
|
||||
}));
|
||||
|
||||
evts.push(eventsService.on("splitView.open", function(name, view) {
|
||||
|
||||
var updateTime = Date.now();
|
||||
|
||||
$scope.splitView = {
|
||||
id: view.id,
|
||||
view: view.view + "?updated=" + updateTime,
|
||||
show: true
|
||||
};
|
||||
|
||||
}));
|
||||
|
||||
$rootScope.$on('$routeChangeSuccess', function(event, current, previous) {
|
||||
$scope.closeSplitView();
|
||||
});
|
||||
|
||||
$scope.closeSplitView = function() {
|
||||
$scope.splitView.show = false;
|
||||
$scope.splitView.id = null;
|
||||
$scope.splitView.view = null;
|
||||
};
|
||||
|
||||
//ensure to unregister from all events!
|
||||
$scope.$on('$destroy', function () {
|
||||
for (var e in evts) {
|
||||
@@ -141,4 +163,4 @@ angular.module('umbraco').controller("Umbraco.MainController", MainController).
|
||||
config(function (tmhDynamicLocaleProvider) {
|
||||
//Set url for locale files
|
||||
tmhDynamicLocaleProvider.localeLocationPattern('lib/angular/1.1.5/i18n/angular-locale_{{locale}}.js');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -41,14 +41,10 @@ body {
|
||||
}
|
||||
|
||||
#contentwrapper, #contentcolumn {
|
||||
position: absolute;
|
||||
top: 0px; bottom: 0px; right: 0px; left: 80px;
|
||||
z-index: 10;
|
||||
margin: 0
|
||||
}
|
||||
|
||||
#umb-notifications-wrapper {
|
||||
left: 80px;
|
||||
// position: absolute;
|
||||
// top: 0px; bottom: 0px; right: 0px; left: 80px;
|
||||
// z-index: 10;
|
||||
// margin: 0
|
||||
}
|
||||
|
||||
#contentcolumn {
|
||||
@@ -63,24 +59,6 @@ body {
|
||||
border: none;
|
||||
}
|
||||
|
||||
#leftcolumn {
|
||||
height: 100%;
|
||||
z-index: 20;
|
||||
width: 80px;
|
||||
float: left;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#applications {
|
||||
z-index: 1000;
|
||||
height: 100%;
|
||||
left: 0px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
#applications-tray {
|
||||
z-index: 900;
|
||||
left: 80px;
|
||||
@@ -91,6 +69,7 @@ body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/*
|
||||
#search-form {
|
||||
display: block;
|
||||
margin: 0;
|
||||
@@ -102,21 +81,37 @@ body {
|
||||
overflow: hidden;
|
||||
|
||||
.form-search {
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
margin-top: 17px;
|
||||
|
||||
.umb-search-field {
|
||||
width: auto;
|
||||
min-width: 160px;
|
||||
-webkit-flex: 1;
|
||||
-ms-flex: 1;
|
||||
flex: 1;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
.form-search {
|
||||
display: flex;
|
||||
//margin-top: 17px;
|
||||
|
||||
.umb-search-field {
|
||||
width: auto;
|
||||
min-width: 160px;
|
||||
flex: 1;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
border-top: none;
|
||||
height: 60px;
|
||||
box-sizing: border-box;
|
||||
padding-left: 40px !important;
|
||||
}
|
||||
}
|
||||
|
||||
#navigation {
|
||||
left: 80px;
|
||||
@@ -199,10 +194,10 @@ body {
|
||||
z-index:9999 !important;
|
||||
}
|
||||
|
||||
@media (min-width: 1101px) {
|
||||
#contentwrapper, #umb-notifications-wrapper {left: 440px;}
|
||||
#speechbubble {left: 360px;}
|
||||
}
|
||||
// @media (min-width: 1101px) {
|
||||
// #contentwrapper, #umb-notifications-wrapper {left: 440px;}
|
||||
// #speechbubble {left: 360px;}
|
||||
// }
|
||||
|
||||
//empty section modification
|
||||
.emptySection #contentwrapper, .emptySection #umb-notifications-wrapper {left: 80px;}
|
||||
|
||||
@@ -0,0 +1,228 @@
|
||||
.umb-navigation {
|
||||
display: flex;
|
||||
flex: 0 0 @navigationBarHeight;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid @grayLight;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
.umb-navigation-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
padding: 0 20px;
|
||||
height: 49px;
|
||||
font-size: 13px;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
background: @grayLighter;
|
||||
}
|
||||
|
||||
&:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.umb-navigation-link.-current {
|
||||
color: @blue;
|
||||
}
|
||||
|
||||
.umb-navigation-link.open {
|
||||
background: @grayLighter;
|
||||
}
|
||||
|
||||
|
||||
.umb-navigation__right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
|
||||
#avatar-img {
|
||||
border-radius: 50%;
|
||||
margin: 0 0 0 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-sections__tray {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
|
||||
width: 220px;
|
||||
top: @navigationBarHeight;
|
||||
|
||||
background: white;
|
||||
|
||||
transform: translate(-42px, 0px);
|
||||
}
|
||||
|
||||
.umb-sections__tray .umb-navigation-link {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.umb-sections__tray .umb-navigation-link:hover {
|
||||
background: #ececec;
|
||||
}
|
||||
|
||||
|
||||
.umb-navigation-more {
|
||||
width: 22px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.umb-navigation-more__path {
|
||||
fill: @black;
|
||||
}
|
||||
|
||||
|
||||
// Tree Doors Downu
|
||||
#mainwrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#contentwrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
#contentcolumn {
|
||||
flex: 1 1 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
// Editor blocks
|
||||
.umb-editor-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: ~"(calc(~'100vh' - ~'@{navigationBarHeight}'))";
|
||||
}
|
||||
|
||||
.umb-editor-header {
|
||||
flex: 0 0 @editorHeaderHeight;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.umb-editor-container {
|
||||
flex: 1 1 auto;
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
//display: flex;
|
||||
//flex-direction: row;
|
||||
}
|
||||
|
||||
.umb-editor-content {
|
||||
padding: 30px 20px;
|
||||
}
|
||||
|
||||
.umb-editor-container-test {
|
||||
flex: 1 1 auto;
|
||||
padding: 30px 20px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.umb-editor-container-sidebar {
|
||||
flex: 0 0 400px;
|
||||
padding: 30px 20px;
|
||||
border-left: 1px solid @grayLight;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.umb-editor-drawer {
|
||||
flex: 0 0 31px;
|
||||
}
|
||||
|
||||
.umb-tree-navigation {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 0 0 300px;
|
||||
border-right: 1px solid @grayLight;
|
||||
overflow-y: auto;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-panel-header-content-wrapper {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-toggle-tree {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
height: 49px;
|
||||
width: 20px;
|
||||
padding: 0 20px;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
transition: background-color 80ms ease;
|
||||
}
|
||||
|
||||
.umb-toggle-icon {
|
||||
margin: 0 auto 0 0;
|
||||
width: 20px;
|
||||
height: 2px;
|
||||
background-color: @grayLight;
|
||||
transition: all 80ms ease;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.umb-toggle-icon:before,
|
||||
.umb-toggle-icon:after {
|
||||
content: '';
|
||||
width: 20px;
|
||||
height: 2px;
|
||||
display: block;
|
||||
background-color: @grayLight;
|
||||
transition: all 80ms ease;
|
||||
}
|
||||
|
||||
.umb-toggle-icon:before {
|
||||
transform: translate(0, -5px);
|
||||
width: 15px;
|
||||
}
|
||||
|
||||
.umb-toggle-icon:after {
|
||||
transform: translate(0, 3px);
|
||||
width: 9px;
|
||||
}
|
||||
|
||||
.umb-toggle-tree:hover,
|
||||
.umb-toggle-tree.-open {
|
||||
background: @grayLighter;
|
||||
}
|
||||
|
||||
.umb-toggle-tree:hover .umb-toggle-icon,
|
||||
.umb-toggle-tree:hover .umb-toggle-icon:before,
|
||||
.umb-toggle-tree:hover .umb-toggle-icon:after {
|
||||
background-color: @grayMed;
|
||||
}
|
||||
|
||||
.umb-toggle-tree.-open .umb-toggle-icon,
|
||||
.umb-toggle-tree.-open .umb-toggle-icon:before,
|
||||
.umb-toggle-tree.-open .umb-toggle-icon:after {
|
||||
width: 20px;
|
||||
background-color: @grayMed;
|
||||
}
|
||||
@@ -59,6 +59,7 @@
|
||||
@import "application/grid.less";
|
||||
@import "application/shadows.less";
|
||||
@import "application/animations.less";
|
||||
@import "application/umb-navigation.less";
|
||||
|
||||
// Belle styles
|
||||
@import "buttons.less";
|
||||
@@ -84,6 +85,8 @@
|
||||
@import "components/umb-sub-views.less";
|
||||
@import "components/umb-editor-navigation.less";
|
||||
@import "components/umb-editor-sub-views.less";
|
||||
@import "components/editor/subviews/umb-editor-sub-view.less";
|
||||
@import "components/editor/umb-editor-toolbar.less";
|
||||
@import "components/editor/subheader/umb-editor-sub-header.less";
|
||||
@import "components/umb-grid-selector.less";
|
||||
@import "components/umb-child-selector.less";
|
||||
@@ -107,6 +110,9 @@
|
||||
@import "components/umb-grid.less";
|
||||
@import "components/umb-empty-state.less";
|
||||
@import "components/umb-property-editor.less";
|
||||
@import "components/umb-iconpicker.less";
|
||||
@import "components/umb-variations.less";
|
||||
@import "components/umb-splitview.less";
|
||||
|
||||
@import "components/buttons/umb-button.less";
|
||||
@import "components/buttons/umb-button-group.less";
|
||||
|
||||
@@ -4,30 +4,29 @@
|
||||
|
||||
.umb-editor-wrapper{
|
||||
background: white;
|
||||
position: absolute;
|
||||
top: 0px; bottom: 0px; left: 0px; right: 0px;
|
||||
// position: absolute;
|
||||
// top: 0px; bottom: 0px; left: 0px; right: 0px;
|
||||
}
|
||||
|
||||
|
||||
.umb-editor-header{
|
||||
background: @grayLighter;
|
||||
.umb-editor-header {
|
||||
//background: @grayLighter;
|
||||
border-bottom: 1px solid @grayLight;
|
||||
position: absolute;
|
||||
height: 99px;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
left: 0px;
|
||||
//position: absolute;
|
||||
// height: 99px;
|
||||
//top: 0px;
|
||||
//right: 0px;
|
||||
//left: 0px;
|
||||
}
|
||||
|
||||
|
||||
.umb-editor-container {
|
||||
top: 101px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 52px;
|
||||
position: absolute;
|
||||
clear: both;
|
||||
overflow: auto;
|
||||
// top: 101px;
|
||||
// left: 0px;
|
||||
// right: 0px;
|
||||
// bottom: 52px;
|
||||
// position: absolute;
|
||||
// clear: both;
|
||||
// overflow: auto;
|
||||
}
|
||||
|
||||
.umb-editor-wrapper.-no-footer .umb-editor-container {
|
||||
@@ -39,17 +38,18 @@
|
||||
}
|
||||
|
||||
.umb-editor-drawer{
|
||||
margin: 0;
|
||||
//margin: 0;
|
||||
padding: 10px 20px;
|
||||
z-index: 999;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
height: 31px;
|
||||
//z-index: 999;
|
||||
//position: absolute;
|
||||
//bottom: 0px;
|
||||
//left: 0px;
|
||||
//right: 0px;
|
||||
|
||||
background: @grayLighter;
|
||||
//background: @grayLighter;
|
||||
border-top: 1px solid @grayLight;
|
||||
flex: 0 0 @editorFooterHeight;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,3 +61,187 @@
|
||||
.umb-editor-actions li{
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.umb-editor-header__published-state {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
/* ----- LANGUAGE AND VARIATION */
|
||||
.umb-editor-header__selected-variations {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 6px;
|
||||
margin-bottom: -4px;
|
||||
}
|
||||
|
||||
.umb-editor-header__selected-variation {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
font-size: 12px;
|
||||
color: #9e9ea6;
|
||||
}
|
||||
|
||||
.umb-editor-header__selected-variation:first-child {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.umb-editor-header__selected-variation-icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
/* --- VARIATIONS --- */
|
||||
.umb-variations-quick-switcher__toggle {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border: 1px solid #ECECEC;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
height: 30px;
|
||||
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__toggle.-active,
|
||||
.umb-variations-quick-switcher__toggle.-active:hover {
|
||||
background: @blue;
|
||||
border-color: @blue;
|
||||
color: @white;
|
||||
}
|
||||
|
||||
|
||||
.umb-variations-quick-switcher__toggle:hover {
|
||||
background-color: @grayLighter;
|
||||
border-color: @grayLight;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__toggle:hover,
|
||||
.umb-variations-quick-switcher__toggle:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__toggle-icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__toggle-arrow {
|
||||
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher_variations {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 6200;
|
||||
background-color: #ffffff;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
list-style: none;
|
||||
margin-left: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher_variation > li {
|
||||
border-left: 4px solid transparent;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher_variation > li:hover {
|
||||
border-color: @grayLighter;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher_variation > li.-active,
|
||||
.umb-variations-quick-switcher_variation > li.-active:hover {
|
||||
border-left-color: @blue;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher_variation li.-active,
|
||||
.umb-variations-quick-switcher_variation li.-active:hover {
|
||||
background-color: fade(@blueDark, 4%);
|
||||
}
|
||||
|
||||
|
||||
.umb-variations-quick-switcher__variation {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
height: 60px;
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation-stroke {
|
||||
border-left: 1px solid @grayLight;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__subnav {
|
||||
list-style: none;
|
||||
margin-left: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation:hover,
|
||||
.umb-variations-quick-switcher__variation:focus {
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation:hover,
|
||||
.umb-variations-quick-switcher__variation.-active {
|
||||
background-color: @grayLighter;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation.-active {
|
||||
background-color: rgb(238, 246, 254);
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation-published-state {
|
||||
display: block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background-color: @grayLight;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation-toggle {
|
||||
font-size: 13px;
|
||||
margin-left: auto;
|
||||
|
||||
opacity: .5;
|
||||
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation-toggle:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
.umb-variations-quick-switcher__variation-published-state.-published {
|
||||
background-color: @green;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation-name {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation-icon {
|
||||
color: @grayLight;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.umb-variations-quick-switcher__variation-description {
|
||||
font-size: 11px;
|
||||
color: @gray;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
+5
-3
@@ -6,13 +6,15 @@
|
||||
justify-content: space-between;
|
||||
margin-top: -30px;
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.umb-editor-sub-header.-umb-sticky-bar {
|
||||
box-shadow:
|
||||
0 5px 0 rgba(0, 0, 0, 0.08),
|
||||
0 1px 0 rgba(0, 0, 0, 0.16);
|
||||
box-shadow: 0 5px 0 rgba(0, 0, 0, 0.08), 0 1px 0 rgba(0, 0, 0, 0.16);
|
||||
transition: box-shadow 1s;
|
||||
top: 100px;
|
||||
transform: translate(0, 50%);
|
||||
|
||||
}
|
||||
|
||||
.umb-group-builder__property-preview .umb-editor-sub-header {
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
.umb-editor-sub-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: ~"(calc(~'100vh' - ~'@{navigationBarHeight}' - ~'@{editorHeaderHeight}' - ~'@{editorFooterHeight}'))";
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-header {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
border-bottom: 1px solid rgba(217,217,217, .6);
|
||||
flex: 0 0 @editorSubViewHeaderHeight;
|
||||
padding: 0 20px;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
|
||||
background: @grayLighter;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-header__content-left {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-header__content-right {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-container {
|
||||
flex: 1 1 auto;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
background: #F9F9F9;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-content {
|
||||
flex: 1 1 auto;
|
||||
padding: 30px 20px;
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-sidebar {
|
||||
flex: 0 0 400px;
|
||||
border-left: 1px solid @grayLight;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: @white;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-editor-sub-view-sidebar-header {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-sidebar-header i {
|
||||
margin-left: auto;
|
||||
cursor: pointer;
|
||||
color: @grayMed;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-sidebar-header i:hover {
|
||||
color: @black;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-sidebar-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: @black;
|
||||
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
.umb-editor-sub-view-sidebar-container {
|
||||
overflow-y: auto;
|
||||
flex: 1 1 auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
padding-top: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
.umb-editor-sub-view-sidebar-footer {
|
||||
flex: 0 0 @editorFooterHeight;
|
||||
background: @grayLighter;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-editor-sub-view-sidebar-header,
|
||||
.umb-editor-sub-view-sidebar-container,
|
||||
.umb-editor-sub-view-sidebar-footer {
|
||||
padding-right: 20px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
.umb-editor-toolbar {
|
||||
padding: 0 20px;
|
||||
flex: 0 0 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid @grayLight;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.editor-toolbar-properties {
|
||||
font-size: 20px;
|
||||
color: @grayMed;
|
||||
}
|
||||
|
||||
.editor-toolbar-properties:hover,
|
||||
.editor-toolbar-properties:focus {
|
||||
color: @grayDark !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
.umb-notifications {
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
bottom: 52px;
|
||||
bottom: @editorFooterHeight;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-bottom: none;
|
||||
|
||||
@@ -152,6 +152,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- OVERLAY FULL ---------- */
|
||||
|
||||
.umb-overlay.umb-overlay-full {
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: @navigationBarHeight;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.umb-overlay.umb-overlay-full .umb-overlay-header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ---------- OVERLAY ITEM DETAILS ---------- */
|
||||
.umb-overlay__item-details {
|
||||
position: absolute;
|
||||
|
||||
@@ -1,14 +1,41 @@
|
||||
.umb-sub-views-nav {
|
||||
list-style: none;
|
||||
display: flex;
|
||||
margin: 0;
|
||||
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
align-items: flex-end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.umb-sub-views-nav-items {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
height: 61px;
|
||||
}
|
||||
|
||||
.umb-sub-views-nav-items .umb-navigation-more {
|
||||
height: 20px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.umb-sub-views-nav-item {
|
||||
text-align: center;
|
||||
margin-left: 20px;
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
|
||||
align-items: center;
|
||||
|
||||
max-width: 100%;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.umb-sub-views-nav-item:focus {
|
||||
@@ -35,5 +62,23 @@
|
||||
}
|
||||
|
||||
.umb-sub-views-nav-item-text {
|
||||
font-size: 11px;
|
||||
font-size: 11px;
|
||||
vertical-align: baseline;
|
||||
margin: 10px 0 0 0;
|
||||
line-height: 1;
|
||||
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
// drop down
|
||||
.umb-sub-views-nav__dropdown {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
background: #fff;
|
||||
margin-top: 10px;
|
||||
z-index: 1;
|
||||
padding: 10px 20px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
// drop zone
|
||||
// tall and small version - animate height
|
||||
.dropzone {
|
||||
height: 400px;
|
||||
height: 500px;
|
||||
width: 100%;
|
||||
padding: 50px 0;
|
||||
border: 1px dashed @grayLight;
|
||||
text-align: center;
|
||||
color: @gray;
|
||||
@@ -15,11 +14,12 @@
|
||||
-webkit-transition: height 0.8s;
|
||||
-moz-transition: height 0.8s;
|
||||
transition: height 0.8s;
|
||||
box-sizing: border-box;
|
||||
.illustration {
|
||||
width: 300px;
|
||||
}
|
||||
&.is-small {
|
||||
height: 100px;
|
||||
height: 200px;
|
||||
.illustration {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
.umb-iconpicker {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.umb-iconpicker-item {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex: 0 0 14.28%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
margin-bottom: 0;
|
||||
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.umb-iconpicker-item a {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
padding: 15px 0;
|
||||
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.umb-iconpicker-item a:hover,
|
||||
.umb-iconpicker-item a:focus{
|
||||
background: darken(@grayLighter, 1%);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.umb-iconpicker-item a:active {
|
||||
background: darken(@grayLighter, 4%);
|
||||
}
|
||||
|
||||
.umb-iconpicker-item i {
|
||||
font-size: 30px;
|
||||
}
|
||||
@@ -16,8 +16,23 @@
|
||||
|
||||
.umb-keyboard-shortcuts-overview__overlay-close {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
font-size: 25px;
|
||||
border-radius: 20px;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: transparent;
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
.umb-keyboard-shortcuts-overview__overlay-close:hover {
|
||||
background-color: @blue;
|
||||
color: #ffffff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.umb-keyboard-shortcuts-overview__overlay-content {
|
||||
|
||||
@@ -1,3 +1,146 @@
|
||||
.umb-property-editor.-not-clickable {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.umb-property-editor {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.umb-property-editor__overlay {
|
||||
background-color: rgba(255,255,255, .65);
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.umb-property-editor__overlay-label {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #;
|
||||
background: #ffffff;
|
||||
padding: 10px 20px;
|
||||
color: @grayLight;
|
||||
}
|
||||
|
||||
|
||||
.umb-property .control-label {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.umb-property .control-label small {
|
||||
font-size: 11px;
|
||||
line-height: 17px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-property-editor__dropdown-toggling {
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-property-editor__dropdown-toggling.-active {
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.umb-property-editor__dropdown-toggling.-active .umb-property-editor__dropdown-toggle {
|
||||
color: @blue;
|
||||
}
|
||||
|
||||
.umb-property-editor__dropdown-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
width: auto;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.umb-property-editor__dropdown-toggle:hover {
|
||||
color: @blue;
|
||||
}
|
||||
|
||||
.umb-property-editor__dropdown-toggle i,
|
||||
.umb-property-editor__dropdown-link i {
|
||||
margin-right: 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-property-editor__dropdown {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
|
||||
min-width: 250px;
|
||||
|
||||
background: #ffffff;
|
||||
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.umb-property-editor__dropdown-items {
|
||||
list-style: none;
|
||||
|
||||
margin-bottom: 0;
|
||||
margin-left: 0;
|
||||
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
|
||||
max-height: 165px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
.umb-property-editor__dropdown-filter {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.umb-property-editor__dropdown-filter input[type="search"] {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.umb-property-editor__dropdown-link.-sync-off {
|
||||
border-bottom: 1px solid @grayLight;
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
.umb-property-editor__dropdown-link.-sync-off:hover {
|
||||
background: rgba(217,217,217, .35);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-property-editor__dropdown-link {
|
||||
padding: 5px 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.umb-property-editor__dropdown-link:hover {
|
||||
background-color: @grayLighter;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/* split view */
|
||||
.splitview--views {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.splitview--view {
|
||||
position: relative;
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
|
||||
.splitview--divider {
|
||||
flex: 0 0 8px;
|
||||
background: @white;
|
||||
border-right: 1px solid @grayLight;
|
||||
border-left: 1px solid @grayLight;
|
||||
|
||||
box-shadow: 0 0 4px rgba(0,0,0,0.1);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.splitview--close {
|
||||
position: absolute;
|
||||
bottom: 50px;
|
||||
left: 50%;
|
||||
transform: translate3d(-50%, -50%, 0);
|
||||
z-index: 100;
|
||||
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
|
||||
padding: 8px 18px;
|
||||
background: rgba(0,0,0,0.05);
|
||||
border-radius: 6px;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0,0,0,0.1);
|
||||
}
|
||||
}
|
||||
@@ -198,6 +198,7 @@ input.umb-table__input {
|
||||
padding: 6px 2px;
|
||||
|
||||
text-align: left;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.umb-table-cell > * {
|
||||
|
||||
@@ -1,15 +1,119 @@
|
||||
.umb-nav-tabs {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
.umb-tabs-nav {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.umb-nav-tabs.-padding-left {
|
||||
padding-left: 20px;
|
||||
|
||||
// Sub view header tabs
|
||||
.umb-editor-sub-view-header .umb-tabs-nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.umb-tab-content {
|
||||
padding-top: 20px;
|
||||
position: relative;
|
||||
top: 22px;
|
||||
border-top: 1px solid @grayLight;
|
||||
.umb-editor-sub-view-header .umb-tabs-nav__tab a {
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
border-radius: 6px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-header .umb-tabs-nav__tab a:hover,
|
||||
.umb-editor-sub-view-header .umb-tabs-nav__tab a:active,
|
||||
.umb-editor-sub-view-header .umb-tabs-nav__tab a:focus {
|
||||
text-decoration: none !important;
|
||||
background: rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-header .umb-tabs-nav__tab.active a {
|
||||
background: @blue;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Sidebar tabs
|
||||
.umb-editor-sub-view-sidebar .umb-tabs-nav {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid @grayLight;
|
||||
padding-top: 25px;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-sidebar .umb-tabs-nav__tab {
|
||||
border-bottom: 3px solid transparent;
|
||||
padding-bottom: 8px;
|
||||
margin-right: 0;
|
||||
flex: 1 1 100%;
|
||||
|
||||
font-size: 14px;
|
||||
color: @grayMed;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-sidebar .umb-tabs-nav__tab:hover,
|
||||
.umb-editor-sub-view-sidebar .umb-tabs-nav__tab.-active {
|
||||
text-decoration: none !important;
|
||||
border-color: @blue;
|
||||
color: @black;
|
||||
}
|
||||
|
||||
.umb-editor-sub-view-sidebar .umb-tabs-nav__tab:focus,
|
||||
.umb-editor-sub-view-sidebar .umb-tabs-nav__tab:active {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Umb activity demo css
|
||||
.umb-activity {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-activity-item {
|
||||
border: 1px solid transparent;
|
||||
padding: 10px;
|
||||
|
||||
list-style: none;
|
||||
|
||||
font-weight: bold;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-activity-item:hover {
|
||||
border-color: @grayLight;
|
||||
}
|
||||
|
||||
.umb-activity-item:hover .umb-activity-item-rollback {
|
||||
color: @blue;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.umb-activity-item-name {
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 15px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.umb-activity-item-rollback {
|
||||
font-size: 13px;
|
||||
color: @grayMed;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.umb-activity-item .umb-activity-item-rollback:hover {
|
||||
color: @blueDark;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-activity-item + .umb-activity-item {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,356 @@
|
||||
.umb-variations {
|
||||
max-width: 100%;
|
||||
padding: 0 20px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.umb-variations__title-wrapper {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.umb-variations__title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: @black;
|
||||
}
|
||||
|
||||
.umb-variations__help-text {
|
||||
line-height: 1.6em;
|
||||
display: block;
|
||||
color: @grayMed;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.umb-variations__filter {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.umb-varations__published-state {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background-color: @grayLight;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.umb-varations__published-state.-published {
|
||||
background-color: @green;
|
||||
}
|
||||
|
||||
/* ---------- VARIATIONS LANG GROUP ---------- */
|
||||
|
||||
.umb-varations__lang-group {
|
||||
background: @white;
|
||||
border: 1px solid @grayLight;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.umb-varations__lang-group-info {
|
||||
padding: 20px 15px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.umb-varations__lang-group-info__name {
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.umb-varations__lang-group-info__link:hover {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.umb-varations__lang-group-info__name i {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.umb-varations__lang-group-info__name small {
|
||||
margin-left: 5px;
|
||||
color: @grayMed;
|
||||
font-weight: normal;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.umb-varations__lang-group .umb-variations__action span {
|
||||
font-size: 13px;
|
||||
margin-left: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.umb-varations__lang-group-info .umb-variations__action {
|
||||
color: @blue;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.umb-varations__lang-group-info .umb-variations__action:hover {
|
||||
color: @blueDark;
|
||||
}
|
||||
|
||||
.umb-variations__no-variations {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
padding: 0 20px 40px;
|
||||
}
|
||||
|
||||
.umb-variations__no-variations-message {
|
||||
display: block;
|
||||
margin-bottom: 20px;
|
||||
font-size: 14px;
|
||||
line-height: 22px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* ---------- VARIATIONS LIST ---------- */
|
||||
|
||||
.umb-variations__list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.umb-variations__list-item-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.umb-variations__list-item {
|
||||
padding: 15px;
|
||||
flex: 3 1 auto;
|
||||
border-top: 1px solid @grayLight;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
|
||||
.umb-variations__list-item.-edit-mode {
|
||||
background: @grayLighter;
|
||||
border-top-color: #e7e7e7;
|
||||
}
|
||||
|
||||
.umb-variations__list-item.-edit-mode + .umb-variations__edit-list-item {
|
||||
border-top-color: @grayLighter;
|
||||
}
|
||||
|
||||
|
||||
.umb-variations__list-item__edit {
|
||||
padding: 4px 10px;
|
||||
border-radius: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.umb-variations__list-item__edit:hover {
|
||||
background: rgba(0, 0, 0, 0.09);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-variations__variation-top-bar {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.umb-variations__published-state {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 20px;
|
||||
background-color: @grayLight;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.umb-variations__published-state.-published {
|
||||
background-color: @green;
|
||||
}
|
||||
|
||||
.umb-variations__name-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.umb-variations__name {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
color: @black;
|
||||
}
|
||||
|
||||
.umb-variations__name:hover {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.umb-variations__name-icon {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.umb-variations__edit-form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.umb-variations__name-input:focus,
|
||||
.umb-variations__name-input:active {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.umb-variations__description {
|
||||
margin-bottom: 0;
|
||||
margin-left: 5px;
|
||||
resize: none;
|
||||
font-size: 12px;
|
||||
color: @grayMed;
|
||||
}
|
||||
|
||||
.umb-variations__description-input {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.umb-variations__actions {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.umb-variations__action {
|
||||
font-size: 18px;
|
||||
cursor: pointer;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.umb-variations__action + .umb-variations__action {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.umb-variations__action:hover {
|
||||
color: @blue;
|
||||
}
|
||||
|
||||
/* --- CREATE VARIATION --- */
|
||||
|
||||
.umb-variation__create-title {
|
||||
color: @black;
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.umb-variation__create-form-description {
|
||||
resize: none;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
.umb-variation__create-form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.umb-variation__create-form label,
|
||||
.umb-variations__edit-form label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.umb-variation__create-form-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.umb-variations__edit-form + .umb-variations__actions {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
.form-group-actions {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.umb-variations__edit-list-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
padding: 20px 30px;
|
||||
box-sizing: border-box;
|
||||
background-color: @white;
|
||||
border-top: 1px solid @grayLight;
|
||||
}
|
||||
|
||||
/* MATCHES */
|
||||
|
||||
.umb-variations__matches {
|
||||
list-style: none;
|
||||
margin-bottom: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.umb-variations__match {
|
||||
background: @grayLighter;
|
||||
padding: 10px 15px;
|
||||
cursor: grab;
|
||||
border-left: 2px solid @blue;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
/* TAGS */
|
||||
|
||||
.umb-variations__tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.umb-variations__tag {
|
||||
display: flex;
|
||||
flex: 0 0 100%;
|
||||
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.umb-variations__tag + .umb-variations__tag {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.umb-variations__tag .checkbox {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.umb-variations__tag .checkbox:checked + span {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* FORM */
|
||||
.umb-variations__form-group {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
.umb-variations__label {
|
||||
font-weight: bold;
|
||||
color: @black;
|
||||
}
|
||||
|
||||
.umb-variations__label + .umb-variations__tags {
|
||||
margin-top: 10px;
|
||||
}
|
||||
@@ -49,6 +49,7 @@ label.control-label {
|
||||
.form-search {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.form-search a{
|
||||
text-decoration:none;
|
||||
@@ -65,8 +66,8 @@ label.control-label {
|
||||
}
|
||||
.form-search .icon, .form-search .icon-search {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: 4px;
|
||||
top: 23px;
|
||||
left: 20px;
|
||||
color: @grayLight;
|
||||
}
|
||||
|
||||
@@ -207,6 +208,11 @@ input.-full-width-input {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
textarea.-full-width-textarea {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
// Reset appearance properties for textual inputs and textarea
|
||||
// Declare width for legacy (can't be on input[type=*] selectors or it's too specific)
|
||||
input,
|
||||
|
||||
@@ -9,13 +9,41 @@
|
||||
color: @white;
|
||||
position: absolute;
|
||||
z-index: 10000;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
margin: 0 !Important;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin: 0 !important;
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
|
||||
only screen and (min-resolution: 144dpi)
|
||||
{
|
||||
.login-overlay {
|
||||
background-image: url(../img/application/logo@2x.png) !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 2),
|
||||
only screen and (min-resolution: 192dpi)
|
||||
{
|
||||
.login-overlay {
|
||||
background-image: url(../img/application/logo@2x.png) !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (-webkit-min-device-pixel-ratio: 3),
|
||||
only screen and (min-resolution: 3dppx),
|
||||
only screen and (min-resolution: 350dpi)
|
||||
{
|
||||
.login-overlay {
|
||||
background-image: url(../img/application/logo@3x.png) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.login-overlay .umb-modalcolumn {
|
||||
background: none;
|
||||
border: none;
|
||||
@@ -62,7 +90,7 @@
|
||||
}
|
||||
|
||||
#hrOr hr {
|
||||
margin: 0px;
|
||||
margin: 0;
|
||||
border: none;
|
||||
background-color: @gray;
|
||||
height: 1px;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// -------------------------
|
||||
.umb-panel {
|
||||
background: white;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
// position: absolute;
|
||||
// top: 0px;
|
||||
// bottom: 0px;
|
||||
// left: 0px;
|
||||
// right: 0px;
|
||||
}
|
||||
|
||||
.umb-panel-nobody {
|
||||
@@ -17,21 +17,21 @@
|
||||
.umb-panel-header {
|
||||
background: @grayLighter;
|
||||
border-bottom: 1px solid @grayLight;
|
||||
position: absolute;
|
||||
height: 99px;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
left: 0px;
|
||||
// position: absolute;
|
||||
// height: 99px;
|
||||
// top: 0px;
|
||||
// right: 0px;
|
||||
// left: 0px;
|
||||
}
|
||||
|
||||
.umb-panel-body {
|
||||
top: 101px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
position: absolute;
|
||||
clear: both;
|
||||
overflow: auto;
|
||||
// top: 101px;
|
||||
// left: 0px;
|
||||
// right: 0px;
|
||||
// bottom: 0px;
|
||||
// position: absolute;
|
||||
// clear: both;
|
||||
// overflow: auto;
|
||||
}
|
||||
|
||||
.umb-panel-body.no-header {
|
||||
@@ -356,7 +356,7 @@
|
||||
.umb-panel-header-content-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100px;
|
||||
// height: 100px;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
@@ -366,15 +366,18 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/*
|
||||
.umb-panel-header-content.-top-position {
|
||||
position: relative;
|
||||
top: -12px;
|
||||
}
|
||||
*/
|
||||
|
||||
.umb-panel-header-left-side {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.umb-panel-header-icon {
|
||||
@@ -493,3 +496,71 @@ input.umb-panel-header-description {
|
||||
.umb-editor-drawer-content__left-side {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Large Search
|
||||
.large-search {
|
||||
font-size: 18px;
|
||||
padding-top: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid @grayLight;
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
|
||||
.large-search,
|
||||
.umb-tree.large-search-results {
|
||||
width: 100%;
|
||||
max-width: 960px;
|
||||
min-width: auto;
|
||||
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.large-search .umb-search-field {
|
||||
border-bottom: none;
|
||||
font-size: 22px;
|
||||
text-indent: 10px;
|
||||
padding-left: 0 !important;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.large-search .icon-search {
|
||||
color: @black;
|
||||
position: static;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.umb-tree.large-search-results .umb-search-group-item-link {
|
||||
padding: 10px 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.umb-tree.large-search-results .umb-search-group-item-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.umb-tree.large-search-results .umb-search-group-item-link .icon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.umb-tree.large-search-results .umb-search-group-item-name {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.umb-tree.large-search-results .search-subtitle {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,6 @@ ul.color-picker li a {
|
||||
flex-wrap: wrap;
|
||||
padding: 2px;
|
||||
margin: 5px;
|
||||
background: white;
|
||||
border: 1px solid #f8f8f8;
|
||||
}
|
||||
|
||||
@@ -275,11 +274,12 @@ ul.color-picker li a {
|
||||
|
||||
.umb-cropper{
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.umb-cropper img, .umb-cropper-gravity img{
|
||||
position: absolute;
|
||||
position: relative;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
@@ -293,19 +293,22 @@ ul.color-picker li a {
|
||||
left: 0;
|
||||
cursor: move;
|
||||
z-index: 6001;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.umb-cropper .viewport{
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
margin: auto;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.umb-cropper-gravity .viewport{
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
width: 400px;
|
||||
height: 300px
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
@@ -335,27 +338,45 @@ ul.color-picker li a {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.umb-cropper-gravity .overlay i{
|
||||
.umb-cropper-gravity .overlay i {
|
||||
font-size: 26px;
|
||||
line-height: 26px;
|
||||
opacity: 0.8 !important;
|
||||
}
|
||||
|
||||
.umb-cropper .crop-container{
|
||||
.umb-cropper .crop-container {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.umb-cropper .crop-slider{
|
||||
vertical-align: middle;
|
||||
padding: 10px 50px 10px 50px;
|
||||
.umb-cropper .crop-slider {
|
||||
padding: 10px;
|
||||
border-top: 1px solid @grayLighter;
|
||||
margin-top: 10px;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
flex-wrap: wrap;
|
||||
|
||||
@media (min-width: 769px) {
|
||||
padding: 10px 50px 10px 50px;
|
||||
}
|
||||
}
|
||||
|
||||
.umb-cropper .crop-slider i{color: @gray;}
|
||||
.umb-cropper .crop-slider input{
|
||||
margin-top: 7px;
|
||||
width: 320px;
|
||||
.umb-cropper .crop-slider i {
|
||||
color: @gray;
|
||||
flex: 0 0 25px;
|
||||
padding: 0 5px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.umb-cropper .crop-slider i:first-of-type {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.umb-cropper .crop-slider input {
|
||||
flex: 0 1 auto;
|
||||
}
|
||||
.umb-cropper-gravity .viewport, .umb-cropper-gravity, .umb-cropper-imageholder {
|
||||
display: inline-block;
|
||||
@@ -372,55 +393,98 @@ ul.color-picker li a {
|
||||
}
|
||||
|
||||
.gravity-container .viewport {
|
||||
width: 494px;
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.gravity-container .viewport:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.imagecropper {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
flex-direction: row;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
float: left;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.imagecropper .umb-cropper__container {
|
||||
position: relative;
|
||||
margin-bottom: 10px;
|
||||
max-width: 100%;
|
||||
border: 1px solid #f8f8f8;
|
||||
|
||||
@media (min-width: 769px) {
|
||||
width: 600px;
|
||||
}
|
||||
}
|
||||
|
||||
.umb-close-cropper {
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
right: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.umb-close-cropper:hover {
|
||||
opacity: .9;
|
||||
background: @grayLighter;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails {
|
||||
border-left: 2px solid #f8f8f8;
|
||||
margin-left: 4px;
|
||||
padding-left: 2px;
|
||||
float: left;
|
||||
width: 100px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li {
|
||||
display: block;
|
||||
}
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li.current a, .imagecropper .umb-sortable-thumbnails li.current a:hover {
|
||||
background: #eeeeee;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li:first-of-type {
|
||||
padding: 8px;
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li .crop-name, .imagecropper .umb-sortable-thumbnails li .crop-size {
|
||||
.imagecropper .umb-sortable-thumbnails li.current {
|
||||
border-color: @grayLight;
|
||||
background: @grayLighter;
|
||||
color: @black;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li:hover,
|
||||
.imagecropper .umb-sortable-thumbnails li.current:hover {
|
||||
border-color: @grayLight;
|
||||
background: @grayLighter;
|
||||
color: @black;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
opacity: .95;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li .crop-name,
|
||||
.imagecropper .umb-sortable-thumbnails li .crop-size {
|
||||
display: block;
|
||||
text-align: left;
|
||||
font-size: 11px;
|
||||
font-size: 13px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li .crop-name {
|
||||
font-weight: bold;
|
||||
margin: 10px 0 5px;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li .crop-size {
|
||||
font-size: 10px;
|
||||
font-style: italic;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li a {
|
||||
display: block;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li a:hover {
|
||||
background: #f8f8f8;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails li a:hover .crop-text {
|
||||
text-decoration: none;
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
|
||||
.btn-crop-delete {
|
||||
@@ -428,20 +492,6 @@ ul.color-picker li a {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails.many {
|
||||
width: 210px;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails.many li {
|
||||
width: 85px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.imagecropper .umb-sortable-thumbnails.many li:nth-child(2) {
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
//
|
||||
// folder-browser
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,24 +1,38 @@
|
||||
// Sections
|
||||
// -------------------------
|
||||
|
||||
ul.sections {
|
||||
margin: 0;
|
||||
display: block;
|
||||
background: @blackLight;
|
||||
height: 100%;
|
||||
width: 80px;
|
||||
border-right: 1px solid @grayDark;
|
||||
.umb-sections {
|
||||
//margin: 0;
|
||||
//display: block;
|
||||
//background: @blackLight;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
//height: 100%;
|
||||
//width: 80px;
|
||||
//border-right: 1px solid @grayDark;
|
||||
}
|
||||
|
||||
ul.sections li {
|
||||
display: block;
|
||||
border-left: 4px @blackLight solid;
|
||||
-webkit-transition: all .3s linear;
|
||||
-moz-transition: all .3s linear;
|
||||
transition: all .3s linear;
|
||||
.umb-sections__section {
|
||||
//border-left: 4px @blackLight solid;
|
||||
//-webkit-transition: all .3s linear;
|
||||
//-moz-transition: all .3s linear;
|
||||
//transition: all .3s linear;
|
||||
}
|
||||
|
||||
ul.sections li [class^="icon-"]:before,
|
||||
.umb-sections__section:hover {
|
||||
background: #E2E2E2;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.umb-sections__section.-current,
|
||||
.umb-sections__section:focus {
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
color: @blue;
|
||||
}
|
||||
|
||||
/*
|
||||
ul.sections li [class^="icon-"]:before,
|
||||
ul.sections li [class*=" icon-"]:before{
|
||||
font-size: 30px;
|
||||
margin: 1px 0 0 0;
|
||||
@@ -27,12 +41,15 @@ ul.sections li [class*=" icon-"]:before{
|
||||
-moz-transition: all .3s linear;
|
||||
transition: all .3s linear;
|
||||
}
|
||||
*/
|
||||
|
||||
ul.sections:hover li [class^="icon-"]:before,
|
||||
/*
|
||||
ul.sections:hover li [class^="icon-"]:before,
|
||||
ul.sections:hover li [class*=" icon-"]:before {
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
ul.sections li a {
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
@@ -43,7 +60,7 @@ ul.sections li a {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0 0 0 -4px;
|
||||
cursor: pointer; // make sure IE10 displays pointer cursor for expand and help sections.
|
||||
cursor: pointer; // make sure IE10 displays pointer cursor for expand and help sections.
|
||||
}
|
||||
|
||||
ul.sections a span {
|
||||
@@ -59,11 +76,12 @@ ul.sections a span {
|
||||
ul.sections:hover a span {
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// Avatar, Section & Help icons
|
||||
// -------------------------
|
||||
|
||||
/*
|
||||
ul.sections li.avatar {
|
||||
height: 75px;
|
||||
padding: 22px 0 2px 0;
|
||||
@@ -84,7 +102,8 @@ ul.sections li.avatar a img {
|
||||
border-radius: 50%;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
*/
|
||||
/*
|
||||
.faded ul.sections li {
|
||||
opacity: 0.4
|
||||
}
|
||||
@@ -101,7 +120,7 @@ ul.sections li.current a{
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
ul.sections li.help {
|
||||
ul.sections li.help {
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
@@ -113,9 +132,11 @@ ul.sections li.help {
|
||||
ul.sections li.help a {
|
||||
border-bottom: none;
|
||||
}
|
||||
*/
|
||||
|
||||
// Section slide-out tray for additional apps
|
||||
// -------------------------
|
||||
|
||||
li.expand a, li.expand{border: none !Important;}
|
||||
|
||||
li.expand {
|
||||
@@ -125,7 +146,7 @@ li.expand {
|
||||
-o-transition: all 1s !important;
|
||||
-moz-transition: all 1s !important;
|
||||
transition: all 1s !important;
|
||||
|
||||
|
||||
&:before {
|
||||
-ms-transform: rotate(180deg) !important; /* IE 9 */
|
||||
-webkit-transform: rotate(180deg) !important; /* Chrome, Safari, Opera */
|
||||
@@ -147,7 +168,7 @@ ul.sections-tray {
|
||||
& > li {
|
||||
// 5px (instead of 4px) because of vertical border
|
||||
border-left-width: 5px;
|
||||
|
||||
|
||||
&.current, &:hover {
|
||||
border-left-width: 5px;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,15 @@
|
||||
// --------------------------------------------------
|
||||
|
||||
|
||||
//
|
||||
// -------------------------
|
||||
|
||||
@navigationBarHeight: 50px;
|
||||
@editorHeaderHeight: 80px;
|
||||
@editorFooterHeight: 50px;
|
||||
@editorSubViewHeaderHeight: 50px;
|
||||
|
||||
|
||||
// Grays
|
||||
// -------------------------
|
||||
@black: #000;
|
||||
|
||||
@@ -20,28 +20,36 @@
|
||||
hide-alias="true">
|
||||
</umb-editor-header>
|
||||
|
||||
<umb-editor-toolbar umb-tabs>
|
||||
<umb-tabs-nav ng-if="dashboard.tabs" model="dashboard.tabs"></umb-tabs-nav>
|
||||
</umb-editor-toolbar>
|
||||
|
||||
<umb-editor-container>
|
||||
|
||||
<umb-tabs-content view="true">
|
||||
<umb-tab id="tab{{tab.id}}" ng-repeat="tab in dashboard.tabs" rel="{{tab.id}}">
|
||||
<div class="umb-editor-content">
|
||||
|
||||
<div ng-repeat="property in tab.properties" ng-switch on="property.serverSide">
|
||||
<umb-tabs-content view="true">
|
||||
<umb-tab id="tab{{tab.id}}" ng-repeat="tab in dashboard.tabs" rel="{{tab.id}}">
|
||||
|
||||
<div class="span12 clearfix" ng-switch-when="false">
|
||||
<h3 ng-show="property.caption">{{property.caption}}</h3>
|
||||
<div ng-include="property.path"></div>
|
||||
</div>
|
||||
<div ng-repeat="property in tab.properties" ng-switch on="property.serverSide">
|
||||
|
||||
<div class="span12 umb-dashboard-control clearfix" ng-switch-when="true">
|
||||
<h3 ng-show="property.caption">{{property.caption}}</h3>
|
||||
<div ng-switch-when="false">
|
||||
<h3 ng-show="property.caption">{{property.caption}}</h3>
|
||||
<div ng-include="property.path"></div>
|
||||
</div>
|
||||
|
||||
<iframe ng-src="dashboard/usercontrolproxy.aspx?ctrl={{ property.path}}"></iframe>
|
||||
</div>
|
||||
<div class="span12 umb-dashboard-control clearfix" ng-switch-when="true">
|
||||
<h3 ng-show="property.caption">{{property.caption}}</h3>
|
||||
|
||||
</div>
|
||||
<iframe ng-src="dashboard/usercontrolproxy.aspx?ctrl={{ property.path}}"></iframe>
|
||||
</div>
|
||||
|
||||
</umb-tab>
|
||||
</umb-tabs-content>
|
||||
</div>
|
||||
|
||||
</umb-tab>
|
||||
</umb-tabs-content>
|
||||
|
||||
</div>
|
||||
|
||||
</umb-editor-container>
|
||||
|
||||
|
||||
@@ -2,55 +2,48 @@
|
||||
<div class="umb-panel-header">
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="form-search">
|
||||
<i class="icon-search"></i>
|
||||
<i class="icon-search"></i>
|
||||
<input type="text"
|
||||
style="width: 100%"
|
||||
ng-model="searchTerm"
|
||||
class="umb-search-field search-query input-block-level"
|
||||
style="width: 100%"
|
||||
ng-model="searchTerm"
|
||||
class="umb-search-field search-query input-block-level"
|
||||
placeholder="Filter...">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="umb-panel-body with-footer">
|
||||
|
||||
|
||||
<div class="umb-control-group">
|
||||
<select ng-model="color" class="input-block-level">
|
||||
<option value="">Black</option>
|
||||
<option value="color-green">Green</option>
|
||||
<option value="color-yellow">Yellow</option>
|
||||
<option value="color-green">Green</option>
|
||||
<option value="color-yellow">Yellow</option>
|
||||
<option value="color-orange">Orange</option>
|
||||
<option value="color-blue">Blue</option>
|
||||
<option value="color-blue">Blue</option>
|
||||
<option value="color-red">Red</option>
|
||||
</select>
|
||||
<!--
|
||||
<select class="input-block-level">
|
||||
<option value="">Black</option>
|
||||
<option value="color-green">Green</option>
|
||||
<option value="color-blue">Turquoise</option>
|
||||
<option value="color-purple">Purple</option>
|
||||
<option value="color-red">Red</option>
|
||||
<option value="color-orange">Orange</option>
|
||||
<option value="color-sky-blue">Sky blue</option>
|
||||
<option value="color-yellow">Yellow</option>
|
||||
</select>-->
|
||||
|
||||
</div>
|
||||
|
||||
<div class="umb-loader" ng-hide="icons"></div>
|
||||
<umb-load-indicator ng-if="loading"></umb-load-indicator>
|
||||
|
||||
<div class="umb-control-group">
|
||||
<ul class="umb-thumbnails thumbnails" ng-class="color">
|
||||
<li class="span1" ng-repeat="icon in icons|filter: searchTerm">
|
||||
<a href="#" title="{{icon}}" class="thumbnail" ng-click="submitClass(icon)" prevent-default>
|
||||
<i class="{{icon}} large" style="font-size: 32px"></i>
|
||||
<div class="umb-control-group" ng-show="!loading">
|
||||
<ul class="umb-iconpicker" ng-class="color" ng-show="icons">
|
||||
<li class="umb-iconpicker-item" ng-repeat="icon in filtered = (icons | filter: searchTerm) track by $id(icon)">
|
||||
<a href="#" title="{{icon}}" ng-click="submitClass(icon)" prevent-default>
|
||||
<i class="{{icon}} large"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<umb-empty-state
|
||||
ng-if="filtered.length === 0"
|
||||
position="center">
|
||||
<localize key="defaultdialogs_noIconsFound">No icons were found.</localize>
|
||||
</umb-empty-state>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="umb-panel-footer" >
|
||||
<div class="umb-el-wrap umb-panel-buttons">
|
||||
<div class="btn-toolbar umb-btn-toolbar pull-right">
|
||||
|
||||
@@ -38,14 +38,19 @@
|
||||
|
||||
<umb-load-indicator ng-if="loading"></umb-load-indicator>
|
||||
|
||||
<div class="umb-control-group" ng-show="!loading">
|
||||
<ul class="umb-thumbnails thumbnails" ng-class="color">
|
||||
<li class="span1" ng-repeat="icon in icons|filter: searchTerm">
|
||||
<a href="#" title="{{icon}}" class="thumbnail" ng-click="selectIcon(icon, color)" prevent-default>
|
||||
<i class="{{icon}} large" style="font-size: 32px"></i>
|
||||
<div class="umb-control-group" ng-show="!loading && filtered.length > 0 ">
|
||||
<ul class="umb-iconpicker" ng-class="color" ng-show="icons">
|
||||
<li class="umb-iconpicker-item" ng-repeat="icon in filtered = (icons | filter: searchTerm) track by $id(icon)">
|
||||
<a href="#" title="{{icon}}" ng-click="selectIcon(icon, color)" prevent-default>
|
||||
<i class="{{icon}} large"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<umb-empty-state
|
||||
ng-if="filtered.length === 0"
|
||||
position="center">
|
||||
<localize key="defaultdialogs_noIconsFound">No icons were found.</localize>
|
||||
</umb-empty-state>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
function SearchOverlay($scope, searchService, $log, $location, navigationService, $q) {
|
||||
|
||||
|
||||
$scope.searchTerm = null;
|
||||
$scope.searchResults = [];
|
||||
$scope.isSearching = false;
|
||||
$scope.selectedResult = -1;
|
||||
|
||||
|
||||
$scope.navigateResults = function(ev) {
|
||||
//38: up 40: down, 13: enter
|
||||
|
||||
switch (ev.keyCode) {
|
||||
case 38:
|
||||
iterateResults(true);
|
||||
break;
|
||||
case 40:
|
||||
iterateResults(false);
|
||||
break;
|
||||
case 13:
|
||||
if ($scope.model.selectedItem) {
|
||||
$scope.selectItem($scope.model.selectedItem);
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
$scope.selectItem = function(selectedItem) {
|
||||
$scope.model.selectedItem = selectedItem;
|
||||
$scope.model.submit($scope.model);
|
||||
};
|
||||
|
||||
|
||||
var group = undefined;
|
||||
var groupIndex = -1;
|
||||
var itemIndex = -1;
|
||||
$scope.model.selectedItem = undefined;
|
||||
|
||||
|
||||
function iterateResults(up) {
|
||||
//default group
|
||||
if (!group) {
|
||||
group = $scope.groups[0];
|
||||
groupIndex = 0;
|
||||
}
|
||||
|
||||
if (up) {
|
||||
if (itemIndex === 0) {
|
||||
if (groupIndex === 0) {
|
||||
gotoGroup($scope.groups.length - 1, true);
|
||||
} else {
|
||||
gotoGroup(groupIndex - 1, true);
|
||||
}
|
||||
} else {
|
||||
gotoItem(itemIndex - 1);
|
||||
}
|
||||
} else {
|
||||
if (itemIndex < group.results.length - 1) {
|
||||
gotoItem(itemIndex + 1);
|
||||
} else {
|
||||
if (groupIndex === $scope.groups.length - 1) {
|
||||
gotoGroup(0);
|
||||
} else {
|
||||
gotoGroup(groupIndex + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function gotoGroup(index, up) {
|
||||
groupIndex = index;
|
||||
group = $scope.groups[groupIndex];
|
||||
|
||||
if (up) {
|
||||
gotoItem(group.results.length - 1);
|
||||
} else {
|
||||
gotoItem(0);
|
||||
}
|
||||
}
|
||||
|
||||
function gotoItem(index) {
|
||||
itemIndex = index;
|
||||
$scope.model.selectedItem = group.results[itemIndex];
|
||||
}
|
||||
|
||||
//used to cancel any request in progress if another one needs to take it's place
|
||||
var canceler = null;
|
||||
|
||||
$scope.$watch("searchTerm", _.debounce(function(newVal, oldVal) {
|
||||
$scope.$apply(function() {
|
||||
if ($scope.searchTerm) {
|
||||
if (newVal !== null && newVal !== undefined && newVal !== oldVal) {
|
||||
$scope.isSearching = true;
|
||||
//navigationService.showSearch();
|
||||
$scope.model.selectedItem = undefined;
|
||||
|
||||
//a canceler exists, so perform the cancelation operation and reset
|
||||
if (canceler) {
|
||||
console.log("CANCELED!");
|
||||
canceler.resolve();
|
||||
canceler = $q.defer();
|
||||
} else {
|
||||
canceler = $q.defer();
|
||||
}
|
||||
|
||||
searchService.searchAll({
|
||||
term: $scope.searchTerm,
|
||||
canceler: canceler
|
||||
}).then(function(result) {
|
||||
$scope.groups = _.filter(result, function(group) {
|
||||
return group.results.length > 0;
|
||||
});
|
||||
//set back to null so it can be re-created
|
||||
canceler = null;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$scope.isSearching = false;
|
||||
//navigationService.hideSearch();
|
||||
$scope.model.selectedItem = undefined;
|
||||
}
|
||||
});
|
||||
}, 200));
|
||||
|
||||
}
|
||||
|
||||
angular.module("umbraco").controller("Umbraco.Overlays.SearchOverlay", SearchOverlay);
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,50 @@
|
||||
<div ng-controller="Umbraco.Overlays.SearchOverlay">
|
||||
|
||||
<!-- Search form -->
|
||||
<form class="form-search large-search" novalidate>
|
||||
<i class="icon-search"></i>
|
||||
<input type="text"
|
||||
id="search-field"
|
||||
ng-model="searchTerm"
|
||||
class="umb-search-field search-query search-input"
|
||||
localize="placeholder"
|
||||
placeholder="@placeholders_search"
|
||||
ng-keydown="navigateResults($event)"
|
||||
umb-auto-focus
|
||||
autocomplete="off" />
|
||||
</form>
|
||||
|
||||
<!-- Search results --->
|
||||
<ul class="umb-tree large-search-results">
|
||||
<li class="root">
|
||||
<div>
|
||||
<h5 class="umb-tree-header"><localize key="general_searchResults">Search results</localize></h5>
|
||||
</div>
|
||||
|
||||
<ul class="umb-search-group" ng-repeat="group in groups">
|
||||
<li ng-repeat="result in group.results" ng-class="{'current':model.selectedItem == result}">
|
||||
<div class="umb-search-group-item">
|
||||
<a class="umb-search-group-item-link" ng-class="{'first':$first}" ng-click="selectItem(result)">
|
||||
|
||||
<i class="icon umb-tree-icon sprTree {{result.icon}}"></i>
|
||||
|
||||
<div class="umb-search-group-item-info">
|
||||
<div class="umb-search-group-item-name">
|
||||
{{result.name}}
|
||||
</div>
|
||||
|
||||
<small class="search-subtitle" ng-show="result.subTitle">
|
||||
{{result.subTitle}}
|
||||
</small>
|
||||
</div>
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -1,104 +1,66 @@
|
||||
<div id="leftcolumn" ng-controller="Umbraco.NavigationController"
|
||||
ng-mouseleave="leaveTree($event)" ng-mouseenter="enterTree($event)">
|
||||
<div
|
||||
class="umb-navigation"
|
||||
ng-controller="Umbraco.NavigationController"
|
||||
ng-mouseleave="leaveTree($event)"
|
||||
ng-mouseenter="enterTree($event)">
|
||||
|
||||
<umb-sections sections="sections" ng-if="authenticated">
|
||||
</umb-sections>
|
||||
<div class="umb-toggle-tree"
|
||||
ng-click="showTree()"
|
||||
ng-class="{'-open':showTreeNavigation}">
|
||||
|
||||
<!-- navigation container -->
|
||||
<div id="navigation" ng-show="showNavigation" class="fill umb-modalcolumn" ng-animate="'slide'" nav-resize>
|
||||
|
||||
<div ng-swipe-left="nav.hideNavigation()" class="navigation-inner-container span6">
|
||||
|
||||
<!-- the search -->
|
||||
<div ng-controller="Umbraco.SearchController" ng-if="authenticated">
|
||||
|
||||
<!-- Search form -->
|
||||
<div id="search-form">
|
||||
<div class="umb-modalcolumn-header">
|
||||
|
||||
<form class="form-search" novalidate>
|
||||
<i class="icon-search"></i>
|
||||
<input type="text"
|
||||
hotkey="ctrl+space"
|
||||
id="search-field"
|
||||
ng-model="searchTerm"
|
||||
class="umb-search-field search-query search-input"
|
||||
localize="placeholder"
|
||||
placeholder="@placeholders_search"
|
||||
ng-keydown="navigateResults($event)"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Search results -->
|
||||
<div id="search-results" class="umb-modalcolumn-body" ng-show="showSearchResults">
|
||||
|
||||
<ul class="umb-tree">
|
||||
<li class="root">
|
||||
<div>
|
||||
<h5 class="umb-tree-header"><localize key="general_searchResults">Search results</localize></h5>
|
||||
</div>
|
||||
|
||||
<ul class="umb-search-group" ng-repeat="group in groups">
|
||||
<li ng-repeat="result in group.results" ng-class="{'current':selectedItem == result}">
|
||||
<div class="umb-search-group-item">
|
||||
<a class="umb-search-group-item-link" ng-class="{'first':$first}" ng-click="searchHide()" ng-href="#/{{result.editorPath}}">
|
||||
|
||||
<div class="umb-search-group-item-name">
|
||||
<i class="icon umb-tree-icon sprTree {{result.icon}}"></i>
|
||||
{{result.name}}
|
||||
</div>
|
||||
|
||||
<small class="search-subtitle" ng-show="result.subTitle">
|
||||
{{result.subTitle}}
|
||||
</small>
|
||||
</a>
|
||||
|
||||
<a href ng-click="searchShowMenu($event, {node: result})" class="umb-options"><i></i><i></i><i></i></a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- the tree -->
|
||||
<div id="tree" class="umb-modalcolumn-body" ng-if="authenticated">
|
||||
<umb-tree
|
||||
cachekey="_"
|
||||
eventhandler="treeEventHandler"
|
||||
section="{{currentSection}}" >
|
||||
</umb-tree>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset6" id="navOffset" style="z-index: 10">
|
||||
|
||||
<!-- The context menu -->
|
||||
<div id='contextMenu' class="umb-modalcolumn fill shadow" ng-swipe-left="nav.hideMenu()" ng-show="showContextMenu" ng-animate="'slide'">
|
||||
<umb-context-menu
|
||||
menu-dialog-title="{{menuDialogTitle}}"
|
||||
current-section="{{currentSection}}"
|
||||
current-node="menuNode"
|
||||
menu-actions="menuActions">
|
||||
</umb-context-menu>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Tree dialogs -->
|
||||
<div id="dialog" class='umb-modalcolumn fill shadow'
|
||||
ng-swipe-left="nav.hideDialog()"
|
||||
ng-show="showContextMenuDialog" ng-animate="'slide'">
|
||||
<div class='umb-modalcolumn-header'>
|
||||
<h1>{{menuDialogTitle}}</h1>
|
||||
</div>
|
||||
<div class='umb-modalcolumn-body'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="umb-toggle-icon"></div>
|
||||
</div>
|
||||
|
||||
<umb-sections
|
||||
ng-if="authenticated"
|
||||
sections="sections">
|
||||
</umb-sections>
|
||||
|
||||
<div class="umb-navigation__right">
|
||||
|
||||
<div class="search">
|
||||
<a class="umb-navigation-link" href class="help" hotkey="ctrl+shift+s" ng-click="searchClick()" prevent-default>
|
||||
<span>Search</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="help">
|
||||
<a class="umb-navigation-link" href class="help" hotkey="ctrl+shift+h" ng-click="helpClick()" prevent-default>
|
||||
<span><localize key="sections_help">Help</localize></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a class="umb-navigation-link" href="#" ng-click="avatarClick()" hotkey="ctrl+shift+u" title="{{user.name}}" prevent-default>
|
||||
<span>{{user.name}}</span>
|
||||
<img id="avatar-img" ng-src="{{avatar[0].value}}" ng-srcset="{{avatar[1].value}} 2x, {{avatar[2].value}} 3x" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- navigation container -->
|
||||
|
||||
<umb-overlay
|
||||
ng-if="searchOverlay.show"
|
||||
model="searchOverlay"
|
||||
view="searchOverlay.view"
|
||||
position="full">
|
||||
</umb-overlay>
|
||||
|
||||
<umb-overlay
|
||||
ng-if="helpDialog.show"
|
||||
model="helpDialog"
|
||||
view="helpDialog.view"
|
||||
position="right">
|
||||
</umb-overlay>
|
||||
|
||||
<umb-overlay
|
||||
ng-if="userDialog.show"
|
||||
model="userDialog"
|
||||
view="userDialog.view"
|
||||
position="right">
|
||||
</umb-overlay>
|
||||
|
||||
</div>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user