Skip to content

Commit

Permalink
Enabled warnings to be treated as errors
Browse files Browse the repository at this point in the history
[BREAKING] DropDownDataGrid SearchText renamed to SearchTextPlaceholder
  • Loading branch information
enchev committed Aug 16, 2023
1 parent 2317305 commit b1819ff
Show file tree
Hide file tree
Showing 24 changed files with 79 additions and 35 deletions.
9 changes: 9 additions & 0 deletions Radzen.Blazor/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2961,9 +2961,18 @@ private static string GetByteString(uint x)
}
}

/// <summary>
/// CoordinateSystem enum
/// </summary>
public enum CoordinateSystem
{
/// <summary>
/// Cartesian CoordinateSystem
/// </summary>
Cartesian,
/// <summary>
/// Cartesian CoordinateSystem
/// </summary>
Polar
}
}
6 changes: 3 additions & 3 deletions Radzen.Blazor/DropDownBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -780,14 +780,14 @@ internal virtual async System.Threading.Tasks.Task<LoadDataArgs> GetLoadDataArgs
#if NET5_0_OR_GREATER
if (AllowVirtualization)
{
return new Radzen.LoadDataArgs() { Skip = 0, Top = PageSize, Filter = searchText };
return await Task.FromResult(new Radzen.LoadDataArgs() { Skip = 0, Top = PageSize, Filter = searchText });
}
else
{
return new Radzen.LoadDataArgs() { Filter = searchText };
return await Task.FromResult(new Radzen.LoadDataArgs() { Filter = searchText });
}
#else
return new Radzen.LoadDataArgs() { Filter = searchText };
return await Task.FromResult(new Radzen.LoadDataArgs() { Filter = searchText });
#endif
}

Expand Down
23 changes: 12 additions & 11 deletions Radzen.Blazor/NotificationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,18 @@ public void Notify(NotificationMessage message)
}
}

