Skip to content

Commit 3744b56

Browse files
committed
refactor: formatting cleanup
1 parent 3af9608 commit 3744b56

File tree

76 files changed

+8797
-8745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+8797
-8745
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ jobs:
55
metadata:
66
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/generate-project-metadata.yml@main
77
build:
8-
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/build-template.yml@main
9-
needs:
8+
uses: jcdcdev/jcdcdev.Github.UmbracoSimpleDeploy/.github/workflows/build-template.yml@main
9+
needs:
1010
- metadata
1111
with:
1212
project-name: ${{ needs.metadata.outputs.project-name }}
1313
project-path: ${{ needs.metadata.outputs.project-path }}
1414
npm-working-dir: ${{ needs.metadata.outputs.npm-working-dir }}
1515
npm-enabled: true
1616
release:
17-
needs:
17+
needs:
1818
- build
1919
permissions:
2020
contents: write

src/TestSite.10/Program.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
namespace TestSite.Ten
1+
namespace TestSite.Ten;
2+
3+
public class Program
24
{
3-
public class Program
4-
{
5-
public static void Main(string[] args)
6-
=> CreateHostBuilder(args)
7-
.Build()
8-
.Run();
5+
public static void Main(string[] args)
6+
=> CreateHostBuilder(args)
7+
.Build()
8+
.Run();
99

10-
public static IHostBuilder CreateHostBuilder(string[] args) =>
11-
Host.CreateDefaultBuilder(args)
12-
.ConfigureUmbracoDefaults()
13-
.ConfigureWebHostDefaults(webBuilder =>
14-
{
15-
webBuilder.UseStaticWebAssets();
16-
webBuilder.UseStartup<Startup>();
17-
});
18-
}
10+
public static IHostBuilder CreateHostBuilder(string[] args) =>
11+
Host.CreateDefaultBuilder(args)
12+
.ConfigureUmbracoDefaults()
13+
.ConfigureWebHostDefaults(webBuilder =>
14+
{
15+
webBuilder.UseStaticWebAssets();
16+
webBuilder.UseStartup<Startup>();
17+
});
1918
}

src/TestSite.10/Startup.cs

Lines changed: 54 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,64 @@
1-
namespace TestSite.Ten
1+
namespace TestSite.Ten;
2+
3+
public class Startup
24
{
3-
public class Startup
5+
private readonly IConfiguration _config;
6+
private readonly IWebHostEnvironment _env;
7+
8+
/// <summary>
9+
/// Initializes a new instance of the <see cref="Startup" /> class.
10+
/// </summary>
11+
/// <param name="webHostEnvironment">The web hosting environment.</param>
12+
/// <param name="config">The configuration.</param>
13+
/// <remarks>
14+
/// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337.
15+
/// </remarks>
16+
public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config)
417
{
5-
private readonly IWebHostEnvironment _env;
6-
private readonly IConfiguration _config;
18+
_env = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment));
19+
_config = config ?? throw new ArgumentNullException(nameof(config));
20+
}
721

8-
/// <summary>
9-
/// Initializes a new instance of the <see cref="Startup" /> class.
10-
/// </summary>
11-
/// <param name="webHostEnvironment">The web hosting environment.</param>
12-
/// <param name="config">The configuration.</param>
13-
/// <remarks>
14-
/// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337.
15-
/// </remarks>
16-
public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config)
17-
{
18-
_env = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment));
19-
_config = config ?? throw new ArgumentNullException(nameof(config));
20-
}
22+
/// <summary>
23+
/// Configures the services.
24+
/// </summary>
25+
/// <param name="services">The services.</param>
26+
/// <remarks>
27+
/// This method gets called by the runtime. Use this method to add services to the container.
28+
/// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940.
29+
/// </remarks>
30+
public void ConfigureServices(IServiceCollection services)
31+
{
32+
services.AddUmbraco(_env, _config)
33+
.AddBackOffice()
34+
.AddWebsite()
35+
.AddComposers()
36+
.Build();
37+
}
2138

