diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -357,7 +357,7 @@ 'rsrc/js/application/conpherence/behavior-pontificate.js' => '53f6f2dd', 'rsrc/js/application/conpherence/behavior-widget-pane.js' => '40b1ff90', 'rsrc/js/application/countdown/timer.js' => '889c96f3', - 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => 'fd965b41', + 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => 'a8367aa9', 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'f2441746', 'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => '533a187b', 'rsrc/js/application/differential/behavior-comment-jump.js' => '71755c79', @@ -551,7 +551,7 @@ 'javelin-behavior-conpherence-widget-pane' => '40b1ff90', 'javelin-behavior-countdown-timer' => '889c96f3', 'javelin-behavior-dark-console' => 'e9fdb5e5', - 'javelin-behavior-dashboard-async-panel' => 'fd965b41', + 'javelin-behavior-dashboard-async-panel' => 'a8367aa9', 'javelin-behavior-device' => '03d6ed07', 'javelin-behavior-differential-add-reviewers-and-ccs' => '533a187b', 'javelin-behavior-differential-comment-jump' => '71755c79', @@ -1576,6 +1576,12 @@ 1 => 'javelin-stratcom', 2 => 'javelin-dom', ), + 'a8367aa9' => + array( + 0 => 'javelin-behavior', + 1 => 'javelin-dom', + 2 => 'javelin-workflow', + ), 'a8d8459d' => array( 0 => 'javelin-behavior', @@ -2020,12 +2026,6 @@ 0 => 'phabricator-busy', 1 => 'javelin-behavior', ), - 'fd965b41' => - array( - 0 => 'javelin-behavior', - 1 => 'javelin-dom', - 2 => 'javelin-workflow', - ), 'fe2e0ba4' => array( 0 => 'javelin-behavior', diff --git a/src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php b/src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php --- a/src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php +++ b/src/applications/dashboard/controller/PhabricatorDashboardPanelRenderController.php @@ -37,6 +37,7 @@ ->setViewer($viewer) ->setPanel($panel) ->setParentPanelPHIDs($parent_phids) + ->setHeaderless($request->getBool('headerless')) ->renderPanel(); if ($request->isAjax()) { diff --git a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php --- a/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php +++ b/src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php @@ -6,6 +6,16 @@ private $viewer; private $enableAsyncRendering; private $parentPanelPHIDs; + private $headerless; + + public function setHeaderless($headerless) { + $this->headerless = $headerless; + return $this; + } + + public function getHeaderless() { + return $this->headerless; + } /** * Allow the engine to render the panel via Ajax. @@ -75,9 +85,14 @@ } private function renderErrorPanel($title, $body) { - return id(new PHUIObjectBoxView()) - ->setHeaderText($title) - ->setFormErrors(array($body)); + if ($this->getHeaderless()) { + return id(new AphrontErrorView()) + ->setErrors(array($body)); + } else { + return id(new PHUIObjectBoxView()) + ->setHeaderText($title) + ->setFormErrors(array($body)); + } } private function renderAsyncPanel(PhabricatorDashboardPanel $panel) { @@ -88,13 +103,25 @@ array( 'panelID' => $panel_id, 'parentPanelPHIDs' => $this->getParentPanelPHIDs(), + 'headerless' => $this->getHeaderless(), 'uri' => '/dashboard/panel/render/'.$panel->getID().'/', )); - return id(new PHUIObjectBoxView()) - ->setHeaderText($panel->getName()) - ->setID($panel_id) - ->appendChild(pht('Loading...')); + $content = pht('Loading...'); + + if ($this->headerless) { + return phutil_tag( + 'div', + array( + 'id' => $panel_id, + ), + $content); + } else { + return id(new PHUIObjectBoxView()) + ->setHeaderText($panel->getName()) + ->setID($panel_id) + ->appendChild($content); + } } /** diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardPanelType.php b/src/applications/dashboard/paneltype/PhabricatorDashboardPanelType.php --- a/src/applications/dashboard/paneltype/PhabricatorDashboardPanelType.php +++ b/src/applications/dashboard/paneltype/PhabricatorDashboardPanelType.php @@ -47,6 +47,10 @@ $content = $this->renderPanelContent($viewer, $panel, $engine); + if ($engine->getHeaderless()) { + return $content; + } + return id(new PHUIObjectBoxView()) ->setHeaderText($panel->getName()) ->appendChild($content); diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeTabs.php b/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeTabs.php --- a/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeTabs.php +++ b/src/applications/dashboard/paneltype/PhabricatorDashboardPanelTypeTabs.php @@ -91,6 +91,7 @@ ->setEnableAsyncRendering(true) ->setParentPanelPHIDs($parent_phids) ->setPanel($panel) + ->setHeaderless(true) ->renderPanel(); } else { $panel_content = 'nope'; diff --git a/webroot/rsrc/js/application/dashboard/behavior-dashboard-async-panel.js b/webroot/rsrc/js/application/dashboard/behavior-dashboard-async-panel.js --- a/webroot/rsrc/js/application/dashboard/behavior-dashboard-async-panel.js +++ b/webroot/rsrc/js/application/dashboard/behavior-dashboard-async-panel.js @@ -9,8 +9,13 @@ var panel = JX.$(config.panelID); panel.style.opacity = '0.5'; + var data = { + parentPanelPHIDs: config.parentPanelPHIDs.join(','), + headerless: config.headerless + }; + new JX.Workflow(config.uri) - .setData({parentPanelPHIDs: config.parentPanelPHIDs.join(',')}) + .setData(data) .setHandler(function(r) { JX.DOM.replace(panel, JX.$H(r.panelMarkup)); })