Skip to content

Commit 5ce363d

Browse files
committed
chore: add jcdcdev.Umbraco.Core
1 parent af85f58 commit 5ce363d

File tree

2 files changed

+5
-29
lines changed

2 files changed

+5
-29
lines changed

src/jcdcdev.Umbraco.ReadingTime/Core/ReadingTimeNotificationHandler.cs

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Humanizer.Localisation;
2+
using jcdcdev.Umbraco.Core.Extensions;
23
using jcdcdev.Umbraco.ReadingTime.Core.Extensions;
34
using jcdcdev.Umbraco.ReadingTime.Core.PropertyEditors;
45
using Umbraco.Cms.Core.Events;
@@ -53,40 +54,12 @@ public async Task HandleAsync(SendingContentNotification notification, Cancellat
5354
return;
5455
}
5556

56-
var properties = new List<ContentPropertyDisplay>();
57-
foreach (var variant in notification.Content.Variants)
58-
{
59-
foreach (var tab in variant.Tabs)
60-
{
61-
var tabbedProperties = tab.Properties?.ToList() ?? new List<ContentPropertyDisplay>();
62-
if (!tabbedProperties.Any())
63-
{
64-
continue;
65-
}
66-
67-
foreach (var property in tabbedProperties)
68-
{
69-
if (property.PropertyEditor == null)
70-
{
71-
continue;
72-
}
73-
74-
if (property.PropertyEditor.Alias != Constants.PropertyEditorAlias)
75-
{
76-
continue;
77-
}
78-
79-
properties.Add(property);
80-
}
81-
}
82-
}
83-
57+
var properties = notification.Content.GetProperties(Constants.PropertyEditorAlias).ToList();
8458
if (!properties.Any())
8559
{
8660
return;
8761
}
8862

89-
9063
foreach (var property in properties)
9164
{
9265
var config = property.ConfigNullable ?? new Dictionary<string, object?>();

src/jcdcdev.Umbraco.ReadingTime/jcdcdev.Umbraco.ReadingTime.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,21 @@
2323
</PropertyGroup>
2424

2525
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
26+
<PackageReference Include="jcdcdev.Umbraco.Core" Version="0.3.0"/>
2627
<PackageReference Include="Umbraco.Cms.Core" Version="[10.4.0,11.0.0)"/>
2728
<PackageReference Include="Umbraco.Cms.Infrastructure" Version="[10.4.0,11.0.0)"/>
2829
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="[10.4.0,11.0.0)"/>
2930
</ItemGroup>
3031

3132
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
33+
<PackageReference Include="jcdcdev.Umbraco.Core" Version="0.3.0"/>
3234
<PackageReference Include="Umbraco.Cms.Core" Version="[12.0.0,13.0.0)"/>
3335
<PackageReference Include="Umbraco.Cms.Infrastructure" Version="[12.0.0,13.0.0)"/>
3436
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="[12.0.0,13.0.0)"/>
3537
</ItemGroup>
3638

3739
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
40+
<PackageReference Include="jcdcdev.Umbraco.Core" Version="0.3.0"/>
3841
<PackageReference Include="Umbraco.Cms.Core" Version="[13.2.0,14.0.0)"/>
3942
<PackageReference Include="Umbraco.Cms.Infrastructure" Version="[13.2.0,14.0.0)"/>
4043
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="[13.2.0,14.0.0)"/>

0 commit comments

Comments
 (0)