From 1ad369b3065c9aa47cbf43fac42972c8269b9c4e Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sun, 30 Jul 2017 11:56:27 -0700 Subject: [PATCH] Remove PHUIInfoPanelView Summary: We've never used this, and no current plans to. Test Plan: grep for use cases. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D18298 --- resources/celerity/map.php | 2 - src/__phutil_library_map__.php | 4 - .../examples/PHUIInfoPanelExample.php | 138 ------------------ src/view/phui/PHUIInfoPanelView.php | 120 --------------- webroot/rsrc/css/phui/phui-info-panel.css | 50 ------- 5 files changed, 314 deletions(-) delete mode 100644 src/applications/uiexample/examples/PHUIInfoPanelExample.php delete mode 100644 src/view/phui/PHUIInfoPanelView.php delete mode 100644 webroot/rsrc/css/phui/phui-info-panel.css diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 86c6567f0e..88f2db1eec 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -163,7 +163,6 @@ return array( 'rsrc/css/phui/phui-icon-set-selector.css' => '87db8fee', 'rsrc/css/phui/phui-icon.css' => '5c4a5de6', 'rsrc/css/phui/phui-image-mask.css' => 'a8498f9c', - 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 'rsrc/css/phui/phui-info-view.css' => 'e1b4ec37', 'rsrc/css/phui/phui-invisible-character-view.css' => '6993d9f0', 'rsrc/css/phui/phui-left-right.css' => 'f60c67e7', @@ -852,7 +851,6 @@ return array( 'phui-icon-set-selector-css' => '87db8fee', 'phui-icon-view-css' => '5c4a5de6', 'phui-image-mask-css' => 'a8498f9c', - 'phui-info-panel-css' => '27ea50a1', 'phui-info-view-css' => 'e1b4ec37', 'phui-inline-comment-view-css' => '65ae3bc2', 'phui-invisible-character-view-css' => '6993d9f0', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 1527091575..4488bacd9a 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1770,8 +1770,6 @@ phutil_register_library_map(array( 'PHUIImageMaskExample' => 'applications/uiexample/examples/PHUIImageMaskExample.php', 'PHUIImageMaskView' => 'view/phui/PHUIImageMaskView.php', 'PHUIInfoExample' => 'applications/uiexample/examples/PHUIInfoExample.php', - 'PHUIInfoPanelExample' => 'applications/uiexample/examples/PHUIInfoPanelExample.php', - 'PHUIInfoPanelView' => 'view/phui/PHUIInfoPanelView.php', 'PHUIInfoView' => 'view/form/PHUIInfoView.php', 'PHUIInvisibleCharacterTestCase' => 'view/phui/__tests__/PHUIInvisibleCharacterTestCase.php', 'PHUIInvisibleCharacterView' => 'view/phui/PHUIInvisibleCharacterView.php', @@ -6928,8 +6926,6 @@ phutil_register_library_map(array( 'PHUIImageMaskExample' => 'PhabricatorUIExample', 'PHUIImageMaskView' => 'AphrontTagView', 'PHUIInfoExample' => 'PhabricatorUIExample', - 'PHUIInfoPanelExample' => 'PhabricatorUIExample', - 'PHUIInfoPanelView' => 'AphrontView', 'PHUIInfoView' => 'AphrontTagView', 'PHUIInvisibleCharacterTestCase' => 'PhabricatorTestCase', 'PHUIInvisibleCharacterView' => 'AphrontView', diff --git a/src/applications/uiexample/examples/PHUIInfoPanelExample.php b/src/applications/uiexample/examples/PHUIInfoPanelExample.php deleted file mode 100644 index 74ed18f37c..0000000000 --- a/src/applications/uiexample/examples/PHUIInfoPanelExample.php +++ /dev/null @@ -1,138 +0,0 @@ -setHeader(pht('Conpherence')); - - $header2 = id(new PHUIHeaderView()) - ->setHeader(pht('Diffusion')); - - $header3 = id(new PHUIHeaderView()) - ->setHeader(pht('Backend Ops Projects')); - - $header4 = id(new PHUIHeaderView()) - ->setHeader(pht('Revamp Liberty')) - ->setSubHeader(pht('For great justice')) - ->setImage( - celerity_get_resource_uri('/rsrc/image/people/washington.png')); - - $header5 = id(new PHUIHeaderView()) - ->setHeader(pht('Phacility Redesign')) - ->setSubHeader(pht('Move them pixels')) - ->setImage( - celerity_get_resource_uri('/rsrc/image/people/harding.png')); - - $header6 = id(new PHUIHeaderView()) - ->setHeader(pht('Python Phlux')) - ->setSubHeader(pht('No. Sleep. Till Brooklyn.')) - ->setImage( - celerity_get_resource_uri('/rsrc/image/people/taft.png')); - - $column1 = id(new PHUIInfoPanelView()) - ->setHeader($header1) - ->setColumns(3) - ->addInfoBlock(3, pht('Needs Triage')) - ->addInfoBlock(5, pht('Unbreak Now')) - ->addInfoBlock(0, pht('High')) - ->addInfoBlock(0, pht('Normal')) - ->addInfoBlock(12, pht('Low')) - ->addInfoBlock(123, pht('Wishlist')); - - $column2 = id(new PHUIInfoPanelView()) - ->setHeader($header2) - ->setColumns(3) - ->addInfoBlock(3, pht('Needs Triage')) - ->addInfoBlock(5, pht('Unbreak Now')) - ->addInfoBlock(0, pht('High')) - ->addInfoBlock(0, pht('Normal')) - ->addInfoBlock(12, pht('Low')) - ->addInfoBlock(123, pht('Wishlist')); - - $column3 = id(new PHUIInfoPanelView()) - ->setHeader($header3) - ->setColumns(3) - ->addInfoBlock(3, pht('Needs Triage')) - ->addInfoBlock(5, pht('Unbreak Now')) - ->addInfoBlock(0, pht('High')) - ->addInfoBlock(0, pht('Normal')) - ->addInfoBlock(12, pht('Low')) - ->addInfoBlock(123, pht('Wishlist')); - - $column4 = id(new PHUIInfoPanelView()) - ->setHeader($header4) - ->setColumns(3) - ->setProgress(90) - ->addInfoBlock(3, pht('Needs Triage')) - ->addInfoBlock(5, pht('Unbreak Now')) - ->addInfoBlock(0, pht('High')) - ->addInfoBlock(0, pht('Normal')) - ->addInfoBlock(0, pht('Wishlist')); - - $column5 = id(new PHUIInfoPanelView()) - ->setHeader($header5) - ->setColumns(2) - ->setProgress(25) - ->addInfoBlock(3, pht('Needs Triage')) - ->addInfoBlock(5, pht('Unbreak Now')) - ->addInfoBlock(0, pht('High')) - ->addInfoBlock(0, pht('Normal')); - - $column6 = id(new PHUIInfoPanelView()) - ->setHeader($header6) - ->setColumns(2) - ->setProgress(50) - ->addInfoBlock(3, pht('Needs Triage')) - ->addInfoBlock(5, pht('Unbreak Now')) - ->addInfoBlock(0, pht('High')) - ->addInfoBlock(0, pht('Normal')); - - $layout1 = id(new AphrontMultiColumnView()) - ->addColumn($column1) - ->addColumn($column2) - ->addColumn($column3) - ->setFluidLayout(true); - - $layout2 = id(new AphrontMultiColumnView()) - ->addColumn($column4) - ->addColumn($column5) - ->addColumn($column6) - ->setFluidLayout(true); - - - $head1 = id(new PHUIHeaderView()) - ->setHeader(pht('Flagged')); - - $head2 = id(new PHUIHeaderView()) - ->setHeader(pht('Sprints')); - - - $wrap1 = id(new PHUIBoxView()) - ->appendChild($layout1) - ->addMargin(PHUI::MARGIN_LARGE_BOTTOM); - - $wrap2 = id(new PHUIBoxView()) - ->appendChild($layout2) - ->addMargin(PHUI::MARGIN_LARGE_BOTTOM); - - - return phutil_tag( - 'div', - array(), - array( - $head1, - $wrap1, - $head2, - $wrap2, - )); - } -} diff --git a/src/view/phui/PHUIInfoPanelView.php b/src/view/phui/PHUIInfoPanelView.php deleted file mode 100644 index 91f9d2b8e4..0000000000 --- a/src/view/phui/PHUIInfoPanelView.php +++ /dev/null @@ -1,120 +0,0 @@ -header = $header; - return $this; - } - - public function setProgress($progress) { - $this->progress = $progress; - return $this; - } - - public function setColumns($columns) { - $this->columns = $columns; - return $this; - } - - public function addInfoblock($num, $text) { - $this->infoblock[] = array($num, $text); - return $this; - } - - public function render() { - require_celerity_resource('phui-info-panel-css'); - - $trs = array(); - $rows = ceil(count($this->infoblock) / $this->columns); - for ($i = 0; $i < $rows; $i++) { - $tds = array(); - $ii = 1; - foreach ($this->infoblock as $key => $cell) { - $tds[] = $this->renderCell($cell); - unset($this->infoblock[$key]); - $ii++; - if ($ii > $this->columns) { - break; - } - } - $trs[] = phutil_tag( - 'tr', - array( - 'class' => 'phui-info-panel-table-row', - ), - $tds); - } - - $table = phutil_tag( - 'table', - array( - 'class' => 'phui-info-panel-table', - ), - $trs); - - $table = id(new PHUIBoxView()) - ->addPadding(PHUI::PADDING_MEDIUM) - ->appendChild($table); - - $progress = null; - if ($this->progress) { - $progress = phutil_tag( - 'div', - array( - 'class' => 'phui-info-panel-progress', - 'style' => 'width: '.(int)$this->progress.'%;', - ), - null); - } - - $box = id(new PHUIObjectBoxView()) - ->setHeader($this->header) - ->appendChild($table) - ->appendChild($progress); - - return phutil_tag( - 'div', - array( - 'class' => 'phui-info-panel', - ), - $box); - } - - private function renderCell($cell) { - $number = phutil_tag( - 'div', - array( - 'class' => 'phui-info-panel-number', - ), - $cell[0]); - - $text = phutil_tag( - 'div', - array( - 'class' => 'phui-info-panel-text', - ), - $cell[1]); - - return phutil_tag( - 'td', - array( - 'class' => 'phui-info-panel-table-cell', - 'align' => 'center', - 'width' => floor(100 / $this->columns).'%', - ), - array( - $number, - $text, - )); - } -} diff --git a/webroot/rsrc/css/phui/phui-info-panel.css b/webroot/rsrc/css/phui/phui-info-panel.css deleted file mode 100644 index a182292a89..0000000000 --- a/webroot/rsrc/css/phui/phui-info-panel.css +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @provides phui-info-panel-css - */ - -.phui-info-panel .phui-object-box .phui-header-has-image { - padding: 2px 0 0 2px; -} - -.phui-info-panel .phui-object-box .phui-header-image { - margin: 0 8px 0 0; -} - -.phui-info-panel-table { - border-collapse: collapse; - border-style: hidden; - width: 100%; -} - -.phui-info-panel-table td, -.phui-info-panel-table th { - border: 1px solid {$thinblueborder}; -} - -.phui-info-panel-table-cell { - padding: 8px; -} - -.phui-info-panel-number, -.phui-info-panel-number a { - font-size: 30px; - font-weight: bold; - color: {$lightgreytext}; - -webkit-font-smoothing: antialiased; -} - -.phui-info-panel-text, -.phui-info-panel-text a { - color: {$lightgreytext}; -} - -.phui-info-panel-number a:hover, -.phui-info-panel-text a:hover { - color: {$greytext}; - text-decoration: none; -} - -.phui-info-panel-progress { - background: {$green}; - height: 6px; -}