1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

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
This commit is contained in:
epriestley 2019-04-03 09:20:20 -07:00
parent 2bd1bb52e4
commit 8d24e3a21a
2 changed files with 27 additions and 6 deletions

View file

@ -275,8 +275,11 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
$header = null;
break;
case self::HEADER_MODE_EDIT:
// In edit mode, include the panel monogram to make managing boards
// a little easier.
$header_text = pht('%s %s', $panel->getMonogram(), $panel->getName());
$header = id(new PHUIHeaderView())
->setHeader($panel->getName());
->setHeader($header_text);
$header = $this->addPanelHeaderActions($header);
break;
case self::HEADER_MODE_NORMAL:
@ -316,6 +319,11 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
->setIcon('fa-pencil')
->setName(pht('Edit Panel'))
->setHref((string)$edit_uri);
$actions[] = id(new PhabricatorActionView())
->setIcon('fa-window-maximize')
->setName(pht('View Panel Details'))
->setHref($panel->getURI());
}
if ($dashboard_id) {

View file

@ -11,11 +11,19 @@ final class PhabricatorDashboardRenderingEngine extends Phobject {
return $this;
}
public function getViewer() {
return $this->viewer;
}
public function setDashboard(PhabricatorDashboard $dashboard) {
$this->dashboard = $dashboard;
return $this;
}
public function getDashboard() {
return $this->dashboard;
}
public function setArrangeMode($mode) {
$this->arrangeMode = $mode;
return $this;
@ -26,6 +34,8 @@ final class PhabricatorDashboardRenderingEngine extends Phobject {
$dashboard = $this->dashboard;
$viewer = $this->viewer;
$is_editable = $this->arrangeMode;
$layout_config = $dashboard->getLayoutConfigObject();
$panel_grid_locations = $layout_config->getPanelLocations();
$panels = mpull($dashboard->getPanels(), null, 'getPHID');
@ -35,7 +45,7 @@ final class PhabricatorDashboardRenderingEngine extends Phobject {
->setFluidLayout(true)
->setGutter(AphrontMultiColumnView::GUTTER_LARGE);
if ($this->arrangeMode) {
if ($is_editable) {
$h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_EDIT;
} else {
$h_mode = PhabricatorDashboardPanelRenderingEngine::HEADER_MODE_NORMAL;
@ -77,8 +87,8 @@ final class PhabricatorDashboardRenderingEngine extends Phobject {
}
$column_class = $layout_config->getColumnClass(
$column,
$this->arrangeMode);
if ($this->arrangeMode) {
$is_editable);
if ($is_editable) {
$column_result[] = $this->renderAddPanelPlaceHolder($column);
$column_result[] = $this->renderAddPanelUI($column);
}
@ -89,7 +99,7 @@ final class PhabricatorDashboardRenderingEngine extends Phobject {
$metadata = array('columnID' => $column));
}
if ($this->arrangeMode) {
if ($is_editable) {
Javelin::initBehavior(
'dashboard-move-panels',
array(
@ -100,7 +110,10 @@ final class PhabricatorDashboardRenderingEngine extends Phobject {
$view = id(new PHUIBoxView())
->addClass('dashboard-view')
->appendChild($result);
->appendChild(
array(
$result,
));
return $view;
}