Merge branch 'temp8' of https://github.com/umbraco/Umbraco-CMS into temp8

This commit is contained in:
Warren Buckley
2019-01-07 14:11:09 +00:00
30 changed files with 36 additions and 86 deletions

View File

@@ -18,6 +18,7 @@
<umb-toggle
checked="vm.checked"
disabled="vm.disabled"
on-click="vm.toggle()"
show-labels="true"
label-on="Start"
@@ -38,6 +39,7 @@
var vm = this;
vm.checked = false;
vm.disabled = false;
vm.toggle = toggle;
@@ -52,6 +54,7 @@
</pre>
@param {boolean} checked Set to <code>true</code> or <code>false</code> to toggle the switch.
@param {boolean} disabled Set to <code>true</code> or <code>false</code> to disable the switch.
@param {callback} onClick The function which should be called when the toggle is clicked.
@param {string=} showLabels Set to <code>true</code> or <code>false</code> to show a "On" or "Off" label next to the switch.
@param {string=} labelOn Set a custom label for when the switched is turned on. It will default to "On".
@@ -115,6 +118,7 @@
templateUrl: 'views/components/buttons/umb-toggle.html',
scope: {
checked: "=",
disabled: "=",
onClick: "&",
labelOn: "@?",
labelOff: "@?",

View File

@@ -28,7 +28,8 @@
.umb-toggle__toggle {
cursor: pointer;
display: inline-block;
align-items: center;
display: flex;
width: 48px;
height: 24px;
background: @gray-8;
@@ -41,6 +42,11 @@
background-color: @green;
}
.umb-toggle--disabled .umb-toggle__toggle {
cursor: not-allowed;
opacity: 0.8;
}
.umb-toggle--checked .umb-toggle__handler {
transform: translate3d(24px, 0, 0) rotate(0);
}
@@ -63,7 +69,7 @@
.umb-toggle__icon {
position: absolute;
top: 3px;
line-height: 1em;
text-decoration: none;
transition: all 0.2s ease;
}

View File

@@ -4,10 +4,6 @@
padding: 7px 0;
}
.umb-permission--disabled {
opacity: 0.8;
}
.umb-permission:last-of-type {
border-bottom: none;
}
@@ -25,6 +21,12 @@
cursor: pointer;
}
.umb-permission--disabled .umb-permission__toggle,
.umb-permission--disabled .umb-permission__content {
cursor: not-allowed;
opacity: 0.8;
}
.umb-permission__description {
font-size: 13px;
color: @gray-4;

View File

@@ -1,4 +1,4 @@
<button ng-click="click()" type="button" class="umb-toggle" ng-class="{'umb-toggle--checked': checked}">
<button ng-click="click()" type="button" class="umb-toggle" ng-disabled="disabled" ng-class="{'umb-toggle--checked': checked, 'umb-toggle--disabled': disabled}">
<span ng-if="!labelPosition && showLabels === 'true' || labelPosition === 'left' && showLabels === 'true'">
<span ng-if="!checked" class="umb-toggle__label umb-toggle__label--left">{{ displayLabelOff }}</span>

View File

@@ -39,7 +39,8 @@
<div class="umb-permission" ng-click="vm.toggleDefault()" ng-class="{'umb-permission--disabled': vm.initIsDefault}">
<umb-toggle
class="umb-permission__toggle"
checked="vm.language.isDefault">
checked="vm.language.isDefault"
disabled="vm.initIsDefault">
</umb-toggle>
<div class="umb-permission__content" >
<div>{{vm.labels.defaultLanguage}}</div>

View File

@@ -9,7 +9,6 @@ using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;

View File

@@ -14,7 +14,6 @@ using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
using Umbraco.Core.Composing;
using Umbraco.Core.Services;
using Current = Umbraco.Web.Composing.Current;
using ApplicationTree = Umbraco.Core.Models.ApplicationTree;

View File

@@ -1,14 +1,12 @@
using System.Linq;
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Web.Actions;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
@@ -117,6 +115,5 @@ namespace Umbraco.Web.Trees
return menu;
}
}
}

View File

@@ -9,11 +9,9 @@ using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Search;
using Constants = Umbraco.Core.Constants;

View File

@@ -14,7 +14,6 @@ using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi.Filters;
using System.Globalization;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Composing;

View File

@@ -5,12 +5,9 @@ using System.Linq;
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi.Filters;

View File

@@ -12,8 +12,6 @@ using Umbraco.Web.WebApi.Filters;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Search;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
@@ -91,7 +89,6 @@ namespace Umbraco.Web.Trees
Constants.DataTypes.DefaultContentListView,
Constants.DataTypes.DefaultMediaListView,
Constants.DataTypes.DefaultMembersListView
};
}

View File

@@ -3,9 +3,7 @@ using System.Linq;
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi.Filters;

View File

@@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http.Formatting;
using System.Web;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Models.Trees;

View File

@@ -1,15 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Formatting;
using System.Web.Http.Routing;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.Trees;
namespace Umbraco.Web.Trees
{
@@ -78,6 +72,5 @@ namespace Umbraco.Web.Trees
public ActionUrlMethod ActionMethod { get; private set; }
public string DialogTitle { get; private set; }
}
}
}

View File

@@ -2,14 +2,11 @@
using System.Linq;
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
@@ -70,7 +67,6 @@ namespace Umbraco.Web.Trees
return menu;
}
var macro = Services.MacroService.GetById(int.Parse(id));
if (macro == null) return new MenuItemCollection();

