From 32788a0a42ae78f81a22be217b20ca6afba7517b Mon Sep 17 00:00:00 2001 From: nzdev <834725+nzdev@users.noreply.github.com> Date: Mon, 16 Nov 2020 17:15:34 +1300 Subject: [PATCH 01/14] reduce array allocations --- src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs index d80affbfa9..ac5719c015 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedContent.cs @@ -33,15 +33,16 @@ namespace Umbraco.Web.PublishedCache.NuCache _urlSegment = ContentData.UrlSegment; IsPreviewing = ContentData.Published == false; - var properties = new List(); + var properties = new IPublishedProperty[_contentNode.ContentType.PropertyTypes.Count()]; + int i =0; foreach (var propertyType in _contentNode.ContentType.PropertyTypes) { // add one property per property type - this is required, for the indexing to work // if contentData supplies pdatas, use them, else use null contentData.Properties.TryGetValue(propertyType.Alias, out var pdatas); // else will be null - properties.Add(new Property(propertyType, this, pdatas, _publishedSnapshotAccessor)); + properties[i++] =new Property(propertyType, this, pdatas, _publishedSnapshotAccessor); } - PropertiesArray = properties.ToArray(); + PropertiesArray = properties; } private string GetProfileNameById(int id) From 39c4dcdaaa4d18acc4fd0134e69c48af17dbb535 Mon Sep 17 00:00:00 2001 From: Steve <6131869+SteveVaneeckhout@users.noreply.github.com> Date: Mon, 23 Nov 2020 10:40:18 +0100 Subject: [PATCH 02/14] Track ng-repeat with id instead of label (#9340) --- .../src/views/components/content/umb-tabbed-content.html | 2 +- .../elementeditor/umb-element-editor-content.component.html | 2 +- .../src/views/components/member/umb-member-node-info.html | 2 +- .../src/views/media/apps/content/content.html | 2 +- .../src/views/member/apps/content/content.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html index d534cd77ed..022c140a2f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-tabbed-content.html @@ -1,6 +1,6 @@ 
-
+
{{ group.label }}
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/elementeditor/umb-element-editor-content.component.html b/src/Umbraco.Web.UI.Client/src/views/components/elementeditor/umb-element-editor-content.component.html index fae639562f..ecbe880eee 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/elementeditor/umb-element-editor-content.component.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/elementeditor/umb-element-editor-content.component.html @@ -2,7 +2,7 @@
+ ng-repeat="group in vm.model.variants[0].tabs track by group.id">
{{ group.label }}
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/member/umb-member-node-info.html b/src/Umbraco.Web.UI.Client/src/views/components/member/umb-member-node-info.html index 0dceeb4c26..5162caf13c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/member/umb-member-node-info.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/member/umb-member-node-info.html @@ -1,7 +1,7 @@
- +
{{ group.label }}
diff --git a/src/Umbraco.Web.UI.Client/src/views/media/apps/content/content.html b/src/Umbraco.Web.UI.Client/src/views/media/apps/content/content.html index 633eccdf62..816ca987f7 100644 --- a/src/Umbraco.Web.UI.Client/src/views/media/apps/content/content.html +++ b/src/Umbraco.Web.UI.Client/src/views/media/apps/content/content.html @@ -1,5 +1,5 @@
-
+
{{ group.label }}
diff --git a/src/Umbraco.Web.UI.Client/src/views/member/apps/content/content.html b/src/Umbraco.Web.UI.Client/src/views/member/apps/content/content.html index 1256c2d234..29051cd855 100644 --- a/src/Umbraco.Web.UI.Client/src/views/member/apps/content/content.html +++ b/src/Umbraco.Web.UI.Client/src/views/member/apps/content/content.html @@ -1,6 +1,6 @@
-
+
{{ group.label }}
From b7d37f2279c607739ca08a90433c1240a012cea9 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Fri, 2 Oct 2020 09:02:30 +0200 Subject: [PATCH 03/14] Replace obsolete usages with injected services in UmbracoHelper --- src/Umbraco.Web/UmbracoHelper.cs | 92 ++++++++++++++++---------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index 6a2fba1152..d73f98b6b5 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -141,7 +141,7 @@ namespace Umbraco.Web /// public IHtmlString RenderTemplate(int contentId, int? altTemplateId = null) { - return ComponentRenderer.RenderTemplate(contentId, altTemplateId); + return _componentRenderer.RenderTemplate(contentId, altTemplateId); } #region RenderMacro @@ -153,7 +153,7 @@ namespace Umbraco.Web /// public IHtmlString RenderMacro(string alias) { - return ComponentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, null); + return _componentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, null); } /// @@ -164,7 +164,7 @@ namespace Umbraco.Web /// public IHtmlString RenderMacro(string alias, object parameters) { - return ComponentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, parameters?.ToDictionary()); + return _componentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, parameters?.ToDictionary()); } /// @@ -175,7 +175,7 @@ namespace Umbraco.Web /// public IHtmlString RenderMacro(string alias, IDictionary parameters) { - return ComponentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, parameters); + return _componentRenderer.RenderMacro(AssignedContentItem?.Id ?? 0, alias, parameters); } #endregion @@ -212,7 +212,7 @@ namespace Umbraco.Web /// Returns the ICultureDictionary for access to dictionary items /// public ICultureDictionary CultureDictionary => _cultureDictionary - ?? (_cultureDictionary = CultureDictionaryFactory.CreateDictionary()); + ?? (_cultureDictionary = _cultureDictionaryFactory.CreateDictionary()); #endregion @@ -225,7 +225,7 @@ namespace Umbraco.Web /// True if the current user has access or if the current document isn't protected public bool MemberHasAccess(string path) { - return MembershipHelper.MemberHasAccess(path); + return _membershipHelper.MemberHasAccess(path); } /// @@ -234,7 +234,7 @@ namespace Umbraco.Web /// True is the current user is logged in public bool MemberIsLoggedOn() { - return MembershipHelper.IsLoggedIn(); + return _membershipHelper.IsLoggedIn(); } #endregion @@ -275,7 +275,7 @@ namespace Umbraco.Web public IPublishedContent Member(Guid id) { - return MembershipHelper.GetById(id); + return _membershipHelper.GetById(id); } public IPublishedContent Member(object id) @@ -291,18 +291,18 @@ namespace Umbraco.Web public IPublishedContent Member(int id) { - return MembershipHelper.GetById(id); + return _membershipHelper.GetById(id); } public IPublishedContent Member(string id) { var asInt = id.TryConvertTo(); - return asInt ? MembershipHelper.GetById(asInt.Result) : MembershipHelper.GetByProviderKey(id); + return asInt ? _membershipHelper.GetById(asInt.Result) : _membershipHelper.GetByProviderKey(id); } public IEnumerable Members(IEnumerable ids) { - return MembershipHelper.GetByIds(ids); + return _membershipHelper.GetByIds(ids); } public IEnumerable Members(IEnumerable ids) @@ -312,7 +312,7 @@ namespace Umbraco.Web public IEnumerable Members(IEnumerable ids) { - return MembershipHelper.GetByIds(ids); + return _membershipHelper.GetByIds(ids); } public IEnumerable Members(IEnumerable ids) @@ -337,7 +337,7 @@ namespace Umbraco.Web public IEnumerable Members(params Guid[] ids) { - return MembershipHelper.GetByIds(ids); + return _membershipHelper.GetByIds(ids); } public IEnumerable Members(params Udi[] ids) @@ -367,11 +367,11 @@ namespace Umbraco.Web private IPublishedContent ContentForObject(object id) { if (ConvertIdObjectToInt(id, out var intId)) - return ContentQuery.Content(intId); + return _publishedContentQuery.Content(intId); if (ConvertIdObjectToGuid(id, out var guidId)) - return ContentQuery.Content(guidId); + return _publishedContentQuery.Content(guidId); if (ConvertIdObjectToUdi(id, out var udiId)) - return ContentQuery.Content(udiId); + return _publishedContentQuery.Content(udiId); return null; } @@ -382,7 +382,7 @@ namespace Umbraco.Web /// The content, or null of the content item is not in the cache. public IPublishedContent Content(int id) { - return ContentQuery.Content(id); + return _publishedContentQuery.Content(id); } /// @@ -392,7 +392,7 @@ namespace Umbraco.Web /// The content, or null of the content item is not in the cache. public IPublishedContent Content(Guid id) { - return ContentQuery.Content(id); + return _publishedContentQuery.Content(id); } /// @@ -407,12 +407,12 @@ namespace Umbraco.Web public IPublishedContent Content(Udi id) { - return ContentQuery.Content(id); + return _publishedContentQuery.Content(id); } public IPublishedContent ContentSingleAtXPath(string xpath, params XPathVariable[] vars) { - return ContentQuery.ContentSingleAtXPath(xpath, vars); + return _publishedContentQuery.ContentSingleAtXPath(xpath, vars); } /// @@ -434,7 +434,7 @@ namespace Umbraco.Web /// If an identifier does not match an existing content, it will be missing in the returned value. public IEnumerable Content(params Udi[] ids) { - return ids.Select(id => ContentQuery.Content(id)).WhereNotNull(); + return ids.Select(id => _publishedContentQuery.Content(id)).WhereNotNull(); } /// @@ -445,16 +445,16 @@ namespace Umbraco.Web /// If an identifier does not match an existing content, it will be missing in the returned value. public IEnumerable Content(params GuidUdi[] ids) { - return ids.Select(id => ContentQuery.Content(id)); + return ids.Select(id => _publishedContentQuery.Content(id)); } private IEnumerable ContentForObjects(IEnumerable ids) { var idsA = ids.ToArray(); if (ConvertIdsObjectToInts(idsA, out var intIds)) - return ContentQuery.Content(intIds); + return _publishedContentQuery.Content(intIds); if (ConvertIdsObjectToGuids(idsA, out var guidIds)) - return ContentQuery.Content(guidIds); + return _publishedContentQuery.Content(guidIds); return Enumerable.Empty(); } @@ -465,7 +465,7 @@ namespace Umbraco.Web /// The content items that were found in the cache. public IEnumerable Content(params int[] ids) { - return ContentQuery.Content(ids); + return _publishedContentQuery.Content(ids); } /// @@ -475,7 +475,7 @@ namespace Umbraco.Web /// The content items that were found in the cache. public IEnumerable Content(params Guid[] ids) { - return ContentQuery.Content(ids); + return _publishedContentQuery.Content(ids); } /// @@ -507,7 +507,7 @@ namespace Umbraco.Web /// If an identifier does not match an existing content, it will be missing in the returned value. public IEnumerable Content(IEnumerable ids) { - return ids.Select(id => ContentQuery.Content(id)).WhereNotNull(); + return ids.Select(id => _publishedContentQuery.Content(id)).WhereNotNull(); } /// @@ -518,7 +518,7 @@ namespace Umbraco.Web /// If an identifier does not match an existing content, it will be missing in the returned value. public IEnumerable Content(IEnumerable ids) { - return ids.Select(id => ContentQuery.Content(id)); + return ids.Select(id => _publishedContentQuery.Content(id)); } /// @@ -540,22 +540,22 @@ namespace Umbraco.Web /// If an identifier does not match an existing content, it will be missing in the returned value. public IEnumerable Content(IEnumerable ids) { - return ContentQuery.Content(ids); + return _publishedContentQuery.Content(ids); } public IEnumerable ContentAtXPath(string xpath, params XPathVariable[] vars) { - return ContentQuery.ContentAtXPath(xpath, vars); + return _publishedContentQuery.ContentAtXPath(xpath, vars); } public IEnumerable ContentAtXPath(XPathExpression xpath, params XPathVariable[] vars) { - return ContentQuery.ContentAtXPath(xpath, vars); + return _publishedContentQuery.ContentAtXPath(xpath, vars); } public IEnumerable ContentAtRoot() { - return ContentQuery.ContentAtRoot(); + return _publishedContentQuery.ContentAtRoot(); } internal static bool ConvertIdObjectToInt(object id, out int intId) @@ -654,7 +654,7 @@ namespace Umbraco.Web public IPublishedContent Media(Guid id) { - return ContentQuery.Media(id); + return _publishedContentQuery.Media(id); } /// @@ -675,17 +675,17 @@ namespace Umbraco.Web private IPublishedContent MediaForObject(object id) { if (ConvertIdObjectToInt(id, out var intId)) - return ContentQuery.Media(intId); + return _publishedContentQuery.Media(intId); if (ConvertIdObjectToGuid(id, out var guidId)) - return ContentQuery.Media(guidId); + return _publishedContentQuery.Media(guidId); if (ConvertIdObjectToUdi(id, out var udiId)) - return ContentQuery.Media(udiId); + return _publishedContentQuery.Media(udiId); return null; } public IPublishedContent Media(int id) { - return ContentQuery.Media(id); + return _publishedContentQuery.Media(id); } public IPublishedContent Media(string id) @@ -708,9 +708,9 @@ namespace Umbraco.Web { var idsA = ids.ToArray(); if (ConvertIdsObjectToInts(idsA, out var intIds)) - return ContentQuery.Media(intIds); + return _publishedContentQuery.Media(intIds); if (ConvertIdsObjectToGuids(idsA, out var guidIds)) - return ContentQuery.Media(guidIds); + return _publishedContentQuery.Media(guidIds); return Enumerable.Empty(); } @@ -722,7 +722,7 @@ namespace Umbraco.Web /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(params int[] ids) { - return ContentQuery.Media(ids); + return _publishedContentQuery.Media(ids); } /// @@ -745,7 +745,7 @@ namespace Umbraco.Web /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(params Udi[] ids) { - return ids.Select(id => ContentQuery.Media(id)).WhereNotNull(); + return ids.Select(id => _publishedContentQuery.Media(id)).WhereNotNull(); } /// @@ -756,7 +756,7 @@ namespace Umbraco.Web /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(params GuidUdi[] ids) { - return ids.Select(id => ContentQuery.Media(id)); + return ids.Select(id => _publishedContentQuery.Media(id)); } /// @@ -778,7 +778,7 @@ namespace Umbraco.Web /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(IEnumerable ids) { - return ContentQuery.Media(ids); + return _publishedContentQuery.Media(ids); } /// @@ -789,7 +789,7 @@ namespace Umbraco.Web /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(IEnumerable ids) { - return ids.Select(id => ContentQuery.Media(id)).WhereNotNull(); + return ids.Select(id => _publishedContentQuery.Media(id)).WhereNotNull(); } /// @@ -800,7 +800,7 @@ namespace Umbraco.Web /// If an identifier does not match an existing media, it will be missing in the returned value. public IEnumerable Media(IEnumerable ids) { - return ids.Select(id => ContentQuery.Media(id)); + return ids.Select(id => _publishedContentQuery.Media(id)); } /// @@ -816,7 +816,7 @@ namespace Umbraco.Web public IEnumerable MediaAtRoot() { - return ContentQuery.MediaAtRoot(); + return _publishedContentQuery.MediaAtRoot(); } #endregion From 14747df4e7238b03d1aa103b7ae6abdc42b779ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 23 Nov 2020 11:31:31 +0100 Subject: [PATCH 04/14] run JS unit test in development script (#9014) --- src/Umbraco.Web.UI.Client/gulp/tasks/test.js | 1 - src/Umbraco.Web.UI.Client/gulpfile.js | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/gulp/tasks/test.js b/src/Umbraco.Web.UI.Client/gulp/tasks/test.js index 255fe17435..b5239d35e7 100644 --- a/src/Umbraco.Web.UI.Client/gulp/tasks/test.js +++ b/src/Umbraco.Web.UI.Client/gulp/tasks/test.js @@ -23,7 +23,6 @@ function runUnitTestServer() { autoWatch: true, port: 9999, singleRun: false, - browsers: ['ChromeDebugging'], keepalive: true }) .start(); diff --git a/src/Umbraco.Web.UI.Client/gulpfile.js b/src/Umbraco.Web.UI.Client/gulpfile.js index d272c77397..547b77cc7b 100644 --- a/src/Umbraco.Web.UI.Client/gulpfile.js +++ b/src/Umbraco.Web.UI.Client/gulpfile.js @@ -6,11 +6,11 @@ * =========== * This is now using Gulp 4, each child task is now a child function in its own corresponding file. * - * To add a new task, simply add a new task file to gulp/tasks folder, add a require statement below to include the one or more methods + * To add a new task, simply add a new task file to gulp/tasks folder, add a require statement below to include the one or more methods * and then add the exports command to add the new item into the task menu. */ -const { src, dest, series, parallel, lastRun } = require('gulp'); +const { series, parallel } = require('gulp'); const config = require('./gulp/config'); const { setDevelopmentMode, setTestMode } = require('./gulp/modes'); @@ -28,9 +28,9 @@ config.compile.current = config.compile.build; // These Exports are the new way of defining Tasks in Gulp 4.x // *********************************************************** exports.build = series(parallel(dependencies, js, less, views), testUnit); -exports.dev = series(setDevelopmentMode, parallel(dependencies, js, less, views), watchTask); +exports.dev = series(setDevelopmentMode, parallel(dependencies, js, less, views), runUnitTestServer, watchTask); exports.watch = series(watchTask); -// +// exports.runTests = series(setTestMode, series(js, testUnit)); exports.runUnit = series(setTestMode, series(js, runUnitTestServer), watchTask); exports.testE2e = series(setTestMode, parallel(testE2e)); From 2b6b9b8c062b8b3572332e89ecf30a18a1250b04 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 23 Nov 2020 11:35:52 +0100 Subject: [PATCH 05/14] Keep getting complaints that there's no `on` in codeql-config.yml --- .github/workflows/codeql-config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/codeql-config.yml b/.github/workflows/codeql-config.yml index afb05e76d2..59b55e48ec 100644 --- a/.github/workflows/codeql-config.yml +++ b/.github/workflows/codeql-config.yml @@ -1,4 +1,7 @@ name: "CodeQL config" +on: + push: + branches: [v8/contrib,v8/dev] paths-ignore: - node_modules - Umbraco.TestData From 930b1c1a7501296e229e09cc5d95e0cef48d1d39 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 23 Nov 2020 11:47:25 +0100 Subject: [PATCH 06/14] Run analysis for bug fixes & features --- .github/workflows/codeql-analysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f446c4cf7e..4dfa5a83b9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,7 +2,7 @@ name: "Code scanning - action" on: push: - branches: [v8/contrib,v8/dev] + branches: [v8/contrib,v8/dev,v8/bug,v8/feature] pull_request: # The branches below must be a subset of the branches above schedule: From 388123ff66933bfed304b6882df49f2fd859a8a0 Mon Sep 17 00:00:00 2001 From: Rachel Breeze Date: Tue, 24 Nov 2020 01:15:58 +0000 Subject: [PATCH 07/14] Follows the same pattern as create a relationship page title and clears the page title when creating a dictionary item (#9279) --- .../src/views/dictionary/dictionary.create.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/dictionary/dictionary.create.controller.js b/src/Umbraco.Web.UI.Client/src/views/dictionary/dictionary.create.controller.js index 03ffcfd09d..d22738b676 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dictionary/dictionary.create.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/dictionary/dictionary.create.controller.js @@ -12,7 +12,7 @@ function DictionaryCreateController($scope, $location, dictionaryResource, navig vm.itemKey = ""; vm.createItem = createItem; - + $scope.$emit("$changeTitle", ""); function createItem() { if (formHelper.submitForm({ scope: $scope, formCtrl: $scope.createDictionaryForm })) { From 1076e58cc7494e6a55de481b1c9dd4558aae72cd Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Wed, 7 Oct 2020 15:51:34 +0200 Subject: [PATCH 08/14] Hide properyt actions for culture invariant properties --- .../src/views/components/property/umb-property.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html index 14ca023046..dff62ee1eb 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/property/umb-property.html @@ -22,7 +22,7 @@ - + From fd09d4f3199046370042f262d543f2b1b56c0f30 Mon Sep 17 00:00:00 2001 From: BatJan <1932158+BatJan@users.noreply.github.com> Date: Sat, 3 Oct 2020 00:24:08 +0200 Subject: [PATCH 09/14] Convert divs with ng-click to button and wrap texts in paragraphs --- .../propertyeditors/grid/grid.prevalues.html | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.html index a1ff49c883..9bf32675e3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.prevalues.html @@ -17,20 +17,20 @@
  • -
    +
    + + + +
    - {{template.name}}
    +

    {{template.name}}

    @@ -64,23 +64,23 @@
  • -
    +
    + + {{area.maxItems}} + + + +
    - {{layout.label || layout.name}}
    +

    {{layout.label || layout.name}}

    - - + + Open {{name}} - - - + + Remove {{name}} - From 8262f25e205233bd9e6cde940e04a35b0142b74a Mon Sep 17 00:00:00 2001 From: Jan Skovgaard <1932158+BatJan@users.noreply.github.com> Date: Tue, 24 Nov 2020 08:19:23 +0100 Subject: [PATCH 11/14] Listview: Fix icon-picker a11y (#9050) * Add proper button and fix icon * split value to avoid binding icon color in icon attribute Co-authored-by: Nathan Woulfe --- .../listview/icon.prevalues.controller.js | 13 ++++++++++--- .../propertyeditors/listview/icon.prevalues.html | 12 ++++++------ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.controller.js index 86dcfdc415..6a485917be 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.controller.js @@ -4,17 +4,24 @@ function iconPreValsController($scope, editorService) { $scope.model.value = "icon-list"; } + let valueArray = $scope.model.value.split(' '); + $scope.icon = valueArray[0], + $scope.color = valueArray[1], + $scope.openIconPicker = function () { var iconPicker = { - icon: $scope.model.value.split(' ')[0], - color: $scope.model.value.split(' ')[1], + icon: $scope.icon, + color: $scope.color, submit: function (model) { if (model.icon) { if (model.color) { $scope.model.value = model.icon + " " + model.color; + $scope.color = model.color; } else { $scope.model.value = model.icon; - } + } + + $scope.icon = model.icon; $scope.iconForm.$setDirty(); } editorService.close(); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.html index 8a11cb516d..4f6735d069 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.html @@ -1,11 +1,11 @@ 
    -
    - -
    - -
    -
    + + + Add icon + +
    From 3f776c32f4bed6a8211dcc66edfd85b9d779f2c9 Mon Sep 17 00:00:00 2001 From: Nathan Woulfe Date: Tue, 24 Nov 2020 17:25:30 +1000 Subject: [PATCH 12/14] Update icon.prevalues.controller.js --- .../propertyeditors/listview/icon.prevalues.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.controller.js index 6a485917be..fd5c3dbf12 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/icon.prevalues.controller.js @@ -5,8 +5,8 @@ function iconPreValsController($scope, editorService) { } let valueArray = $scope.model.value.split(' '); - $scope.icon = valueArray[0], - $scope.color = valueArray[1], + $scope.icon = valueArray[0]; + $scope.color = valueArray[1]; $scope.openIconPicker = function () { var iconPicker = { From 8d96c6e842116e4a8c28547ac3cc08d5c78dee24 Mon Sep 17 00:00:00 2001 From: nzdev <834725+nzdev@users.noreply.github.com> Date: Thu, 29 Oct 2020 15:28:02 +1300 Subject: [PATCH 13/14] Add check for converted so .startsWith does not throw --- src/Umbraco.Web.UI.Client/src/common/services/tree.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js index 37485ea7eb..9ba4d2964b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tree.service.js @@ -135,7 +135,7 @@ function treeService($q, treeResource, iconHelper, notificationsService, eventsS if (treeNode.iconIsClass === undefined || treeNode.iconIsClass) { var converted = iconHelper.convertFromLegacyTreeNodeIcon(treeNode); treeNode.cssClass = standardCssClass + " " + converted; - if (converted.startsWith('.')) { + if (converted && converted.startsWith('.')) { //its legacy so add some width/height treeNode.style = "height:16px;width:16px;"; } From a6f5e48f43ace13af2b0c671d060b68e402adab4 Mon Sep 17 00:00:00 2001 From: Matt Brailsford Date: Fri, 27 Nov 2020 13:02:19 +0000 Subject: [PATCH 14/14] Introduce content app helper (#9425) --- .../components/content/edit.controller.js | 4 +-- .../content/umbvariantcontent.directive.js | 4 +-- .../services/contentapphelper.service.js | 35 +++++++++++++++++++ 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/common/services/contentapphelper.service.js diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index 826d6b87fc..f2dc0622c7 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -2,7 +2,7 @@ 'use strict'; function ContentEditController($rootScope, $scope, $routeParams, $q, $window, - appState, contentResource, entityResource, navigationService, notificationsService, + appState, contentResource, entityResource, navigationService, notificationsService, contentAppHelper, serverValidationManager, contentEditingHelper, localizationService, formHelper, umbRequestHelper, editorState, $http, eventsService, overlayService, $location, localStorageService, treeService, $exceptionHandler) { @@ -282,7 +282,7 @@ $scope.page.saveButtonStyle = content.trashed || content.isElement || isBlueprint ? "primary" : "info"; // only create the save/publish/preview buttons if the // content app is "Conent" - if ($scope.activeApp && $scope.activeApp.alias !== "umbContent" && $scope.activeApp.alias !== "umbInfo" && $scope.activeApp.alias !== "umbListView") { + if ($scope.activeApp && !contentAppHelper.isContentBasedApp($scope.activeApp)) { $scope.defaultButton = null; $scope.subButtons = null; $scope.page.showSaveButton = false; diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontent.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontent.directive.js index eb9971d83a..55e66c5706 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontent.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbvariantcontent.directive.js @@ -24,7 +24,7 @@ controller: umbVariantContentController }; - function umbVariantContentController($scope) { + function umbVariantContentController($scope, contentAppHelper) { var unsubscribe = []; @@ -110,7 +110,7 @@ function onAppChanged(activeApp) { // disable the name field if the active content app is not "Content" or "Info" - vm.nameDisabled = (activeApp && activeApp.alias !== "umbContent" && activeApp.alias !== "umbInfo" && activeApp.alias !== "umbListView"); + vm.nameDisabled = (activeApp && !contentAppHelper.isContentBasedApp(activeApp)); } /** diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contentapphelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contentapphelper.service.js new file mode 100644 index 0000000000..0b3dc2c6e0 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/services/contentapphelper.service.js @@ -0,0 +1,35 @@ + +/** +* @ngdoc service +* @name umbraco.services.contentAppHelper +* @description A helper service for content app related functions. +**/ +function contentAppHelper() { + + var service = {}; + + /** + * Default known content based apps. + */ + service.CONTENT_BASED_APPS = [ "umbContent", "umbInfo", "umbListView" ]; + + /** + * @ngdoc method + * @name umbraco.services.contentAppHelper#isContentBasedApp + * @methodOf umbraco.services.contentAppHelper + * + * @param {object} app A content app to check + * + * @description + * Determines whether the supplied content app is a known content based app + * + */ + service.isContentBasedApp = function (app) { + return service.CONTENT_BASED_APPS.indexOf(app.alias) !== -1; + } + + return service; + +} + +angular.module('umbraco.services').factory('contentAppHelper', contentAppHelper);