1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 11:12:42 +01:00
phorge-phorge/src/applications/metamta/herald
epriestley a90b16e83a Define available Herald rule repetition options in terms of "isSingleEventAdapter()"
Summary:
Depends on D18924. Ref T13048. Each adapter defines which repetition options ("every time", "only the first time") users may select for rules.

Currently, this is all explicit and hard-coded. However, every adapter really just implements this rule (except for some bugs, see below):

> You can pick "only the first time" if this adapter fires more than once on the same object.

Since we already have a `isSingleEventAdapter()` method which lets us tell if an adapter fires more than once, just write this rule in the base class and delete all the copy/pasting.

This also fixes two bugs because of the copy/pasting: Pholio Mocks and Phriction Documents did not allow you to write "only the first time" rules. There's no reason for this, they just didn't copy/paste enough methods when they were implemented.

This will make a future diff (which introduces an "if the rule did not match last time" policy) cleaner.

Test Plan:
  - Checked several different types of rules, saw appropriate options in the dropdown (pre-commit: no options; tasks: first or every).
  - Checked mocks and wiki docs, saw that you can now write "only the first time" rules.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13048

Differential Revision: https://secure.phabricator.com/D18925
2018-01-26 11:02:35 -08:00
..
PhabricatorMailEmailHeraldField.php Add basic support for Herald outbound rules 2015-08-15 10:54:33 -07:00
PhabricatorMailEmailHeraldFieldGroup.php Add basic support for Herald outbound rules 2015-08-15 10:54:33 -07:00
PhabricatorMailEmailSubjectHeraldField.php Add basic support for Herald outbound rules 2015-08-15 10:54:33 -07:00
PhabricatorMailOutboundMailHeraldAdapter.php Define available Herald rule repetition options in terms of "isSingleEventAdapter()" 2018-01-26 11:02:35 -08:00
PhabricatorMailOutboundRoutingHeraldAction.php Add basic support for Herald outbound rules 2015-08-15 10:54:33 -07:00
PhabricatorMailOutboundRoutingSelfEmailHeraldAction.php Add basic support for Herald outbound rules 2015-08-15 10:54:33 -07:00
PhabricatorMailOutboundRoutingSelfNotificationHeraldAction.php Add basic support for Herald outbound rules 2015-08-15 10:54:33 -07:00
PhabricatorMetaMTAApplicationEmailHeraldField.php Group and order Herald fields 2015-07-16 14:13:13 -07:00
PhabricatorMetaMTAEmailHeraldAction.php Don't run Herald build and mail rules when they don't make sense 2017-10-27 08:44:12 -07:00
PhabricatorMetaMTAEmailOthersHeraldAction.php Modularize "Send an Email" Herald actions 2015-08-03 14:33:23 -07:00
PhabricatorMetaMTAEmailSelfHeraldAction.php Modularize "Send an Email" Herald actions 2015-08-03 14:33:23 -07:00