@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.

When a dashboard has inconsistent panel policies: keep doing nothing

Summary:
Depends on D20376. Ref T8033. It's possible to put a bunch of secret panels on a public dashboard, and not obvious that the dashboard won't be very useful.

This was more of an issue long ago (when the dashboard broke or all the panels completely vanished or something?). Nowadays, the panels render "You don't have permission to view this" so it's likely easy to explain/fix. Still, we can warn about this.

But, for now, don't, since a lot of this works better now and it's not really clear that this is particularly valuable. We can revisit this after all the connected changes have more of a chance to settle.

Test Plan:
(Earlier behavior, not how things look in the final version.)

{F6335008}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T8033

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

+27 -6
+9 -1
src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
··· 275 275 $header = null; 276 276 break; 277 277 case self::HEADER_MODE_EDIT: 278 + // In edit mode, include the panel monogram to make managing boards 279 + // a little easier. 280 + $header_text = pht('%s %s', $panel->getMonogram(), $panel->getName()); 278 281 $header = id(new PHUIHeaderView()) 279 - ->setHeader($panel->getName()); 282 + ->setHeader($header_text); 280 283 $header = $this->addPanelHeaderActions($header); 281 284 break; 282 285 case self::HEADER_MODE_NORMAL: ··· 316 319 ->setIcon('fa-pencil') 317 320 ->setName(pht('Edit Panel')) 318 321 ->setHref((string)$edit_uri); 322 + 323 + $actions[] = id(new PhabricatorActionView()) 324 + ->setIcon('fa-window-maximize') 325 + ->setName(pht('View Panel Details')) 326 + ->setHref($panel->getURI()); 319 327 } 320 328 321 329 if ($dashboard_id) {
+18 -5
src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
··· 11 11 return $this; 12 12 } 13 13 14 + public function getViewer() { 15 + return $this->viewer; 16 + } 17 + 14 18 public function setDashboard(PhabricatorDashboard $dashboard) { 15 19 $this->dashboard = $dashboard; 16 20 return $this; 17 21 } 18 22 23 + public function getDashboard() { 24 + return $this->dashboard; 25 + } 26 + 19 27 public function setArrangeMode($mode) { 20 28 $this->arrangeMode = $mode; 21 29 return $this; ··· 26 34 $dashboard = $this->dashboard; 27 35 $viewer = $this->viewer; 28 36 37 + $is_editable = $this->arrangeMode; 38 + 29 39 $layout_config = $dashboard->getLayoutConfigObject(); 30 40 $panel_grid_locations = $layout_config->getPanelLocations(); 31 41 $panels = mpull($dashboard->getPanels(), null, 'getPHID'); ··· 35 45 ->setFluidLayout(true) 36 46 ->setGutter(AphrontMultiColumnView::GUTTER_LARGE); 37 47 38 - if ($this->arrangeMode) { 48 + if ($is_editable) { 39 49 $h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_EDIT; 40 50 } else { 41 51 $h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_NORMAL; ··· 77 87 } 78 88 $column_class = $layout_config->getColumnClass( 79 89 $column, 80 - $this->arrangeMode); 81 - if ($this->arrangeMode) { 90 + $is_editable); 91 + if ($is_editable) { 82 92 $column_result[] = $this->renderAddPanelPlaceHolder($column); 83 93 $column_result[] = $this->renderAddPanelUI($column); 84 94 } ··· 89 99 $metadata = array('columnID' => $column)); 90 100 } 91 101 92 - if ($this->arrangeMode) { 102 + if ($is_editable) { 93 103 Javelin::initBehavior( 94 104 'dashboard-move-panels', 95 105 array( ··· 100 110 101 111 $view = id(new PHUIBoxView()) 102 112 ->addClass('dashboard-view') 103 - ->appendChild($result); 113 + ->appendChild( 114 + array( 115 + $result, 116 + )); 104 117 105 118 return $view; 106 119 }