diff --git a/.github/IDEAS.md b/.github/IDEAS.md index 363340f5..f07f33ec 100644 --- a/.github/IDEAS.md +++ b/.github/IDEAS.md @@ -20,6 +20,7 @@ - Nested Content - Reimagined. Reach for its heart, imagine a new landscape, another atmosphere, and see how it goes. + ### Internally used editors Could these internally used editors have potential as standalone property editors? @@ -29,6 +30,7 @@ Could these internally used editors have potential as standalone property editor - Data Table - Macro Picker + ### Validation None of the editors have explicit validation implemented, (only because I've never researched it). Let's explore the validation approaches for the editors. diff --git a/.github/README.md b/.github/README.md index 89bf385f..da0fdc57 100644 --- a/.github/README.md +++ b/.github/README.md @@ -43,7 +43,8 @@ Downloads are available on the [releases page](https://github.com/leekelleher/um #### Installation -> *Note:* Contentment has been developed against **Umbraco v8.6.1** and will support that version and above. +> *Note:* Contentment v2.x has been developed against **Umbraco v8.14.0** and will support that version and above. +> If you are using **Umbraco v8.6.1 (or above)**, you can continue to use Contentment v1.x. Contentment can be installed from either Our Umbraco or NuGet package repositories, or build manually from the source-code: @@ -129,7 +130,7 @@ For more information about the Mozilla Public License, please visit: -Current development effort: 920+ hours (between 2019-03-13 to 2021-04-14) +Current development effort: 1010+ hours (between 2019-03-13 to 2021-06-08) _To give you an idea of how much human developer time/effort has been put into making this package._ diff --git a/.github/ROADMAP.md b/.github/ROADMAP.md index 7ae3b38e..bf725e58 100644 --- a/.github/ROADMAP.md +++ b/.github/ROADMAP.md @@ -42,14 +42,14 @@ Property Editors are: ### v1.4 -- 🤫 +- _A bunch of (hidden) extra data-sources._ 🤫 ## v2 ### v2.0 -- _(At the time of writing),_ a breaking-change release _(following SemVer guidelines),_ of v1.3 features that compiles against Umbraco CMS v8.12. +- _(At the time of writing),_ a breaking-change release _(following SemVer guidelines),_ of v1.4.x features that compiles against Umbraco CMS v8.14. ### v2.1 diff --git a/VERSION b/VERSION index e1df5de7..359a5b95 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.4 \ No newline at end of file +2.0.0 \ No newline at end of file diff --git a/build/build-assets.ps1 b/build/build-assets.ps1 index a4382b2d..914bb28c 100644 --- a/build/build-assets.ps1 +++ b/build/build-assets.ps1 @@ -8,10 +8,11 @@ param( [string]$TargetDir, [string]$ProjectName, [string]$ProjectDir, - [string]$TargetDevWebsite, [string]$ConfigurationName ); +. "${SolutionDir}_vars.ps1"; + Write-Host $ConfigurationName; if ($ConfigurationName -eq 'Debug') { @@ -59,12 +60,12 @@ foreach($razorFile in $razorFiles){ # CSS - Bundle & Minify $targetCssPath = "${pluginFolder}contentment.css"; -Get-Content -Raw -Path "${ProjectDir}**\**\*.css" | Set-Content -Path $targetCssPath; +Get-Content -Raw -Path "${ProjectDir}**\**\*.css" | Set-Content -Encoding UTF8 -Path $targetCssPath; & "${SolutionDir}..\tools\AjaxMinifier.exe" $targetCssPath -o $targetCssPath # JS - Bundle & Minify $targetJsPath = "${pluginFolder}contentment.js"; -Get-Content -Raw -Path "${ProjectDir}**\**\*.js" | Set-Content -Path $targetJsPath; +Get-Content -Raw -Path "${ProjectDir}**\**\*.js" | Set-Content -Encoding UTF8 -Path $targetJsPath; & "${SolutionDir}..\tools\AjaxMinifier.exe" $targetJsPath -o $targetJsPath # In debug mode, copy the assets over to the local dev website diff --git a/build/build-pkgs.ps1 b/build/build-pkgs.ps1 index 25bfeb3d..b58962c3 100644 --- a/build/build-pkgs.ps1 +++ b/build/build-pkgs.ps1 @@ -4,26 +4,6 @@ # file, You can obtain one at https://mozilla.org/MPL/2.0/. -# https://gist.github.com/jageall/c5119d5ba26fa33602d1 -Function parseSemVer($version) { - $version -match "^(?\d+)(\.(?\d+))?(\.(?\d+))?(\-(?
[0-9A-Za-z\-\.]+))?(\+(?[0-9A-Za-z\-\.]+))?$" | Out-Null;
-    $major = [int]$matches['major'];
-    $minor = [int]$matches['minor'];
-    $patch = [int]$matches['patch'];
-    $pre = [string]$matches['pre'];
-    $build = [string]$matches['build'];
-
-    New-Object PSObject -Property @{
-        Major = $major
-        Minor = $minor
-        Patch = $patch
-        Pre = $pre
-        Build = $build
-        VersionString = $version
-    };
-}
-
-
 # Set various variables / folder paths
 
 $nugetPackageId = 'Our.Umbraco.Community.Contentment';
