Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet 8 upgrade #1

Merged
merged 5 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,25 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

strategy:
matrix:
dotnet-version: ['8.0.x']

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.7.2
- name: Setup dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
# SDK version to use. Example: 2.2.104
dotnet-version: 6.0.100
dotnet-version: ${{ matrix.dotnet-version }}

- name: Display dotnet version
run: dotnet --version

- name: Restore NuGet Packages
run: dotnet restore

Expand All @@ -38,12 +45,12 @@ jobs:

- name: Publish
if: github.ref == 'refs/heads/master'
run: dotnet publish Dcidr.Blazor -o publish -c Release
run: dotnet publish Dcidr.BlazorWasm -o publish -c Release

# deploy to azure blob storage (static website)
- name: Upload to Azure Static Website
if: github.ref == 'refs/heads/master'
uses: tibor19/static-website-deploy@v1
uses: tibor19/static-website-deploy@v3
with:
# Connection String of the Azure Storage Container
connection-string: ${{ secrets.azureBlobStorageConnectionString }}
Expand Down
25 changes: 0 additions & 25 deletions Dcidr.Blazor/Dcidr.Blazor.csproj

This file was deleted.

28 changes: 0 additions & 28 deletions Dcidr.Blazor/Program.cs

This file was deleted.

27 changes: 0 additions & 27 deletions Dcidr.Blazor/Properties/launchSettings.json

This file was deleted.

9 changes: 0 additions & 9 deletions Dcidr.Blazor/_Imports.razor

This file was deleted.

7 changes: 0 additions & 7 deletions Dcidr.Blazor/wwwroot/css/bootstrap/bootstrap.min.css

This file was deleted.

1 change: 0 additions & 1 deletion Dcidr.Blazor/wwwroot/css/bootstrap/bootstrap.min.css.map

This file was deleted.

4 changes: 0 additions & 4 deletions Dcidr.Blazor/wwwroot/service-worker.js

This file was deleted.

48 changes: 0 additions & 48 deletions Dcidr.Blazor/wwwroot/service-worker.published.js

This file was deleted.

6 changes: 4 additions & 2 deletions Dcidr.Blazor/App.razor → Dcidr.BlazorWasm/App.razor
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<Router AppAssembly="@typeof(Program).Assembly">
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
20 changes: 20 additions & 0 deletions Dcidr.BlazorWasm/Dcidr.BlazorWasm.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Dcidr.Excel\Dcidr.Excel.csproj" />
<ProjectReference Include="..\Dcidr.Model\Dcidr.Model.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace Dcidr.Blazor
namespace Dcidr.BlazorWasm
{
public class DcidrAppModel
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@if (showList)
{
<ul class="decision-item-list">
@foreach (var d in decisionArchive.Decisions)
@foreach (var d in decisionArchive!.Decisions)
{
<ArchiveItem @key="@d.Id"
Item="@d"
Expand Down Expand Up @@ -45,7 +45,7 @@

private bool isLoading;
private bool showList;
private DecisionArchive decisionArchive;
private DecisionArchive? decisionArchive;

private async Task Refresh()
{
Expand All @@ -65,7 +65,7 @@
await localStorage.RemoveItemAsync($"decision-{decisionArchiveItem.Id}");

await localStorage.GetItemAsync<DecisionArchive>("decision-archive");
decisionArchive.Remove(decisionArchiveItem);
decisionArchive!.Remove(decisionArchiveItem);
await localStorage.SetItemAsync("decision-archive", decisionArchive);

await Refresh();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/compare-criteria"
@inject DcidrAppModel AppModel
@using Dcidr.Blazor.Shared
@using Dcidr.BlazorWasm.Shared
@inject NavigationManager NavigationManager

<div class="fade-in">
Expand Down Expand Up @@ -37,7 +37,7 @@
@if (AppModel.Decision.ResultPrerequisitesMet)
{
<NavLink class="d-btn d-btn-primary" title="View Results" href="results">
View Results <Dcidr.Blazor.Shared.InlineSvg.ArrowRight />
View Results <Dcidr.BlazorWasm.Shared.InlineSvg.ArrowRight />
</NavLink>
}
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/compare-options"
@inject DcidrAppModel AppModel
@using Dcidr.Blazor.Shared
@using Dcidr.BlazorWasm.Shared
@inject NavigationManager NavigationManager

<div class="fade-in">
Expand Down Expand Up @@ -40,7 +40,7 @@
{
<NavLink class="d-btn d-btn-primary" href="compare-criteria" title="Continue">
Continue
<Dcidr.Blazor.Shared.InlineSvg.ArrowRight />
<Dcidr.BlazorWasm.Shared.InlineSvg.ArrowRight />
</NavLink>
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page "/criteria"
@inject DcidrAppModel AppModel
@inject NavigationManager NavigationManager
@using Dcidr.Blazor.Shared
@using Dcidr.BlazorWasm.Shared

<div class="fade-in">

Expand Down Expand Up @@ -53,7 +53,7 @@
@if (AppModel.Decision.HasEnoughCriteria)
{
<NavLink class="d-btn d-btn-primary" title="Continue" href="compare-options">
Continue <Dcidr.Blazor.Shared.InlineSvg.ArrowRight />
Continue <Dcidr.BlazorWasm.Shared.InlineSvg.ArrowRight />
</NavLink>
}

Expand All @@ -67,7 +67,7 @@

@code {

private string newCriteriaInput;
private string? newCriteriaInput;

private void AddCriteria()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@inject NavigationManager NavigationManager

<div class="text-center fade-in">
<h1>Complex decisions made easy.</h1>
<h1 tabindex="-1">Complex decisions made easy.</h1>

<p class="mb-4">Use this app to make any decision involving multiple <strong>options</strong> and <strong>criteria</strong>. </p>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/options"
@inject DcidrAppModel AppModel
@using Dcidr.Blazor.Shared
@using Dcidr.BlazorWasm.Shared
@inject NavigationManager NavigationManager

<div class="fade-in">
Expand Down Expand Up @@ -59,7 +59,7 @@
@if (AppModel.Decision.HasEnoughOptions)
{
<NavLink class="d-btn d-btn-primary" title="Continue" href="criteria">
Continue <Dcidr.Blazor.Shared.InlineSvg.ArrowRight />
Continue <Dcidr.BlazorWasm.Shared.InlineSvg.ArrowRight />
</NavLink>
}
</div>
Expand All @@ -70,7 +70,7 @@


@code {
private string newOptionInput;
private string? newOptionInput;

private void AddOption()
{
Expand Down
File renamed without changes.
15 changes: 15 additions & 0 deletions Dcidr.BlazorWasm/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Blazored.LocalStorage;
using Dcidr.Blazor;
using Dcidr.BlazorWasm;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

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

await builder.Build().RunAsync();
Loading