diff --git a/FeatureManagementDashboard.sln b/FeatureManagementDashboard.sln index 6603e75..ecfecc1 100644 --- a/FeatureManagementDashboard.sln +++ b/FeatureManagementDashboard.sln @@ -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 @@ -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 diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 47c286a..fc0f22d 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -14,7 +14,7 @@ - net6.0;net5.0 + net7.0;net6.0;net5.0 @@ -41,11 +41,6 @@ enable disable - false - false - false - false - false diff --git a/src/FeatureManagement.ExampleWeb/.gitignore b/src/FeatureManagement.ExampleWeb/.gitignore index 5444415..8bcfaae 100644 --- a/src/FeatureManagement.ExampleWeb/.gitignore +++ b/src/FeatureManagement.ExampleWeb/.gitignore @@ -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/ \ No newline at end of file +# Media files +/wwwroot/media/ diff --git a/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/Lang/en-US.xml b/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/Lang/en-US.xml new file mode 100644 index 0000000..7640747 --- /dev/null +++ b/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/Lang/en-US.xml @@ -0,0 +1,12 @@ + + + + Feature Management + + + Feature Management Dashboard + Future management tool for Umbraco. A feature flags a technique that provides functions to hide, enable or disable the feature during runtime. + Status + Feature Name + + \ No newline at end of file diff --git a/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/dashboard.controller.js b/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/dashboard.controller.js new file mode 100644 index 0000000..dec1f92 --- /dev/null +++ b/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/dashboard.controller.js @@ -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]); +})(); \ No newline at end of file diff --git a/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/dashboard.html b/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/dashboard.html new file mode 100644 index 0000000..1bef079 --- /dev/null +++ b/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/dashboard.html @@ -0,0 +1,41 @@ +
+
+ +
+ + +
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+
{{feature.Name}}
+
+ + +
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/package.manifest b/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/package.manifest new file mode 100644 index 0000000..22e80dc --- /dev/null +++ b/src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/package.manifest @@ -0,0 +1,5 @@ +{ + "javascript": [ + "~/App_Plugins/FeatureManagementDashboard/dashboard.controller.js" + ] +} \ No newline at end of file diff --git a/src/FeatureManagement.ExampleWeb/FeatureManagement.ExampleWeb.csproj b/src/FeatureManagement.ExampleWeb/FeatureManagement.ExampleWeb.csproj index ed59ab7..658bf52 100644 --- a/src/FeatureManagement.ExampleWeb/FeatureManagement.ExampleWeb.csproj +++ b/src/FeatureManagement.ExampleWeb/FeatureManagement.ExampleWeb.csproj @@ -1,7 +1,7 @@ - + - false - false + net7.0 + FeatureManagement.ExampleWeb @@ -12,36 +12,38 @@ - - + - - + + + + + + + + + + - - - - $(DefaultItemExcludes);App_Plugins/**; - $(DefaultItemExcludes);umbraco/**; - $(DefaultItemExcludes);wwwroot/media/**; - + + @@ -53,17 +55,15 @@ - - - + true - + false false - - \ No newline at end of file + + diff --git a/src/FeatureManagement.ExampleWeb/Program.cs b/src/FeatureManagement.ExampleWeb/Program.cs index a243b49..b43d617 100644 --- a/src/FeatureManagement.ExampleWeb/Program.cs +++ b/src/FeatureManagement.ExampleWeb/Program.cs @@ -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()); - -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(); }); - } } - -#pragma warning restore SA1649 // File name should match first type name } \ No newline at end of file diff --git a/src/FeatureManagement.ExampleWeb/Properties/launchSettings.json b/src/FeatureManagement.ExampleWeb/Properties/launchSettings.json index 7708575..eb8e6ed 100644 --- a/src/FeatureManagement.ExampleWeb/Properties/launchSettings.json +++ b/src/FeatureManagement.ExampleWeb/Properties/launchSettings.json @@ -4,8 +4,8 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:13050", - "sslPort": 44331 + "applicationUrl": "http://localhost:55669", + "sslPort": 44349 } }, "profiles": { @@ -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" } diff --git a/src/FeatureManagement.ExampleWeb/Startup.cs b/src/FeatureManagement.ExampleWeb/Startup.cs new file mode 100644 index 0000000..9698cc5 --- /dev/null +++ b/src/FeatureManagement.ExampleWeb/Startup.cs @@ -0,0 +1,49 @@ +using FeaturesManagementDashboard.Extensions; +using Umbraco.Cms.Core.DependencyInjection; +using Umbraco.Extensions; + +namespace FeatureManagement.ExampleWeb +{ + public class Startup + { + 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) + .AddFeaturesManagementDashboard() + .AddBackOffice() + .AddWebsite() + .AddComposers() + .Build(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseUmbraco() + .WithMiddleware(u => + { + u.UseBackOffice(); + u.UseWebsite(); + }) + .WithEndpoints(u => + { + u.UseInstallerEndpoints(); + u.UseBackOfficeEndpoints(); + u.UseWebsiteEndpoints(); + }); + } + } +} \ No newline at end of file diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/area.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/area.cshtml new file mode 100644 index 0000000..3614847 --- /dev/null +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/area.cshtml @@ -0,0 +1,10 @@ +@using Umbraco.Extensions +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + +
+ @await Html.GetBlockGridItemsHtmlAsync(Model) +
diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/areas.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/areas.cshtml new file mode 100644 index 0000000..30f987c --- /dev/null +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/areas.cshtml @@ -0,0 +1,13 @@ +@using Umbraco.Extensions +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@{ + if (Model?.Areas.Any() != true) { return; } +} + +
+ @foreach (var area in Model.Areas) + { + @await Html.GetBlockGridItemAreaHtmlAsync(area) + } +
diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/default.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/default.cshtml new file mode 100644 index 0000000..e25839e --- /dev/null +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/default.cshtml @@ -0,0 +1,11 @@ +@using Umbraco.Extensions +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@{ + if (Model?.Any() != true) { return; } +} + +
+ @await Html.GetBlockGridItemsHtmlAsync(Model) +
diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/items.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/items.cshtml new file mode 100644 index 0000000..2703fa5 --- /dev/null +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/blockgrid/items.cshtml @@ -0,0 +1,36 @@ +@using Umbraco.Cms.Core.Models.Blocks +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage> +@{ + if (Model?.Any() != true) { return; } +} + +
+ @foreach (var item in Model) + { + +
+ @{ + var partialViewName = "blockgrid/Components/" + item.Content.ContentType.Alias; + try + { + @await Html.PartialAsync(partialViewName, item) + } + catch (InvalidOperationException) + { +

+ Could not render component of type: @(item.Content.ContentType.Alias) +
+ This likely happened because the partial view @partialViewName could not be found. +

+ } + } +
+ } +
diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/blocklist/default.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/blocklist/default.cshtml index d5944b9..accca2e 100644 --- a/src/FeatureManagement.ExampleWeb/Views/Partials/blocklist/default.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/blocklist/default.cshtml @@ -1,6 +1,6 @@ @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage @{ - if (!Model.Any()) { return; } + if (Model?.Any() != true) { return; } }
@foreach (var block in Model) diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/bootstrap3-fluid.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/bootstrap3-fluid.cshtml index 8400492..b92734e 100644 --- a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/bootstrap3-fluid.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/bootstrap3-fluid.cshtml @@ -7,7 +7,7 @@ Razor helpers located at the bottom of this file *@ -@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null) +@if (Model is JObject && Model?.sections is not null) { var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; @@ -55,7 +55,7 @@
@foreach (var control in area.controls) { - if (control != null && control.editor != null && control.editor.view != null) + if (control?.editor?.view != null) { @await Html.PartialAsync("grid/editors/base", (object)control) } diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/bootstrap3.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/bootstrap3.cshtml index ebe1cf7..8863788 100644 --- a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/bootstrap3.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/bootstrap3.cshtml @@ -3,9 +3,9 @@ @using Newtonsoft.Json.Linq @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage -@if (Model != null && Model.GetType() == typeof(JObject) && Model.sections != null) +@if (Model is JObject && Model?.sections is not null) { - var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; + var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1;
@if (oneColumn) @@ -56,7 +56,7 @@
@foreach (var control in area.controls) { - if (control != null && control.editor != null && control.editor.view != null) + if (control?.editor?.view != null) { @await Html.PartialAsync("grid/editors/base", (object)control) } diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/base.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/base.cshtml index eca6381..e40543b 100644 --- a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/base.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/base.cshtml @@ -3,7 +3,7 @@ @try { string editor = EditorView(Model); - @await Html.PartialAsync(editor, (object)Model) + @await Html.PartialAsync(editor, Model as object) } catch (Exception ex) { @@ -15,7 +15,7 @@ catch (Exception ex) public static string EditorView(dynamic contentItem) { string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString(); - view = view.ToLower().Replace(".html", ".cshtml"); + view = view.Replace(".html", ".cshtml"); if (!view.Contains("/")) { diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/embed.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/embed.cshtml index a383046..74c8fe2 100644 --- a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/embed.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/embed.cshtml @@ -1,10 +1,11 @@ -@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage -@{ - string embedValue = Convert.ToString(Model.value); - embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value; -} +@if (Model is not null) +{ + string embedValue = Convert.ToString(Model.value); + embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value; -
- @Html.Raw(embedValue) -
+
+ @Html.Raw(embedValue) +
+} diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/macro.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/macro.cshtml index 0e9661e..a4450d1 100644 --- a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/macro.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/macro.cshtml @@ -1,6 +1,6 @@ @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage -@if (Model.value != null) +@if (Model?.value is not null) { string macroAlias = Model.value.macroAlias.ToString(); var parameters = new Dictionary(); diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/media.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/media.cshtml index 4cc31d0..bc3b111 100644 --- a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/media.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/media.cshtml @@ -2,7 +2,8 @@ @using Umbraco.Cms.Core.Media @using Umbraco.Cms.Core.PropertyEditors.ValueConverters @inject IImageUrlGenerator ImageUrlGenerator -@if (Model.value != null) + +@if (Model?.value is not null) { var url = Model.value.image; diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/rte.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/rte.cshtml index e14c6e1..9445666 100644 --- a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/rte.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/rte.cshtml @@ -5,7 +5,7 @@ @inject HtmlImageSourceParser HtmlImageSourceParser; @{ - var value = HtmlLocalLinkParser.EnsureInternalLinks(Model.value.ToString()); + var value = HtmlLocalLinkParser.EnsureInternalLinks(Model?.value.ToString()); value = HtmlUrlParser.EnsureUrls(value); value = HtmlImageSourceParser.EnsureImageSources(value); } diff --git a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/textstring.cshtml b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/textstring.cshtml index 42972f6..e6b9352 100644 --- a/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/textstring.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/Partials/grid/editors/textstring.cshtml @@ -1,7 +1,6 @@ -@using System.Web @model dynamic -@if (Model.editor.config.markup != null) +@if (Model?.editor.config.markup is not null) { string markup = Model.editor.config.markup.ToString(); markup = markup.Replace("#value#", Html.ReplaceLineBreaks((string)Model.value.ToString()).ToString()); @@ -18,6 +17,6 @@ else { -
@Model.value
+
@Model?.value
} diff --git a/src/FeatureManagement.ExampleWeb/Views/_ViewImports.cshtml b/src/FeatureManagement.ExampleWeb/Views/_ViewImports.cshtml index 97ed030..541ba3d 100644 --- a/src/FeatureManagement.ExampleWeb/Views/_ViewImports.cshtml +++ b/src/FeatureManagement.ExampleWeb/Views/_ViewImports.cshtml @@ -7,4 +7,4 @@ @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Microsoft.FeatureManagement.AspNetCore @addTagHelper *, Smidge -@inject Smidge.SmidgeHelper SmidgeHelper +@inject Smidge.SmidgeHelper SmidgeHelper \ No newline at end of file diff --git a/src/FeatureManagement.ExampleWeb/appsettings.Development.json b/src/FeatureManagement.ExampleWeb/appsettings.Development.json index 13d5c48..0c279af 100644 --- a/src/FeatureManagement.ExampleWeb/appsettings.Development.json +++ b/src/FeatureManagement.ExampleWeb/appsettings.Development.json @@ -1,5 +1,5 @@ { - "$schema": "./umbraco/config/appsettings-schema.json", + "$schema": "appsettings-schema.json", "Serilog": { "MinimumLevel": { "Default": "Information" @@ -25,19 +25,12 @@ "Content": { "MacroErrors": "Throw" }, - "Global": { - "Smtp": { - "From": "your@email.here", - "Host": "localhost", - "Port": 25 - } - }, "Hosting": { "Debug": true }, "RuntimeMinification": { - "useInMemoryCache": true, - "cacheBuster": "Timestamp" + "UseInMemoryCache": true, + "CacheBuster": "Timestamp" } } } diff --git a/src/FeatureManagement.ExampleWeb/appsettings.json b/src/FeatureManagement.ExampleWeb/appsettings.json index 1e1c5c7..348f793 100644 --- a/src/FeatureManagement.ExampleWeb/appsettings.json +++ b/src/FeatureManagement.ExampleWeb/appsettings.json @@ -1,5 +1,5 @@ { - "$schema": "./umbraco/config/appsettings-schema.json", + "$schema": "appsettings-schema.json", "Serilog": { "MinimumLevel": { "Default": "Information", @@ -10,24 +10,17 @@ } } }, - "ConnectionStrings": { - "umbracoDbDSN": "" - }, "Umbraco": { "CMS": { - "Hosting": { - "Debug": false + "Global": { + "Id": "26848e4a-acc6-434e-b673-9c09763e3fbb", + "SanitizeTinyMce": true }, "Content": { + "AllowEditInvariantFromNonDefault": true, "ContentVersionCleanupPolicy": { "EnableCleanup": true } - }, - "ModelsBuilder": { - "ModelsMode": "Nothing" - }, - "Global": { - "Id": "af261308-8c62-4525-8e66-654a78200a3d" } } }, diff --git a/src/Module.FeaturesManagementDashboard.Application/FeaturesManagementDashboard.Application.csproj b/src/Module.FeaturesManagementDashboard.Application/FeaturesManagementDashboard.Application.csproj index 3119f48..801caf5 100644 --- a/src/Module.FeaturesManagementDashboard.Application/FeaturesManagementDashboard.Application.csproj +++ b/src/Module.FeaturesManagementDashboard.Application/FeaturesManagementDashboard.Application.csproj @@ -4,8 +4,8 @@ - - + + diff --git a/src/Module.FeaturesManagementDashboard.Infrastructure/FeaturesManagementDashboard.Infrastructure.csproj b/src/Module.FeaturesManagementDashboard.Infrastructure/FeaturesManagementDashboard.Infrastructure.csproj index bc7eea4..cbeb3f0 100644 --- a/src/Module.FeaturesManagementDashboard.Infrastructure/FeaturesManagementDashboard.Infrastructure.csproj +++ b/src/Module.FeaturesManagementDashboard.Infrastructure/FeaturesManagementDashboard.Infrastructure.csproj @@ -8,13 +8,15 @@ - - - - + + + + + + diff --git a/src/Module.FeaturesManagementDashboard.Infrastructure/Repositories/UmbracoFeatureRepository.cs b/src/Module.FeaturesManagementDashboard.Infrastructure/Repositories/UmbracoFeatureRepository.cs index 3d175e9..42bb613 100644 --- a/src/Module.FeaturesManagementDashboard.Infrastructure/Repositories/UmbracoFeatureRepository.cs +++ b/src/Module.FeaturesManagementDashboard.Infrastructure/Repositories/UmbracoFeatureRepository.cs @@ -74,6 +74,7 @@ public async ValueTask> GetAllAsync() } catch (Exception) { + // ignored } return Enumerable.Empty(); @@ -96,6 +97,7 @@ public async ValueTask GetAsync(FeatureId featureId) } catch (Exception) { + // ignored } return null; @@ -122,6 +124,7 @@ public async ValueTask SaveAsync(Feature feature) } catch (Exception) { + // ignored } } } diff --git a/src/Module.FeaturesManagementDashboard/FeaturesManagementDashboard.csproj b/src/Module.FeaturesManagementDashboard/FeaturesManagementDashboard.csproj index ea9e6de..444e218 100644 --- a/src/Module.FeaturesManagementDashboard/FeaturesManagementDashboard.csproj +++ b/src/Module.FeaturesManagementDashboard/FeaturesManagementDashboard.csproj @@ -4,8 +4,8 @@ . Our.Umbraco.FeaturesManagementDashboard Our.Umbraco.FeaturesManagementDashboard - Feature Management dashboard for Umbraco 9/10. This package adds feature management dashboard into **Umbraco** backoffice. It use as feature management the Microsoft Feature Flags engine - Feature Management dashboard for Umbraco 9/10 + Feature Management dashboard for Umbraco 9/10/11. This package adds feature management dashboard into **Umbraco** backoffice. It use as feature management the Microsoft Feature Flags engine + Feature Management dashboard for Umbraco 9/10/11 umbraco plugin package feature management toggle Adrian Ochmann, Marcin Zajkowski @@ -26,13 +26,13 @@ - - - - - - - + + + + + + + diff --git a/src/Shared/Shared.csproj b/src/Shared/Shared.csproj index 1c3989f..e9562c6 100644 --- a/src/Shared/Shared.csproj +++ b/src/Shared/Shared.csproj @@ -4,9 +4,9 @@ - - - + + +