Skip to content

Commit 2c0bb3f

Browse files
author
Warren Buckley
authored
Merge pull request #33 from umbraco-community/feature/manifest-filter
Adds package in Umbraco backoffice
2 parents 61708ca + d342019 commit 2c0bb3f

24 files changed

+169
-180
lines changed

Our.Umbraco.TagHelpers.Playground/.gitignore renamed to Our.Umbraco.TagHelpers.ExampleSite/.gitignore

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -453,35 +453,26 @@ $RECYCLE.BIN/
453453
!.vscode/launch.json
454454
!.vscode/extensions.json
455455

456-
457456
##
458-
## Umbraco CMS .NETCore
457+
## Umbraco CMS
459458
##
460459

461-
# Dont commit Umbraco TEMP folder containing Examine Indexes, NuCache etc
462-
**/umbraco/Data/TEMP/
463-
464-
# Dont commit files that are generated and cached from the default ImageSharp location
465-
**/umbraco/mediacache/
460+
# JSON schema file for appsettings.json
461+
appsettings-schema.json
466462

467-
# Umbraco backoffice language files
468-
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
469-
# Customize langguage files in /config/lang/{language}.user.xml
470-
**/umbraco/config/lang/
463+
# Packages created from the backoffice (package.xml/package.zip)
464+
/umbraco/Data/CreatedPackages/
471465

472-
# JSON Schema file for appsettings
473-
# This is auto generated from the build
474-
**/umbraco/config/appsettings-schema.json
466+
# Temp folder containing Examine indexes, NuCache, MediaCache, etc.
467+
/umbraco/Data/TEMP/
475468

476-
# This is the no-nodes, installer & upgrader pages from Umbraco
477-
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
478-
**/umbraco/UmbracoWebsite/
479-
**/umbraco/UmbracoInstall/
480-
**/umbraco/UmbracoBackOffice/
469+
# SQLite database files
470+
/umbraco/Data/*.sqlite.db
471+
/umbraco/Data/*.sqlite.db-shm
472+
/umbraco/Data/*.sqlite.db-wal
481473

482-
# Comment out the line below if you wish to change or add any new templates to PartialView Macros
483-
**/umbraco/PartialViewMacros/
474+
# Log files
475+
/umbraco/Logs/
484476

485-
# Umbraco Static Assets of Backoffice
486-
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
487-
**/wwwroot/umbraco/
477+
# Media files
478+
/wwwroot/media/
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
<PropertyGroup>
3+
<TargetFramework>net6.0</TargetFramework>
4+
<ImplicitUsings>enable</ImplicitUsings>
5+
<Nullable>enable</Nullable>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="Umbraco.Cms" Version="10.1.0" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
14+
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
15+
<ProjectReference Include="..\Our.Umbraco.TagHelpers\Our.Umbraco.TagHelpers.csproj" />
16+
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
17+
</ItemGroup>
18+
19+
<PropertyGroup>
20+
<!-- Razor files are needed for the backoffice to work correctly -->
21+
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
22+
</PropertyGroup>
23+
24+
<PropertyGroup>
25+
<!-- Remove RazorCompileOnBuild and RazorCompileOnPublish when not using ModelsMode InMemoryAuto -->
26+
<RazorCompileOnBuild>false</RazorCompileOnBuild>
27+
<RazorCompileOnPublish>false</RazorCompileOnPublish>
28+
</PropertyGroup>
29+
30+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace Our.Umbraco.TagHelpers.ExampleSite
2+
{
3+
public class Program
4+
{
5+
public static void Main(string[] args)
6+
=> CreateHostBuilder(args)
7+
.Build()
8+
.Run();
9+
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+
}
19+
}

Our.Umbraco.TagHelpers.Playground/Properties/launchSettings.json renamed to Our.Umbraco.TagHelpers.ExampleSite/Properties/launchSettings.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"windowsAuthentication": false,
55
"anonymousAuthentication": true,
66
"iisExpress": {
7-
"applicationUrl": "http://localhost:17329",
8-
"sslPort": 44330
7+
"applicationUrl": "http://localhost:46843",
8+
"sslPort": 44370
99
}
1010
},
1111
"profiles": {
@@ -16,23 +16,14 @@
1616
"ASPNETCORE_ENVIRONMENT": "Development"
1717
}
1818
},
19-
"Our.Umbraco.TagHelpers.Playground [Dev]": {
19+
"Umbraco.Web.UI": {
2020
"commandName": "Project",
2121
"dotnetRunMessages": true,
2222
"launchBrowser": true,
23-
"applicationUrl": "https://localhost:44330;http://localhost:17329",
23+
"applicationUrl": "https://localhost:44370;http://localhost:46843",
2424
"environmentVariables": {
2525
"ASPNETCORE_ENVIRONMENT": "Development"
26-
}
27-
},
28-
"Our.Umbraco.TagHelpers.Playground [Prod]": {
29-
"commandName": "Project",
30-
"dotnetRunMessages": true,
31-
"launchBrowser": true,
32-
"applicationUrl": "https://localhost:44330;http://localhost:17329",
33-
"environmentVariables": {
34-
"ASPNETCORE_ENVIRONMENT": "Production"
35-
}
26+
}
3627
}
3728
}
3829
}

