Skip to content

Commit

Permalink
Fixed build errors and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasherceg committed Jun 4, 2024
1 parent 37b3826 commit 83fc30d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Framework/Framework/Controls/RouteLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ public string Text
/// Gets or sets the required culture of the page. This property is supported only when using localizable routes.
/// </summary>
[MarkupOptions(AllowBinding = false)]
public string Culture
public string? Culture
{
get { return (string)GetValue(CultureProperty); }
get { return (string?)GetValue(CultureProperty); }
set { SetValue(CultureProperty, value); }
}
public static readonly DotvvmProperty CultureProperty
= DotvvmProperty.Register<string, RouteLink>(c => c.Culture, null);
= DotvvmProperty.Register<string?, RouteLink>(c => c.Culture, null);

/// <summary>
/// Gets or sets a collection of parameters to be substituted in the route URL. If the current route contains a parameter with the same name, its value will be reused unless another value is specified here.
Expand Down Expand Up @@ -219,7 +219,7 @@ public static IEnumerable<ControlUsageError> ValidateUsage(ResolvedControl contr
}
}

var parameterDefinitions = route.ParameterNames;
var parameterDefinitions = route!.ParameterNames;
var parameterReferences = control.Properties.Where(i => i.Key is GroupedDotvvmProperty p && p.PropertyGroup == ParamsGroupDescriptor);

var undefinedReferences =
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/Framework/Routing/DotvvmRouteTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void AddRouteRedirection(string routeName, string urlPattern, Func<IDotvv
/// <param name="url">The URL.</param>
/// <param name="presenterType">The presenter factory.</param>
/// <param name="defaultValues">The default values.</param>
public void Add(string routeName, string? url, Type presenterType, object? defaultValues = null, LocalizedRouteUrl[] localizedUrls = null)
public void Add(string routeName, string? url, Type presenterType, object? defaultValues = null, LocalizedRouteUrl[]? localizedUrls = null)
{
ThrowIfFrozen();
if (!typeof(IDotvvmPresenter).IsAssignableFrom(presenterType))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,10 @@
}
},
"DotVVM.Framework.Controls.RouteLink": {
"Culture": {
"type": "System.String",
"onlyHardcoded": true
},
"Enabled": {
"type": "System.Boolean",
"defaultValue": true
Expand Down

0 comments on commit 83fc30d

Please sign in to comment.