diff --git a/.github/README.md b/.github/README.md index 6cc55f9..f07bbab 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,119 +1,31 @@ # Umbraco.Community.BackOfficeOrganiser -[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/umbraco.community.backofficeorganiser) -[![GitHub License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.BackOfficeOrganiser?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/blob/main/LICENSE) -[![NuGet Downloads](https://img.shields.io/nuget/dt/Umbraco.Community.BackOfficeOrganiser?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/Umbraco.Community.BackOfficeOrganiser/) +[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/Umbraco.Community.BackOfficeOrganiser) +[![License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.BackOfficeOrganiser?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser?tab=MIT-1-ov-file) +[![NuGet Downloads](https://img.shields.io/nuget/dt/Umbraco.Community.BackOfficeOrganiser?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/Umbraco.Community.BackOfficeOrganiser) [![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/back-office-organiser) -Is your backoffice a bit untidy? + +Is your Backoffice a bit untidy? - Single-click (and opinionated) organiser for - Document Types - Media Types - Member Types - Data Types -- Automatically sorts on save (configurable) - -![A screenshot of the Back Office Organiser in action](https://raw.githubusercontent.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/main/docs/screenshots/backoffice.png) - -## Quick Start - -- Go to the backoffice -- Click `Settings` -- Click `Organise` -- Select the types you wish to organise -- Click submit and confirm -- Refresh your page and enjoy a cleaner backoffice ✨ - -## Configuration -Add the following to your `appsettings.json` file - -```JSON -{ - "BackOfficeOrganiser": { - "DataTypes": { - "InternalFolderName": "Internal", - "ThirdPartyFolderName": "Third Party", - "CustomFolderName": "Custom", - "OrganiseOnSave": true - }, - "ContentTypes": { - "OrganiseOnSave": true - }, - "MediaTypes": { - "OrganiseOnSave": true - }, - "MemberTypes": { - "OrganiseOnSave": true - } - } -} -``` - -## Extending -You can implement your own `Organise Action`, a method that determines where a type should be moved to. Implement the following interfaces: +> [!WARNING] +> Version 14 is no longer supported and is End of Life (EOL). -- `Document Types` => `IContentTypeOrganiseAction` -- `Media Types` => `IMediaTypeOrganiseAction` -- `Member Types` => `IMemberTypeOrganiseAction` -- `Data Types` => `IDataTypeOrganiseAction` +> Please review the [security policy](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser?tab=security-ov-file#supported-versions) for more information. -### Example -```csharp -using jcdcdev.Umbraco.Core.Extensions; -using Umbraco.Cms.Core.Models; -using Umbraco.Cms.Core.Services; - -namespace Umbraco.Community.BackOfficeOrganiser.Organisers.ContentTypes; - -public class ExampleContentTypeOrganiseAction : IContentTypeOrganiseAction -{ - // Handle all but container types (Folders) - public bool CanMove(IContentType contentType, IContentTypeService contentTypeService) => !contentType.IsContainer; - - public void Move(IContentType contentType, IContentTypeService contentTypeService) - { - var folderId = -1; - var folderName = string.Empty; - var isComposition = contentTypeService.GetComposedOf(contentType.Id).Any(); - - if (contentType.AllowedTemplates?.Any() ?? false) - { - folderName = "Pages"; - } - else if (isComposition) - { - folderName = "Compositions"; - } - else if (contentType.IsElement) - { - folderName = "Element Types"; - } - - if (!folderName.IsNullOrWhiteSpace()) - { - folderId = contentTypeService.GetOrCreateFolder(folderName).Id; - } +## Contributing - contentTypeService.Move(contentType, folderId); - } -} +Contributions to this package are most welcome! Please visit the [Contributing](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/contribute) page. -public class Composer : IComposer -{ - public void Compose(IUmbracoBuilder builder) - { - // Make sure you register your action BEFORE the default! - builder.ContentTypeOrganiseActions().Insert(); - } -} -``` +## Acknowledgements (Thanks) -## Contributing +- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter) -Contributions to this package are most welcome! Please read the [Contributing Guidelines](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/blob/main/.github/CONTRIBUTING.md). -## Acknowledgments (thanks!) -- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter) \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..7a19caa --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,62 @@ +# Security Policy + +## Supported Versions + +The following table outlines the versions of the project that are currently supported with security & feature updates: + +> [!NOTE] +> Once a version starts its security phase, it will no longer receive feature updates. Only critical bug fixes and security updates will be provided. + +| Package Version | Umbraco Version | Security Phase Start | End of Life | +| ---------------------------------------------------------------------------------- | --------------- | -------------------- | ----------- | +| [10.x](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/tree/v10) | 10 | 2024-06-16 | 2025-06-16 | +| [13.x](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/tree/v13) | 13 | 2025-12-14 | 2026-12-14 | +| [15.x](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/tree/v15) | 15 | 2025-08-14 | 2025-11-14 | +## Unsupported Versions + +| Package Version | Umbraco Version | End of Life | +| ---------------------------------------------------------------------------------- | --------------- | ----------- | +| [12.x](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/tree/v12) | 12 | 2024-06-29 | +| [14.x](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/tree/v14) | 14 | 2025-05-30 | + + +## Future Support + +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. + +> [!NOTE] +> Visit [jcdc.dev/blog/umbraco-version-information](https://jcdc.dev/blog/umbraco-version-information) for more information on Umbraco versions. + +## Reporting a Vulnerability + +If you discover a vulnerability in this project, please follow one of these steps to report it: + +- Create an [issue](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/security/advisories/new) +- Contact the project author privately at [jcdc.dev/contact](https://jcdc.dev/contact) + +### Details + +Include as much information as possible about the vulnerability, including: + +- Steps to reproduce +- Potential impact +- Any suggested fixes + +### Acknowledgment + +You will receive an acknowledgment of your report as soon as possible. + +> [!NOTE] +> Response times may vary depending on other commitments. + +### Resolution + +Once the vulnerability is confirmed, project maintainers will work to resolve it as quickly as possible. + +You will be notified once the issue has been resolved or rejected. + +> [!TIP] +> If the vulnerability is accepted, you will receive credit in the release notes. + +Thank you for helping to keep this project secure! + diff --git a/docs/README_nuget.md b/docs/README_nuget.md index 184ff7f..5404302 100644 --- a/docs/README_nuget.md +++ b/docs/README_nuget.md @@ -1,12 +1,13 @@ # Umbraco.Community.BackOfficeOrganiser -[![Documentation](https://img.shields.io/badge/Docs-Quickstart-394933?style=flat&logo=github)](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/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.backofficeorganiser) -[![GitHub License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.BackOfficeOrganiser?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/blob/main/LICENSE) -[![NuGet Downloads](https://img.shields.io/nuget/dt/Umbraco.Community.BackOfficeOrganiser?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/Umbraco.Community.BackOfficeOrganiser/) +[![Documentation](https://img.shields.io/badge/Docs-Quickstart-394933?style=flat&logo=github)](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser#quick-start) +[![Umbraco Marketplace](https://img.shields.io/badge/Umbraco-Marketplace-%233544B1?style=flat&logo=umbraco)](https://marketplace.umbraco.com/package/Umbraco.Community.BackOfficeOrganiser) +[![License](https://img.shields.io/github/license/jcdcdev/Umbraco.Community.BackOfficeOrganiser?color=8AB803&label=License&logo=github)](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser?tab=MIT-1-ov-file) +[![NuGet Downloads](https://img.shields.io/nuget/dt/Umbraco.Community.BackOfficeOrganiser?color=cc9900&label=Downloads&logo=nuget)](https://www.nuget.org/packages/Umbraco.Community.BackOfficeOrganiser) [![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/back-office-organiser) -Is your backoffice a bit untidy? + +Is your Backoffice a bit untidy? - Single-click (and opinionated) organiser for - Document Types @@ -14,12 +15,36 @@ Is your backoffice a bit untidy? - Member Types - Data Types -![A screenshot of the Back Office Organiser in action](https://raw.githubusercontent.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/main/docs/screenshots/backoffice.png) +## Quick Start + +- Go to the backoffice +- Click `Settings` +- Click `Organise` +- Select the types you wish to organise +- Click submit and confirm +- Refresh your page and enjoy a cleaner backoffice ✨ + +## Configuration + +Add the following to your `appsettings.json` file + +```json title="appsettings.json" + "BackOfficeOrganiser": { + "DataTypes": { + "InternalFolderName": "Internal", + "ThirdPartyFolderName": "Third Party", + "CustomFolderName": "Custom" + } + } +``` ## Contributing -Contributions to this package are most welcome! Please read the [Contributing Guidelines](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/blob/main/.github/CONTRIBUTING.md). +Contributions to this package are most welcome! Please visit the [Contributing](https://github.com/jcdcdev/Umbraco.Community.BackOfficeOrganiser/contribute) page. + +## Acknowledgements (Thanks) + +- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter) + -## Acknowledgments (thanks!) -- LottePitcher - [opinionated-package-starter](https://github.com/LottePitcher/opinionated-package-starter) \ No newline at end of file diff --git a/src/Umbraco.Community.BackOfficeOrganiser.Client/package-lock.json b/src/Umbraco.Community.BackOfficeOrganiser.Client/package-lock.json index 0160f8a..39ae653 100644 --- a/src/Umbraco.Community.BackOfficeOrganiser.Client/package-lock.json +++ b/src/Umbraco.Community.BackOfficeOrganiser.Client/package-lock.json @@ -11,10 +11,10 @@ "lit": "^3.3.0" }, "devDependencies": { - "@hey-api/openapi-ts": "^0.66.5", + "@hey-api/openapi-ts": "^0.67.1", "@umbraco-cms/backoffice": "^14.3.3", "typescript": "^5.8.3", - "vite": "^6.3.2" + "vite": "^6.3.5" } }, "node_modules/@esbuild/aix-ppc64": { @@ -418,14 +418,16 @@ } }, "node_modules/@hey-api/json-schema-ref-parser": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@hey-api/json-schema-ref-parser/-/json-schema-ref-parser-1.0.4.tgz", - "integrity": "sha512-IaJ4yFgU5r63KZyeySHRKSM1bavFIda8KdwCFi5BxQCIklltzEByBksNOPms+yHXpWWfR+OopIusVZV8roycYg==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@hey-api/json-schema-ref-parser/-/json-schema-ref-parser-1.0.5.tgz", + "integrity": "sha512-bWUV9ICwvU5I3YKVZqWIUXFC2SIXznUi/u+LqurJx6ILiyImfZD5+g/lj3w4EiyXxmjqyaxptzUz/1IgK3vVtw==", "dev": true, + "license": "MIT", "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.15", - "js-yaml": "^4.1.0" + "js-yaml": "^4.1.0", + "lodash": "^4.17.21" }, "engines": { "node": ">= 16" @@ -435,12 +437,13 @@ } }, "node_modules/@hey-api/openapi-ts": { - "version": "0.66.5", - "resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.66.5.tgz", - "integrity": "sha512-3bk0UMrIYdF7IC+SoJ941jni0rmc0cTk10MzcKarW5ybR2z631UrIU1sHNzadftaYL/WK+dbaDRwJ5Juhmf9/A==", + "version": "0.67.1", + "resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.67.1.tgz", + "integrity": "sha512-WXnh/mTl9m4UmeJd19iLLZyd7oTPw+lgnq+xcu3MmEIWYBx6BeLxsy5SFMYxcBPDyg6QtNQUFXBgUIxhGoh5Eg==", "dev": true, + "license": "MIT", "dependencies": { - "@hey-api/json-schema-ref-parser": "1.0.4", + "@hey-api/json-schema-ref-parser": "1.0.5", "c12": "2.0.1", "commander": "13.0.0", "handlebars": "4.7.8" @@ -462,7 +465,8 @@ "version": "7.1.3", "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@lit-labs/ssr-dom-shim": { "version": "1.3.0", @@ -765,7 +769,8 @@ "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/trusted-types": { "version": "2.0.7", @@ -1812,7 +1817,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "dev": true, + "license": "Python-2.0" }, "node_modules/base64-js": { "version": "1.5.1", @@ -2129,6 +2135,7 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -2164,6 +2171,13 @@ "@types/trusted-types": "^2.0.2" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, "node_modules/marked": { "version": "14.1.4", "resolved": "https://registry.npmjs.org/marked/-/marked-14.1.4.tgz", @@ -2591,17 +2605,18 @@ } }, "node_modules/vite": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.2.tgz", - "integrity": "sha512-ZSvGOXKGceizRQIZSz7TGJ0pS3QLlVY/9hwxVh17W3re67je1RKYzFHivZ/t0tubU78Vkyb9WnHPENSBCzbckg==", + "version": "6.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.5.tgz", + "integrity": "sha512-cZn6NDFE7wdTpINgs++ZJ4N49W2vRp8LCKrn3Ob1kYNtOo21vfDoaV5GzBfLU4MovSAB8uNRm4jgzVQZ+mBzPQ==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.25.0", - "fdir": "^6.4.3", + "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", - "tinyglobby": "^0.2.12" + "tinyglobby": "^0.2.13" }, "bin": { "vite": "bin/vite.js" diff --git a/src/Umbraco.Community.BackOfficeOrganiser.Client/package.json b/src/Umbraco.Community.BackOfficeOrganiser.Client/package.json index ab64930..980906e 100644 --- a/src/Umbraco.Community.BackOfficeOrganiser.Client/package.json +++ b/src/Umbraco.Community.BackOfficeOrganiser.Client/package.json @@ -13,10 +13,10 @@ "lit": "^3.3.0" }, "devDependencies": { - "@hey-api/openapi-ts": "^0.66.5", + "@hey-api/openapi-ts": "^0.67.1", "@umbraco-cms/backoffice": "^14.3.3", "typescript": "^5.8.3", - "vite": "^6.3.2" + "vite": "^6.3.5" }, "volta": { "node": "20.9.0"