Dragged cards to a column with a trigger, saw them close.
Why does this get its own class? Are we going to be catching it specifically somewhere?
Ok this was unclear on my first pass through this, but in reality, $rule_specifications is going to be a JSON blob, right? Which this code is turning back into objects?
Shouldn't we have a way to expand this info?
Maybe add a "valid values for rules of this type are..." blurb?
Shouldn't $this->getRecord()->getType() also be exposed? Or is that only used for construction of the rules and we won't need it again?
|3 ↗||(On Diff #48427)|
Shouldn't this be PhabricatorProjectTriggerManiphestStatusRule? I know that Maniphest is the only application that has workboards and could therefore have columns and triggers, but wasn't it somewhere in the planning docs that we want to keep this appropriately generalizable?
Yeah, I'm planning to eventually catch it on the trigger edit page and say "this trigger is garbo, you can edit if you want but you're going to overwrite the old stuff if you do."
Right, this is simulating a value coming out of the DB. In the future, this will just be $rule_specifications = $this->getRuleset(). I just haven't written a way to write to that property yet, since it involves a bunch of JS.
You can click "View Rule" to get everything (well, in a future diff). This is just a little tooltip that appears if you hover over the trigger icon on the workboard.
This is currently only used in the tooltip, so I didn't want to get a paragraph of text in. When the edit part happens, that should get more details.
(This is going to have a Herald-style visual editor eventually, so it should be hard for users to specify invalid values -- really just extension/upgrade/manually-edit-the-db stuff.)
Maybe, we just don't need it for anything right now. (Today, getValue() is only really for building transactions, and rules generally don't need to know their type to build transactions since the type is implicit in whichever class the method lives in.)
Normally, $this->getTriggerType() and $this->getRecord()->getType() will be the same. The only case where they differ is "Unknown" rules, where the getTriggerType() is "unknown" but the record type is the underlying storage record type ("some-extension-type" or whatever).
|3 ↗||(On Diff #48427)|
Yeah, this is probably a good idea. I'm sort of unsure we'll ever actually generalize, but no reason to make it harder than needbe.