Skip to content

Commit 332c0da

Browse files
authored
Merge pull request telerik#146 from telerik/sample-apps-v5-dev-comply
Sample apps update to comply with v5 dev changes and 3.0.0 breaking changes
2 parents ba9ca26 + a28b704 commit 332c0da

30 files changed

+168
-100
lines changed

sample-applications/blazing-coffee/BlazingCoffee/Client/BlazingCoffee.Client.csproj

+6-7
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,16 @@
1919
<!-- /PWA -->
2020

2121
<ItemGroup>
22-
<PackageReference Include="Blazored.LocalStorage" Version="3.0.0" />
23-
<PackageReference Include="BuildWebCompiler" Version="1.12.405" />
24-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0" />
25-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all" />
26-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="6.0.0" />
27-
<PackageReference Include="Microsoft.Extensions.Localization" Version="6.0.0" />
22+
<PackageReference Include="Blazored.LocalStorage" Version="4.1.5" />
23+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.1" />
24+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.1" PrivateAssets="all" />
25+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="6.0.1" />
26+
<PackageReference Include="Microsoft.Extensions.Localization" Version="6.0.1" />
2827
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.113" />
2928
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
3029
<PackageReference Include="Telerik.UI.for.Blazor.Trial" Version="3.0.0" />
3130
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
32-
<PackageReference Include="Markdig" Version="0.22.0" />
31+
<PackageReference Include="Markdig" Version="0.26.0" />
3332
</ItemGroup>
3433

3534
<ItemGroup>

sample-applications/blazing-coffee/BlazingCoffee/Client/Pages/Index.razor

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<img class="k-card-image" src="./img/Sales.jpg">
1414
<p class="card-description">@L["Index_SalesCard_Description"]</p>
1515
<div class="k-card-actions k-card-actions-stretched">
16-
<span class="k-card-action"><a href="/blazor-coffee/sales" class="k-button k-primary">@L["Sales"]</a></span>
16+
<span class="k-card-action"><a href="/blazor-coffee/sales" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary">@L["Sales"]</a></span>
1717
</div>
1818
</Content>
1919
</TileLayoutItem>
@@ -22,7 +22,7 @@
2222
<img class="k-card-image" src="./img/Schedule.jpg">
2323
<p class="card-description">@L["Index_EmployeesCard_Description"]</p>
2424
<div class="k-card-actions k-card-actions-stretched">
25-
<span class="k-card-action"><a href="/blazor-coffee/manage-employees" class="k-button k-primary">@L["HumanCapital"]</a></span>
25+
<span class="k-card-action"><a href="/blazor-coffee/manage-employees" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary">@L["HumanCapital"]</a></span>
2626
</div>
2727
</Content>
2828
</TileLayoutItem>
@@ -31,7 +31,7 @@
3131
<img class="k-card-image" src="./img/coffee.jpg">
3232
<p class="card-description">@L["Index_ProductsCard_Description"]</p>
3333
<div class="k-card-actions k-card-actions-stretched">
34-
<span class="k-card-action"><a href="/blazor-coffee/manage-products" class="k-button k-primary">@L["ManageProducts"]</a></span>
34+
<span class="k-card-action"><a href="/blazor-coffee/manage-products" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary">@L["ManageProducts"]</a></span>
3535
</div>
3636
</Content>
3737
</TileLayoutItem>

