Page MenuHomePhabricator

Add icon, color and profile image to project.query
ClosedPublic

Authored by valhallasw on Nov 9 2014, 6:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 4:24 PM
Unknown Object (File)
Thu, Dec 19, 4:24 PM
Unknown Object (File)
Thu, Dec 19, 4:24 PM
Unknown Object (File)
Thu, Dec 19, 4:24 PM
Unknown Object (File)
Thu, Dec 19, 4:24 PM
Unknown Object (File)
Thu, Dec 19, 1:41 PM
Unknown Object (File)
Mon, Dec 16, 6:41 PM
Unknown Object (File)
Sat, Dec 14, 4:01 PM

Details

Summary
  • The icon CSS tag is transformed through the new function PhabricatorProjectIcon::getAPIName($key), which returns a name without fa-.
  • Color is a trivial lookup
  • Profile image returns the PHID or null if not available
Test Plan
  • Create two projects, with different icon and color, one with and one without profile image.
  • Request information on both using project.query

Then:

  • Confirm icon and colors are correct for both projects
  • Confirm image PHID is correct
  • Confirm image PHID is null for the project without image

Diff Detail

Repository
rP Phabricator
Branch
master
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3004
Build 3008: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

valhallasw retitled this revision from to Add icon, color and profile image to project.query.
valhallasw updated this object.
valhallasw edited the test plan for this revision. (Show Details)
valhallasw added a reviewer: epriestley.
valhallasw added subscribers: legoktm, yuvipanda.
epriestley edited edge metadata.

One minor inline, looks good otherwise.

src/applications/project/conduit/ProjectConduitAPIMethod.php
43

Let's call this profileImagePHID to disambiguate it from, e.g., profileImageURI.

This revision now requires changes to proceed.Nov 9 2014, 6:37 PM
valhallasw edited edge metadata.

Use sub-array with phid key for profileImage

I have opted for

"profileImage" : {
        "phid" : "PHID-FILE-w5kjphncwdhjgyazny6j"
      },

instead, as that will allow

"profileImage" : {
        "phid" : "PHID-FILE-w5kjphncwdhjgyazny6j",
        "uri": "some/uri",
        "50x50": "some/other/uri"
      },

etc in the future instead of

"profileImagePHID" : "PHID-FILE-w5kjphncwdhjgyazny6j",
"profileImageURI": "some/uri",
"profileImage50x50URI": "some/other/uri"

Let's just do profileImagePHID instead of the sub-array, this is more consistent with lotsOfOtherStuffPHID in modern calls.

Specifically, it's unlikely (but possible) that we'll add profileImageURI here, but profileImagePHID makes it clear that the value isn't a URI, like authorPHID makes it clear that the value isn't a username and activeDiffPHID makes it clear that the value isn't a vanilla ID, in a call like differential.query. This is super nitpicky overall but annotating PHID fields with ...PHID just improves consistency and clarity a little bit.

valhallasw edited edge metadata.

profileImagePHID it is

epriestley edited edge metadata.

Cool, thanks!

This revision is now accepted and ready to land.Nov 9 2014, 7:36 PM
This revision was automatically updated to reflect the committed changes.