From 0ca6bf8ae32cac592d432f41ec3d2e6dd9731687 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 24 Sep 2021 13:55:11 -0700 Subject: [PATCH] Rename extension (ang `msgtplui` => `crmMsgadm`, lowerCamelForm) --- .../CRM/MessageAdmin/Page/MsgtplBasePage.php | 2 +- ext/msgtplui/ang/msgtplui.ang.php | 10 +++++----- ext/msgtplui/ang/msgtplui.js | 2 +- ext/msgtplui/ang/msgtplui/Edit.js | 12 ++++++------ ext/msgtplui/ang/msgtplui/EditContent.js | 8 ++++---- ext/msgtplui/ang/msgtplui/GenericCtrl.js | 6 +++--- ext/msgtplui/ang/msgtplui/ListCtrl.js | 10 +++++----- ext/msgtplui/ang/msgtplui/Preview.js | 6 +++--- ext/msgtplui/ang/msgtplui/User.html | 2 +- ext/msgtplui/ang/msgtplui/User.js | 4 ++-- ext/msgtplui/ang/msgtplui/Workflow.html | 2 +- ext/msgtplui/ang/msgtplui/Workflow.js | 10 +++++----- ext/msgtplui/ang/msgtplui/WorkflowTranslated.html | 2 +- 13 files changed, 38 insertions(+), 38 deletions(-) diff --git a/ext/msgtplui/CRM/MessageAdmin/Page/MsgtplBasePage.php b/ext/msgtplui/CRM/MessageAdmin/Page/MsgtplBasePage.php index b49a237d2e..7034a67139 100644 --- a/ext/msgtplui/CRM/MessageAdmin/Page/MsgtplBasePage.php +++ b/ext/msgtplui/CRM/MessageAdmin/Page/MsgtplBasePage.php @@ -17,7 +17,7 @@ class CRM_MessageAdmin_Page_MsgtplBasePage extends CRM_Core_Page { /** @var \Civi\Angular\AngularLoader $loader */ CRM_Utils_System::setTitle(ts('Message Templates')); $loader = \Civi::service('angularjs.loader'); - $loader->addModules(['msgtplui']); + $loader->addModules(['crmMsgadm']); $loader->useApp(array( 'defaultRoute' => '/user', )); diff --git a/ext/msgtplui/ang/msgtplui.ang.php b/ext/msgtplui/ang/msgtplui.ang.php index b7bf600c5a..c7d9c84659 100644 --- a/ext/msgtplui/ang/msgtplui.ang.php +++ b/ext/msgtplui/ang/msgtplui.ang.php @@ -4,15 +4,15 @@ // \https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_angularModules/n return [ 'js' => [ - 'ang/msgtplui.js', - 'ang/msgtplui/*.js', - 'ang/msgtplui/*/*.js', + 'ang/crmMsgadm.js', + 'ang/crmMsgadm/*.js', + 'ang/crmMsgadm/*/*.js', ], 'css' => [ - 'ang/msgtplui.css', + 'ang/crmMsgadm.css', ], 'partials' => [ - 'ang/msgtplui', + 'ang/crmMsgadm', ], 'bundles' => [ 'bootstrap3', diff --git a/ext/msgtplui/ang/msgtplui.js b/ext/msgtplui/ang/msgtplui.js index 47b27fac85..19b5ec35e9 100644 --- a/ext/msgtplui/ang/msgtplui.js +++ b/ext/msgtplui/ang/msgtplui.js @@ -1,4 +1,4 @@ (function(angular, $, _) { // Declare a list of dependencies. - angular.module('msgtplui', CRM.angRequires('msgtplui')); + angular.module('crmMsgadm', CRM.angRequires('crmMsgadm')); })(angular, CRM.$, CRM._); diff --git a/ext/msgtplui/ang/msgtplui/Edit.js b/ext/msgtplui/ang/msgtplui/Edit.js index 98358361c5..7c77d2c727 100644 --- a/ext/msgtplui/ang/msgtplui/Edit.js +++ b/ext/msgtplui/ang/msgtplui/Edit.js @@ -103,11 +103,11 @@ }); } - angular.module('msgtplui').config(function($routeProvider) { + angular.module('crmMsgadm').config(function($routeProvider) { $routeProvider.when('/edit', { controller: 'MsgtpluiEdit', controllerAs: '$ctrl', - templateUrl: '~/msgtplui/Edit.html', + templateUrl: '~/crmMsgadm/Edit.html', // If you need to look up data when opening the page, list it out // under "resolve". @@ -150,14 +150,14 @@ } ); - angular.module('msgtplui').controller('MsgtpluiEdit', function($q, $scope, crmApi4, crmBlocker, crmStatus, crmUiAlert, crmUiHelp, $location, prefetch, tokenList, $rootScope, dialogService) { + angular.module('crmMsgadm').controller('MsgtpluiEdit', function($q, $scope, crmApi4, crmBlocker, crmStatus, crmUiAlert, crmUiHelp, $location, prefetch, tokenList, $rootScope, dialogService) { var block = $scope.block = crmBlocker(); - var ts = $scope.ts = CRM.ts('msgtplui'); + var ts = $scope.ts = CRM.ts('crmMsgadm'); var hs = $scope.hs = crmUiHelp({file: 'CRM/MessageAdmin/Edit'}); // See: templates/CRM/MessageAdmin/Edit.hlp var $ctrl = this; var args = $location.search(); - $ctrl.locales = CRM.msgtplui.allLanguages; + $ctrl.locales = CRM.crmMsgadm.allLanguages; $ctrl.records = prefetch; $ctrl.tokenList = tokenList; if (args.lang) { @@ -300,7 +300,7 @@ height: '90%', width: '90%' }); - return dialogService.open('previewMsgDlg', '~/msgtplui/Preview.html', model, options) + return dialogService.open('previewMsgDlg', '~/crmMsgadm/Preview.html', model, options) // Nothing to do but hide warnings. The field was edited live. .then(function(){}, function(){}); }, function(failure) { diff --git a/ext/msgtplui/ang/msgtplui/EditContent.js b/ext/msgtplui/ang/msgtplui/EditContent.js index 98e555b752..b2289f3815 100644 --- a/ext/msgtplui/ang/msgtplui/EditContent.js +++ b/ext/msgtplui/ang/msgtplui/EditContent.js @@ -1,12 +1,12 @@ (function (angular, $, _) { - angular.module('msgtplui').component('msgtpluiEditContent', { + angular.module('crmMsgadm').component('crmMsgadmEditContent', { bindings: { onPreview: '&', options: '=' }, - templateUrl: '~/msgtplui/EditContent.html', + templateUrl: '~/crmMsgadm/EditContent.html', controller: function ($scope, $element, crmStatus, crmUiAlert, dialogService, $rootScope) { - var ts = $scope.ts = CRM.ts('msgtplui'); + var ts = $scope.ts = CRM.ts('crmMsgadm'); var $ctrl = this; $ctrl.isDisabled = function() { @@ -41,7 +41,7 @@ height: '90%', width: '90%' }); - return dialogService.open('expandedEditDlg', '~/msgtplui/ExpandedEdit.html', model, options) + return dialogService.open('expandedEditDlg', '~/crmMsgadm/ExpandedEdit.html', model, options) // Nothing to do but hide warnings. The field was edited live. .then(function(){}, function(){}); }; diff --git a/ext/msgtplui/ang/msgtplui/GenericCtrl.js b/ext/msgtplui/ang/msgtplui/GenericCtrl.js index 7ae10305cc..f68e763cd3 100644 --- a/ext/msgtplui/ang/msgtplui/GenericCtrl.js +++ b/ext/msgtplui/ang/msgtplui/GenericCtrl.js @@ -1,8 +1,8 @@ (function(angular, $, _) { - angular.module('msgtplui').controller('MsgtpluiGenericCtrl', function($scope, crmUiHelp) { - var ts = $scope.ts = CRM.ts('msgtplui'); - var hs = $scope.hs = crmUiHelp({file: 'CRM/MessageAdmin/msgtplui'}); // See: templates/CRM/MessageAdmin/msgtplui.hlp + angular.module('crmMsgadm').controller('MsgtpluiGenericCtrl', function($scope, crmUiHelp) { + var ts = $scope.ts = CRM.ts('crmMsgadm'); + var hs = $scope.hs = crmUiHelp({file: 'CRM/MessageAdmin/crmMsgadm'}); // See: templates/CRM/MessageAdmin/crmMsgadm.hlp }); })(angular, CRM.$, CRM._); diff --git a/ext/msgtplui/ang/msgtplui/ListCtrl.js b/ext/msgtplui/ang/msgtplui/ListCtrl.js index 1b7e12897c..f2c77dfd42 100644 --- a/ext/msgtplui/ang/msgtplui/ListCtrl.js +++ b/ext/msgtplui/ang/msgtplui/ListCtrl.js @@ -16,8 +16,8 @@ return newRec; } - angular.module('msgtplui').controller('MsgtpluiListCtrl', function($scope, $route, crmApi4, crmStatus, crmUiAlert, crmUiHelp, prefetch, $location, dialogService) { - var ts = $scope.ts = CRM.ts('msgtplui'); + angular.module('crmMsgadm').controller('MsgtpluiListCtrl', function($scope, $route, crmApi4, crmStatus, crmUiAlert, crmUiHelp, prefetch, $location, dialogService) { + var ts = $scope.ts = CRM.ts('crmMsgadm'); var hs = $scope.hs = crmUiHelp({file: 'CRM/MessageAdmin/User'}); // See: templates/CRM/MessageAdmin/User.hlp $scope.crmUrl = CRM.url; $scope.crmUiAlert = crmUiAlert; @@ -81,12 +81,12 @@ $ctrl.addTranslation = function(record) { var existing = findTranslations(record), activeLangs = findActiveLangs(); var langs = []; - angular.forEach(CRM.msgtplui.allLanguages, function (label, value) { + angular.forEach(CRM.crmMsgadm.allLanguages, function (label, value) { langs.push({ name: value, label: label, is_allowed: !existing[value], - is_encouraged: !!(activeLangs[value] || CRM.msgtplui.uiLanguages[value]) + is_encouraged: !!(activeLangs[value] || CRM.crmMsgadm.uiLanguages[value]) }); }); var model = { @@ -101,7 +101,7 @@ width: '50%', title: ts('Add Translation') }); - return dialogService.open('addTranslationDlg', '~/msgtplui/AddTranslation.html', model, options) + return dialogService.open('addTranslationDlg', '~/crmMsgadm/AddTranslation.html', model, options) .then(function(){ var selection = (model.selected === 'other') ? model.selectedOther : model.selected; window.location = $ctrl.editUrl({id: record.id, tx_language: selection}); diff --git a/ext/msgtplui/ang/msgtplui/Preview.js b/ext/msgtplui/ang/msgtplui/Preview.js index 87207758a4..f2f5e1e21a 100644 --- a/ext/msgtplui/ang/msgtplui/Preview.js +++ b/ext/msgtplui/ang/msgtplui/Preview.js @@ -1,8 +1,8 @@ (function(angular, $, _) { - angular.module('msgtplui').controller('MsgtpluiPreviewCtrl', function($scope, crmUiHelp, crmStatus, crmApi4, crmUiAlert, $timeout, $q) { - var ts = $scope.ts = CRM.ts('msgtplui'); - var hs = $scope.hs = crmUiHelp({file: 'CRM/MessageAdmin/msgtplui'}); // See: templates/CRM/MessageAdmin/msgtplui.hlp + angular.module('crmMsgadm').controller('MsgtpluiPreviewCtrl', function($scope, crmUiHelp, crmStatus, crmApi4, crmUiAlert, $timeout, $q) { + var ts = $scope.ts = CRM.ts('crmMsgadm'); + var hs = $scope.hs = crmUiHelp({file: 'CRM/MessageAdmin/crmMsgadm'}); // See: templates/CRM/MessageAdmin/crmMsgadm.hlp var $ctrl = this, model = $scope.model; diff --git a/ext/msgtplui/ang/msgtplui/User.html b/ext/msgtplui/ang/msgtplui/User.html index 178d937773..bc910a1557 100644 --- a/ext/msgtplui/ang/msgtplui/User.html +++ b/ext/msgtplui/ang/msgtplui/User.html @@ -1,7 +1,7 @@
-
+
diff --git a/ext/msgtplui/ang/msgtplui/User.js b/ext/msgtplui/ang/msgtplui/User.js index 5d38a75b64..be8bef4ea8 100644 --- a/ext/msgtplui/ang/msgtplui/User.js +++ b/ext/msgtplui/ang/msgtplui/User.js @@ -1,12 +1,12 @@ (function(angular, $, _) { // Display a list of user-driven message-templates. - angular.module('msgtplui').config(function($routeProvider) { + angular.module('crmMsgadm').config(function($routeProvider) { $routeProvider.when('/user', { reloadOnSearch: false, controller: 'MsgtpluiListCtrl', controllerAs: '$ctrl', - templateUrl: '~/msgtplui/User.html', + templateUrl: '~/crmMsgadm/User.html', resolve: { prefetch: function(crmApi4, crmStatus) { var q = crmApi4({ diff --git a/ext/msgtplui/ang/msgtplui/Workflow.html b/ext/msgtplui/ang/msgtplui/Workflow.html index 42490be24e..099a0aaab8 100644 --- a/ext/msgtplui/ang/msgtplui/Workflow.html +++ b/ext/msgtplui/ang/msgtplui/Workflow.html @@ -1,7 +1,7 @@
-
+
diff --git a/ext/msgtplui/ang/msgtplui/Workflow.js b/ext/msgtplui/ang/msgtplui/Workflow.js index 8eaab630d8..833b544227 100644 --- a/ext/msgtplui/ang/msgtplui/Workflow.js +++ b/ext/msgtplui/ang/msgtplui/Workflow.js @@ -1,7 +1,7 @@ (function(angular, $, _) { // Display a list of system-workflow message-templates. - angular.module('msgtplui').config(function($routeProvider) { + angular.module('crmMsgadm').config(function($routeProvider) { $routeProvider.when('/workflow', { reloadOnSearch: false, controller: 'MsgtpluiListCtrl', @@ -9,12 +9,12 @@ templateUrl: function() { // The original drafts had a mode where the "Translate" button was conditioned on some kind of language-opt-in. // However, uiLanguages isn't giving that signal anymore, and that opt-in isn't strictly needed since htis - // is currently packaged as an opt-in extension. Maybe we should just remove `~/msgtplui/Workflow.html` in a few months. + // is currently packaged as an opt-in extension. Maybe we should just remove `~/crmMsgadm/Workflow.html` in a few months. // But for the moment, keep it around it in case we have to pivot. - // var supportsTranslation = CRM.msgtplui.uiLanguages && _.size(CRM.msgtplui.uiLanguages) > 1; - // return supportsTranslation ? '~/msgtplui/WorkflowTranslated.html' : '~/msgtplui/Workflow.html'; - return '~/msgtplui/WorkflowTranslated.html'; + // var supportsTranslation = CRM.crmMsgadm.uiLanguages && _.size(CRM.crmMsgadm.uiLanguages) > 1; + // return supportsTranslation ? '~/crmMsgadm/WorkflowTranslated.html' : '~/crmMsgadm/Workflow.html'; + return '~/crmMsgadm/WorkflowTranslated.html'; }, resolve: { prefetch: function(crmApi4, crmStatus) { diff --git a/ext/msgtplui/ang/msgtplui/WorkflowTranslated.html b/ext/msgtplui/ang/msgtplui/WorkflowTranslated.html index 0e9b9d2dec..f19f9ccfa2 100644 --- a/ext/msgtplui/ang/msgtplui/WorkflowTranslated.html +++ b/ext/msgtplui/ang/msgtplui/WorkflowTranslated.html @@ -1,7 +1,7 @@
-
+
-- 2.25.1