sample-applications/blazing-coffee/BlazingCoffee/Client/Pages/ManageProducts.razor

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<p>@L["DatabaseConnectionError"]</p>
1616
</CardContent>
1717
<ActionTemplate>
18-
<TelerikButton OnClick="LoadData" Class="k-primary">Retry</TelerikButton>
18+
<TelerikButton OnClick="LoadData" ThemeColor="@(ThemeConstants.Button.ThemeColor.Primary)">Retry</TelerikButton>
1919
</ActionTemplate>
2020
</Card>
2121
}
@@ -26,7 +26,7 @@
2626
OnEdit="LoadGroups" OnUpdate="UpdateItem" OnDelete="DeleteItem" OnCreate="CreateItem">
2727
<GridToolBar>
2828
<GridCommandButton Command="ToggleId" OnClick="(() => isIdVisible = !isIdVisible)" Icon="parameter-integer">@L["Toggle_Id"]</GridCommandButton>
29-
<GridCommandButton Command="Add" OnClick="LoadGroups" Icon="add" Class="k-primary">@L["ManageProducts_AddProduct"]</GridCommandButton>
29+
<GridCommandButton Command="Add" OnClick="LoadGroups" Icon="add" ThemeColor="@(ThemeConstants.Button.ThemeColor.Primary)">@L["ManageProducts_AddProduct"]</GridCommandButton>
3030
<span class="k-spacer"></span>
3131
<GridSearchBox DebounceDelay="400"></GridSearchBox>
3232
</GridToolBar>
@@ -45,7 +45,7 @@
4545
}
4646
</Template>
4747
<EditorTemplate>
48-
<TelerikDropDownList Data="@Groups" Width="auto" @bind-Value="((Product)context).Group" TextField="ProductName" ValueField="ProductName">
48+
<TelerikDropDownList Data="@Groups" Width="100%" @bind-Value="((Product)context).Group" TextField="ProductName" ValueField="ProductName">
4949
<ItemTemplate Context="group">
5050
<img width="64" src="./img/products/@(group.Replace(" ", "")).jpg" class="k-avatar-rounded" />
5151
<span style="padding-left:5px">@group</span>
@@ -93,8 +93,8 @@
9393
</EditorTemplate>
9494
</GridColumn>
9595
<GridCommandColumn Width="200px">
96-
<GridCommandButton Command="Edit" Icon="edit" Class="k-primary">@L["Grid_Edit"]</GridCommandButton>
97-
<GridCommandButton Command="Save" Icon="save" Class="k-primary" ShowInEdit="true">@L["Grid_Update"]</GridCommandButton>
96+
<GridCommandButton Command="Edit" Icon="edit" ThemeColor="@(ThemeConstants.Button.ThemeColor.Primary)">@L["Grid_Edit"]</GridCommandButton>
97+
<GridCommandButton Command="Save" Icon="save" ThemeColor="@(ThemeConstants.Button.ThemeColor.Primary)" ShowInEdit="true">@L["Grid_Update"]</GridCommandButton>
9898
<GridCommandButton Command="Cancel" Icon="cancel" ShowInEdit="true">@L["Grid_Cancel"]</GridCommandButton>
9999
<GridCommandButton Command="Delete" OnClick="ShowConfirmationDialog" Icon="delete" ShowInEdit="false">@L["Grid_Delete"]</GridCommandButton>
100100
</GridCommandColumn>

sample-applications/blazing-coffee/BlazingCoffee/Client/Pages/ManageProducts.razor.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ async Task CreateItem(GridCommandEventArgs args)
116116
CrudNotification?.Show(new()
117117
{
118118
Text = string.Format(L["ManageProducts_Create_Success"], newProduct.Sku),
119-
ThemeColor = ThemeColors.Success
119+
ThemeColor = ThemeConstants.Notification.ThemeColor.Success
120120
});
121121
}
122122
catch (Exception)
@@ -141,7 +141,7 @@ async Task UpdateItem(GridCommandEventArgs args)
141141
CrudNotification?.Show(new()
142142
{
143143
Text = string.Format(L["ManageProducts_Update_Success"], product.Sku),
144-
ThemeColor = ThemeColors.Success
144+
ThemeColor = ThemeConstants.Notification.ThemeColor.Success
145145
});
146146
}
147147
catch (Exception)
@@ -163,7 +163,7 @@ async Task DeleteItem(GridCommandEventArgs args)
163163
CrudNotification?.Show(new()
164164
{
165165
Text = string.Format(L["ManageProducts_Delete_Success"], product.Sku),
166-
ThemeColor = ThemeColors.Success
166+
ThemeColor = ThemeConstants.Notification.ThemeColor.Success
167167
});
168168
}
169169
catch (Exception)
@@ -182,7 +182,7 @@ void ShowDataConnectionError() =>
182182
CrudNotification?.Show(new()
183183
{
184184
Text = L["DatabaseConnectionError"],
185-
ThemeColor = ThemeColors.Error
185+
ThemeColor = ThemeConstants.Notification.ThemeColor.Error
186186
});
187187

188188
#endregion

sample-applications/blazing-coffee/BlazingCoffee/Client/Pages/SalesReports/Sales.razor

+3-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<SalesByDateChart Data="chartData"></SalesByDateChart>
99
<CardContainer Title="@L["Sales"]">
1010
<TelerikGrid @ref="Grid"
11+
TItem="Sale"
1112
Height="500px"
1213
FilterMode="@GridFilterMode.FilterMenu"
1314
Sortable="true"
@@ -16,8 +17,6 @@
1617
Resizable="true"
1718
OnStateInit="@((GridStateEventArgs<Sale> args) => OnStateInit(args))"
1819
OnStateChanged="@((GridStateEventArgs<Sale> args) => OnStateChanged(args))"
19-
Data=@Model.CurrentPageData
20-
TotalCount=@Model.TotalItemCount
2120
OnRead=@ReadItems>
2221
<GridToolBar>
2322
<TelerikDateRangePicker StartValue="@StartValue" EndValue="@EndValue"
@@ -67,6 +66,8 @@
6766
{
6867
Model = await response.Content.ReadFromJsonAsync<DataEnvelope<Sale>>();
6968
}
69+
args.Data = Model.CurrentPageData;
70+
args.Total = Model.TotalItemCount;
7071
}
7172

