V10/bugfix/variant permissions segments (#12890)

* Remove null check from MapperContext.SetCulture and .SetSegment

We need to be able to set these to null, since null = invariant / default segment

* show segment label on property

* Add ContentVariation to ContentPropertyDisplay

* Add ContentVariation to DocumentTypeDisplay

* Change variations to be on ContentTypeBasic.cs

* don't cache value

* show correct label and unlock text for culture and segment variations

* make lock overlay take up less space

Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
Co-authored-by: Zeegaan <nge@umbraco.dk>
This commit is contained in:
Mads Rasmussen
2022-08-24 16:17:56 +02:00
committed by Bjarke Berg
parent 128dd42b47
commit bfbc2abca8
15 changed files with 89 additions and 35 deletions

View File

@@ -26,24 +26,12 @@ public static class MapperContextExtensions
/// <summary>
/// Sets a context culture.
/// </summary>
public static void SetCulture(this MapperContext context, string? culture)
{
if (culture is not null)
{
context.Items[CultureKey] = culture;
}
}
public static void SetCulture(this MapperContext context, string? culture) => context.Items[CultureKey] = culture;
/// <summary>
/// Sets a context segment.
/// </summary>
public static void SetSegment(this MapperContext context, string? segment)
{
if (segment is not null)
{
context.Items[SegmentKey] = segment;
}
}
public static void SetSegment(this MapperContext context, string? segment) => context.Items[SegmentKey] = segment;
/// <summary>
/// Get included properties.