From fef937a8d818cc1a322224ef662cdfd7700726b5 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 9 Jun 2022 21:05:44 -0400 Subject: [PATCH] AngularJS - Remove UI-Utils library The [UI-Utils Libary](https://github.com/angular-ui/ui-utils/tree/v0.1.1) was introduced in 2014, but never used for much of anything. It remains very underutilized, and is the source of a major bug (see https://lab.civicrm.org/dev/core/-/issues/2688). Since it's abandonware, it seems best to stop using it rather than try to patch it. Fixes dev/core#2688 --- Civi/Angular/Manager.php | 1 - ang/crmCaseType.ang.php | 2 +- ang/crmCaseType.js | 6 +++++- ang/crmCaseType/edit.html | 2 +- ang/crmCaseType/timelineTable.html | 15 +++++-------- ang/crmCxn.ang.php | 2 +- ang/crmMailing.ang.php | 2 +- ang/crmMailing/BlockHeaderFooter.html | 6 ++---- ang/crmMailing/BlockPublication.html | 3 +-- ang/crmMailing/BlockResponses.html | 12 ++++------- ang/crmMailingAB.ang.php | 2 +- ang/crmUi.ang.php | 1 - ang/crmUi.js | 25 ++++++++++++++++------ ang/crmUi/tabset.html | 4 ++-- ang/ui.utils.ang.php | 6 ------ composer.json | 3 --- tests/phpunit/Civi/Angular/ManagerTest.php | 1 - 17 files changed, 43 insertions(+), 50 deletions(-) delete mode 100644 ang/ui.utils.ang.php diff --git a/Civi/Angular/Manager.php b/Civi/Angular/Manager.php index 6c7cde0b2a..ec14228af1 100644 --- a/Civi/Angular/Manager.php +++ b/Civi/Angular/Manager.php @@ -117,7 +117,6 @@ class Manager { $angularModules['jsonFormatter'] = include "$civicrm_root/ang/jsonFormatter.ang.php"; $angularModules['ngRoute'] = include "$civicrm_root/ang/ngRoute.ang.php"; $angularModules['ngSanitize'] = include "$civicrm_root/ang/ngSanitize.ang.php"; - $angularModules['ui.utils'] = include "$civicrm_root/ang/ui.utils.ang.php"; $angularModules['ui.bootstrap'] = include "$civicrm_root/ang/ui.bootstrap.ang.php"; $angularModules['ui.sortable'] = include "$civicrm_root/ang/ui.sortable.ang.php"; $angularModules['unsavedChanges'] = include "$civicrm_root/ang/unsavedChanges.ang.php"; diff --git a/ang/crmCaseType.ang.php b/ang/crmCaseType.ang.php index f035068cde..62ba2a55c3 100644 --- a/ang/crmCaseType.ang.php +++ b/ang/crmCaseType.ang.php @@ -7,5 +7,5 @@ return [ 'js' => ['ang/crmCaseType.js'], 'css' => ['ang/crmCaseType.css'], 'partials' => ['ang/crmCaseType'], - 'requires' => ['ngRoute', 'ui.utils', 'crmUi', 'unsavedChanges', 'crmUtil', 'crmResource'], + 'requires' => ['ngRoute', 'crmUi', 'unsavedChanges', 'crmUtil', 'crmResource'], ]; diff --git a/ang/crmCaseType.js b/ang/crmCaseType.js index c8b836b385..5e8d49d7a8 100644 --- a/ang/crmCaseType.js +++ b/ang/crmCaseType.js @@ -239,7 +239,7 @@ }; }); - crmCaseType.controller('CaseTypeCtrl', function($scope, crmApi, apiCalls, crmUiHelp) { + crmCaseType.controller('CaseTypeCtrl', function($scope, $timeout, crmApi, apiCalls, crmUiHelp) { var defaultAssigneeDefaultValue, ts; (function init () { @@ -254,6 +254,10 @@ initCaseType(); initCaseTypeDefinition(); initSelectedStatuses(); + + $timeout(function() { + $('form[name=editCaseTypeForm] .crmCaseType-acttab').tabs({show: true, hide: true}); + }); })(); /// Stores the api calls results in the $scope object diff --git a/ang/crmCaseType/edit.html b/ang/crmCaseType/edit.html index 034093b270..47e3f3c13f 100644 --- a/ang/crmCaseType/edit.html +++ b/ang/crmCaseType/edit.html @@ -13,7 +13,7 @@ Required vars: caseType
-
+
  • {{:: ts('Case Roles') }}
  • {{:: ts('Case Statuses') }}
  • diff --git a/ang/crmCaseType/timelineTable.html b/ang/crmCaseType/timelineTable.html index e25351d782..7703d57e21 100644 --- a/ang/crmCaseType/timelineTable.html +++ b/ang/crmCaseType/timelineTable.html @@ -27,8 +27,7 @@ Required vars: activitySet @@ -55,8 +53,7 @@ Required vars: activitySet @@ -20,8 +19,7 @@ Required vars: mailing, crmMailingConst @@ -46,8 +45,7 @@ Required vars: mailing, crmMailingConst @@ -70,8 +67,7 @@ Required vars: mailing, crmMailingConst