HomePhabricator

Modularize application extensions to EditEngine

Authored by epriestley.

Description

Modularize application extensions to EditEngine

Summary:
Ref T9132. Currently, EditEngine had some branchy-instanceof code like this:

if ($object instanceof Whatever) {
  do_magic();
}

if ($object instanceof SomethingElse) {
  do_other_magic();
}

...where Whatever and SomethingElse are first-party applications like ProjectsInterface and SubscribersInterface.

This kind of code is generally bad because third-parties can't add new stuff, and it suggest something is kind of hacky in its architecture. Ideally, we would eventually get rid of almost all of this.

T9789 is a similar discussion of this for the next layer down (TransactionEditor) and plans to get rid of branchy-instanceofs there too.

Since I'm about to add more stuff here (for Custom Fields), split it out first so I'm not digging us any deeper than I already dug us.

Broadly, this allows third-party extensions to add fields to every EditEngine UI if they want, like we do for Policies, Subscribers, Projects and Comments today (and CustomFields soon).

Test Plan:

  • Observed that all fields still appear on the form and seem to work correctly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9132

Differential Revision: https://secure.phabricator.com/D14599

Details

Committed
epriestleyNov 30 2015, 4:59 PM
Pushed
epriestleyNov 30 2015, 4:59 PM
Reviewer
chad
Differential Revision
D14599: Modularize application extensions to EditEngine
Parents
rP9a193093459f: Update PhameBlogView UI
Branches
Unknown
Tags
Unknown
Tasks
T9132: Build an ApplicationEditor abstraction
Build Status
Buildable 9147
Build 10798: Run Core Tests