Skip to content

Commit

Permalink
feat: upgraded packages to net7 and Umbraco 11
Browse files Browse the repository at this point in the history
  • Loading branch information
aochmann committed Dec 1, 2022
1 parent ddc3fea commit 931769f
Show file tree
Hide file tree
Showing 32 changed files with 323 additions and 180 deletions.
10 changes: 5 additions & 5 deletions FeatureManagementDashboard.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FeaturesManagementDashboard
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FeaturesManagementDashboard.Domain", "src\Module.FeaturesManagementDashboard.Domain\FeaturesManagementDashboard.Domain.csproj", "{3D0323E0-F6B6-44D5-93C7-28F7C003FC52}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FeatureManagement.ExampleWeb", "src\FeatureManagement.ExampleWeb\FeatureManagement.ExampleWeb.csproj", "{074FF0D5-AC9D-4459-8BD1-6231C45C6850}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FeatureManagement.ExampleWeb", "src\FeatureManagement.ExampleWeb\FeatureManagement.ExampleWeb.csproj", "{D79496FA-B21F-46A2-B40B-EF0C262BBC8C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -72,10 +72,10 @@ Global
{3D0323E0-F6B6-44D5-93C7-28F7C003FC52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D0323E0-F6B6-44D5-93C7-28F7C003FC52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D0323E0-F6B6-44D5-93C7-28F7C003FC52}.Release|Any CPU.Build.0 = Release|Any CPU
{074FF0D5-AC9D-4459-8BD1-6231C45C6850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{074FF0D5-AC9D-4459-8BD1-6231C45C6850}.Debug|Any CPU.Build.0 = Debug|Any CPU
{074FF0D5-AC9D-4459-8BD1-6231C45C6850}.Release|Any CPU.ActiveCfg = Release|Any CPU
{074FF0D5-AC9D-4459-8BD1-6231C45C6850}.Release|Any CPU.Build.0 = Release|Any CPU
{D79496FA-B21F-46A2-B40B-EF0C262BBC8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D79496FA-B21F-46A2-B40B-EF0C262BBC8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D79496FA-B21F-46A2-B40B-EF0C262BBC8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D79496FA-B21F-46A2-B40B-EF0C262BBC8C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 1 addition & 6 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- Project Setup -->

<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TargetFrameworks>net6.0;net5.0</TargetFrameworks>
<TargetFrameworks>net7.0;net6.0;net5.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' != 'Release'">
Expand All @@ -41,11 +41,6 @@
<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0'">
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<PackRelease>false</PackRelease>
<PublishRelease>false</PublishRelease>
<EnablePreviewFeatures>false</EnablePreviewFeatures>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
Expand Down
45 changes: 16 additions & 29 deletions src/FeatureManagement.ExampleWeb/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -453,40 +453,27 @@ $RECYCLE.BIN/
!.vscode/launch.json
!.vscode/extensions.json


##
## Umbraco CMS .NETCore
## Umbraco CMS
##

# Dont commit Umbraco TEMP folder containing Examine Indexes, NuCache etc
**/umbraco/Data/TEMP/

# Dont commit files that are generated and cached from the default ImageSharp location
**/umbraco/mediacache/

# Umbraco backoffice language files
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
# Customize langguage files in /config/lang/{language}.user.xml
**/umbraco/config/lang/

# JSON Schema file for appsettings
# This is auto generated from the build
**/umbraco/config/appsettings-schema.json
# JSON schema files for appsettings.json
appsettings-schema.json
appsettings-schema.*.json

# This is the no-nodes, installer & upgrader pages from Umbraco
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
**/umbraco/UmbracoWebsite/
**/umbraco/UmbracoInstall/
**/umbraco/UmbracoBackOffice/
# Packages created from the backoffice (package.xml/package.zip)
/umbraco/Data/CreatedPackages/

# Comment out the line below if you wish to change or add any new templates to PartialView Macros
**/umbraco/PartialViewMacros/
# Temp folder containing Examine indexes, NuCache, MediaCache, etc.
/umbraco/Data/TEMP/

# Umbraco Static Assets of Backoffice
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
**/wwwroot/umbraco/
# SQLite database files
/umbraco/Data/*.sqlite.db
/umbraco/Data/*.sqlite.db-shm
/umbraco/Data/*.sqlite.db-wal

App_Plugins/FeatureManagementDashboard/**/*.*
# Log files
/umbraco/Logs/

**/wwwroot/
**/umbraco/
# Media files
/wwwroot/media/
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<language alias="en" intName="English (US)" localName="English (US)" lcid="" culture="en-US">
<area alias="dashboardTabs">
<key alias="Our.Umbraco.FeaturesManagementDashboard">Feature Management</key>
</area>
<area alias="featureManagementDashboard">
<key alias="title">Feature Management Dashboard</key>
<key alias="description">Future management tool for Umbraco. A feature flags a technique that provides functions to hide, enable or disable the feature during runtime.</key>
<key alias="column_status">Status</key>
<key alias="column_name">Feature Name</key>
</area>
</language>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
(function () {
"use strict";

function controller($http) {
var vm = this;
vm.features = [];
vm.changeFeatureStatus = changeFeatureStatus;
vm.getFeatures = getFeatures;
vm.featureStatusChange = featureStatusChange;

function featureStatusChange(feature) {
console.log("feature change click", feature);
feature.Status = !feature.Status;
vm.changeFeatureStatus(feature.Id, feature.Status);
}

function getFeatures() {
$http.get('/umbraco/backoffice/api/FeaturesManagementDashboard/features').then(function (res) {
vm.features = res.data;
});
}

function changeFeatureStatus(featureId, featureStatus) {
$http.put(`/umbraco/backoffice/api/FeaturesManagementDashboard/features/${featureId}/status`, { status: featureStatus }).then(function (res) {
});
}

vm.getFeatures();

return vm;
}

angular.module("umbraco").controller("Our.Umbraco.FeatureManagementDashboard.Controller", ['$http', controller]);
})();
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<div ng-controller="Our.Umbraco.FeatureManagementDashboard.Controller as vm">
<div>
<umb-box>
<div slot="header">
<umb-box-header title-key="featureManagementDashboard_title"
description-key="featureManagementDashboard_description">
</umb-box-header>
</div>
<div slot="main">
<umb-box-content>
<div class="umb-table">
<div class="umb-table-head">
<div class="umb-table-row">
<div class="umb-table-cell">
<umb-icon icon="icon-settings"></umb-icon>
</div>
<div class="umb-table-cell umb-table__name not-fixed"><localize key="featureManagementDashboard_column_name"></localize></div>
<div class="umb-table-cell"><localize key="featureManagementDashboard_column_status"></localize></div>
</div>
</div>
<div class="umb-table-body">
<div class="umb-table-row" ng-repeat="feature in vm.features">
<div class="umb-table-cell">
<umb-icon icon="icon-settings-alt"></umb-icon>
</div>
<div class="umb-table-cell umb-table__name not-fixed">{{feature.Name}}</div>
<div class="umb-table-cell">
<umb-toggle checked="feature.Status"
on-Click="vm.featureStatusChange(feature)"
show-labels="false"
input-id="feature.Id">
</umb-toggle>
</div>
</div>
</div>
</div>
</umb-box-content>
</div>
</umb-box>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"javascript": [
"~/App_Plugins/FeatureManagementDashboard/dashboard.controller.js"
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace>FeatureManagement.ExampleWeb</RootNamespace>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -12,36 +12,38 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="2.4.0" />
<PackageReference Include="Umbraco.Cms" Version="10.2.1" />
<PackageReference Include="Umbraco.Cms" Version="11.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="2.4.0" />
<PackageReference Include="Umbraco.Cms" Version="10.2.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="2.4.0" />
<PackageReference Include="Umbraco.Cms" Version="9.5.4" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.FeatureManagement" Version="2.5.1" />
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="2.5.1" />
</ItemGroup>

<ItemGroup>
<!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Module.FeaturesManagementDashboard.Application\FeaturesManagementDashboard.Application.csproj" />
<ProjectReference Include="..\Module.FeaturesManagementDashboard.Domain\FeaturesManagementDashboard.Domain.csproj" />
<ProjectReference Include="..\Module.FeaturesManagementDashboard.Infrastructure\FeaturesManagementDashboard.Infrastructure.csproj" />
<ProjectReference Include="..\Module.FeaturesManagementDashboard\FeaturesManagementDashboard.csproj" />
<ProjectReference Include="..\SharedAbstractions\SharedAbstractions.csproj" />
<ProjectReference Include="..\Shared\Shared.csproj" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" />
</ItemGroup>

<PropertyGroup>
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins/**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco/**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot/media/**;</DefaultItemExcludes>
</PropertyGroup>

<Import Project="..\Module.FeaturesManagementDashboard\build\Our.Umbraco.FeaturesManagementDashboard.targets" />

<ItemGroup>
<Content Include="App_Plugins/**" CopyToOutputDirectory="Always" />
Expand All @@ -53,17 +55,15 @@
<Compile Include="umbraco/models/**" Exclude="**/*.flag" />
</ItemGroup>

<Import Project="..\Module.FeaturesManagementDashboard\build\Our.Umbraco.FeaturesManagementDashboard.targets" />


<PropertyGroup>
<!-- Razor files are needed for the backoffice to work correctly -->
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
</PropertyGroup>

<!-- Set this to true if ModelsBuilder mode is not InMemoryAuto-->
<PropertyGroup>
<!-- Remove RazorCompileOnBuild and RazorCompileOnPublish when not using ModelsMode InMemoryAuto -->
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorCompileOnPublish>false</RazorCompileOnPublish>
</PropertyGroup>

</Project>
</Project>
66 changes: 12 additions & 54 deletions src/FeatureManagement.ExampleWeb/Program.cs
Original file line number Diff line number Diff line change
@@ -1,61 +1,19 @@
using FeatureManagement.ExampleWeb;
using FeaturesManagementDashboard.Extensions;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Extensions;

var builder = Host.CreateDefaultBuilder(args)
.ConfigureLogging(configure => configure.ClearProviders())
.ConfigureWebHostDefaults(webHost => webHost.UseStartup<Startup>());

using var app = builder.Build();

await app.RunAsync();

namespace FeatureManagement.ExampleWeb
{
#pragma warning disable SA1649 // File name should match first type name

internal class Startup
public static class Program
{
private readonly IWebHostEnvironment _env;
private readonly IConfiguration _config;

public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config)
{
_env = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment));
_config = config ?? throw new ArgumentNullException(nameof(config));
}

public void ConfigureServices(IServiceCollection services)
=> services
.AddUmbraco(_env, _config)
.AddBackOffice()
.AddWebsite()
.AddComposers()
.AddFeaturesManagementDashboard()
.Build();

public static void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}

app.UseUmbraco()
.WithMiddleware(u =>
public static void Main(string[] args)
=> CreateHostBuilder(args)
.Build()
.Run();

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureUmbracoDefaults()
.ConfigureWebHostDefaults(webBuilder =>
{
u.UseBackOffice();
u.UseWebsite();
})
.WithEndpoints(u =>
{
u.UseInstallerEndpoints();
u.UseBackOfficeEndpoints();
u.UseWebsiteEndpoints();
webBuilder.UseStaticWebAssets();
webBuilder.UseStartup<Startup>();
});
}
}

#pragma warning restore SA1649 // File name should match first type name
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:13050",
"sslPort": 44331
"applicationUrl": "http://localhost:55669",
"sslPort": 44349
}
},
"profiles": {
Expand All @@ -20,7 +20,7 @@
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:44331;http://localhost:13050",
"applicationUrl": "https://localhost:44349;http://localhost:55669",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down
Loading

0 comments on commit 931769f

Please sign in to comment.