Merge remote-tracking branch 'origin/v8/dev' into netcore/dev

# Conflicts:
#	src/Umbraco.Core/Models/PropertyType.cs
#	src/Umbraco.Examine.Lucene/BackOfficeExamineSearcher.cs
#	src/Umbraco.Infrastructure/Models/Mapping/EntityMapDefinition.cs
#	src/Umbraco.Tests/Models/PropertyTypeTests.cs
This commit is contained in:
Bjarke Berg
2020-03-10 07:44:22 +01:00
51 changed files with 221 additions and 230 deletions
@@ -6,8 +6,6 @@ using System.Text.RegularExpressions;
using Examine;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Identity;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
using Umbraco.Web;
using Umbraco.Web.Models.ContentEditing;
@@ -175,6 +175,12 @@ namespace Umbraco.Web.Models.Mapping
target.Name = source.Values.ContainsKey(UmbracoExamineFieldNames.NodeNameFieldName) ? source.Values[UmbracoExamineFieldNames.NodeNameFieldName] : "[no name]";
var culture = context.GetCulture();
if(culture.IsNullOrWhiteSpace() == false)
{
target.Name = source.Values.ContainsKey($"nodeName_{culture}") ? source.Values[$"nodeName_{culture}"] : target.Name;
}
if (source.Values.TryGetValue(UmbracoExamineFieldNames.UmbracoFileFieldName, out var umbracoFile))
{
if (umbracoFile != null)
@@ -168,6 +168,7 @@ namespace Umbraco.Core.Models
/// <inheritdoc />
[DataMember]
[DoNotClone]
public Lazy<int> PropertyGroupId
{
get => _propertyGroupId;
@@ -653,10 +653,14 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
var entity = new MediaEntitySlim();
BuildContentEntity(entity, dto);
if (dto is MediaEntityDto contentDto)
// fill in the media info
if (dto is MediaEntityDto mediaEntityDto)
{
// fill in the media info
entity.MediaPath = contentDto.MediaPath;
entity.MediaPath = mediaEntityDto.MediaPath;
}
else if (dto is GenericContentEntityDto genericContentEntityDto)
{
entity.MediaPath = genericContentEntityDto.MediaPath;
}
return entity;
@@ -119,7 +119,7 @@ namespace Umbraco.Core.PropertyEditors
/// <para>Technically, it could be cached by datatype but let's keep things
/// simple enough for now.</para>
/// </remarks>
public IDataValueEditor GetValueEditor(object configuration)
public virtual IDataValueEditor GetValueEditor(object configuration)
{
// if an explicit value editor has been set (by the manifest parser)
// then return it, and ignore the configuration, which is going to be
@@ -10,6 +10,7 @@ using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
using Umbraco.Examine;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Mapping;
using Umbraco.Web.Routing;
using Umbraco.Web.Trees;
@@ -50,6 +51,7 @@ namespace Umbraco.Web.Search
/// </summary>
/// <param name="query"></param>
/// <param name="entityType"></param>
/// <param name="culture"></param>
/// <param name="totalFound"></param>
/// <param name="searchFrom">
/// A starting point for the search, generally a node id, but for members this is a member type alias
@@ -62,7 +64,7 @@ namespace Umbraco.Web.Search
string query,
UmbracoEntityTypes entityType,
int pageSize,
long pageIndex, out long totalFound, string searchFrom = null, bool ignoreUserStartNodes = false)
long pageIndex, out long totalFound, string culture = null, string searchFrom = null, bool ignoreUserStartNodes = false)
{
var pagedResult = _backOfficeExamineSearcher.Search(query, entityType, pageSize, pageIndex, out totalFound, searchFrom, ignoreUserStartNodes);
@@ -73,7 +75,7 @@ namespace Umbraco.Web.Search
case UmbracoEntityTypes.Media:
return MediaFromSearchResults(pagedResult);
case UmbracoEntityTypes.Document:
return ContentFromSearchResults(pagedResult);
return ContentFromSearchResults(pagedResult, culture);
default:
throw new NotSupportedException("The " + typeof(UmbracoTreeSearcher) + " currently does not support searching against object type " + entityType);
}
@@ -145,14 +147,20 @@ namespace Umbraco.Web.Search
/// Returns a collection of entities for content based on search results
/// </summary>
/// <param name="results"></param>
/// <param name="culture"></param>
/// <returns></returns>
private IEnumerable<SearchResultEntity> ContentFromSearchResults(IEnumerable<ISearchResult> results)
private IEnumerable<SearchResultEntity> ContentFromSearchResults(IEnumerable<ISearchResult> results, string culture = null)
{
var defaultLang = _languageService.GetDefaultLanguageIsoCode();
foreach (var result in results)
{
var entity = _mapper.Map<SearchResultEntity>(result);
var entity = _mapper.Map<SearchResultEntity>(result, context => {
if(culture != null) {
context.SetCulture(culture);
}
}
);
var intId = entity.Id.TryConvertTo<int>();
if (intId.Success)
@@ -160,7 +168,7 @@ namespace Umbraco.Web.Search
//if it varies by culture, return the default language URL
if (result.Values.TryGetValue(UmbracoExamineFieldNames.VariesByCultureFieldName, out var varies) && varies == "y")
{
entity.AdditionalData["Url"] = _publishedUrlProvider.GetUrl(intId.Result, culture: defaultLang);
entity.AdditionalData["Url"] = _publishedUrlProvider.GetUrl(intId.Result, culture: culture ?? defaultLang);
}
else
{
@@ -1179,7 +1179,7 @@ namespace Umbraco.Core.Services.Implement
/// <summary>
/// Occurs before Save
/// </summary>
internal static event TypedEventHandler<IUserService, SaveEventArgs<UserGroupWithUsers>> SavingUserGroup;
public static event TypedEventHandler<IUserService, SaveEventArgs<UserGroupWithUsers>> SavingUserGroup;
/// <summary>
/// Occurs after Save
@@ -94,7 +94,7 @@ namespace Umbraco.ModelsBuilder.Embedded.Building
//
private static void WriteGeneratedCodeAttribute(StringBuilder sb, string tabs)
{
sb.AppendFormat("{0}[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Umbraco.ModelsBuilder\", \"{1}\")]\n", tabs, ApiVersion.Current.Version);
sb.AppendFormat("{0}[global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Umbraco.ModelsBuilder.Embedded\", \"{1}\")]\n", tabs, ApiVersion.Current.Version);
}
private void WriteContentType(StringBuilder sb, TypeModel type)
@@ -14,7 +14,7 @@ namespace Umbraco.ModelsBuilder.Embedded.Building
sb.Append("// <auto-generated>\n");
sb.Append("// This code was generated by a tool.\n");
sb.Append("//\n");
sb.AppendFormat("// Umbraco.ModelsBuilder v{0}\n", ApiVersion.Current.Version);
sb.AppendFormat("// Umbraco.ModelsBuilder.Embedded v{0}\n", ApiVersion.Current.Version);
sb.Append("//\n");
sb.Append("// Changes to this file will be lost if the code is regenerated.\n");
sb.Append("// </auto-generated>\n");
@@ -2,7 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Umbraco.ModelsBuilder")]
[assembly: AssemblyTitle("Umbraco.ModelsBuilder.Embedded")]
[assembly: AssemblyDescription("Umbraco ModelsBuilder")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Umbraco CMS")]
@@ -1,9 +1,10 @@
using System;
using System.Diagnostics;
using Newtonsoft.Json;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Core.Serialization;
using Umbraco.Tests.Testing;
namespace Umbraco.Tests.Models
@@ -50,9 +51,9 @@ namespace Umbraco.Tests.Models
Assert.AreEqual(clone.ValidationRegExp, pt.ValidationRegExp);
Assert.AreEqual(clone.ValueStorageType, pt.ValueStorageType);
//This double verifies by reflection
//This double verifies by reflection (don't test properties marked with [DoNotClone]
var allProps = clone.GetType().GetProperties();
foreach (var propertyInfo in allProps)
foreach (var propertyInfo in allProps.Where(p => p.GetCustomAttribute<DoNotCloneAttribute>(false) == null))
{
var expected = propertyInfo.GetValue(pt, null);
var actual = propertyInfo.GetValue(clone, null);
+12 -12
View File
@@ -54,7 +54,7 @@ namespace Umbraco.Tests.ModelsBuilder
// <auto-generated>
// This code was generated by a tool.
//
// Umbraco.ModelsBuilder v" + version + @"
// Umbraco.ModelsBuilder.Embedded v" + version + @"
//
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
@@ -76,14 +76,14 @@ namespace Umbraco.Web.PublishedModels
{
// helpers
#pragma warning disable 0109 // new is redundant
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
public new const string ModelTypeAlias = ""type1"";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
public new const PublishedItemType ModelItemType = PublishedItemType.Content;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
public new static IPublishedContentType GetModelContentType()
=> PublishedModelUtility.GetModelContentType(ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
public static IPublishedPropertyType GetModelPropertyType<TValue>(Expression<Func<Type1, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(), selector);
#pragma warning restore 0109
@@ -95,7 +95,7 @@ namespace Umbraco.Web.PublishedModels
// properties
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
[ImplementPropertyType(""prop1"")]
public string Prop1 => this.Value<string>(""prop1"");
}
@@ -169,7 +169,7 @@ namespace Umbraco.Web.PublishedModels
// <auto-generated>
// This code was generated by a tool.
//
// Umbraco.ModelsBuilder v" + version + @"
// Umbraco.ModelsBuilder.Embedded v" + version + @"
//
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
@@ -191,14 +191,14 @@ namespace Umbraco.Web.PublishedModels
{
// helpers
#pragma warning disable 0109 // new is redundant
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
public new const string ModelTypeAlias = ""type1"";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
public new const PublishedItemType ModelItemType = PublishedItemType.Content;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
public new static IPublishedContentType GetModelContentType()
=> PublishedModelUtility.GetModelContentType(ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
public static IPublishedPropertyType GetModelPropertyType<TValue>(Expression<Func<Type1, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(), selector);
#pragma warning restore 0109
@@ -210,7 +210,7 @@ namespace Umbraco.Web.PublishedModels
// properties
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder"", """ + version + @""")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute(""Umbraco.ModelsBuilder.Embedded"", """ + version + @""")]
[ImplementPropertyType(""foo"")]
public global::System.Collections.Generic.IEnumerable<global::Foo> Foo => this.Value<global::System.Collections.Generic.IEnumerable<global::Foo>>(""foo"");
}
-74
View File
@@ -1,74 +0,0 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="Umbraco.Web" />
<add namespace="Umbraco.Core" />
<add namespace="Umbraco.Core.Models" />
<add namespace="Umbraco.Core.Models.PublishedContent" />
<add namespace="Umbraco.Web.Mvc" />
<add namespace="Examine" />
<add namespace="Umbraco.Web.PublishedModels" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
<system.web>
<compilation targetFramework="4.7.2">
<assemblies>
<add assembly="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<!--
Views are compiled by the Microsoft.CodeDom.Providers.DotNetCompilerPlatform which uses the Roslyn compiler
from ~/bin/roslyn to expose an ICodeProvider implementation to System.CodeDom.
For instance, starting with package 1.4.0 (which contains version 1.2.2.0) System.Collections.Immutable
lists netstandard2.0 as a supported target, whereas package 1.3.1 only listed net45. So now, when
installing, NuGet picks the netstandard2.0 version, thus introducing a dependency to netstandard2.0.
Somehow, transitive dependencies are not working correctly, and either (a) NuGet fails to properly
register this dependency, or (b) when reference assemblies are gathered before compiling views, this
dependency is missed. In any case, the result is that the ICodeProvider is passed a list of referenced
assemblies that is missing .NET Standard.
It may be a mix of both. NuGet registers the dependency well enough, that we can actually build the
whole application - but it is not doing something that is required in order to have .NET Standard
being a dependency when building views.
See also: https://stackoverflow.com/questions/50165910
Funny enough, the CSharpCompiler already explicitly adds System.Runtime as a referenced assembly,
with a comment mentioning an issue. But it's not adding .NET Standard. So, for the time being, to be sure,
we are adding both here.
-->
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add assembly="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
</assemblies>
</compilation>
</system.web>
</configuration>
@@ -84,7 +84,7 @@ angular.module('umbraco.mocks').
"buttons_save": "Save",
"buttons_saveAndPublish": "Save and publish",
"buttons_saveToPublish": "Save and send for approval",
"buttons_showPage": "Preview",
"buttons_saveAndPreview": "Save and preview",
"buttons_showPageDisabled": "Preview is disabled because there's no template assigned",
"buttons_styleChoose": "Choose style",
"buttons_styleShow": "Show styles",
@@ -588,7 +588,7 @@ When building a custom infinite editor view you can use the same components as a
*/
function mediaPicker(editor) {
editor.view = "views/common/infiniteeditors/mediapicker/mediapicker.html";
if (!editor.size) editor.size = "small";
if (!editor.size) editor.size = "medium";
editor.updatedMediaNodes = [];
open(editor);
}
@@ -256,7 +256,7 @@ body.touch .umb-tree {
}
&.current > .umb-tree-item__inner > .umb-tree-item__annotation {
background-color: @pinkLight;
background-color: @ui-active;
}
}
@@ -115,7 +115,7 @@
li {
&.is-active a {
border-left-color: @ui-active;
border-left-color: @ui-active-border;
}
a {
@@ -1,5 +1,8 @@
@checkboxWidth: 16px;
@checkboxHeight: 16px;
@checkboxWidth: 18px;
@checkboxHeight: 18px;
label.umb-form-check--checkbox{
margin:3px 0;
}
.umb-form-check {
display: flex;
@@ -10,11 +13,11 @@
cursor: pointer !important;
.umb-form-check__symbol {
margin-top: 1px;
margin-top: 4px;
margin-right: 10px;
}
.umb-form-check__info {
margin-left:20px;
}
@@ -95,6 +98,10 @@
&__state {
display: flex;
height: 18px;
position: absolute;
margin-top: 2px;
top: 0;
left: -1px;
}
&__check {
@@ -101,6 +101,9 @@
position:relative;
}
.usky-grid .grid-layout {
max-width: 600px;
}
// ROW
// -------------------------
@@ -517,6 +520,25 @@
position:relative;
}
.usky-grid .uSky-templates .layout {
margin-top: 5px;
margin-bottom: 20px;
float: left;
}
.usky-grid .uSky-templates .columns {
margin-top: 5px;
margin-bottom: 25px;
float: left;
}
.usky-grid .uSky-templates .columns .preview-cell p {
font-size: 6px;
line-height: 8px;
text-align: center;
}
/**************************************************************************************************/
@@ -88,9 +88,13 @@
background: @white;
}
.umb-dialog .umb-btn-toolbar .umb-control-group{
border: none;
padding: none;
.umb-dialog .abstract{
margin-bottom:20px;
}
.umb-dialog .umb-btn-toolbar .umb-control-group {
border: none;
padding: none;
}
.umb-dialog-body{
@@ -31,7 +31,7 @@ ul.sections {
height: 4px;
bottom: 0;
transform: translateY(4px);
background-color: @ui-active;
background-color: @pinkLight;
position: absolute;
border-radius: 3px 3px 0 0;
opacity: 0;
@@ -56,7 +56,7 @@ ul.sections {
}
&.current > a {
color: @ui-active;
color: @pinkLight;
&::after {
opacity: 1;
@@ -79,7 +79,7 @@ ul.sections {
&.current {
i {
opacity: 1;
background: @ui-active;
background: @pinkLight;
}
}
@@ -111,7 +111,7 @@ ul.sections-tray {
li {
&.current a {
color: @ui-active;
color: @ui-active-border;
opacity: 1;
&::after {
@@ -131,7 +131,7 @@ ul.sections-tray {
content: "";
width: 4px;
height: 100%;
background-color: @ui-active;
background-color: @ui-active-border;
position: absolute;
border-radius: 0 3px 3px 0;
opacity: 0;
@@ -75,6 +75,8 @@
@gray-9: #E9E9EB;
@gray-10: #F3F3F5;
@gray-11: #F6F6F7;
@gray-12: #F9F9FA;
@gray-13: #FBFBFD;
@sand-1: #DED4CF;// added 2019
@sand-2: #EBDED6;// added 2019
@@ -108,7 +110,7 @@
//@blueLight: #4f89de;
@blue: #2E8AEA;
@blueMid: #2152A3;// updated 2019
@blueMidLight: rgb(99, 174, 236);
@blueMidLight: #6ab4f0;
@blueDark: #3544b1;// updated 2019
@blueExtraDark: #1b264f;// added 2019
@blueLight: #ADD8E6;
@@ -116,6 +118,7 @@
//@orange: #f79c37;// updated 2019
@pink: #D93F4C;// #C3325F;// update 2019
@pinkLight: #f5c1bc;// added 2019
@pinkExtraLight: #fee4e1;// added 2020
@pinkRedLight: #ff8a89;// added 2019
@brown: #9d8057;// added 2019
@brownLight: #e4e0dd;// added 2019
@@ -134,17 +137,18 @@
@ui-option-type: @blueExtraDark;
@ui-option-type-hover: @blueMid;
@ui-option: @white;
@ui-option-hover: @sand-7;
@ui-option-hover: @gray-12;
@ui-option-disabled-type: @gray-6;
@ui-option-disabled-type-hover: @gray-5;
@ui-option-disabled-hover: @sand-7;
@ui-option-disabled-hover: @gray-12;
@ui-disabled-type: @gray-6;
@ui-disabled-border: @gray-6;
//@ui-active: #346ab3;
@ui-active: @pinkLight;
@ui-active: @pinkExtraLight;
@ui-active-border: @pinkLight;
@ui-active-blur: @brownLight;
@ui-active-type: @blueExtraDark;
@ui-active-type-hover: @blueMid;
@@ -161,19 +165,19 @@
@ui-light-type-hover: @blueMid;
@ui-light-active-border: @pinkLight;
@ui-light-active-type: @blueExtraDark;
@ui-light-active-type-hover: @blueMid;
@ui-light-active-type: @blueMid;
@ui-light-active-type-hover: @blueMidLight;
@ui-action: @white;
@ui-action-hover: @sand-7;
@ui-action-hover: @gray-12;
@ui-action-type: @blueExtraDark;
@ui-action-type-hover: @blueMid;
@ui-action-border: @blueExtraDark;
@ui-action-border-hover: @blueMid;
@ui-action-discreet: @white;
@ui-action-discreet-hover: @sand-7;
@ui-action-discreet-hover: @gray-12;
@ui-action-discreet-type: @blueExtraDark;
@ui-action-discreet-type-hover: @blueMid;
@ui-action-discreet-border: @gray-7;
@@ -1,7 +1,7 @@
//used for the media picker dialog
angular.module("umbraco")
.controller("Umbraco.Editors.MediaPickerController",
function ($scope, mediaResource, entityResource, userService, mediaHelper, mediaTypeHelper, eventsService, treeService, localStorageService, localizationService, editorService, umbSessionStorage) {
function ($scope, $timeout, mediaResource, entityResource, userService, mediaHelper, mediaTypeHelper, eventsService, treeService, localStorageService, localizationService, editorService, umbSessionStorage) {
var vm = this;
@@ -306,9 +306,7 @@ angular.module("umbraco")
});
} else {
var image = $scope.images[$scope.images.length - 1];
$scope.target = image;
$scope.target.url = mediaHelper.resolveFile(image);
selectMedia(image);
clickHandler(image);
}
});
});
@@ -324,7 +322,7 @@ angular.module("umbraco")
// also make sure the node is not trashed
if (nodePath.indexOf($scope.startNodeId.toString()) !== -1 && node.trashed === false) {
gotoFolder({ id: $scope.lastOpenedNode, name: "Media", icon: "icon-folder", path: node.path });
gotoFolder({ id: $scope.lastOpenedNode || $scope.startNodeId, name: "Media", icon: "icon-folder", path: node.path });
return true;
} else {
gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" });
@@ -78,18 +78,20 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
*/
function onInit () {
// load languages
languageResource.getAll().then(function (languages) {
vm.languages = languages;
if (vm.showLanguageSelector) {
// load languages
languageResource.getAll().then(function (languages) {
vm.languages = languages;
// set the default language
vm.languages.forEach(function (language) {
if (language.isDefault) {
vm.selectedLanguage = language;
vm.languageSelectorIsOpen = false;
}
// set the default language
vm.languages.forEach(function (language) {
if (language.isDefault) {
vm.selectedLanguage = language;
vm.languageSelectorIsOpen = false;
}
});
});
});
}
if (vm.treeAlias === "content") {
vm.entityType = "Document";
@@ -214,7 +216,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController",
if (vm.dataTypeKey) {
queryParams["dataTypeKey"] = vm.dataTypeKey;
}
var queryString = $.param(queryParams); //create the query string from the params object
if (!queryString) {
@@ -45,9 +45,9 @@
alias="preview"
ng-if="!page.isNew && content.allowPreview && page.showPreviewButton"
type="button"
button-style="info"
button-style="link"
action="preview(content)"
label-key="buttons_showPage">
label-key="buttons_saveAndPreview">
</umb-button>
<umb-button
@@ -1,18 +1,20 @@
<div ng-controller="Umbraco.Editors.ContentBlueprint.CreateController as vm">
<div class="umbracoDialog umb-dialog-body with-footer" ng-cloak>
<div class="umb-pane">
<h5><localize key="create_createUnder">Create an item under</localize> {{currentNode.name}}</h5>
<p class="abstract" style="margin-bottom: 20px;"><localize key="create_createContentBlueprint">Select the document type you want to make a content template for</localize></p>
<p class="abstract">
<localize key="create_createContentBlueprint">Select the document type you want to make a content template for</localize>
</p>
<umb-load-indicator ng-if="vm.loading"></umb-load-indicator>
<ul class="umb-actions umb-actions-child">
<li class="umb-action" ng-repeat="documentType in vm.documentTypes | orderBy:'name':false">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.createBlueprint(documentType)" prevent-default>
<i class="large icon {{documentType.icon}}"></i>
<li class="umb-action" ng-repeat="documentType in vm.documentTypes |orderBy:'name':false">
<button type="button" class="umb-action-link umb-outline btn-reset" ng-click="vm.createBlueprint(documentType)">
<i class="large icon {{documentType.icon}}" aria-hidden="true"></i>
<span class="menu-label">
{{documentType.name}}
<small>
@@ -29,11 +31,10 @@
<div class="umb-dialog-footer btn-toolbar umb-btn-toolbar">
<umb-button
label-key="buttons_somethingElse"
action="vm.close()"
type="button"
button-style="info">
<umb-button label-key="buttons_somethingElse"
action="vm.close()"
type="button"
button-style="info">
</umb-button>
</div>
@@ -1,9 +1,15 @@
<div ng-controller="Umbraco.PropertyEditors.GridPrevalueEditorController" class="usky-grid usky-grid-configuration">
<div style="max-width: 600px">
<div class="grid-layout">
<div class="control-group uSky-templates">
<h4><localize key="grid_gridLayouts" /></h4>
<p><localize key="grid_gridLayoutsDetail" /></p>
<h4>
<localize key="grid_gridLayouts">
Grid Layouts
</localize>
</h4>
<p>
<localize key="grid_gridLayoutsDetail">Layouts are the overall work area for the grid editor, usually you only need one or two different layouts</localize>
</p>
<ul class="unstyled"
ui-sortable
@@ -12,7 +18,7 @@
<li ng-repeat="template in model.value.templates" class="clearfix">
<div ng-click="configureTemplate(template)"
class="preview-rows layout" style="margin-top: 5px; margin-bottom: 20px; float:left">
class="preview-rows layout">
<div class="preview-row">
<div class="preview-col"
@@ -26,28 +32,32 @@
<div>
{{template.name}} <br />
<i class="icon-delete red"></i>
<a class="btn btn-small btn-link"
href
ng-click="deleteTemplate($index)"><localize key="general_delete" /></a>
<button type="button" class="btn btn-small btn-link" ng-click="deleteTemplate($index)">
<i class="icon-delete red" aria-hidden="true"></i>
<localize key="general_delete">Delete</localize>
</button>
</div>
</li>
</ul>
<button class="btn btn-small"
prevent-default
<button type="button" class="btn btn-small btn-info"
ng-click="configureTemplate()">
<i class="icon-add"></i> <localize key="grid_addGridLayout" />
<i class="icon-add" aria-hidden="true"></i>
<localize key="grid_addGridLayout" />
</button>
</div>
</div>
<div style="max-width: 600px">
<div class="grid-layout">
<div class="control-group uSky-templates">
<h4><localize key="grid_rowConfigurations" /></h4>
<p><localize key="grid_rowConfigurationsDetail" /></p>
<h4>
<localize key="grid_rowConfigurations">Row Configurations</localize>
</h4>
<p>
<localize key="grid_rowConfigurationsDetail">Rows are predefined cells arranged horizontally</localize>
</p>
<div class="control-group uSky-templates-rows">
<ul class="unstyled"
@@ -57,7 +67,7 @@
<li ng-repeat="layout in model.value.layouts" class="clearfix">
<div ng-click="configureLayout(layout)"
class="preview-rows columns" style="margin-top: 5px; margin-bottom: 25px; float:left">
class="preview-rows columns">
<div class="preview-row">
<div class="preview-col"
@@ -66,7 +76,7 @@
ng-style="{width: percentage(area.grid) + '%', 'max-width': '100%'}">
<div class="preview-cell">
<p style="font-size: 6px; line-height: 8px; text-align: center" ng-show="area.maxItems > 0">{{area.maxItems}}</p>
<p ng-show="area.maxItems > 0">{{area.maxItems}}</p>
</div>
</div>
</div>
@@ -74,17 +84,18 @@
<div>
{{layout.label || layout.name}}<br />
<i class="icon-delete red"></i>
<a class="btn btn-small btn-link" href ng-click="deleteLayout($index)">
<localize key="general_delete" />
</a>
<button type="button" class="btn btn-small btn-link" ng-click="deleteLayout($index)">
<i class="icon-delete red" aria-hidden="true"></i>
<localize key="general_delete">Delete</localize>
</button>
</div>
</li>
</ul>
<button class="btn btn-small" prevent-default ng-click="configureLayout()">
<i class="icon-add"></i> <localize key="grid_addRowConfiguration" />
<button type="button" class="btn btn-small" ng-click="configureLayout()">
<i class="icon-add" aria-hidden="true"></i>
<localize key="grid_addRowConfiguration">Add row configuration</localize>
</button>
</div>
@@ -93,7 +104,7 @@
</div>
<div style="max-width: 600px">
<div class="grid-layout">
<umb-control-group label="@grid_columns"
description="@grid_columnsDetails">
@@ -108,22 +119,21 @@
ng-model="model.value.config">
<li ng-repeat="configValue in model.value.config">
<i class="icon icon-navigation handle"></i>
<i class="icon icon-navigation handle" aria-hidden="true"></i>
<a href="#" prevent-default ng-click="removeConfigValue(model.value.config, $index)">
<i class="icon icon-delete red"></i>
<button type="button" class="btn-link" ng-click="removeConfigValue(model.value.config, $index)">
<i class="icon icon-delete red" aria-hidden="true"></i>
{{configValue.label}}
</a>
</button>
</li>
</ul>
<ul class="unstyled list-icons">
<li>
<i class="icon icon-settings-alt-2 turquoise"></i>
<a href="#" ng-click="editConfig()" prevent-default>
<localize key="general_edit" />
</a>
<li>
<button type="button" ng-click="editConfig()" class="btn-link">
<i class="icon icon-settings-alt-2 turquoise" aria-hidden="true"></i>
<localize key="general_edit">Edit</localize>
</button>
</li>
</ul>
</umb-control-group>
@@ -137,22 +147,22 @@
ng-model="model.value.styles">
<li ng-repeat="style in model.value.styles">
<i class="icon icon-navigation handle"></i>
<i class="icon icon-navigation handle" aria-hidden="true"></i>
<a href="#" prevent-default ng-click="removeConfigValue(model.value.styles, $index)">
<i class="icon icon-delete red"></i>
<button type="button" class="btn-link" ng-click="removeConfigValue(model.value.styles, $index)">
<i class="icon icon-delete red" aria-hidden="true"></i>
{{style.label}}
</a>
</button>
</li>
</ul>
<ul class="unstyled list-icons">
<li>
<i class="icon icon-settings-alt-2 turquoise"></i>
<a href="#" ng-click="editStyles()" prevent-default>
<localize key="general_edit" />
</a>
<li>
<button type="button" ng-click="editStyles()" class="btn-link">
<i class="icon icon-settings-alt-2 turquoise" aria-hidden="true"></i>
<localize key="general_edit">Edit</localize>
</button>
</li>
</ul>
</umb-control-group>
@@ -49,12 +49,10 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl
// when there is no match for a selected id. This will ensure that the values being set on save, are the same as before.
medias = ids.map(id => {
var found = medias.find(m =>
// We could use coercion (two ='s) here .. but not sure if this works equally well in all browsers and
// it's prone to someone "fixing" it at some point without knowing the effects. Rather use toString()
// compares and be completely sure it works.
m.udi.toString() === id.toString() || m.id.toString() === id.toString());
// We could use coercion (two ='s) here .. but not sure if this works equally well in all browsers and
// it's prone to someone "fixing" it at some point without knowing the effects. Rather use toString()
// compares and be completely sure it works.
var found = medias.find(m => m.udi.toString() === id.toString() || m.id.toString() === id.toString());
if (found) {
return found;
} else {
@@ -591,8 +591,8 @@
}
function updatePropertyActionStates() {
copyAllEntriesAction.isDisabled = !model.value || model.value.length === 0;
removeAllEntriesAction.isDisabled = !model.value || model.value.length === 0;
copyAllEntriesAction.isDisabled = !model.value || !model.value.length;
removeAllEntriesAction.isDisabled = copyAllEntriesAction.isDisabled;
}
@@ -81,7 +81,7 @@
<key alias="save">Uložit</key>
<key alias="saveAndPublish">Uložit a publikovat</key>
<key alias="saveToPublish">Uložit a odeslat ke schválení</key>
<key alias="showPage">Náhled</key>
<key alias="saveAndPreview">Náhled</key>
<key alias="showPageDisabled">Náhled je deaktivován, protože není přiřazena žádná šablona</key>
<key alias="styleChoose">Vybrat styl</key>
<key alias="styleShow">Zobrazit styly</key>
@@ -139,7 +139,7 @@
<key alias="saveToPublish">Gem og send til udgivelse</key>
<key alias="saveListView">Gem listevisning</key>
<key alias="schedulePublish">Planlæg</key>
<key alias="showPage">Forhåndsvisning</key>
<key alias="saveAndPreview">Forhåndsvisning</key>
<key alias="showPageDisabled">Forhåndsvisning er deaktiveret fordi der ikke er nogen skabelon tildelt</key>
<key alias="styleChoose">Vælg formattering</key>
<key alias="styleShow">Vis koder</key>
@@ -140,7 +140,7 @@
<key alias="saveToPublish">Speichern und zur Abnahme übergeben</key>
<key alias="saveListView">Listenansicht sichern</key>
<key alias="schedulePublish">Veröffentlichung planen</key>
<key alias="showPage">Vorschau</key>
<key alias="saveAndPreview">Vorschau</key>
<key alias="showPageDisabled">Die Vorschaufunktion ist deaktiviert, da keine Vorlage zugewiesen ist</key>
<key alias="styleChoose">Stil auswählen</key>
<key alias="styleShow">Stil anzeigen</key>
@@ -141,7 +141,7 @@
<key alias="saveToPublish">Save and send for approval</key>
<key alias="saveListView">Save list view</key>
<key alias="schedulePublish">Schedule</key>
<key alias="showPage">Preview</key>
<key alias="saveAndPreview">Save and preview</key>
<key alias="showPageDisabled">Preview is disabled because there's no template assigned</key>
<key alias="styleChoose">Choose style</key>
<key alias="styleShow">Show styles</key>
@@ -139,7 +139,7 @@
<key alias="saveToPublish">Send for approval</key>
<key alias="saveListView">Save list view</key>
<key alias="schedulePublish">Schedule</key>
<key alias="showPage">Preview</key>
<key alias="saveAndPreview">Save and preview</key>
<key alias="showPageDisabled">Preview is disabled because there's no template assigned</key>
<key alias="styleChoose">Choose style</key>
<key alias="styleShow">Show styles</key>
@@ -124,7 +124,7 @@
<key alias="saveAndPublish">Guardar y publicar</key>
<key alias="saveToPublish">Guardar y enviar para aprobación</key>
<key alias="saveListView">Guardar vista de lista</key>
<key alias="showPage">Previsualizar</key>
<key alias="saveAndPreview">Previsualizar</key>
<key alias="showPageDisabled">La previsualización está deshabilitada porque no hay ninguna plantilla asignada</key>
<key alias="styleChoose">Elegir estilo</key>
<key alias="styleShow">Mostrar estilos</key>
@@ -124,7 +124,7 @@
<key alias="saveAndSchedule">Sauver et planifier</key>
<key alias="saveToPublish">Sauver et envoyer pour approbation</key>
<key alias="saveListView">Sauver la mise en page de la liste</key>
<key alias="showPage">Prévisualiser</key>
<key alias="saveAndPreview">Prévisualiser</key>
<key alias="showPageDisabled">La prévisualisation est désactivée car aucun modèle n'a été assigné.</key>
<key alias="styleChoose">Choisir un style</key>
<key alias="styleShow">Afficher les styles</key>
@@ -68,7 +68,7 @@
<key alias="save">שמור</key>
<key alias="saveAndPublish">שמור ופרסם</key>
<key alias="saveToPublish">שמור ושלח לאישור</key>
<key alias="showPage">תצוגה מקדימה</key>
<key alias="saveAndPreview">תצוגה מקדימה</key>
<key alias="styleChoose">בחר עיצוב</key>
<key alias="styleShow">הצג עיצוב</key>
<key alias="tableInsert">הוספת טבלה</key>
@@ -69,7 +69,7 @@
<key alias="save">Salva</key>
<key alias="saveAndPublish">Salva e pubblica</key>
<key alias="saveToPublish">Salva e invia per approvazione</key>
<key alias="showPage">Anteprima</key>
<key alias="saveAndPreview">Anteprima</key>
<key alias="showPageDisabled"><![CDATA[L'anteprima è disabilitata dato che non è stato assegnato alcun template]]></key>
<key alias="styleChoose">Scegli lo stile</key>
<key alias="styleShow">Mostra gli stili</key>
@@ -85,7 +85,7 @@
<key alias="saveAndPublish">保存及び公開</key>
<key alias="saveToPublish">保存して承認に送る</key>
<key alias="saveListView">リスト ビューの保存</key>
<key alias="showPage">プレビュー</key>
<key alias="saveAndPreview">プレビュー</key>
<key alias="showPageDisabled">テンプレートが指定されていないのでプレビューは無効になっています</key>
<key alias="styleChoose">スタイルの選択</key>
<key alias="styleShow">スタイルの表示</key>
@@ -67,7 +67,7 @@
<key alias="save">저장</key>
<key alias="saveAndPublish">저장 후 발행</key>
<key alias="saveToPublish">저장 후 승인을 위해 전송</key>
<key alias="showPage">미리보기</key>
<key alias="saveAndPreview">미리보기</key>
<key alias="styleChoose">스타일 선택</key>
<key alias="styleShow">스타일 보기</key>
<key alias="tableInsert">테이블 삽입</key>
@@ -83,7 +83,7 @@
<key alias="saveAndPublish">Lagre og publiser</key>
<key alias="saveAndSchedule">Lagre og planlegge</key>
<key alias="saveToPublish">Lagre og send til publisering</key>
<key alias="showPage">Forhåndsvis</key>
<key alias="saveAndPreview">Forhåndsvis</key>
<key alias="showPageDisabled">Forhåndsvisning er deaktivert siden det ikke er angitt noen mal</key>
<key alias="styleChoose">Velg formattering</key>
<key alias="styleShow">Vis stiler</key>
@@ -90,7 +90,7 @@
<key alias="saveAndPublish">Opslaan en publiceren</key>
<key alias="saveToPublish">Opslaan en verzenden voor goedkeuring</key>
<key alias="saveListView">Sla list view op</key>
<key alias="showPage">voorbeeld bekijken</key>
<key alias="saveAndPreview">voorbeeld bekijken</key>
<key alias="showPageDisabled">Voorbeeld bekijken is uitgeschakeld omdat er geen template is geselecteerd</key>
<key alias="styleChoose">Stijl kiezen</key>
<key alias="styleShow">Stijlen tonen</key>
@@ -121,7 +121,7 @@
<key alias="saveAndPublish">Zapisz i publikuj</key>
<key alias="saveToPublish">Zapisz i wyślij do zaakceptowania</key>
<key alias="saveListView">Zapisz widok listy</key>
<key alias="showPage">Podgląd</key>
<key alias="saveAndPreview">Podgląd</key>
<key alias="showPageDisabled">Podgląd jest wyłączony, ponieważ żaden szablon nie został przydzielony</key>
<key alias="styleChoose">Wybierz styl</key>
<key alias="styleShow">Pokaż style</key>
@@ -67,7 +67,7 @@
<key alias="save">Salvar</key>
<key alias="saveAndPublish">Salvar e publicar</key>
<key alias="saveToPublish">Salvar e mandar para aprovação</key>
<key alias="showPage">Prévia</key>
<key alias="saveAndPreview">Prévia</key>
<key alias="styleChoose">Escolha estilo</key>
<key alias="styleShow">Mostrar estilos</key>
<key alias="tableInsert">Inserir tabela</key>
@@ -155,7 +155,7 @@
<key alias="saveToPublish">Направить на публикацию</key>
<key alias="saveListView">Сохранить список</key>
<key alias="select">Выбрать</key>
<key alias="showPage">Предварительный просмотр</key>
<key alias="saveAndPreview">Предварительный просмотр</key>
<key alias="showPageDisabled">Предварительный просмотр запрещен, так как документу не сопоставлен шаблон</key>
<key alias="somethingElse">Другие действия</key>
<key alias="styleChoose">Выбрать стиль</key>
@@ -134,7 +134,7 @@
<key alias="saveToPublish">Spara och skicka för godkännande</key>
<key alias="schedulePublish">Schemaläggning</key>
<key alias="select">Välj</key>
<key alias="showPage">Förhandsgranska</key>
<key alias="saveAndPreview">Förhandsgranska</key>
<key alias="showPageDisabled">Förhandsgranskning är avstängt på grund av att det inte finns någon mall tilldelad</key>
<key alias="somethingElse">Ångra</key>
<key alias="styleChoose">Välj stil</key>
@@ -85,7 +85,7 @@
<key alias="save">Kaydet</key>
<key alias="saveAndPublish">Kaydet ve Yayınla</key>
<key alias="saveToPublish">Kaydet ve Onay için gönder</key>
<key alias="showPage">Önizle</key>
<key alias="saveAndPreview">Önizle</key>
<key alias="showPageDisabled">Önizleme kapalı, Atanmış şablon yok</key>
<key alias="styleChoose">Stili seçin</key>
<key alias="styleShow">Stilleri Göster</key>
@@ -90,7 +90,7 @@
<key alias="saveAndPublish">保存并发布</key>
<key alias="saveToPublish">保存并提交审核</key>
<key alias="saveListView">保存列表视图</key>
<key alias="showPage">预览</key>
<key alias="saveAndPreview">预览</key>
<key alias="showPageDisabled">因未设置模板无法预览</key>
<key alias="styleChoose">选择样式</key>
<key alias="styleShow">显示样式</key>
@@ -87,7 +87,7 @@
<key alias="saveAndPublish">保存並發佈</key>
<key alias="saveToPublish">保存並提交審核</key>
<key alias="saveListView">保存清單檢視</key>
<key alias="showPage">預覽</key>
<key alias="saveAndPreview">預覽</key>
<key alias="showPageDisabled">因未設置範本無法預覽</key>
<key alias="styleChoose">選擇樣式</key>
<key alias="styleShow">顯示樣式</key>
+2 -1
View File
@@ -787,7 +787,8 @@ namespace Umbraco.Web.Editors
/// <returns></returns>
private IEnumerable<SearchResultEntity> ExamineSearch(string query, UmbracoEntityTypes entityType, string searchFrom = null, bool ignoreUserStartNodes = false)
{
return _treeSearcher.ExamineSearch(query, entityType, 200, 0, out _, searchFrom, ignoreUserStartNodes);
var culture = ClientCulture();
return _treeSearcher.ExamineSearch(query, entityType, 200, 0, out _, culture, searchFrom, ignoreUserStartNodes);
}
private IEnumerable<EntityBasic> GetResultForChildren(int id, UmbracoEntityTypes entityType)
@@ -37,9 +37,9 @@ namespace Umbraco.Web.Routing
reason = "No template exists to render the document at url '{0}'.";
response.Write("<html><body><h1>Page not found</h1>");
response.Write("<h3>");
response.Write("<h2>");
response.Write(string.Format(reason, HttpUtility.HtmlEncode(Current.UmbracoContext.OriginalRequestUrl.PathAndQuery)));
response.Write("</h3>");
response.Write("</h2>");
if (string.IsNullOrWhiteSpace(_message) == false)
response.Write("<p>" + _message + "</p>");
response.Write("<p>This page can be replaced with a custom 404. Check the documentation for \"custom 404\".</p>");