Page MenuHomePhabricator

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

Authored by valhallasw on Nov 9 2014, 6:30 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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

valhallasw updated this revision to Diff 25978.Nov 9 2014, 6:30 PM
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 requested changes to this revision.Nov 9 2014, 6:37 PM
epriestley edited edge metadata.

One minor inline, looks good otherwise.

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

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 updated this revision to Diff 25980.Nov 9 2014, 7:00 PM
valhallasw edited edge metadata.

Use sub-array with phid key for profileImage

valhallasw added a comment.EditedNov 9 2014, 7:01 PM

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 updated this revision to Diff 25982.Nov 9 2014, 7:35 PM
valhallasw edited edge metadata.

profileImagePHID it is

epriestley accepted this revision.Nov 9 2014, 7:36 PM
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.