From 5585e21652a0980f43eba7eeeb3b35107d907f67 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 17 Mar 2017 16:23:36 -0700 Subject: [PATCH 1/2] CRM-20299 - CiviMail UI - Refresh recipient list after changing advanced options When composing a new mailing, there are advanced options for targetting recipients by location type (`location_type_id`, `email_selection_method`). This ensures that the estimate recipient count updates to match the selection. --- ang/crmMailing/EditRecipCtrl.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ang/crmMailing/EditRecipCtrl.js b/ang/crmMailing/EditRecipCtrl.js index 607ab2cb9976..16c125f8cfca 100644 --- a/ang/crmMailing/EditRecipCtrl.js +++ b/ang/crmMailing/EditRecipCtrl.js @@ -46,6 +46,8 @@ }); }, RECIPIENTS_DEBOUNCE_MS); $scope.$watchCollection("mailing.dedupe_email", refreshRecipients); + $scope.$watchCollection("mailing.location_type_id", refreshRecipients); + $scope.$watchCollection("mailing.email_selection_method", refreshRecipients); $scope.$watchCollection("mailing.recipients.groups.include", refreshRecipients); $scope.$watchCollection("mailing.recipients.groups.exclude", refreshRecipients); $scope.$watchCollection("mailing.recipients.mailings.include", refreshRecipients); From 5fdd3b708cb221a83a980ee79d326155b0ffe1c9 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 17 Mar 2017 16:25:22 -0700 Subject: [PATCH 2/2] CRM-20299 - CiviMail - "Location Type" requirement feels wonky If you select a "Location Type" and then deselect it, the field changes to "Automatic". This is the default value (which is acceptable), but the UI flags it as erroneous. The "Selection Method" also defaults to "Automatic". These fields are oddly a bit different (e.g. "Automatic" translates to `location_type_id==null` and `email_selection_method=automatic`), so the fields are a little different, but this revision brings them closer. --- ang/crmMailing/EditRecipOptionsDialogCtrl.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/ang/crmMailing/EditRecipOptionsDialogCtrl.html b/ang/crmMailing/EditRecipOptionsDialogCtrl.html index 53d2c15b88c2..4c773b49644d 100644 --- a/ang/crmMailing/EditRecipOptionsDialogCtrl.html +++ b/ang/crmMailing/EditRecipOptionsDialogCtrl.html @@ -17,9 +17,7 @@ crm-ui-select="{dropdownAutoWidth : true}" name="location_type_id" ng-model="model.mailing.location_type_id" - required > - @@ -32,7 +30,6 @@ crm-ui-select="" name="email_selection_method" ng-model="model.mailing.email_selection_method" - required >