@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Redesign] Add Show/Hide functions to PHUIObjectBoxView

Summary: Ref T8099, adds 'show/hide' functions to PHUIObjectBoxView, rolls them out in Application Search for trial.

Test Plan:
Test doing a couple searches in Projects, Audit, etc. Seems to work ok. Design might need more?

{F437207}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T8099

Differential Revision: https://secure.phabricator.com/D13027

+89 -29
+3 -3
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => '9d77cbde', 10 + 'core.pkg.css' => '247930e0', 11 11 'core.pkg.js' => '9db3e620', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => 'bb338e4b', ··· 140 140 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 141 141 'rsrc/css/phui/phui-info-view.css' => '33e54618', 142 142 'rsrc/css/phui/phui-list.css' => 'e448b6ba', 143 - 'rsrc/css/phui/phui-object-box.css' => 'e3441f90', 143 + 'rsrc/css/phui/phui-object-box.css' => 'fc4b0f93', 144 144 'rsrc/css/phui/phui-object-item-list-view.css' => 'fef025d8', 145 145 'rsrc/css/phui/phui-pinboard-view.css' => '55b27bc3', 146 146 'rsrc/css/phui/phui-property-list-view.css' => 'd2d143ea', ··· 776 776 'phui-info-view-css' => '33e54618', 777 777 'phui-inline-comment-view-css' => '2174771a', 778 778 'phui-list-view-css' => 'e448b6ba', 779 - 'phui-object-box-css' => 'e3441f90', 779 + 'phui-object-box-css' => 'fc4b0f93', 780 780 'phui-object-item-list-view-css' => 'fef025d8', 781 781 'phui-pinboard-view-css' => '55b27bc3', 782 782 'phui-property-list-view-css' => 'd2d143ea',
+10 -26
src/applications/search/controller/PhabricatorApplicationSearchController.php
··· 174 174 // we sort out T5307. 175 175 176 176 $form->appendChild($submit); 177 - $filter_view = id(new AphrontListFilterView())->appendChild($form); 178 - 179 - if ($run_query && $named_query) { 180 - if ($named_query->getIsBuiltin()) { 181 - $description = pht( 182 - 'Showing results for query "%s".', 183 - $named_query->getQueryName()); 184 - } else { 185 - $description = pht( 186 - 'Showing results for saved query "%s".', 187 - $named_query->getQueryName()); 188 - } 189 - 190 - $filter_view->setCollapsed( 191 - pht('Edit Query...'), 192 - pht('Hide Query'), 193 - $description, 194 - $this->getApplicationURI('query/advanced/?query='.$query_key)); 195 - } 196 177 197 178 if ($this->getPreface()) { 198 179 $nav->appendChild($this->getPreface()); 199 180 } 200 - 201 - $nav->appendChild($filter_view); 202 181 203 182 if ($named_query) { 204 183 $title = $named_query->getQueryName(); ··· 207 186 } 208 187 209 188 if ($run_query) { 210 - $nav->appendChild( 211 - $anchor = id(new PhabricatorAnchorView()) 212 - ->setAnchorName('R')); 189 + $anchor = id(new PhabricatorAnchorView()) 190 + ->setAnchorName('R'); 213 191 214 192 try { 215 193 $query = $engine->buildQueryFromSavedQuery($saved_query); ··· 234 212 } 235 213 236 214 $box = id(new PHUIObjectBoxView()) 237 - ->setHeaderText($title); 215 + ->setHeaderText($title) 216 + ->setAnchor($anchor); 217 + 218 + $box->setShowHide( 219 + pht('Edit Query'), 220 + pht('Hide Query'), 221 + $form, 222 + $this->getApplicationURI('query/advanced/?query='.$query_key)); 238 223 239 224 if ($list instanceof AphrontTableView) { 240 225 $box->setTable($list); ··· 246 231 // TODO: This is a bit hacky. 247 232 if ($list instanceof PHUIObjectItemListView) { 248 233 $list->setNoDataString(pht('No results found for this query.')); 249 - $list->setPager($pager); 250 234 } else { 251 235 if ($pager->willShowPagingControls()) { 252 236 $pager_box = id(new PHUIBoxView())
+70
src/view/phui/PHUIObjectBoxView.php
··· 18 18 private $objectList; 19 19 private $table; 20 20 private $collapsed = false; 21 + private $anchor; 22 + 23 + private $showAction; 24 + private $hideAction; 25 + private $showHideHref; 26 + private $showHideContent; 21 27 22 28 private $tabs = array(); 23 29 private $propertyLists = array(); ··· 162 168 return $this; 163 169 } 164 170 171 + public function setAnchor(PhabricatorAnchorView $anchor) { 172 + $this->anchor = $anchor; 173 + return $this; 174 + } 175 + 176 + public function setShowHide($show, $hide, $content, $href) { 177 + $this->showAction = $show; 178 + $this->hideAction = $hide; 179 + $this->showHideContent = $content; 180 + $this->showHideHref = $href; 181 + return $this; 182 + } 183 + 165 184 public function setValidationException( 166 185 PhabricatorApplicationTransactionValidationException $ex = null) { 167 186 $this->validationException = $ex; ··· 178 197 ->setHeader($this->headerText); 179 198 } 180 199 200 + $showhide = null; 201 + if ($this->showAction !== null) { 202 + Javelin::initBehavior('phabricator-reveal-content'); 203 + 204 + $hide_action_id = celerity_generate_unique_node_id(); 205 + $show_action_id = celerity_generate_unique_node_id(); 206 + $content_id = celerity_generate_unique_node_id(); 207 + 208 + $hide_action = id(new PHUIButtonView()) 209 + ->setTag('a') 210 + ->addSigil('reveal-content') 211 + ->setID($hide_action_id) 212 + ->setHref($this->showHideHref) 213 + ->setMetaData( 214 + array( 215 + 'hideIDs' => array($hide_action_id), 216 + 'showIDs' => array($content_id, $show_action_id), 217 + )) 218 + ->setText($this->showAction); 219 + 220 + $show_action = id(new PHUIButtonView()) 221 + ->setTag('a') 222 + ->addSigil('reveal-content') 223 + ->setStyle('display: none;') 224 + ->setHref('#') 225 + ->setID($show_action_id) 226 + ->setMetaData( 227 + array( 228 + 'hideIDs' => array($content_id, $show_action_id), 229 + 'showIDs' => array($hide_action_id), 230 + )) 231 + ->setText($this->hideAction); 232 + 233 + $header->addActionLink($hide_action); 234 + $header->addActionLink($show_action); 235 + 236 + $showhide = array( 237 + phutil_tag( 238 + 'div', 239 + array( 240 + 'class' => 'phui-object-box-hidden-content', 241 + 'id' => $content_id, 242 + 'style' => 'display: none;', 243 + ), 244 + $this->showHideContent), 245 + ); 246 + } 247 + 248 + 181 249 if ($this->actionListID) { 182 250 $icon_id = celerity_generate_unique_node_id(); 183 251 $icon = id(new PHUIIconView()) ··· 284 352 $content = id(new PHUIBoxView()) 285 353 ->appendChild( 286 354 array( 355 + $this->anchor, 287 356 $header, 288 357 $this->infoView, 289 358 $this->formErrors, ··· 292 361 $this->form, 293 362 $tabs, 294 363 $tab_lists, 364 + $showhide, 295 365 $property_lists, 296 366 $this->table, 297 367 $this->renderChildren(),
+6
webroot/rsrc/css/phui/phui-object-box.css
··· 90 90 border-bottom-color: {$lightred}; 91 91 } 92 92 93 + .phui-object-box-hidden-content { 94 + background: {$lightgreybackground}; 95 + border-bottom: 1px solid {$thinblueborder}; 96 + margin-bottom: 4px; 97 + } 98 + 93 99 /* - Double Object Box Override --------------------------------------------- */ 94 100 95 101 .phui-object-box .phui-object-box {