Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchKit - Fix broken update dialog and add input type float #19758

Merged
merged 1 commit into from
Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion ext/search/ang/crmSearchActions/crmSearchActionDelete.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="bootstrap-theme">
<form ng-controller="crmSearchActionDelete">
<form ng-controller="crmSearchActionDelete as $ctrl">
<p><strong>{{:: ts('Are you sure you want to delete %1 %2?', {1: model.ids.length, 2: $ctrl.entityTitle}) }}</strong></p>
<hr />
<div ng-if="$ctrl.run" class="crm-search-action-progress">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -61,6 +61,7 @@
if (fieldInUse(item.name)) {
formatted.disabled = true;
}
result.push(formatted);
}, []);
return {results: results};
};
Expand Down
2 changes: 1 addition & 1 deletion ext/search/ang/crmSearchActions/crmSearchActionUpdate.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="bootstrap-theme">
<form ng-controller="crmSearchActionUpdate">
<form ng-controller="crmSearchActionUpdate as $ctrl">
<p><strong>{{:: ts('Update the %1 selected %2 with the following values:', {1: model.ids.length, 2: $ctrl.entityTitle}) }}</strong></p>
<div class="form-inline" ng-repeat="clause in $ctrl.values" >
<input class="form-control" ng-change="$ctrl.updateField($index)" ng-disabled="$ctrl.run" ng-model="clause[0]" crm-ui-select="{data: $ctrl.availableFields, allowClear: true, placeholder: 'Field'}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
};

Expand Down
6 changes: 6 additions & 0 deletions ext/search/ang/crmSearchActions/crmSearchInput/float.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="form-group" ng-if="!$ctrl.multi" >
<input type="number" step="any" class="form-control" ng-model="$ctrl.value">
</div>
<div class="form-group" ng-if="$ctrl.multi" >
<input class="form-control" ng-model="$ctrl.value" crm-ui-select="{multiple: true, tags: [], tokenSeparators: [','], formatNoMatches: ''}" ng-list>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="form-group" ng-if="!$ctrl.multi" >
<input type="number" class="form-control" ng-model="$ctrl.value">
<input type="number" step="1" class="form-control" ng-model="$ctrl.value">
</div>
<div class="form-group" ng-if="$ctrl.multi" >
<input class="form-control" ng-model="$ctrl.value" crm-ui-select="{multiple: true, tags: [], tokenSeparators: [','], formatNoMatches: ''}" ng-list>
Expand Down