From fa171e4553179ccb17f76e50fbaddd7b9c976bf5 Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Fri, 23 Mar 2018 15:33:42 +0100 Subject: [PATCH 1/3] Added culture property to Backoffice tour --- src/Umbraco.Web/Models/BackOfficeTour.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Models/BackOfficeTour.cs b/src/Umbraco.Web/Models/BackOfficeTour.cs index 268d5667f4..d5987ec5bc 100644 --- a/src/Umbraco.Web/Models/BackOfficeTour.cs +++ b/src/Umbraco.Web/Models/BackOfficeTour.cs @@ -11,7 +11,7 @@ namespace Umbraco.Web.Models { public BackOfficeTour() { - RequiredSections = new List(); + RequiredSections = new List(); } [DataMember(Name = "name")] @@ -28,5 +28,8 @@ namespace Umbraco.Web.Models public List RequiredSections { get; set; } [DataMember(Name = "steps")] public BackOfficeTourStep[] Steps { get; set; } + + [DataMember(Name = "culture")] + public string Culture { get; set; } } } From 29bb86ea1371249e4acc76bb2f5d8e0744f2c004 Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Fri, 23 Mar 2018 16:37:13 +0100 Subject: [PATCH 2/3] Filter tours based on current users culture --- src/Umbraco.Web/Editors/TourController.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Umbraco.Web/Editors/TourController.cs b/src/Umbraco.Web/Editors/TourController.cs index 98a01f2c6e..d544d3d1ef 100644 --- a/src/Umbraco.Web/Editors/TourController.cs +++ b/src/Umbraco.Web/Editors/TourController.cs @@ -124,6 +124,7 @@ namespace Umbraco.Web.Editors PluginName = pluginName, Tours = tours .Where(x => aliasFilters.Count == 0 || aliasFilters.All(filter => filter.IsMatch(x.Alias)) == false) + .Where(x => x.Culture == null || string.IsNullOrEmpty(x.Culture) || x.Culture.Equals(Security.CurrentUser.Language, StringComparison.InvariantCultureIgnoreCase)) .ToArray() }; From 36d6b6a2547844388fca01cf30e4852c6556d91d Mon Sep 17 00:00:00 2001 From: Dave Woestenborghs Date: Tue, 27 Mar 2018 14:22:51 +0200 Subject: [PATCH 3/3] U4-11150 merged where statements in to one statement --- src/Umbraco.Web/Editors/TourController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Editors/TourController.cs b/src/Umbraco.Web/Editors/TourController.cs index d544d3d1ef..a493ea5b99 100644 --- a/src/Umbraco.Web/Editors/TourController.cs +++ b/src/Umbraco.Web/Editors/TourController.cs @@ -123,8 +123,8 @@ namespace Umbraco.Web.Editors FileName = Path.GetFileNameWithoutExtension(tourFile), PluginName = pluginName, Tours = tours - .Where(x => aliasFilters.Count == 0 || aliasFilters.All(filter => filter.IsMatch(x.Alias)) == false) - .Where(x => x.Culture == null || string.IsNullOrEmpty(x.Culture) || x.Culture.Equals(Security.CurrentUser.Language, StringComparison.InvariantCultureIgnoreCase)) + .Where(x => (aliasFilters.Count == 0 || aliasFilters.All(filter => filter.IsMatch(x.Alias)) == false) + && (x.Culture == null || string.IsNullOrEmpty(x.Culture) || x.Culture.Equals(Security.CurrentUser.Language, StringComparison.InvariantCultureIgnoreCase))) .ToArray() };