v11: Umbraco Marketplace replaces packages repo (#13371)
* add lang keys for marketplace * remove old 'repo' page and deprecate related services * add new view for Umbraco Marketplace * optimise margin/padding for other tabs * mark Our Repository constants as obsolete * improve css path to iframe slightly with more aliases and classnames * remove style qs * update URL of Marketplace * add ng-controller with utitlities for future PostMessage API * rename marketplace loaded function * remove iframe postmessage logic for time being * add handling of dynamic querystring params * assume url does not change * Added support for additional parameters for marketplace * Update src/JsonSchema/AppSettings.cs Fix styling issue Co-authored-by: Ronald Barendse <ronald@barend.se> * Update src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs Fix styling issue Co-authored-by: Ronald Barendse <ronald@barend.se> * Update src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs Make comment more descriptive Co-authored-by: Ronald Barendse <ronald@barend.se> * Update src/Umbraco.Core/Constants-Marketplace.cs Fix styling issue Co-authored-by: Ronald Barendse <ronald@barend.se> Co-authored-by: Bjarke Berg <mail@bergmania.dk> Co-authored-by: Ronald Barendse <ronald@barend.se>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
@@ -54,6 +55,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
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(
|
||||
@@ -139,6 +141,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
{
|
||||
}
|
||||
|
||||
[Obsolete("Use constructor that takes IOptionsMonitor<MarketplaceSettings>, scheduled for removal in V13")]
|
||||
public BackOfficeServerVariables(
|
||||
LinkGenerator linkGenerator,
|
||||
IRuntimeState runtimeState,
|
||||
@@ -159,6 +162,52 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
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;
|
||||
@@ -179,6 +228,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
_tempDataDictionaryFactory = tempDataDictionaryFactory;
|
||||
_memberPasswordConfigurationSettings = memberPasswordConfigurationSettings.CurrentValue;
|
||||
_dataTypesSettings = dataTypesSettings.CurrentValue;
|
||||
_marketplaceSettings = marketplaceSettings.CurrentValue;
|
||||
|
||||
globalSettings.OnChange(x => _globalSettings = x);
|
||||
contentSettings.OnChange(x => _contentSettings = x);
|
||||
@@ -186,6 +236,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
securitySettings.OnChange(x => _securitySettings = x);
|
||||
dataTypesSettings.OnChange(x => _dataTypesSettings = x);
|
||||
memberPasswordConfigurationSettings.OnChange(x => _memberPasswordConfigurationSettings = x);
|
||||
marketplaceSettings.OnChange(x => _marketplaceSettings = x);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -298,6 +349,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
{"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
|
||||
@@ -625,6 +677,25 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
|
||||
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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user