Page MenuHomePhabricator

Mostly make the editor UI for triggers work
ClosedPublic

Authored by epriestley on Mar 21 2019, 4:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 16 2024, 9:30 PM
Unknown Object (File)
Oct 15 2024, 1:27 PM
Unknown Object (File)
Oct 10 2024, 5:08 AM
Unknown Object (File)
Sep 30 2024, 10:03 PM
Unknown Object (File)
Sep 15 2024, 8:04 PM
Unknown Object (File)
Sep 14 2024, 12:08 PM
Unknown Object (File)
Sep 4 2024, 10:14 PM
Unknown Object (File)
Aug 27 2024, 12:29 AM
Subscribers
None

Details

Summary

Ref T5474. This provides a Herald-like UI for editing workboard trigger rules.

This probably has some missing pieces and doesn't actually save anything to the database yet, but the basics at least roughly work.

Test Plan

Screen Shot 2019-03-21 at 9.31.37 AM.png (879×1 px, 184 KB)

Diff Detail

Repository
rP Phabricator
Branch
trigger7
Lint
Lint Warnings
Unit
Tests Passed
Build Status
Buildable 22319
Build 30530: Run Core Tests
Build 30529: arc lint + arc unit

Event Timeline

I'm gonna guess a lot of this JS is more-or-less copy/pasted from the Herald editor? Is there enough code in common to factor out into something more reusable?

src/applications/project/controller/trigger/PhabricatorProjectTriggerEditController.php
68–69

These are unused, I'm assuming because we aren't yet writing anything to the DB.

This revision is now accepted and ready to land.Mar 25 2019, 7:37 PM

I think we have five of these editors now: Herald, Bulk Edit, Owners Package Paths, Custom Policy, and now Trigger Rule. Depending on how you want to count, the action stack on comment forms is also a similar editor.

I think they share a mostly-reasonable amount of code already. All but the action stack use "MultirowManager", which is super ancient but not too terrible. The newer ones (bulk edit, comment forms, trigger rules, maybe owners?) share PHUIX controls for rendering the actual dropdowns and text inputs and stuff, although the older ones (herald/policy?) could be updated. They do all have some amount of unique behavior. For example, Herald has two sections for conditions/actions, and conditions has three columns for [ field ] [ operation ][ value ]. Owners has an AJAX validation callback and an associated UI. So they're never going to share all of the same code, and the pieces that need to be specialized vary from instance to instance.

I think this stuff probably could be cleaned up a bit and more code could be shared, but it doesn't feel too bad to me right now.

This revision was landed with ongoing or failed builds.Mar 25 2019, 8:25 PM
This revision was automatically updated to reflect the committed changes.