Our.Umbraco.TagHelpers.Playground/Startup.cs renamed to Our.Umbraco.TagHelpers.ExampleSite/Startup.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
using System;
2-
using Microsoft.AspNetCore.Builder;
3-
using Microsoft.AspNetCore.Hosting;
4-
using Microsoft.Extensions.Configuration;
5-
using Microsoft.Extensions.DependencyInjection;
6-
using Microsoft.Extensions.Hosting;
7-
using Umbraco.Cms.Core.DependencyInjection;
8-
using Umbraco.Extensions;
9-
10-
namespace Our.Umbraco.TagHelpers.Playground
1+
namespace Our.Umbraco.TagHelpers.ExampleSite
112
{
123
public class Startup
134
{
@@ -20,7 +11,7 @@ public class Startup
2011
/// <param name="webHostEnvironment">The web hosting environment.</param>
2112
/// <param name="config">The configuration.</param>
2213
/// <remarks>
23-
/// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337
14+
/// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337.
2415
/// </remarks>
2516
public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config)
2617
{
@@ -34,18 +25,15 @@ public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config)
3425
/// <param name="services">The services.</param>
3526
/// <remarks>
3627
/// This method gets called by the runtime. Use this method to add services to the container.
37-
/// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
28+
/// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940.
3829
/// </remarks>
3930
public void ConfigureServices(IServiceCollection services)
4031
{
41-
#pragma warning disable IDE0022 // Use expression body for methods
4232
services.AddUmbraco(_env, _config)
4333
.AddBackOffice()
4434
.AddWebsite()
4535
.AddComposers()
4636
.Build();
47-
#pragma warning restore IDE0022 // Use expression body for methods
48-
4937
}
5038

5139
/// <summary>
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListModel>
22
@{
3-
if (!Model.Any()) { return; }
3+
if (Model?.Any() != true) { return; }
44
}
55
<div class="umb-block-list">
66
@foreach (var block in Model)
77
{
88
if (block?.ContentUdi == null) { continue; }
99
var data = block.Content;
1010

11-
@await Html.PartialAsync("BlockList/Components/" + data.ContentType.Alias, block)
11+
@await Html.PartialAsync("blocklist/Components/" + data.ContentType.Alias, block)
1212
}
1313
</div>

Our.Umbraco.TagHelpers.Playground/Views/Partials/grid/bootstrap3-fluid.cshtml renamed to Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/bootstrap3-fluid.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Razor helpers located at the bottom of this file
88
*@
99

10-
@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null)
10+
@if (Model is JObject && Model?.sections is not null)
1111
{
1212
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
1313

@@ -55,7 +55,7 @@
5555
<div @RenderElementAttributes(area)>
5656
@foreach (var control in area.controls)
5757
{
58-
if (control != null && control.editor != null && control.editor.view != null)
58+
if (control?.editor?.view != null)
5959
{
6060
<text>@await Html.PartialAsync("grid/editors/base", (object)control)</text>
6161
}

Our.Umbraco.TagHelpers.Playground/Views/Partials/grid/bootstrap3.cshtml renamed to Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/bootstrap3.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
@using Newtonsoft.Json.Linq
44
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
55

6-
@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null)
6+
@if (Model is JObject && Model?.sections is not null)
77
{
8-
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
8+
var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
99

1010
<div class="umb-grid">
1111
@if (oneColumn)
@@ -56,7 +56,7 @@
5656
<div @RenderElementAttributes(area)>
5757
@foreach (var control in area.controls)
5858
{
59-
if (control != null && control.editor != null && control.editor.view != null)
59+
if (control?.editor?.view != null)
6060
{
6161
<text>@await Html.PartialAsync("grid/editors/base", (object)control)</text>
6262
}

Our.Umbraco.TagHelpers.Playground/Views/Partials/grid/editors/base.cshtml renamed to Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/base.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@try
44
{
55
string editor = EditorView(Model);
6-
<text>@await Html.PartialAsync(editor, (object)Model)</text>
6+
<text>@await Html.PartialAsync(editor, Model as object)</text>
77
}
88
catch (Exception ex)
99
{
@@ -15,7 +15,7 @@ catch (Exception ex)
1515
public static string EditorView(dynamic contentItem)
1616
{
1717
string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString();
18-
view = view.ToLower().Replace(".html", ".cshtml");
18+
view = view.Replace(".html", ".cshtml");
1919

2020
if (!view.Contains("/"))
2121
{
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<dynamic>
2+
3+
@if (Model is not null)
4+
{
5+
string embedValue = Convert.ToString(Model.value);
6+
embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value;
7+
8+
<div class="video-wrapper">
9+
@Html.Raw(embedValue)
10+
</div>
11+
}

0 commit comments

Comments
 (0)