Compare commits

..

1 Commits

Author SHA1 Message Date
Warren Buckley 294452a6aa Note this is a POC branch - init work upgrading from v4 to v5 2019-07-29 15:07:03 +01:00
87 changed files with 442 additions and 780 deletions
@@ -203,24 +203,6 @@ namespace Umbraco.Core
/// <remarks>Must be a valid <see cref="ValueTypes"/> value.</remarks>
public const string DataValueType = "umbracoDataValueType";
}
/// <summary>
/// Defines Umbraco's built-in property editor groups.
/// </summary>
public static class Groups
{
public const string Common = "Common";
public const string Lists = "Lists";
public const string Media = "Media";
public const string People = "People";
public const string Pickers = "Pickers";
public const string RichContent = "Rich Content";
}
}
}
}
@@ -30,7 +30,7 @@ namespace Umbraco.Core.PropertyEditors
// defaults
Type = type;
Icon = Constants.Icons.PropertyEditor;
Group = Constants.PropertyEditors.Groups.Common;
Group = "common";
// assign properties based on the attribute, if it is found
Attribute = GetType().GetCustomAttribute<DataEditorAttribute>(false);
@@ -121,7 +121,7 @@ namespace Umbraco.Core.PropertyEditors
/// Gets or sets an optional group.
/// </summary>
/// <remarks>The group can be used for example to group the editors by category.</remarks>
public string Group { get; set; } = Constants.PropertyEditors.Groups.Common;
public string Group { get; set; } = "common";
/// <summary>
/// Gets or sets a value indicating whether the value editor is deprecated.
@@ -5,11 +5,7 @@ namespace Umbraco.Core.PropertyEditors
/// <summary>
/// Represents a property editor for label properties.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.Label,
"Label",
"readonlyvalue",
Icon = "icon-readonly")]
[DataEditor(Constants.PropertyEditors.Aliases.Label, "Label", "readonlyvalue", Icon = "icon-readonly")]
public class LabelPropertyEditor : DataEditor
{
/// <summary>
+1 -1
View File
@@ -45,7 +45,7 @@ namespace Umbraco.Examine
continue;
case string strVal:
{
if (strVal.IsNullOrWhiteSpace()) continue;
if (strVal.IsNullOrWhiteSpace()) return;
var key = $"{keyVal.Key}{cultureSuffix}";
if (values.TryGetValue(key, out var v))
values[key] = new List<object>(v) { val }.ToArray();
@@ -81,19 +81,6 @@ namespace Umbraco.Tests.Routing
Assert.AreEqual(expected, resolvedUrl);
}
[Test]
public void Get_Media_Url_Returns_Absolute_Url_If_Stored_Url_Is_Absolute()
{
const string expected = "http://localhost/media/rfeiw584/test.jpg";
var umbracoContext = GetUmbracoContext("http://localhost", mediaUrlProviders: new[] { _mediaUrlProvider });
var publishedContent = CreatePublishedContent(Constants.PropertyEditors.Aliases.UploadField, expected, null);
var resolvedUrl = umbracoContext.UrlProvider.GetMediaUrl(publishedContent, UrlMode.Relative);
Assert.AreEqual(expected, resolvedUrl);
}
[Test]
public void Get_Media_Url_Returns_Empty_String_When_PropertyType_Is_Not_Supported()
{
@@ -25,23 +25,19 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting
public async Task<Tuple<HttpResponseMessage, string>> Execute(string controllerName, string actionName, HttpMethod method,
HttpContent content = null,
MediaTypeWithQualityHeaderValue mediaTypeHeader = null,
bool assertOkResponse = true, object routeDefaults = null, string url = null)
bool assertOkResponse = true)
{
if (mediaTypeHeader == null)
{
mediaTypeHeader = new MediaTypeWithQualityHeaderValue("application/json");
}
if (routeDefaults == null)
{
routeDefaults = new { controller = controllerName, action = actionName, id = RouteParameter.Optional };
}
var startup = new TestStartup(
configuration =>
{
configuration.Routes.MapHttpRoute("Default",
routeTemplate: "{controller}/{action}/{id}",
defaults: routeDefaults);
defaults: new { controller = controllerName, action = actionName, id = RouteParameter.Optional });
},
_controllerFactory);
@@ -49,7 +45,7 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting
{
var request = new HttpRequestMessage
{
RequestUri = new Uri("https://testserver/" + (url ?? "")),
RequestUri = new Uri("https://testserver/"),
Method = method
};
-1
View File
@@ -243,7 +243,6 @@
<Compile Include="Cache\FullDataSetCachePolicyTests.cs" />
<Compile Include="Cache\SingleItemsOnlyCachePolicyTests.cs" />
<Compile Include="Collections\DeepCloneableListTests.cs" />
<Compile Include="Web\Controllers\AuthenticationControllerTests.cs" />
<Compile Include="Web\Controllers\BackOfficeControllerUnitTests.cs" />
<Compile Include="CoreThings\DelegateExtensionsTests.cs" />
<Compile Include="Web\Controllers\ContentControllerTests.cs" />
@@ -1,139 +0,0 @@
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using System.Security.Cryptography;
using System.Threading;
using System.Web;
using System.Web.Hosting;
using System.Web.Http;
using Moq;
using Newtonsoft.Json;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Services;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.ControllerTesting;
using Umbraco.Tests.Testing;
using Umbraco.Web;
using Umbraco.Web.Editors;
using Umbraco.Web.Features;
using Umbraco.Web.Models.ContentEditing;
using IUser = Umbraco.Core.Models.Membership.IUser;
namespace Umbraco.Tests.Web.Controllers
{
[TestFixture]
[UmbracoTest(Database = UmbracoTestOptions.Database.None)]
public class AuthenticationControllerTests : TestWithDatabaseBase
{
protected override void ComposeApplication(bool withApplication)
{
base.ComposeApplication(withApplication);
//if (!withApplication) return;
// replace the true IUserService implementation with a mock
// so that each test can configure the service to their liking
Composition.RegisterUnique(f => Mock.Of<IUserService>());
// kill the true IEntityService too
Composition.RegisterUnique(f => Mock.Of<IEntityService>());
Composition.RegisterUnique<UmbracoFeatures>();
}
[Test]
public async System.Threading.Tasks.Task GetCurrentUser_Fips()
{
ApiController CtrlFactory(HttpRequestMessage message, IUmbracoContextAccessor umbracoContextAccessor, UmbracoHelper helper)
{
//setup some mocks
var userServiceMock = Mock.Get(Current.Services.UserService);
userServiceMock.Setup(service => service.GetUserById(It.IsAny<int>()))
.Returns(() => null);
if (Thread.GetDomain().GetData(".appPath") != null)
{
HttpContext.Current = new HttpContext(new SimpleWorkerRequest("", "", new StringWriter()));
}
else
{
var baseDir = IOHelper.MapPath("", false).TrimEnd(IOHelper.DirSepChar);
HttpContext.Current = new HttpContext(new SimpleWorkerRequest("/", baseDir, "", "", new StringWriter()));
}
IOHelper.ForceNotHosted = true;
var usersController = new AuthenticationController(
Factory.GetInstance<IGlobalSettings>(),
umbracoContextAccessor,
Factory.GetInstance<ISqlContext>(),
Factory.GetInstance<ServiceContext>(),
Factory.GetInstance<AppCaches>(),
Factory.GetInstance<IProfilingLogger>(),
Factory.GetInstance<IRuntimeState>(),
helper);
return usersController;
}
Mock.Get(Current.SqlContext)
.Setup(x => x.Query<IUser>())
.Returns(new Query<IUser>(Current.SqlContext));
var syntax = new SqlCeSyntaxProvider();
Mock.Get(Current.SqlContext)
.Setup(x => x.SqlSyntax)
.Returns(syntax);
var mappers = new MapperCollection(new[]
{
new UserMapper(new Lazy<ISqlContext>(() => Current.SqlContext), new ConcurrentDictionary<Type, ConcurrentDictionary<string, string>>())
});
Mock.Get(Current.SqlContext)
.Setup(x => x.Mappers)
.Returns(mappers);
// Testing what happens if the system were configured to only use FIPS-compliant algorithms
var typ = typeof(CryptoConfig);
var flds = typ.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
var haveFld = flds.FirstOrDefault(f => f.Name == "s_haveFipsAlgorithmPolicy");
var isFld = flds.FirstOrDefault(f => f.Name == "s_fipsAlgorithmPolicy");
var originalFipsValue = CryptoConfig.AllowOnlyFipsAlgorithms;
try
{
if (!originalFipsValue)
{
haveFld.SetValue(null, true);
isFld.SetValue(null, true);
}
var runner = new TestRunner(CtrlFactory);
var response = await runner.Execute("Authentication", "GetCurrentUser", HttpMethod.Get);
var obj = JsonConvert.DeserializeObject<UserDetail>(response.Item2);
Assert.AreEqual(-1, obj.UserId);
}
finally
{
if (!originalFipsValue)
{
haveFld.SetValue(null, false);
isFld.SetValue(null, false);
}
}
}
}
}
@@ -4,8 +4,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Reflection;
using System.Security.Cryptography;
using System.Web.Http;
using Moq;
using Newtonsoft.Json;
@@ -157,7 +155,7 @@ namespace Umbraco.Tests.Web.Controllers
var runner = new TestRunner(CtrlFactory);
var response = await runner.Execute("Users", "GetPagedUsers", HttpMethod.Get);
var obj = JsonConvert.DeserializeObject<PagedResult<UserBasic>>(response.Item2);
var obj = JsonConvert.DeserializeObject<PagedResult<UserDisplay>>(response.Item2);
Assert.AreEqual(0, obj.TotalItems);
}
@@ -192,100 +190,9 @@ namespace Umbraco.Tests.Web.Controllers
var runner = new TestRunner(CtrlFactory);
var response = await runner.Execute("Users", "GetPagedUsers", HttpMethod.Get);
var obj = JsonConvert.DeserializeObject<PagedResult<UserBasic>>(response.Item2);
var obj = JsonConvert.DeserializeObject<PagedResult<UserDisplay>>(response.Item2);
Assert.AreEqual(10, obj.TotalItems);
Assert.AreEqual(10, obj.Items.Count());
}
[Test]
public async System.Threading.Tasks.Task GetPagedUsers_Fips()
{
await RunFipsTest("GetPagedUsers", mock =>
{
var users = MockedUser.CreateMulipleUsers(10);
long outVal = 10;
mock.Setup(service => service.GetAll(
It.IsAny<long>(), It.IsAny<int>(), out outVal, It.IsAny<string>(), It.IsAny<Direction>(),
It.IsAny<UserState[]>(), It.IsAny<string[]>(), It.IsAny<string[]>(), It.IsAny<IQuery<IUser>>()))
.Returns(() => users);
}, response =>
{
var obj = JsonConvert.DeserializeObject<PagedResult<UserBasic>>(response.Item2);
Assert.AreEqual(10, obj.TotalItems);
Assert.AreEqual(10, obj.Items.Count());
});
}
[Test]
public async System.Threading.Tasks.Task GetById_Fips()
{
const int mockUserId = 1234;
var user = MockedUser.CreateUser();
await RunFipsTest("GetById", mock =>
{
mock.Setup(service => service.GetUserById(1234))
.Returns((int i) => i == mockUserId ? user : null);
}, response =>
{
var obj = JsonConvert.DeserializeObject<UserDisplay>(response.Item2);
Assert.AreEqual(user.Username, obj.Username);
Assert.AreEqual(user.Email, obj.Email);
}, new { controller = "Users", action = "GetById" }, $"Users/GetById/{mockUserId}");
}
private async System.Threading.Tasks.Task RunFipsTest(string action, Action<Mock<IUserService>> userServiceSetup,
Action<Tuple<HttpResponseMessage, string>> verification,
object routeDefaults = null, string url = null)
{
ApiController CtrlFactory(HttpRequestMessage message, IUmbracoContextAccessor umbracoContextAccessor, UmbracoHelper helper)
{
//setup some mocks
var userServiceMock = Mock.Get(Current.Services.UserService);
userServiceSetup(userServiceMock);
var usersController = new UsersController(
Factory.GetInstance<IGlobalSettings>(),
umbracoContextAccessor,
Factory.GetInstance<ISqlContext>(),
Factory.GetInstance<ServiceContext>(),
Factory.GetInstance<AppCaches>(),
Factory.GetInstance<IProfilingLogger>(),
Factory.GetInstance<IRuntimeState>(),
helper);
return usersController;
}
// Testing what happens if the system were configured to only use FIPS-compliant algorithms
var typ = typeof(CryptoConfig);
var flds = typ.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
var haveFld = flds.FirstOrDefault(f => f.Name == "s_haveFipsAlgorithmPolicy");
var isFld = flds.FirstOrDefault(f => f.Name == "s_fipsAlgorithmPolicy");
var originalFipsValue = CryptoConfig.AllowOnlyFipsAlgorithms;
try
{
if (!originalFipsValue)
{
haveFld.SetValue(null, true);
isFld.SetValue(null, true);
}
MockForGetPagedUsers();
var runner = new TestRunner(CtrlFactory);
var response = await runner.Execute("Users", action, HttpMethod.Get, routeDefaults: routeDefaults, url: url);
verification(response);
}
finally
{
if (!originalFipsValue)
{
haveFld.SetValue(null, false);
isFld.SetValue(null, false);
}
}
}
}
}
@@ -23,7 +23,7 @@ module.exports = function(files, out) {
// sort files in stream by path or any custom sort comparator
task = task.pipe(babel())
.pipe(sort())
.pipe(embedTemplates({ basePath: "./src/", minimize:{ loose: true } }))
.pipe(embedTemplates({ basePath: "./src/" }))
.pipe(concat(out))
.pipe(wrap('(function(){\n%= body %\n})();'))
.pipe(gulp.dest(config.root + config.targets.js));
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -39,7 +39,7 @@
"npm": "^6.4.1",
"signalr": "2.4.0",
"spectrum-colorpicker": "1.8.0",
"tinymce": "4.9.2",
"tinymce": "^5.0.12",
"typeahead.js": "0.11.1",
"underscore": "1.9.1"
},
@@ -1,7 +1,7 @@
(function () {
'use strict';
function ContentNodeInfoDirective($timeout, logResource, eventsService, userService, localizationService, dateHelper, editorService, redirectUrlsResource, overlayService, entityResource) {
function ContentNodeInfoDirective($timeout, logResource, eventsService, userService, localizationService, dateHelper, editorService, redirectUrlsResource, overlayService) {
function link(scope) {
@@ -16,12 +16,8 @@
scope.disableTemplates = Umbraco.Sys.ServerVariables.features.disabledFeatures.disableTemplates;
scope.allowChangeDocumentType = false;
scope.allowChangeTemplate = false;
scope.allTemplates = [];
function onInit() {
entityResource.getAll("Template").then(function (templates) {
scope.allTemplates = templates;
});
// set currentVariant
scope.currentVariant = _.find(scope.node.variants, (v) => v.active);
@@ -162,12 +158,8 @@
}
scope.openTemplate = function () {
var template = _.findWhere(scope.allTemplates, {alias: scope.node.template})
if (!template) {
return;
}
var templateEditor = {
id: template.id,
id: scope.node.templateId,
submit: function (model) {
editorService.close();
},
@@ -1,7 +1,7 @@
(function () {
'use strict';
function EditorContentHeader(serverValidationManager, localizationService, editorState) {
function EditorContentHeader(serverValidationManager) {
function link(scope, el, attr, ctrl) {
@@ -13,24 +13,7 @@
if (!scope.serverValidationAliasField) {
scope.serverValidationAliasField = "Alias";
}
scope.isNew = scope.content.state == "NotCreated";
localizationService.localizeMany([
scope.isNew ? "placeholders_a11yCreateItem" : "placeholders_a11yEdit",
"placeholders_a11yName"]
).then(function (data) {
scope.a11yMessage = data[0];
scope.a11yName = data[1];
if (!scope.isNew) {
scope.a11yMessage += " " + scope.content.name;
} else {
var name = editorState.current.contentTypeName;
scope.a11yMessage += " " + name;
scope.a11yName = name + " " + scope.a11yName;
}
});
scope.vm = {};
scope.vm.dropdownOpen = false;
scope.vm.currentVariant = "";
@@ -16,7 +16,9 @@
editor.moveRight = true;
editor.level = 0;
editor.styleIndex = 0;
editor.infinityMode = true;
// push the new editor to the dom
scope.editors.push(editor);
@@ -133,7 +133,7 @@ function entityResource($q, $http, umbRequestHelper) {
* ##usage
* <pre>
* //get media by id
* entityResource.getById(0, "Media")
* entityResource.getEntityById(0, "Media")
* .then(function(ent) {
* var myDoc = ent;
* alert('its here!');
@@ -204,7 +204,7 @@ function entityResource($q, $http, umbRequestHelper) {
* ##usage
* <pre>
* //Get templates for ids
* entityResource.getByIds( [1234,2526,28262], "Template")
* entityResource.getEntitiesByIds( [1234,2526,28262], "Template")
* .then(function(templateArray) {
* var myDoc = contentArray;
* alert('they are here!');
@@ -261,7 +261,7 @@ When building a custom infinite editor view you can use the same components as a
*/
unbindKeyboardShortcuts();
// set flag so we know when the editor is open in "infinite mode"
// set flag so we know when the editor is open in "infinie mode"
editor.infiniteMode = true;
editors.push(editor);
@@ -195,7 +195,8 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
//distraction-free = Theme: inlite, inline: true
switch (args.mode) {
case "classic":
modeTheme = "modern";
//modeTheme = "modern";
modeTheme = "silver";
modeInline = false;
break;
@@ -206,7 +207,8 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
default:
//Will default to 'classic'
modeTheme = "modern";
//modeTheme = "modern";
modeTheme = "silver";
modeInline = false;
break;
}
@@ -336,10 +338,10 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
* @param {Object} editor the TinyMCE editor instance
*/
createInsertEmbeddedMedia: function (editor, callback) {
editor.addButton('umbembeddialog', {
editor.ui.registry.addButton('umbembeddialog', {
icon: 'custom icon-tv',
tooltip: 'Embed',
onclick: function () {
onAction: function (buttonApi) {
if (callback) {
angularHelper.safeApply($rootScope, function() {
callback();
@@ -356,10 +358,10 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
createAceCodeEditor: function(editor, callback){
editor.addButton("ace", {
editor.ui.registry.addButton("ace", {
icon: "code",
tooltip: "View Source Code",
onclick: function(){
onAction: function(buttonApi){
if (callback) {
angularHelper.safeApply($rootScope, function() {
callback();
@@ -381,11 +383,11 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
* @param {Object} editor the TinyMCE editor instance
*/
createMediaPicker: function (editor, callback) {
editor.addButton('umbmediapicker', {
editor.ui.registry.addButton('umbmediapicker', {
icon: 'custom icon-picture',
tooltip: 'Media Picker',
stateSelector: 'img',
onclick: function () {
onAction: function (buttonApi) {
var selectedElm = editor.selection.getNode(),
@@ -428,7 +430,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
id: '__mcenew',
'data-udi': img.udi
};
editor.selection.setContent(editor.dom.createHTML('img', data));
$timeout(function () {
@@ -447,9 +449,9 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
}
}
editor.dom.setAttrib(imgElm, 'id', null);
editor.fire('Change');
}, 500);
}
},
@@ -515,13 +517,13 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
}
/** Adds the button instance */
editor.addButton('umbmacro', {
editor.ui.registry.addButton('umbmacro', {
icon: 'custom icon-settings-alt',
tooltip: 'Insert macro',
onPostRender: function () {
let ctrl = this;
/**
* Check if the macro is currently selected and toggle the menu button
*/
@@ -543,7 +545,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
},
/** The insert macro button click event handler */
onclick: function () {
onAction: function (buttonApi) {
var dialogData = {
//flag for use in rte so we only show macros flagged for the editor
@@ -865,29 +867,29 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
});
}
editor.addButton('link', {
editor.ui.registry.addButton('link', {
icon: 'link',
tooltip: 'Insert/edit link',
shortcut: 'Ctrl+K',
onclick: createLinkList(showDialog),
onAction: createLinkList(showDialog),
stateSelector: 'a[href]'
});
editor.addButton('unlink', {
icon: 'unlink',
tooltip: 'Remove link',
cmd: 'unlink',
stateSelector: 'a[href]'
});
// editor.ui.registry.addButton('unlink', {
// icon: 'unlink',
// tooltip: 'Remove link',
// cmd: 'unlink',
// stateSelector: 'a[href]'
// });
editor.addShortcut('Ctrl+K', '', createLinkList(showDialog));
this.showDialog = showDialog;
editor.addMenuItem('link', {
editor.ui.registry.addMenuItem('link', {
icon: 'link',
text: 'Insert link',
shortcut: 'Ctrl+K',
onclick: createLinkList(showDialog),
onAction: createLinkList(showDialog),
stateSelector: 'a[href]',
context: 'insert',
prependToContext: true
@@ -1134,7 +1136,7 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
};
editorService.linkPicker(linkPicker);
});
});
//Create the insert media plugin
@@ -17,7 +17,7 @@
z-index: @zIndexEditor;
}
.umb-editor--infiniteMode {
.umb-editor--infinityMode {
transform: none;
will-change: transform;
transition: transform 400ms ease-in-out;
@@ -94,7 +94,6 @@
font-size: 14px;
color: @black;
margin-left: 10px;
text-align: left;
}
small {
@@ -268,7 +268,7 @@ angular.module("umbraco")
// also make sure the node is not trashed
if (nodePath.indexOf($scope.startNodeId.toString()) !== -1 && node.trashed === false) {
$scope.gotoFolder({ id: $scope.lastOpenedNode, name: "Media", icon: "icon-folder", path: node.path });
$scope.gotoFolder({ id: $scope.lastOpenedNode, name: "Media", icon: "icon-folder" });
return true;
} else {
$scope.gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" });
@@ -11,30 +11,24 @@
<div class="flex items-center" style="flex: 1;">
<div id="nameField" class="umb-editor-header__name-and-description" style="flex: 1 1 auto;">
<div>
<p tabindex="0" class="sr-only">
{{a11yMessage}}
</p>
</div>
<div class="umb-editor-header__name-wrapper">
<label for="headerName" class="sr-only">{{a11yName}}</label>
<ng-form name="headerNameForm">
<input data-element="editor-name-field"
type="text"
class="umb-editor-header__name-input"
localize="placeholder"
placeholder="@placeholders_entername"
name="headerName"
id="headerName"
ng-model="name"
ng-class="{'name-is-empty': $parent.name===null || $parent.name===''}"
ng-disabled="nameDisabled"
umb-auto-focus
val-server-field="{{serverValidationNameField}}"
required
aria-required="true"
aria-invalid="{{contentForm.headerNameForm.headerName.$invalid ? true : false}}"
autocomplete="off" maxlength="255" />
<input
data-element="editor-name-field"
type="text"
class="umb-editor-header__name-input"
localize="placeholder"
placeholder="@placeholders_entername"
name="headerName"
ng-model="name"
ng-class="{'name-is-empty': $parent.name===null || $parent.name===''}"
ng-disabled="nameDisabled"
umb-auto-focus
val-server-field="{{serverValidationNameField}}"
required
aria-required="true"
aria-invalid="{{contentForm.headerNameForm.headerName.$invalid ? true : false}}"
autocomplete="off" maxlength="255" />
</ng-form>
<a ng-if="content.variants.length > 0 && hideChangeVariant !== true" class="umb-variant-switcher__toggle" href="" ng-click="vm.dropdownOpen = !vm.dropdownOpen" ng-class="{'--error': vm.errorsOnOtherVariants}">
@@ -5,7 +5,7 @@
ng-class="{'umb-editor--small': model.size === 'small',
'umb-editor--animating': model.animating,
'--notInFront': model.inFront !== true,
'umb-editor--infiniteMode': model.infiniteMode,
'umb-editor--infinityMode': model.infinityMode,
'moveRight': model.moveRight,
'umb-editor--n0': model.styleIndex === 0,
'umb-editor--n1': model.styleIndex === 1,
@@ -32,7 +32,7 @@
</div>
<div class="text-center" ng-if="(availableItems | compareArrays:selectedItems:'alias').length === 0">
<small><localize key="general_all">All</localize> {{itemLabel}}s <localize key="grid_areAdded">are added</localize></small>
<small><localize key="general_all">Akk</localize> {{itemLabel}}s <localize key="grid_areAdded">are added</localize></small>
</div>
</div>
@@ -94,11 +94,6 @@ function contentCreateController($scope,
navigationService.hideDialog(showMenu);
};
$scope.editContentType = function() {
$location.path("/settings/documenttypes/edit/" + $scope.contentTypeId).search("view", "permissions");
close();
}
$scope.createBlank = createBlank;
$scope.createOrSelectBlueprintIfAny = createOrSelectBlueprintIfAny;
$scope.createFromBlueprint = createFromBlueprint;
@@ -24,7 +24,7 @@ function ContentEditController($scope, $routeParams, contentResource) {
$scope.page = $routeParams.page;
$scope.isNew = infiniteMode ? $scope.model.create : $routeParams.create;
//load the default culture selected in the main tree if any
$scope.culture = $routeParams.cculture ? $routeParams.cculture : $routeParams.mculture;
$scope.culture = $routeParams.cculture ? $routeParams.cculture : ($routeParams.mculture === "true");
//Bind to $routeUpdate which will execute anytime a location changes but the route is not triggered.
//This is so we can listen to changes on the cculture parameter since that will not cause a route change
@@ -10,7 +10,7 @@
<p class="abstract" ng-if="!hasSettingsAccess"><localize key="create_noDocumentTypesWithNoSettingsAccess"/></p>
<div ng-if="hasSettingsAccess">
<p class="abstract"><localize key="create_noDocumentTypes" /></p>
<button class="btn umb-outline" ng-click="editContentType()">
<button class="btn umb-outline" href="#settings/documentTypes/edit/{{contentTypeId}}?view=permissions" ng-click="close()">
<localize key="create_noDocumentTypesEditPermissions"/>
</button>
</div>
@@ -11,7 +11,7 @@
<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>
<a href="" class="umb-action-link" ng-click="vm.createBlueprint(documentType)" prevent-default>
<i class="large icon {{documentType.icon}}"></i>
<span class="menu-label">
{{documentType.name}}
@@ -19,7 +19,7 @@
{{documentType.description}}
</small>
</span>
</button>
</a>
</li>
</ul>
@@ -6,20 +6,20 @@
<ul class="umb-actions umb-actions-child">
<li data-element="action-data-type" class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="createDataType()" umb-auto-focus>
<a href="" class="umb-action-link" ng-click="createDataType()" umb-auto-focus>
<i class="large icon icon-autofill"></i>
<span class="menu-label">
<localize key="create_newDataType">New data type</localize>
</span>
</button>
</a>
</li>
<li data-element="action-folder" class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="showCreateFolder()">
<a href="" class="umb-action-link" ng-click="showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label">
<localize key="create_newFolder">New folder</localize>...
</span>
</button>
</a>
</li>
</ul>
</div>
@@ -7,36 +7,36 @@
<ul class="umb-actions umb-actions-child">
<li data-element="action-documentType" class="umb-action" ng-hide="model.disableTemplates">
<button href="" ng-click="createDocType()" class="umb-action-link umb-outline btn-reset" umb-auto-focus>
<a href="" ng-click="createDocType()" class="umb-action-link" umb-auto-focus>
<i class="large icon icon-item-arrangement"></i>
<span class="menu-label">
<localize key="content_documentType">Document type</localize>
</span>
</button>
</a>
</li>
<li data-element="action-documentTypeWithoutTemplate" class="umb-action">
<button href="" ng-click="createComponent()" class="umb-action-link umb-outline btn-reset">
<a href="" ng-click="createComponent()" class="umb-action-link">
<i class="large icon 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>
</span>
</button>
</a>
</li>
<li data-element="action-documentTypeCollection" class="umb-action">
<button href="" ng-click="showCreateDocTypeCollection()" class="umb-action-link umb-outline btn-reset">
<a href="" ng-click="showCreateDocTypeCollection()" class="umb-action-link">
<i class="large icon icon-thumbnail-list"></i>
<span class="menu-label">
Document Type Collection...
<!-- <localize key="content_documentType_collection">Document Type Collection</localize>-->
</span>
</button>
</a>
</li>
<li data-element="action-folder" ng-if="model.allowCreateFolder" class="umb-action">
<button href="" ng-click="showCreateFolder()" class="umb-action-link umb-outline btn-reset">
<a href="" ng-click="showCreateFolder()" class="umb-action-link">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</button>
</a>
</li>
</ul>
</div>
@@ -17,13 +17,13 @@
<ul class="umb-actions umb-actions-child">
<li data-element="action-{{docType.alias}}" class="umb-action" ng-repeat="docType in allowedTypes">
<button ng-click="createMediaItem(docType)" class="umb-action-link umb-outline btn-reset" prevent-default>
<a ng-href="" ng-click="createMediaItem(docType)" class="umb-action-link" prevent-default>
<i class="large icon {{docType.icon}}"></i>
<span class="menu-label">
{{docType.name}}
<small>{{docType.description}}</small>
</span>
</button>
</a>
</li>
<!--
<li class="add">
@@ -7,19 +7,19 @@
<ul class="umb-actions umb-actions-child">
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="createMediaType()" umb-auto-focus>
<a href="" class="umb-action-link" ng-click="createMediaType()" umb-auto-focus>
<i class="large icon icon-item-arrangement"></i>
<span class="menu-label">
<localize key="general_new">New</localize>
<localize key="content_mediatype">Media type</localize>
</span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="showCreateFolder()">
<a href="" class="umb-action-link" ng-click="showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</button>
</a>
</li>
</ul>
</div>
@@ -6,13 +6,13 @@
<ul class="umb-actions umb-actions-child">
<li class="umb-action" ng-repeat="docType in allowedTypes">
<button class="umb-action-link umb-outline btn-reset" href="#member/member/edit/{{currentNode.id}}?doctype={{docType.alias}}&create=true" ng-click="hideActions()">
<a class="umb-action-link" href="#member/member/edit/{{currentNode.id}}?doctype={{docType.alias}}&create=true" ng-click="hideActions()">
<i class="large icon {{docType.icon}}"></i>
<span class="menu-label">
{{docType.name}}
<small>{{docType.description}}</small>
</span>
</button>
</a>
</li>
</ul>
@@ -5,13 +5,13 @@
<ul class="umb-actions umb-actions-child">
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="showCreateFolder()">
<a href="" class="umb-action-link" ng-click="showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize></span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="createMemberType()">
<a href="" class="umb-action-link" ng-click="createMemberType()">
<i class="large icon icon-item-arrangement"></i>
@@ -20,7 +20,7 @@
<localize key="content_memberType">Member type</localize>
</span>
</button>
</a>
</li>
</ul>
</div>
@@ -11,28 +11,28 @@
<ul class="umb-actions umb-actions-child">
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.createFile()" umb-auto-focus>
<a href="" class="umb-action-link" ng-click="vm.createFile()" umb-auto-focus>
<i class="large icon-article"></i>
<span class="menu-label"><localize key="create_newPartialViewMacro">New partial view macro</localize></span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.createFileWithoutMacro()">
<a href="" class="umb-action-link" ng-click="vm.createFileWithoutMacro()">
<i class="large icon icon-article"></i>
<span class="menu-label"><localize key="create_newPartialViewMacroNoMacro">New partial view macro (without macro)</localize></span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.showCreateFromSnippet()">
<a href="" class="umb-action-link" ng-click="vm.showCreateFromSnippet()">
<i class="large icon icon-article"></i>
<span class="menu-label"><localize key="create_newPartialViewMacroFromSnippet">>New partial view macro from snippet</localize>...</span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.showCreateFolder()">
<a href="" class="umb-action-link" ng-click="vm.showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</button>
</a>
</li>
</ul>
</div>
@@ -44,10 +44,10 @@
<ul class="umb-actions umb-actions-child">
<li class="umb-action" ng-repeat="snippet in vm.snippets">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.createFileFromSnippet(snippet)" style="padding-top: 6px; padding-bottom: 6px;">
<a href="" class="umb-action-link" ng-click="vm.createFileFromSnippet(snippet)" style="padding-top: 6px; padding-bottom: 6px;">
<i class="icon-article icon" style="font-size: 20px;"></i>
<span class="menu-label" style="margin-left: 0; padding-left: 5px;">{{ snippet.name }}</span>
</button>
</a>
</li>
</ul>
</div>
@@ -10,22 +10,22 @@
<div ng-if="!vm.showSnippets">
<ul class="umb-actions umb-actions-child">
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.createPartialView()" umb-auto-focus>
<a href="" class="umb-action-link" ng-click="vm.createPartialView()" umb-auto-focus>
<i class="large icon icon-article"></i>
<span class="menu-label"><localize key="create_newEmptyPartialView">New empty partial view</localize></span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.showCreateFromSnippet()">
<a href="" class="umb-action-link" ng-click="vm.showCreateFromSnippet()">
<i class="large icon icon-article"></i>
<span class="menu-label"><localize key="create_newPartialViewFromSnippet">New partial view from snippet</localize>...</span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.showCreateFolder()">
<a href="" class="umb-action-link" ng-click="vm.showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</button>
</a>
</li>
</ul>
</div>
@@ -34,10 +34,10 @@
<div ng-if="vm.showSnippets">
<ul class="umb-actions umb-actions-child">
<li class="umb-action" ng-repeat="snippet in vm.snippets">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.createPartialView(snippet)" style="padding-top: 6px; padding-bottom: 6px;">
<a href="" class="umb-action-link" ng-click="vm.createPartialView(snippet)" style="padding-top: 6px; padding-bottom: 6px;">
<i class="icon-article icon" style="font-size: 20px;"></i>
<span class="menu-label" style="margin-left: 0; padding-left: 5px;">{{ snippet.name }}</span>
</button>
</a>
</li>
</ul>
</div>
@@ -1,4 +1,3 @@
//TODO: What is this file? Is it used?? I don't think so
var uSkyGridConfig = [
{
@@ -229,7 +229,7 @@ angular.module('umbraco').controller("Umbraco.PropertyEditors.MediaPickerControl
$scope.sortableOptions = {
disabled: !multiPicker,
disabled: !$scope.isMultiPicker,
items: "li:not(.add-wrapper)",
cancel: ".unsortable",
update: function (e, ui) {
@@ -15,10 +15,6 @@
});
}
$scope.canAdd = function () {
return !$scope.model.docTypes || !$scope.model.value || $scope.model.value.length < $scope.model.docTypes.length;
}
$scope.remove = function (index) {
$scope.model.value.splice(index, 1);
}
@@ -61,20 +57,10 @@
ncResources.getContentTypes().then(function (docTypes) {
$scope.model.docTypes = docTypes;
// Count doctype name occurrences
var docTypeNameOccurrences = _.countBy(docTypes, 'name');
// Populate document type tab dictionary
// And append alias to name if multiple doctypes have the same name
docTypes.forEach(function (value) {
$scope.docTypeTabs[value.alias] = value.tabs;
value.displayName = value.name;
if (docTypeNameOccurrences[value.name] > 1) {
value.displayName += " (" + value.alias + ")";
}
});
});
@@ -23,7 +23,7 @@
</td>
<td>
<select id="{{model.alias}}_doctype_select"
ng-options="dt.alias as dt.displayName for dt in selectableDocTypesFor(config) | orderBy: 'name'"
ng-options="dt.alias as dt.name for dt in selectableDocTypesFor(config) | orderBy: 'name'"
ng-model="config.ncAlias" required></select>
</td>
<td>
@@ -35,17 +35,17 @@
<input type="text" ng-model="config.nameTemplate" />
</td>
<td>
<button type="button" class="btn btn-danger" ng-click="remove($index)">
<a class="btn btn-danger" ng-click="remove($index)">
<localize key="general_delete">Delete</localize>
</button>
</a>
</td>
</tr>
</tbody>
</table>
<div>
<button type="button" class="btn" ng-click="add()" ng-disabled="!canAdd()">
<a class="btn" ng-click="add()">
<localize key="general_add">Add</localize>
</button>
</a>
<i class="icon icon-help-alt medium umb-nested-content__help-icon" ng-click="showHelpText = !showHelpText"></i>
</div>
</div>
@@ -48,18 +48,19 @@ angular.module("umbraco")
$q.all(promises).then(function (result) {
var standardConfig = result[promises.length - 1];
if (height !== null) {
standardConfig.plugins.splice(standardConfig.plugins.indexOf("autoresize"), 1);
}
//create a baseline Config to extend upon
var baseLineConfigObj = {
maxImageSize: editorConfig.maxImageSize,
width: width,
height: height
maxImageSize: editorConfig.maxImageSize
//width: width,
//height: height
};
angular.extend(baseLineConfigObj, standardConfig);
baseLineConfigObj.setup = function (editor) {
@@ -1,6 +1,6 @@
<div ng-controller="Umbraco.PropertyEditors.RTEController" class="umb-property-editor umb-rte">
<umb-load-indicator ng-if="isLoading"></umb-load-indicator>
<div ng-style="{ visibility : isLoading ? 'hidden' : 'visible', width :containerWidth, height: containerHeight, overflow: containerOverflow}"
<div ng-style="{ visibility : isLoading ? 'hidden' : 'visible', overflow: containerOverflow}"
id="{{textAreaHtmlId}}" class="umb-rte-editor"></div>
</div>
@@ -7,16 +7,16 @@
<ul class="umb-actions umb-actions-child">
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" umb-auto-focus ng-click="vm.createFile()">
<a href="" class="umb-action-link" umb-auto-focus ng-click="vm.createFile()">
<i class="large icon icon-script"></i>
<span class="menu-label"><localize key="create_newJavascriptFile">New javascript file</localize></span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.showCreateFolder()">
<a href="" class="umb-action-link" ng-click="vm.showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</button>
</a>
</li>
</ul>
@@ -7,22 +7,22 @@
<ul class="umb-actions umb-actions-child">
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" umb-auto-focus ng-click="vm.createFile()">
<a href="" class="umb-action-link" umb-auto-focus ng-click="vm.createFile()">
<i class="large icon icon-script"></i>
<span class="menu-label"><localize key="create_newStyleSheetFile">New style sheet file</localize></span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" ng-click="vm.createRichtextStyle()" class="umb-action-link umb-outline btn-reset">
<a href="" ng-click="vm.createRichtextStyle()" class="umb-action-link">
<i class="large icon icon-script"></i>
<span class="menu-label"><localize key="create_newRteStyleSheetFile">New richtext style sheet file</localize></span>
</button>
</a>
</li>
<li class="umb-action">
<button href="" class="umb-action-link umb-outline btn-reset" ng-click="vm.showCreateFolder()">
<a href="" class="umb-action-link" ng-click="vm.showCreateFolder()">
<i class="large icon icon-folder"></i>
<span class="menu-label"><localize key="general_folder"></localize>...</span>
</button>
</a>
</li>
</ul>
@@ -90,7 +90,6 @@
ng-repeat="node in model.user.startContentIds"
icon="node.icon"
name="node.name"
allow-remove="true"
on-remove="model.removeSelectedItem($index, model.user.startContentIds)">
</umb-node-preview>
@@ -115,7 +114,6 @@
ng-repeat="node in model.user.startMediaIds"
icon="node.icon"
name="node.name"
allow-remove="true"
on-remove="model.removeSelectedItem($index, model.user.startMediaIds)">
</umb-node-preview>
@@ -527,9 +527,6 @@
<key alias="anchor">#value or ?key=value</key>
<key alias="enterAlias">Enter alias...</key>
<key alias="generatingAlias">Generating alias...</key>
<key alias="a11yCreateItem">Create item</key>
<key alias="a11yEdit">Edit</key>
<key alias="a11yName">Name</key>
</area>
<area alias="editcontenttype">
<key alias="createListView" version="7.2">Create custom list view</key>
@@ -530,9 +530,6 @@
<key alias="anchor">#value or ?key=value</key>
<key alias="enterAlias">Enter alias...</key>
<key alias="generatingAlias">Generating alias...</key>
<key alias="a11yCreateItem">Create item</key>
<key alias="a11yEdit">Edit</key>
<key alias="a11yName">Name</key>
</area>
<area alias="editcontenttype">
<key alias="createListView" version="7.2">Create custom list view</key>
@@ -1,7 +1,6 @@
using System;
using Umbraco.Core.Cache;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence.Repositories;
using Umbraco.Core.Services;
namespace Umbraco.Web.Cache
@@ -9,13 +8,11 @@ namespace Umbraco.Web.Cache
public sealed class TemplateCacheRefresher : CacheRefresherBase<TemplateCacheRefresher>
{
private readonly IdkMap _idkMap;
private readonly IContentTypeCommonRepository _contentTypeCommonRepository;
public TemplateCacheRefresher(AppCaches appCaches, IdkMap idkMap, IContentTypeCommonRepository contentTypeCommonRepository)
public TemplateCacheRefresher(AppCaches appCaches, IdkMap idkMap)
: base(appCaches)
{
_idkMap = idkMap;
_contentTypeCommonRepository = contentTypeCommonRepository;
}
#region Define
@@ -48,7 +45,6 @@ namespace Umbraco.Web.Cache
// it has an associated template.
ClearAllIsolatedCacheByEntityType<IContent>();
ClearAllIsolatedCacheByEntityType<IContentType>();
_contentTypeCommonRepository.ClearCache();
base.Remove(id);
}
@@ -301,7 +301,7 @@ namespace Umbraco.Web.Models.Mapping
target.Avatars = source.GetUserAvatarUrls(_appCaches.RuntimeCache);
target.Culture = source.GetUserCulture(_textService, _globalSettings).ToString();
target.Email = source.Email;
target.EmailHash = source.Email.ToLowerInvariant().Trim().GenerateHash();
target.EmailHash = source.Email.ToLowerInvariant().Trim().ToMd5();
target.Id = source.Id;
target.Key = source.Key;
target.LastLoginDate = source.LastLoginDate == default ? null : (DateTime?) source.LastLoginDate;
@@ -8,12 +8,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// A property editor to allow multiple checkbox selection of pre-defined items.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.CheckBoxList,
"Checkbox list",
"checkboxlist",
Icon = "icon-bulleted-list",
Group = Constants.PropertyEditors.Groups.Lists)]
[DataEditor(Constants.PropertyEditors.Aliases.CheckBoxList, "Checkbox list", "checkboxlist", Icon="icon-bulleted-list", Group="lists")]
public class CheckBoxListPropertyEditor : DataEditor
{
private readonly ILocalizedTextService _textService;
@@ -4,12 +4,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.ColorPicker,
"Color Picker",
"colorpicker",
Icon = "icon-colorpicker",
Group = Constants.PropertyEditors.Groups.Pickers)]
[DataEditor(Constants.PropertyEditors.Aliases.ColorPicker, "Color Picker", "colorpicker", Icon="icon-colorpicker", Group="Pickers")]
public class ColorPickerPropertyEditor : DataEditor
{
public ColorPickerPropertyEditor(ILogger logger)
@@ -8,13 +8,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Content property editor that stores UDI
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.ContentPicker,
EditorType.PropertyValue | EditorType.MacroParameter,
"Content Picker",
"contentpicker",
ValueType = ValueTypes.String,
Group = Constants.PropertyEditors.Groups.Pickers)]
[DataEditor(Constants.PropertyEditors.Aliases.ContentPicker, EditorType.PropertyValue | EditorType.MacroParameter, "Content Picker", "contentpicker", ValueType = ValueTypes.String, Group = "Pickers")]
public class ContentPickerPropertyEditor : DataEditor
{
public ContentPickerPropertyEditor(ILogger logger)
@@ -7,12 +7,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a date and time property editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.DateTime,
"Date/Time",
"datepicker",
ValueType = ValueTypes.DateTime,
Icon = "icon-time")]
[DataEditor(Constants.PropertyEditors.Aliases.DateTime, "Date/Time", "datepicker", ValueType = ValueTypes.DateTime, Icon="icon-time")]
public class DateTimePropertyEditor : DataEditor
{
/// <summary>
@@ -8,12 +8,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a decimal property and parameter editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.Decimal,
EditorType.PropertyValue | EditorType.MacroParameter,
"Decimal",
"decimal",
ValueType = ValueTypes.Decimal)]
[DataEditor(Constants.PropertyEditors.Aliases.Decimal, EditorType.PropertyValue | EditorType.MacroParameter, "Decimal", "decimal", ValueType = ValueTypes.Decimal)]
public class DecimalPropertyEditor : DataEditor
{
/// <summary>
@@ -5,12 +5,7 @@ using Umbraco.Core.Services;
namespace Umbraco.Web.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.DropDownListFlexible,
"Dropdown",
"dropdownFlexible",
Group = Constants.PropertyEditors.Groups.Lists,
Icon = "icon-indent")]
[DataEditor(Constants.PropertyEditors.Aliases.DropDownListFlexible, "Dropdown", "dropdownFlexible", Group = "lists", Icon = "icon-indent")]
public class DropDownFlexiblePropertyEditor : DataEditor
{
private readonly ILocalizedTextService _textService;
@@ -5,12 +5,7 @@ using Umbraco.Core.PropertyEditors.Validators;
namespace Umbraco.Web.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.EmailAddress,
EditorType.PropertyValue | EditorType.MacroParameter,
"Email address",
"email",
Icon = "icon-message")]
[DataEditor(Constants.PropertyEditors.Aliases.EmailAddress, EditorType.PropertyValue | EditorType.MacroParameter, "Email address", "email", Icon="icon-message")]
public class EmailAddressPropertyEditor : DataEditor
{
/// <summary>
@@ -12,12 +12,7 @@ using Umbraco.Web.Media;
namespace Umbraco.Web.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.UploadField,
"File upload",
"fileupload",
Group = Constants.PropertyEditors.Groups.Media,
Icon = "icon-download-alt")]
[DataEditor(Constants.PropertyEditors.Aliases.UploadField, "File upload", "fileupload", Icon = "icon-download-alt", Group = "media")]
public class FileUploadPropertyEditor : DataEditor
{
private readonly IMediaFileSystem _mediaFileSystem;
@@ -12,14 +12,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a grid property and parameter editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.Grid,
"Grid layout",
"grid",
HideLabel = true,
ValueType = ValueTypes.Json,
Icon = "icon-layout",
Group = Constants.PropertyEditors.Groups.RichContent)]
[DataEditor(Constants.PropertyEditors.Aliases.Grid, "Grid layout", "grid", HideLabel = true, ValueType = ValueTypes.Json, Group="rich content", Icon="icon-layout")]
public class GridPropertyEditor : DataEditor
{
public GridPropertyEditor(ILogger logger)
@@ -19,14 +19,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents an image cropper property editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.ImageCropper,
"Image Cropper",
"imagecropper",
ValueType = ValueTypes.Json,
HideLabel = false,
Group = Constants.PropertyEditors.Groups.Media,
Icon = "icon-crop")]
[DataEditor(Constants.PropertyEditors.Aliases.ImageCropper, "Image Cropper", "imagecropper", ValueType = ValueTypes.Json, HideLabel = false, Group="media", Icon="icon-crop")]
public class ImageCropperPropertyEditor : DataEditor
{
private readonly IMediaFileSystem _mediaFileSystem;
@@ -8,12 +8,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents an integer property and parameter editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.Integer,
EditorType.PropertyValue | EditorType.MacroParameter,
"Numeric",
"integer",
ValueType = ValueTypes.Integer)]
[DataEditor(Constants.PropertyEditors.Aliases.Integer, EditorType.PropertyValue | EditorType.MacroParameter, "Numeric", "integer", ValueType = ValueTypes.Integer)]
public class IntegerPropertyEditor : DataEditor
{
public IntegerPropertyEditor(ILogger logger)
@@ -8,13 +8,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a list-view editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.ListView,
"List view",
"listview",
HideLabel = true,
Group = Constants.PropertyEditors.Groups.Lists,
Icon = Constants.Icons.ListView)]
[DataEditor(Constants.PropertyEditors.Aliases.ListView, "List view", "listview", HideLabel = true, Group = "lists", Icon = Constants.Icons.ListView)]
public class ListViewPropertyEditor : DataEditor
{
/// <summary>
@@ -5,14 +5,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
// TODO: MacroContainerPropertyEditor is deprecated, but what's the alternative?
[DataEditor(
Constants.PropertyEditors.Aliases.MacroContainer,
"(Obsolete) Macro Picker",
"macrocontainer",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.RichContent,
Icon = Constants.Icons.Macro,
IsDeprecated = true)]
[DataEditor(Constants.PropertyEditors.Aliases.MacroContainer, "(Obsolete) Macro Picker", "macrocontainer", ValueType = ValueTypes.Text, Group = "rich content", Icon = Constants.Icons.Macro, IsDeprecated = true)]
public class MacroContainerPropertyEditor : DataEditor
{
public MacroContainerPropertyEditor(ILogger logger)
@@ -7,13 +7,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a markdown editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.MarkdownEditor,
"Markdown editor",
"markdowneditor",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.RichContent,
Icon = "icon-code")]
[DataEditor(Constants.PropertyEditors.Aliases.MarkdownEditor, "Markdown editor", "markdowneditor", ValueType = ValueTypes.Text, Icon="icon-code", Group="rich content")]
public class MarkdownPropertyEditor : DataEditor
{
/// <summary>
@@ -7,14 +7,8 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a media picker property editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.MediaPicker,
EditorType.PropertyValue | EditorType.MacroParameter,
"Media Picker",
"mediapicker",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.Media,
Icon = Constants.Icons.MediaImage)]
[DataEditor(Constants.PropertyEditors.Aliases.MediaPicker, EditorType.PropertyValue | EditorType.MacroParameter,
"Media Picker", "mediapicker", ValueType = ValueTypes.Text, Group = "media", Icon = Constants.Icons.MediaImage)]
public class MediaPickerPropertyEditor : DataEditor
{
/// <summary>
@@ -4,13 +4,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.MemberGroupPicker,
"Member Group Picker",
"membergrouppicker",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.People,
Icon = Constants.Icons.MemberGroup)]
[DataEditor(Constants.PropertyEditors.Aliases.MemberGroupPicker, "Member Group Picker", "membergrouppicker", ValueType = ValueTypes.Text, Group = "People", Icon = Constants.Icons.MemberGroup)]
public class MemberGroupPickerPropertyEditor : DataEditor
{
public MemberGroupPickerPropertyEditor(ILogger logger)
@@ -4,13 +4,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.MemberPicker,
"Member Picker",
"memberpicker",
ValueType = ValueTypes.String,
Group = Constants.PropertyEditors.Groups.People,
Icon = Constants.Icons.Member)]
[DataEditor(Constants.PropertyEditors.Aliases.MemberPicker, "Member Picker", "memberpicker", ValueType = ValueTypes.String, Group = "People", Icon = Constants.Icons.Member)]
public class MemberPickerPropertyEditor : DataEditor
{
public MemberPickerPropertyEditor(ILogger logger)
@@ -4,13 +4,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.MultiNodeTreePicker,
"Multinode Treepicker",
"contentpicker",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.Pickers,
Icon = "icon-page-add")]
[DataEditor(Constants.PropertyEditors.Aliases.MultiNodeTreePicker, "Multinode Treepicker", "contentpicker", ValueType = ValueTypes.Text, Group = "pickers", Icon = "icon-page-add")]
public class MultiNodeTreePickerPropertyEditor : DataEditor
{
public MultiNodeTreePickerPropertyEditor(ILogger logger)
@@ -7,14 +7,7 @@ using Umbraco.Web.PublishedCache;
namespace Umbraco.Web.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.MultiUrlPicker,
EditorType.PropertyValue,
"Multi Url Picker",
"multiurlpicker",
ValueType = ValueTypes.Json,
Group = Constants.PropertyEditors.Groups.Pickers,
Icon = "icon-link")]
[DataEditor(Constants.PropertyEditors.Aliases.MultiUrlPicker, EditorType.PropertyValue, "Multi Url Picker", "multiurlpicker", ValueType = ValueTypes.Json, Group = "pickers", Icon = "icon-link")]
public class MultiUrlPickerPropertyEditor : DataEditor
{
private readonly IEntityService _entityService;
@@ -13,13 +13,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a multiple text string property editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.MultipleTextstring,
"Repeatable textstrings",
"multipletextbox",
ValueType = ValueTypes.Text,
Group = Constants.PropertyEditors.Groups.Lists,
Icon = "icon-ordered-list")]
[DataEditor(Constants.PropertyEditors.Aliases.MultipleTextstring, "Repeatable textstrings", "multipletextbox", ValueType = ValueTypes.Text, Icon="icon-ordered-list", Group="lists")]
public class MultipleTextStringPropertyEditor : DataEditor
{
/// <summary>
@@ -18,13 +18,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a nested content property editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.NestedContent,
"Nested Content",
"nestedcontent",
ValueType = ValueTypes.Json,
Group = Constants.PropertyEditors.Groups.Lists,
Icon = "icon-thumbnail-list")]
[DataEditor(Constants.PropertyEditors.Aliases.NestedContent, "Nested Content", "nestedcontent", ValueType = "JSON", Group = "lists", Icon = "icon-thumbnail-list")]
public class NestedContentPropertyEditor : DataEditor
{
private readonly Lazy<PropertyEditorCollection> _propertyEditors;
@@ -6,11 +6,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
/// <summary>
/// Represents a content type parameter editor.
/// </summary>
[DataEditor(
"contentType",
EditorType.MacroParameter,
"Content Type Picker",
"entitypicker")]
[DataEditor("contentType", EditorType.MacroParameter, "Content Type Picker", "entitypicker")]
public class ContentTypeParameterEditor : DataEditor
{
/// <summary>
@@ -7,11 +7,7 @@ namespace Umbraco.Web.PropertyEditors.ParameterEditors
/// <summary>
/// Represents a parameter editor of some sort.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.MultiNodeTreePicker,
EditorType.MacroParameter,
"Multiple Content Picker",
"contentpicker")]
[DataEditor(Constants.PropertyEditors.Aliases.MultiNodeTreePicker, EditorType.MacroParameter, "Multiple Content Picker", "contentpicker")]
public class MultipleContentPickerParameterEditor : DataEditor
{
/// <summary>
@@ -3,11 +3,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
[DataEditor(
"contentTypeMultiple",
EditorType.MacroParameter,
"Multiple Content Type Picker",
"entitypicker")]
[DataEditor("contentTypeMultiple", EditorType.MacroParameter, "Multiple Content Type Picker", "entitypicker")]
public class MultipleContentTypeParameterEditor : DataEditor
{
public MultipleContentTypeParameterEditor(ILogger logger)
@@ -3,11 +3,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
[DataEditor(
"tabPickerMultiple",
EditorType.MacroParameter,
"Multiple Tab Picker",
"entitypicker")]
[DataEditor("tabPickerMultiple", EditorType.MacroParameter, "Multiple Tab Picker", "entitypicker")]
public class MultiplePropertyGroupParameterEditor : DataEditor
{
public MultiplePropertyGroupParameterEditor(ILogger logger)
@@ -3,11 +3,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
[DataEditor(
"propertyTypePickerMultiple",
EditorType.MacroParameter,
"Multiple Property Type Picker",
"entitypicker")]
[DataEditor("propertyTypePickerMultiple", EditorType.MacroParameter, "Multiple Property Type Picker", "entitypicker")]
public class MultiplePropertyTypeParameterEditor : DataEditor
{
public MultiplePropertyTypeParameterEditor(ILogger logger)
@@ -3,11 +3,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
[DataEditor(
"tabPicker",
EditorType.MacroParameter,
"Tab Picker",
"entitypicker")]
[DataEditor("tabPicker", EditorType.MacroParameter, "Tab Picker", "entitypicker")]
public class PropertyGroupParameterEditor : DataEditor
{
public PropertyGroupParameterEditor(ILogger logger)
@@ -3,11 +3,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors.ParameterEditors
{
[DataEditor(
"propertyTypePicker",
EditorType.MacroParameter,
"Property Type Picker",
"entitypicker")]
[DataEditor("propertyTypePicker", EditorType.MacroParameter, "Property Type Picker", "entitypicker")]
public class PropertyTypeParameterEditor : DataEditor
{
public PropertyTypeParameterEditor(ILogger logger)
@@ -8,13 +8,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// A property editor to allow the individual selection of pre-defined items.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.RadioButtonList,
"Radio button list",
"radiobuttons",
ValueType = ValueTypes.String,
Group = Constants.PropertyEditors.Groups.Lists,
Icon = "icon-target")]
[DataEditor(Constants.PropertyEditors.Aliases.RadioButtonList, "Radio button list", "radiobuttons", ValueType = ValueTypes.String, Group="lists", Icon="icon-target")]
public class RadioButtonsPropertyEditor : DataEditor
{
private readonly ILocalizedTextService _textService;
@@ -15,14 +15,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a rich text property editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.TinyMce,
"Rich Text Editor",
"rte",
ValueType = ValueTypes.Text,
HideLabel = false,
Group = Constants.PropertyEditors.Groups.RichContent,
Icon = "icon-browser-window")]
[DataEditor(Constants.PropertyEditors.Aliases.TinyMce, "Rich Text Editor", "rte", ValueType = ValueTypes.Text, HideLabel = false, Group="Rich Content", Icon="icon-browser-window")]
public class RichTextPropertyEditor : DataEditor
{
/// <summary>
@@ -7,11 +7,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a slider editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.Slider,
"Slider",
"slider",
Icon = "icon-navigation-horizontal")]
[DataEditor(Constants.PropertyEditors.Aliases.Slider, "Slider", "slider", Icon = "icon-navigation-horizontal")]
public class SliderPropertyEditor : DataEditor
{
/// <summary>
@@ -15,11 +15,7 @@ namespace Umbraco.Web.PropertyEditors
/// Represents a tags property editor.
/// </summary>
[TagsPropertyEditor]
[DataEditor(
Constants.PropertyEditors.Aliases.Tags,
"Tags",
"tags",
Icon = "icon-tags")]
[DataEditor(Constants.PropertyEditors.Aliases.Tags, "Tags", "tags", Icon="icon-tags")]
public class TagsPropertyEditor : DataEditor
{
private readonly ManifestValueValidatorCollection _validators;
@@ -7,13 +7,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a textarea property and parameter editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.TextArea,
EditorType.PropertyValue | EditorType.MacroParameter,
"Textarea",
"textarea",
ValueType = ValueTypes.Text,
Icon = "icon-application-window-alt")]
[DataEditor(Constants.PropertyEditors.Aliases.TextArea, EditorType.PropertyValue | EditorType.MacroParameter, "Textarea", "textarea", ValueType = ValueTypes.Text, Icon="icon-application-window-alt")]
public class TextAreaPropertyEditor : DataEditor
{
/// <summary>
@@ -7,12 +7,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a textbox property and parameter editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.TextBox,
EditorType.PropertyValue | EditorType.MacroParameter,
"Textbox",
"textbox",
Group = Constants.PropertyEditors.Groups.Common)]
[DataEditor(Constants.PropertyEditors.Aliases.TextBox, EditorType.PropertyValue | EditorType.MacroParameter, "Textbox", "textbox", Group = "Common")]
public class TextboxPropertyEditor : DataEditor
{
/// <summary>
@@ -7,14 +7,7 @@ namespace Umbraco.Web.PropertyEditors
/// <summary>
/// Represents a checkbox property and parameter editor.
/// </summary>
[DataEditor(
Constants.PropertyEditors.Aliases.Boolean,
EditorType.PropertyValue | EditorType.MacroParameter,
"Checkbox",
"boolean",
ValueType = ValueTypes.Integer,
Group = Constants.PropertyEditors.Groups.Common,
Icon = "icon-checkbox")]
[DataEditor(Constants.PropertyEditors.Aliases.Boolean, EditorType.PropertyValue | EditorType.MacroParameter, "Checkbox", "boolean", ValueType = ValueTypes.Integer, Group = "Common", Icon="icon-checkbox")]
public class TrueFalsePropertyEditor : DataEditor
{
/// <summary>
@@ -6,13 +6,7 @@ using Umbraco.Core.PropertyEditors;
namespace Umbraco.Web.PropertyEditors
{
[DataEditor(
Constants.PropertyEditors.Aliases.UserPicker,
"User picker",
"entitypicker",
ValueType = ValueTypes.Integer,
Group = Constants.PropertyEditors.Groups.People,
Icon = Constants.Icons.User)]
[DataEditor(Constants.PropertyEditors.Aliases.UserPicker, "User picker", "entitypicker", ValueType = ValueTypes.Integer, Group = "People", Icon = Constants.Icons.User)]
public class UserPickerPropertyEditor : DataEditor
{
public UserPickerPropertyEditor(ILogger logger)
@@ -45,10 +45,6 @@ namespace Umbraco.Web.Routing
if (string.IsNullOrEmpty(path))
return null;
// the stored path is absolute so we just return it as is
if(Uri.IsWellFormedUriString(path, UriKind.Absolute))
return new Uri(path);
Uri uri;
if (current == null)