-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: upgraded packages to net7 and Umbraco 11
- Loading branch information
Showing
32 changed files
with
323 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/Lang/en-US.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
34 changes: 34 additions & 0 deletions
34
...atureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/dashboard.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | ||
})(); |
41 changes: 41 additions & 0 deletions
41
src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/dashboard.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
5 changes: 5 additions & 0 deletions
5
src/FeatureManagement.ExampleWeb/App_Plugins/FeatureManagementDashboard/package.manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"javascript": [ | ||
"~/App_Plugins/FeatureManagementDashboard/dashboard.controller.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.