Make it possible to add ellipsis on actions that invokes dialogs by means of OpensDialog on IAction

This commit is contained in:
Kenn Jacobsen
2018-10-25 14:54:36 +02:00
parent 3652a96687
commit 4cfac8da16
36 changed files with 101 additions and 2 deletions

View File

@@ -49,6 +49,8 @@ namespace Umbraco.Tests.Composing
public bool ShowInNotifier => false;
public bool CanBePermissionAssigned => true;
public bool OpensDialog => true;
}
public class NonSingletonAction : IAction
@@ -66,6 +68,8 @@ namespace Umbraco.Tests.Composing
public bool ShowInNotifier => false;
public bool CanBePermissionAssigned => true;
public bool OpensDialog => true;
}
#endregion

View File

@@ -51,6 +51,15 @@
text-decoration: none;
}
.umb-action {
&.-opens-dialog {
.menu-label:after {
// adds an ellipsis (...) after the menu label for actions that open a dialog
content: '\2026';
}
}
}
.umb-actions-child {
.umb-action {

View File

@@ -5,7 +5,7 @@
<div class='umb-modalcolumn-body'>
<ul class="umb-actions">
<li data-element="action-{{action.alias}}" ng-click="executeMenuItem(action)" class="umb-action" ng-class="{sep:action.seperator}" ng-repeat="action in menuActions">
<li data-element="action-{{action.alias}}" ng-click="executeMenuItem(action)" class="umb-action" ng-class="{sep:action.seperator, '-opens-dialog': action.opensDialog}" ng-repeat="action in menuActions">
<a class="umb-action-link" prevent-default>
<i class="icon icon-{{action.cssclass}}"></i>
<span class="menu-label">{{action.name}}</span>
@@ -13,4 +13,4 @@
</li>
</ul>
</div>
</div>
</div>

View File

@@ -38,6 +38,7 @@ namespace Umbraco.Web.Models.Trees
SeperatorBefore = false;
Icon = legacyMenu.Icon;
Action = legacyMenu;
OpensDialog = legacyMenu.OpensDialog;
}
#endregion
@@ -71,6 +72,10 @@ namespace Umbraco.Web.Models.Trees
[DataMember(Name = "cssclass")]
public string Icon { get; set; }
[DataMember(Name = "opensDialog")]
public bool OpensDialog { get; set; }
#endregion
#region Constants

View File

@@ -174,6 +174,7 @@ namespace Umbraco.Web._Legacy.Actions
public string Alias { get; set; }
public string JsFunctionName { get; set; }
public string JsSource { get; set; }
public bool OpensDialog { get; set; }
public PlaceboAction() { }
public PlaceboAction(IAction legacyAction)
@@ -185,6 +186,7 @@ namespace Umbraco.Web._Legacy.Actions
Alias = legacyAction.Alias;
JsFunctionName = legacyAction.JsFunctionName;
JsSource = legacyAction.JsSource;
OpensDialog = legacyAction.OpensDialog;
}
}

View File

@@ -69,6 +69,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -60,6 +60,8 @@ namespace Umbraco.Web._Legacy.Actions
get { return ""; }
}
public bool OpensDialog => false;
#endregion
}
}

View File

@@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -20,6 +20,7 @@ namespace Umbraco.Web._Legacy.Actions
public string Alias { get; private set; }
public string JsFunctionName { get; private set; }
public string JsSource { get; private set; }
public bool OpensDialog => true;
public ActionCreateBlueprintFromContent()
{

View File

@@ -77,6 +77,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -73,6 +73,8 @@ namespace Umbraco.Web._Legacy.Actions
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -71,6 +71,8 @@ namespace Umbraco.Web._Legacy.Actions
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -72,6 +72,8 @@
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -70,6 +70,8 @@ namespace Umbraco.Web._Legacy.Actions
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -76,6 +76,9 @@ namespace Umbraco.Web._Legacy.Actions
return false;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -51,6 +51,8 @@
get { return string.Empty; }
}
public bool OpensDialog => false;
#endregion
}
}

View File

@@ -75,6 +75,8 @@ namespace Umbraco.Web._Legacy.Actions
}
}
public bool OpensDialog => false;
#endregion
}
}

View File

@@ -75,6 +75,8 @@ namespace Umbraco.Web._Legacy.Actions
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -77,6 +77,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -74,6 +74,9 @@ namespace Umbraco.Web._Legacy.Actions
return false;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -81,6 +81,9 @@ namespace Umbraco.Web._Legacy.Actions
return false;
}
}
public bool OpensDialog => false;
#endregion
}
}

View File

@@ -27,6 +27,8 @@
public bool CanBePermissionAssigned => false;
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -82,6 +82,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -83,6 +83,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -78,6 +78,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => false;
#endregion
}
}

View File

@@ -77,6 +77,8 @@ namespace Umbraco.Web._Legacy.Actions
}
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -76,6 +76,9 @@ namespace Umbraco.Web._Legacy.Actions
return false;
}
}
public bool OpensDialog => false;
#endregion
}

View File

@@ -77,6 +77,9 @@ namespace Umbraco.Web._Legacy.Actions
return true;
}
}
public bool OpensDialog => false;
#endregion
}
}

View File

@@ -46,6 +46,8 @@
get { return false; }
}
public bool OpensDialog => false;
#endregion
}
}

View File

@@ -14,5 +14,9 @@ namespace Umbraco.Web._Legacy.Actions
/// A path to a supporting JavaScript file for the IAction. A script tag will be rendered out with the reference to the JavaScript file.
/// </summary>
string JsSource { get; }
/// <summary>
/// Whether or not the action opens a dialog when invoked
/// </summary>
bool OpensDialog { get; }
}
}

View File

@@ -78,6 +78,8 @@ namespace umbraco.cms.presentation.developer.RelationTypes.TreeMenu
get { return "javascript:actionDeleteRelationType(UmbClientMgr.mainTree().getActionNode().nodeId,UmbClientMgr.mainTree().getActionNode().nodeName);"; }
}
public bool OpensDialog => true;
#endregion
}
}

View File

@@ -78,6 +78,8 @@ namespace umbraco.cms.presentation.developer.RelationTypes.TreeMenu
get { return "javascript:actionNewRelationType();"; }
}
public bool OpensDialog => true;
#endregion
}
}