7273
protected override void OnInitialized()

sample-applications/blazing-coffee/BlazingCoffee/Client/Shared/CultureChooser.razor

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
<div style="margin-bottom: 20px;">
77
<TelerikDropDownList Data="@Cultures"
88
Value="@SelectedCulture"
9-
PopupHeight=""
9+
Width="300px"
1010
ValueChanged="@((string value) => OnValueChanged(value) )"
1111
TextField="@nameof(CultureData.Text)"
1212
ValueField="@nameof(CultureData.Value)">
13+
<DropDownListSettings>
14+
<DropDownListPopupSettings Height=""></DropDownListPopupSettings>
15+
</DropDownListSettings>
1316
</TelerikDropDownList>
1417
</div>
1518

sample-applications/blazing-coffee/BlazingCoffee/Client/Shared/Layouts/MainLayout.razor

+12-12
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
<div class="header">
1212
<div class="nav-container">
1313
<div class="menu-button">
14-
<TelerikButton Icon="@IconName.Menu" OnClick="ToggleMenuDrawer" />
14+
<TelerikButton Icon="menu" OnClick="ToggleMenuDrawer" />
1515
</div>
1616
<div class="title">
1717
<h1>Blazing Coffee Warehouse</h1>
1818
</div>
1919
@if (Layout.HasDocs)
2020
{
2121
<div class="information">
22-
<TelerikButton Icon="@IconName.Information" OnClick="@(() => DocsExpanded = !DocsExpanded)" />
22+
<TelerikButton Icon="information" OnClick="@(() => DocsExpanded = !DocsExpanded)" />
2323
</div>
2424
}
2525
<div class="settings">
26-
<TelerikButton Icon="@IconName.Gear" OnClick="@(() => SettingsExpanded = !SettingsExpanded)" />
26+
<TelerikButton Icon="gear" OnClick="@(() => SettingsExpanded = !SettingsExpanded)" />
2727
</div>
2828
</div>
2929
</div>
@@ -34,9 +34,9 @@
3434
<Template>
3535
<DrawTemplate Data="context"></DrawTemplate>
3636
</Template>
37-
<Content>
37+
<DrawerContent>
3838
@Body
39-
</Content>
39+
</DrawerContent>
4040
</TelerikDrawer>
4141
<TelerikWindow @bind-Visible="SettingsExpanded" Modal="true">
4242
<WindowTitle>
@@ -96,13 +96,13 @@
9696
new List<DrawerItem>
9797
{
9898
new DrawerItem{ Text = L["Home"], Icon = "home", Url="/blazor-coffee/", Group = "home"},
99-
new DrawerItem{ Text = L["Sales"], Icon = IconName.Dollar, Url="/blazor-coffee/sales", Group = "app"},
100-
new DrawerItem{ Text = L["HumanCapital"], Icon = IconName.TellAFriend, Url="/blazor-coffee/manage-employees", Group = "app"},
101-
new DrawerItem{ Text = L["ManageProducts"], Icon = IconName.Grid, Url="/blazor-coffee/manage-products", Group = "app"},
102-
new DrawerItem{ Text = "GitHub", Icon = IconName.Share, Url="https://github.com/telerik/blazor-ui/tree/master/sample-applications/blazing-coffee", Group = "ext"},
103-
new DrawerItem{ Text = "Telerik", Icon = IconName.HyperlinkGlobe, Url="https://telerik.com", Group = "ext"},
104-
new DrawerItem{ Text = L["Documentation"], Icon = IconName.Html, Url="https://docs.telerik.com/blazor-ui/introduction", Group = "ext"},
105-
new DrawerItem{ Text = L["Support"], Icon = IconName.Question, Url="https://www.telerik.com/account/support-tickets", Group = "ext"}
99+
new DrawerItem{ Text = L["Sales"], Icon = "dollar", Url="/blazor-coffee/sales", Group = "app"},
100+
new DrawerItem{ Text = L["HumanCapital"], Icon = "tell-a-friend", Url="/blazor-coffee/manage-employees", Group = "app"},
101+
new DrawerItem{ Text = L["ManageProducts"], Icon = "grid", Url="/blazor-coffee/manage-products", Group = "app"},
102+
new DrawerItem{ Text = "GitHub", Icon = "share", Url="https://github.com/telerik/blazor-ui/tree/master/sample-applications/blazing-coffee", Group = "ext"},
103+
new DrawerItem{ Text = "Telerik", Icon = "hyperlink-globe", Url="https://www.telerik.com", Group = "ext"},
104+
new DrawerItem{ Text = L["Documentation"], Icon = "html", Url="https://docs.telerik.com/blazor-ui/introduction", Group = "ext"},
105+
new DrawerItem{ Text = L["Support"], Icon = "question", Url="https://www.telerik.com/account/support-tickets", Group = "ext"}
106106
};
107107