@@ -37,7 +17,7 @@ $licenseName = 'Mozilla Public License Version 2.0';
 $licenseUrl = 'https://mozilla.org/MPL/2.0/';
 $authorName = 'Lee Kelleher';
 $authorUrl = 'https://leekelleher.com/';
-$minUmbracoVersion = parseSemVer('8.6.1');
+$minUmbracoVersion = 8,14,0;
 $copyright = "Copyright " + [char]0x00A9 + " " + (Get-Date).year + " $authorName";
 
 $rootFolder = (Get-Item($MyInvocation.MyCommand.Path)).Directory.Parent.FullName;
@@ -46,22 +26,10 @@ $assetsFolder = Join-Path -Path $buildFolder -ChildPath 'assets';
 $srcFolder = Join-Path -Path $rootFolder -ChildPath 'src';
 
 
-# Get some package metadata - name, description, links, etc.
-
-$version = Get-Content -Path "${rootFolder}\VERSION";
-$semver = parseSemVer($version);
-
-
-# Update the assembly version number
-
-Set-Content -Path "${srcFolder}\${projectNamespace}\Properties\VersionInfo.cs" -Value @"
-using System.Reflection;
-
-[assembly: AssemblyVersion("$($semver.Major).$($semver.Minor)")]
-[assembly: AssemblyFileVersion("$($semver.Major).$($semver.Minor).$($semver.Patch)")]
-[assembly: AssemblyInformationalVersion("$($semver.VersionString)")]
-"@ -Encoding UTF8;
-
+# Get package version number
+$csprojXml = [xml](Get-Content -Path "${srcFolder}\${projectNamespace}\${projectNamespace}.csproj");
+$version = $csprojXml.Project.PropertyGroup.Version;
+Write-Host "Package version: $version";
 
 # Build the VS project
 
