Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/JsonSchema/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public class CmsDefinition
public InstallDefaultDataSettings? DefaultDataCreation { get; set; }

public DataTypesSettings? DataTypes { get; set; }

public MarketplaceSettings? Marketplace { get; set; }
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ namespace Umbraco.Cms.Core.Configuration.Models;
/// Typed configuration options for active directory settings.
/// </summary>
[UmbracoOptions(Constants.Configuration.ConfigActiveDirectory)]
[Obsolete("This is not used anymore. Will be removed in Umbraco 12")]public class ActiveDirectorySettings
[Obsolete("This is not used anymore. Will be removed in Umbraco 12")]
public class ActiveDirectorySettings
{
/// <summary>
/// Gets or sets a value for the Active Directory domain.
Expand Down
16 changes: 16 additions & 0 deletions src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.

namespace Umbraco.Cms.Core.Configuration.Models;

/// <summary>
/// Configuration options for the Marketplace.
/// </summary>
[UmbracoOptions(Constants.Configuration.ConfigMarketplace)]
public class MarketplaceSettings
{
/// <summary>
/// Gets or sets the additional parameters that are sent to the Marketplace.
/// </summary>
public Dictionary<string, string> AdditionalParameters { get; set; } = new ();
}
1 change: 1 addition & 0 deletions src/Umbraco.Core/Constants-Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public static class Configuration
public const string ConfigHostingDebug = ConfigHostingPrefix + "Debug";
public const string ConfigCustomErrorsMode = ConfigCustomErrorsPrefix + "Mode";
public const string ConfigActiveDirectory = ConfigPrefix + "ActiveDirectory";
public const string ConfigMarketplace = ConfigPrefix + "Marketplace";
public const string ConfigLegacyPasswordMigration = ConfigPrefix + "LegacyPasswordMigration";
public const string ConfigContent = ConfigPrefix + "Content";
public const string ConfigCoreDebug = ConfigCorePrefix + "Debug";
Expand Down
12 changes: 12 additions & 0 deletions src/Umbraco.Core/Constants-Marketplace.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Umbraco.Cms.Core;

public static partial class Constants
{
/// <summary>
/// Defines the constants used for the Umbraco Marketplace.
/// </summary>
public static class Marketplace
{
public const string Url = "https://marketplace.umbraco.com";
}
}
1 change: 1 addition & 0 deletions src/Umbraco.Core/Constants-PackageRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public static partial class Constants
/// <summary>
/// Defines the constants used for the Umbraco package repository
/// </summary>
[Obsolete("This is no longer used and will be removed in Umbraco 13")]
public static class PackageRepository
{
public const string RestApiBaseUrl = "https://our.umbraco.com/webapi/packages/v1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static IUmbracoBuilder AddConfiguration(this IUmbracoBuilder builder)
builder
.AddUmbracoOptions<ModelsBuilderSettings>()
.AddUmbracoOptions<ActiveDirectorySettings>()
.AddUmbracoOptions<MarketplaceSettings>()
.AddUmbracoOptions<ContentSettings>()
.AddUmbracoOptions<CoreDebugSettings>()
.AddUmbracoOptions<ExceptionFilterSettings>()
Expand Down
1 change: 1 addition & 0 deletions src/Umbraco.Core/EmbeddedResources/Lang/da.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,7 @@ Mange hilsner fra Umbraco robotten
<key alias="media">Mediearkiv</key>
<key alias="member">Medlemmer</key>
<key alias="packages">Pakker</key>
<key alias="marketplace">Marketplace</key>
<key alias="newsletters">Nyhedsbreve</key>
<key alias="settings">Indstillinger</key>
<key alias="statistics">Statistik</key>
Expand Down
1 change: 1 addition & 0 deletions src/Umbraco.Core/EmbeddedResources/Lang/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
<key alias="member">Members</key>
<key alias="newsletters">Newsletters</key>
<key alias="packages">Packages</key>
<key alias="marketplace">Marketplace</key>
<key alias="settings">Settings</key>
<key alias="statistics">Statistics</key>
<key alias="translation">Translation</key>
Expand Down
1 change: 1 addition & 0 deletions src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
<key alias="media">Media</key>
<key alias="member">Members</key>
<key alias="packages">Packages</key>
<key alias="marketplace">Marketplace</key>
<key alias="settings">Settings</key>
<key alias="translation">Translation</key>
<key alias="users">Users</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Runtime.Serialization;
using System.Web;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Routing;
Expand Down Expand Up @@ -54,6 +55,7 @@ public class BackOfficeServerVariables
private MemberPasswordConfigurationSettings _memberPasswordConfigurationSettings;
private DataTypesSettings _dataTypesSettings;
private readonly ITempDataDictionaryFactory _tempDataDictionaryFactory;
private MarketplaceSettings _marketplaceSettings;

[Obsolete("Use constructor that takes IOptionsMontior<DataTypeSettings>, scheduled for removal in V12")]
public BackOfficeServerVariables(
Expand Down Expand Up @@ -139,6 +141,7 @@ public BackOfficeServerVariables(
{
}

[Obsolete("Use constructor that takes IOptionsMonitor<MarketplaceSettings>, scheduled for removal in V13")]
public BackOfficeServerVariables(
LinkGenerator linkGenerator,
IRuntimeState runtimeState,
Expand All @@ -159,6 +162,52 @@ public BackOfficeServerVariables(
IOptionsMonitor<MemberPasswordConfigurationSettings> memberPasswordConfigurationSettings,
IOptionsMonitor<DataTypesSettings> dataTypesSettings,
ITempDataDictionaryFactory tempDataDictionaryFactory)
: this(
linkGenerator,
runtimeState,
features,
globalSettings,
umbracoVersion,
contentSettings,
httpContextAccessor,
treeCollection,
hostingEnvironment,
runtimeSettings,
securitySettings,
runtimeMinifier,
externalLogins,
imageUrlGenerator,
previewRoutes,
emailSender,
memberPasswordConfigurationSettings,
dataTypesSettings,
tempDataDictionaryFactory,
StaticServiceProvider.Instance.GetRequiredService<IOptionsMonitor<MarketplaceSettings>>()
)
{
}

public BackOfficeServerVariables(
LinkGenerator linkGenerator,
IRuntimeState runtimeState,
UmbracoFeatures features,
IOptionsMonitor<GlobalSettings> globalSettings,
IUmbracoVersion umbracoVersion,
IOptionsMonitor<ContentSettings> contentSettings,
IHttpContextAccessor httpContextAccessor,
TreeCollection treeCollection,
IHostingEnvironment hostingEnvironment,
IOptionsMonitor<RuntimeSettings> runtimeSettings,
IOptionsMonitor<SecuritySettings> securitySettings,
IRuntimeMinifier runtimeMinifier,
IBackOfficeExternalLoginProviders externalLogins,
IImageUrlGenerator imageUrlGenerator,
PreviewRoutes previewRoutes,
IEmailSender emailSender,
IOptionsMonitor<MemberPasswordConfigurationSettings> memberPasswordConfigurationSettings,
IOptionsMonitor<DataTypesSettings> dataTypesSettings,
ITempDataDictionaryFactory tempDataDictionaryFactory,
IOptionsMonitor<MarketplaceSettings> marketplaceSettings)
{
_linkGenerator = linkGenerator;
_runtimeState = runtimeState;
Expand All @@ -179,13 +228,15 @@ public BackOfficeServerVariables(
_tempDataDictionaryFactory = tempDataDictionaryFactory;
_memberPasswordConfigurationSettings = memberPasswordConfigurationSettings.CurrentValue;
_dataTypesSettings = dataTypesSettings.CurrentValue;
_marketplaceSettings = marketplaceSettings.CurrentValue;

globalSettings.OnChange(x => _globalSettings = x);
contentSettings.OnChange(x => _contentSettings = x);
runtimeSettings.OnChange(x => _runtimeSettings = x);
securitySettings.OnChange(x => _securitySettings = x);
dataTypesSettings.OnChange(x => _dataTypesSettings = x);
memberPasswordConfigurationSettings.OnChange(x => _memberPasswordConfigurationSettings = x);
marketplaceSettings.OnChange(x => _marketplaceSettings = x);
}

/// <summary>
Expand Down Expand Up @@ -298,6 +349,7 @@ internal async Task<Dictionary<string, object>> GetServerVariablesAsync()
{"gridConfig", _linkGenerator.GetPathByAction(nameof(BackOfficeController.GetGridConfig), backOfficeControllerName, new { area = Constants.Web.Mvc.BackOfficeArea })},
// TODO: This is ultra confusing! this same key is used for different things, when returning the full app when authenticated it is this URL but when not auth'd it's actually the ServerVariables address
{"serverVarsJs", _linkGenerator.GetPathByAction(nameof(BackOfficeController.Application), backOfficeControllerName, new { area = Constants.Web.Mvc.BackOfficeArea })},
{"marketplaceUrl", GetMarketplaceUrl()},
//API URLs
{
"packagesRestApiBaseUrl", Constants.PackageRepository.RestApiBaseUrl
Expand Down Expand Up @@ -625,6 +677,25 @@ internal async Task<Dictionary<string, object>> GetServerVariablesAsync()
return defaultVals;
}

private string GetMarketplaceUrl()
{
var uriBuilder = new UriBuilder(Constants.Marketplace.Url);

var query = HttpUtility.ParseQueryString(uriBuilder.Query);

query["umbversion"] = _runtimeState.SemanticVersion.ToSemanticStringWithoutBuild();
query["style"] = "backoffice";

foreach (var kvp in _marketplaceSettings.AdditionalParameters)
{
query[kvp.Key] = kvp.Value;
}

uriBuilder.Query = query.ToString();

return uriBuilder.ToString();
}

[DataContract]
private class PluginTree
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* @ngdoc service
* @name umbraco.resources.ourPackageRepositoryResource
* @description handles data for package installations
* @deprecated This resource is deprecated and will be removed in future versions. Umbraco no longer supports the Our Umbraco repository.
**/
function ourPackageRepositoryResource($q, $http, umbDataFormatter, umbRequestHelper) {
function ourPackageRepositoryResource($http, umbRequestHelper) {

var baseurl = Umbraco.Sys.ServerVariables.umbracoUrls.packagesRestApiBaseUrl;

Expand Down
38 changes: 38 additions & 0 deletions src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
[data-element="editor-packages"] {
.umb-pane {
height: 100%;
margin: 0;

.umb-pane-content,
.umb-editor-sub-views {
height: 100%;

.umb-editor-sub-view {
padding: 20px;
}

.sub-view-Marketplace {
height: 100%;
margin: 0;
padding: 0;

.umb-editor-sub-view__content {
height: 100%;
}
}
}
}
}

.umb-marketplace-view-wrapper {
height: 100%;
display: flex;
align-items: stretch;
}

.umb-marketplace-view {
width: 100%;
height: 100%;
overflow: hidden;
}

.umb-packages-view-title {
font-size: 20px;
font-weight: bold;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</div>

<div class="umb-pane">
<div ng-transclude></div>
<div class="umb-pane-content" ng-transclude></div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<div class="umb-editor-sub-views">

<div
id="sub-view-{{$index}}"
class="umb-editor-sub-view"
ng-repeat="subView in subViews track by subView.alias"
ng-class="'sub-view-' + subView.name"
val-sub-view="subView">

<div class="umb-editor-sub-view__content"
ng-show="subView.active === true"
ng-include="subView.view">
</div>

</div>

<div
id="sub-view-{{$index}}"
class="umb-editor-sub-view"
ng-repeat="subView in subViews track by subView.alias"
ng-class="'sub-view-' + subView.name"
val-sub-view="subView"
ng-if="subView.active"
>
<div class="umb-editor-sub-view__content" ng-include="subView.view"></div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
* @description
* The controller for the info view of the datatype editor
*/
function DataTypeInfoController($scope, $routeParams, dataTypeResource, eventsService, $timeout, editorService) {
function DataTypeInfoController($scope, $routeParams, dataTypeResource, $timeout, editorService) {

var vm = this;
var evts = [];
var referencesLoaded = false;

vm.references = {};
Expand Down Expand Up @@ -48,7 +47,7 @@ function DataTypeInfoController($scope, $routeParams, dataTypeResource, eventsSe

function open(id, event, type) {
// targeting a new tab/window?
if (event.ctrlKey ||
if (event.ctrlKey ||
event.shiftKey ||
event.metaKey || // apple
(event.button && event.button === 1) // middle click, >IE9 + everyone else
Expand Down Expand Up @@ -85,25 +84,7 @@ function DataTypeInfoController($scope, $routeParams, dataTypeResource, eventsSe
}
}

// load data type references when the references tab is activated
evts.push(eventsService.on("app.tabChange", function (event, args) {
$timeout(function () {
if (args.alias === "info") {
loadRelations();
}
});
}));

//ensure to unregister from all events!
$scope.$on('$destroy', function () {
for (var e in evts) {
eventsService.unsubscribe(evts[e]);
}
});




loadRelations();
}

angular.module("umbraco").controller("Umbraco.Editors.DataType.InfoController", DataTypeInfoController);
Loading