Skip to content

Commit

Permalink
Merge pull request #117 from leekelleher/dev/v2.0
Browse files Browse the repository at this point in the history
Preparing v2.0.0 release
  • Loading branch information
leekelleher authored Jun 18, 2021
2 parents 1a989c0 + af459e4 commit c0be5f1
Show file tree
Hide file tree
Showing 86 changed files with 873 additions and 959 deletions.
2 changes: 2 additions & 0 deletions .github/IDEAS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -129,7 +130,7 @@ For more information about the Mozilla Public License, please visit: <https://ww
- [Lee Kelleher](https://leekelleher.com) - ([GitHub](https://github.com/leekelleher), [Twitter](https://twitter.com/leekelleher))

<details>
<summary>Current development effort: <b>920+ hours</b> (between 2019-03-13 to 2021-04-14)</summary>
<summary>Current development effort: <b>1010+ hours</b> (between 2019-03-13 to 2021-06-08)</summary>

_To give you an idea of how much human developer time/effort has been put into making this package._

Expand Down
4 changes: 2 additions & 2 deletions .github/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.4
2.0.0
7 changes: 4 additions & 3 deletions build/build-assets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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
Expand Down
66 changes: 17 additions & 49 deletions build/build-pkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 "^(?<major>\d+)(\.(?<minor>\d+))?(\.(?<patch>\d+))?(\-(?<pre>[0-9A-Za-z\-\.]+))?(\+(?<build>[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';
Expand All @@ -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;
Expand All @@ -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

Expand Down Expand Up @@ -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){
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/editors/content-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 2 additions & 1 deletion src/Umbraco.Community.Contentment.sln
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -29,13 +28,13 @@ public static Composition UnlockContentment(this Composition composition)
.Add<TimeZoneDataListSource>()
.Add<uCssClassNameDataListSource>()
.Add<UmbracoContentPropertiesDataListSource>()
.Add<UmbracoContentTypesDataListSource>()
.Add<UmbracoContentXPathDataListSource>()
.Add<UmbracoDictionaryDataListSource>()
.Add<UmbracoEntityDataListSource>()
.Add<UmbracoImageCropDataListSource>()
.Add<UmbracoMembersDataListSource>()
.Add<UmbracoMemberGroupDataListSource>()
.Add<UserDefinedDataListSource>()
;

return composition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public sealed class ButtonsDataListEditor : IDataListEditor

public string Icon => "icon-tab";

public string Group => default;

public IEnumerable<ConfigurationField> Fields => new ConfigurationField[]
{
new ConfigurationField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, object>
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<string, object>
{
{ Constants.Conventions.ConfigurationFieldAliases.Items, new[]
{
Expand All @@ -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<string, object>
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<string, object>
{
{ "initVal1", 2 },
{ "minVal", 0 },
{ "maxVal", 10 },
{ "step", 1 }
});
}
});
}

public override IDictionary<string, object> ToValueEditor(object configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public sealed class CheckboxListDataListEditor : IDataListEditor

public string Icon => "icon-fa fa-check-square-o";

public string Group => default;

public IEnumerable<ConfigurationField> Fields => new ConfigurationField[]
{
new ConfigurationField
Expand Down
Loading

0 comments on commit c0be5f1

Please sign in to comment.