Page MenuHomePhabricator

Make some defaults for Quick Create / Favorites
ClosedPublic

Authored by chad on Jan 11 2017, 4:23 AM.
Tags
None
Referenced Files
F12837219: D17174.id.diff
Thu, Mar 28, 4:43 PM
Unknown Object (File)
Sun, Mar 17, 9:16 PM
Unknown Object (File)
Sun, Mar 10, 7:21 AM
Unknown Object (File)
Feb 13 2024, 11:35 PM
Unknown Object (File)
Feb 13 2024, 11:35 PM
Unknown Object (File)
Feb 13 2024, 11:35 PM
Unknown Object (File)
Feb 13 2024, 11:34 PM
Unknown Object (File)
Feb 10 2024, 12:13 PM
Subscribers
Tokens
"100" token, awarded by epriestley.

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
Branch
default-create (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15191
Build 19961: Run Core Tests
Build 19960: arc lint + arc unit

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.