1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 13:30:55 +01:00

Expand scope of addActionItem in PHUIHeaderView

Summary: Gives a bit more flexibility to add anything to the right side of PHUIHeaderView.

Test Plan: Test Maniphest, Workboards, Project Home, Differential. Grep for `addActionIcon` use. Fixes T10518

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T10518

Differential Revision: https://secure.phabricator.com/D15402
This commit is contained in:
Chad Little 2016-03-04 18:34:37 -08:00
parent 2b1ac4fcec
commit fec1a154d5
9 changed files with 29 additions and 29 deletions

View file

@ -7,7 +7,7 @@
*/ */
return array( return array(
'names' => array( 'names' => array(
'core.pkg.css' => 'db1cd0bd', 'core.pkg.css' => 'c0f196d2',
'core.pkg.js' => '7d8faf57', 'core.pkg.js' => '7d8faf57',
'darkconsole.pkg.js' => 'e7393ebb', 'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '2de124c9', 'differential.pkg.css' => '2de124c9',
@ -135,7 +135,7 @@ return array(
'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e', 'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e',
'rsrc/css/phui/phui-form.css' => 'aac1d51d', 'rsrc/css/phui/phui-form.css' => 'aac1d51d',
'rsrc/css/phui/phui-head-thing.css' => '11731da0', 'rsrc/css/phui/phui-head-thing.css' => '11731da0',
'rsrc/css/phui/phui-header-view.css' => 'bfb9fed3', 'rsrc/css/phui/phui-header-view.css' => '32e71367',
'rsrc/css/phui/phui-hovercard.css' => 'de1a2119', 'rsrc/css/phui/phui-hovercard.css' => 'de1a2119',
'rsrc/css/phui/phui-icon-set-selector.css' => '1ab67aad', 'rsrc/css/phui/phui-icon-set-selector.css' => '1ab67aad',
'rsrc/css/phui/phui-icon.css' => '3f33ab57', 'rsrc/css/phui/phui-icon.css' => '3f33ab57',
@ -155,7 +155,7 @@ return array(
'rsrc/css/phui/phui-status.css' => '37309046', 'rsrc/css/phui/phui-status.css' => '37309046',
'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2', 'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2',
'rsrc/css/phui/phui-timeline-view.css' => '2efceff8', 'rsrc/css/phui/phui-timeline-view.css' => '2efceff8',
'rsrc/css/phui/phui-two-column-view.css' => '097630a3', 'rsrc/css/phui/phui-two-column-view.css' => 'ecd7ec62',
'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7', 'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7',
'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647', 'rsrc/css/phui/workboards/phui-workboard.css' => 'e6d89647',
'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96', 'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96',
@ -820,7 +820,7 @@ return array(
'phui-form-css' => 'aac1d51d', 'phui-form-css' => 'aac1d51d',
'phui-form-view-css' => '4a1a0f5e', 'phui-form-view-css' => '4a1a0f5e',
'phui-head-thing-view-css' => '11731da0', 'phui-head-thing-view-css' => '11731da0',
'phui-header-view-css' => 'bfb9fed3', 'phui-header-view-css' => '32e71367',
'phui-hovercard' => '1bd28176', 'phui-hovercard' => '1bd28176',
'phui-hovercard-view-css' => 'de1a2119', 'phui-hovercard-view-css' => 'de1a2119',
'phui-icon-set-selector-css' => '1ab67aad', 'phui-icon-set-selector-css' => '1ab67aad',
@ -843,7 +843,7 @@ return array(
'phui-tag-view-css' => '6bbd83e2', 'phui-tag-view-css' => '6bbd83e2',
'phui-theme-css' => '027ba77e', 'phui-theme-css' => '027ba77e',
'phui-timeline-view-css' => '2efceff8', 'phui-timeline-view-css' => '2efceff8',
'phui-two-column-view-css' => '097630a3', 'phui-two-column-view-css' => 'ecd7ec62',
'phui-workboard-color-css' => 'ac6fe6a7', 'phui-workboard-color-css' => 'ac6fe6a7',
'phui-workboard-view-css' => 'e6d89647', 'phui-workboard-view-css' => 'e6d89647',
'phui-workcard-view-css' => '3646fb96', 'phui-workcard-view-css' => '3646fb96',

View file

@ -76,7 +76,7 @@ final class ConpherenceWidgetController extends ConpherenceController {
), ),
id(new PHUIHeaderView()) id(new PHUIHeaderView())
->setHeader($header) ->setHeader($header)
->addActionIcon($new_icon)); ->addActionItem($new_icon));
$user = $this->getRequest()->getUser(); $user = $this->getRequest()->getUser();
// now the widget bodies // now the widget bodies
$widgets[] = javelin_tag( $widgets[] = javelin_tag(

View file

@ -253,7 +253,7 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
->setIcon('fa-pencil') ->setIcon('fa-pencil')
->setWorkflow(true) ->setWorkflow(true)
->setHref((string)$edit_uri); ->setHref((string)$edit_uri);
$header->addActionIcon($action_edit); $header->addActionItem($action_edit);
if ($dashboard_id) { if ($dashboard_id) {
$uri = id(new PhutilURI( $uri = id(new PhutilURI(
@ -263,7 +263,7 @@ final class PhabricatorDashboardPanelRenderingEngine extends Phobject {
->setIcon('fa-trash-o') ->setIcon('fa-trash-o')
->setHref((string)$uri) ->setHref((string)$uri)
->setWorkflow(true); ->setWorkflow(true);
$header->addActionIcon($action_remove); $header->addActionItem($action_remove);
} }
return $header; return $header;
} }

View file

@ -119,7 +119,7 @@ final class PhabricatorDashboardQueryPanelType
$icon = id(new PHUIIconView()) $icon = id(new PHUIIconView())
->setIcon('fa-search') ->setIcon('fa-search')
->setHref($href); ->setHref($href);
$header->addActionIcon($icon); $header->addActionItem($icon);
return $header; return $header;
} }

View file

@ -322,7 +322,7 @@ final class PhabricatorHomeMainController extends PhabricatorHomeController {
->setHref($href); ->setHref($href);
$header = id(new PHUIHeaderView()) $header = id(new PHUIHeaderView())
->setHeader($title) ->setHeader($title)
->addActionIcon($icon); ->addActionItem($icon);
return $header; return $header;
} }

View file

@ -20,7 +20,7 @@ final class PHUIHeaderView extends AphrontTagView {
private $buttonBar = null; private $buttonBar = null;
private $policyObject; private $policyObject;
private $epoch; private $epoch;
private $actionIcons = array(); private $actionItems = array();
private $badges = array(); private $badges = array();
private $href; private $href;
private $actionList; private $actionList;
@ -105,8 +105,8 @@ final class PHUIHeaderView extends AphrontTagView {
return $this; return $this;
} }
public function addActionIcon(PHUIIconView $action) { public function addActionItem($action) {
$this->actionIcons[] = $action; $this->actionItems[] = $action;
return $this; return $this;
} }
@ -277,16 +277,16 @@ final class PHUIHeaderView extends AphrontTagView {
$this->buttonBar); $this->buttonBar);
} }
if ($this->actionIcons) { if ($this->actionItems) {
$action_list = array(); $action_list = array();
if ($this->actionIcons) { if ($this->actionItems) {
foreach ($this->actionIcons as $icon) { foreach ($this->actionItems as $item) {
$action_list[] = phutil_tag( $action_list[] = phutil_tag(
'li', 'li',
array( array(
'class' => 'phui-header-action-icon', 'class' => 'phui-header-action-item',
), ),
$icon); $item);
} }
} }
$right[] = phutil_tag( $right[] = phutil_tag(
@ -346,7 +346,7 @@ final class PHUIHeaderView extends AphrontTagView {
)); ));
} }
if ($this->properties || $this->policyObject) { if ($this->properties || $this->policyObject || $this->tags) {
$property_list = array(); $property_list = array();
foreach ($this->properties as $type => $property) { foreach ($this->properties as $type => $property) {
switch ($type) { switch ($type) {

View file

@ -83,16 +83,16 @@ final class PHUIWorkpanelView extends AphrontTagView {
->setHeader($this->header) ->setHeader($this->header)
->setSubheader($this->subheader); ->setSubheader($this->subheader);
if ($this->headerIcon) { foreach ($this->headerActions as $action) {
$header->setHeaderIcon($this->headerIcon); $header->addActionItem($action);
} }
if ($this->headerTag) { if ($this->headerTag) {
$header->addTag($this->headerTag); $header->addActionItem($this->headerTag);
} }
foreach ($this->headerActions as $action) { if ($this->headerIcon) {
$header->addActionIcon($action); $header->setHeaderIcon($this->headerIcon);
} }
$href = $this->getHref(); $href = $this->getHref();

View file

@ -197,8 +197,11 @@ body .phui-header-shell.phui-bleed-header
border-color: transparent; border-color: transparent;
} }
.phui-header-subheader .phui-tag-view,
.phui-header-subheader .phui-tag-type-shade .phui-tag-core { .phui-header-subheader .phui-tag-type-shade .phui-tag-core {
border: none; border: none;
font-weight: normal;
-webkit-font-smoothing: auto; -webkit-font-smoothing: auto;
} }
@ -246,12 +249,9 @@ body .phui-header-shell.phui-bleed-header
float: right; float: right;
} }
.phui-header-action-list li.phui-header-action-icon { .phui-header-action-list .phui-header-action-item .phui-icon-view {
height: 18px; height: 18px;
width: 16px; width: 16px;
}
.phui-header-action-list .phui-header-action-icon .phui-icon-view {
font-size: 16px; font-size: 16px;
line-height: 20px; line-height: 20px;
display: block; display: block;

View file

@ -103,7 +103,7 @@
margin: 0; margin: 0;
} }
.phui-main-column > .phui-timeline-view { .phui-main-column > .phui-timeline-view:first-child {
border-top: 1px solid {$thinblueborder}; border-top: 1px solid {$thinblueborder};
} }