Skip to content

Commit cf7684a

Browse files
authored
Merge pull request #4 from jcdcdev/dev/v16
16.0.0
2 parents 487f777 + 2bba453 commit cf7684a

29 files changed

+633
-151
lines changed

.github/README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,94 @@
11
# Umbraco.Community.SimpleTrees
22

3+
[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/Umbraco.Community.SimpleTrees)
4+
[![License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.SimpleTrees?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.SimpleTrees?tab=MIT-1-ov-file)
5+
[![NuGet Downloads](https://img.shields.io/nuget/dt/Umbraco.Community.SimpleTrees?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/Umbraco.Community.SimpleTrees)
6+
[![Project Website](https://img.shields.io/badge/Project%20Website-jcdc.dev-jcdcdev?style=flat&color=3c4834&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiIGNsYXNzPSJiaSBiaS1wYy1kaXNwbGF5IiB2aWV3Qm94PSIwIDAgMTYgMTYiPgogIDxwYXRoIGQ9Ik04IDFhMSAxIDAgMCAxIDEtMWg2YTEgMSAwIDAgMSAxIDF2MTRhMSAxIDAgMCAxLTEgMUg5YTEgMSAwIDAgMS0xLTF6bTEgMTMuNWEuNS41IDAgMSAwIDEgMCAuNS41IDAgMCAwLTEgMG0yIDBhLjUuNSAwIDEgMCAxIDAgLjUuNSAwIDAgMC0xIDBNOS41IDFhLjUuNSAwIDAgMCAwIDFoNWEuNS41IDAgMCAwIDAtMXpNOSAzLjVhLjUuNSAwIDAgMCAuNS41aDVhLjUuNSAwIDAgMCAwLTFoLTVhLjUuNSAwIDAgMC0uNS41TTEuNSAyQTEuNSAxLjUgMCAwIDAgMCAzLjV2N0ExLjUgMS41IDAgMCAwIDEuNSAxMkg2djJoLS41YS41LjUgMCAwIDAgMCAxSDd2LTRIMS41YS41LjUgMCAwIDEtLjUtLjV2LTdhLjUuNSAwIDAgMSAuNS0uNUg3VjJ6Ii8+Cjwvc3ZnPg==)](https://jcdc.dev/umbraco-packages/simple-trees)
7+
8+
9+
This packages aims to help developers quickly put together Umbraco Trees using C#.
10+
11+
## Features
12+
13+
- C# custom tree creation
14+
- No javascript or umbraco-package.json files required
15+
- Supports both Views & View Components
16+
- Easy to define section permissions
17+
18+
## Quick Start
19+
20+
### Install Package
21+
22+
```csharp
23+
dotnet add package Umbraco.Community.SimpleTrees
24+
```
25+
26+
### Register Tree
27+
28+
By default, this will display in the content section.
29+
30+
```csharp title="ExampleTree.cs"
31+
using Umbraco.Cms.Core.Models;
32+
using Umbraco.Community.SimpleTrees.Models;
33+
34+
namespace Umbraco.Community.SimpleTrees.TestSite.Trees;
35+
36+
public class MyTree : SimpleTree
37+
{
38+
public override Task<PagedModel<ISimpleTreeItem>> GetTreeRootAsync(int skip, int take, bool foldersOnly)
39+
{
40+
var data = new List<ISimpleTreeItem>
41+
{
42+
CreateRootItem("James", Guid.NewGuid().ToString(), "icon-user"),
43+
CreateRootItem("Tim", Guid.NewGuid().ToString(), "icon-user"),
44+
};
45+
46+
return Task.FromResult(new PagedModel<ISimpleTreeItem>(data.Count, data));
47+
}
48+
49+
public override Task<PagedModel<ISimpleTreeItem>> GetTreeChildrenAsync(string entityType, string parentUnique, int skip, int take, bool foldersOnly) => Task.FromResult(EmptyResult());
50+
51+
public override string Name => "My Tree";
52+
}
53+
```
54+
55+
### Create Views
56+
57+
- Your views **must** go in `/Views/Trees`
58+
- You views **must** be the name of your tree entities
59+
- For example: `MyTree.cs` => `/Views/Trees/MyItem.cshtml` & `/Views/Trees/MyRoot.cshtml`
60+
61+
```csharp title="Views/Trees/MyItem.cshtml"
62+
@inherits Umbraco.Community.SimpleTrees.Web.SimpleTreeViewPage
63+
64+
<uui-box headline="This is a custom tree item">
65+
<div>
66+
<table>
67+
<thead>
68+
<tr>
69+
<th>Entity Type</th>
70+
<th>Unique</th>
71+
</tr>
72+
</thead>
73+
<tbody>
74+
<tr>
75+
<td>@Model.EntityType</td>
76+
<td>@Model.Unique</td>
77+
</tr>
78+
</table>
79+
</div>
80+
</uui-box>
81+
```
82+
83+
84+
85+
## Contributing
86+
87+
Contributions to this package are most welcome! Please visit the [Contributing](https://github.com/jcdcdev/Umbraco.Community.SimpleTrees/contribute) page.
88+
89+
## Acknowledgements (Thanks)
90+
91+
- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter)
92+
93+
394

.github/workflows/update-readme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
needs: get-refs
3131
env:
3232
DRY_RUN: ${{ github.event.inputs.dry-run }}
33-
PROJECT_NAME: jcdcdev.Umbraco.RelationsManager
33+
PROJECT_NAME: Umbraco.Community.SimpleTrees
3434
README_FILEPATH: ./.github/README.md
3535
NUGET_README_FILEPATH: ./docs/README_nuget.md
3636
strategy:

.github/workflows/update-security-policy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
needs: get-refs
3131
env:
3232
DRY_RUN: ${{ github.event.inputs.dry-run }}
33-
PROJECT_NAME: jcdcdev.Umbraco.RelationsManager
33+
PROJECT_NAME: Umbraco.Community.SimpleTrees
3434
SECURITY_POLICY_FILEPATH: ./SECURITY.md
3535
strategy:
3636
max-parallel: 1

SECURITY.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
The following table outlines the versions of the project that are currently supported with security & feature updates:
6+
7+
> [!NOTE]
8+
> Once a version starts its security phase, it will no longer receive feature updates. Only critical bug fixes and security updates will be provided.
9+
10+
| Package Version | Umbraco Version | Security Phase Start | End of Life |
11+
| ---------------------------------------------------------------------------------- | --------------- | -------------------- | ----------- |
12+
| [15.x](https://github.com/jcdcdev/Umbraco.Community.SimpleTrees/tree/v15) | 15 | 2025-08-14 | 2025-11-14 |
13+
| [16.x](https://github.com/jcdcdev/Umbraco.Community.SimpleTrees/tree/v16) | 16 | 2026-03-12 | 2026-06-12 |
14+
15+
16+
## Future Support
17+
18+
Project maintainers plan to support all STS (Short-Term Support) and LTS (Long-Term Support) versions of Umbraco. However, exact release dates cannot be guaranteed.
19+
20+
> [!NOTE]
21+
> Visit [jcdc.dev/blog/umbraco-version-information](https://jcdc.dev/blog/umbraco-version-information) for more information on Umbraco versions.
22+
23+
## Reporting a Vulnerability
24+
25+
If you discover a vulnerability in this project, please follow one of these steps to report it:
26+
27+
- Create an [issue](https://github.com/jcdcdev/Umbraco.Community.SimpleTrees/security/advisories/new)
28+
- Contact the project author privately at [jcdc.dev/contact](https://jcdc.dev/contact)
29+
30+
### Details
31+
32+
Include as much information as possible about the vulnerability, including:
33+
34+
- Steps to reproduce
35+
- Potential impact
36+
- Any suggested fixes
37+
38+
### Acknowledgment
39+
40+
You will receive an acknowledgment of your report as soon as possible.
41+
42+
> [!NOTE]
43+
> Response times may vary depending on other commitments.
44+
45+
### Resolution
46+
47+
Once the vulnerability is confirmed, project maintainers will work to resolve it as quickly as possible.
48+
49+
You will be notified once the issue has been resolved or rejected.
50+
51+
> [!TIP]
52+
> If the vulnerability is accepted, you will receive credit in the release notes.
53+
54+
Thank you for helping to keep this project secure!
55+

docs/README_nuget.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,94 @@
11
# Umbraco.Community.SimpleTrees
22

3+
[![Documentation](https://img.shields.io/badge/Docs-Quickstart-394933?style=flat&logo=github)](https://github.com/jcdcdev/Umbraco.Community.SimpleTrees#quick-start)
4+
[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/Umbraco.Community.SimpleTrees)
5+
[![License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.SimpleTrees?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.SimpleTrees?tab=MIT-1-ov-file)
6+
[![NuGet Downloads](https://img.shields.io/nuget/dt/Umbraco.Community.SimpleTrees?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/Umbraco.Community.SimpleTrees)
7+
[![Project Website](https://img.shields.io/badge/Project%20Website-jcdc.dev-jcdcdev?style=flat&color=3c4834&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0id2hpdGUiIGNsYXNzPSJiaSBiaS1wYy1kaXNwbGF5IiB2aWV3Qm94PSIwIDAgMTYgMTYiPgogIDxwYXRoIGQ9Ik04IDFhMSAxIDAgMCAxIDEtMWg2YTEgMSAwIDAgMSAxIDF2MTRhMSAxIDAgMCAxLTEgMUg5YTEgMSAwIDAgMS0xLTF6bTEgMTMuNWEuNS41IDAgMSAwIDEgMCAuNS41IDAgMCAwLTEgMG0yIDBhLjUuNSAwIDEgMCAxIDAgLjUuNSAwIDAgMC0xIDBNOS41IDFhLjUuNSAwIDAgMCAwIDFoNWEuNS41IDAgMCAwIDAtMXpNOSAzLjVhLjUuNSAwIDAgMCAuNS41aDVhLjUuNSAwIDAgMCAwLTFoLTVhLjUuNSAwIDAgMC0uNS41TTEuNSAyQTEuNSAxLjUgMCAwIDAgMCAzLjV2N0ExLjUgMS41IDAgMCAwIDEuNSAxMkg2djJoLS41YS41LjUgMCAwIDAgMCAxSDd2LTRIMS41YS41LjUgMCAwIDEtLjUtLjV2LTdhLjUuNSAwIDAgMSAuNS0uNUg3VjJ6Ii8+Cjwvc3ZnPg==)](https://jcdc.dev/umbraco-packages/simple-trees)
8+
9+
10+
This packages aims to help developers quickly put together Umbraco Trees using C#.
11+
12+
## Features
13+
14+
- C# custom tree creation
15+
- No javascript or umbraco-package.json files required
16+
- Supports both Views & View Components
17+
- Easy to define section permissions
18+
19+
## Quick Start
20+
21+
### Install Package
22+
23+
```csharp
24+
dotnet add package Umbraco.Community.SimpleTrees
25+
```
26+
27+
### Register Tree
28+
29+
By default, this will display in the content section.
30+
31+
```csharp title="ExampleTree.cs"
32+
using Umbraco.Cms.Core.Models;
33+
using Umbraco.Community.SimpleTrees.Models;
34+
35+
namespace Umbraco.Community.SimpleTrees.TestSite.Trees;
36+
37+
public class MyTree : SimpleTree
38+
{
39+
public override Task<PagedModel<ISimpleTreeItem>> GetTreeRootAsync(int skip, int take, bool foldersOnly)
40+
{
41+
var data = new List<ISimpleTreeItem>
42+
{
43+
CreateRootItem("James", Guid.NewGuid().ToString(), "icon-user"),
44+
CreateRootItem("Tim", Guid.NewGuid().ToString(), "icon-user"),
45+
};
46+
47+
return Task.FromResult(new PagedModel<ISimpleTreeItem>(data.Count, data));
48+
}
49+
50+
public override Task<PagedModel<ISimpleTreeItem>> GetTreeChildrenAsync(string entityType, string parentUnique, int skip, int take, bool foldersOnly) => Task.FromResult(EmptyResult());
51+
52+
public override string Name => "My Tree";
53+
}
54+
```
55+
56+
### Create Views
57+
58+
- Your views **must** go in `/Views/Trees`
59+
- You views **must** be the name of your tree entities
60+
- For example: `MyTree.cs` => `/Views/Trees/MyItem.cshtml` & `/Views/Trees/MyRoot.cshtml`
61+
62+
```csharp title="Views/Trees/MyItem.cshtml"
63+
@inherits Umbraco.Community.SimpleTrees.Web.SimpleTreeViewPage
64+
65+
<uui-box headline="This is a custom tree item">
66+
<div>
67+
<table>
68+
<thead>
69+
<tr>
70+
<th>Entity Type</th>
71+
<th>Unique</th>
72+
</tr>
73+
</thead>
74+
<tbody>
75+
<tr>
76+
<td>@Model.EntityType</td>
77+
<td>@Model.Unique</td>
78+
</tr>
79+
</table>
80+
</div>
81+
</uui-box>
82+
```
83+
84+
85+
## Contributing
86+
87+
Contributions to this package are most welcome! Please visit the [Contributing](https://github.com/jcdcdev/Umbraco.Community.SimpleTrees/contribute) page.
88+
89+
## Acknowledgements (Thanks)
90+
91+
- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter)
92+
393

494

160 KB
Loading
89.7 KB
Loading
126 KB
Loading
74 KB
Loading
124 KB
Loading

0 commit comments

Comments
 (0)