@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Embed dashboard panels in comments

Summary: Fixes T4983, Panel prefix 'W' should be recognized as a shortcut to a dashboard panel

Test Plan: Open any comment input, type '{W1}', or other existing panel, preview should embed that panel.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Maniphest Tasks: T4983

Differential Revision: https://secure.phabricator.com/D9215

authored by

lkassianik and committed by
epriestley
8a429c51 b38ad4e4

+38
+2
src/__phutil_library_map__.php
··· 1489 1489 'PhabricatorDashboardPanelTypeText' => 'applications/dashboard/paneltype/PhabricatorDashboardPanelTypeText.php', 1490 1490 'PhabricatorDashboardPanelViewController' => 'applications/dashboard/controller/PhabricatorDashboardPanelViewController.php', 1491 1491 'PhabricatorDashboardQuery' => 'applications/dashboard/query/PhabricatorDashboardQuery.php', 1492 + 'PhabricatorDashboardRemarkupRule' => 'applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php', 1492 1493 'PhabricatorDashboardRemovePanelController' => 'applications/dashboard/controller/PhabricatorDashboardRemovePanelController.php', 1493 1494 'PhabricatorDashboardRenderingEngine' => 'applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php', 1494 1495 'PhabricatorDashboardSearchEngine' => 'applications/dashboard/query/PhabricatorDashboardSearchEngine.php', ··· 4284 4285 'PhabricatorDashboardPanelTypeText' => 'PhabricatorDashboardPanelType', 4285 4286 'PhabricatorDashboardPanelViewController' => 'PhabricatorDashboardController', 4286 4287 'PhabricatorDashboardQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4288 + 'PhabricatorDashboardRemarkupRule' => 'PhabricatorRemarkupRuleObject', 4287 4289 'PhabricatorDashboardRemovePanelController' => 'PhabricatorDashboardController', 4288 4290 'PhabricatorDashboardRenderingEngine' => 'Phobject', 4289 4291 'PhabricatorDashboardSearchEngine' => 'PhabricatorApplicationSearchEngine',
+6
src/applications/dashboard/application/PhabricatorApplicationDashboard.php
··· 41 41 ); 42 42 } 43 43 44 + public function getRemarkupRules() { 45 + return array( 46 + new PhabricatorDashboardRemarkupRule(), 47 + ); 48 + } 49 + 44 50 public function shouldAppearInLaunchView() { 45 51 return false; 46 52 }
+30
src/applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php
··· 1 + <?php 2 + 3 + final class PhabricatorDashboardRemarkupRule 4 + extends PhabricatorRemarkupRuleObject { 5 + 6 + protected function getObjectNamePrefix() { 7 + return 'W'; 8 + } 9 + 10 + protected function loadObjects(array $ids) { 11 + $viewer = $this->getEngine()->getConfig('viewer'); 12 + 13 + return id(new PhabricatorDashboardPanelQuery()) 14 + ->setViewer($viewer) 15 + ->withIDs($ids) 16 + ->execute(); 17 + 18 + } 19 + 20 + protected function renderObjectEmbed($object, $handle, $options) { 21 + $viewer = $this->getEngine()->getConfig('viewer'); 22 + 23 + return id(new PhabricatorDashboardPanelRenderingEngine()) 24 + ->setViewer($viewer) 25 + ->setPanel($object) 26 + ->setParentPanelPHIDs(array()) 27 + ->renderPanel(); 28 + 29 + } 30 + }