Compare commits

..

1 Commits

Author SHA1 Message Date
elitsa 6f716cc343 Update old string format for a language area alias and a language key alias 2018-09-13 14:33:29 +02:00
180 changed files with 2785 additions and 3990 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ Assume positive intent and try to understand before being understood.
Treat others as you would like to be treated.
This also goes for treating the HQ with respect. For example: dont promote products on [our.umbraco.com](https://our.umbraco.com) that directly compete with our commercial offerings which enables us to work for a sustainable Umbraco.
This also goes for treating the HQ with respect. For example: dont promote products on [our.umbraco.org](https://our.umbraco.org) that directly compete with our commercial offerings which enables us to work for a sustainable Umbraco.
## Open
+1 -1
View File
@@ -82,7 +82,7 @@ These wonderful volunteers will provide you with a first reply to your PR, revie
You can get in touch with [the PR team](#the-pr-team) in multiple ways, we love open conversations and we are a friendly bunch. No question you have is stupid. Any questions you have usually helps out multiple people with the same question. Ask away:
- If there's an existing issue on the issue tracker then that's a good place to leave questions and discuss how to start or move forward
- Unsure where to start? Did something not work as expected? Try leaving a note in the ["Contributing to Umbraco"](https://our.umbraco.com/forum/contributing-to-umbraco-cms/) forum, the team monitors that one closely
- Unsure where to start? Did something not work as expected? Try leaving a note in the ["Contributing to Umbraco"](https://our.umbraco.org/forum/contributing-to-umbraco-cms/) forum, the team monitors that one closely
- We're also [active in the Gitter chatroom](https://gitter.im/umbraco/Umbraco-CMS)
## Code of Conduct
+5 -5
View File
@@ -31,7 +31,7 @@ Before creating bug reports, please check [this list](#before-submitting-a-bug-r
##### Before Submitting A Bug Report
* Most importantly, check **if you can reproduce the problem** in the [latest version of Umbraco](https://our.umbraco.com/download/). We might have already fixed your particular problem.
* Most importantly, check **if you can reproduce the problem** in the [latest version of Umbraco](https://our.umbraco.org/download/). We might have already fixed your particular problem.
* It also helps tremendously to check if the issue you're experiencing is present in **a clean install** of the Umbraco version you're currently using. Custom code can have side-effects that don't occur in a clean install.
* **Use the Google**. Whatever you're experiencing, Google it plus "Umbraco" - usually you can get some pretty good hints from the search results, including open issues and further troubleshooting hints.
* If you do find and existing issue has **and the issue is still open**, add a comment to the existing issue if you have additional information. If you have the same problem and no new info to add, just "star" the issue.
@@ -65,7 +65,7 @@ Most of the suggestions in the [reporting bugs](#reporting-bugs) section also co
Some additional hints that may be helpful:
* **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of Umbraco which the suggestion is related to.
* **Explain why this enhancement would be useful to most Umbraco users** and isn't something that can or should be implemented as a [community package](https://our.umbraco.com/projects/).
* **Explain why this enhancement would be useful to most Umbraco users** and isn't something that can or should be implemented as a [community package](https://our.umbraco.org/projects/).
### Your First Code Contribution
@@ -80,7 +80,7 @@ The most successful pull requests usually look a like this:
* Fill in the required template
* Include screenshots and animated GIFs in your pull request whenever possible.
* Unit tests, while optional are awesome, thank you!
* New code is commented with documentation from which [the reference documentation](https://our.umbraco.com/documentation/Reference/) is generated
* New code is commented with documentation from which [the reference documentation](https://our.umbraco.org/documentation/Reference/) is generated
Again, these are guidelines, not strict requirements.
@@ -116,8 +116,8 @@ There's two big areas that you should know about:
To find the general areas of something you're looking to fix or improve, have a look at the following two parts of the API documentation.
* [The AngularJS based backoffice files](https://our.umbraco.com/apidocs/ui/#/api) (to be found in `src\Umbraco.Web.UI.Client\src`)
* [The rest](https://our.umbraco.com/apidocs/csharp/)
* [The AngularJS based backoffice files](https://our.umbraco.org/apidocs/ui/#/api) (to be found in `src\Umbraco.Web.UI.Client\src`)
* [The rest](https://our.umbraco.org/apidocs/csharp/)
### What branch should I target for my contributions?
+1 -2
View File
@@ -46,5 +46,4 @@ Umbraco is contribution focused and community driven. If you want to contribute
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](https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/.github/CONTRIBUTING.md).
You can comment and report issues on the [github issue tracker](https://github.com/umbraco/Umbraco-CMS/issues).
Since [September 2018](https://umbraco.com/blog/a-second-take-on-umbraco-issue-tracker-hello-github-issues/) the old issue tracker is in read only mode, but can still be found at [http://issues.umbraco.org](http://issues.umbraco.org).
To view existing issues, please visit [http://issues.umbraco.org](http://issues.umbraco.org).
+1 -1
View File
@@ -1,6 +1,6 @@
# The MIT License (MIT) #
Copyright (c) 2013-present Umbraco
Copyright (c) 2013 Umbraco
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -8,7 +8,7 @@
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
<meta name="generator" content="docfx {{_docfxVersion}}">
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
<link rel="icon" type="image/png" href="https://our.umbraco.com/assets/images/app-icons/favicon.png">
<link rel="icon" type="image/png" href="https://our.umbraco.org/assets/images/app-icons/favicon.png">
<link rel="stylesheet" href="{{_rel}}styles/docfx.vendor.css">
<link rel="stylesheet" href="{{_rel}}styles/docfx.css">
<link rel="stylesheet" href="{{_rel}}styles/main.css">
+1 -1
View File
@@ -63,7 +63,7 @@ a:focus {
}
.navbar-header .navbar-brand {
background: url(https://our.umbraco.com/assets/images/logo.svg) left center no-repeat;
background: url(https://our.umbraco.org/assets/images/logo.svg) left center no-repeat;
background-size: 40px auto;
width:50px;
}
@@ -94,14 +94,14 @@ function Get-UmbracoBuildEnv
}
# ensure we have node
$node = "$path\node-v8.12.0-win-x86"
$source = "http://nodejs.org/dist/v8.12.0/node-v8.12.0-win-x86.7z "
$node = "$path\node-v6.9.1-win-x86"
$source = "http://nodejs.org/dist/v6.9.1/node-v6.9.1-win-x86.7z"
if (-not (test-path $node))
{
Write-Host "Download Node..."
Invoke-WebRequest $source -OutFile "$path\node-v8.12.0-win-x86.7z"
&$sevenZip x "$path\node-v8.12.0-win-x86.7z" -o"$path" -aos > $nul
Remove-File "$path\node-v8.12.0-win-x86.7z"
Invoke-WebRequest $source -OutFile "$path\node-v6.9.1-win-x86.7z"
&$sevenZip x "$path\node-v6.9.1-win-x86.7z" -o"$path" -aos > $nul
Remove-File "$path\node-v6.9.1-win-x86.7z"
}
# note: why? node already brings everything we need!
+1 -1
View File
@@ -28,7 +28,7 @@
<dependency id="HtmlAgilityPack" version="[1.4.9.5, 2.0.0)" />
<dependency id="Lucene.Net" version="[2.9.4.1, 3.0.0.0)" />
<dependency id="MySql.Data" version="[6.9.9, 7.0.0)" />
<dependency id="ClientDependency" version="[1.9.7, 2.0.0)" />
<dependency id="ClientDependency" version="[1.9.6, 2.0.0)" />
<dependency id="ClientDependency-Mvc5" version="[1.8.0.0, 2.0.0)" />
<dependency id="AutoMapper" version="[3.3.1, 4.0.0)" />
<dependency id="Newtonsoft.Json" version="[10.0.2, 11.0.0)" />
-1
View File
@@ -20,7 +20,6 @@
<dependency id="Umbraco.ModelsBuilder" version="[3.0.10, 4.0.0)" />
<dependency id="Microsoft.AspNet.SignalR.Core" version="[2.2.1, 3.0.0)" />
<dependency id="ImageProcessor.Web.Config" version="[2.3.1, 3.0.0)" />
<dependency id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="[2.0.0, 3.0.0)" />
</dependencies>
</metadata>
<files>
+2 -2
View File
@@ -2,7 +2,7 @@
using System.Resources;
[assembly: AssemblyCompany("Umbraco")]
[assembly: AssemblyCopyright("Copyright © Umbraco 2018")]
[assembly: AssemblyCopyright("Copyright © Umbraco 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -12,4 +12,4 @@ using System.Resources;
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.13.0")]
[assembly: AssemblyInformationalVersion("7.13.0")]
[assembly: AssemblyInformationalVersion("7.13.0")]
@@ -13,7 +13,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
IEnumerable<string> ImageTagAllowedAttributes { get; }
IEnumerable<IImagingAutoFillUploadField> ImageAutoFillProperties { get; }
string ScriptFolderPath { get; }
IEnumerable<string> ScriptFileTypes { get; }
+1 -6
View File
@@ -110,11 +110,6 @@ namespace Umbraco.Core
/// Property alias for the Media's file extension.
/// </summary>
public const string Extension = "umbracoExtension";
/// <summary>
/// The default height/width of an image file if the size can't be determined from the metadata
/// </summary>
public const int DefaultSize = 200;
}
/// <summary>
@@ -359,4 +354,4 @@ namespace Umbraco.Core
}
}
}
}
}
-1
View File
@@ -61,7 +61,6 @@
public const int DefaultContentListViewDataTypeId = -95;
public const int DefaultMediaListViewDataTypeId = -96;
public const int DefaultMembersListViewDataTypeId = -97;
public const int DefaultLabelDataTypeId = -92;
public const string UmbracoConnectionName = "umbracoDbDSN";
public const string UmbracoMigrationName = "Umbraco";
+28 -29
View File
@@ -17,15 +17,15 @@ using Umbraco.Core.Models;
namespace Umbraco.Core.IO
{
/// <summary>
/// A custom file system provider for media
/// </summary>
[FileSystemProvider("media")]
public class MediaFileSystem : FileSystemWrapper
{
private readonly IContentSection _contentConfig;
/// <summary>
/// A custom file system provider for media
/// </summary>
[FileSystemProvider("media")]
public class MediaFileSystem : FileSystemWrapper
{
private readonly IContentSection _contentConfig;
private readonly UploadAutoFillProperties _uploadAutoFillProperties;
private readonly ILogger _logger;
private readonly ILogger _logger;
private readonly object _folderCounterLock = new object();
private long _folderCounter;
@@ -39,8 +39,8 @@ namespace Umbraco.Core.IO
};
public MediaFileSystem(IFileSystem wrapped)
: this(wrapped, UmbracoConfig.For.UmbracoSettings().Content, ApplicationContext.Current.ProfilingLogger.Logger)
{ }
: this(wrapped, UmbracoConfig.For.UmbracoSettings().Content, ApplicationContext.Current.ProfilingLogger.Logger)
{ }
public MediaFileSystem(IFileSystem wrapped, IContentSection contentConfig, ILogger logger)
: base(wrapped)
@@ -60,13 +60,13 @@ namespace Umbraco.Core.IO
[Obsolete("This low-level method should NOT exist.")]
public string GetRelativePath(int propertyId, string fileName)
{
{
var sep = _contentConfig.UploadAllowDirectories
? Path.DirectorySeparatorChar
: '-';
? Path.DirectorySeparatorChar
: '-';
return propertyId.ToString(CultureInfo.InvariantCulture) + sep + fileName;
}
return propertyId.ToString(CultureInfo.InvariantCulture) + sep + fileName;
}
[Obsolete("This low-level method should NOT exist.", false)]
public string GetRelativePath(string subfolder, string fileName)
@@ -264,7 +264,7 @@ namespace Umbraco.Core.IO
var filename = Path.GetFileName(sourcepath);
var filepath = GetMediaPath(filename, content.Key, propertyType.Key);
this.CopyFile(sourcepath, filepath);
return filepath;
}
@@ -321,7 +321,7 @@ namespace Umbraco.Core.IO
/// <param name="filepath"></param>
/// <param name="filestream"></param>
private void SetUploadFile(IContentBase content, Property property, string filepath, Stream filestream)
{
{
// will use filepath for extension, and filestream for length
_uploadAutoFillProperties.Populate(content, property.Alias, filepath, filestream);
}
@@ -368,20 +368,19 @@ namespace Umbraco.Core.IO
return new Size(width, height);
}
}
//we have no choice but to try to read in via GDI
using (var image = Image.FromStream(stream))
{
var fileWidth = image.Width;
var fileHeight = image.Height;
return new Size(fileWidth, fileHeight);
}
}
catch (Exception)
{
//We will just swallow, just means we can't read exif data, we don't want to log an error either
return new Size(Constants.Conventions.Media.DefaultSize, Constants.Conventions.Media.DefaultSize);
}
//we have no choice but to try to read in via GDI
using (var image = Image.FromStream(stream))
{
var fileWidth = image.Width;
var fileHeight = image.Height;
return new Size(fileWidth, fileHeight);
}
}
@@ -431,8 +430,8 @@ namespace Umbraco.Core.IO
}
}
public void DeleteMediaFiles(IEnumerable<string> files)
{
public void DeleteMediaFiles(IEnumerable<string> files)
{
files = files.Distinct();
Parallel.ForEach(files, file =>
+16 -20
View File
@@ -2,7 +2,6 @@
using System.Drawing;
using System.IO;
using System.Text;
using Umbraco.Core.Media.TypeDetector;
namespace Umbraco.Core.Media.Exif
{
@@ -119,25 +118,22 @@ namespace Umbraco.Core.Media.Exif
/// <returns>The <see cref="ImageFile"/> created from the file.</returns>
public static ImageFile FromStream(Stream stream, Encoding encoding)
{
// JPEG
if(JPEGDetector.IsOfType(stream))
{
return new JPEGFile(stream, encoding);
}
// TIFF
if (TIFFDetector.IsOfType(stream))
{
return new TIFFFile(stream, encoding);
}
// SVG
if (SVGDetector.IsOfType(stream))
{
return new SVGFile(stream);
}
throw new NotValidImageFileException ();
stream.Seek (0, SeekOrigin.Begin);
byte[] header = new byte[8];
stream.Seek (0, SeekOrigin.Begin);
if (stream.Read (header, 0, header.Length) != header.Length)
throw new NotValidImageFileException ();
// JPEG
if (header[0] == 0xFF && header[1] == 0xD8)
return new JPEGFile (stream, encoding);
// TIFF
string tiffHeader = Encoding.ASCII.GetString (header, 0, 4);
if (tiffHeader == "MM\x00\x2a" || tiffHeader == "II\x2a\x00")
return new TIFFFile (stream, encoding);
throw new NotValidImageFileException ();
}
#endregion
}
@@ -17,9 +17,5 @@
/// The file is a TIFF File.
/// </summary>
TIFF,
/// <summary>
/// The file is a SVG File.
/// </summary>
SVG,
}
}
-37
View File
@@ -1,37 +0,0 @@
using System;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Xml.Linq;
namespace Umbraco.Core.Media.Exif
{
internal class SVGFile : ImageFile
{
public SVGFile(Stream fileStream)
{
fileStream.Position = 0;
var document = XDocument.Load(fileStream); //if it throws an exception the ugly try catch in MediaFileSystem will catch it
var width = document.Root?.Attributes().Where(x => x.Name == "width").Select(x => x.Value).FirstOrDefault();
var height = document.Root?.Attributes().Where(x => x.Name == "height").Select(x => x.Value).FirstOrDefault();
Properties.Add(new ExifSInt(ExifTag.PixelYDimension,
height == null ? Constants.Conventions.Media.DefaultSize : int.Parse(height)));
Properties.Add(new ExifSInt(ExifTag.PixelXDimension,
width == null ? Constants.Conventions.Media.DefaultSize : int.Parse(width)));
Format = ImageFileFormat.SVG;
}
public override void Save(Stream stream)
{
}
public override Image ToImage()
{
throw new NotImplementedException();
}
}
}
@@ -1,14 +0,0 @@
using System.IO;
namespace Umbraco.Core.Media.TypeDetector
{
public class JPEGDetector : RasterizedTypeDetector
{
public static bool IsOfType(Stream fileStream)
{
var header = GetFileHeader(fileStream);
return header[0] == 0xff && header[1] == 0xD8;
}
}
}
@@ -1,16 +0,0 @@
using System.IO;
namespace Umbraco.Core.Media.TypeDetector
{
public abstract class RasterizedTypeDetector
{
public static byte[] GetFileHeader(Stream fileStream)
{
fileStream.Seek(0, SeekOrigin.Begin);
byte[] header = new byte[8];
fileStream.Seek(0, SeekOrigin.Begin);
return header;
}
}
}
@@ -1,24 +0,0 @@
using System.IO;
using System.Xml.Linq;
namespace Umbraco.Core.Media.TypeDetector
{
public class SVGDetector
{
public static bool IsOfType(Stream fileStream)
{
var document = new XDocument();
try
{
document = XDocument.Load(fileStream);
}
catch (System.Exception ex)
{
return false;
}
return document.Root?.Name.LocalName == "svg";
}
}
}
@@ -1,24 +0,0 @@
using System.IO;
using System.Text;
namespace Umbraco.Core.Media.TypeDetector
{
public class TIFFDetector
{
public static bool IsOfType(Stream fileStream)
{
string tiffHeader = GetFileHeader(fileStream);
return tiffHeader == "MM\x00\x2a" || tiffHeader == "II\x2a\x00";
}
public static string GetFileHeader(Stream fileStream)
{
var header = RasterizedTypeDetector.GetFileHeader(fileStream);
string tiffHeader = Encoding.ASCII.GetString(header, 0, 4);
return tiffHeader;
}
}
}
+2 -2
View File
@@ -83,7 +83,7 @@ namespace Umbraco.Core.Models
/// <summary>
/// Returns the instance of the tag support, by default tags are not enabled
/// </summary>
public PropertyTags TagSupport
internal PropertyTags TagSupport
{
get { return _tagSupport; }
}
@@ -242,4 +242,4 @@ namespace Umbraco.Core.Models
return clone;
}
}
}
}
@@ -1,9 +1,9 @@
namespace Umbraco.Core.Models
{
public enum PropertyTagBehavior
internal enum PropertyTagBehavior
{
Replace,
Remove,
Merge
}
}
}
+2 -2
View File
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Models
/// <summary>
/// A property extension class that allows us to enable tags for any given property
/// </summary>
public class PropertyTags
internal class PropertyTags
{
public PropertyTags()
{
@@ -33,4 +33,4 @@ namespace Umbraco.Core.Models
public IEnumerable<Tuple<string, string>> Tags { get; set; }
}
}
}
@@ -1,5 +1,6 @@
using System;
using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
@@ -10,9 +11,6 @@ using Umbraco.Core.Services;
namespace Umbraco.Core.Persistence
{
/// <summary>
/// Helper class for working with databases and schemas.
/// </summary>
public class DatabaseSchemaHelper
{
private readonly Database _db;
@@ -20,22 +18,6 @@ namespace Umbraco.Core.Persistence
private readonly ISqlSyntaxProvider _syntaxProvider;
private readonly BaseDataCreation _baseDataCreation;
/// <summary>
/// Intializes a new helper instance.
/// </summary>
/// <param name="db">The database to be used.</param>
/// <param name="logger">The logger.</param>
/// <param name="syntaxProvider">The syntax provider.</param>
/// <example>
/// A new instance could be initialized like:
/// <code>
/// var schemaHelper = new DatabaseSchemaHelper(
/// ApplicationContext.Current.DatabaseContext.Database,
/// ApplicationContext.Current.ProfilingLogger.Logger,
/// ApplicationContext.Current.DatabaseContext.SqlSyntax
/// );
/// </code>
/// </example>
public DatabaseSchemaHelper(Database db, ILogger logger, ISqlSyntaxProvider syntaxProvider)
{
_db = db;
@@ -44,41 +26,11 @@ namespace Umbraco.Core.Persistence
_baseDataCreation = new BaseDataCreation(db, logger);
}
/// <summary>
/// Returns whether a table with the specified <paramref name="tableName"/> exists in the database.
/// </summary>
/// <param name="tableName">The name of the table.</param>
/// <returns><c>true</c> if the table exists; otherwise <c>false</c>.</returns>
/// <example>
/// <code>
/// if (schemaHelper.TableExist("MyTable"))
/// {
/// // do something when the table exists
/// }
/// </code>
/// </example>
public bool TableExist(string tableName)
{
return _syntaxProvider.DoesTableExist(_db, tableName);
}
/// <summary>
/// Returns whether the table for the specified <typeparamref name="T"/> exists in the database.
///
/// If <typeparamref name="T"/> has been decorated with an <see cref="TableNameAttribute"/>, the name from that
/// attribute will be used for the table name. If the attribute is not present, the name
/// <typeparamref name="T"/> will be used instead.
/// </summary>
/// <typeparam name="T">The type representing the DTO/table.</typeparam>
/// <returns><c>true</c> if the table exists; otherwise <c>false</c>.</returns>
/// <example>
/// <code>
/// if (schemaHelper.TableExist&lt;MyDto&gt;)
/// {
/// // do something when the table exists
/// }
/// </code>
/// </example>
public bool TableExist<T>()
{
var poco = Database.PocoData.ForType(typeof(T));
@@ -138,17 +90,6 @@ namespace Umbraco.Core.Persistence
_logger.Info<Database>("Finalized database schema creation");
}
/// Creates a new table in the database based on the type of <typeparamref name="T"/>.
///
/// If <typeparamref name="T"/> has been decorated with an <see cref="TableNameAttribute"/>, the name from that
/// attribute will be used for the table name. If the attribute is not present, the name
/// <typeparamref name="T"/> will be used instead.
///
/// If a table with the same name already exists, the <paramref name="overwrite"/> parameter will determine
/// whether the table is overwritten. If <c>true</c>, the table will be overwritten, whereas this method will
/// not do anything if the parameter is <c>false</c>.
/// <typeparam name="T">The type representing the DTO/table.</typeparam>
/// <param name="overwrite">Whether the table should be overwritten if it already exists.</param>
public void CreateTable<T>(bool overwrite)
where T : new()
{
@@ -156,16 +97,6 @@ namespace Umbraco.Core.Persistence
CreateTable(overwrite, tableType);
}
/// <summary>
/// Creates a new table in the database based on the type of <typeparamref name="T"/>.
///
/// If <typeparamref name="T"/> has been decorated with an <see cref="TableNameAttribute"/>, the name from that
/// attribute will be used for the table name. If the attribute is not present, the name
/// <typeparamref name="T"/> will be used instead.
///
/// If a table with the same name already exists, this method will not do anything.
/// </summary>
/// <typeparam name="T">The type representing the DTO/table.</typeparam>
public void CreateTable<T>()
where T : new()
{
@@ -173,19 +104,6 @@ namespace Umbraco.Core.Persistence
CreateTable(false, tableType);
}
/// <summary>
/// Creates a new table in the database for the specified <paramref name="modelType"/>.
///
/// If <paramref name="modelType"/> has been decorated with an <see cref="TableNameAttribute"/>, the name from
/// that attribute will be used for the table name. If the attribute is not present, the name
/// <paramref name="modelType"/> will be used instead.
///
/// If a table with the same name already exists, the <paramref name="overwrite"/> parameter will determine
/// whether the table is overwritten. If <c>true</c>, the table will be overwritten, whereas this method will
/// not do anything if the parameter is <c>false</c>.
/// </summary>
/// <param name="overwrite">Whether the table should be overwritten if it already exists.</param>
/// <param name="modelType">The the representing the table.</param>
public void CreateTable(bool overwrite, Type modelType)
{
var tableDefinition = DefinitionFactory.GetTableDefinition(_syntaxProvider, modelType);
@@ -199,8 +117,6 @@ namespace Umbraco.Core.Persistence
var tableExist = TableExist(tableName);
if (overwrite && tableExist)
{
_logger.Info<Database>(string.Format("Table '{0}' already exists, but will be recreated", tableName));
DropTable(tableName);
tableExist = false;
}
@@ -253,37 +169,15 @@ namespace Umbraco.Core.Persistence
_logger.Info<Database>(string.Format("Create Foreign Key sql {0}:\n {1}", createdFk, sql));
}
transaction.Complete();
if (overwrite)
{
_logger.Info<Database>(string.Format("Table '{0}' was recreated", tableName));
}
else
{
_logger.Info<Database>(string.Format("New table '{0}' was created", tableName));
}
}
}
else
{
// The table exists and was not recreated/overwritten.
_logger.Info<Database>(string.Format("Table '{0}' already exists - no changes were made", tableName));
}
_logger.Info<Database>(string.Format("New table '{0}' was created", tableName));
}
/// <summary>
/// Drops the table for the specified <typeparamref name="T"/>.
///
/// If <typeparamref name="T"/> has been decorated with an <see cref="TableNameAttribute"/>, the name from that
/// attribute will be used for the table name. If the attribute is not present, the name
/// <typeparamref name="T"/> will be used instead.
/// </summary>
/// <typeparam name="T">The type representing the DTO/table.</typeparam>
/// <example>
/// <code>
/// schemaHelper.DropTable&lt;MyDto&gt;);
/// </code>
/// </example>
public void DropTable<T>()
where T : new()
{
@@ -299,15 +193,6 @@ namespace Umbraco.Core.Persistence
DropTable(tableName);
}
/// <summary>
/// Drops the table with the specified <paramref name="tableName"/>.
/// </summary>
/// <param name="tableName">The name of the table.</param>
/// <example>
/// <code>
/// schemaHelper.DropTable("MyTable");
/// </code>
/// </example>
public void DropTable(string tableName)
{
var sql = new Sql(string.Format(
@@ -30,7 +30,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
if(tableName.Equals("umbracoNode"))
{
CreateUmbracoNodeData();
CreateUmbracNodeData();
}
if (tableName.Equals("umbracoLock"))
@@ -111,7 +111,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
_logger.Info<BaseDataCreation>(string.Format("Done creating data in table {0}", tableName));
}
private void CreateUmbracoNodeData()
private void CreateUmbracNodeData()
{
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -1, Trashed = false, ParentId = -1, UserId = 0, Level = 0, Path = "-1", SortOrder = 0, UniqueId = new Guid("916724a5-173d-4619-b97e-b9de133dd6f5"), Text = "SYSTEM DATA: umbraco master root", NodeObjectType = new Guid(Constants.ObjectTypes.SystemRoot), CreateDate = DateTime.Now });
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -20, Trashed = false, ParentId = -1, UserId = 0, Level = 0, Path = "-1,-20", SortOrder = 0, UniqueId = new Guid("0F582A79-1E41-4CF0-BFA0-76340651891A"), Text = "Recycle Bin", NodeObjectType = new Guid(Constants.ObjectTypes.ContentRecycleBin), CreateDate = DateTime.Now });
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwelveZ
// We need to get all datatypes with an alias of "umbraco.tags" so we can loop over them and set the missing values if needed
var datatypes = Context.Database.Fetch<DataTypeDto>("SELECT * FROM cmsDataType");
var tagsDataTypes = datatypes.Where(x => string.Equals(x.PropertyEditorAlias, Constants.PropertyEditors.TagsAlias, StringComparison.InvariantCultureIgnoreCase));
var dataTypePreValues = Context.Database.Fetch<DataTypePreValueDto>("SELECT * FROM cmsDataTypePreValues");
var dataTypePreValues = Context.Database.Fetch<DataTypePreValueDto>("SELECT * FROM cmsDataTypePrevalues");
foreach (var datatype in tagsDataTypes)
{
@@ -36,7 +36,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenTwelveZ
// if the "storageType" has not been set we do so by adding a new row in the table for the nodid and set it
if (result == null)
{
Insert.IntoTable("cmsDataTypePreValues").Row(new
Insert.IntoTable("CmsDataTypePrevalues").Row(new
{
datatypeNodeId = datatype.DataTypeId,
value = "Csv",
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
@@ -48,33 +47,43 @@ namespace Umbraco.Core.Persistence.Repositories
var sql = GetBaseQuery(false);
if (query == null) query = new Query<IAuditItem>();
var queryHasWhereClause = query.GetWhereClauses().Any();
var translatorIds = new SqlTranslator<IAuditItem>(sql, query);
var translatedQuery = translatorIds.Translate();
var customFilterWheres = customFilter?.GetWhereClauses().ToArray();
var customFilterWheres = customFilter != null ? customFilter.GetWhereClauses().ToArray() : null;
var hasCustomFilter = customFilterWheres != null && customFilterWheres.Length > 0;
if (hasCustomFilter)
{
var filterSql = new Sql();
foreach (var filterClause in customFilterWheres)
{
filterSql.Append($"AND ({filterClause.Item1})", filterClause.Item2);
var first = true;
foreach (var filterClaus in customFilterWheres)
{
if (first == false)
{
filterSql.Append(" AND ");
}
filterSql.Append(string.Format("({0})", filterClaus.Item1), filterClaus.Item2);
first = false;
}
translatedQuery = GetFilteredSqlForPagedResults(translatedQuery, filterSql, queryHasWhereClause);
translatedQuery = GetFilteredSqlForPagedResults(translatedQuery, filterSql);
}
if (auditTypeFilter.Length > 0)
{
var filterSql = new Sql();
foreach (var filterClause in auditTypeFilter)
{
filterSql.Append("AND (logHeader = @logHeader)", new { logHeader = filterClause.ToString() });
var first = true;
foreach (var filterClaus in auditTypeFilter)
{
if (first == false || hasCustomFilter)
{
filterSql.Append(" AND ");
}
filterSql.Append("(logHeader = @logHeader)", new {logHeader = filterClaus.ToString() });
first = false;
}
translatedQuery = GetFilteredSqlForPagedResults(translatedQuery, filterSql, queryHasWhereClause || hasCustomFilter);
translatedQuery = GetFilteredSqlForPagedResults(translatedQuery, filterSql);
}
if (orderDirection == Direction.Descending)
@@ -90,7 +99,7 @@ namespace Umbraco.Core.Persistence.Repositories
dto => new AuditItem(dto.Id, dto.Comment, Enum<AuditType>.ParseOrNull(dto.Header) ?? AuditType.Custom, dto.UserId)).ToArray();
//Mapping the DateStamp
for (var i = 0; i < pages.Length; i++)
for (int i = 0; i < pages.Length; i++)
{
pages[i].CreateDate = pagedResult.Items[i].Datestamp;
}
@@ -160,17 +169,14 @@ namespace Umbraco.Core.Persistence.Repositories
}
#endregion
private Sql GetFilteredSqlForPagedResults(Sql sql, Sql filterSql, bool hasWhereClause)
private Sql GetFilteredSqlForPagedResults(Sql sql, Sql filterSql)
{
Sql filteredSql;
// Apply filter
if (filterSql != null)
{
//ensure we don't append a WHERE if there is already one
var sqlFilter = hasWhereClause
? filterSql.SQL
: " WHERE " + filterSql.SQL.TrimStart("AND ");
var sqlFilter = " WHERE " + filterSql.SQL.TrimStart("AND ");
//NOTE: this is certainly strange - NPoco handles this much better but we need to re-create the sql
// instance a couple of times to get the parameter order correct, for some reason the first
@@ -134,7 +134,7 @@ namespace Umbraco.Core.Persistence.Repositories
.InnerJoin<ContentDto>(SqlSyntax)
.On<ContentVersionDto, ContentDto>(SqlSyntax, left => left.NodeId, right => right.NodeId)
.InnerJoin<NodeDto>(SqlSyntax)
.On<ContentDto, NodeDto>(SqlSyntax, left => left.NodeId, right => right.NodeId)
.On<ContentDto, NodeDto>(SqlSyntax, left => left.NodeId, right => right.NodeId)
.InnerJoin<ContentTypeDto>()
.On<ContentTypeDto, ContentDto>(left => left.NodeId, right => right.ContentTypeId);
//TODO: IF we want to enable querying on content type information this will need to be joined
@@ -836,19 +836,19 @@ order by umbracoNode.{2}, umbracoNode.parentID, umbracoNode.sortOrder",
}
public int CountPublished(string contentTypeAlias = null)
{
if (contentTypeAlias.IsNullOrWhiteSpace())
{
{
if (contentTypeAlias.IsNullOrWhiteSpace())
{
var sql = GetBaseQuery(true).Where<NodeDto>(x => x.Trashed == false)
.Where<DocumentDto>(x => x.Published == true);
return Database.ExecuteScalar<int>(sql);
.Where<DocumentDto>(x => x.Published == true);
return Database.ExecuteScalar<int>(sql);
}
else
{
else
{
var sql = GetBaseQuery(true).Where<NodeDto>(x => x.Trashed == false)
.Where<DocumentDto>(x => x.Published == true)
.Where<ContentTypeDto>(x => x.Alias == contentTypeAlias);
return Database.ExecuteScalar<int>(sql);
.Where<DocumentDto>(x => x.Published == true)
.Where<ContentTypeDto>(x => x.Alias == contentTypeAlias);
return Database.ExecuteScalar<int>(sql);
}
}
@@ -1220,14 +1220,7 @@ ORDER BY cmsContentVersion.id DESC
if (def.DocumentDto.TemplateId.HasValue)
templates.TryGetValue(def.DocumentDto.TemplateId.Value, out template); // else null
cc.Template = template;
if (propertyData.ContainsKey(cc.Version))
{
cc.Properties = propertyData[cc.Version];
}
else
{
throw new InvalidOperationException($"No property data found for version: '{cc.Version}'.");
}
cc.Properties = propertyData[cc.Version];
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
@@ -1314,4 +1307,4 @@ ORDER BY cmsContentVersion.id DESC
}
}
}
}
}
@@ -284,7 +284,7 @@ namespace Umbraco.Core.Persistence.Repositories
var nonAssignedRoles = roleNames.Except(assignedRoles, StringComparer.CurrentCultureIgnoreCase);
foreach (var toAssign in nonAssignedRoles)
{
var groupId = rolesForNames.First(x => x.Text.InvariantEquals(toAssign)).NodeId;
var groupId = rolesForNames.First(x => x.Text == toAssign).NodeId;
Database.Insert(new Member2MemberGroupDto { Member = mId, MemberGroup = groupId });
}
}
@@ -4,7 +4,6 @@ using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Text.RegularExpressions;
using System.Web.Security;
using Newtonsoft.Json;
using Umbraco.Core.Configuration;
@@ -711,10 +710,10 @@ ORDER BY colName";
private IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser> query, long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection,
string[] includeUserGroups = null,
string[] excludeUserGroups = null,
UserState[] userState = null,
private IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser> query, long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection,
string[] includeUserGroups = null,
string[] excludeUserGroups = null,
UserState[] userState = null,
IQuery<IUser> customFilter = null)
{
if (string.IsNullOrWhiteSpace(orderBy)) throw new ArgumentException("Value cannot be null or whitespace.", "orderBy");
@@ -722,23 +721,23 @@ ORDER BY colName";
Sql filterSql = null;
var customFilterWheres = customFilter != null ? customFilter.GetWhereClauses().ToArray() : null;
var hasCustomFilter = customFilterWheres != null && customFilterWheres.Length > 0;
var hasCustomFilter = customFilterWheres != null && customFilterWheres.Length > 0;
if (hasCustomFilter
|| (includeUserGroups != null && includeUserGroups.Length > 0) || (excludeUserGroups != null && excludeUserGroups.Length > 0)
|| (userState != null && userState.Length > 0 && userState.Contains(UserState.All) == false))
filterSql = new Sql();
|| (includeUserGroups != null && includeUserGroups.Length > 0) || (excludeUserGroups != null && excludeUserGroups.Length > 0)
|| (userState != null && userState.Length > 0 && userState.Contains(UserState.All) == false))
filterSql = new Sql();
if (hasCustomFilter)
{
foreach (var filterClause in customFilterWheres)
{
filterSql.Append($"AND ({filterClause.Item1})", filterClause.Item2);
filterSql.Append(string.Format("AND ({0})", filterClause.Item1), filterClause.Item2);
}
}
}
if (includeUserGroups != null && includeUserGroups.Length > 0)
{
const string subQuery = @"AND (umbracoUser.id IN (SELECT DISTINCT umbracoUser.id
var subQuery = @"AND (umbracoUser.id IN (SELECT DISTINCT umbracoUser.id
FROM umbracoUser
INNER JOIN umbracoUser2UserGroup ON umbracoUser2UserGroup.userId = umbracoUser.id
INNER JOIN umbracoUserGroup ON umbracoUserGroup.id = umbracoUser2UserGroup.userGroupId
@@ -748,21 +747,21 @@ ORDER BY colName";
if (excludeUserGroups != null && excludeUserGroups.Length > 0)
{
const string subQuery = @"AND (umbracoUser.id NOT IN (SELECT DISTINCT umbracoUser.id
var subQuery = @"AND (umbracoUser.id NOT IN (SELECT DISTINCT umbracoUser.id
FROM umbracoUser
INNER JOIN umbracoUser2UserGroup ON umbracoUser2UserGroup.userId = umbracoUser.id
INNER JOIN umbracoUserGroup ON umbracoUserGroup.id = umbracoUser2UserGroup.userGroupId
WHERE umbracoUserGroup.userGroupAlias IN (@userGroups)))";
filterSql.Append(subQuery, new { userGroups = excludeUserGroups });
}
}
if (userState != null && userState.Length > 0)
{
{
//the "ALL" state doesn't require any filtering so we ignore that, if it exists in the list we don't do any filtering
if (userState.Contains(UserState.All) == false)
{
var sb = new StringBuilder("(");
var appended = false;
var appended = false;
if (userState.Contains(UserState.Active))
{
@@ -798,81 +797,67 @@ ORDER BY colName";
filterSql.Append("AND " + sb);
}
}
// Get base query for returning IDs
var sqlBaseIds = GetBaseQuery("id");
}
// Get base query for returning IDs
var sqlBaseIds = GetBaseQuery("id");
if (query == null) query = new Query<IUser>();
var queryHasWhereClause = query.GetWhereClauses().Any();
var translatorIds = new SqlTranslator<IUser>(sqlBaseIds, query);
var sqlQueryIds = translatorIds.Translate();
var sqlBaseFull = GetBaseQuery("umbracoUser.*, umbracoUserGroup.*, umbracoUserGroup2App.*, umbracoUserStartNode.*");
var translatorFull = new SqlTranslator<IUser>(sqlBaseFull, query);
//get sorted and filtered sql
var sqlQueryIds = translatorIds.Translate();
//get sorted and filtered sql
var sqlNodeIdsWithSort = GetSortedSqlForPagedResults(
GetFilteredSqlForPagedResults(sqlQueryIds, filterSql, queryHasWhereClause),
GetFilteredSqlForPagedResults(sqlQueryIds, filterSql),
orderDirection, orderBy);
// Get page of results and total count
var pagedResult = Database.Page<UserDto>(pageIndex + 1, pageSize, sqlNodeIdsWithSort);
totalRecords = Convert.ToInt32(pagedResult.TotalItems);
//NOTE: We need to check the actual items returned, not the 'totalRecords', that is because if you request a page number
// that doesn't actually have any data on it, the totalRecords will still indicate there are records but there are none in
// the pageResult.
totalRecords = Convert.ToInt32(pagedResult.TotalItems);
//NOTE: We need to check the actual items returned, not the 'totalRecords', that is because if you request a page number
// that doesn't actually have any data on it, the totalRecords will still indicate there are records but there are none in
// the pageResult.
if (pagedResult.Items.Any())
{
//Create the inner paged query that was used above to get the paged result, we'll use that as the inner sub query
var args = sqlNodeIdsWithSort.Arguments;
string sqlStringCount, sqlStringPage;
Database.BuildPageQueries<UserDto>(pageIndex * pageSize, pageSize, sqlNodeIdsWithSort.SQL, ref args, out sqlStringCount, out sqlStringPage);
var sqlQueryFull = translatorFull.Translate();
//We need to make this FULL query an inner join on the paged ID query
var splitQuery = sqlQueryFull.SQL.Split(new[] { "WHERE " }, StringSplitOptions.None);
var fullQueryWithPagedInnerJoin = new Sql(splitQuery[0])
.Append("INNER JOIN (")
//join the paged query with the paged query arguments
var sqlQueryFull = GetBaseQuery("umbracoUser.*, umbracoUserGroup.*, umbracoUserGroup2App.*, umbracoUserStartNode.*");
var fullQueryWithPagedInnerJoin = sqlQueryFull
.Append("INNER JOIN (")
//join the paged query with the paged query arguments
.Append(sqlStringPage, args)
.Append(") temp ")
.Append("ON umbracoUser.id = temp.id");
AddGroupLeftJoin(fullQueryWithPagedInnerJoin);
if (splitQuery.Length > 1)
{
//add the original where clause back with the original arguments
fullQueryWithPagedInnerJoin.Where(splitQuery[1], sqlQueryIds.Arguments);
}
//get sorted and filtered sql
var fullQuery = GetSortedSqlForPagedResults(
GetFilteredSqlForPagedResults(fullQueryWithPagedInnerJoin, filterSql, queryHasWhereClause),
GetFilteredSqlForPagedResults(fullQueryWithPagedInnerJoin, filterSql),
orderDirection, orderBy);
var users = ConvertFromDtos(Database.Fetch<UserDto, UserGroupDto, UserGroup2AppDto, UserStartNodeDto, UserDto>(new UserGroupRelator().Map, fullQuery))
.ToArray(); // important so we don't iterate twice, if we don't do this we can end up with null values in cache if we were caching.
return users;
}
}
return Enumerable.Empty<IUser>();
}
private Sql GetFilteredSqlForPagedResults(Sql sql, Sql filterSql, bool hasWhereClause)
private Sql GetFilteredSqlForPagedResults(Sql sql, Sql filterSql)
{
Sql filteredSql;
// Apply filter
if (filterSql != null)
{
//ensure we don't append a WHERE if there is already one
var sqlFilter = hasWhereClause
? filterSql.SQL
: " WHERE " + filterSql.SQL.TrimStart("AND ");
var sqlFilter = " WHERE " + filterSql.SQL.TrimStart("AND ");
//NOTE: this is certainly strange - NPoco handles this much better but we need to re-create the sql
// instance a couple of times to get the parameter order correct, for some reason the first
@@ -290,9 +290,6 @@ namespace Umbraco.Core.Persistence.Repositories
// Apply filter
if (defaultFilter != null)
{
//NOTE: It is assumed here that the `sql` already contains a WHERE clause, see UserRepository.GetFilteredSqlForPagedResults
// for an example of when it's not assumed there's already a WHERE clause
var filterResult = defaultFilter();
//NOTE: this is certainly strange - NPoco handles this much better but we need to re-create the sql
@@ -996,4 +993,4 @@ ORDER BY contentNodeId, versionId, propertytypeid
}
}
}
}
}
@@ -1,10 +1,8 @@
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
@@ -460,23 +458,5 @@ namespace Umbraco.Core.Security
return ticket;
}
/// <summary>
/// Ensures that the thread culture is set based on the back office user's culture
/// </summary>
/// <param name="identity"></param>
internal static void EnsureCulture(this IIdentity identity)
{
if (identity is UmbracoBackOfficeIdentity umbIdentity && umbIdentity.IsAuthenticated)
{
Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture =
UserCultures.GetOrAdd(umbIdentity.Culture, s => new CultureInfo(s));
}
}
/// <summary>
/// Used so that we aren't creating a new CultureInfo object for every single request
/// </summary>
private static readonly ConcurrentDictionary<string, CultureInfo> UserCultures = new ConcurrentDictionary<string, CultureInfo>();
}
}
}
@@ -102,8 +102,7 @@ namespace Umbraco.Core.Security
/// <returns/>
public override async Task ValidateIdentity(CookieValidateIdentityContext context)
{
//ensure the thread culture is set
context?.Identity?.EnsureCulture();
EnsureCulture(context);
await EnsureValidSessionId(context);
@@ -121,5 +120,21 @@ namespace Umbraco.Core.Security
if (_appCtx.IsConfigured && _appCtx.IsUpgrading == false)
await SessionIdValidator.ValidateSessionAsync(TimeSpan.FromMinutes(1), context);
}
private void EnsureCulture(CookieValidateIdentityContext context)
{
var umbIdentity = context.Identity as UmbracoBackOfficeIdentity;
if (umbIdentity != null && umbIdentity.IsAuthenticated)
{
Thread.CurrentThread.CurrentCulture =
Thread.CurrentThread.CurrentUICulture =
UserCultures.GetOrAdd(umbIdentity.Culture, s => new CultureInfo(s));
}
}
/// <summary>
/// Used so that we aren't creating a new CultureInfo object for every single request
/// </summary>
private static readonly ConcurrentDictionary<string, CultureInfo> UserCultures = new ConcurrentDictionary<string, CultureInfo>();
}
}
}
@@ -236,10 +236,7 @@ namespace Umbraco.Core.Security
if (dataProtectionProvider != null)
{
manager.UserTokenProvider = new DataProtectorTokenProvider<T, int>(dataProtectionProvider.Create("ASP.NET Identity"))
{
TokenLifespan = TimeSpan.FromDays(3)
};
manager.UserTokenProvider = new DataProtectorTokenProvider<T, int>(dataProtectionProvider.Create("ASP.NET Identity"));
}
manager.UserLockoutEnabledByDefault = true;
@@ -751,7 +748,6 @@ namespace Umbraco.Core.Security
var httpContext = HttpContext.Current == null ? (HttpContextBase)null : new HttpContextWrapper(HttpContext.Current);
return httpContext.GetCurrentRequestIpAddress();
}
}
}
@@ -630,9 +630,7 @@ namespace Umbraco.Core.Security
|| identityUser.LastLoginDateUtc.HasValue && user.LastLoginDate.ToUniversalTime() != identityUser.LastLoginDateUtc.Value)
{
anythingChanged = true;
//if the LastLoginDate is being set to MinValue, don't convert it ToLocalTime
var dt = identityUser.LastLoginDateUtc == DateTime.MinValue ? DateTime.MinValue : identityUser.LastLoginDateUtc.Value.ToLocalTime();
user.LastLoginDate = dt;
user.LastLoginDate = identityUser.LastLoginDateUtc.Value.ToLocalTime();
}
if (identityUser.IsPropertyDirty("LastPasswordChangeDateUtc")
|| (user.LastPasswordChangeDate != default(DateTime) && identityUser.LastPasswordChangeDateUtc.HasValue == false)
+5 -8
View File
@@ -2060,15 +2060,12 @@ namespace Umbraco.Core.Services
using (new WriteLock(Locker))
{
var allContent = GetByIds(ids).ToDictionary(x => x.Id, x => x);
if (allContent.Any() == false)
{
return false;
}
var items = ids.Select(x => allContent[x]).ToArray();
var items = ids.Select(x => allContent[x]);
using (var uow = UowProvider.GetUnitOfWork())
{
var saveEventArgs = new SaveEventArgs<IContent>(items);
var asArray = items.ToArray();
var saveEventArgs = new SaveEventArgs<IContent>(asArray);
if (raiseEvents && uow.Events.DispatchCancelable(Saving, this, saveEventArgs, "Saving"))
{
uow.Commit();
@@ -2078,7 +2075,7 @@ namespace Umbraco.Core.Services
var repository = RepositoryFactory.CreateContentRepository(uow);
var i = 0;
foreach (var content in items)
foreach (var content in asArray)
{
//If the current sort order equals that of the content
//we don't need to update it, so just increment the sort order
@@ -2125,7 +2122,7 @@ namespace Umbraco.Core.Services
_publishingStrategy.PublishingFinalized(uow, shouldBePublished, false);
}
Audit(uow, AuditType.Sort, "Sort child items performed by user", userId, items.First().ParentId);
Audit(uow, AuditType.Sort, "Sorting content performed by user", userId, 0);
uow.Commit();
}
}
@@ -49,7 +49,7 @@ namespace Umbraco.Core.Services
private Dictionary<string, IContentType> _importedContentTypes;
private IPackageInstallation _packageInstallation;
private readonly IUserService _userService;
private static HttpClient _httpClient;
public PackagingService(
ILogger logger,
@@ -89,6 +89,7 @@ namespace Umbraco.Core.Services
/// <returns></returns>
public string FetchPackageFile(Guid packageId, Version umbracoVersion, int userId)
{
using (var httpClient = new HttpClient())
using (var uow = _uowProvider.GetUnitOfWork())
{
//includeHidden = true because we don't care if it's hidden we want to get the file regardless
@@ -96,11 +97,7 @@ namespace Umbraco.Core.Services
byte[] bytes;
try
{
if (_httpClient == null)
{
_httpClient = new HttpClient();
}
bytes = _httpClient.GetByteArrayAsync(url).GetAwaiter().GetResult();
bytes = httpClient.GetByteArrayAsync(url).GetAwaiter().GetResult();
}
catch (HttpRequestException ex)
{
@@ -1749,7 +1746,7 @@ namespace Umbraco.Core.Services
internal InstallationSummary InstallPackage(string packageFilePath, int userId = 0, bool raiseEvents = false)
{
var metaData = GetPackageMetaData(packageFilePath);
var metaData = GetPackageMetaData(packageFilePath);
if (raiseEvents)
{
+7 -12
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -45,8 +45,8 @@
<Reference Include="AutoMapper.Net4, Version=3.3.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005, processorArchitecture=MSIL">
<HintPath>..\packages\AutoMapper.3.3.1\lib\net40\AutoMapper.Net4.dll</HintPath>
</Reference>
<Reference Include="ClientDependency.Core, Version=1.9.7.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ClientDependency.1.9.7\lib\net45\ClientDependency.Core.dll</HintPath>
<Reference Include="ClientDependency.Core, Version=1.9.6.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ClientDependency.1.9.6\lib\net45\ClientDependency.Core.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack, Version=1.4.9.5, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">
<HintPath>..\packages\HtmlAgilityPack.1.4.9.5\lib\Net45\HtmlAgilityPack.dll</HintPath>
@@ -365,11 +365,6 @@
<Compile Include="IEmailSender.cs" />
<Compile Include="IHttpContextAccessor.cs" />
<Compile Include="Logging\RollingFileCleanupAppender.cs" />
<Compile Include="Media\Exif\SVGFile.cs" />
<Compile Include="Media\TypeDetector\JPEGDetector.cs" />
<Compile Include="Media\TypeDetector\RasterizedTypeDetector.cs" />
<Compile Include="Media\TypeDetector\SVGDetector.cs" />
<Compile Include="Media\TypeDetector\TIFFDetector.cs" />
<Compile Include="Models\AuditEntry.cs" />
<Compile Include="Models\Consent.cs" />
<Compile Include="Models\ConsentExtensions.cs" />
@@ -572,8 +567,8 @@
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenEightZero\AddInstructionCountColumn.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenEightZero\AddCmsMediaTable.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenEightZero\AddUserLoginTable.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwelveZero\RenameTrueFalseField.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwelveZero\SetDefaultTagsStorageType.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwelveZero\RenameTrueFalseField.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwelveZero\SetDefaultTagsStorageType.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenNineZero\AddUmbracoAuditTable.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenNineZero\AddUmbracoConsentTable.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenNineZero\AddIsSensitiveMemberTypeColumn.cs" />
@@ -643,7 +638,7 @@
<Compile Include="Media\Exif\TIFFStrip.cs" />
<Compile Include="Media\Exif\Utility.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenThreeOne\UpdateUserLanguagesToIsoCode.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwelveZero\IncreaseLanguageIsoCodeColumnLength.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwelveZero\IncreaseLanguageIsoCodeColumnLength.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwelveZero\UpdateUmbracoConsent.cs" />
<Compile Include="Persistence\PocoDataDataReader.cs" />
<Compile Include="Persistence\Querying\CachedExpression.cs" />
@@ -1693,4 +1688,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AutoMapper" version="3.3.1" targetFramework="net45" />
<package id="ClientDependency" version="1.9.7" targetFramework="net45" />
<package id="ClientDependency" version="1.9.6" targetFramework="net45" />
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net45" />
<package id="ImageProcessor" version="2.5.6" targetFramework="net45" />
<package id="log4net" version="2.0.8" targetFramework="net45" />
@@ -66,46 +66,6 @@ namespace Umbraco.Tests.Persistence.Repositories
}
}
[Test]
public void Get_Paged_Items_By_User_Id_With_Query_And_Filter()
{
var provider = new PetaPocoUnitOfWorkProvider(Logger);
var unitOfWork = provider.GetUnitOfWork();
using (var repo = new AuditRepository(unitOfWork, CacheHelper, Logger, SqlSyntax))
{
for (int i = 0; i < 100; i++)
{
repo.AddOrUpdate(new AuditItem(i, string.Format("Content {0} created", i), AuditType.New, 0));
repo.AddOrUpdate(new AuditItem(i, string.Format("Content {0} published", i), AuditType.Publish, 0));
}
unitOfWork.Commit();
}
using (var repo = new AuditRepository(unitOfWork, CacheHelper, Logger, SqlSyntax))
{
var query = Query<IAuditItem>.Builder.Where(x => x.UserId == 0);
try
{
DatabaseContext.Database.EnableSqlTrace = true;
DatabaseContext.Database.EnableSqlCount();
var page = repo.GetPagedResultsByQuery(query, 0, 10, out var total, Direction.Descending,
new[] { AuditType.Publish },
Query<IAuditItem>.Builder.Where(x => x.UserId > -1));
Assert.AreEqual(10, page.Count());
Assert.AreEqual(100, total);
}
finally
{
DatabaseContext.Database.EnableSqlTrace = false;
DatabaseContext.Database.DisableSqlCount();
}
}
}
[Test]
public void Get_Paged_Items_With_AuditType_Filter()
{
@@ -123,24 +83,14 @@ namespace Umbraco.Tests.Persistence.Repositories
using (var repo = new AuditRepository(unitOfWork, CacheHelper, Logger, SqlSyntax))
{
try
{
DatabaseContext.Database.EnableSqlTrace = true;
DatabaseContext.Database.EnableSqlCount();
long total;
var page = repo.GetPagedResultsByQuery(Query<IAuditItem>.Builder, 0, 9, out total, Direction.Descending,
new[] {AuditType.Publish}, null)
.ToArray();
var page = repo.GetPagedResultsByQuery(Query<IAuditItem>.Builder, 0, 9, out var total, Direction.Descending,
new[] { AuditType.Publish }, null)
.ToArray();
Assert.AreEqual(9, page.Length);
Assert.IsTrue(page.All(x => x.AuditType == AuditType.Publish));
Assert.AreEqual(100, total);
}
finally
{
DatabaseContext.Database.EnableSqlTrace = false;
DatabaseContext.Database.DisableSqlCount();
}
Assert.AreEqual(9, page.Length);
Assert.IsTrue(page.All(x => x.AuditType == AuditType.Publish));
Assert.AreEqual(100, total);
}
}
@@ -161,25 +111,15 @@ namespace Umbraco.Tests.Persistence.Repositories
using (var repo = new AuditRepository(unitOfWork, CacheHelper, Logger, SqlSyntax))
{
try
{
DatabaseContext.Database.EnableSqlTrace = true;
DatabaseContext.Database.EnableSqlCount();
long total;
var page = repo.GetPagedResultsByQuery(Query<IAuditItem>.Builder, 0, 8, out total, Direction.Descending,
null, Query<IAuditItem>.Builder.Where(item => item.Comment == "Content created"))
.ToArray();
var page = repo.GetPagedResultsByQuery(Query<IAuditItem>.Builder, 0, 8, out var total, Direction.Descending,
null, Query<IAuditItem>.Builder.Where(item => item.Comment == "Content created"))
.ToArray();
Assert.AreEqual(8, page.Length);
Assert.IsTrue(page.All(x => x.Comment == "Content created"));
Assert.AreEqual(100, total);
}
finally
{
DatabaseContext.Database.EnableSqlTrace = false;
DatabaseContext.Database.DisableSqlCount();
}
Assert.AreEqual(8, page.Length);
Assert.IsTrue(page.All(x => x.Comment == "Content created"));
Assert.AreEqual(100, total);
}
}
}
}
}
@@ -6,7 +6,6 @@ using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Persistence.Repositories;
using Umbraco.Core.Persistence.UnitOfWork;
@@ -393,71 +392,7 @@ namespace Umbraco.Tests.Persistence.Repositories
var result = repository.Count(query);
// Assert
Assert.AreEqual(2, result);
}
}
[Test]
public void Can_Get_Paged_Results_By_Query_And_Filter_And_Groups()
{
// Arrange
var provider = new PetaPocoUnitOfWorkProvider(Logger);
var unitOfWork = provider.GetUnitOfWork();
using (var repository = CreateRepository(unitOfWork))
{
var users = CreateAndCommitMultipleUsers(repository, unitOfWork);
var query = Query<IUser>.Builder.Where(x => x.Username == "TestUser1" || x.Username == "TestUser2");
try
{
DatabaseContext.Database.EnableSqlTrace = true;
DatabaseContext.Database.EnableSqlCount();
// Act
var result = repository.GetPagedResultsByQuery(query, 0, 10, out var totalRecs, user => user.Id, Direction.Ascending,
excludeUserGroups: new[] { Constants.Security.TranslatorGroupAlias },
filter: Query<IUser>.Builder.Where(x => x.Id > -1));
// Assert
Assert.AreEqual(2, totalRecs);
}
finally
{
DatabaseContext.Database.EnableSqlTrace = false;
DatabaseContext.Database.DisableSqlCount();
}
}
}
[Test]
public void Can_Get_Paged_Results_With_Filter_And_Groups()
{
// Arrange
var provider = new PetaPocoUnitOfWorkProvider(Logger);
var unitOfWork = provider.GetUnitOfWork();
using (var repository = CreateRepository(unitOfWork))
{
var users = CreateAndCommitMultipleUsers(repository, unitOfWork);
try
{
DatabaseContext.Database.EnableSqlTrace = true;
DatabaseContext.Database.EnableSqlCount();
// Act
var result = repository.GetPagedResultsByQuery(null, 0, 10, out var totalRecs, user => user.Id, Direction.Ascending,
includeUserGroups: new[] { Constants.Security.AdminGroupAlias, Constants.Security.SensitiveDataGroupAlias },
excludeUserGroups: new[] { Constants.Security.TranslatorGroupAlias },
filter: Query<IUser>.Builder.Where(x => x.Id == 0));
// Assert
Assert.AreEqual(1, totalRecs);
}
finally
{
DatabaseContext.Database.EnableSqlTrace = false;
DatabaseContext.Database.DisableSqlCount();
}
Assert.That(result, Is.GreaterThanOrEqualTo(2));
}
}
@@ -504,4 +439,4 @@ namespace Umbraco.Tests.Persistence.Repositories
return new IUser[] { user1, user2, user3 };
}
}
}
}
@@ -288,29 +288,6 @@ namespace Umbraco.Tests.Services
Assert.AreEqual(2, membersInRole.Count());
}
[Test]
public void Associate_Members_To_Roles_With_Member_Id_Casing()
{
ServiceContext.MemberService.AddRole("MyTestRole1");
IMemberType memberType = MockedContentTypes.CreateSimpleMemberType();
ServiceContext.MemberTypeService.Save(memberType);
var member1 = MockedMember.CreateSimpleMember(memberType, "test1", "test1@test.com", "pass", "test1");
ServiceContext.MemberService.Save(member1);
var member2 = MockedMember.CreateSimpleMember(memberType, "test2", "test2@test.com", "pass", "test2");
ServiceContext.MemberService.Save(member2);
// temp make sure they exist
Assert.IsNotNull(ServiceContext.MemberService.GetById(member1.Id));
Assert.IsNotNull(ServiceContext.MemberService.GetById(member2.Id));
ServiceContext.MemberService.AssignRoles(new[] { member1.Id, member2.Id }, new[] { "mytestrole1" });
var membersInRole = ServiceContext.MemberService.GetMembersInRole("MyTestRole1");
Assert.AreEqual(2, membersInRole.Count());
}
[Test]
public void Associate_Members_To_Roles_With_Member_Username()
{
@@ -1202,4 +1179,4 @@ namespace Umbraco.Tests.Services
}
}
}
}
@@ -150,8 +150,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
sourceUrl: currentMenuNode.childNodesUrl,
updateDefinition: function() {
throw "'updateDefinition' method is not supported in Umbraco 7, consider upgrading to the new v7 APIs";
},
expanded: currentMenuNode.expanded === true
}
};
//defined getters that will throw a not implemented/supported exception
Object.defineProperty(legacyNode, "menu", {
+15
View File
@@ -1,4 +1,19 @@
{
"author": "Umbraco HQ",
"name": "umbraco",
"homepage": "https://github.com/umbraco/umbraco-cms/",
"version": "7.1.2",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/umbraco/Umbraco-CMS.git"
},
"bugs": {
"url": "https://issues.umbraco.org"
},
"engines": {
"node": ">= 0.8.4"
},
"scripts": {
"install": "bower-installer",
"test": "karma start test/config/karma.conf.js --singlerun",
@@ -1,17 +1,4 @@
/**
@ngdoc directive
@name umbraco.directives.directive:umbTourStep
@restrict E
@scope
@description
<b>Added in Umbraco 7.8</b>. The tour step component is a component that can be used in custom views for tour steps.
@param {callback} onClose The callback which should be performened when the close button of the tour step is clicked
@param {boolean=} hideClose A boolean indicating if the close button needs to be shown
**/
(function () {
(function() {
'use strict';
function TourStepDirective() {
@@ -1,17 +1,4 @@
/**
@ngdoc directive
@name umbraco.directives.directive:umbTourStepContent
@restrict E
@scope
@description
<b>Added in Umbraco 7.8</b>. The tour step content component is a component that can be used in custom views for tour steps.
It's meant to be used in the umb-tour-step directive.
All markup in the body of the directive will be shown after the content attribute
@param {string} content The content that needs to be shown
**/
(function () {
(function() {
'use strict';
function TourStepContentDirective() {
@@ -1,18 +1,4 @@
/**
@ngdoc directive
@name umbraco.directives.directive:umbTourStepCounter
@restrict E
@scope
@description
<b>Added in Umbraco 7.8</b>. The tour step counter component is a component that can be used in custom views for tour steps.
It's meant to be used in the umb-tour-step-footer directive. It will show the progress you have made in a tour eg. step 2/12
@param {int} currentStep The current step the tour is on
@param {int} totalSteps The current step the tour is on
**/
(function () {
(function() {
'use strict';
function TourStepCounterDirective() {
@@ -1,16 +1,4 @@
/**
@ngdoc directive
@name umbraco.directives.directive:umbTourStepFooter
@restrict E
@scope
@description
<b>Added in Umbraco 7.8</b>. The tour step footer component is a component that can be used in custom views for tour steps. It's meant to be used in the umb-tour-step directive.
All markup in the body of the directive will be shown as the footer of the tour step
**/
(function () {
(function() {
'use strict';
function TourStepFooterDirective() {
@@ -1,16 +1,4 @@
/**
@ngdoc directive
@name umbraco.directives.directive:umbTourStepHeader
@restrict E
@scope
@description
<b>Added in Umbraco 7.8</b>. The tour step header component is a component that can be used in custom views for tour steps. It's meant to be used in the umb-tour-step directive.
@param {string} title The title that needs to be shown
**/
(function () {
(function() {
'use strict';
function TourStepHeaderDirective() {
@@ -1,7 +1,7 @@
(function () {
'use strict';
function ContentNodeInfoDirective($timeout, $location, logResource, eventsService, userService, localizationService, dateHelper, redirectUrlsResource) {
function ContentNodeInfoDirective($timeout, $location, logResource, eventsService, userService, localizationService, dateHelper) {
function link(scope, element, attrs, ctrl) {
@@ -46,9 +46,6 @@
// Make sure to set the node status
setNodePublishStatus(scope.node);
//default setting for redirect url management
scope.urlTrackerDisabled = false;
// Declare a fallback URL for the <umb-node-preview/> directive
if (scope.documentType !== null) {
scope.previewOpenUrl = '#/settings/documenttypes/edit/' + scope.documentType.id;
@@ -102,7 +99,7 @@
// get current backoffice user and format dates
userService.getCurrentUser().then(function (currentUser) {
angular.forEach(data.items, function (item) {
angular.forEach(data.items, function(item) {
item.timestampFormatted = dateHelper.getLocalDate(item.timestamp, currentUser.locale, 'LLL');
});
});
@@ -119,25 +116,6 @@
});
}
function loadRedirectUrls() {
scope.loadingRedirectUrls = true;
//check if Redirect Url Management is enabled
redirectUrlsResource.getEnableState().then(function (response) {
scope.urlTrackerDisabled = response.enabled !== true;
if (scope.urlTrackerDisabled === false) {
redirectUrlsResource.getRedirectsForContentItem(scope.node.udi)
.then(function (data) {
scope.redirectUrls = data.searchResults;
scope.hasRedirects = (typeof data.searchResults !== 'undefined' && data.searchResults.length > 0);
scope.loadingRedirectUrls = false;
});
}
else {
scope.loadingRedirectUrls = false;
}
});
}
function setAuditTrailLogTypeColor(auditTrail) {
angular.forEach(auditTrail, function (item) {
@@ -158,27 +136,27 @@
function setNodePublishStatus(node) {
// deleted node
if (node.trashed === true) {
if(node.trashed === true) {
scope.publishStatus.label = localizationService.localize("general_deleted");
scope.publishStatus.color = "danger";
}
// unpublished node
if (node.published === false && node.trashed === false) {
if(node.published === false && node.trashed === false) {
scope.publishStatus.label = localizationService.localize("content_unpublished");
scope.publishStatus.color = "gray";
}
// published node
if (node.hasPublishedVersion === true && node.publishDate && node.published === true) {
if(node.hasPublishedVersion === true && node.publishDate && node.published === true) {
scope.publishStatus.label = localizationService.localize("content_published");
scope.publishStatus.color = "success";
}
// published node with pending changes
if (node.hasPublishedVersion === true && node.publishDate && node.published === false) {
if(node.hasPublishedVersion === true && node.publishDate && node.published === false) {
scope.publishStatus.label = localizationService.localize("content_publishedPendingChanges");
scope.publishStatus.color = "success";
scope.publishStatus.color = "success"
}
}
@@ -274,13 +252,12 @@
});
}
// load audit trail and redirects when on the info tab
// load audit trail when on the info tab
evts.push(eventsService.on("app.tabChange", function (event, args) {
$timeout(function () {
$timeout(function(){
if (args.id === -1) {
isInfoTab = true;
loadAuditTrail();
loadRedirectUrls();
} else {
isInfoTab = false;
}
@@ -288,14 +265,13 @@
}));
// watch for content updates - reload content when node is saved, published etc.
scope.$watch('node.updateDate', function (newValue, oldValue) {
scope.$watch('node.updateDate', function(newValue, oldValue){
if (!newValue) { return; }
if (newValue === oldValue) { return; }
if(!newValue) { return; }
if(newValue === oldValue) { return; }
if(isInfoTab) {
loadAuditTrail();
loadRedirectUrls();
formatDatesToLocal();
setNodePublishStatus(scope.node);
}
@@ -11,36 +11,32 @@ function hexBgColor() {
restrict: "A",
link: function (scope, element, attr, formCtrl) {
// Only add inline hex background color if defined and not "true".
if (attr.hexBgInline === undefined || (attr.hexBgInline !== undefined && attr.hexBgInline === "true")) {
var origColor = null;
if (attr.hexBgOrig) {
// Set the orig based on the attribute if there is one.
origColor = attr.hexBgOrig;
}
attr.$observe("hexBgColor", function (newVal) {
if (newVal) {
if (!origColor) {
// Get the orig color before changing it.
origColor = element.css("border-color");
}
// Validate it - test with and without the leading hash.
if (/^([0-9a-f]{3}|[0-9a-f]{6})$/i.test(newVal)) {
element.css("background-color", "#" + newVal);
return;
}
if (/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(newVal)) {
element.css("background-color", newVal);
return;
}
}
element.css("background-color", origColor);
});
var origColor = null;
if (attr.hexBgOrig) {
//set the orig based on the attribute if there is one
origColor = attr.hexBgOrig;
}
attr.$observe("hexBgColor", function (newVal) {
if (newVal) {
if (!origColor) {
//get the orig color before changing it
origColor = element.css("border-color");
}
//validate it - test with and without the leading hash.
if (/^([0-9a-f]{3}|[0-9a-f]{6})$/i.test(newVal)) {
element.css("background-color", "#" + newVal);
return;
}
if (/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(newVal)) {
element.css("background-color", newVal);
return;
}
}
element.css("background-color", origColor);
});
}
};
}
angular.module('umbraco.directives').directive("hexBgColor", hexBgColor);
angular.module('umbraco.directives').directive("hexBgColor", hexBgColor);
@@ -14,7 +14,7 @@ angular.module("umbraco.directives")
scope: {
src: '=',
center: "=",
onImageLoaded: "&"
onImageLoaded: "="
},
link: function(scope, element, attrs) {
@@ -31,10 +31,10 @@ angular.module("umbraco.directives")
//elements
var $viewport = element.find(".viewport");
var $image = element.find("img");
var $overlay = element.find(".overlay");
var $overlay = element.find(".overlay");
scope.style = function () {
if (scope.dimensions.width <= 0) {
scope.style = function () {
if(scope.dimensions.width <= 0){
setDimensions();
}
@@ -45,28 +45,28 @@ angular.module("umbraco.directives")
};
scope.setFocalPoint = function(event) {
scope.$emit("imageFocalPointStart");
var offsetX = event.offsetX - 10;
var offsetY = event.offsetY - 10;
scope.$emit("imageFocalPointStart");
calculateGravity(offsetX, offsetY);
var offsetX = event.offsetX - 10;
var offsetY = event.offsetY - 10;
calculateGravity(offsetX, offsetY);
lazyEndEvent();
lazyEndEvent();
};
var setDimensions = function () {
if (scope.isCroppable) {
scope.dimensions.width = $image.width();
scope.dimensions.height = $image.height();
if(scope.center){
scope.dimensions.left = scope.center.left * scope.dimensions.width -10;
scope.dimensions.top = scope.center.top * scope.dimensions.height -10;
}else{
scope.center = { left: 0.5, top: 0.5 };
}
}
var setDimensions = function(){
scope.dimensions.width = $image.width();
scope.dimensions.height = $image.height();
if(scope.center){
scope.dimensions.left = scope.center.left * scope.dimensions.width -10;
scope.dimensions.top = scope.center.top * scope.dimensions.height -10;
}else{
scope.center = { left: 0.5, top: 0.5 };
}
};
var calculateGravity = function(offsetX, offsetY){
@@ -107,32 +107,10 @@ angular.module("umbraco.directives")
//// INIT /////
$image.load(function() {
$timeout(function() {
scope.isCroppable = true;
scope.hasDimensions = true;
if (scope.src !== "undefined") {
if (scope.src.endsWith(".svg")) {
scope.isCroppable = false;
scope.hasDimensions = false;
} else {
// From: https://stackoverflow.com/a/51789597/5018
var type = scope.src.substring(scope.src.indexOf("/") + 1, scope.src.indexOf(";base64"));
if (type.startsWith("svg")) {
scope.isCroppable = false;
scope.hasDimensions = false;
}
}
}
setDimensions();
scope.loaded = true;
if (angular.isFunction(scope.onImageLoaded)) {
scope.onImageLoaded(
{
"isCroppable": scope.isCroppable,
"hasDimensions": scope.hasDimensions
}
);
scope.onImageLoaded();
}
});
});
@@ -18,7 +18,7 @@
</example>
*/
angular.module("umbraco.directives")
.directive('umbTreeItem', function ($compile, $http, $templateCache, $interpolate, $log, $location, $rootScope, $window, treeService, $timeout, localizationService, appState) {
.directive('umbTreeItem', function ($compile, $http, $templateCache, $interpolate, $log, $location, $rootScope, $window, treeService, $timeout, localizationService) {
return {
restrict: 'E',
replace: true,
@@ -132,15 +132,7 @@ angular.module("umbraco.directives")
}
if (node.selected) {
css.push("umb-tree-node-checked");
}
//is this the current action node (this is not the same as the current selected node!)
var actionNode = appState.getMenuState("currentNode");
if(actionNode) {
if(actionNode.id === node.id) {
css.push("active");
}
}
}
return css.join(" ");
};
@@ -1,4 +1,5 @@
/**
/**
@ngdoc directive
@name umbraco.directives.directive:umbColorSwatches
@restrict E
@@ -14,10 +15,9 @@ Use this directive to generate color swatches to pick from.
</umb-color-swatches>
</pre>
@param {array} colors (<code>attribute</code>): The array of colors.
@param {string} colors (<code>attribute</code>): The array of colors.
@param {string} selectedColor (<code>attribute</code>): The selected color.
@param {string} size (<code>attribute</code>): The size (s, m).
@param {string} useLabel (<code>attribute</code>): Specify if labels should be used.
@param {string} useColorClass (<code>attribute</code>): Specify if color values are css classes.
@param {function} onSelect (<code>expression</code>): Callback function when the item is selected.
**/
@@ -28,11 +28,6 @@ Use this directive to generate color swatches to pick from.
function link(scope, el, attr, ctrl) {
// Set default to true if not defined
if (angular.isUndefined(scope.useColorClass)) {
scope.useColorClass = false;
}
scope.setColor = function (color) {
//scope.selectedColor({color: color });
scope.selectedColor = color;
@@ -52,9 +47,7 @@ Use this directive to generate color swatches to pick from.
colors: '=?',
size: '@',
selectedColor: '=',
onSelect: '&',
useLabel: '=',
useColorClass: '=?'
onSelect: '&'
},
link: link
};
@@ -125,20 +125,6 @@ Use this directive to generate a thumbnail grid of media items.
i--;
}
// If subfolder search is not enabled remove the media items that's not needed
// Make sure that includeSubFolder is not undefined since the directive is used
// in contexts where it should not be used. Currently only used when we trigger
// a media picker
if(scope.includeSubFolders !== undefined){
if (scope.includeSubFolders !== 'true') {
if (item.parentId !== parseInt(scope.currentFolderId)) {
scope.items.splice(i, 1);
i--;
}
}
}
}
if (scope.items.length > 0) {
@@ -158,7 +144,7 @@ Use this directive to generate a thumbnail grid of media items.
}
if (!item.isFolder) {
// handle entity
if(item.image) {
item.thumbnail = mediaHelper.resolveFileFromEntity(item, true);
@@ -167,7 +153,7 @@ Use this directive to generate a thumbnail grid of media items.
} else {
item.thumbnail = mediaHelper.resolveFile(item, true);
item.image = mediaHelper.resolveFile(item, false);
var fileProp = _.find(item.properties, function (v) {
return (v.alias === "umbracoFile");
});
@@ -321,9 +307,7 @@ Use this directive to generate a thumbnail grid of media items.
itemMaxHeight: "@",
itemMinWidth: "@",
itemMinHeight: "@",
onlyImages: "@",
includeSubFolders: "@",
currentFolderId: "@"
onlyImages: "@"
},
link: link
};
@@ -7,60 +7,10 @@
**/
function logResource($q, $http, umbRequestHelper) {
function isValidDate(input) {
if (input) {
if (Object.prototype.toString.call(input) === "[object Date]" && !isNaN(input.getTime())) {
return true;
}
}
return false;
};
function dateToValidIsoString(input) {
if (isValidDate(input)) {
return input.toISOString();
}
return '';
};
//the factory object returned
return {
/**
* @ngdoc method
* @name umbraco.resources.logResource#getPagedEntityLog
* @methodOf umbraco.resources.logResource
*
* @description
* Gets a paginated log history for a entity
*
* ##usage
* <pre>
* var options = {
* id : 1234
* pageSize : 10,
* pageNumber : 1,
* orderDirection : "Descending",
* sinceDate : new Date(2018,0,1)
* };
* logResource.getPagedEntityLog(options)
* .then(function(log) {
* alert('its here!');
* });
* </pre>
*
* @param {Object} options options object
* @param {Int} options.id the id of the entity
* @param {Int} options.pageSize if paging data, number of nodes per page, default = 10, set to 0 to disable paging
* @param {Int} options.pageNumber if paging data, current page index, default = 1
* @param {String} options.orderDirection can be `Ascending` or `Descending` - Default: `Descending`
* @param {Date} options.sinceDate if provided this will only get log entries going back to this date
* @returns {Promise} resourcePromise object containing the log.
*
*/
getPagedEntityLog: function(options) {
getPagedEntityLog: function (options) {
var defaults = {
pageSize: 10,
@@ -74,21 +24,17 @@ function logResource($q, $http, umbRequestHelper) {
angular.extend(defaults, options);
//now copy back to the options we will use
options = defaults;
if (options.hasOwnProperty('sinceDate')) {
options.sinceDate = dateToValidIsoString(options.sinceDate);
}
//change asc/desct
if (options.orderDirection === "asc") {
options.orderDirection = "Ascending";
} else if (options.orderDirection === "desc") {
}
else if (options.orderDirection === "desc") {
options.orderDirection = "Descending";
}
if (options.id === undefined || options.id === null) {
throw "options.id is required";
}
}
return umbRequestHelper.resourcePromise(
$http.get(
@@ -99,37 +45,7 @@ function logResource($q, $http, umbRequestHelper) {
'Failed to retrieve log data for id');
},
/**
* @ngdoc method
* @name umbraco.resources.logResource#getPagedUserLog
* @methodOf umbraco.resources.logResource
*
* @description
* Gets a paginated log history for the current user
*
* ##usage
* <pre>
* var options = {
* pageSize : 10,
* pageNumber : 1,
* orderDirection : "Descending",
* sinceDate : new Date(2018,0,1)
* };
* logResource.getPagedUserLog(options)
* .then(function(log) {
* alert('its here!');
* });
* </pre>
*
* @param {Object} options options object
* @param {Int} options.pageSize if paging data, number of nodes per page, default = 10, set to 0 to disable paging
* @param {Int} options.pageNumber if paging data, current page index, default = 1
* @param {String} options.orderDirection can be `Ascending` or `Descending` - Default: `Descending`
* @param {Date} options.sinceDate if provided this will only get log entries going back to this date
* @returns {Promise} resourcePromise object containing the log.
*
*/
getPagedUserLog: function(options) {
getPagedUserLog: function (options) {
var defaults = {
pageSize: 10,
@@ -143,15 +59,11 @@ function logResource($q, $http, umbRequestHelper) {
angular.extend(defaults, options);
//now copy back to the options we will use
options = defaults;
if (options.hasOwnProperty('sinceDate')) {
options.sinceDate = dateToValidIsoString(options.sinceDate);
}
//change asc/desct
if (options.orderDirection === "asc") {
options.orderDirection = "Ascending";
} else if (options.orderDirection === "desc") {
}
else if (options.orderDirection === "desc") {
options.orderDirection = "Descending";
}
@@ -159,10 +71,10 @@ function logResource($q, $http, umbRequestHelper) {
$http.get(
umbRequestHelper.getApiUrl(
"logApiBaseUrl",
"GetPagedCurrentUserLog",
"GetPagedEntityLog",
options)),
'Failed to retrieve log data for id');
},
},
/**
* @ngdoc method
@@ -170,7 +82,6 @@ function logResource($q, $http, umbRequestHelper) {
* @methodOf umbraco.resources.logResource
*
* @description
* <strong>[OBSOLETE] use getPagedEntityLog instead</strong><br />
* Gets the log history for a give entity id
*
* ##usage
@@ -185,24 +96,23 @@ function logResource($q, $http, umbRequestHelper) {
* @returns {Promise} resourcePromise object containing the log.
*
*/
getEntityLog: function(id) {
getEntityLog: function (id) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"logApiBaseUrl",
"GetEntityLog",
[{ id: id }])),
'Failed to retrieve user data for id ' + id);
$http.get(
umbRequestHelper.getApiUrl(
"logApiBaseUrl",
"GetEntityLog",
[{ id: id }])),
'Failed to retrieve user data for id ' + id);
},
/**
* @ngdoc method
* @name umbraco.resources.logResource#getUserLog
* @methodOf umbraco.resources.logResource
*
* @description
* <strong>[OBSOLETE] use getPagedUserLog instead</strong><br />
* Gets the current user's log history for a given type of log entry
* Gets the current users' log history for a given type of log entry
*
* ##usage
* <pre>
@@ -217,14 +127,14 @@ function logResource($q, $http, umbRequestHelper) {
* @returns {Promise} resourcePromise object containing the log.
*
*/
getUserLog: function(type, since) {
getUserLog: function (type, since) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"logApiBaseUrl",
"GetCurrentUserLog",
[{ logtype: type }, { sinceDate: dateToValidIsoString(since) }])),
'Failed to retrieve log data for current user of type ' + type + ' since ' + since);
$http.get(
umbRequestHelper.getApiUrl(
"logApiBaseUrl",
"GetCurrentUserLog",
[{ logtype: type}, {sinceDate: since }])),
'Failed to retrieve log data for current user of type ' + type + ' since ' + since);
},
/**
@@ -248,16 +158,16 @@ function logResource($q, $http, umbRequestHelper) {
* @returns {Promise} resourcePromise object containing the log.
*
*/
getLog: function(type, since) {
getLog: function (type, since) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"logApiBaseUrl",
"GetLog",
[{ logtype: type }, { sinceDate: dateToValidIsoString(since) }])),
'Failed to retrieve log data of type ' + type + ' since ' + since);
}
};
$http.get(
umbRequestHelper.getApiUrl(
"logApiBaseUrl",
"GetLog",
[{ logtype: type}, {sinceDate: since }])),
'Failed to retrieve log data of type ' + type + ' since ' + since);
}
};
}
angular.module('umbraco.resources').factory('logResource', logResource);
@@ -46,7 +46,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function() {
* $scope.complete = true;
* });
* </pre>
* </pre>
* @param {Object} args arguments object
* @param {Int} args.parentId the ID of the parent node
* @param {Array} options.sortedIds array of node IDs as they should be sorted
@@ -87,9 +87,9 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function() {
* alert("node was moved");
* }, function(err){
* alert("node didnt move:" + err.data.Message);
* alert("node didnt move:" + err.data.Message);
* });
* </pre>
* </pre>
* @param {Object} args arguments object
* @param {Int} args.idd the ID of the node to move
* @param {Int} args.parentId the ID of the parent node to move to
@@ -109,23 +109,11 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("mediaApiBaseUrl", "PostMove"),
{
parentId: args.parentId,
id: args.id
}),
{
error: function(data){
var errorMsg = 'Failed to move media';
if(data.parentId === data.id){
errorMsg = 'Media can\'t be moved into itself';
}
return {
errorMsg: errorMsg
};
}
});
{
parentId: args.parentId,
id: args.id
}),
'Failed to move media');
},
@@ -141,12 +129,12 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* <pre>
* mediaResource.getById(1234)
* .then(function(media) {
* var myMedia = media;
* var myMedia = media;
* alert('its here!');
* });
* </pre>
*
* @param {Int} id id of media item to return
* </pre>
*
* @param {Int} id id of media item to return
* @returns {Promise} resourcePromise object containing the media item.
*
*/
@@ -175,9 +163,9 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function() {
* alert('its gone!');
* });
* </pre>
*
* @param {Int} id id of media item to delete
* </pre>
*
* @param {Int} id id of media item to delete
* @returns {Promise} resourcePromise object.
*
*/
@@ -203,12 +191,12 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* <pre>
* mediaResource.getByIds( [1234,2526,28262])
* .then(function(mediaArray) {
* var myDoc = contentArray;
* var myDoc = contentArray;
* alert('they are here!');
* });
* </pre>
*
* @param {Array} ids ids of media items to return as an array
* </pre>
*
* @param {Array} ids ids of media items to return as an array
* @returns {Promise} resourcePromise object containing the media items array.
*
*/
@@ -235,28 +223,28 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
*
* @description
* Returns a scaffold of an empty media item, given the id of the media item to place it underneath and the media type alias.
*
*
* - Parent Id must be provided so umbraco knows where to store the media
* - Media Type alias must be provided so umbraco knows which properties to put on the media scaffold
*
* - Media Type alias must be provided so umbraco knows which properties to put on the media scaffold
*
* The scaffold is used to build editors for media that has not yet been populated with data.
*
*
* ##usage
* <pre>
* mediaResource.getScaffold(1234, 'folder')
* .then(function(scaffold) {
* var myDoc = scaffold;
* myDoc.name = "My new media item";
* myDoc.name = "My new media item";
*
* mediaResource.save(myDoc, true)
* .then(function(media){
* alert("Retrieved, updated and saved again");
* });
* });
* </pre>
*
* </pre>
*
* @param {Int} parentId id of media item to return
* @param {String} alias mediatype alias to base the scaffold on
* @param {String} alias mediatype alias to base the scaffold on
* @returns {Promise} resourcePromise object containing the media scaffold.
*
*/
@@ -295,11 +283,11 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* <pre>
* mediaResource.getChildren(1234, {pageSize: 10, pageNumber: 2})
* .then(function(contentArray) {
* var children = contentArray;
* var children = contentArray;
* alert('they are here!');
* });
* </pre>
*
* </pre>
*
* @param {Int} parentid id of content item to return children of
* @param {Object} options optional options object
* @param {Int} options.pageSize if paging data, number of nodes per page, default = 0
@@ -373,9 +361,9 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
*
* @description
* Saves changes made to a media item, if the media item is new, the isNew paramater must be passed to force creation
* if the media item needs to have files attached, they must be provided as the files param and passed separately
*
*
* if the media item needs to have files attached, they must be provided as the files param and passed separately
*
*
* ##usage
* <pre>
* mediaResource.getById(1234)
@@ -386,11 +374,11 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* alert("Retrieved, updated and saved again");
* });
* });
* </pre>
*
* </pre>
*
* @param {Object} media The media item object with changes applied
* @param {Bool} isNew set to true to create a new item or to update an existing
* @param {Array} files collection of files for the media item
* @param {Bool} isNew set to true to create a new item or to update an existing
* @param {Array} files collection of files for the media item
* @returns {Promise} resourcePromise object containing the saved media item.
*
*/
@@ -412,10 +400,10 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function(folder) {
* alert('New folder');
* });
* </pre>
* </pre>
*
* @param {string} name Name of the folder to create
* @param {int} parentId Id of the media item to create the folder underneath
* @param {int} parentId Id of the media item to create the folder underneath
* @returns {Promise} resourcePromise object.
*
*/
@@ -439,18 +427,18 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* Retrieves all media children with types used as folders.
* Uses the convention of looking for media items with mediaTypes ending in
* *Folder so will match "Folder", "bannerFolder", "secureFolder" etc,
*
*
* NOTE: This will return a max of 500 folders, if more is required it needs to be paged
*
*
* ##usage
* <pre>
* mediaResource.getChildFolders(1234)
* .then(function(data) {
* alert('folders');
* });
* </pre>
* </pre>
*
* @param {int} parentId Id of the media item to query for child folders
* @param {int} parentId Id of the media item to query for child folders
* @returns {Promise} resourcePromise object.
*
*/
@@ -485,8 +473,8 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function() {
* alert('its empty!');
* });
* </pre>
*
* </pre>
*
* @returns {Promise} resourcePromise object.
*
*/
@@ -513,8 +501,8 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
* .then(function(searchResult) {
* alert('it's here!');
* });
* </pre>
*
* </pre>
*
* @param {string} query The search query
* @param {int} pageNumber The page number
* @param {int} pageSize The number of media items on a page
@@ -525,7 +513,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
search: function (query, pageNumber, pageSize, searchFrom) {
var args = [
{ "query": query },
{ "query": query },
{ "pageNumber": pageNumber },
{ "pageSize": pageSize },
{ "searchFrom": searchFrom }
@@ -40,32 +40,6 @@
{ searchTerm: searchTerm, page: pageIndex, pageSize: pageSize })),
'Failed to retrieve data for searching redirect urls');
}
/**
* @ngdoc function
* @name umbraco.resources.redirectUrlResource#getRedirectsForContentItem
* @methodOf umbraco.resources.redirectUrlResource
* @function
*
* @description
* Used to retrieve RedirectUrls for a specific item of content for Information tab
* ##usage
* <pre>
* redirectUrlsResource.getRedirectsForContentItem("udi:123456")
* .then(function(response) {
*
* });
* </pre>
* @param {String} contentUdi identifier for the content item to retrieve redirects for
*/
function getRedirectsForContentItem(contentUdi) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"redirectUrlManagementApiBaseUrl",
"RedirectUrlsForContentItem",
{ contentUdi: contentUdi })),
'Failed to retrieve redirects for content: ' + contentUdi);
}
function getEnableState() {
@@ -76,7 +50,7 @@
"GetEnableState")),
'Failed to retrieve data to check if the 301 redirect is enabled');
}
/**
* @ngdoc function
* @name umbraco.resources.redirectUrlResource#deleteRedirectUrl
@@ -133,8 +107,7 @@
searchRedirectUrls: searchRedirectUrls,
deleteRedirectUrl: deleteRedirectUrl,
toggleUrlTracker: toggleUrlTracker,
getEnableState: getEnableState,
getRedirectsForContentItem: getRedirectsForContentItem
getEnableState: getEnableState
};
return resource;
@@ -73,7 +73,6 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
appState.setSectionState("showSearchResults", false);
appState.setGlobalState("stickyNavigation", false);
appState.setGlobalState("showTray", false);
appState.setMenuState("currentNode", null);
if (appState.getGlobalState("isTablet") === true) {
appState.setGlobalState("showNavigation", false);
@@ -348,8 +347,7 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
if (appState.getGlobalState("isTablet") === true && !appState.getGlobalState("stickyNavigation")) {
//reset it to whatever is in the url
appState.setSectionState("currentSection", $routeParams.section);
appState.setSectionState("currentSection", $routeParams.section);
setMode("default-hidesectiontree");
}
@@ -661,10 +659,10 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
*/
hideDialog: function (showMenu) {
if (showMenu) {
setMode("default");
if(showMenu){
this.showMenu(undefined, { skipDefault: true, node: appState.getMenuState("currentNode") });
} else {
setMode("default");
}
},
/**
@@ -143,6 +143,7 @@ angular.module('umbraco.services')
/** Called to update the current user's timeout */
function setUserTimeoutInternal(newTimeout) {
var asNumber = parseFloat(newTimeout);
if (!isNaN(asNumber) && currentUser && angular.isNumber(asNumber)) {
currentUser.remainingAuthSeconds = newTimeout;
@@ -150,29 +151,6 @@ angular.module('umbraco.services')
}
}
function getMomentLocales(locales, supportedLocales) {
var localeUrls = [];
var locales = locales.split(',');
for (var i = 0; i < locales.length; i++) {
var locale = locales[i].toString().toLowerCase();
if (locale !== 'en-us') {
if (supportedLocales.indexOf(locale + '.js') > -1) {
localeUrls.push('lib/moment/' + locale + '.js');
}
if (locale.indexOf('-') > -1) {
var majorLocale = locale.split('-')[0] + '.js';
if (supportedLocales.indexOf(majorLocale) > -1) {
localeUrls.push('lib/moment/' + majorLocale);
}
}
}
}
return localeUrls;
}
/** resets all user data, broadcasts the notAuthenticated event and shows the login dialog */
function userAuthExpired(isLogout) {
//store the last user id and clear the user
@@ -200,7 +178,7 @@ angular.module('umbraco.services')
}
});
var services = {
return {
/** Internal method to display the login dialog */
_showLoginDialog: function () {
@@ -301,32 +279,41 @@ angular.module('umbraco.services')
/** Loads the Moment.js Locale for the current user. */
loadMomentLocaleForCurrentUser: function () {
function loadLocales(currentUser, supportedLocales) {
var locale = currentUser.locale.toLowerCase();
if (locale !== 'en-us') {
var localeUrls = [];
if (supportedLocales.indexOf(locale + '.js') > -1) {
localeUrls.push('lib/moment/' + locale + '.js');
}
if (locale.indexOf('-') > -1) {
var majorLocale = locale.split('-')[0] + '.js';
if (supportedLocales.indexOf(majorLocale) > -1) {
localeUrls.push('lib/moment/' + majorLocale);
}
}
return assetsService.load(localeUrls, $rootScope);
}
else {
//return a noop promise
var deferred = $q.defer();
var promise = deferred.promise;
deferred.resolve(true);
return promise;
}
}
var promises = {
currentUser: this.getCurrentUser(),
supportedLocales: javascriptLibraryService.getSupportedLocalesForMoment()
}
return $q.all(promises).then(function (values) {
return services.loadLocales(values.currentUser.locale, values.supportedLocales);
return loadLocales(values.currentUser, values.supportedLocales);
});
},
/** Loads specific Moment.js Locales. */
loadLocales: function (locales, supportedLocales) {
var localeUrls = getMomentLocales(locales, supportedLocales);
if (localeUrls.length >= 1) {
return assetsService.load(localeUrls, $rootScope);
}
else {
//return a noop promise
var deferred = $q.defer();
var promise = deferred.promise;
deferred.resolve(true);
return promise;
}
},
/** Called whenever a server request is made that contains a x-umb-user-seconds response header for which we can update the user's remaining timeout seconds */
@@ -335,5 +322,4 @@ angular.module('umbraco.services')
}
};
return services;
});
@@ -146,7 +146,6 @@
@import "components/umb-mini-editor.less";
@import "components/users/umb-user-cards.less";
@import "components/users/umb-user-details.less";
@import "components/users/umb-user-group-picker-list.less";
@import "components/users/umb-user-group-preview.less";
@import "components/users/umb-user-preview.less";
@@ -63,6 +63,9 @@
.btn-group>.btn+.dropdown-toggle {
box-shadow: none;
-webkit-box-shadow:none;
}
.btn-group .btn.dropdown-toggle {
border-left-width: 1px;
border-left-style: solid;
}
@@ -81,9 +81,9 @@ a, a:hover{
.wait {
display: block;
height: 100%;
height: 280px;
width: 100%;
background:#fff center center url(../img/loader.gif) no-repeat;
background: center center url(../img/loader.gif) no-repeat;
}
/****************************/
@@ -790,13 +790,13 @@ h4.panel-title {
}
.smartphone-portrait {
width: 360px;
height: 640px;
width: 320px;
height: 504px;
}
.smartphone-landscape {
width: 640px;
height: 360px;
width: 480px;
height: 256px;
}
.border {
@@ -156,7 +156,6 @@
margin-bottom: 1px;
border-radius: 0;
border-bottom: 1px solid @gray-9;
padding: 10px;
}
.umb-help-list-item__group-title i {
@@ -187,7 +186,6 @@
.umb-help-list-item__title {
font-size: 14px;
display: block;
margin-left: 26px;
}
.umb-help-list-item__description {
@@ -200,7 +198,6 @@
margin-right: 8px;
color: @gray-4;
font-size: 18px;
float: left;
}
.umb-help-list-item__open-icon {
@@ -215,4 +212,4 @@
[data-element*="tour-"].umb-help-list-item:hover .umb-help-list-item__title {
text-decoration:none;
}
}
@@ -10,10 +10,6 @@
}
}
.umb-toggle:focus .umb-toggle__toggle{
box-shadow: 0 1px 3px fade(@black, 12%), 0 1px 2px fade(@black, 24%);
}
.umb-toggle__handler {
position: absolute;
top: 0;
@@ -34,7 +30,6 @@
background: @gray-8;
border-radius: 90px;
position: relative;
transition: box-shadow .3s;
}
.umb-toggle--checked .umb-toggle__toggle {
@@ -48,6 +43,7 @@
/* Labels */
.umb-toggle__label {
font-size: 12px;
color: @gray-2;
}
@@ -97,6 +97,7 @@
text-align: center;
width: 100px;
height: 105px;
box-sizing: border-box;
}
@@ -114,7 +115,6 @@
width: 100%;
height: 100%;
border-radius: 3px;
padding-bottom: 5px;
}
@@ -10,7 +10,6 @@
.umb-prevalues-multivalues__left {
display: flex;
flex: 1 1 auto;
overflow: hidden;
}
.umb-prevalues-multivalues__right {
@@ -1,25 +1,21 @@
.umb-color-swatches {
display: flex;
flex-flow: row wrap;
.umb-color-box {
border: 1px solid @gray-8;
color: @white;
border: none;
color: white;
cursor: pointer;
padding: 1px;
padding: 5px;
text-align: center;
text-decoration: none;
display: inline-block;
margin: 5px;
border-radius: 3px;
width: 30px;
height: 30px;
transition: box-shadow .3s;
display: flex;
align-items: center;
justify-content: center;
&:hover, &:focus {
box-shadow: 0 1px 3px fade(@black, 12%), 0 1px 2px fade(@black, 24%);
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
&.active {
@@ -38,56 +34,4 @@
}
}
}
&.with-labels {
.umb-color-box {
width: 120px;
height: 100%;
display: flex;
flex-flow: row wrap;
.umb-color-box-inner {
display: flex;
flex-flow: column wrap;
flex: 0 0 100%;
max-width: 100%;
min-height: 80px;
padding-top: 10px;
.umb-color-box__label {
background: @white;
font-size: 14px;
display: flex;
flex-flow: column wrap;
flex: 0 0 100%;
padding: 1px 5px;
max-width: 100%;
margin-top: auto;
margin-bottom: -3px;
margin-left: -1px;
margin-right: -1px;
text-indent: 0;
text-align: left;
border-top: 1px solid @gray-8;
border-bottom: 1px solid @gray-8;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
overflow: hidden;
.umb-color-box__name {
color: @black;
font-weight: bold;
margin-top: 3px;
}
.umb-color-box__description {
font-size: 12px;
line-height: 1.5em;
color: @gray-3;
}
}
}
}
}
}
@@ -33,18 +33,6 @@
background-color: @gray-10;
}
.umb-media-grid__item-file-icon > span {
color: @white;
background: @gray-4;
padding: 1px 3px;
font-size: 10px;
line-height: 130%;
display: block;
margin-top: -30px;
margin-left: -10px;
position: relative;
}
.umb-media-grid__item.-selected {
box-shadow: 0 2px 8px 0 rgba(0,0,0,.35);
}
@@ -1,6 +1,5 @@
.umb-nested-content {
text-align: center;
position: relative;
}
.umb-nested-content--not-supported {
@@ -209,26 +208,12 @@
width: 99%;
}
.usky-grid.umb-nested-content__node-type-picker {
.cell-tools-menu {
position: relative;
transform: translate(-50%, -25%);
}
.elements li {
&:hover {
i {
color: @white !important;
}
}
i {
// make sure the item icons shown are in the correct color according to their doc type icon instead of the grid editor item color
color: unset;
}
}
.usky-grid.umb-nested-content__node-type-picker .cell-tools-menu {
position: relative;
transform: translate(-50%, -25%);
}
// this resolves the layout issue introduced in nested content in 7.12 with the addition of the input for link anchors
// the attribute selector ensures the change only applies to the linkpicker overlay
.form-horizontal .umb-nested-content--narrow [ng-controller*="Umbraco.Overlays.LinkPickerController"] .controls-row {
@@ -165,7 +165,7 @@ input.umb-table__input {
}
.-content :not(.with-unpublished-version).-unpublished {
.-content .-unpublished {
.umb-table__name > * {
opacity: .4;
}
@@ -1,15 +1,15 @@
.umb-nav-tabs {
position: absolute;
z-index: 999;
}
.umb-nav-tabs.-padding-left {
padding-left: 20px;
}
.umb-tab-content {
padding-top: 20px;
position: relative;
top: 31px;
border-top: 1px solid @purple-l3;
}
.umb-nav-tabs {
position: absolute;
z-index: 999;
}
.umb-nav-tabs.-padding-left {
padding-left: 20px;
}
.umb-tab-content {
padding-top: 20px;
position: relative;
top: 22px;
border-top: 1px solid @purple-l3;
}
@@ -1,122 +0,0 @@
.umb-user-details-avtar {
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #d8d7d9;
}
div.umb-user-details-actions > div {
margin-bottom: 20px;
}
.umb-user-details-actions .umb-button {
margin-bottom: 20px;
}
.umb-user-details-view-title {
font-size: 20px;
font-weight: bold;
color: @black;
margin-bottom: 30px;
}
.umb-user-details-view-wrapper {
padding: 20px 60px;
}
@media (max-width: 768px) {
.umb-user-details-view-wrapper {
padding: 0;
}
}
.umb-user-details-section {
margin-bottom: 40px;
}
.umb-user-details-details {
display: flex;
}
a.umb-user-details-details__back-link {
font-weight: bold;
color: @black;
}
.umb-user-details-details__back-link:hover {
color: @gray-4;
text-decoration: none;
}
@sidebarwidth: 350px; // Width of sidebar. Ugly hack because of old version of Less
.umb-user-details-details__main-content {
flex: 1 1 auto;
margin-right: 30px;
width: calc(~'100%' - ~'@{sidebarwidth}' - ~'30px'); // Make sure that the main content area doesn't gets affected by inline styling
}
.umb-user-details-details__main-content .umb-node-preview-add {
max-width: 100%;
}
.umb-user-details-details__sidebar {
flex: 0 0 @sidebarwidth;
}
@media (max-width: 768px) {
.umb-user-details-details {
flex-direction: column;
}
.umb-user-details-details__main-content {
flex: 1 1 auto;
width: 100%;
margin-bottom: 30px;
margin-right: 0;
}
.umb-user-details-details__sidebar {
flex: 1 1 auto;
width: 100%;
}
}
.umb-user-details-details__section {
background: @gray-10;
padding: 20px;
margin-bottom: 20px;
border-radius: 3px;
border: 1px solid @gray-8;
}
.umb-user-details-details__section-title {
font-size: 17px;
font-weight: bold;
color: @black;
margin-top: 0;
margin-bottom: 15px;
}
.umb-user-details-details__section-description {
font-size: 12px;
line-height: 1.6em;
margin-bottom: 15px;
}
.umb-user-details-details__information-item {
margin-bottom: 10px;
font-size: 13px;
}
.umb-user-details-details__information-item-label {
color: @black;
font-weight: bold;
}
.umb-user-details-details__information-item-content {
word-break: break-word;
}
@@ -105,63 +105,6 @@
border-top: 1px solid @purple-l3;
}
.umb-dialog .propertyItemheader {
width: 140px !Important;
}
.umb-dialog .diffDropdown
{
width:400px;
}
.umb-dialog .diffPanel {
height: 400px;
}
.umb-dialog .diff {
margin-top: 10px;
height: 100%;
overflow: auto;
border-top: 1px solid #ccc;
border-top: 1px solid #ccc;
padding: 5px;
}
.umb-dialog .diff table{
width:95%;
max-width:95%;
margin: 0 3px;
}
.umb-dialog .diff table th {
padding: 5px;
width: 25%;
border-bottom: 1px solid #ccc;
}
.umb-dialog .diff table td {
border-bottom: 1px solid #ccc;
padding: 3px;
}
.umb-dialog .diff del {
background: rgb(255, 230, 230) none repeat scroll 0%;
-moz-background-clip: -moz-initial;
-moz-background-origin: -moz-initial;
-moz-background-inline-policy: -moz-initial;
}
.umb-dialog .diff ins {
background: rgb(230, 255, 230) none repeat scroll 0%;
-moz-background-clip: -moz-initial;
-moz-background-origin: -moz-initial;
-moz-background-inline-policy: -moz-initial;
}
.umb-dialog .diff .diffnotice {
text-align: center;
margin-bottom: 10px;
}
/*we will always make sure to wrap iframe dialogs in proper padding*/
.umbracoDialog{
width: auto !Important;
+9 -2
View File
@@ -119,8 +119,13 @@
// TABS
// ----
// Give the tabs something to sit on
.nav-tabs {
border-bottom: 1px solid @purple-l3;
}
// Make the list-items overlay the bottom border
.nav-tabs > li {
margin-bottom: -1px;
&.dropdown {
margin-bottom: -3px;
@@ -132,13 +137,11 @@
}
// Actual tabs (as links)
.nav-tabs > li > a {
position: relative;
color: @gray-3;
padding-top: 5px;
padding-bottom: 4px;
line-height: @baseLineHeight;
border: 1px solid transparent;
transform: translateY(1px);
&:hover {
color: @black;
@@ -180,6 +183,10 @@
.show-validation .nav-tabs > li.active.error > a:focus {
}
.umb-nav-tabs {
margin: -8px 0 0 0;
}
// PILLS
// -----
+1 -12
View File
@@ -52,16 +52,6 @@
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
&__toggle{
margin: 10px 0;
label{
margin-right: 10px;
position: relative;
top: -2px;
}
}
}
.upload-button {
@@ -446,8 +436,7 @@
}
.umb-panel-header .umb-nav-tabs {
bottom: 0;
margin: 0;
bottom: -1px;
}
input.umb-panel-header-name-input {
@@ -115,13 +115,6 @@ div.umb-codeeditor .umb-btn-toolbar {
//
// RTE
// --------------------------------------------------
.umb-rte {
position: relative;
.-loading {
position: absolute;
}
}
.mce-tinymce{border: 1px solid @gray-8 !important; border-radius: 0px !important;}
.mce-panel{background: @gray-10 !important; border-color: @gray-8 !important;}
.mce-btn-group, .mce-btn{border: none !important; background: none !important;}
@@ -140,18 +133,42 @@ div.umb-codeeditor .umb-btn-toolbar {
//
// Color picker
// --------------------------------------------------
ul.color-picker li {
padding: 2px;
margin: 3px;
border: 2px solid transparent;
width: 60px;
&.active {
.check_circle {
opacity: 1;
}
}
.thumbnail{
min-width: auto;
width: inherit;
padding: 0;
}
a {
height: 50px;
display:flex;
align-items: center;
justify-content: center;
cursor:pointer;
margin: 0 0 5px;
}
}
/* pre-value editor */
.control-group.color-picker-preval {
.thumbnail {
width: 34px;
height: 34px;
width: 36px;
min-width: auto;
border: none;
cursor: move;
border-radius: 3px;
margin-top: auto;
margin-bottom: auto;
}
.handle {
@@ -163,19 +180,19 @@ div.umb-codeeditor .umb-btn-toolbar {
div.color-picker-prediv {
display: inline-flex;
align-items: center;
max-width: 100%;
flex: 1;
max-width: 80%;
pre {
display: inline-flex;
font-family: monospace;
margin-left: 15px;
margin-right: 15px;
margin-right: 10px;
margin-left: 10px;
white-space: nowrap;
overflow: hidden;
margin-bottom: 0;
vertical-align: middle;
padding: 6px 10px;
padding-top: 7px;
padding-bottom: 7px;
background: #f7f7f7;
flex: 0 0 auto;
}
@@ -204,11 +221,11 @@ div.umb-codeeditor .umb-btn-toolbar {
label {
border: 1px solid #fff;
padding: 6px 10px;
padding: 7px 10px;
font-family: monospace;
border: 1px solid #dfdfe1;
background: #f7f7f7;
margin: 0 15px 0 3px;
margin: 0 15px 0 0;
border-radius: 3px;
}
}
@@ -315,7 +332,7 @@ div.umb-codeeditor .umb-btn-toolbar {
.umb-mediapicker .umb-sortable-thumbnails li {
flex-direction: column;
margin: 0 0 5px 5px;
margin: 0 5px 5px 0;
padding: 5px;
}
@@ -346,30 +363,13 @@ div.umb-codeeditor .umb-btn-toolbar {
text-align: center;
}
.umb-sortable-thumbnails .umb-icon-holder .icon {
.umb-sortable-thumbnails .umb-icon-holder .icon{
font-size: 40px;
line-height: 50px;
color: @gray-3;
display: block;
}
.umb-sortable-thumbnails .umb-icon-holder .file-icon > span {
color: @white;
background: @gray-4;
padding: 1px 3px;
font-size: 10px;
line-height: 130%;
display: block;
margin-top: -30px;
width: 2em;
}
.umb-sortable-thumbnails .umb-icon-holder .file-icon + small {
display: block;
margin-top: 1em;
}
.umb-sortable-thumbnails .umb-sortable-thumbnails__wrapper {
width: 124px;
height: 124px;
@@ -574,16 +574,6 @@ div.umb-codeeditor .umb-btn-toolbar {
}
}
.imagecropper .umb-cropper__container .button-drawer {
display: flex;
justify-content: flex-end;
padding: 10px;
button {
margin-left: 4px;
}
}
.umb-close-cropper {
position: absolute;
top: 3px;
+1 -2
View File
@@ -185,8 +185,7 @@
line-height: 16px;
}
.umb-tree div:hover,
.umb-tree div.active {
.umb-tree div:hover {
background: @gray-10;
}
@@ -19,6 +19,7 @@ angular.module("umbraco")
$scope.classes.splice(0, 0, "noclass");
})
assetsService.loadCss("/App_Plugins/Lecoati.uSky.Grid/lib/uSky.Grid.ApprovedColorPicker.css", $scope);
assetsService.loadCss(cssPath, $scope);
});
});
@@ -29,7 +29,6 @@
function init() {
// Check if it is a new user
var inviteVal = $location.search().invite;
//1 = enter password, 2 = password set, 3 = invalid token
if (inviteVal && (inviteVal === "1" || inviteVal === "2")) {
$q.all([
@@ -59,8 +58,6 @@
$scope.inviteStep = Number(inviteVal);
});
} else if (inviteVal && inviteVal === "3") {
$scope.inviteStep = Number(inviteVal);
}
}
@@ -99,18 +99,10 @@
</umb-button>
</div>
</div>
</div>
<div ng-show="invitedUser == null && inviteStep === 3" ng-if="inviteStep === 3" class="umb-login-container">
<div class="form">
<h1 style="margin-bottom: 10px; text-align: left;">Hi there</h1>
<p style="line-height: 1.6; margin-bottom: 25px;">
<localize key="user_userinviteExpiredMessage">Welcome to Umbraco! Unfortunately your invite has expired. Please contact your administrator and ask them to resend it.</localize>
</p>
</div>
</div>
<div ng-show="invitedUser == null && !inviteStep" class="umb-login-container">
<div ng-show="invitedUser == null" class="umb-login-container">
<div class="form">
<h1>{{greeting}}</h1>
@@ -12,25 +12,25 @@ function IconPickerOverlay($scope, iconHelper, localizationService) {
$scope.model.hideSubmitButton = false;
$scope.colors = [
{ label: "Black", value: "color-black" },
{ label: "Blue Grey", value: "color-blue-grey" },
{ label: "Grey", value: "color-grey" },
{ label: "Brown", value: "color-brown" },
{ label: "Blue", value: "color-blue" },
{ label: "Light Blue", value: "color-light-blue" },
{ label: "Indigo", value: "color-indigo" },
{ label: "Purple", value: "color-purple" },
{ label: "Deep Purple", value: "color-deep-purple" },
{ label: "Cyan", value: "color-cyan" },
{ label: "Green", value: "color-green" },
{ label: "Light Green", value: "color-light-green" },
{ label: "Lime", value: "color-lime" },
{ label: "Yellow", value: "color-yellow" },
{ label: "Amber", value: "color-amber" },
{ label: "Orange", value: "color-orange" },
{ label: "Deep Orange", value: "color-deep-orange" },
{ label: "Red", value: "color-red" },
{ label: "Pink", value: "color-pink" }
{ name: "Black", value: "color-black" },
{ name: "Blue Grey", value: "color-blue-grey" },
{ name: "Grey", value: "color-grey" },
{ name: "Brown", value: "color-brown" },
{ name: "Blue", value: "color-blue" },
{ name: "Light Blue", value: "color-light-blue" },
{ name: "Indigo", value: "color-indigo" },
{ name: "Purple", value: "color-purple" },
{ name: "Deep Purple", value: "color-deep-purple" },
{ name: "Cyan", value: "color-cyan" },
{ name: "Green", value: "color-green" },
{ name: "Light Green", value: "color-light-green" },
{ name: "Lime", value: "color-lime" },
{ name: "Yellow", value: "color-yellow" },
{ name: "Amber", value: "color-amber" },
{ name: "Orange", value: "color-orange" },
{ name: "Deep Orange", value: "color-deep-orange" },
{ name: "Red", value: "color-red" },
{ name: "Pink", value: "color-pink" }
];
if (!$scope.color) {
@@ -1,3 +1,5 @@
<div ng-controller="Umbraco.Overlays.IconPickerOverlay">
<div class="umb-control-group">
@@ -15,11 +17,7 @@
</div>
<div class="umb-control-group">
<umb-color-swatches colors="colors"
selected-color="color"
size="s"
use-color-class="true">
</umb-color-swatches>
<umb-color-swatches colors="colors" selected-color="color" size="s"></umb-color-swatches>
</div>
<umb-load-indicator ng-if="loading"></umb-load-indicator>
@@ -119,6 +119,8 @@ angular.module("umbraco").controller("Umbraco.Overlays.LinkPickerController",
$scope.model.target.isMedia = true;
$scope.model.target.name = media.name;
$scope.model.target.url = mediaHelper.resolveFile(media);
debugger;
$scope.mediaPickerOverlay.show = false;
$scope.mediaPickerOverlay = null;
@@ -151,7 +151,7 @@ angular.module("umbraco")
if (folder.id > 0) {
entityResource.getAncestors(folder.id, "media")
.then(function(anc) {
.then(function(anc) {
$scope.path = _.filter(anc,
function(f) {
return f.path.indexOf($scope.startNodeId) !== -1;
@@ -237,10 +237,7 @@ angular.module("umbraco")
$scope.onUploadComplete = function(files) {
$scope.gotoFolder($scope.currentFolder).then(function() {
if (files.length === 1 && $scope.model.selectedImages.length === 0) {
var image = $scope.images[$scope.images.length - 1];
$scope.target = image;
$scope.target.url = mediaHelper.resolveFile(image);
selectImage(image);
selectImage($scope.images[$scope.images.length - 1]);
}
});
};
@@ -309,23 +306,6 @@ angular.module("umbraco")
debounceSearchMedia();
};
/**
* Toggle the $scope.model.allowAsRoot value to either true or false
*/
$scope.toggle = function(){
// Make sure to activate the changeSearch function everytime the toggle is clicked
$scope.changeSearch();
// Toggle the showChilds option
if($scope.showChilds){
$scope.showChilds = false;
return;
}
$scope.showChilds = true;
}
$scope.changePagination = function(pageNumber) {
$scope.loading = true;
$scope.searchOptions.pageNumber = pageNumber;
@@ -334,7 +314,7 @@ angular.module("umbraco")
function searchMedia() {
$scope.loading = true;
entityResource.getPagedDescendants($scope.currentFolder.id, "Media", $scope.searchOptions)
entityResource.getPagedDescendants($scope.startNodeId, "Media", $scope.searchOptions)
.then(function(data) {
// update image data to work with image grid
angular.forEach(data.items,
@@ -11,6 +11,7 @@
<umb-load-indicator ng-if="loading">
</umb-load-indicator>
<div class="form-search">
<i class="icon-search"></i>
<input class="umb-search-field search-query -full-width-input"
@@ -20,17 +21,6 @@
ng-change="changeSearch()"
type="text"
no-dirty-check />
<div class="form-search__toggle">
<label>
<localize key="general_includeFromsubFolders">Include subfolders in search</localize>
</label>
<umb-toggle
checked="showChilds"
on-click="toggle()">
</umb-toggle>
</div>
</div>
<div class="upload-button">
@@ -93,9 +83,7 @@
item-max-height="150"
item-min-width="100"
item-min-height="100"
only-images={{onlyImages}}
include-sub-folders={{showChilds}}
current-Folder-id="{{currentFolder.id}}">
only-images={{onlyImages}}>
</umb-media-grid>
<div class="flex justify-center">
@@ -1,4 +1,4 @@
<button ng-click="click()" type="button" class="umb-toggle" ng-class="{'umb-toggle--checked': checked}">
<button ng-click="click()" type="button" class="umb-toggle dib" ng-class="{'umb-toggle--checked': checked}">
<span ng-if="!labelPosition && showLabels === 'true' || labelPosition === 'left' && showLabels === 'true'">
<span ng-if="!checked" class="umb-toggle__label umb-toggle__label--left">{{ displayLabelOff }}</span>
@@ -2,7 +2,7 @@
<div class="umb-package-details__main-content">
<umb-box ng-if="node.urls" data-element="node-info-urls">
<umb-box data-element="node-info-urls">
<umb-box-header title-key="general_links"></umb-box-header>
<umb-box-content class="block-form">
<ul class="nav nav-stacked" style="margin-bottom: 0;">
@@ -19,23 +19,6 @@
</ul>
</umb-box-content>
</umb-box>
<umb-box data-element="node-info-redirects" style="display:none;" ng-cloak ng-show="!urlTrackerDisabled && hasRedirects">
<umb-box-header title-key="redirectUrls_redirectUrlManagement"></umb-box-header>
<umb-box-content class="block-form">
<div style="position: relative;">
<div ng-if="loadingRedirectUrls" style="background: rgba(255, 255, 255, 0.8); position: absolute; top: 0; left: 0; right: 0; bottom: 0;"></div>
<umb-load-indicator ng-if="loadingRedirectUrls"></umb-load-indicator>
<div ng-show="hasRedirects">
<p><localize key="redirectUrls_panelInformation" class="ng-isolate-scope ng-scope">The following URLs redirect to this content item:</localize></p>
<ul class="nav nav-stacked" style="margin-bottom: 0;">
<li ng-repeat="redirectUrl in redirectUrls">
<a href="{{redirectUrl.originalUrl}}" target="_blank"><i ng-class="value.icon" class="icon-out"></i> {{redirectUrl.originalUrl}}</a>
</li>
</ul>
</div>
</div>
</umb-box-content>
</umb-box>
<umb-box data-element="node-info-history">
<umb-box-header title-key="general_history"></umb-box-header>
@@ -78,7 +61,6 @@
<div class="history-item__break">
<umb-badge size="xs"
color="{{item.logTypeColor}}">
<!--{{ item.logType }}-->
<localize key="auditTrails_small{{ item.logType }}">{{ item.logType }}</localize>
</umb-badge>
@@ -189,7 +171,7 @@
</umb-badge>
</umb-control-group>
<umb-control-group ng-if="node.id !== 0" data-element="node-info-create-date" label="@template_createdDate">
<umb-control-group data-element="node-info-create-date" label="@template_createdDate">
{{node.createDateFormatted}} <localize key="general_by">by</localize> {{ node.owner.name }}
</umb-control-group>
@@ -219,7 +201,7 @@
</div>
</umb-control-group>
<umb-control-group ng-if="node.id !== 0" data-element="node-info-id" label="Id">
<umb-control-group data-element="node-info-id" label="Id">
<div>{{ node.id }}</div>
<small>{{ node.key }}</small>
</umb-control-group>
@@ -1,14 +1,12 @@
<div class="umb-cropper-gravity">
<div class="gravity-container" ng-show="loaded">
<div class="viewport">
<div class="viewport">
<img ng-src="{{src}}" style="max-width: 100%; max-height: 100%" ng-click="setFocalPoint($event)" draggable="false" />
<img ng-show="isCroppable" ng-src="{{src}}" style="max-width: 100%; max-height: 100%" ng-click="setFocalPoint($event)" draggable="false"/>
<img ng-show="!isCroppable && !hasDimensions" ng-src="{{src}}" width="200" height="200" draggable="false" style="cursor: default;"/>
<div class="overlay" ng-style="style()">
<div ng-show="isCroppable" ng-when="isCroppable" class="overlay" ng-style="style()">
</div>
</div>
</div>
</div>
</div>
</div>
@@ -29,11 +29,11 @@
<umb-box-header title-key="general_general"></umb-box-header>
<umb-box-content class="block-form">
<umb-control-group ng-if="node.id !== 0" data-element="node-info-create-date" label="@content_createDate">
<umb-control-group data-element="node-info-create-date" label="@content_createDate">
{{node.createDateFormatted}} by {{ node.owner.name }}
</umb-control-group>
<umb-control-group ng-if="node.id !== 0" data-element="node-info-update-date" label="@content_updateDate">
<umb-control-group data-element="node-info-update-date" label="@content_updateDate">
{{node.updateDateFormatted}}
</umb-control-group>
@@ -47,7 +47,7 @@
</umb-node-preview>
</umb-control-group>
<umb-control-group ng-if="node.id !== 0" data-element="node-info-id" label="Id">
<umb-control-group data-element="node-info-id" label="Id">
<div>{{ node.id }}</div>
<small>{{ node.key }}</small>
</umb-control-group>
@@ -9,15 +9,12 @@
<div ng-if="notification.view">
<div ng-include="notification.view"></div>
</div>
<div ng-if="notification.headline" ng-switch on="{{notification}}">
<a ng-href="{{notification.url}}" ng-switch-when="{{notification.url && notification.url.trim() != ''}}" target="_blank">
<div ng-if="notification.headline">
<a ng-href="{{notification.url}}" target="_blank">
<strong>{{notification.headline}}</strong>
<span ng-bind-html="notification.message"></span>
</a>
<div ng-switch-default>
<strong>{{notification.headline}}</strong>
<span ng-bind-html="notification.message"></span>
</div>
</div>
</li>
</ul>
@@ -1,14 +1,8 @@
<div class="umb-color-swatches" ng-class="{ 'with-labels': useLabel }">
<div class="umb-color-swatches">
<button type="button" class="umb-color-box umb-color-box--{{size}} btn-{{color.value}}" ng-repeat="color in colors" title="{{useLabel ? color.label : '#' + color.value}}" hex-bg-inline="{{useColorClass === false}}" hex-bg-color="{{color.value}}" ng-class="{ 'active': color.value === selectedColor }" ng-click="setColor(color.value)">
<div class="umb-color-box-inner">
<div class="check_circle">
<i class="icon icon-check small"></i>
</div>
<div class="umb-color-box__label" ng-if="useLabel">
<div class="umb-color-box__name truncate">{{ color.label }}</div>
<div class="umb-color-box__description">#{{ color.value }}</div>
</div>
<button class="umb-color-box umb-color-box--{{size}} btn-{{color.value}}" ng-repeat="color in colors" title="{{color.name}}" ng-class="{active:color.value === selectedColor}" ng-click="setColor(color.value)">
<div class="check_circle">
<i class="icon icon-check small"></i>
</div>
</button>
@@ -21,10 +21,8 @@
<img class="umb-media-grid__item-image-placeholder" ng-if="!item.thumbnail && item.extension != 'svg'" src="assets/img/transparent.png" alt="{{item.name}}" draggable="false" />
<!-- Icon for files -->
<span class="umb-media-grid__item-file-icon" ng-if="!item.thumbnail && item.extension != 'svg'">
<i class="umb-media-grid__item-icon {{item.icon}}"></i>
<span>.{{item.extension}}</span>
</span>
<i class="umb-media-grid__item-icon {{item.icon}}" ng-if="!item.thumbnail && item.extension != 'svg'"></i>
</div>
</div>
</div>
@@ -32,8 +32,7 @@
ng-class="{
'-selected':item.selected,
'-published':item.published,
'-unpublished':!item.published,
'with-unpublished-version':!item.published && item.hasPublishedVersion
'-unpublished':!item.published
}"
ng-click="selectItem(item, $index, $event)">
@@ -27,8 +27,8 @@ function DocumentTypesCreateController($scope, $location, navigationService, con
$scope.showCreateDocTypeCollection = function () {
$scope.model.creatingDoctypeCollection = true;
$scope.model.collectionCreateTemplate = !$scope.model.disableTemplates;
$scope.model.collectionItemCreateTemplate = !$scope.model.disableTemplates;
$scope.model.collectionCreateTemplate = true;
$scope.model.collectionItemCreateTemplate = true;
};
$scope.createContainer = function () {
@@ -19,8 +19,8 @@
<i class="large icon-item-arrangement"></i>
<span class="menu-label">
<localize ng-if="model.disableTemplates === false" key="create_documentTypeWithoutTemplate"></localize>
<localize ng-if="model.disableTemplates === true" key="content_documentType">Document type></localize>
<localize ng-if="model.disableTemplates == false" key="create_documentTypeWithoutTemplate"></localize>
<localize ng-if="model.disableTemplates == true" key="content_documentType">Document type></localize>
</span>
</a>
</li>
@@ -80,18 +80,14 @@
<umb-control-group label="Name of the Parent Document Type" hide-label="false">
<input type="text" name="collectionName" ng-model="model.collectionName" class="umb-textstring textstring input-block-level" umb-auto-focus required />
<span ng-if="model.disableTemplates === false">
<umb-toggle on-click="model.collectionCreateTemplate = !model.collectionCreateTemplate" checked="model.collectionCreateTemplate"></umb-toggle>
<label>Create template for the Parent Document Type</label>
</span>
<umb-toggle on-click="model.collectionCreateTemplate = !model.collectionCreateTemplate" checked="model.collectionCreateTemplate"></umb-toggle>
<label>Create template for the Parent Document Type</label>
</umb-control-group>
<umb-control-group label="Name of the Item Document Type" hide-label="false">
<input type="text" name="collectionItemName" ng-model="model.collectionItemName" class="umb-textstring textstring input-block-level" required />
<span ng-if="model.disableTemplates === false">
<umb-toggle on-click="model.collectionItemCreateTemplate = !model.collectionItemCreateTemplate" checked="model.collectionItemCreateTemplate"></umb-toggle>
<label>Create template for the Item Document Type</label>
</span>
<umb-toggle on-click="model.collectionItemCreateTemplate = !model.collectionItemCreateTemplate" checked="model.collectionItemCreateTemplate"></umb-toggle>
<label>Create template for the Item Document Type</label>
</umb-control-group>
<button type="submit" class="btn btn-primary"><localize key="general_create">Create</localize></button>
@@ -1,4 +1,4 @@
function booleanEditorController($scope) {
function booleanEditorController($scope, $rootScope, assetsService) {
function setupViewModel() {
$scope.renderModel = {
@@ -1,10 +1,6 @@
<div class="umb-editor umb-boolean" ng-controller="Umbraco.PropertyEditors.BooleanController">
<umb-toggle
checked="renderModel.value"
on-click="toggle()"
show-labels="{{model.config.labelOn ? 'true': 'false'}}"
label-position="right"
label-on="{{model.config.labelOn}}"
label-off="{{model.config.labelOn}}">
on-click="toggle()">
</umb-toggle>
</div>

Some files were not shown because too many files have changed in this diff Show More