Page MenuHomePhabricator

Halp - how get policy control into batch editor?
AbandonedPublic

Authored by btrahan on Apr 2 2014, 6:37 PM.
Tags
None
Referenced Files
F15451738: D8677.id20571.diff
Fri, Mar 28, 11:35 PM
F15444575: D8677.id.diff
Thu, Mar 27, 10:09 AM
F15439434: D8677.diff
Wed, Mar 26, 7:29 AM
F15375093: D8677.id.diff
Wed, Mar 12, 9:39 PM
F15282907: D8677.diff
Mar 4 2025, 3:27 AM
Unknown Object (File)
Feb 23 2025, 3:02 AM
Unknown Object (File)
Feb 21 2025, 11:16 AM
Unknown Object (File)
Feb 9 2025, 12:08 PM
Subscribers

Details

Summary

Ref T4675. Getting the policy control into the batch editor is a bit tricky since the policy control is JS wizardy bound to a single object in the vanilla case. Tossing up this non-working diff for guidance as I don't want to waste time on a bad solution. I think we need to get this working well for the herald case too. We could possibly have a weaker version that doesn't allow for creating new custom policies.

Test Plan

NA

Diff Detail

Repository
rP Phabricator
Branch
T4675
Lint
Lint Errors
SeverityLocationCodeMessage
Errorwebroot/rsrc/js/application/maniphest/behavior-batch-editor.js:73JSHintW086JSHintW086
Unit
No Test Coverage

Event Timeline

btrahan retitled this revision from to Halp - how get policy control into batch editor?.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.

oh man this is a huge mess

I think the cleanest approach is to do something similar to the Typeahead:

  • Separate the control into "template" (dumb blob of HTML) and "js magic" parts, like the Tokenizer/Typeahead are.
  • Put the "js magic" part in some separate Javascript class (JX.PhabricatorPolicyControl).
  • Make the existing behavior a thin wrapper around "pass all this stuff to the JS magic", so it basically does new JX.PhabricatorPolicyControl().setStuff(...).start().
  • From the batch editor, drop the template into the document and then create a new JX.PhabricatorPolicyControl and call all the set() junk to give it magic.

This is probably an ass-ton of work. I don't think this feature is too important, so maybe deprioritize it for now? If anyone runs into an issue I can give them a 5 line script to make the adjustment they want. Or take a shot at the above, but I was thinking this was like a 5-minute fix when prioritizing.

Yeah, I'll de-prioritize for now, but I'd like to take a whack at it later.