From 2228fd64a45a908bc2a051fbe00a8fd0e48ec9b9 Mon Sep 17 00:00:00 2001 From: "support@subpointsolutions.com" Date: Mon, 24 Oct 2016 01:11:42 -0700 Subject: [PATCH] + WebNavigationSettingsDefinition - missed impl for AddNewPagesToNavigation/CreateFriendlyUrlsForNewPages props #906 --- .../WebNavigationSettingsDefinitionValidator.cs | 6 +++--- .../WebNavigationSettingsDefinitionValidator.cs | 12 +++++++----- .../WebNavigationSettingsScenariosTest.cs | 4 ++-- .../WebNavigationSettingsModelHandler.cs | 16 ++++++++-------- 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/SPMeta2/SPMeta2.Regression.CSOM.Standard/Validation/WebNavigationSettingsDefinitionValidator.cs b/SPMeta2/SPMeta2.Regression.CSOM.Standard/Validation/WebNavigationSettingsDefinitionValidator.cs index 310b15c7f..78ab7d3a0 100644 --- a/SPMeta2/SPMeta2.Regression.CSOM.Standard/Validation/WebNavigationSettingsDefinitionValidator.cs +++ b/SPMeta2/SPMeta2.Regression.CSOM.Standard/Validation/WebNavigationSettingsDefinitionValidator.cs @@ -209,7 +209,7 @@ public override void DeployModel(object modelHost, DefinitionBase model) var isGlobalNavIncludeTypesValid = false; - if (definition.CurrentNavigationShowSubsites.Value) + if (definition.CurrentNavigationShowPages.Value) { isGlobalNavIncludeTypesValid = ((currentNavIncludeTypesValue & 2) == 2) && (currentIncludeSubSitesValue); @@ -363,7 +363,7 @@ public override void DeployModel(object modelHost, DefinitionBase model) { assert.ShouldBeEqual((p, s, d) => { - var srcProp = s.GetExpressionValue(m => m.AddNewPagesToNavigation.Value); + var srcProp = s.GetExpressionValue(m => m.AddNewPagesToNavigation); return new PropertyValidationResult { @@ -392,7 +392,7 @@ public override void DeployModel(object modelHost, DefinitionBase model) { assert.ShouldBeEqual((p, s, d) => { - var srcProp = s.GetExpressionValue(m => m.CreateFriendlyUrlsForNewPages.Value); + var srcProp = s.GetExpressionValue(m => m.CreateFriendlyUrlsForNewPages); return new PropertyValidationResult { diff --git a/SPMeta2/SPMeta2.Regression.SSOM.Standard/Validation/WebNavigationSettingsDefinitionValidator.cs b/SPMeta2/SPMeta2.Regression.SSOM.Standard/Validation/WebNavigationSettingsDefinitionValidator.cs index 24658808d..9b369c12e 100644 --- a/SPMeta2/SPMeta2.Regression.SSOM.Standard/Validation/WebNavigationSettingsDefinitionValidator.cs +++ b/SPMeta2/SPMeta2.Regression.SSOM.Standard/Validation/WebNavigationSettingsDefinitionValidator.cs @@ -268,11 +268,12 @@ public override void DeployModel(object modelHost, DefinitionBase model) if (definition.AddNewPagesToNavigation.HasValue) { - if (!string.IsNullOrEmpty(definition.GlobalNavigationSource) || !string.IsNullOrEmpty(definition.CurrentNavigationSource)) + if (!string.IsNullOrEmpty(definition.GlobalNavigationSource) + || !string.IsNullOrEmpty(definition.CurrentNavigationSource)) { assert.ShouldBeEqual((p, s, d) => { - var srcProp = s.GetExpressionValue(m => m.AddNewPagesToNavigation.Value); + var srcProp = s.GetExpressionValue(m => m.AddNewPagesToNavigation); return new PropertyValidationResult { @@ -294,14 +295,15 @@ public override void DeployModel(object modelHost, DefinitionBase model) assert.SkipProperty(d => d.AddNewPagesToNavigation, "AddNewPagesToNavigation is null"); } - + if (definition.CreateFriendlyUrlsForNewPages.HasValue) { - if (!string.IsNullOrEmpty(definition.GlobalNavigationSource) || !string.IsNullOrEmpty(definition.CurrentNavigationSource)) + if (!string.IsNullOrEmpty(definition.GlobalNavigationSource) + || !string.IsNullOrEmpty(definition.CurrentNavigationSource)) { assert.ShouldBeEqual((p, s, d) => { - var srcProp = s.GetExpressionValue(m => m.CreateFriendlyUrlsForNewPages.Value); + var srcProp = s.GetExpressionValue(m => m.CreateFriendlyUrlsForNewPages); return new PropertyValidationResult { diff --git a/SPMeta2/SPMeta2.Regression.Tests/Impl/Scenarios/WebNavigationSettingsScenariosTest.cs b/SPMeta2/SPMeta2.Regression.Tests/Impl/Scenarios/WebNavigationSettingsScenariosTest.cs index de780a2e7..ee02b6e5b 100644 --- a/SPMeta2/SPMeta2.Regression.Tests/Impl/Scenarios/WebNavigationSettingsScenariosTest.cs +++ b/SPMeta2/SPMeta2.Regression.Tests/Impl/Scenarios/WebNavigationSettingsScenariosTest.cs @@ -550,9 +550,9 @@ public void CanDeploy_WebNavigationSettings_With_AddNewPages_And_FriendlyUrls() web.AddWebNavigationSettings(new WebNavigationSettingsDefinition() { AddNewPagesToNavigation = Rnd.Bool(), - CreateFriendlyUrlsForNewPages = Rnd.Bool() + CreateFriendlyUrlsForNewPages = Rnd.Bool(), - //GlobalNavigationSource = BuiltInStandardNavigationSources.PortalProvider, + GlobalNavigationSource = BuiltInStandardNavigationSources.PortalProvider, //GlobalNavigationShowSubsites = true, //GlobalNavigationShowPages = true, diff --git a/SPMeta2/SPMeta2.SSOM.Standard/ModelHandlers/WebNavigationSettingsModelHandler.cs b/SPMeta2/SPMeta2.SSOM.Standard/ModelHandlers/WebNavigationSettingsModelHandler.cs index 802f0c020..79c51b645 100644 --- a/SPMeta2/SPMeta2.SSOM.Standard/ModelHandlers/WebNavigationSettingsModelHandler.cs +++ b/SPMeta2/SPMeta2.SSOM.Standard/ModelHandlers/WebNavigationSettingsModelHandler.cs @@ -146,16 +146,16 @@ private void DeployNavigationSettings(object modelHost, WebModelHost webModelHos } } } + } - if (navigationModel.AddNewPagesToNavigation.HasValue) - { - thisWebNavSettings.AddNewPagesToNavigation = navigationModel.AddNewPagesToNavigation.Value; - } + if (navigationModel.AddNewPagesToNavigation.HasValue) + { + thisWebNavSettings.AddNewPagesToNavigation = navigationModel.AddNewPagesToNavigation.Value; + } - if (navigationModel.CreateFriendlyUrlsForNewPages.HasValue) - { - thisWebNavSettings.CreateFriendlyUrlsForNewPages = navigationModel.CreateFriendlyUrlsForNewPages.Value; - } + if (navigationModel.CreateFriendlyUrlsForNewPages.HasValue) + { + thisWebNavSettings.CreateFriendlyUrlsForNewPages = navigationModel.CreateFriendlyUrlsForNewPages.Value; } if (navigationModel.DisplayShowHideRibbonAction.HasValue)