Skip to content

Commit

Permalink
Merge pull request #2 from fernandezja/dev/update-net8
Browse files Browse the repository at this point in the history
Update NET8
  • Loading branch information
fernandezja authored Feb 13, 2024
2 parents 775f71c + 64b6adc commit 75db630
Show file tree
Hide file tree
Showing 223 changed files with 125,721 additions and 1,221 deletions.
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
name: Azure Static Web Apps CI/CD
# name: Azure Static Web Apps CI/CD

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master
# on:
# push:
# branches:
# - master
# pull_request:
# types: [opened, synchronize, reopened, closed]
# branches:
# - master

jobs:
build_and_deploy_job:
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
runs-on: ubuntu-latest
name: Build and Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
# jobs:
# build_and_deploy_job:
# if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
# runs-on: ubuntu-latest
# name: Build and Deploy Job
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: true

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
# - name: Setup .NET Core
# uses: actions/setup-dotnet@v1
# with:
# dotnet-version: 3.1.301

- name: Publish App
working-directory: src
run: dotnet publish -c Release -o publish
# - name: Publish App
# working-directory: src
# run: dotnet publish -c Release -o publish

- name: Build And Deploy
id: builddeploy
uses: Azure/static-web-apps-deploy@v0.0.1-preview
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WONDERFUL_MEADOW_0EFD48C1E }}
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
action: "upload"
###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
app_location: "src/publish/wwwroot" # App source code path
api_location: "api" # Api source code path - optional
app_artifact_location: "src/publish/wwwroot" # Built app content directory - optional
###### End of Repository/Build Configurations ######
# - name: Build And Deploy
# id: builddeploy
# uses: Azure/static-web-apps-deploy@v0.0.1-preview
# with:
# azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WONDERFUL_MEADOW_0EFD48C1E }}
# repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
# action: "upload"
# ###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
# # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
# app_location: "src/publish/wwwroot" # App source code path
# api_location: "api" # Api source code path - optional
# app_artifact_location: "src/publish/wwwroot" # Built app content directory - optional
# ###### End of Repository/Build Configurations ######

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v0.0.1-preview
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WONDERFUL_MEADOW_0EFD48C1E }}
action: "close"
# close_pull_request_job:
# if: github.event_name == 'pull_request' && github.event.action == 'closed'
# runs-on: ubuntu-latest
# name: Close Pull Request Job
# steps:
# - name: Close Pull Request
# id: closepullrequest
# uses: Azure/static-web-apps-deploy@v0.0.1-preview
# with:
# azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WONDERFUL_MEADOW_0EFD48C1E }}
# action: "close"
6 changes: 3 additions & 3 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.301
dotnet-version: 8.0.x
- name: Install dependencies
working-directory: src
run: dotnet restore
Expand Down
20 changes: 20 additions & 0 deletions src/BlazorEmojiSearch.Client/BlazorEmojiSearch.Client.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>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlazorEmojiSearch.Entities\BlazorEmojiSearch.Entities.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@inherits LayoutComponentBase

<div class="pusher">

@Body

<div class="ui vertical footer segment">
Expand All @@ -18,7 +18,7 @@
<a href="https://github.com/fernandezja" target="_blank">
<i class="github icon"></i>@@fernandezja
</a>
<span>v1.5.0-20210530</span>
<span>v2.0.0-20240213</span>
</div>
</div>
</div>
Expand Down
96 changes: 96 additions & 0 deletions src/BlazorEmojiSearch.Client/Layout/MainLayout.razor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.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 ::deep .btn-link {
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
}

.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
text-decoration: underline;
}

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

@media (max-width: 640.98px) {
.top-row {
justify-content: space-between;
}

.top-row ::deep a, .top-row ::deep .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;
}

.top-row.auth ::deep a:first-child {
flex: 1;
text-align: right;
width: 0;
}

.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
}
}

#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}

#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@page "/counter"

<PageTitle>Counter</PageTitle>

<h1>Counter</h1>

<p>Current count: @currentCount</p>
<p role="status">Current count: @currentCount</p>

<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/"


<div class="ui inverted vertical masthead center aligned segment">

<div class="ui text container">
Expand Down Expand Up @@ -64,3 +65,4 @@


}

63 changes: 63 additions & 0 deletions src/BlazorEmojiSearch.Client/Pages/Weather.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@page "/weather"

<PageTitle>Weather</PageTitle>

<h1>Weather</h1>

<p>This component demonstrates showing data.</p>

@if (forecasts == null)
{
<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>
}

@code {
private WeatherForecast[]? forecasts;

protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate a loading indicator
await Task.Delay(500);

var startDate = DateOnly.FromDateTime(DateTime.Now);
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = summaries[Random.Shared.Next(summaries.Length)]
}).ToArray();
}

private class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public string? Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}
11 changes: 11 additions & 0 deletions src/BlazorEmojiSearch.Client/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;

var builder = WebAssemblyHostBuilder.CreateDefault(args);


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

await builder.Build().RunAsync();
6 changes: 6 additions & 0 deletions src/BlazorEmojiSearch.Client/Routes.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Router AppAssembly="@typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(Layout.MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
</Router>
12 changes: 12 additions & 0 deletions src/BlazorEmojiSearch.Client/_Imports.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@using System.Net.Http
@using System.Net.Http.Json
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using BlazorEmojiSearch.Entities
@using BlazorEmojiSearch.Code
@using BlazorEmojiSearch.Client.Components
@using BlazorEmojiSearch.Client
11 changes: 11 additions & 0 deletions src/BlazorEmojiSearch.Client/libman.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"provider": "cdnjs",
"library": "semantic-ui@2.5.0",
"destination": "wwwroot/lib/semantic-ui/"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
Loading

0 comments on commit 75db630

Please sign in to comment.