Skip to content

Commit

Permalink
Updated package to target Umbraco 13 😎
Browse files Browse the repository at this point in the history
  • Loading branch information
abjerner committed Jan 30, 2024
1 parent be11a64 commit 85c9f15
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 24 deletions.
2 changes: 1 addition & 1 deletion debug.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@echo off
dotnet build src/Limbo.Umbraco.Tables --configuration Debug /t:rebuild /t:pack -p:PackageOutputPath=c:\nuget\Umbraco10
dotnet build src/Limbo.Umbraco.Tables --configuration Debug /t:rebuild /t:pack -p:PackageOutputPath=c:\nuget\Umbraco13
16 changes: 8 additions & 8 deletions src/Limbo.Umbraco.Tables/Limbo.Umbraco.Tables.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<LangVersion>10.0</LangVersion>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>12.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<StaticWebAssetBasePath>App_Plugins/$(AssemblyName)</StaticWebAssetBasePath>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>1.1.3</VersionPrefix>
<VersionPrefix>13.0.0-alpha000</VersionPrefix>
<VersionSuffix Condition="'$(Configuration)'=='Debug'">build$([System.DateTime]::UtcNow.ToString(`yyyyMMddHHmm`))</VersionSuffix>
<Company>Limbo</Company>
<Authors>Anders Bjerner</Authors>
<Copyright>Copyright © $([System.DateTime]::UtcNow.ToString(`yyyy`))</Copyright>
<Title>Limbo Tables</Title>
<Description>Table editor for Umbraco 10+.</Description>
<Description>Table editor for Umbraco 13.</Description>
</PropertyGroup>

<!-- Information for the NuGet package -->
<PropertyGroup>
<PackageId>Limbo.Umbraco.Tables</PackageId>
<PackageTags>Skybrud, Limbo, Umbraco, Tables, Data, StructuredData, Table, Umbraco-Marketplace</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://packages.limbo.works/limbo.umbraco.tables/v1/</PackageProjectUrl>
<PackageProjectUrl>https://packages.limbo.works/limbo.umbraco.tables/v13/</PackageProjectUrl>
<PackageIcon>Limbo.png</PackageIcon>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/limbo-works/Limbo.Umbraco.Tables</RepositoryUrl>
Expand All @@ -31,9 +31,9 @@
<!-- Include NuGet dependencies -->
<ItemGroup>
<PackageReference Include="Skybrud.Essentials" Version="1.1.54" />
<PackageReference Include="Umbraco.Cms.Core" Version="[10.0.0,12.999)" />
<PackageReference Include="Umbraco.Cms.Web.Website" Version="[10.0.0,12.999)" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="[10.0.0,12.999)" />
<PackageReference Include="Umbraco.Cms.Core" Version="[13.1.0,13.999)" />
<PackageReference Include="Umbraco.Cms.Web.Website" Version="[13.1.0,13.999)" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="[13.1.0,13.999)" />
</ItemGroup>

<!-- Backoffice assets -->
Expand Down
12 changes: 1 addition & 11 deletions src/Limbo.Umbraco.Tables/Manifests/TablesManifestFilter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Reflection;
using Umbraco.Cms.Core.Manifest;

namespace Limbo.Umbraco.Tables.Manifests;
Expand All @@ -13,6 +12,7 @@ public void Filter(List<PackageManifest> manifests) {
// Initialize a new manifest filter for this package
PackageManifest manifest = new() {
AllowPackageTelemetry = true,
PackageId = TablesPackage.Alias,
PackageName = TablesPackage.Name,
Version = TablesPackage.InformationalVersion,
BundleOptions = BundleOptions.Independent,
Expand All @@ -24,16 +24,6 @@ public void Filter(List<PackageManifest> manifests) {
Stylesheets = new[] { $"/App_Plugins/{TablesPackage.Alias}/Styles/Styles.css" }
};

// The "PackageId" property isn't available prior to Umbraco 12, and since the package is build against
// Umbraco 10, we need to use reflection for setting the property value for Umbraco 12+. Ideally this
// shouldn't fail, but we might at least add a try/catch to be sure
try {
PropertyInfo? property = manifest.GetType().GetProperty("PackageId");
property?.SetValue(manifest, TablesPackage.Alias);
} catch {
// We don't really care about the exception
}

// Append the manifest
manifests.Add(manifest);

Expand Down
2 changes: 1 addition & 1 deletion src/Limbo.Umbraco.Tables/Parsers/TablesHtmlParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public TablesHtmlParser(HtmlLocalLinkParser linkParser, HtmlUrlParser urlParser,
/// <param name="sourceString">The HTML string to be parsed.</param>
/// <param name="preview">Whether the HTML string should be parsed in preview mode.</param>
/// <returns>The parsed HTML string.</returns>
[return: NotNullIfNotNull("sourceString")]
[return: NotNullIfNotNull(nameof(sourceString))]
public string? Parse(string? sourceString, bool preview) {

if (sourceString == null) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ public class TableConfiguration {
[ConfigurationField("rte", "Rich text editor", "views/propertyeditors/rte/rte.prevalues.html", Description = "Rich text editor configuration", HideLabel = true)]
public object? Rte { get; set; }

/// <summary>
/// Gets or sets the overlay size of the link picker overlay.
/// </summary>
[ConfigurationField("overlaySize", "Overlay Size", "overlaysize", Description = "Select the width of the link picker overlay.")]
public string? OverlaySize { get; set; }

/// <summary>
/// Gets or sets the property cache level of the underlying property value converter. Defaults to <see cref="PropertyCacheLevel.Elements"/> if not specified.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Limbo.Umbraco.Tables/TablesPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ public class TablesPackage {
/// <summary>
/// Gets the URL of the documentation for this package.
/// </summary>
public const string DocumentationUrl = "https://packages.limbo.works/limbo.umbraco.tables/v1/docs/";
public const string DocumentationUrl = "https://packages.limbo.works/limbo.umbraco.tables/v13/docs/";

}
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,13 @@
label: "",
view: "rte",
config: {
editor: $scope.model.config.rte
editor: $scope.model.config.rte,
overlaySize: $scope.model.config.overlaySize
},
value: cell.value
},
submit: function (model) {
cell.value = model.prop.value;
cell.value = model.prop.value?.markup ? model.prop.value.markup : model.prop.value;
editorService.close();
},
close: function () {
Expand Down

0 comments on commit 85c9f15

Please sign in to comment.