22-
/// <summary>
23-
/// Configures the services.
24-
/// </summary>
25-
/// <param name="services">The services.</param>
26-
/// <remarks>
27-
/// This method gets called by the runtime. Use this method to add services to the container.
28-
/// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940.
29-
/// </remarks>
30-
public void ConfigureServices(IServiceCollection services)
39+
/// <summary>
40+
/// Configures the application.
41+
/// </summary>
42+
/// <param name="app">The application builder.</param>
43+
/// <param name="env">The web hosting environment.</param>
44+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
45+
{
46+
if (env.IsDevelopment())
3147
{
32-
services.AddUmbraco(_env, _config)
33-
.AddBackOffice()
34-
.AddWebsite()
35-
.AddComposers()
36-
.Build();
48+
app.UseDeveloperExceptionPage();
3749
}
3850

39-
/// <summary>
40-
/// Configures the application.
41-
/// </summary>
42-
/// <param name="app">The application builder.</param>
43-
/// <param name="env">The web hosting environment.</param>
44-
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
45-
{
46-
if (env.IsDevelopment())
51+
app.UseUmbraco()
52+
.WithMiddleware(u =>
4753
{
48-
app.UseDeveloperExceptionPage();
49-
}
50-
51-
app.UseUmbraco()
52-
.WithMiddleware(u =>
53-
{
54-
u.UseBackOffice();
55-
u.UseWebsite();
56-
})
57-
.WithEndpoints(u =>
58-
{
59-
u.UseInstallerEndpoints();
60-
u.UseBackOfficeEndpoints();
61-
u.UseWebsiteEndpoints();
62-
});
63-
}
54+
u.UseBackOffice();
55+
u.UseWebsite();
56+
})
57+
.WithEndpoints(u =>
58+
{
59+
u.UseInstallerEndpoints();
60+
u.UseBackOfficeEndpoints();
61+
u.UseWebsiteEndpoints();
62+
});
6463
}
6564
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@using Umbraco.Extensions
2-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
1+
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
32

43
<h2 style="padding: 20px">@Model.Content.Value("headline")</h2>
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
@using Umbraco.Extensions
2-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
1+
@using Umbraco.Cms.Core.Models
2+
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
33

44
@{
5-
var typedMediaPickerSingle = Model.Content.Value<Umbraco.Cms.Core.Models.MediaWithCrops>("image");
5+
var typedMediaPickerSingle = Model.Content.Value<MediaWithCrops>("image");
66
if (typedMediaPickerSingle != null)
77
{
88
<img src="@typedMediaPickerSingle.MediaUrl()" style="object-fit:cover; width:100%; height:100%;"/>
9-
} else {
9+
}
10+
else
11+
{
1012
<p>Missing image</p>
1113
}
1214
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
@using Umbraco.Extensions
2-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
1+
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
32

43
<div style="padding: 20px">
5-
@Model.Content.Value("richText")
4+
@Model.Content.Value("richText")
65
</div>

src/TestSite.10/Views/Partials/blockgrid/Components/umbBlockGridDemoTwoColumnLayoutBlock.cshtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
@using Umbraco.Extensions
2-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
1+
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
32

43
<div>
54
@await Html.GetBlockGridItemAreasHtmlAsync(Model)

src/TestSite.10/Views/Partials/blockgrid/area.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridArea>
1+
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridArea>
22
@{
3-
var bsClass = $"col-{Model.ColumnSpan}";
3+
var bsClass = $"col-{Model.ColumnSpan}";
44
}
55
<div class="umb-block-grid__area @bsClass"
66
data-area-col-span="@Model.ColumnSpan"

src/TestSite.10/Views/Partials/blockgrid/areas.cshtml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
1+
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridItem>
22
@{
3-
if (Model?.Areas.Any() != true) { return; }
3+
if (Model?.Areas.Any() != true)
4+
{
5+
return;
6+
}
47
}
58

69
<div class="umb-block-grid__area-container row"

src/TestSite.10/Views/Partials/blockgrid/default.cshtml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridModel>
1+
@inherits UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockGridModel>
22
@{
3-
if (Model?.Any() != true) { return; }
3+
if (Model?.Any() != true)
4+
{
5+
return;
6+
}
47
}
58

69
<div class="umb-block-grid container-fluid"

0 commit comments

Comments
 (0)