108108
async Task ToggleMenuDrawer()

sample-applications/blazing-coffee/BlazingCoffee/Client/Shared/NavMenu/LoginDisplay.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<AuthorizeView>
99
<Authorized>
10-
<TelerikButton Icon="@IconName.User" @onclick="BeginSignOut">Log out</TelerikButton>
10+
<TelerikButton Icon="user" @onclick="BeginSignOut">Log out</TelerikButton>
1111
<img class="k-avatar-rounded" src="@HashEmailForGravatar(context.User.Identity.Name)" />
1212
<a href="authentication/profile">@context.User.Identity.Name</a>
1313
</Authorized>

sample-applications/blazing-coffee/BlazingCoffee/Client/Shared/Themes/ThemeChooser.razor

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
TextField="ThemeText"
77
ValueField="ThemeValue"
88
Value="@SelectedTheme"
9-
PopupHeight=""
10-
ValueChanged="@( (string v) => HandleThemeSelected(v) )" />
9+
Width="300px"
10+
ValueChanged="@( (string v) => HandleThemeSelected(v) )" >
11+
<DropDownListSettings>
12+
<DropDownListPopupSettings Height=""></DropDownListPopupSettings>
13+
</DropDownListSettings>
14+
</TelerikDropDownList>
1115

1216
@code {
1317

sample-applications/blazing-coffee/BlazingCoffee/Client/Theme/main.scss

+19
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ a.k-link.k-state-selected {
8383
}
8484
}
8585

86+
.k-card-action > .k-button {
87+
flex: 1 1 auto;
88+
}
89+
90+
.k-card .k-card-actions-stretched {
91+
border-top-width: 1px;
92+
}
93+
94+
.k-card-actions-stretched {
95+
padding: 0;
96+
gap: 0;
97+
}
98+
99+
.k-card-actions-stretched .k-button {
100+
border-radius: 0;
101+
padding-top: calc( 8px + 4px);
102+
padding-bottom: calc( 8px + 4px);
103+
}
104+
86105
html, body, app {
87106
height: 100%;
88107
margin: 0;

sample-applications/blazing-coffee/BlazingCoffee/Client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"author": "",
1010
"license": "ISC",
1111
"dependencies": {
12-
"@progress/kendo-theme-default": "4.42.0"
12+
"@progress/kendo-theme-default": "5.0.0"
1313
}
1414
}

sample-applications/blazing-coffee/BlazingCoffee/Server/BlazingCoffee.Server.csproj

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.0" />
15-
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.0" />
16-
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="6.0.0" />
17-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
18-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0">
13+
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.1" />
14+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="6.0.1" />
15+
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="6.0.1" />
16+
<PackageReference Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="6.0.1" />
17+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.1" />
18+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.1">
1919
<PrivateAssets>all</PrivateAssets>
2020
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2121
</PackageReference>
@@ -27,13 +27,13 @@
2727

2828
<ItemGroup>
2929
<PackageReference Include="CsvHelper" Version="16.0.0" />
30-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.0" />
31-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
32-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
30+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.1" />
31+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
32+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.1">
3333
<PrivateAssets>all</PrivateAssets>
3434
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3535
</PackageReference>
36-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.0" />
36+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.1" />
3737
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
3838
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="6.0.0" />
3939
<PackageReference Include="Telerik.Documents.SpreadsheetStreaming.Trial" Version="2022.1.106" />

sample-applications/blazing-coffee/BlazingCoffee/Server/Startup.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
3838
{
3939
app.UseDeveloperExceptionPage();
4040
app.UseWebAssemblyDebugging();
41-
// TODO: Update obsolete code warning
42-
app.UseDatabaseErrorPage();
41+
app.UseDeveloperExceptionPage();
4342
}
4443
else
4544
{

sample-applications/blazor-dashboard/BlazorDashboard/Pages/Dashboard.razor

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
</h2>
2020
</div>
2121
<div class="col-sm text-sm-right">
22-
<TelerikDropDownList Data="@DateFilterData" TextField="Text" ValueField="Value" @bind-Value="@timeRange"
23-
OnChange="@LoadIssuesData" PopupHeight="auto">
22+
<TelerikDropDownList Width="300px" Data="@DateFilterData" TextField="Text" ValueField="Value" @bind-Value="@timeRange"
23+
OnChange="@LoadIssuesData">
24+
<DropDownListSettings>
25+
<DropDownListPopupSettings Height="auto"></DropDownListPopupSettings>
26+
</DropDownListSettings>
2427
</TelerikDropDownList>
2528
</div>
2629
</div>

0 commit comments

Comments
 (0)