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)
Tue, Nov 26, 10:51 AM
Unknown Object (File)
Sun, Nov 24, 1:15 AM
Unknown Object (File)
Sun, Nov 24, 12:38 AM
Unknown Object (File)
Sat, Nov 23, 10:33 PM
Unknown Object (File)
Thu, Oct 31, 7:39 AM
Unknown Object (File)
Oct 24 2024, 1:01 AM
Unknown Object (File)
Oct 23 2024, 8:12 PM
Unknown Object (File)
Oct 20 2024, 9:45 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 3002
Build 3006: [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
35

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.