Skip to content

Commit

Permalink
Merge pull request #22 from jcdcdev/dev/v14
Browse files Browse the repository at this point in the history
feature: v14 support (WIP)
  • Loading branch information
jcdcdev authored Jun 24, 2024
2 parents cc38df0 + dbceb87 commit 88f9f9f
Show file tree
Hide file tree
Showing 228 changed files with 8,175 additions and 9,733 deletions.
23 changes: 12 additions & 11 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
# Umbraco.Community.SimpleDashboards

[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/umbraco.community.simpledashboards)
[![GitHub License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.SimpleDashboards?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/main/LICENSE)
[![GitHub License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.SimpleDashboards?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/v14/LICENSE)
[![NuGet Downloads](https://img.shields.io/nuget/dt/Umbraco.Community.SimpleDashboards?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/Umbraco.Community.SimpleDashboards/)

[![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-dashboards)

This packages aims to help developers quickly put together Umbraco Dashboards using C# only.

![Basic Dashboard in the Umbraco Office](https://raw.githubusercontent.com/jcdcdev/Umbraco.Community.SimpleDashboards/main/docs/screenshot.png)
![Basic Dashboard in the Umbraco Office](https://raw.githubusercontent.com/jcdcdev/Umbraco.Community.SimpleDashboards/v14/docs/screenshot.png)

## Features

- Simplifies C# based dashboard creation
- C# dashboard creation
- No javascript or umbraco-package.json files required
- Supports both Views & View Components
- No package.manifest or lang/lang.xml files required!
- Variant support (culture specific names)
- Easy to define Access Rules
- Easy to define section permissions

## Quick Start

Expand Down Expand Up @@ -43,17 +42,19 @@ public class BasicDashboard : SimpleDashboard { }
```csharp
@inherits Umbraco.Community.SimpleDashboards.Web.DashboardViewPage

<h1>Hello Umbraco</h1>
<p>My Dashboard alias is: @Model.Dashboard.Alias</p>
<uui-box headline="Hello Umbraco">
<p>My Dashboard is: @Model.Dashboard.Alias</p>
</uui-box>
```

### More Examples

[docs/examples.md](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/dev/docs/examples.md)
[docs/examples.md](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/v14/docs/examples.md)
## Contributing

Contributions to this package are most welcome! Please read the [Contributing Guidelines](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/main/.github/CONTRIBUTING.md).
Contributions to this package are most welcome! Please read
the [Contributing Guidelines](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/v14/.github/CONTRIBUTING.md).
## Acknowledgments (thanks!)

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
jobs:
metadata:
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/generate-project-metadata.yml@dev
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/generate-project-metadata.yml@main
build:
runs-on: ubuntu-latest
needs:
Expand All @@ -16,4 +16,6 @@ jobs:
with:
project-name: ${{ needs.metadata.outputs.project-name}}
project-path: ${{ needs.metadata.outputs.project-path }}
umbraco-version: UMBRACO_VERSION
npm-working-dir: ${{ needs.metadata.outputs.npm-working-dir }}
npm-enabled: true
umbraco-version: 14
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [ closed ]
jobs:
metadata:
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/generate-project-metadata.yml@dev
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/generate-project-metadata.yml@main
release:
runs-on: ubuntu-latest
permissions:
Expand All @@ -19,7 +19,9 @@ jobs:
with:
project-name: ${{ needs.metadata.outputs.project-name}}
project-path: ${{ needs.metadata.outputs.project-path }}
umbraco-version: UMBRACO_VERSION
npm-working-dir: ${{ needs.metadata.outputs.npm-working-dir }}
npm-enabled: true
umbraco-version: 14
- name: Release
uses: jcdcdev/jcdcdev.Umbraco.GitHub.Release@main
with:
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/sync-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 🔃 Sync branches

on:
push:
branches:
- 'v*'
workflow_dispatch:

jobs:
check-branch:
runs-on: ubuntu-latest
outputs:
is-valid-branch: ${{ steps.branch_check.outputs.is-valid-branch }}
steps:
- name: Check if branch name starts with 'v'
id: branch_check
run: |
BRANCH_NAME=${{ github.ref }}
if [[ $BRANCH_NAME =~ refs/heads/v.* ]]; then
VALID=true
else
VALID=false
fi
echo "is-valid-branch=$VALID" >> $GITHUB_OUTPUT
merge-branches:
needs: check-branch
permissions:
contents: write
if: needs.check-branch.outputs.is-valid-branch == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Merge into dev/v**
run: |
# Extract the version number from the branch name
VERSION=$(echo "${GITHUB_REF}" | sed -n 's#refs/heads/v\([0-9]\+\)#\1#p')
SOURCE_BRANCH="v${VERSION}"
TARGET_BRANCH="dev/v${VERSION}"
# Set git config
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
echo "Merging $SOURCE_BRANCH into $TARGET_BRANCH"
# Checkout the source branch
git checkout $SOURCE_BRANCH
git pull origin $SOURCE_BRANCH
echo "Pulled latest for $SOURCE_BRANCH"
# Merge into the target branch
git checkout $TARGET_BRANCH
git merge --no-ff $SOURCE_BRANCH -m "Merge v$VERSION into dev/v$VERSION"
echo "Merged $SOURCE_BRANCH into $TARGET_BRANCH"
# Push changes
git push origin $TARGET_BRANCH
echo "Pushed changes to $TARGET_BRANCH"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,4 @@ MigrationBackup/
# Rider
src/.idea
*.sqlite.db*
/src/Umbraco.Community.SimpleDashboards/wwwroot/App_Plugins/Umbraco.Community.SimpleDashboards/dist/
8 changes: 5 additions & 3 deletions docs/README_nuget.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

[![Documentation](https://img.shields.io/badge/Docs-Quickstart-394933?style=flat&logo=github)](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/tree/main?tab=readme-ov-file#quick-start)
[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/umbraco.community.simpledashboards)
[![GitHub License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.SimpleDashboards?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/main/LICENSE)
[![GitHub License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.SimpleDashboards?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/v14/LICENSE)
[![NuGet Downloads](https://img.shields.io/nuget/dt/Umbraco.Community.SimpleDashboards?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/Umbraco.Community.SimpleDashboards/)
[![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-dashboards)

This packages aims to help developers quickly put together Umbraco Dashboards using C# only.

![Basic Dashboard in the Umbraco Office](https://raw.githubusercontent.com/jcdcdev/Umbraco.Community.SimpleDashboards/main/docs/screenshot.png)
![Basic Dashboard in the Umbraco Office](https://raw.githubusercontent.com/jcdcdev/Umbraco.Community.SimpleDashboards/v14/docs/screenshot.png)

## Contributing

Contributions to this package are most welcome! Please read the [Contributing Guidelines](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/main/.github/CONTRIBUTING.md).
Contributions to this package are most welcome! Please read
the [Contributing Guidelines](https://github.com/jcdcdev/Umbraco.Community.SimpleDashboards/blob/v14/.github/CONTRIBUTING.md).

## Acknowledgments (thanks!)

Expand Down
38 changes: 11 additions & 27 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,46 +21,30 @@ public class BasicDashboard : SimpleDashboard { }
```csharp
@inherits Umbraco.Community.SimpleDashboards.DashboardViewPage

<h1>Hello Umbraco</h1>
<p>My Dashboard alias is: @Model.Dashboard.Alias</p>
<uui-box headline="Hello Umbraco">
<p>My Dashboard is: @Model.Dashboard.Alias</p>
</uui-box>
```

## Detailed Register Dashboard

By adding a constructor you can define permissions, where to display (content sections) and the name
By adding a constructor you can define permissions, where to display and the name of the dashboard.

```csharp
using Umbraco.Community.SimpleDashboards.Core;

// Control order of where dashboard shows
[Umbraco.Cms.Core.Composing.Weight(-100)]
public class ExampleDashboard : SimpleDashboard
{
public ExampleDashboard()
{
// Allow Admin User Group to see dashboard
AddAccessRule(SimpleAccessRule.AllowAdminGroup);

// Custom Section permissions
Allow(x => x.Section("content"));
Deny(x => x.Section("content"));

// Custom User Groups
Allow(x=>x.UserGroup("myGroup"));
Deny(x=>x.UserGroup("myOtherGroup"));

// Set dashboard name
SetName("Dashboard Name");

// Set culture specific dashboard name
SetName("Dashboard Name (cy-GB)", "cy-GB");

// Show dashboard in the Media section
AddSection(Umbraco.Cms.Core.Constants.Applications.Media);

// Show dashboard in your custom section
AddSection("mySection");
SetName("Example Dashboard");
SetWeight(500);
// Show dashboard in the Media & Content sections
AddSection("Umb.Section.Media");
AddSection("Umb.Section.Content");
}
}

```

## View Component Example
Expand Down
Binary file modified docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 88f9f9f

Please sign in to comment.