From af986131ec99f49d3d124eac56cfba57fd75b7ed Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Mon, 16 Mar 2020 21:41:55 +0100 Subject: [PATCH 1/4] Set build to 2.1.0 beta --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 79bf53c..1d2cc50 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ image: Visual Studio 2017 # Version format -version: 2.0.0.{build} +version: 2.1.0.{build} branches: only: @@ -9,7 +9,7 @@ branches: - master init: - - set UMBRACO_PACKAGE_PRERELEASE_SUFFIX=rtm + - set UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta assembly_info: patch: true From 6199c6bd548a153c6cff48ab5c1805ceed477513 Mon Sep 17 00:00:00 2001 From: Rachel Breeze Date: Mon, 11 May 2020 20:21:50 +0100 Subject: [PATCH 2/4] Added support for the social media property in SEO Checker --- .../Community/SEOCheckerParserTests.cs | 81 +++++++++++++++++++ .../Our.Umbraco.Nexu.Parsers.Tests.csproj | 1 + .../Community/SEOCheckerParser.cs | 64 +++++++++++++++ .../Our.Umbraco.Nexu.Parsers.csproj | 1 + 4 files changed, 147 insertions(+) create mode 100644 src/Our.Umbraco.Nexu.Parsers.Tests/Community/SEOCheckerParserTests.cs create mode 100644 src/Our.Umbraco.Nexu.Parsers/Community/SEOCheckerParser.cs diff --git a/src/Our.Umbraco.Nexu.Parsers.Tests/Community/SEOCheckerParserTests.cs b/src/Our.Umbraco.Nexu.Parsers.Tests/Community/SEOCheckerParserTests.cs new file mode 100644 index 0000000..b0fb52a --- /dev/null +++ b/src/Our.Umbraco.Nexu.Parsers.Tests/Community/SEOCheckerParserTests.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Our.Umbraco.Nexu.Parsers.Tests.Community +{ + using System.Linq; + + using global::Umbraco.Core; + + using NUnit.Framework; + + using Our.Umbraco.Nexu.Common.Constants; + using Our.Umbraco.Nexu.Parsers.Core; + + [TestFixture] + public class SEOCheckerParserTests + { + [Test] + public void When_EditorAlias_Is_Not_Correct_IsParserFor_Should_Return_False() + { + // arrange + var parser = new SEOCheckerParser(); + + // act + var result = parser.IsParserFor(Constants.PropertyEditors.Aliases.Boolean); + + // assert + Assert.IsFalse(result); + } + + [Test] + public void When_EditorAlias_Is_Correct_IsParserFor_Should_Return_True() + { + // arrange + var parser = new SEOCheckerParser(); + + // act + var result = parser.IsParserFor("SEOChecker.SEOCheckerSocialPropertyEditor"); + + // assert + Assert.IsTrue(result); + } + + [Test] + public void When_Value_Is_Not_Set_GetRelatedEntities_Return_Empty_List() + { + // arrange + var parser = new SEOCheckerParser(); + + // act + var result = parser.GetRelatedEntities(null).ToList(); + + // assert + Assert.IsNotNull(result); + Assert.That(result.Count == 0); + } + + [Test] + public void When_Value_Is_Set_GetRelatedEntities_Return_List_With_Related_Entities() + { + // arrange + var seoCheckerXML = + "umb://media/6f2d6d1d13a8438789b3cf0cced47344 "; + + var parser = new SEOCheckerParser(); + + // act + var result = parser.GetRelatedEntities(seoCheckerXML).ToList(); + + // assert + Assert.IsNotNull(result); + Assert.That(result.Count == 1); + Assert.That(result.Count(x => x.RelationType == RelationTypes.DocumentToMedia) == 1); + + Assert.That(result.Exists(x => x.RelatedEntityUdi.ToString() == "umb://media/6f2d6d1d13a8438789b3cf0cced47344")); + } + } +} diff --git a/src/Our.Umbraco.Nexu.Parsers.Tests/Our.Umbraco.Nexu.Parsers.Tests.csproj b/src/Our.Umbraco.Nexu.Parsers.Tests/Our.Umbraco.Nexu.Parsers.Tests.csproj index b34cee2..b6f9d1c 100644 --- a/src/Our.Umbraco.Nexu.Parsers.Tests/Our.Umbraco.Nexu.Parsers.Tests.csproj +++ b/src/Our.Umbraco.Nexu.Parsers.Tests/Our.Umbraco.Nexu.Parsers.Tests.csproj @@ -191,6 +191,7 @@ + diff --git a/src/Our.Umbraco.Nexu.Parsers/Community/SEOCheckerParser.cs b/src/Our.Umbraco.Nexu.Parsers/Community/SEOCheckerParser.cs new file mode 100644 index 0000000..2e9a47e --- /dev/null +++ b/src/Our.Umbraco.Nexu.Parsers/Community/SEOCheckerParser.cs @@ -0,0 +1,64 @@ +using Our.Umbraco.Nexu.Parsers.Helpers; + +namespace Our.Umbraco.Nexu.Parsers.Core +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Xml.Linq; + using global::Umbraco.Core; + + using Our.Umbraco.Nexu.Common.Interfaces.Models; + using Our.Umbraco.Nexu.Common.Models; + + /// + /// Represents content picker parser. + /// + public class SEOCheckerParser : IPropertyValueParser + { + /// + public bool IsParserFor(string propertyEditorAlias) + { + return propertyEditorAlias.Equals("SEOChecker.SEOCheckerSocialPropertyEditor"); + } + + /// + public IEnumerable GetRelatedEntities(string value) + { + if (!string.IsNullOrWhiteSpace(value)) + { + var entities = new List(); + var model = XDocument.Parse(value).Root; + if (model != null) + { + try + { + var socialImage = model.Descendants("socialImage").FirstOrDefault(); + if (socialImage == null) + { + return Enumerable.Empty(); + } + + if (string.IsNullOrEmpty(socialImage.Value)) + { + return Enumerable.Empty(); + } + + foreach (var documentUdi in ParserUtilities.GetMediaUdiFromText(socialImage.Value).ToList()) + { + entities.Add(new RelatedMediaEntity + { + RelatedEntityUdi = documentUdi, + }); + } + + return entities; + } + catch { } + } + } + + return Enumerable.Empty(); + } + } +} diff --git a/src/Our.Umbraco.Nexu.Parsers/Our.Umbraco.Nexu.Parsers.csproj b/src/Our.Umbraco.Nexu.Parsers/Our.Umbraco.Nexu.Parsers.csproj index 880a1d5..d801297 100644 --- a/src/Our.Umbraco.Nexu.Parsers/Our.Umbraco.Nexu.Parsers.csproj +++ b/src/Our.Umbraco.Nexu.Parsers/Our.Umbraco.Nexu.Parsers.csproj @@ -146,6 +146,7 @@ + From 56b42bcb7414ec877e77066093def4c01820b08a Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Mon, 19 Oct 2020 12:38:51 +0200 Subject: [PATCH 3/4] new nuget api key --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1d2cc50..bcad6a7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -68,7 +68,7 @@ deploy: - provider: NuGet server: api_key: - secure: nbR13qs8xp+iOGpuDFDsz7AtYFcltXswOXo9N8fhqx+oJoRdkzHk3pjubFbfO6dx + secure: f5ijMJdo8hygOHm+RRD4pCBcRqj6uw4AWqDgG4MvA1x5sgdmcuRxvdtN1Cn2NB6I artifact: /.*\.nupkg/ on: branch: master From c767bf9c12454e06a4dfce899aa4eaeaab9353e9 Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Tue, 8 Dec 2020 10:52:13 +0100 Subject: [PATCH 4/4] Added block list editor support --- .../Core/BlockListEditorParser.cs | 10 ++++++++++ .../Our.Umbraco.Nexu.Parsers.csproj | 1 + 2 files changed, 11 insertions(+) create mode 100644 src/Our.Umbraco.Nexu.Parsers/Core/BlockListEditorParser.cs diff --git a/src/Our.Umbraco.Nexu.Parsers/Core/BlockListEditorParser.cs b/src/Our.Umbraco.Nexu.Parsers/Core/BlockListEditorParser.cs new file mode 100644 index 0000000..14c03d2 --- /dev/null +++ b/src/Our.Umbraco.Nexu.Parsers/Core/BlockListEditorParser.cs @@ -0,0 +1,10 @@ +namespace Our.Umbraco.Nexu.Parsers.Core +{ + public class BlockListEditorParser : BaseTextParser + { + public override bool IsParserFor(string propertyEditorAlias) + { + return propertyEditorAlias.Equals("Umbraco.BlockList"); + } + } +} diff --git a/src/Our.Umbraco.Nexu.Parsers/Our.Umbraco.Nexu.Parsers.csproj b/src/Our.Umbraco.Nexu.Parsers/Our.Umbraco.Nexu.Parsers.csproj index d801297..868b0e6 100644 --- a/src/Our.Umbraco.Nexu.Parsers/Our.Umbraco.Nexu.Parsers.csproj +++ b/src/Our.Umbraco.Nexu.Parsers/Our.Umbraco.Nexu.Parsers.csproj @@ -147,6 +147,7 @@ +