Page MenuHomePhabricator

Make some defaults for Quick Create / Favorites
ClosedPublic

Authored by chad on Jan 11 2017, 4:23 AM.

Details

Summary

Add in some basic defaults, Tasks, Projects, Repositories... anything else? Also switches "manage" context if you are an admin or user. Hides link if you are not logged in.

Test Plan

Review Global/Personal in Favorites app, click on each link.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley added inline comments.
src/applications/favorites/engine/PhabricatorFavoritesProfileMenuEngine.php
29

Can we use constants for these? e.g. ManiphestEditEngine::whatever? Maybe with a static function on EditEngine to add the "/" in the middle?

This revision is now accepted and ready to land.Jan 11 2017, 3:19 PM
  • move magic upstream to PhabricatorEditEngine

I couldn't make it static, assume not important anyways?

I'd say your version is better than a static verison.

This revision was automatically updated to reflect the committed changes.

The fully static version would be:

PhabricatorEditEngine::generateFullKeyForFormFromTheseConstants(
  ManiphestTaskEditEngine::ENGINEKEY,
  PhabricatorEditEngine::EDITENGINECONFIG_DEFUAULT);

But I think your version is cleaner.

You can technically do your version as a static method, like this:

public static function generateFullFormKey() {
  return static::ENGINEKEY.'/'.self::EDITENGINECONFIG_DEFAULT;
}

...using static instead of self, but this is a feature called "Late Static Binding" which was not introduced until PHP 5.3, so we can't currently use it in this codebase.