From fb8f4482afaee5eda1fa5151aaef3a2453b20df9 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Sat, 18 May 2024 10:30:05 +0100 Subject: [PATCH 1/8] :package: Updated Umbraco Marketplace metadata to update support for previous Umbraco versions. --- umbraco-marketplace.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/umbraco-marketplace.json b/umbraco-marketplace.json index b0c761cab..78961a1a5 100644 --- a/umbraco-marketplace.json +++ b/umbraco-marketplace.json @@ -75,5 +75,27 @@ "text input" ], "Title": "Contentment", + "VersionSpecificPackageIds": [ + { + "UmbracoMajorVersion": 8, + "PackageId": "Our.Umbraco.Community.Contentment" + }, + { + "UmbracoMajorVersion": 9, + "PackageId": "Our.Umbraco.Community.Contentment" + }, + { + "UmbracoMajorVersion": 10, + "PackageId": "Our.Umbraco.Community.Contentment" + }, + { + "UmbracoMajorVersion": 11, + "PackageId": "Our.Umbraco.Community.Contentment" + }, + { + "UmbracoMajorVersion": 12, + "PackageId": "Our.Umbraco.Community.Contentment" + } + ], "VideoUrl": "https://www.youtube.com/embed/alhbwyQkU1E" } From 4583f89a77e8030d095df0aa1ce9171b6d08da80 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Sat, 18 May 2024 10:32:18 +0100 Subject: [PATCH 2/8] Incremented version number, v5.1.0-develop --- VERSION | 2 +- .../Umbraco.Community.Contentment.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 28cbf7c0a..961fd920f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.0 \ No newline at end of file +5.1.0-develop \ No newline at end of file diff --git a/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj b/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj index e2c65a66c..034c2774c 100644 --- a/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj +++ b/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj @@ -14,7 +14,7 @@ Umbraco.Community.Contentment Contentment for Umbraco Contentment, a collection of components for Umbraco. - 5.0.0 + 5.1.0-develop Lee Kelleher Lee Kelleher $([System.DateTime]::Now.Year) © $(Company) From ca77e05f29046634afa5b4216917372ed7f48e7d Mon Sep 17 00:00:00 2001 From: leekelleher Date: Sun, 9 Jun 2024 16:06:59 +0100 Subject: [PATCH 3/8] :notebook: Updated README --- .github/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/README.md b/.github/README.md index 8ebf316a5..45c1976f3 100644 --- a/.github/README.md +++ b/.github/README.md @@ -4,7 +4,10 @@ > contentment /kənˈtɛntm(ə)nt/ - a state of happiness and satisfaction -[![Mozilla Public License](https://img.shields.io/badge/MPL--2.0-orange?label=license)](https://opensource.org/licenses/MPL-2) [![Latest version](https://img.shields.io/nuget/v/Umbraco.Community.Contentment?label=version)](https://marketplace.umbraco.com/package/umbraco.community.contentment) [![NuGet download count](https://img.shields.io/nuget/dt/Our.Umbraco.Community.Contentment.Core?label=downloads)](https://www.nuget.org/packages/Umbraco.Community.Contentment) +[![Mozilla Public License](https://img.shields.io/badge/MPL--2.0-orange?label=license)](https://opensource.org/licenses/MPL-2) [![Latest version](https://img.shields.io/nuget/v/Umbraco.Community.Contentment?label=version)](https://marketplace.umbraco.com/package/umbraco.community.contentment) [![NuGet download count](https://img.shields.io/nuget/dt.Umbraco.Community.Contentment?label=downloads)](https://www.nuget.org/packages/Umbraco.Community.Contentment) + +> [!IMPORTANT] +> If you are looking for **Contentment for Umbraco 14** (Bellissima, the new backoffice), [please see the latest progress updates](https://github.com/leekelleher/umbraco-contentment/discussions/357)! ### What is it? From ad6a8468d90dc03efdbd8768006ccca0f3425434 Mon Sep 17 00:00:00 2001 From: Anders Bjerner Date: Fri, 21 Jun 2024 17:40:59 +0200 Subject: [PATCH 4/8] Update README.md --- .github/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/README.md b/.github/README.md index 45c1976f3..23bfa6d8b 100644 --- a/.github/README.md +++ b/.github/README.md @@ -4,7 +4,7 @@ > contentment /kənˈtɛntm(ə)nt/ - a state of happiness and satisfaction -[![Mozilla Public License](https://img.shields.io/badge/MPL--2.0-orange?label=license)](https://opensource.org/licenses/MPL-2) [![Latest version](https://img.shields.io/nuget/v/Umbraco.Community.Contentment?label=version)](https://marketplace.umbraco.com/package/umbraco.community.contentment) [![NuGet download count](https://img.shields.io/nuget/dt.Umbraco.Community.Contentment?label=downloads)](https://www.nuget.org/packages/Umbraco.Community.Contentment) +[![Mozilla Public License](https://img.shields.io/badge/MPL--2.0-orange?label=license)](https://opensource.org/licenses/MPL-2) [![Latest version](https://img.shields.io/nuget/v/Umbraco.Community.Contentment?label=version)](https://marketplace.umbraco.com/package/umbraco.community.contentment) [![NuGet download count](https://img.shields.io/nuget/dt/Umbraco.Community.Contentment?label=downloads)](https://www.nuget.org/packages/Umbraco.Community.Contentment) > [!IMPORTANT] > If you are looking for **Contentment for Umbraco 14** (Bellissima, the new backoffice), [please see the latest progress updates](https://github.com/leekelleher/umbraco-contentment/discussions/357)! From 2d2ea44e7f817da2d7dc1121a4c8b85817175aa9 Mon Sep 17 00:00:00 2001 From: Jesper Mayntzhusen <79840720+jemayn@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:02:13 +0200 Subject: [PATCH 5/8] Update data-picker.md --- docs/editors/data-picker.md | 82 ++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/docs/editors/data-picker.md b/docs/editors/data-picker.md index 858d9882c..44c1214e0 100644 --- a/docs/editors/data-picker.md +++ b/docs/editors/data-picker.md @@ -67,7 +67,87 @@ This interface contains two methods; The `DataListItem` model is made up of four `string` properties: `Name`, `Value`, `Description` _(optional)_ and `Icon` _(optional)_. -> `// TODO: Add a code snippet example of a custom data source.` +```csharp +using Umbraco.Cms.Core.Models; +using Umbraco.Cms.Core.PropertyEditors; +using Umbraco.Community.Contentment.DataEditors; + +namespace CodeExample; + +public class EventDataSource : IDataPickerSource +{ + private readonly IEventService _eventService; + + public EventDataSource(IEventService eventService) + { + _eventService = eventService; + } + + public string Name => "Events"; + public string Description => "List of events"; + public string Icon => "icon-movie-alt"; + public Dictionary? DefaultValues => default; + public IEnumerable? Fields => default; + public string Group => "Custom datasources"; + public OverlaySize OverlaySize => OverlaySize.Small; + + public async Task> GetItemsAsync( + Dictionary config, + IEnumerable values + ) + { + var items = new List(); + + var events = (await _eventService.GetEventsAsync()).ToList(); + + if (events.Count == 0) + { + return items; + } + + foreach (var eventItem in events) + { + items.Add(new DataListItem { Name = eventItem.Name, Value = eventItem.Id.ToString() }); + } + + return items.OrderBy(x => x.Name); + } + + public async Task> SearchAsync( + Dictionary config, + int pageNumber = 1, + int pageSize = 12, + string query = "" + ) + { + var items = new List(); + + var events = await _eventService.SearchEventsAsync(query, null, null, null, null); + + if (!events.Events.Any()) + { + return new PagedResult(0, pageNumber, pageSize) { Items = items }; + } + + foreach (var eventItem in events.Events) + { + items.Add( + new DataListItem + { + Name = eventItem.Name, + Value = eventItem.Id.ToString(), + Icon = "icon-movie-alt" + } + ); + } + + return new PagedResult(events.EventCount, pageNumber, pageSize) + { + Items = items + }; + } +} +``` ##### Accessing contextual content From 55f1bedc020cdf8960ce9f9f1059dcb7cffe9757 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Tue, 9 Jul 2024 17:23:44 +0100 Subject: [PATCH 6/8] :package: Updated Umbraco Marketplace metadata with latest schema. --- umbraco-marketplace.json | 1 + 1 file changed, 1 insertion(+) diff --git a/umbraco-marketplace.json b/umbraco-marketplace.json index 78961a1a5..7fc34efaf 100644 --- a/umbraco-marketplace.json +++ b/umbraco-marketplace.json @@ -75,6 +75,7 @@ "text input" ], "Title": "Contentment", + "VersionDependencyMode": "Default", "VersionSpecificPackageIds": [ { "UmbracoMajorVersion": 8, From dec33530991967f084e236af5b8042969e99c56a Mon Sep 17 00:00:00 2001 From: leekelleher Date: Mon, 19 Aug 2024 22:38:15 +0100 Subject: [PATCH 7/8] Set `DataListItemAttribute.Disabled` as non-nullable Fixes #411 --- src/Umbraco.Cms.13.x/DataSources/RenderPosition.cs | 5 ++++- .../DataEditors/DataList/DataListItemAttribute.cs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Cms.13.x/DataSources/RenderPosition.cs b/src/Umbraco.Cms.13.x/DataSources/RenderPosition.cs index 323c41cef..77b3b8e70 100644 --- a/src/Umbraco.Cms.13.x/DataSources/RenderPosition.cs +++ b/src/Umbraco.Cms.13.x/DataSources/RenderPosition.cs @@ -1,9 +1,12 @@ -using Umbraco.Community.Contentment.DataEditors; +using Umbraco.Community.Contentment.DataEditors; namespace Umbraco.Cms.Web.Common.PublishedModels { public enum RenderPosition { + [DataListItem(Name = "Html", Description = "The root <html> tag", Disabled = true)] + Html = 3, + [DataListItem(Name = "Head", Description = "Inside the <head> tags")] Head = 2, diff --git a/src/Umbraco.Community.Contentment/DataEditors/DataList/DataListItemAttribute.cs b/src/Umbraco.Community.Contentment/DataEditors/DataList/DataListItemAttribute.cs index 826d3de51..7dbd7512c 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/DataList/DataListItemAttribute.cs +++ b/src/Umbraco.Community.Contentment/DataEditors/DataList/DataListItemAttribute.cs @@ -15,13 +15,13 @@ public DataListItemAttribute() public string? Description { get; set; } - public bool? Disabled { get; set; } + public bool Disabled { get; set; } = false; public string? Group { get; set; } public string? Icon { get; set; } - public bool? Ignore { get; set; } + public bool Ignore { get; set; } = false; public string? Name { get; set; } From 1b7d99f18249a0ed73261144b7c8dbf2ea0ed90b Mon Sep 17 00:00:00 2001 From: leekelleher Date: Mon, 19 Aug 2024 22:38:28 +0100 Subject: [PATCH 8/8] Incremented version number, v5.0.2 --- VERSION | 2 +- .../Umbraco.Community.Contentment.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 961fd920f..3e827a3a1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.1.0-develop \ No newline at end of file +5.0.2 \ No newline at end of file diff --git a/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj b/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj index f7a9821ce..780826be3 100644 --- a/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj +++ b/src/Umbraco.Community.Contentment/Umbraco.Community.Contentment.csproj @@ -14,7 +14,7 @@ Umbraco.Community.Contentment Contentment for Umbraco Contentment, a collection of components for Umbraco. - 5.1.0-develop + 5.0.2 Lee Kelleher Lee Kelleher $([System.DateTime]::Now.Year) © $(Company)