View File

@@ -9,11 +9,9 @@ using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Search;
using Constants = Umbraco.Core.Constants;

View File

@@ -5,18 +5,14 @@ using System.Net.Http.Formatting;
using AutoMapper;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Search;
namespace Umbraco.Web.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.MediaTypes)]

View File

@@ -14,7 +14,6 @@ using Umbraco.Web.Actions;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Search;
using Constants = Umbraco.Core.Constants;
@@ -116,8 +115,6 @@ namespace Umbraco.Web.Trees
return node;
}
}
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
@@ -188,7 +185,6 @@ namespace Umbraco.Web.Trees
menu.Items.Add(new ExportMember(Services.TextService));
}
return menu;
}

View File

@@ -1,9 +1,7 @@
using System.Collections.Generic;
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Models.Trees;
namespace Umbraco.Web.Trees

View File

@@ -1,15 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Formatting;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
using umbraco;
using umbraco.cms.businesslogic.packager;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
@@ -27,13 +24,11 @@ namespace Umbraco.Web.Trees
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var root = base.CreateRootNode(queryStrings);
root.RoutePath = $"{Constants.Applications.Packages}/{Constants.Trees.Packages}/overview";
root.Icon = "icon-box";
return root;
}
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
{
var nodes = new TreeNodeCollection();
@@ -47,7 +42,8 @@ namespace Umbraco.Web.Trees
.OrderBy(entity => entity.Data.Name)
.Select(dt =>
{
var node = CreateTreeNode(dt.Data.Id.ToString(), id, queryStrings, dt.Data.Name, "icon-inbox", false,
var node = CreateTreeNode(dt.Data.Id.ToString(), id, queryStrings, dt.Data.Name,
"icon-inbox", false,
$"/{queryStrings.GetValue<string>("application")}/framed/{Uri.EscapeDataString("developer/Packages/EditPackage.aspx?id=" + dt.Data.Id)}");
return node;
}));
@@ -64,16 +60,12 @@ namespace Umbraco.Web.Trees
createdPackages.Count > 0,
string.Empty);
//TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now.
node.AdditionalData["jsClickCallback"] = "javascript:void(0);";
nodes.Add(node);
}
return nodes;
}
@@ -85,12 +77,14 @@ namespace Umbraco.Web.Trees
if (id == "-1")
{
menu.Items.Add<ActionNew>(Services.TextService, opensDialog: true)
.ConvertLegacyMenuItem(null, Constants.Trees.Packages, queryStrings.GetValue<string>("application"));
.ConvertLegacyMenuItem(null, Constants.Trees.Packages,
queryStrings.GetValue<string>("application"));
}
else if (id == "created")
{
menu.Items.Add<ActionNew>(Services.TextService, opensDialog: true)
.ConvertLegacyMenuItem(null, Constants.Trees.Packages, queryStrings.GetValue<string>("application"));
.ConvertLegacyMenuItem(null, Constants.Trees.Packages,
queryStrings.GetValue<string>("application"));
menu.Items.Add(new RefreshNode(Services.TextService, true));
}

View File

@@ -1,5 +1,4 @@
using umbraco;
using Umbraco.Core.IO;
using Umbraco.Core.IO;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;

View File

@@ -44,9 +44,10 @@ namespace Umbraco.Web.Trees
if (id == Constants.System.Root.ToInvariantString())
{
nodes.AddRange(Services.RelationService.GetAllRelationTypes()
.Select(rt => CreateTreeNode(rt.Id.ToString(), id, queryStrings, rt.Name,
"icon-trafic", false)));
.Select(rt => CreateTreeNode(rt.Id.ToString(), id, queryStrings, rt.Name,
"icon-trafic", false)));
}
return nodes;
}
}

View File

@@ -1,5 +1,4 @@
using System;
using Umbraco.Core;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.Trees;

View File

@@ -5,16 +5,13 @@ using System.Linq;
using System.Net.Http.Formatting;
using AutoMapper;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Web.Actions;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.Search;
using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees

View File

@@ -48,8 +48,6 @@ namespace Umbraco.Web.Trees
IsSingleNodeTree = isSingleNodeTree;
}
public string ApplicationAlias { get; private set; }
public string Alias { get; private set; }
public string Title { get; private set; }

View File

@@ -1,8 +1,4 @@
using System;
using System.Linq;
using Umbraco.Core.Services;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.Trees
{
/// <summary>
/// The base controller for all tree requests
@@ -22,8 +18,8 @@ namespace Umbraco.Web.Trees
/// </summary>
public override string RootNodeDisplayName
=> _rootNodeDisplayName
?? (_rootNodeDisplayName = Services.ApplicationTreeService.GetByAlias(_attribute.Alias)
?.GetRootNodeDisplayName(Services.TextService));
?? (_rootNodeDisplayName = Services.ApplicationTreeService.GetByAlias(_attribute.Alias)
?.GetRootNodeDisplayName(Services.TextService));
/// <summary>
/// Gets the current tree alias from the attribute assigned to it.

View File

@@ -10,7 +10,6 @@ using Umbraco.Core.Models.Entities;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Web.Search;
namespace Umbraco.Web.Trees
{

View File

@@ -2,8 +2,6 @@
using System.Linq;
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;

View File

@@ -1,10 +1,7 @@
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees