Skip to content

Commit

Permalink
Update for dotnet 5 and private prerelease of CSLA 5.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rockfordlhotka committed Nov 30, 2020
1 parent 06e2f36 commit bc25f58
Show file tree
Hide file tree
Showing 22 changed files with 450 additions and 393 deletions.
34 changes: 17 additions & 17 deletions BlazorCslaAuthentication/BlazorCslaAuthentication.sln
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30001.183
VisualStudioVersion = 16.0.30717.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorCslaAuthentication.Server", "BlazorCslaAuthentication\Server\BlazorCslaAuthentication.Server.csproj", "{00B2DEFC-74AC-419C-8B54-27A2CBCBA559}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorCslaAuthentication.Server", "BlazorCslaAuthentication\Server\BlazorCslaAuthentication.Server.csproj", "{EF65DC2B-09EB-4FC0-81A4-C252217DAEE2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorCslaAuthentication.Client", "BlazorCslaAuthentication\Client\BlazorCslaAuthentication.Client.csproj", "{C3BE9F38-5720-432E-9268-BA6963D4D852}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorCslaAuthentication.Client", "BlazorCslaAuthentication\Client\BlazorCslaAuthentication.Client.csproj", "{DB551421-DEA4-45BE-80FA-A58CAE414E24}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorCslaAuthentication.Shared", "BlazorCslaAuthentication\Shared\BlazorCslaAuthentication.Shared.csproj", "{FD4AA7EE-FDEB-4993-909A-865E52A798DA}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlazorCslaAuthentication.Shared", "BlazorCslaAuthentication\Shared\BlazorCslaAuthentication.Shared.csproj", "{704C28BF-1D0F-4B05-984F-64D9E4592041}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{00B2DEFC-74AC-419C-8B54-27A2CBCBA559}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00B2DEFC-74AC-419C-8B54-27A2CBCBA559}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00B2DEFC-74AC-419C-8B54-27A2CBCBA559}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00B2DEFC-74AC-419C-8B54-27A2CBCBA559}.Release|Any CPU.Build.0 = Release|Any CPU
{C3BE9F38-5720-432E-9268-BA6963D4D852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3BE9F38-5720-432E-9268-BA6963D4D852}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3BE9F38-5720-432E-9268-BA6963D4D852}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3BE9F38-5720-432E-9268-BA6963D4D852}.Release|Any CPU.Build.0 = Release|Any CPU
{FD4AA7EE-FDEB-4993-909A-865E52A798DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD4AA7EE-FDEB-4993-909A-865E52A798DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD4AA7EE-FDEB-4993-909A-865E52A798DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD4AA7EE-FDEB-4993-909A-865E52A798DA}.Release|Any CPU.Build.0 = Release|Any CPU
{EF65DC2B-09EB-4FC0-81A4-C252217DAEE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF65DC2B-09EB-4FC0-81A4-C252217DAEE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF65DC2B-09EB-4FC0-81A4-C252217DAEE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF65DC2B-09EB-4FC0-81A4-C252217DAEE2}.Release|Any CPU.Build.0 = Release|Any CPU
{DB551421-DEA4-45BE-80FA-A58CAE414E24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB551421-DEA4-45BE-80FA-A58CAE414E24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB551421-DEA4-45BE-80FA-A58CAE414E24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB551421-DEA4-45BE-80FA-A58CAE414E24}.Release|Any CPU.Build.0 = Release|Any CPU
{704C28BF-1D0F-4B05-984F-64D9E4592041}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{704C28BF-1D0F-4B05-984F-64D9E4592041}.Debug|Any CPU.Build.0 = Debug|Any CPU
{704C28BF-1D0F-4B05-984F-64D9E4592041}.Release|Any CPU.ActiveCfg = Release|Any CPU
{704C28BF-1D0F-4B05-984F-64D9E4592041}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5FB7346C-099A-40E4-BB31-D45DDDF6EF0B}
SolutionGuid = {C6BA5FD3-57AD-48D8-B744-FA73366E5918}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RazorLangVersion>3.0</RazorLangVersion>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Csla.Blazor.WebAssembly" Version="5.2.0-R20050802" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="3.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0-rc1.20223.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0-rc1.20223.4" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.2.0-preview3.20168.3" />
<PackageReference Include="Csla.Blazor.WebAssembly" Version="5.4.0-R20112901" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.0" PrivateAssets="all" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Shared\BlazorCslaAuthentication.Shared.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@using BlazorCslaAuthentication.Shared
@inject HttpClient Http
@using Csla.Blazor
@using Csla.Rules
@using Csla.Rules
@attribute [HasPermission(AuthorizationActions.CreateObject, typeof(PersonEdit))]

<h1>Weather forecast</h1>
Expand All @@ -11,39 +11,39 @@

@if (forecasts == null)
{
<p><em>Loading...</em></p>
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}

@code {
private WeatherForecast[] forecasts;
private WeatherForecast[] forecasts;

protected override async Task OnInitializedAsync()
{
forecasts = await Http.GetJsonAsync<WeatherForecast[]>("WeatherForecast");
}
protected override async Task OnInitializedAsync()
{
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
}

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Components.Authorization;
using Csla.Blazor.Client.Authentication;
using Csla.Configuration;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Net.Http;
using System.Threading.Tasks;

namespace BlazorCslaAuthentication.Client
{
Expand All @@ -14,9 +14,9 @@ public class Program
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.RootComponents.Add<App>("#app");

builder.Services.AddSingleton(new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

builder.Services.AddOptions();
builder.Services.AddAuthorizationCore();
Expand All @@ -27,7 +27,7 @@ public static async Task Main(string[] args)
builder.UseCsla(c =>
{
c.DataPortal()
.DefaultProxy(typeof(Csla.DataPortalClient.HttpProxy), "https://localhost:44317/api/dataportaltext/");
.DefaultProxy(typeof(Csla.DataPortalClient.HttpProxy), "https://localhost:44345/api/dataportaltext/");
});

await builder.Build().RunAsync();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
@inherits LayoutComponentBase

<div class="sidebar">
<NavMenu />
</div>

<div class="main">
<div class="top-row px-4">
<AuthorizeView>
<Authorized>
Hello, @context.User.Identity.Name
<a href="/Logout">Log out</a>
</Authorized>
<NotAuthorized>
<a href="/Login">Log in</a>
</NotAuthorized>
</AuthorizeView>
<a href="https://cslanet.com" target="_blank">About</a>
<div class="page">
<div class="sidebar">
<NavMenu />
</div>

<div class="content px-4">
@Body
<div class="main">
<div class="top-row px-4 auth">
<AuthorizeView>
<Authorized>
Hello, @context.User.Identity.Name
<a href="/Logout">Log out</a>
</Authorized>
<NotAuthorized>
<a href="/Login">Log in</a>
</NotAuthorized>
</AuthorizeView>
<a href="https://cslanet.com" target="_blank">About</a>
</div>

<div class="content px-4">
@Body
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.page {
position: relative;
display: flex;
flex-direction: column;
}

.main {
flex: 1;
}

.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
}

.top-row {
background-color: #f7f7f7;
border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
align-items: center;
}

.top-row ::deep a, .top-row .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
}

.top-row a:first-child {
overflow: hidden;
text-overflow: ellipsis;
}

@media (max-width: 640.98px) {
.top-row:not(.auth) {
display: none;
}

.top-row.auth {
justify-content: space-between;
}

.top-row a, .top-row .btn-link {
margin-left: 0;
}
}

@media (min-width: 641px) {
.page {
flex-direction: row;
}

.sidebar {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}

.top-row {
position: sticky;
top: 0;
z-index: 1;
}

.main > div {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.navbar-toggler {
background-color: rgba(255, 255, 255, 0.1);
}

.top-row {
height: 3.5rem;
background-color: rgba(0,0,0,0.4);
}

.navbar-brand {
font-size: 1.1rem;
}

.oi {
width: 2rem;
font-size: 1.1rem;
vertical-align: text-top;
top: -2px;
}

.nav-item {
font-size: 0.9rem;
padding-bottom: 0.5rem;
}

.nav-item:first-of-type {
padding-top: 1rem;
}

.nav-item:last-of-type {
padding-bottom: 1rem;
}

.nav-item ::deep a {
color: #d7d7d7;
border-radius: 4px;
height: 3rem;
display: flex;
align-items: center;
line-height: 3rem;
}

.nav-item ::deep a.active {
background-color: rgba(255,255,255,0.25);
color: white;
}

.nav-item ::deep a:hover {
background-color: rgba(255,255,255,0.1);
color: white;
}

@media (min-width: 641px) {
.navbar-toggler {
display: none;
}

.collapse {
/* Never collapse the sidebar for wide screens */
display: block;
}
}

This file was deleted.

Loading

0 comments on commit bc25f58

Please sign in to comment.