From 6d3a696016eebb7178a6e106e2b34acfa1dd7c96 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 8 Mar 2021 08:03:22 -0500 Subject: [PATCH] SearchKit - Fix broken update dialog and add input type float --- .../ang/crmSearchActions/crmSearchActionDelete.ctrl.js | 2 +- ext/search/ang/crmSearchActions/crmSearchActionDelete.html | 2 +- .../ang/crmSearchActions/crmSearchActionUpdate.ctrl.js | 3 ++- ext/search/ang/crmSearchActions/crmSearchActionUpdate.html | 2 +- .../crmSearchInput/crmSearchInputVal.component.js | 4 ++++ ext/search/ang/crmSearchActions/crmSearchInput/float.html | 6 ++++++ ext/search/ang/crmSearchActions/crmSearchInput/integer.html | 2 +- 7 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 ext/search/ang/crmSearchActions/crmSearchInput/float.html diff --git a/ext/search/ang/crmSearchActions/crmSearchActionDelete.ctrl.js b/ext/search/ang/crmSearchActions/crmSearchActionDelete.ctrl.js index 6408a5918f..148fe63343 100644 --- a/ext/search/ang/crmSearchActions/crmSearchActionDelete.ctrl.js +++ b/ext/search/ang/crmSearchActions/crmSearchActionDelete.ctrl.js @@ -4,7 +4,7 @@ angular.module('crmSearchActions').controller('crmSearchActionDelete', function($scope, dialogService) { var ts = $scope.ts = CRM.ts(), model = $scope.model, - ctrl = $scope.$ctrl = this; + ctrl = this; this.entityTitle = model.ids.length === 1 ? model.entityInfo.title : model.entityInfo.title_plural; diff --git a/ext/search/ang/crmSearchActions/crmSearchActionDelete.html b/ext/search/ang/crmSearchActions/crmSearchActionDelete.html index 340fdae9e1..7f924aa409 100644 --- a/ext/search/ang/crmSearchActions/crmSearchActionDelete.html +++ b/ext/search/ang/crmSearchActions/crmSearchActionDelete.html @@ -1,5 +1,5 @@
-
+

{{:: ts('Are you sure you want to delete %1 %2?', {1: model.ids.length, 2: $ctrl.entityTitle}) }}


diff --git a/ext/search/ang/crmSearchActions/crmSearchActionUpdate.ctrl.js b/ext/search/ang/crmSearchActions/crmSearchActionUpdate.ctrl.js index b55b605d27..14c5a359c6 100644 --- a/ext/search/ang/crmSearchActions/crmSearchActionUpdate.ctrl.js +++ b/ext/search/ang/crmSearchActions/crmSearchActionUpdate.ctrl.js @@ -4,7 +4,7 @@ angular.module('crmSearchActions').controller('crmSearchActionUpdate', function ($scope, $timeout, crmApi4, dialogService) { var ts = $scope.ts = CRM.ts(), model = $scope.model, - ctrl = $scope.$ctrl = this; + ctrl = this; this.entityTitle = model.ids.length === 1 ? model.entityInfo.title : model.entityInfo.title_plural; this.values = []; @@ -61,6 +61,7 @@ if (fieldInUse(item.name)) { formatted.disabled = true; } + result.push(formatted); }, []); return {results: results}; }; diff --git a/ext/search/ang/crmSearchActions/crmSearchActionUpdate.html b/ext/search/ang/crmSearchActions/crmSearchActionUpdate.html index 06d5ef51d9..58e5697537 100644 --- a/ext/search/ang/crmSearchActions/crmSearchActionUpdate.html +++ b/ext/search/ang/crmSearchActions/crmSearchActionUpdate.html @@ -1,5 +1,5 @@
- +

{{:: ts('Update the %1 selected %2 with the following values:', {1: model.ids.length, 2: $ctrl.entityTitle}) }}

diff --git a/ext/search/ang/crmSearchActions/crmSearchInput/crmSearchInputVal.component.js b/ext/search/ang/crmSearchActions/crmSearchInput/crmSearchInputVal.component.js index 3a6e30066f..3fd663c022 100644 --- a/ext/search/ang/crmSearchActions/crmSearchInput/crmSearchInputVal.component.js +++ b/ext/search/ang/crmSearchActions/crmSearchInput/crmSearchInputVal.component.js @@ -106,6 +106,10 @@ return '~/crmSearchActions/crmSearchInput/integer.html'; } + if (ctrl.field.data_type === 'Float') { + return '~/crmSearchActions/crmSearchInput/float.html'; + } + return '~/crmSearchActions/crmSearchInput/text.html'; }; diff --git a/ext/search/ang/crmSearchActions/crmSearchInput/float.html b/ext/search/ang/crmSearchActions/crmSearchInput/float.html new file mode 100644 index 0000000000..89b0079a78 --- /dev/null +++ b/ext/search/ang/crmSearchActions/crmSearchInput/float.html @@ -0,0 +1,6 @@ +
+ +
+
+ +
diff --git a/ext/search/ang/crmSearchActions/crmSearchInput/integer.html b/ext/search/ang/crmSearchActions/crmSearchInput/integer.html index 6c0f01ace6..0c5e75c49a 100644 --- a/ext/search/ang/crmSearchActions/crmSearchInput/integer.html +++ b/ext/search/ang/crmSearchActions/crmSearchInput/integer.html @@ -1,5 +1,5 @@
- +
-- 2.25.1