From 01de3a644ad588c646b0880fbad72988ce5a3166 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Fri, 31 Jul 2020 14:08:20 +0200 Subject: [PATCH] Remove usages of angular.forEach in property editors --- .../contentpicker/contentpicker.controller.js | 2 +- .../propertyeditors/grid/grid.controller.js | 2 +- .../list/list.listviewlayout.controller.js | 18 ++++++++---------- .../nestedcontent/nestedcontent.controller.js | 3 +-- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js index b78f4819c523..bd80cdc42c4c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js @@ -446,7 +446,7 @@ function contentPickerController($scope, $q, $routeParams, $location, entityReso if (entityType !== "Member") { entityResource.getUrl(entity.id, entityType).then(function (data) { // update url - angular.forEach($scope.renderModel, function (item) { + $scope.renderModel.forEach(function (item) { if (item.id === entity.id) { if (entity.trashed) { item.url = vm.labels.general_recycleBin; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js index e560fec56282..6d3383c51e0c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js @@ -955,7 +955,7 @@ angular.module("umbraco") $scope.availableEditors = response.data; //Localize the grid editor names - angular.forEach($scope.availableEditors, function (value, key) { + $scope.availableEditors.forEach(function (value) { //If no translation is provided, keep using the editor name from the manifest localizationService.localize("grid_" + value.alias, undefined, value.name).then(function (v) { value.name = v; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js index 4230633e9680..fd49d3f706e8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/layouts/list/list.listviewlayout.controller.js @@ -86,22 +86,20 @@ } function markAsSensitive() { - angular.forEach($scope.options.includeProperties, function (option) { + $scope.options.includeProperties.forEach(function (option) { option.isSensitive = false; - angular.forEach($scope.items, - function (item) { + $scope.items.forEach(function (item) { - angular.forEach(item.properties, - function (property) { + item.properties.forEach(function (property) { - if (option.alias === property.alias) { - option.isSensitive = property.isSensitive; - } + if (option.alias === property.alias) { + option.isSensitive = property.isSensitive; + } - }); + }); - }); + }); }); } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js index 86dc9e24f101..31c52322783e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js @@ -498,8 +498,7 @@ if (tab) { scaffold.variants[0].tabs.push(tab); - angular.forEach(tab.properties, - function (property) { + tab.properties.forEach(function (property) { if (_.find(notSupported, function (x) { return x === property.editor; })) { property.notSupported = true; // TODO: Not supported message to be replaced with 'content_nestedContentEditorNotSupported' dictionary key. Currently not possible due to async/timing quirk.