-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add ability to extend child items of the uSync tree node. * don't append build onto version (we use it to find scripts) * schema update * Add Ability to direct menus from the sub items. * Fix - path seperator not using linux safe '/' value * fix - for subtrees,return a blank menu, when they don't have a menu.
- Loading branch information
Showing
22 changed files
with
463 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
using System.Collections.Generic; | ||
|
||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
using Umbraco.Cms.Core.Trees; | ||
|
||
namespace uSync.BackOffice.Expansions | ||
{ | ||
/// <summary> | ||
/// add on for uSync that allows you to render a node | ||
/// under the uSync tree. | ||
/// </summary> | ||
public interface ISyncTreeNode | ||
{ | ||
/// <summary> | ||
/// position in the tree, (higher is lower down the tree) | ||
/// </summary> | ||
public int Weight { get; } | ||
|
||
/// <summary> | ||
/// Id this will be passed to the controller. | ||
/// </summary> | ||
public string Id { get; } | ||
|
||
/// <summary> | ||
/// alias for the tree | ||
/// </summary> | ||
public string TreeAlias { get; } | ||
|
||
/// <summary> | ||
/// alias for the node item | ||
/// </summary> | ||
public string Alias { get; } | ||
|
||
/// <summary> | ||
/// title of the tree item | ||
/// </summary> | ||
public string Title { get; } | ||
|
||
/// <summary> | ||
/// icon for the tree item. | ||
/// </summary> | ||
public string Icon { get; } | ||
|
||
|
||
/// <summary> | ||
/// method to return any additional child nodes under the parent node | ||
/// </summary> | ||
public IEnumerable<uSyncTreeNode> GetChildNodes(string id, FormCollection queryStrings); | ||
|
||
/// <summary> | ||
/// to display any context menu. | ||
/// </summary> | ||
/// <param name="id"></param> | ||
/// <param name="queryStrings"></param> | ||
/// <returns></returns> | ||
public ActionResult<MenuItemCollection> GetMenuItems(string id, FormCollection queryStrings); | ||
} | ||
|
||
/// <summary> | ||
/// Representation of a single tree node | ||
/// </summary> | ||
public class uSyncTreeNode | ||
{ | ||
/// <summary> | ||
/// Id for this tree node | ||
/// </summary> | ||
public string Id { get; set; } | ||
|
||
/// <summary> | ||
/// Alias of the tree item | ||
/// </summary> | ||
public string Alias { get; set; } | ||
|
||
/// <summary> | ||
/// title (shown to user) for tree item | ||
/// </summary> | ||
public string Title { get; set; } | ||
|
||
/// <summary> | ||
/// Icon to display. | ||
/// </summary> | ||
public string Icon { get; set; } | ||
|
||
/// <summary> | ||
/// segment path to this item. | ||
/// </summary> | ||
public string Path { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
using Umbraco.Cms.Core.Composing; | ||
|
||
namespace uSync.BackOffice.Expansions; | ||
|
||
/// <summary> | ||
/// collection of UI tree nodes, allows us to dynamically extend the uSync tree | ||
/// </summary> | ||
public class SyncTreeNodeCollection | ||
: BuilderCollectionBase<ISyncTreeNode> | ||
{ | ||
/// <inheritdoc/> | ||
public SyncTreeNodeCollection(Func<IEnumerable<ISyncTreeNode>> items) | ||
: base(items) | ||
{ } | ||
} | ||
|
||
/// <summary> | ||
/// collection builder for UI tree nodes under uSync tree.(subtrees) | ||
/// </summary> | ||
public class SyncTreeNodeCollectionBuilder | ||
: LazyCollectionBuilderBase<SyncTreeNodeCollectionBuilder, | ||
SyncTreeNodeCollection, ISyncTreeNode> | ||
{ | ||
/// <inheritdoc/> | ||
protected override SyncTreeNodeCollectionBuilder This => this; | ||
} |
Oops, something went wrong.