diff --git a/src/JsonSchema/AppSettings.cs b/src/JsonSchema/AppSettings.cs index f9c7c224beee..6f53541df418 100644 --- a/src/JsonSchema/AppSettings.cs +++ b/src/JsonSchema/AppSettings.cs @@ -75,5 +75,7 @@ public class CmsDefinition public DataTypesSettings? DataTypes { get; set; } public LicensesSettings? Licenses { get; set; } + + public MarketplaceSettings? Marketplace { get; set; } } } diff --git a/src/Umbraco.Core/Configuration/Models/ActiveDirectorySettings.cs b/src/Umbraco.Core/Configuration/Models/ActiveDirectorySettings.cs index 3373b7a7786a..3a3f90de898e 100644 --- a/src/Umbraco.Core/Configuration/Models/ActiveDirectorySettings.cs +++ b/src/Umbraco.Core/Configuration/Models/ActiveDirectorySettings.cs @@ -7,7 +7,8 @@ namespace Umbraco.Cms.Core.Configuration.Models; /// Typed configuration options for active directory settings. /// [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 { /// /// Gets or sets a value for the Active Directory domain. diff --git a/src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs b/src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs new file mode 100644 index 000000000000..73f7da185fcf --- /dev/null +++ b/src/Umbraco.Core/Configuration/Models/MarketplaceSettings.cs @@ -0,0 +1,16 @@ +// Copyright (c) Umbraco. +// See LICENSE for more details. + +namespace Umbraco.Cms.Core.Configuration.Models; + +/// +/// Configuration options for the Marketplace. +/// +[UmbracoOptions(Constants.Configuration.ConfigMarketplace)] +public class MarketplaceSettings +{ + /// + /// Gets or sets the additional parameters that are sent to the Marketplace. + /// + public Dictionary AdditionalParameters { get; set; } = new (); +} diff --git a/src/Umbraco.Core/Constants-Configuration.cs b/src/Umbraco.Core/Constants-Configuration.cs index bc4c29cfa6af..656bcd1cdfb0 100644 --- a/src/Umbraco.Core/Constants-Configuration.cs +++ b/src/Umbraco.Core/Constants-Configuration.cs @@ -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"; diff --git a/src/Umbraco.Core/Constants-Marketplace.cs b/src/Umbraco.Core/Constants-Marketplace.cs new file mode 100644 index 000000000000..6d5abb38e7b2 --- /dev/null +++ b/src/Umbraco.Core/Constants-Marketplace.cs @@ -0,0 +1,12 @@ +namespace Umbraco.Cms.Core; + +public static partial class Constants +{ + /// + /// Defines the constants used for the Umbraco Marketplace. + /// + public static class Marketplace + { + public const string Url = "https://dev.marketplace.umbraco.com"; + } +} diff --git a/src/Umbraco.Core/Constants-PackageRepository.cs b/src/Umbraco.Core/Constants-PackageRepository.cs index 96746adb4940..ef2e6fdd4848 100644 --- a/src/Umbraco.Core/Constants-PackageRepository.cs +++ b/src/Umbraco.Core/Constants-PackageRepository.cs @@ -5,6 +5,7 @@ public static partial class Constants /// /// Defines the constants used for the Umbraco package repository /// + [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"; diff --git a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs index 28fc05907e0f..92e10c7b1c8d 100644 --- a/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs +++ b/src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Configuration.cs @@ -50,6 +50,7 @@ public static IUmbracoBuilder AddConfiguration(this IUmbracoBuilder builder) builder .AddUmbracoOptions() .AddUmbracoOptions() + .AddUmbracoOptions() .AddUmbracoOptions() .AddUmbracoOptions() .AddUmbracoOptions() diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/da.xml b/src/Umbraco.Core/EmbeddedResources/Lang/da.xml index 1c23c53e3858..32317e57d0c8 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/da.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/da.xml @@ -1263,6 +1263,7 @@ Mange hilsner fra Umbraco robotten Mediearkiv Medlemmer Pakker + Marketplace Nyhedsbreve Indstillinger Statistik diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 7bb861fb3d66..3b58b2eb42cf 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -1477,6 +1477,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Members Newsletters Packages + Marketplace Settings Statistics Translation diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index 7e1aa9525ace..181d9d1f3885 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -1515,6 +1515,7 @@ To manage your website, simply open the Umbraco backoffice and start adding cont Media Members Packages + Marketplace Settings Translation Users diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs index 9a782c173f82..6d44fcd15f60 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs @@ -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 @@ public class BackOfficeServerVariables private MemberPasswordConfigurationSettings _memberPasswordConfigurationSettings; private DataTypesSettings _dataTypesSettings; private readonly ITempDataDictionaryFactory _tempDataDictionaryFactory; + private MarketplaceSettings _marketplaceSettings; [Obsolete("Use constructor that takes IOptionsMontior, scheduled for removal in V12")] public BackOfficeServerVariables( @@ -139,6 +141,7 @@ public BackOfficeServerVariables( { } + [Obsolete("Use constructor that takes IOptionsMonitor, scheduled for removal in V13")] public BackOfficeServerVariables( LinkGenerator linkGenerator, IRuntimeState runtimeState, @@ -159,6 +162,52 @@ public BackOfficeServerVariables( IOptionsMonitor memberPasswordConfigurationSettings, IOptionsMonitor 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>() + ) + { + } + + public BackOfficeServerVariables( + LinkGenerator linkGenerator, + IRuntimeState runtimeState, + UmbracoFeatures features, + IOptionsMonitor globalSettings, + IUmbracoVersion umbracoVersion, + IOptionsMonitor contentSettings, + IHttpContextAccessor httpContextAccessor, + TreeCollection treeCollection, + IHostingEnvironment hostingEnvironment, + IOptionsMonitor runtimeSettings, + IOptionsMonitor securitySettings, + IRuntimeMinifier runtimeMinifier, + IBackOfficeExternalLoginProviders externalLogins, + IImageUrlGenerator imageUrlGenerator, + PreviewRoutes previewRoutes, + IEmailSender emailSender, + IOptionsMonitor memberPasswordConfigurationSettings, + IOptionsMonitor dataTypesSettings, + ITempDataDictionaryFactory tempDataDictionaryFactory, + IOptionsMonitor marketplaceSettings) { _linkGenerator = linkGenerator; _runtimeState = runtimeState; @@ -179,6 +228,7 @@ public BackOfficeServerVariables( _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 @@ public BackOfficeServerVariables( securitySettings.OnChange(x => _securitySettings = x); dataTypesSettings.OnChange(x => _dataTypesSettings = x); memberPasswordConfigurationSettings.OnChange(x => _memberPasswordConfigurationSettings = x); + marketplaceSettings.OnChange(x => _marketplaceSettings = x); } /// @@ -298,6 +349,7 @@ internal async Task> 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 @@ -625,6 +677,25 @@ internal async Task> 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 { diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js index 430f05c2c42b..60ceebb20740 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js @@ -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; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index 589a3bfe915f..14cfa5f00791 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -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; diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-container.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-container.html index aa1765f365fc..2def207c7035 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-container.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-container.html @@ -6,6 +6,6 @@
-
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-sub-views.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-sub-views.html index a0f56ee8830a..56c7a9cf4805 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-sub-views.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-sub-views.html @@ -1,17 +1,12 @@
- -
- -
-
- -
- +
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/overview.controller.js index f5fd3bfd9caa..d0de742205ba 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packages/overview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packages/overview.controller.js @@ -1,99 +1,99 @@ (function () { - "use strict"; + "use strict"; - function PackagesOverviewController($scope, $location, $routeParams, localizationService, localStorageService) { + function PackagesOverviewController($location, $routeParams, localizationService, localStorageService) { - //Hack! - // if there is a local storage value for packageInstallData then we need to redirect there, - // the issue is that we still have webforms and we cannot go to a hash location and then window.reload - // because it will double load it. - // we will refresh and then navigate there. + //Hack! + // if there is a local storage value for packageInstallData then we need to redirect there, + // the issue is that we still have webforms and we cannot go to a hash location and then window.reload + // because it will double load it. + // we will refresh and then navigate there. - let packageInstallData = localStorageService.get("packageInstallData"); - let packageUri = $routeParams.method; + let packageInstallData = localStorageService.get("packageInstallData"); + let packageUri = $routeParams.method; - if (packageInstallData) { - localStorageService.remove("packageInstallData"); + if (packageInstallData) { + localStorageService.remove("packageInstallData"); - if (packageInstallData.postInstallationPath) { - //navigate to the custom installer screen if set - $location.path(packageInstallData.postInstallationPath).search("packageId", packageInstallData.id); - return; - } + if (packageInstallData.postInstallationPath) { + //navigate to the custom installer screen if set + $location.path(packageInstallData.postInstallationPath).search("packageId", packageInstallData.id); + return; + } + + //if it is "installed" then set the uri/path to that + if (packageInstallData === "installed") { + packageUri = "installed"; + } + } + + var vm = this; + vm.page = {}; + vm.page.labels = {}; + vm.page.name = ""; + vm.page.navigation = []; + + onInit(); + + function onInit() { + + loadNavigation(); - //if it is "installed" then set the uri/path to that - if (packageInstallData === "installed") { - packageUri = "installed"; + setPageName(); + } + + function loadNavigation() { + + var labels = ["sections_marketplace", "packager_installed", "packager_installLocal", "packager_created"]; + + localizationService.localizeMany(labels).then(function (data) { + vm.page.labels.marketplace = data[0]; + vm.page.labels.installed = data[1]; + vm.page.labels.install = data[2]; + vm.page.labels.created = data[3]; + + vm.page.navigation = [ + { + "name": vm.page.labels.marketplace, + "icon": "icon-cloud", + "view": "views/packages/views/marketplace.html", + "active": !packageUri || packageUri === "repo", + "alias": "umbMarketplace", + "action": function () { + $location.path("/packages/packages/repo"); + } + }, + { + "name": vm.page.labels.installed, + "icon": "icon-box", + "view": "views/packages/views/installed.html", + "active": packageUri === "installed", + "alias": "umbInstalled", + "action": function () { + $location.path("/packages/packages/installed"); } - } - - var vm = this; - vm.page = {}; - vm.page.labels = {}; - vm.page.name = ""; - vm.page.navigation = []; - - onInit(); - - function onInit() { - - loadNavigation(); - - setPageName(); - } - - function loadNavigation() { - - var labels = ["sections_packages", "packager_installed", "packager_installLocal", "packager_created"]; - - localizationService.localizeMany(labels).then(function (data) { - vm.page.labels.packages = data[0]; - vm.page.labels.installed = data[1]; - vm.page.labels.install = data[2]; - vm.page.labels.created = data[3]; - - vm.page.navigation = [ - { - "name": vm.page.labels.packages, - "icon": "icon-cloud", - "view": "views/packages/views/repo.html", - "active": !packageUri || packageUri === "repo", - "alias": "umbPackages", - "action": function () { - $location.path("/packages/packages/repo"); - } - }, - { - "name": vm.page.labels.installed, - "icon": "icon-box", - "view": "views/packages/views/installed.html", - "active": packageUri === "installed", - "alias": "umbInstalled", - "action": function () { - $location.path("/packages/packages/installed"); - } - }, - { - "name": vm.page.labels.created, - "icon": "icon-files", - "view": "views/packages/views/created.html", - "active": packageUri === "created", - "alias": "umbCreatedPackages", - "action": function () { - $location.path("/packages/packages/created"); - } - } - ]; - }); - } - - function setPageName() { - localizationService.localize("sections_packages").then(function (data) { - vm.page.name = data; - }) - } + }, + { + "name": vm.page.labels.created, + "icon": "icon-files", + "view": "views/packages/views/created.html", + "active": packageUri === "created", + "alias": "umbCreatedPackages", + "action": function () { + $location.path("/packages/packages/created"); + } + } + ]; + }); + } + + function setPageName() { + localizationService.localize("sections_marketplace").then(function (data) { + vm.page.name = data; + }) } + } - angular.module("umbraco").controller("Umbraco.Editors.Packages.OverviewController", PackagesOverviewController); + angular.module("umbraco").controller("Umbraco.Editors.Packages.OverviewController", PackagesOverviewController); })(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/views/marketplace.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/views/marketplace.controller.js new file mode 100644 index 000000000000..f2a4deb2c156 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packages/views/marketplace.controller.js @@ -0,0 +1,18 @@ +(function () { + "use strict"; + + function MarketplaceController($sce) { + + var vm = this; + var marketplaceUrl = new URL(Umbraco.Sys.ServerVariables.umbracoUrls.marketplaceUrl); + + function init() { + vm.marketplaceUrl = $sce.trustAsResourceUrl(marketplaceUrl.toString()); + } + + init(); + } + + angular.module("umbraco").controller("Umbraco.Editors.Packages.MarketplaceController", MarketplaceController); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/views/marketplace.html b/src/Umbraco.Web.UI.Client/src/views/packages/views/marketplace.html new file mode 100644 index 000000000000..95a28061b4da --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packages/views/marketplace.html @@ -0,0 +1,13 @@ +
+ +
diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js deleted file mode 100644 index 0c7a2bd91c07..000000000000 --- a/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js +++ /dev/null @@ -1,265 +0,0 @@ -(function () { - "use strict"; - - function PackagesRepoController($scope, $timeout, ourPackageRepositoryResource, $q, localizationService, notificationsService) { - - var vm = this; - - vm.packageViewState = "packageList"; - vm.categories = []; - vm.loading = true; - vm.pagination = { - pageNumber: 1, - totalPages: 10, - pageSize: 24 - }; - vm.searchQuery = ""; - vm.selectCategory = selectCategory; - vm.showPackageDetails = showPackageDetails; - vm.setPackageViewState = setPackageViewState; - vm.nextPage = nextPage; - vm.prevPage = prevPage; - vm.goToPage = goToPage; - vm.openLightbox = openLightbox; - vm.closeLightbox = closeLightbox; - vm.search = search; - vm.installCompleted = false; - vm.highlightedPackageCollections = []; - vm.labels = {}; - - var defaultSort = "Latest"; - var currSort = defaultSort; - - //used to cancel any request in progress if another one needs to take it's place - var canceler = null; - - function getActiveCategory() { - if (vm.searchQuery !== "") { - return ""; - } - for (var i = 0; i < vm.categories.length; i++) { - if (vm.categories[i].active === true) { - return vm.categories[i].name; - } - } - return ""; - } - - function init() { - - vm.loading = true; - localizationService.localizeMany(["packager_packagesPopular", "packager_packagesPromoted"]) - .then(function (labels) { - vm.labels.popularPackages = labels[0]; - vm.labels.promotedPackages = labels[1]; - - var popularPackages, promotedPackages; - $q.all([ - ourPackageRepositoryResource.getCategories() - .then(function (cats) { - vm.categories = cats.filter(function (cat) { - return cat.name !== "Umbraco Pro"; - }); - }), - ourPackageRepositoryResource.getPopular(10) - .then(function (pack) { - popularPackages = { title: vm.labels.popularPackages, packages: pack.packages }; - }), - ourPackageRepositoryResource.getPromoted(20) - .then(function (pack) { - promotedPackages = { title: vm.labels.promotedPackages, packages: pack.packages }; - }), - ourPackageRepositoryResource.search(vm.pagination.pageNumber - 1, vm.pagination.pageSize, currSort) - .then(function (pack) { - vm.packages = pack.packages; - vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); - }) - ]) - .then(function () { - vm.highlightedPackageCollections = [popularPackages, promotedPackages]; - vm.loading = false; - }); - }); - } - - function selectCategory(selectedCategory, categories) { - - for (var i = 0; i < categories.length; i++) { - var category = categories[i]; - if (category.name === selectedCategory.name) { - //it's already selected, let's unselect to show all again - if (category.active === true) { - category.active = false; - } - else { - category.active = true; - } - } - else { - category.active = false; - } - } - - vm.loading = true; - vm.searchQuery = ""; - - var reset = selectedCategory.active === false; - var searchCategory = reset ? "" : selectedCategory.name; - - currSort = defaultSort; - - var popularPackages, promotedPackages; - $q.all([ - ourPackageRepositoryResource.getPopular(10, searchCategory) - .then(function (pack) { - popularPackages = { title: vm.labels.popularPackages, packages: pack.packages }; - }), - ourPackageRepositoryResource.getPromoted(20, searchCategory) - .then(function (pack) { - promotedPackages = { title: vm.labels.promotedPackages, packages: pack.packages }; - }), - ourPackageRepositoryResource.search(vm.pagination.pageNumber - 1, vm.pagination.pageSize, currSort, searchCategory, vm.searchQuery) - .then(function (pack) { - vm.packages = pack.packages; - vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); - vm.pagination.pageNumber = 1; - }) - ]) - .then(function () { - vm.highlightedPackageCollections = [popularPackages, promotedPackages]; - vm.loading = false; - }); - } - - function showPackageDetails(selectedPackage) { - ourPackageRepositoryResource.getDetails(selectedPackage.id) - .then(function (pack) { - vm.package = pack; - vm.packageViewState = "packageDetails"; - }); - } - - function setPackageViewState(state) { - if (state) { - vm.packageViewState = state; - } - } - - function nextPage(pageNumber) { - ourPackageRepositoryResource.search(pageNumber - 1, vm.pagination.pageSize, currSort, getActiveCategory(), vm.searchQuery) - .then(function (pack) { - vm.packages = pack.packages; - vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); - }); - } - - function prevPage(pageNumber) { - ourPackageRepositoryResource.search(pageNumber - 1, vm.pagination.pageSize, currSort, getActiveCategory(), vm.searchQuery) - .then(function (pack) { - vm.packages = pack.packages; - vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); - }); - } - - function goToPage(pageNumber) { - ourPackageRepositoryResource.search(pageNumber - 1, vm.pagination.pageSize, currSort, getActiveCategory(), vm.searchQuery) - .then(function (pack) { - vm.packages = pack.packages; - vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); - }); - } - var previousElement = null; - - function openLightbox(itemIndex, items) { - - previousElement = ( document.activeElement || document.body ); - - vm.lightbox = { - show: true, - items: items, - activeIndex: itemIndex, - focus: true - }; - } - - function closeLightbox() { - vm.lightbox.show = false; - vm.lightbox = null; - - if(previousElement){ - setTimeout(function(){ - previousElement.focus(); - previousElement = null; - }, 100) - } - document.activeElement.blur(); - } - - - var searchDebounced = _.debounce(function (e) { - //a canceler exists, so perform the cancelation operation and reset - if (canceler) { - canceler.resolve(); - } - - canceler = $q.defer(); - - $scope.$apply(function () { - currSort = vm.searchQuery ? "Default" : "Latest"; - - ourPackageRepositoryResource.search(vm.pagination.pageNumber - 1, - vm.pagination.pageSize, - currSort, - "", - vm.searchQuery, - canceler.promise) - .then(function (pack) { - vm.packages = pack.packages; - vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); - vm.pagination.pageNumber = 1; - vm.loading = false; - //set back to null so it can be re-created - canceler = null; - }) - .catch(function (err) { - canceler = null; - - if (err) { - // If an abort happened, ignore it since it happened because of a new search - if (err.xhrStatus === 'abort') { - return; - } - - // Otherwise, show the error - if (err.errorMsg) { - notificationsService.error(err.errorMsg); - return; - } - } - - console.error(err); - }); - - }); - - }, 200); - - function search(searchQuery) { - vm.loading = true; - searchDebounced(); - } - - vm.reloadPage = function () { - //reload on next digest (after cookie) - $timeout(function () { - window.location.reload(true); - }); - } - - init(); - - } - - angular.module("umbraco").controller("Umbraco.Editors.Packages.RepoController", PackagesRepoController); - -})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html deleted file mode 100644 index 1c3e3ec5d82c..000000000000 --- a/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html +++ /dev/null @@ -1,318 +0,0 @@ -
- - - - -
- -
- -
- -
-
- -
-
- -
- -
-
-

{{highlightedPackageCollection.title}}

-
- -
- -
- -
-
-
- -
- -

New Releases

-

Results for '{{ vm.searchQuery }}'

- -
- -
- -
- -
-
- -
- - - - -
- - - -

We couldn't find anything for '{{ vm.searchQuery }}'

-

Please try searching for another package or browse through the categories.

-
- - -

Sorry, we can not find what you are looking for.

-

Please try searching for another package or browse through the categories.

-
- -
- -
- - - -
- - - - - - - -
- -
- -
- - - -
{{ vm.package.name }}
-
- -
-
- - - - -
- -
- - - -
Install Instructions
-
- dotnet add package {{vm.package.nuGetPackageId}} -
-
-
- - - -
- -
- - -
- -
-
{{ vm.package.ownerInfo.owner }}
-
- {{ vm.package.ownerInfo.owner }} has {{ vm.package.ownerInfo.karma }} karma points -
-
-
-
-
- - - -
Information
-
- -
-
Owner:
-
{{vm.package.ownerInfo.owner}}
-
- -
-
Contributors:
-
- {{ contributor }} -
-
- -
-
Created:
-
{{vm.package.created | date:'yyyy-MM-dd HH:mm:ss'}}
-
- -
-
Current version:
-
{{vm.package.latestVersion}}
-
- -
-
.NET Version:
-
{{vm.package.information.netVersion}}
-
- -
-
License:
-
{{vm.package.licenseName}}
-
- -
-
Downloads:
-
{{vm.package.downloads}}
-
- -
-
Likes:
-
{{vm.package.likes}}
-
- -
-
Verified to work on Umbraco CLoud
-
- -
-
-
- - - -
Compatibility
-
This package is compatible with the following versions of Umbraco, as reported by community members. Full compatability cannot be guaranteed for versions reported below 100%
-
-
- {{compatibility.version}} - ({{compatibility.percentage}}%) -
- - -
-
-
- - - -
External sources
- -
-
- -
- -
-
-
- -