Commit 19770236 authored by jaapjansma's avatar jaapjansma
Browse files

Fixed issue with dropdown of retrieval of default data.

parent d2811ab0
Version 1.18 (not yet released) Version 1.17.2
============ ============
* Fixed issue with dropdown of retrieval of default data.
Version 1.17.1 Version 1.17.1
============ ============
......
...@@ -54,8 +54,6 @@ ...@@ -54,8 +54,6 @@
$scope.deletedDefaultDataInputs = []; $scope.deletedDefaultDataInputs = [];
$scope.deletedDefaultDataActions = []; $scope.deletedDefaultDataActions = [];
$scope.default_data_fields = {}; $scope.default_data_fields = {};
$scope.doNotChangeDefaultDataOutputConfiguration = false;
$scope.default_data_output_configuration = $scope.formProcessor.default_data_output_configuration;
$scope.permissions = CRM.form_processor.permissions; $scope.permissions = CRM.form_processor.permissions;
$scope.actionTitles = CRM.form_processor.actionTitles; $scope.actionTitles = CRM.form_processor.actionTitles;
$scope.defaultDataActionTitles = CRM.form_processor.defaultDataActionTitles; $scope.defaultDataActionTitles = CRM.form_processor.defaultDataActionTitles;
...@@ -96,36 +94,12 @@ ...@@ -96,36 +94,12 @@
$scope.$watchCollection('formProcessor.default_data_actions', function (newActions, oldActions) { $scope.$watchCollection('formProcessor.default_data_actions', function (newActions, oldActions) {
formProcessorFactory.getFieldList([], $scope.formProcessor.default_data_actions, false, "form_processor_default_data") formProcessorFactory.getFieldList([], $scope.formProcessor.default_data_actions, false, "form_processor_default_data")
.then(function(fields) { .then(function(fields) {
$scope.doNotChangeDefaultDataOutputConfiguration = true; var originalDefaultDataOutputConfiguration = $scope.formProcessor.default_data_output_configuration;
angular.forEach(fields, function(field, key) { $scope.default_data_fields = fields;
if (!$scope.default_data_fields.hasOwnProperty(field.name)) { $scope.formProcessor.default_data_output_configuration = originalDefaultDataOutputConfiguration;
$scope.default_data_fields[field.name] = field;
}
});
angular.forEach($scope.default_data_fields, function(fieldLabel, fieldName) {
var found = false;
angular.forEach(fields, function(field, key) {
if (field.name == fieldName) {
found = true;
}
});
if (!found) {
delete $scope.default_data_fields[fieldName];
}
});
angular.forEach($scope.formProcessor.default_data_output_configuration, function(mapping, field) {
$scope.default_data_output_configuration[field] = mapping;
});
$scope.doNotChangeDefaultDataOutputConfiguration = false;
}); });
}); });
$scope.$watchCollection('default_data_output_configuration', function(newDefaultDataOutputConfiguration, oldDefaultDataOutputConfiguration) {
if (!$scope.doNotChangeDefaultDataOutputConfiguration) {
$scope.formProcessor.default_data_output_configuration = newDefaultDataOutputConfiguration;
}
});
$scope.isValidName = function(name) { $scope.isValidName = function(name) {
return (!name) || name.match(/^[a-z0-9_]+$/) ? true : false; return (!name) || name.match(/^[a-z0-9_]+$/) ? true : false;
}; };
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
name="{{input.name}}" name="{{input.name}}"
crm-ui-id="defaultData.{{input.name}}" crm-ui-id="defaultData.{{input.name}}"
crm-ui-select="{dropdownAutoWidth : true, allowClear: true}" crm-ui-select="{dropdownAutoWidth : true, allowClear: true}"
ng-model="default_data_output_configuration[input.name]" ng-model="formProcessor.default_data_output_configuration[input.name]"
ng-required="false" ng-required="false"
> >
<option value="">{{ts('- Select field to add to the output -')}}</option> <option value="">{{ts('- Select field to add to the output -')}}</option>
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> <url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
<url desc="Action-Provider Extension">https://lab.civicrm.org/extensions/action-provider</url> <url desc="Action-Provider Extension">https://lab.civicrm.org/extensions/action-provider</url>
</urls> </urls>
<releaseDate>2020-11-10</releaseDate> <releaseDate>2020-11-11</releaseDate>
<version>1.18-dev</version> <version>1.17.2</version>
<develStage>stable</develStage> <develStage>stable</develStage>
<compatibility> <compatibility>
<ver>4.7</ver> <ver>4.7</ver>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment