Page MenuHomePhabricator

Pass viewer to all typeahead controls
AbandonedPublic

Authored by epriestley on Feb 14 2014, 6:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 6:54 AM
Unknown Object (File)
Tue, Dec 17, 5:59 AM
Unknown Object (File)
Tue, Dec 3, 8:39 PM
Unknown Object (File)
Mon, Dec 2, 6:57 PM
Unknown Object (File)
Sat, Nov 30, 3:34 AM
Unknown Object (File)
Wed, Nov 27, 12:28 AM
Unknown Object (File)
Mon, Nov 25, 1:30 AM
Unknown Object (File)
Nov 22 2024, 6:33 AM
Subscribers

Details

Summary

Ref T4420. I might need/want this to modernize datasources (for instance, if we let datasources declare that they're static and we should just ship down the results with the page, we need to be able to pass a viewer), and it also lets us make the username config (which sorts your username first) work more consistently.

Test Plan

Clicked every app homescreen, grep, lint, tried to hist most of the other interfaces. Verified username makes it into JS correctly.

Diff Detail

Repository
rP Phabricator
Branch
type1
Lint
Lint Passed
Unit
Tests Passed

Event Timeline

the new PhabricatorUser() ones strike me as sketchy?

src/applications/differential/field/specification/DifferentialCCsFieldSpecification.php
56

uh?

Yeah, they're a bit sketchy. There are two sites:

  • In DifferentialFields, we have no reasonable access to the viewer, and won't reasonably until T3886.
  • The Differential AddComment control is theoretically dead soon (T2222), or I'll fix it if I don't kill it.

In these cases, passing an empty user doesn't do anything bad, it just removes all the viewer's permissions and makes these controls render like they would for a logged-out user. That means the "put your username first" rule doesn't work, but that's not terrible for these four fields.

I don't really need this for anything immediately (some guy just started showing up above me, and I wanted to fix that), so let me hold this until I figure out the AddComment stuff at least and I can look at threading the viewer into fields in advance of T3886 too.

HEAD is miles ahead of this now and we don't have much of a specific need for it. I might pick this up at some point but don't plan to pursue it for now -- pile of work for a barely perceptible change.