From db8004982f211807c16a1782ffb608d2ba709e26 Mon Sep 17 00:00:00 2001 From: Adam Werner Date: Fri, 10 Apr 2020 10:42:58 -0400 Subject: [PATCH] angular.isObject replace to Utilities.isObject --- .../directives/components/users/changepassword.directive.js | 2 +- .../src/common/services/contenteditinghelper.service.js | 4 ++-- .../src/common/services/contenttypehelper.service.js | 2 +- .../src/common/services/filemanager.service.js | 2 +- .../src/common/services/mediahelper.service.js | 2 +- .../src/common/services/notifications.service.js | 2 +- .../src/common/services/umbrequesthelper.service.js | 2 +- .../infiniteeditors/treepicker/treepicker.controller.js | 4 ++-- .../changepassword/changepassword.controller.js | 2 +- .../propertyeditors/checkboxlist/checkboxlist.controller.js | 2 +- .../dropdownFlexible/dropdownFlexible.controller.js | 4 ++-- .../views/propertyeditors/grid/editors/embed.controller.js | 4 ++-- .../src/views/propertyeditors/grid/grid.controller.js | 4 ++-- .../propertyeditors/radiobuttons/radiobuttons.controller.js | 2 +- src/Umbraco.Web.UI.Client/test/lib/angular/angular-mocks.js | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js index 97eb2bf708..8cbdabbf75 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/users/changepassword.directive.js @@ -56,7 +56,7 @@ } //set the model defaults - if (!angular.isObject(vm.passwordValues)) { + if (!Utilities.isObject(vm.passwordValues)) { //if it's not an object then just create a new one vm.passwordValues = { newPassword: null, diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js index 20a47ae32c..3cfe4f740e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js @@ -39,7 +39,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, editorSt /** Used by the content editor and mini content editor to perform saving operations */ contentEditorPerformSave: function (args) { - if (!angular.isObject(args)) { + if (!Utilities.isObject(args)) { throw "args must be an object"; } if (!args.scope) { @@ -152,7 +152,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, editorSt here we'll build the buttons according to the chars of the user. */ configureContentEditorButtons: function (args) { - if (!angular.isObject(args)) { + if (!Utilities.isObject(args)) { throw "args must be an object"; } if (!args.content) { diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenttypehelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenttypehelper.service.js index 305e4a694d..42431b751f 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/contenttypehelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/contenttypehelper.service.js @@ -13,7 +13,7 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje angular.forEach(array, function(arrayItem){ - if(angular.isObject(arrayItem)) { + if(Utilities.isObject(arrayItem)) { newArray.push(arrayItem.id); } else { newArray.push(arrayItem); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js b/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js index 41614a3bee..cb2ec8ed0b 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/filemanager.service.js @@ -30,7 +30,7 @@ function fileManager($rootScope) { if (!angular.isString(args.propertyAlias)) { throw "args.propertyAlias must be a non empty string"; } - if (!angular.isObject(args.files)) { + if (!Utilities.isObject(args.files)) { throw "args.files must be an object"; } diff --git a/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js index 2271f891ce..308ccc8d65 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/mediahelper.service.js @@ -143,7 +143,7 @@ function mediaHelper(umbRequestHelper, $log) { */ resolveFileFromEntity: function (mediaEntity, thumbnail) { - var mediaPath = angular.isObject(mediaEntity.metaData) ? mediaEntity.metaData.MediaPath : null; + var mediaPath = Utilities.isObject(mediaEntity.metaData) ? mediaEntity.metaData.MediaPath : null; if (!mediaPath) { //don't throw since this image legitimately might not contain a media path, but output a warning diff --git a/src/Umbraco.Web.UI.Client/src/common/services/notifications.service.js b/src/Umbraco.Web.UI.Client/src/common/services/notifications.service.js index e5701b9de0..196e0e3baa 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/notifications.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/notifications.service.js @@ -245,7 +245,7 @@ angular.module('umbraco.services') * @param {Int} index index where the notication should be removed from */ remove: function (index) { - if(angular.isObject(index)){ + if (Utilities.isObject(index)){ var i = nArray.indexOf(index); angularHelper.safeApply($rootScope, function() { nArray.splice(i, 1); diff --git a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js index 0d766dc7d8..cf2b8d30ad 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js @@ -59,7 +59,7 @@ function umbRequestHelper($http, $q, notificationsService, eventsService, formHe return encodeURIComponent(key) + "=" + encodeURIComponent(val); }).join("&"); } - else if (angular.isObject(queryStrings)) { + else if (Utilities.isObject(queryStrings)) { //this allows for a normal object to be passed in (ie. a dictionary) return decodeURIComponent($.param(queryStrings)); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js index 11d80d562d..4679e7748b 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/common/infiniteeditors/treepicker/treepicker.controller.js @@ -176,7 +176,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController", if (angular.isFunction($scope.model.filter)) { $scope.model.filterAdvanced = true; } - else if (angular.isObject($scope.model.filter)) { + else if (Utilities.isObject($scope.model.filter)) { $scope.model.filterAdvanced = true; } else { @@ -446,7 +446,7 @@ angular.module("umbraco").controller("Umbraco.Editors.TreePickerController", // be allowed to be clicked on nodes = _.filter(nodes, function (n) { - return !angular.isObject(n.metaData.listViewNode); + return !Utilities.isObject(n.metaData.listViewNode); }); if ($scope.model.filterAdvanced) { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js index 49058dfe29..ab7f5c66e0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/changepassword/changepassword.controller.js @@ -38,7 +38,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.ChangePasswordCont } //set the model defaults - if (!angular.isObject($scope.model.value)) { + if (!Utilities.isObject($scope.model.value)) { //if it's not an object then just create a new one $scope.model.value = { newPassword: null, diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/checkboxlist/checkboxlist.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/checkboxlist/checkboxlist.controller.js index 297bf23cef..10668808a5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/checkboxlist/checkboxlist.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/checkboxlist/checkboxlist.controller.js @@ -10,7 +10,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.CheckboxListContro function init() { // currently the property editor will onyl work if our input is an object. - if (angular.isObject($scope.model.config.items)) { + if (Utilities.isObject($scope.model.config.items)) { // formatting the items in the dictionary into an array var sortedItems = []; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.controller.js index a6d615cdd1..0f530ae5ee 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/dropdownFlexible/dropdownFlexible.controller.js @@ -48,11 +48,11 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.DropdownFlexibleCo if (angular.isArray($scope.model.config.items)) { //PP: I dont think this will happen, but we have tests that expect it to happen.. //if array is simple values, convert to array of objects - if(!angular.isObject($scope.model.config.items[0])){ + if (!Utilities.isObject($scope.model.config.items[0])){ $scope.model.config.items = convertArrayToDictionaryArray($scope.model.config.items); } } - else if (angular.isObject($scope.model.config.items)) { + else if (Utilities.isObject($scope.model.config.items)) { $scope.model.config.items = convertObjectToDictionaryArray($scope.model.config.items); } else { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.controller.js index 0f8a8df895..1370550631 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/embed.controller.js @@ -4,7 +4,7 @@ angular.module("umbraco") function onInit() { - var embedPreview = angular.isObject($scope.control.value) && $scope.control.value.preview ? $scope.control.value.preview : $scope.control.value; + var embedPreview = Utilities.isObject($scope.control.value) && $scope.control.value.preview ? $scope.control.value.preview : $scope.control.value; $scope.trustedValue = embedPreview ? $sce.trustAsHtml(embedPreview) : null; @@ -19,7 +19,7 @@ angular.module("umbraco") $scope.setEmbed = function () { - var original = angular.isObject($scope.control.value) ? $scope.control.value : null; + var original = Utilities.isObject($scope.control.value) ? $scope.control.value : null; var embed = { original: original, 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 67ec951512..f9e366a4a0 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 @@ -473,7 +473,7 @@ angular.module("umbraco") config = _.filter(angular.copy($scope.model.config.items.config), function (item) { return shouldApply(item, itemType, gridItem); }); } - if (angular.isObject(gridItem.config)) { + if (Utilities.isObject(gridItem.config)) { _.each(config, function (cfg) { var val = gridItem.config[cfg.key]; if (val) { @@ -482,7 +482,7 @@ angular.module("umbraco") }); } - if (angular.isObject(gridItem.styles)) { + if (Utilities.isObject(gridItem.styles)) { _.each(styles, function (style) { var val = gridItem.styles[style.key]; if (val) { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.controller.js index 2db7eaf562..6bfde10e9c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/radiobuttons/radiobuttons.controller.js @@ -8,7 +8,7 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.RadioButtonsContro function init() { //we can't really do anything if the config isn't an object - if (angular.isObject($scope.model.config.items)) { + if (Utilities.isObject($scope.model.config.items)) { // formatting the items in the dictionary into an array var sortedItems = []; diff --git a/src/Umbraco.Web.UI.Client/test/lib/angular/angular-mocks.js b/src/Umbraco.Web.UI.Client/test/lib/angular/angular-mocks.js index 3b6c9643ff..95313088ee 100644 --- a/src/Umbraco.Web.UI.Client/test/lib/angular/angular-mocks.js +++ b/src/Umbraco.Web.UI.Client/test/lib/angular/angular-mocks.js @@ -698,7 +698,7 @@ angular.mock.dump = function (object) { out.push(serialize(o)); }); out = '[ ' + out.join(', ') + ' ]'; - } else if (angular.isObject(object)) { + } else if (Utilities.isObject(object)) { if (angular.isFunction(object.$eval) && angular.isFunction(object.$apply)) { out = serializeScope(object); } else if (object instanceof Error) {