1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 05:20:56 +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(
'names' => array(
'core.pkg.css' => 'db1cd0bd',
'core.pkg.css' => 'c0f196d2',
'core.pkg.js' => '7d8faf57',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '2de124c9',
@ -135,7 +135,7 @@ return array(
'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e',
'rsrc/css/phui/phui-form.css' => 'aac1d51d',
'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-icon-set-selector.css' => '1ab67aad',
'rsrc/css/phui/phui-icon.css' => '3f33ab57',
@ -155,7 +155,7 @@ return array(
'rsrc/css/phui/phui-status.css' => '37309046',
'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2',
'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.css' => 'e6d89647',
'rsrc/css/phui/workboards/phui-workcard.css' => '3646fb96',
@ -820,7 +820,7 @@ return array(
'phui-form-css' => 'aac1d51d',
'phui-form-view-css' => '4a1a0f5e',
'phui-head-thing-view-css' => '11731da0',
'phui-header-view-css' => 'bfb9fed3',
'phui-header-view-css' => '32e71367',
'phui-hovercard' => '1bd28176',
'phui-hovercard-view-css' => 'de1a2119',
'phui-icon-set-selector-css' => '1ab67aad',
@ -843,7 +843,7 @@ return array(
'phui-tag-view-css' => '6bbd83e2',
'phui-theme-css' => '027ba77e',
'phui-timeline-view-css' => '2efceff8',
'phui-two-column-view-css' => '097630a3',
'phui-two-column-view-css' => 'ecd7ec62',
'phui-workboard-color-css' => 'ac6fe6a7',
'phui-workboard-view-css' => 'e6d89647',
'phui-workcard-view-css' => '3646fb96',

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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