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

Make the Dashboard dropshadow a little lighter and turn panel management into a menu

Summary:
Depends on D20372. Ref T13272.

  - There's a very heavy dropshadow on panels right now that looks out of place. Reduce it a bit.
  - Panels currently have unlabeled pencil and trash icons. Turn this into a menu. I'm likely planning to add options like "Change Query..." to this menu to make managing some types of panels easier.

Test Plan: {F6332838}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13272

Differential Revision: https://secure.phabricator.com/D20373
This commit is contained in:
epriestley 2019-04-02 12:08:05 -07:00
parent b1e2d3cd29
commit a1a89589b1
6 changed files with 63 additions and 35 deletions

View file

@ -9,7 +9,7 @@ return array(
'names' => array( 'names' => array(
'conpherence.pkg.css' => '3c8a0668', 'conpherence.pkg.css' => '3c8a0668',
'conpherence.pkg.js' => '020aebcf', 'conpherence.pkg.js' => '020aebcf',
'core.pkg.css' => '3b565a84', 'core.pkg.css' => '2d4810eb',
'core.pkg.js' => 'a568e834', 'core.pkg.js' => 'a568e834',
'differential.pkg.css' => '8d8360fb', 'differential.pkg.css' => '8d8360fb',
'differential.pkg.js' => '67e02996', 'differential.pkg.js' => '67e02996',
@ -58,7 +58,7 @@ return array(
'rsrc/css/application/contentsource/content-source-view.css' => 'cdf0d579', 'rsrc/css/application/contentsource/content-source-view.css' => 'cdf0d579',
'rsrc/css/application/countdown/timer.css' => 'bff8012f', 'rsrc/css/application/countdown/timer.css' => 'bff8012f',
'rsrc/css/application/daemon/bulk-job.css' => '73af99f5', 'rsrc/css/application/daemon/bulk-job.css' => '73af99f5',
'rsrc/css/application/dashboard/dashboard.css' => '4267d6c6', 'rsrc/css/application/dashboard/dashboard.css' => '5a205b9d',
'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d', 'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d',
'rsrc/css/application/differential/add-comment.css' => '7e5900d9', 'rsrc/css/application/differential/add-comment.css' => '7e5900d9',
'rsrc/css/application/differential/changeset-view.css' => 'bde53589', 'rsrc/css/application/differential/changeset-view.css' => 'bde53589',
@ -765,7 +765,7 @@ return array(
'phabricator-countdown-css' => 'bff8012f', 'phabricator-countdown-css' => 'bff8012f',
'phabricator-darklog' => '3b869402', 'phabricator-darklog' => '3b869402',
'phabricator-darkmessage' => '26cd4b73', 'phabricator-darkmessage' => '26cd4b73',
'phabricator-dashboard-css' => '4267d6c6', 'phabricator-dashboard-css' => '5a205b9d',
'phabricator-diff-changeset' => 'd0a85a85', 'phabricator-diff-changeset' => 'd0a85a85',
'phabricator-diff-changeset-list' => '04023d82', 'phabricator-diff-changeset-list' => '04023d82',
'phabricator-diff-inline' => 'a4a14a94', 'phabricator-diff-inline' => 'a4a14a94',

View file

@ -42,8 +42,7 @@ final class PhabricatorDashboardRemovePanelController
return new Aphront404Response(); return new Aphront404Response();
} }
$redirect_uri = $this->getApplicationURI( $redirect_uri = $dashboard->getURI();
'arrange/'.$dashboard->getID().'/');
$layout_config = $dashboard->getLayoutConfigObject(); $layout_config = $dashboard->getLayoutConfigObject();
if ($request->isFormPost()) { if ($request->isFormPost()) {

View file

@ -9,11 +9,10 @@ final class PhabricatorDashboardPanelEditController
$engine = id(new PhabricatorDashboardPanelEditEngine()) $engine = id(new PhabricatorDashboardPanelEditEngine())
->setController($this); ->setController($this);
$id = $request->getURIData('id'); // We can create or edit a panel in the context of a dashboard. If we
if (!$id) { // started on a dashboard, we want to return to that dashboard when we're
// done editing.
$dashboard_id = $request->getStr('dashboardID'); $dashboard_id = $request->getStr('dashboardID');
$column_id = $request->getStr('columnID');
if (strlen($dashboard_id)) { if (strlen($dashboard_id)) {
$dashboard = id(new PhabricatorDashboardQuery()) $dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer) ->setViewer($viewer)
@ -27,10 +26,18 @@ final class PhabricatorDashboardPanelEditController
if (!$dashboard) { if (!$dashboard) {
return new Aphront404Response(); return new Aphront404Response();
} }
$engine
->setDashboard($dashboard)
->addContextParameter('dashboardID', $dashboard_id);
} else { } else {
$dashboard = null; $dashboard = null;
} }
$id = $request->getURIData('id');
if (!$id) {
$column_id = $request->getStr('columnID');
if ($dashboard) { if ($dashboard) {
$cancel_uri = $dashboard->getURI(); $cancel_uri = $dashboard->getURI();
} else { } else {
@ -45,10 +52,8 @@ final class PhabricatorDashboardPanelEditController
$engine $engine
->addContextParameter('panelType', $panel_type) ->addContextParameter('panelType', $panel_type)
->addContextParameter('dashboardID', $dashboard_id)
->addContextParameter('columnID', $column_id) ->addContextParameter('columnID', $column_id)
->setPanelType($panel_type) ->setPanelType($panel_type)
->setDashboard($dashboard)
->setColumnID($column_id); ->setColumnID($column_id);
} }

View file

@ -101,6 +101,15 @@ final class PhabricatorDashboardPanelEditEngine
return parent::getEffectiveObjectEditDoneURI($object); return parent::getEffectiveObjectEditDoneURI($object);
} }
protected function getObjectEditCancelURI($object) {
$dashboard = $this->getDashboard();
if ($dashboard) {
return $dashboard->getURI();
}
return parent::getObjectEditCancelURI($object);
}
protected function getObjectEditTitleText($object) { protected function getObjectEditTitleText($object) {
return pht('Edit Panel: %s', $object->getName()); return pht('Edit Panel: %s', $object->getName());
} }

View file

@ -277,10 +277,13 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
private function addPanelHeaderActions( private function addPanelHeaderActions(
PHUIHeaderView $header) { PHUIHeaderView $header) {
$panel = $this->getPanel();
$viewer = $this->getViewer();
$panel = $this->getPanel();
$dashboard_id = $this->getDashboardID(); $dashboard_id = $this->getDashboardID();
$actions = array();
if ($panel) { if ($panel) {
$panel_id = $panel->getID(); $panel_id = $panel->getID();
@ -290,12 +293,10 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
$edit_uri->replaceQueryParam('dashboardID', $dashboard_id); $edit_uri->replaceQueryParam('dashboardID', $dashboard_id);
} }
$action_edit = id(new PHUIIconView()) $actions[] = id(new PhabricatorActionView())
->setIcon('fa-pencil') ->setIcon('fa-pencil')
->setWorkflow(true) ->setName(pht('Edit Panel'))
->setHref((string)$edit_uri); ->setHref((string)$edit_uri);
$header->addActionItem($action_edit);
} }
if ($dashboard_id) { if ($dashboard_id) {
@ -305,14 +306,28 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
$remove_uri = id(new PhutilURI($remove_uri)) $remove_uri = id(new PhutilURI($remove_uri))
->replaceQueryParam('panelPHID', $panel_phid); ->replaceQueryParam('panelPHID', $panel_phid);
$action_remove = id(new PHUIIconView()) $actions[] = id(new PhabricatorActionView())
->setIcon('fa-trash-o') ->setIcon('fa-times')
->setHref((string)$remove_uri) ->setHref((string)$remove_uri)
->setName(pht('Remove Panel'))
->setWorkflow(true); ->setWorkflow(true);
$header->addActionItem($action_remove);
} }
$dropdown_menu = id(new PhabricatorActionListView())
->setViewer($viewer);
foreach ($actions as $action) {
$dropdown_menu->addAction($action);
}
$action_menu = id(new PHUIButtonView())
->setTag('a')
->setIcon('fa-cog')
->setText(pht('Manage Panel'))
->setDropdownMenu($dropdown_menu);
$header->addActionLink($action_menu);
return $header; return $header;
} }

View file

@ -54,7 +54,7 @@
} }
.grippable .aphront-multi-column-column .dashboard-box.phui-object-box:hover { .grippable .aphront-multi-column-column .dashboard-box.phui-object-box:hover {
box-shadow: {$dropshadow}; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.10);
} }
.grippable .aphront-multi-column-column .dashboard-box.phui-object-box:hover .grippable .aphront-multi-column-column .dashboard-box.phui-object-box:hover