/// <summary>
/// Notifies the specified severity.
/// </summary>
/// <param name="severity">The severity.</param>
/// <param name="summary">The summary.</param>
/// <param name="detail">The detail.</param>
/// <param name="duration">The duration.</param>
/// <param name="click">The click event.</param>
/// <param name="closeOnClick">If true, then the notification will be closed when clicked on.</param>
/// <param name="payload">Used to store a custom payload that can be retreived later in the click event handler.</param>
public void Notify(NotificationSeverity severity = NotificationSeverity.Info, string summary = "", string detail = "", double duration = 3000, Action<NotificationMessage> click = null, bool closeOnClick = false, object payload = null, Action<NotificationMessage> close = null)
/// <summary>
/// Notifies the specified severity.
/// </summary>
/// <param name="severity">The severity.</param>
/// <param name="summary">The summary.</param>
/// <param name="detail">The detail.</param>
/// <param name="duration">The duration.</param>
/// <param name="click">The click event.</param>
/// <param name="closeOnClick">If true, then the notification will be closed when clicked on.</param>
/// <param name="payload">Used to store a custom payload that can be retreived later in the click event handler.</param>
/// <param name="close">Action to be executed on close.</param>
public void Notify(NotificationSeverity severity = NotificationSeverity.Info, string summary = "", string detail = "", double duration = 3000, Action<NotificationMessage> click = null, bool closeOnClick = false, object payload = null, Action<NotificationMessage> close = null)
{
var newMessage = new NotificationMessage()
{
Expand Down
2 changes: 1 addition & 1 deletion Radzen.Blazor/PagedDataBoundComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public int PageSize
if (_PageSize != value)
{
_PageSize = value;
OnPageSizeChanged(value);
InvokeAsync(() => OnPageSizeChanged(value));
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Radzen.Blazor/Radzen.Blazor.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<NoWarn>BL9993;BL0007;BL0005</NoWarn>
<NoWarn>BL0007</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RazorLangVersion>3.0</RazorLangVersion>
<LangVersion>7.3</LangVersion>
Expand Down
1 change: 0 additions & 1 deletion Radzen.Blazor/RadzenDataFilterProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ public Type FilterPropertyType

object filterValue;
FilterOperator? filterOperator;
LogicalFilterOperator? logicalFilterOperator;

/// <summary>
/// Set parameters as an asynchronous operation.
Expand Down
4 changes: 2 additions & 2 deletions Radzen.Blazor/RadzenDataGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,15 @@
<RadzenDataGridFilterMenu Grid="@this" Column="@column" />
<RadzenDatePicker Disabled=@column.CanSetFilterValue() TValue="@object" Style="width:100%" AllowInput=@(AllowFilterDateInput) AllowClear="true"
ShowTime="false" ShowTimeOkButton="false" DateFormat="@getFilterDateFormat(column)"
Value="@column.GetFilterValue()" Change="@(args => { if(!args.HasValue) { ClearFilter(column, true); } else {column.SetFilterValue(args.Value); ApplyFilter(column, true);} })" />
Value="@column.GetFilterValue()" Change="@(args => { if(!args.HasValue) { InvokeAsync(() => ClearFilter(column, true)); } else {column.SetFilterValue(args.Value); InvokeAsync(() => ApplyFilter(column, true));} })" />
}
}
else if (PropertyAccess.IsNullableEnum(column.FilterPropertyType) || PropertyAccess.IsEnum(column.FilterPropertyType))
{
<RadzenDropDown Style="width:100%" AllowClear="true" AllowFiltering="false" TValue="@object"
Value=@column.GetFilterValue() Multiple="false" Placeholder="@EnumFilterSelectText" TextProperty="Text" ValueProperty="Value"
Data=@((PropertyAccess.IsNullableEnum(column.FilterPropertyType) ? new object[]{ new { Value = -1, Text = EnumNullFilterText}} : Enumerable.Empty<object>()).Concat(EnumExtensions.EnumAsKeyValuePair(Nullable.GetUnderlyingType(column.FilterPropertyType) ?? column.FilterPropertyType)))
Change="@(args => {column.SetFilterValue(args);column.SetFilterOperator(object.Equals(args, -1) ? FilterOperator.IsNull : FilterOperator.Equals);ApplyFilter(column, true);})" />
Change="@(args => {column.SetFilterValue(args);column.SetFilterOperator(object.Equals(args, -1) ? FilterOperator.IsNull : FilterOperator.Equals);InvokeAsync(() => ApplyFilter(column, true));})" />
}
else if (PropertyAccess.IsNumeric(column.FilterPropertyType))
{
Expand Down
13 changes: 8 additions & 5 deletions Radzen.Blazor/RadzenDataGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ public Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize<TItem> Virt
var query = view.AsQueryable().OrderBy(string.Join(',', Groups.Select(g => $"np({g.Property})")));
_groupedPagedView = query.GroupByMany(Groups.Select(g => $"np({g.Property})").ToArray()).ToList();

var totalItemsCount = _groupedPagedView.Count();
var totalItemsCount = await Task.FromResult(_groupedPagedView.Count());

return new Microsoft.AspNetCore.Components.Web.Virtualization.ItemsProviderResult<GroupResult>(_groupedPagedView.Skip(request.StartIndex).Take(top), totalItemsCount);
}
#endif

RenderFragment DrawRows(IList<RadzenDataGridColumn<TItem>> visibleColumns)
{
return new RenderFragment(builder =>
Expand Down Expand Up @@ -326,7 +326,7 @@ async Task DebounceFilter(RadzenDataGridColumn<TItem> column)
var inputValue = await JSRuntime.InvokeAsync<string>("Radzen.getInputValue", getFilterInputId(column));
if (!object.Equals(column.GetFilterValue(), inputValue))
{
await InvokeAsync(() => { OnFilter(new ChangeEventArgs() { Value = inputValue }, column); });
await OnFilter(new ChangeEventArgs() { Value = inputValue }, column);
}
}

Expand Down Expand Up @@ -450,7 +450,10 @@ internal void UpdatePickableColumn(RadzenDataGridColumn<TItem> column, bool visi
selectedColumns = columnsList;
}

public void UpdatePickableColumns()
/// <summary>
/// Updates pickable columns.
/// </summary>
public void UpdatePickableColumns()
{
if (allColumns.Any(c => c.Pickable))
{
Expand Down Expand Up @@ -539,7 +542,7 @@ internal RenderFragment DrawNumericFilter(RadzenDataGridColumn<TItem> column, bo
Action<object> action;
if (force)
{
action = args => OnFilter(new ChangeEventArgs() { Value = args }, column, isFirst);
action = args => InvokeAsync(() => OnFilter(new ChangeEventArgs() { Value = args }, column, isFirst));
}
else
{
Expand Down
5 changes: 4 additions & 1 deletion Radzen.Blazor/RadzenDataGridColumn.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ protected override void OnInitialized()
[Parameter]
public int? OrderIndex { get; set; }

/// <summary>
/// Gets the order index.
/// </summary>
public int? GetOrderIndex()
{
return orderIndex ?? OrderIndex;
Expand Down Expand Up @@ -1020,7 +1023,7 @@ public void SetWidth(string value)

if (IsFrozen())
{
Grid.ChangeState();
InvokeAsync(() => Grid.ChangeState());
}
}

Expand Down
6 changes: 3 additions & 3 deletions Radzen.Blazor/RadzenDataGridGroupRow.razor
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
var columnsOfGrid = Columns
.Where(c => c.GetVisible())
.ToList();
return columnsOfGrid.Sum(c => CountVisibleLeafColumns(c));
return columnsOfGrid.Sum(c => CountVisibleLeafColumns<TItem>(c));
}
}

Expand Down Expand Up @@ -177,7 +177,7 @@
return i;
}

private int CountVisibleLeafColumns<TItem>(RadzenDataGridColumn<TItem> column)
private int CountVisibleLeafColumns<T>(RadzenDataGridColumn<TItem> column)
{
if (column.ColumnsCollection?.Count == 0)
{
Expand All @@ -187,7 +187,7 @@
int count = 0;
foreach (var childColumn in column.ColumnsCollection)
{
count += CountVisibleLeafColumns(childColumn);
count += CountVisibleLeafColumns<T>(childColumn);
}
return count;
}
Expand Down
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenDataGridHeaderCell.razor
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
}
else if (Column.FilterPropertyType == typeof(bool) || Column.FilterPropertyType == typeof(bool?))
{
<RadzenCheckBox TriState="true" TValue="@object" Value="@Column.GetFilterValue()" Change="@(args => { Column.FilterValue = null; Column.SetFilterValue(args); Grid.SaveSettings(); Grid.Reload(); })" />
<RadzenCheckBox TriState="true" TValue="@object" Value="@Column.GetFilterValue()" Change="@(args => { Column.SetFilterValue(null); Column.SetFilterValue(args); Grid.SaveSettings(); InvokeAsync(() => Grid.Reload()); })" />
}
else
{
Expand Down
3 changes: 3 additions & 0 deletions Radzen.Blazor/RadzenDataGridRow.razor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Radzen.Blazor
{
/// <summary>
/// RadzenDataGridRow.
/// </summary>
public partial class RadzenDataGridRow<TItem>
{
}
Expand Down
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenDatePicker.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ protected async Task ParseDate()

if (valid && !DateAttributes(value).Disabled)
{
newValue = TimeOnly && CurrentDate != null ? new DateTime(CurrentDate.Year, CurrentDate.Month, CurrentDate.Day, value.Hour, value.Minute, value.Second) : value;
newValue = TimeOnly && CurrentDate != default(DateTime) ? new DateTime(CurrentDate.Year, CurrentDate.Month, CurrentDate.Day, value.Hour, value.Minute, value.Second) : value;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenDropDownDataGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
@if (AllowFiltering)
{
<div class="rz-lookup-search">
<input class="rz-lookup-search-input" id="@SearchID" @ref="@search" tabindex="-1" placeholder="@SearchText"
<input class="rz-lookup-search-input" id="@SearchID" @ref="@search" tabindex="-1" placeholder="@SearchTextPlaceholder"
@onchange="@((args) => OnFilter(args))" @onkeydown="@((args) => OnFilterKeyPress(args))" value="@searchText" style="@(ShowSearch ? "" : "margin-right:0px;")"
@oninput=@(args => searchText = $"{args.Value}")/>
@if (ShowSearch)
Expand Down
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenDropDownDataGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ protected override async System.Threading.Tasks.Task OpenPopup(string key = "Arr
/// </summary>
/// <value>The search input placeholder text.</value>
[Parameter]
public string SearchText { get; set; } = "Search...";
public string SearchTextPlaceholder { get; set; } = "Search...";

/// <summary>
/// Gets or sets the selected value.
Expand Down
3 changes: 3 additions & 0 deletions Radzen.Blazor/RadzenGrid.razor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Radzen.Blazor
{
/// <summary>
/// RadzenGrid.
/// </summary>
public partial class RadzenGrid<TItem>
{
}
Expand Down
2 changes: 2 additions & 0 deletions Radzen.Blazor/RadzenHtmlEditorSource.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@
{
Editor.SetMode(HtmlEditorMode.Design);
}

await Task.CompletedTask;
}
}
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenPieSeries.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public override string Color
}

/// <summary>
/// Stores <see cref="Data" /> filtered to items greater than zero as an IList of <typeparamref name="TItem"/>.
/// Stores Data filtered to items greater than zero as an IList of <typeparamref name="TItem"/>.
/// </summary>
/// <value>The items.</value>
protected IList<TItem> PositiveItems { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions Radzen.Blazor/RadzenProgressBarCircular.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ protected override string GetComponentCssClass()
return string.Join(" ", classList);
}

/// <summary>
/// Gets the circle size.
/// </summary>
protected string GetCircleSize()
{
switch (Size)
Expand Down
3 changes: 3 additions & 0 deletions Radzen.Blazor/RadzenScheduler.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ public partial class RadzenScheduler<TItem> : RadzenComponent, IScheduler

IList<ISchedulerView> Views { get; set; } = new List<ISchedulerView>();

/// <summary>
/// Gets the SelectedView.
/// </summary>
public ISchedulerView SelectedView
{
get
Expand Down
4 changes: 4 additions & 0 deletions Radzen.Blazor/RadzenTimeline.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ namespace Radzen.Blazor
/// </example>
public partial class RadzenTimeline : RadzenComponent
{
/// <summary>
/// Gets or sets the items.
/// </summary>
/// <value>The items.</value>
[Parameter]
public RenderFragment Items { get; set; }

Expand Down
8 changes: 7 additions & 1 deletion Radzen.Blazor/RadzenTimelineItem.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public partial class RadzenTimelineItem : RadzenComponent
[Parameter]
public RenderFragment ChildContent { get; set; }

/// <summary>
/// Gets or sets the text.
/// </summary>
[Parameter]
public string Text { get; set; }

Expand All @@ -36,6 +39,9 @@ public partial class RadzenTimelineItem : RadzenComponent
[Parameter]
public RenderFragment LabelContent { get; set; }

/// <summary>
/// Gets or sets the label.
/// </summary>
[Parameter]
public string Label { get; set; }

Expand Down Expand Up @@ -64,7 +70,7 @@ public partial class RadzenTimelineItem : RadzenComponent
public Variant PointVariant { get; set; } = Variant.Filled;

/// <summary>
/// Specifies the Shadow level from <c>0</c> (no shadow) to <c>10<c>. Set to <c>1</c> by default.
/// Specifies the Shadow level from <c>0</c> (no shadow) to <c>10</c>. Set to <c>1</c> by default.
/// </summary>
[Parameter]
public int PointShadow { get; set; } = 1;
Expand Down
4 changes: 4 additions & 0 deletions Radzen.Blazor/RadzenTreeItem.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ namespace Radzen.Blazor
/// </summary>
public partial class RadzenTreeItem : IDisposable
{
/// <summary>
/// Specifies additional custom attributes that will be rendered by the component.
/// </summary>
/// <value>The attributes.</value>
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object> Attributes { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion Radzen.Blazor/RadzenYearView.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public override string Title
public override string Text { get; set; } = "Year";

/// <summary>
/// Specifies the text displayed when there are more appointments in a slot than <see cref="MaxAppointmentsInSlot" />.
/// Specifies the text displayed when there are more appointments in a slot than MaxAppointmentsInSlot.
/// </summary>
/// <value>The more text. Set to <c>"+ {0} more"</c> by default.</value>
[Parameter]
Expand Down

0 comments on commit b1819ff

Please sign in to comment.