@@ -92,25 +60,25 @@ if (-NOT $?) {
 
 # Populate the Umbraco package manifest
 
-$umbFolder = Join-Path -Path $buildFolder -ChildPath '__umb';
+$umbFolder = Join-Path -Path $buildFolder -ChildPath "__umb";
 if (!(Test-Path -Path $umbFolder)) {New-Item -Path $umbFolder -Type Directory;}
 
-$umbracoManifest = Join-Path -Path $buildFolder -ChildPath 'manifest-umbraco.xml';
+$umbracoManifest = Join-Path -Path $buildFolder -ChildPath "manifest-umbraco.xml";
 $umbracoPackageXml = [xml](Get-Content $umbracoManifest);
-$umbracoPackageXml.umbPackage.info.package.version = "$($semver.VersionString)";
+$umbracoPackageXml.umbPackage.info.package.version = "$($version)";
 $umbracoPackageXml.umbPackage.info.package.name = $packageName;
 $umbracoPackageXml.umbPackage.info.package.iconUrl = $iconUrl;
 $umbracoPackageXml.umbPackage.info.package.license.set_InnerText($licenseName);
 $umbracoPackageXml.umbPackage.info.package.license.url = $licenseUrl;
 $umbracoPackageXml.umbPackage.info.package.url = $packageUrl;
-$umbracoPackageXml.umbPackage.info.package.requirements.major = "$($minUmbracoVersion.Major)";
-$umbracoPackageXml.umbPackage.info.package.requirements.minor = "$($minUmbracoVersion.Minor)";
-$umbracoPackageXml.umbPackage.info.package.requirements.patch = "$($minUmbracoVersion.Patch)";
+$umbracoPackageXml.umbPackage.info.package.requirements.major = "$($minUmbracoVersion[0])";
+$umbracoPackageXml.umbPackage.info.package.requirements.minor = "$($minUmbracoVersion[1])";
+$umbracoPackageXml.umbPackage.info.package.requirements.patch = "$($minUmbracoVersion[2])";
 $umbracoPackageXml.umbPackage.info.author.name = $authorName;
 $umbracoPackageXml.umbPackage.info.author.website = $authorUrl;
-$umbracoPackageXml.umbPackage.info.readme.'#cdata-section' = $packageDescription;
+$umbracoPackageXml.umbPackage.info.readme."#cdata-section" = $packageDescription;
 
-$filesXml = $umbracoPackageXml.CreateElement('files');
+$filesXml = $umbracoPackageXml.CreateElement("files");
 
 $assetFiles = Get-ChildItem -Path $assetsFolder -File -Recurse;
 foreach($assetFile in $assetFiles){
@@ -129,16 +97,16 @@ foreach($assetFile in $assetFiles){
 $umbracoPackageXml.umbPackage.ReplaceChild($filesXml, $umbracoPackageXml.SelectSingleNode("/umbPackage/files")) | Out-Null;
 $umbracoPackageXml.Save("${umbFolder}\package.xml");
 
-$artifactsFolder = Join-Path -Path $rootFolder -ChildPath 'artifacts';
+$artifactsFolder = Join-Path -Path $rootFolder -ChildPath "artifacts";
 if (!(Test-Path -Path $artifactsFolder)) {New-Item -Path $artifactsFolder -Type Directory;}
-Compress-Archive -Path "${umbFolder}\*" -DestinationPath "${artifactsFolder}\Contentment_$($semver.VersionString).zip" -Force;
+Compress-Archive -Path "${umbFolder}\*" -DestinationPath "${artifactsFolder}\Contentment_$version.zip" -Force;
 
 
 # Populate the NuGet package manifest
 
 Copy-Item -Path "${rootFolder}\docs\assets\img\logo.png" -Destination "${assetsFolder}\icon.png";
-& $nuget_exe pack "${buildFolder}\manifest-nuget-core.nuspec" -BasePath $assetsFolder -OutputDirectory $artifactsFolder -Version "$($semver.VersionString)" -Properties "id=$nugetPackageId;version=$($semver.VersionString);title=$nugetTitle;authors=$authorName;owners=$authorName;projectUrl=$packageUrl;requireLicenseAcceptance=false;description=$packageDescription;copyright=$copyright;license=MPL-2.0;language=en;tags=umbraco;minUmbracoVersion=$($minUmbracoVersion.VersionString);repositoryUrl=$packageUrl;"
-& $nuget_exe pack "${buildFolder}\manifest-nuget-web.nuspec" -BasePath $assetsFolder -OutputDirectory $artifactsFolder -Version "$($semver.VersionString)" -Properties "id=$nugetPackageId;version=$($semver.VersionString);title=$nugetTitle;authors=$authorName;owners=$authorName;projectUrl=$packageUrl;requireLicenseAcceptance=false;description=$packageDescription;copyright=$copyright;license=MPL-2.0;language=en;tags=umbraco;minUmbracoVersion=$($minUmbracoVersion.VersionString);repositoryUrl=$packageUrl;"
+& $nuget_exe pack "${buildFolder}\manifest-nuget-core.nuspec" -BasePath $assetsFolder -OutputDirectory $artifactsFolder -Version "$version" -Properties "id=$nugetPackageId;version=$version;title=$nugetTitle;authors=$authorName;owners=$authorName;projectUrl=$packageUrl;requireLicenseAcceptance=false;description=$packageDescription;copyright=$copyright;license=MPL-2.0;language=en;tags=umbraco;minUmbracoVersion=$($minUmbracoVersion[0]).$($minUmbracoVersion[1]).$($minUmbracoVersion[2]);repositoryUrl=$packageUrl;"
+& $nuget_exe pack "${buildFolder}\manifest-nuget-web.nuspec" -BasePath $assetsFolder -OutputDirectory $artifactsFolder -Version "$version" -Properties "id=$nugetPackageId;version=$version;title=$nugetTitle;authors=$authorName;owners=$authorName;projectUrl=$packageUrl;requireLicenseAcceptance=false;description=$packageDescription;copyright=$copyright;license=MPL-2.0;language=en;tags=umbraco;minUmbracoVersion=$($minUmbracoVersion[0]).$($minUmbracoVersion[1]).$($minUmbracoVersion[2]);repositoryUrl=$packageUrl;"
 
 
 # Tidy up folders
diff --git a/docs/editors/content-blocks.md b/docs/editors/content-blocks.md
index 61dc78a4..6fa3b193 100644
--- a/docs/editors/content-blocks.md
+++ b/docs/editors/content-blocks.md
@@ -167,6 +167,7 @@ There are several alternative block-based editors that you could use with Umbrac
 
 For further reading, here are a selection of insights...
 
+- [Poornima Nayar's article about **Content Blocks**, from her series about the various block editors for Umbraco](https://poornimanayar.co.uk/blog/contentment-content-blocks/)
 - [Paul Marden's **Landing Page article** on Skrift](https://skrift.io/issues/part-1-landing-pages/) - part of a wider series on exploring common practices.
 - [Building with blocks. Which Umbraco block builder is right for you?](https://24days.in/umbraco-cms/2020/umbraco-block-builders/) - Peter Gregory's 24 Days In Umbraco article.
 - [How to Pick a Block Style Editor](https://www.wearecogworks.com/blog/umbraco-v8-how-to-pick-a-block-style-editor/) - by Marcin Zajkowski on the Cogworks blog.
diff --git a/src/Umbraco.Community.Contentment.sln b/src/Umbraco.Community.Contentment.sln
index d03ab422..1be536dc 100644
--- a/src/Umbraco.Community.Contentment.sln
+++ b/src/Umbraco.Community.Contentment.sln
@@ -1,12 +1,13 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 16
-VisualStudioVersion = 16.0.28729.10
+VisualStudioVersion = 16.0.31105.61
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Community.Contentment", "Umbraco.Community.Contentment\Umbraco.Community.Contentment.csproj", "{7D440D19-44D0-474F-8BAB-A7DDF4062994}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D4F87338-D989-4C50-BF8E-EF4AF179B459}"
 	ProjectSection(SolutionItems) = preProject
+		_vars.ps1 = _vars.ps1
 		..\LICENSE = ..\LICENSE
 		..\VERSION = ..\VERSION
 	EndProjectSection
diff --git a/src/Umbraco.Community.Contentment/Composing/CompositionExtensions.cs b/src/Umbraco.Community.Contentment/Composing/CompositionExtensions.cs
index db5074ae..c143d5fd 100644
--- a/src/Umbraco.Community.Contentment/Composing/CompositionExtensions.cs
+++ b/src/Umbraco.Community.Contentment/Composing/CompositionExtensions.cs
@@ -10,8 +10,7 @@
 // as to reduce namespace imports and ease the developer experience. [LK]
 namespace Umbraco.Core.Composing
 {
-    // TODO: [LK:2021-03-04] Rename class to `CompositionExtensions` v2.0.0. For consistency with the other `Composition` extension classes.
-    public static partial class ContentmentCompositionExtensions
+    public static partial class CompositionExtensions
     {
         public static ContentmentListItemCollectionBuilder ContentmentListItems(this Composition composition)
         {
@@ -29,13 +28,13 @@ public static Composition UnlockContentment(this Composition composition)
                     .Add()
                     .Add()
                     .Add()
+                    .Add()
                     .Add()
                     .Add()
                     .Add()
                     .Add()
                     .Add()
                     .Add()
-                    .Add()
             ;
 
             return composition;
diff --git a/src/Umbraco.Community.Contentment/DataEditors/Buttons/ButtonsDataListEditor.cs b/src/Umbraco.Community.Contentment/DataEditors/Buttons/ButtonsDataListEditor.cs
index 36dbf391..4ac78b4a 100644
--- a/src/Umbraco.Community.Contentment/DataEditors/Buttons/ButtonsDataListEditor.cs
+++ b/src/Umbraco.Community.Contentment/DataEditors/Buttons/ButtonsDataListEditor.cs
@@ -20,6 +20,8 @@ public sealed class ButtonsDataListEditor : IDataListEditor
 
         public string Icon => "icon-tab";
 
+        public string Group => default;
+
         public IEnumerable Fields => new ConfigurationField[]
         {
             new ConfigurationField
diff --git a/src/Umbraco.Community.Contentment/DataEditors/Bytes/BytesConfigurationEditor.cs b/src/Umbraco.Community.Contentment/DataEditors/Bytes/BytesConfigurationEditor.cs
index 8af6f7fa..303284da 100644
--- a/src/Umbraco.Community.Contentment/DataEditors/Bytes/BytesConfigurationEditor.cs
+++ b/src/Umbraco.Community.Contentment/DataEditors/Bytes/BytesConfigurationEditor.cs
@@ -18,12 +18,13 @@ internal sealed class BytesConfigurationEditor : ConfigurationEditor
 
         public BytesConfigurationEditor()
         {
-            Fields.Add(
-                Kilo,
-                "Kilobytes?",
-                "How many bytes do you prefer in your kilobyte?",
-                IOHelper.ResolveUrl(RadioButtonListDataListEditor.DataEditorViewPath),
-                new Dictionary
+            Fields.Add(new ConfigurationField
+            {
+                Key = Kilo,
+                Name = "Kilobytes?",
+                Description = "How many bytes do you prefer in your kilobyte?",
+                View = IOHelper.ResolveUrl(RadioButtonListDataListEditor.DataEditorViewPath),
+                Config = new Dictionary
                 {
                     { Constants.Conventions.ConfigurationFieldAliases.Items, new[]
                         {
@@ -33,20 +34,23 @@ public BytesConfigurationEditor()
                     },
                     { ShowDescriptionsConfigurationField.ShowDescriptions, Constants.Values.True },
                     { Constants.Conventions.ConfigurationFieldAliases.DefaultValue, "1024" },
-                });
+                }
+            });
 
-            Fields.Add(
-                Decimals,
-                "Decimal places",
-                "How many decimal places would you like?",
-                IOHelper.ResolveUrl("~/umbraco/views/propertyeditors/slider/slider.html"),
-                new Dictionary
+            Fields.Add(new ConfigurationField
+            {
+                Key = Decimals,
+                Name = "Decimal places",
+                Description = "How many decimal places would you like?",
+                View = IOHelper.ResolveUrl("~/umbraco/views/propertyeditors/slider/slider.html"),
+                Config = new Dictionary
                 {
                     { "initVal1", 2 },
                     { "minVal", 0 },
                     { "maxVal", 10 },
                     { "step", 1 }
-                });
+                }
+            });
         }
 
         public override IDictionary ToValueEditor(object configuration)
diff --git a/src/Umbraco.Community.Contentment/DataEditors/CheckboxList/CheckboxListDataListEditor.cs b/src/Umbraco.Community.Contentment/DataEditors/CheckboxList/CheckboxListDataListEditor.cs
index a82d37a3..c44a2933 100644
--- a/src/Umbraco.Community.Contentment/DataEditors/CheckboxList/CheckboxListDataListEditor.cs
+++ b/src/Umbraco.Community.Contentment/DataEditors/CheckboxList/CheckboxListDataListEditor.cs
@@ -18,6 +18,8 @@ public sealed class CheckboxListDataListEditor : IDataListEditor
 
         public string Icon => "icon-fa fa-check-square-o";
 
+        public string Group => default;
+
         public IEnumerable Fields => new ConfigurationField[]
         {
             new ConfigurationField
diff --git a/src/Umbraco.Community.Contentment/DataEditors/CodeEditor/CodeEditorConfigurationEditor.cs b/src/Umbraco.Community.Contentment/DataEditors/CodeEditor/CodeEditorConfigurationEditor.cs
index fc4c791c..e3df5f7f 100644
--- a/src/Umbraco.Community.Contentment/DataEditors/CodeEditor/CodeEditorConfigurationEditor.cs
+++ b/src/Umbraco.Community.Contentment/DataEditors/CodeEditor/CodeEditorConfigurationEditor.cs
@@ -53,54 +53,57 @@ public CodeEditorConfigurationEditor()
                     if (modes.Count > 0)
                     {
                         DefaultConfiguration.Add(Mode, "razor");
-                        Fields.Add(
-                            Mode,
-                            "Language mode",
-                            "Select the programming language mode. The default mode is 'Razor'.",
-                            IOHelper.ResolveUrl(DropdownListDataListEditor.DataEditorViewPath),
-                            new Dictionary
+                        Fields.Add(new ConfigurationField
+                        {
+                            Key = Mode,
+                            Name = "Language mode",
+                            Description = "Select the programming language mode. The default mode is 'Razor'.",
+                            View = IOHelper.ResolveUrl(DropdownListDataListEditor.DataEditorViewPath),
+                            Config = new Dictionary
                             {
                                 { DropdownListDataListEditor.AllowEmpty, Constants.Values.False },
                                 { Constants.Conventions.ConfigurationFieldAliases.Items, modes },
-                            });
+                            }
+                        });
                     }
 
                     if (themes.Count > 0)
                     {
                         DefaultConfiguration.Add(Theme, "chrome");
-                        Fields.Add(
-                            Theme,
-                            nameof(Theme),
-                            "Set the theme for the code editor. The default theme is 'Chrome'.",
-                            IOHelper.ResolveUrl(DropdownListDataListEditor.DataEditorViewPath),
-                            new Dictionary
+                        Fields.Add(new ConfigurationField
+                        {
+                            Key = Theme,
+                            Name = nameof(Theme),
+                            Description = "Set the theme for the code editor. The default theme is 'Chrome'.",
+                            View = IOHelper.ResolveUrl(DropdownListDataListEditor.DataEditorViewPath),
+                            Config = new Dictionary
                             {
                                 { DropdownListDataListEditor.AllowEmpty, Constants.Values.False },
                                 { Constants.Conventions.ConfigurationFieldAliases.Items, themes },
-                            });
+                            }
+                        });
                     }
 
                     if (modes.Count > 0 || themes.Count > 0)
                     {
                         Fields.Add(new NotesConfigurationField($@"
Would you like to add more language modes and themes? -

This property editor makes use of AWS Cloud 9's Ace editor library that is distributed with Umbraco. By default, Umbraco ships a streamlined set of programming language modes and themes.

If you would like to add more modes and themes, you can do this by downloading the latest pre-packaged version of the Ace editor and copy any of the mode-* or theme-* files from the src-min-noconflict folder over to the {targetPath} folder in this Umbraco installation.

When you reload this screen, the new programming language modes and themes will appear in the dropdown options above.

-
", true)); } } } DefaultConfiguration.Add(FontSize, "small"); - Fields.Add( - FontSize, - "Font size", - @"Set the font size. The value must be a valid CSS font-size value. The default size is 'small'.", - IOHelper.ResolveUrl(TextInputDataEditor.DataEditorViewPath), - new Dictionary + Fields.Add(new ConfigurationField + { + Key = FontSize, + Name = "Font size", + Description = @"Set the font size. The value must be a valid CSS font-size value. The default size is 'small'.", + View = IOHelper.ResolveUrl(TextInputDataEditor.DataEditorViewPath), + Config = new Dictionary { { Constants.Conventions.ConfigurationFieldAliases.Items, new[] { new DataListItem { Name = "Extra extra small", Value = "xx-small" }, @@ -116,9 +119,16 @@ public CodeEditorConfigurationEditor() new DataListItem { Name = "Use ems?", Value = "0.8em" }, new DataListItem { Name = "Use rems?", Value = "1.2rem" }, } }, - }); + } + }); - Fields.Add(UseWrapMode, "Word wrapping", "Select to enable word wrapping.", "boolean"); + Fields.Add(new ConfigurationField + { + Key = UseWrapMode, + Name = "Word wrapping", + Description = "Select to enable word wrapping.", + View = "boolean" + }); // NOTE: [LK:2019-06-07] Hidden the advanced options (for now), need to review. //Fields.Add("showGutter", "Show gutter?", "Select to show the left-hand side gutter in the code editor.", "boolean"); @@ -134,10 +144,22 @@ public CodeEditorConfigurationEditor() //Fields.Add("readonly", "readonly", "[A friendly description]", "boolean");// readonly: 0, DefaultConfiguration.Add(MinLines, 12); - Fields.Add(MinLines, "Minimum lines", "Set the minimum number of lines that the editor will be. The default is 12 lines.", IOHelper.ResolveUrl(NumberInputDataEditor.DataEditorViewPath)); + Fields.Add(new ConfigurationField + { + Key = MinLines, + Name = "Minimum lines", + Description = "Set the minimum number of lines that the editor will be. The default is 12 lines.", + View = IOHelper.ResolveUrl(NumberInputDataEditor.DataEditorViewPath) + }); DefaultConfiguration.Add(MaxLines, 30); - Fields.Add(MaxLines, "Maximum lines", "Set the maximum number of lines that the editor can be. If left empty, the editor will not auto-scale.", IOHelper.ResolveUrl(NumberInputDataEditor.DataEditorViewPath)); + Fields.Add(new ConfigurationField + { + Key = MaxLines, + Name = "Maximum lines", + Description = "Set the maximum number of lines that the editor can be. If left empty, the editor will not auto-scale.", + View = IOHelper.ResolveUrl(NumberInputDataEditor.DataEditorViewPath) + }); } } } diff --git a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/ConfigurationEditorModel.cs b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/ConfigurationEditorModel.cs index 63e0bcd4..78505d1a 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/ConfigurationEditorModel.cs +++ b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/ConfigurationEditorModel.cs @@ -13,7 +13,7 @@ namespace Umbraco.Community.Contentment.DataEditors { [EditorBrowsable(EditorBrowsableState.Never)] [JsonObject(NamingStrategyType = typeof(CamelCaseNamingStrategy))] - public sealed class ConfigurationEditorModel + public sealed class ConfigurationEditorModel : IConfigurationEditorItem { public string Key { get; set; } @@ -23,6 +23,9 @@ public sealed class ConfigurationEditorModel public string Icon { get; set; } + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public string Group { get; set; } + public IEnumerable Fields { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] diff --git a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/ConfigurationEditorUtility.cs b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/ConfigurationEditorUtility.cs index 1a3f3499..5e248f66 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/ConfigurationEditorUtility.cs +++ b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/ConfigurationEditorUtility.cs @@ -61,6 +61,7 @@ public ConfigurationEditorModel GetConfigurationEditorModel(T item, bool igno Name = item.Name ?? type.Name.SplitPascalCasing(), Description = item.Description, Icon = item.Icon ?? Core.Constants.Icons.DefaultIcon, + Group = item.Group, Fields = fields, DefaultValues = item.DefaultValues, OverlaySize = item.OverlaySize, diff --git a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.js b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.js index 80058fcb..734b32a9 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.js +++ b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.js @@ -117,9 +117,9 @@ angular.module("umbraco").controller("Umbraco.Community.Contentment.DataEditors. function add() { - var items = Object.toBoolean(config.allowDuplicates) ? config.items : _.reject(config.items, function (x) { // TODO: Replace Underscore.js dependency. [LK:2020-03-02] - return _.find($scope.model.value, function (y) { return x.key === y.key; }); // TODO: Replace Underscore.js dependency. [LK:2020-03-02] - }); + var items = Object.toBoolean(config.allowDuplicates) + ? config.items + : config.items.filter(x => $scope.model.value.some(y => x.key === y.key) === false); editorService.open({ view: config.overlayView, diff --git a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.overlay.html b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.overlay.html index 42b61af2..6ca789af 100644 --- a/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.overlay.html +++ b/src/Umbraco.Community.Contentment/DataEditors/ConfigurationEditor/configuration-editor.overlay.html @@ -19,20 +19,20 @@ - + + + +
  • + +
    + + +
    + + + + + diff --git a/src/Umbraco.Community.Contentment/Web/UI/backoffice-ui-shim.css b/src/Umbraco.Community.Contentment/Web/UI/backoffice-ui-shim.css index c4d74d22..4f1cd73c 100644 --- a/src/Umbraco.Community.Contentment/Web/UI/backoffice-ui-shim.css +++ b/src/Umbraco.Community.Contentment/Web/UI/backoffice-ui-shim.css @@ -18,17 +18,6 @@ width: 20px; } -/* Enables the use of the Umbraco icon in the backoffice. */ -[class].icon-umbraco { - background-image: url(/umbraco/assets/img/application/logo_black.png); - background-repeat: no-repeat; - background-size: contain; -} - -.umb-action-link .icon-umbraco { - height: 30px; -} - /* Anchor links within `.alert-form` are rendered as white, (appearing invisible) */ .alert-form a { color: #1b264f; diff --git a/src/Umbraco.Community.Contentment/packages.config b/src/Umbraco.Community.Contentment/packages.config deleted file mode 100644 index e24ef585..00000000 --- a/src/Umbraco.Community.Contentment/packages.config +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/_vars.ps1 b/src/_vars.ps1 new file mode 100644 index 00000000..4862f6dc --- /dev/null +++ b/src/_vars.ps1 @@ -0,0 +1,7 @@ +# Copyright © 2021 Lee Kelleher. +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at https://mozilla.org/MPL/2.0/. + +# Sets the path for development site. +$TargetDevWebsite = "C:\path\to\umbraco";