@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.

Hide Archived Panels from Dashboards

Summary:
In edit mode, Archived Panels are shown differently,
with content text in grey and with the usual red tag.

In view mode, Archived Panels are just not rendered.

This makes it easier to design Dashboards with individual
components that can be de-activated and re-activated on the fly.

Closes T15366.

{F325637}

Test Plan:
Have a Dashboard somewhere (e.g in your homepage).

Visit a Panel (W-ID) and Archive it.

See that now the Panel is not shown anymore on the Dashboard.

Edit the Dashboard and you see the Panel again as "Archived".

Anything around is just normal.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15366

Differential Revision: https://we.phorge.it/D25368

+36 -4
+3 -3
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => '76ed87e3', 11 11 'conpherence.pkg.js' => '020aebcf', 12 - 'core.pkg.css' => '67a5ecf3', 12 + 'core.pkg.css' => '1a5169fe', 13 13 'core.pkg.js' => '2eeda9e0', 14 14 'dark-console.pkg.js' => '187792c2', 15 15 'differential.pkg.css' => '525f9a1d', ··· 167 167 'rsrc/css/phui/phui-invisible-character-view.css' => 'c694c4a4', 168 168 'rsrc/css/phui/phui-left-right.css' => '68513c34', 169 169 'rsrc/css/phui/phui-lightbox.css' => '4ebf22da', 170 - 'rsrc/css/phui/phui-list.css' => '0c04affd', 170 + 'rsrc/css/phui/phui-list.css' => 'ccf73664', 171 171 'rsrc/css/phui/phui-object-box.css' => 'fdffed5c', 172 172 'rsrc/css/phui/phui-pager.css' => 'd022c7ad', 173 173 'rsrc/css/phui/phui-pinboard-view.css' => '1f08f5d8', ··· 864 864 'phui-invisible-character-view-css' => 'c694c4a4', 865 865 'phui-left-right-css' => '68513c34', 866 866 'phui-lightbox-css' => '4ebf22da', 867 - 'phui-list-view-css' => '0c04affd', 867 + 'phui-list-view-css' => 'ccf73664', 868 868 'phui-object-box-css' => 'fdffed5c', 869 869 'phui-oi-big-ui-css' => 'fa74cc35', 870 870 'phui-oi-color-css' => 'b517bfa0',
+15
src/applications/dashboard/engine/PhabricatorDashboardPanelRenderingEngine.php
··· 273 273 ->addClass('dashboard-box') 274 274 ->addSigil('dashboard-panel'); 275 275 276 + // Allow to style Archived Panels differently. 277 + if ($panel && $panel->getIsArchived()) { 278 + $box->addClass('dashboard-panel-disabled'); 279 + } 280 + 276 281 if ($this->getMovable()) { 277 282 $box->addSigil('panel-movable'); 278 283 } ··· 302 307 $header = id(new PHUIHeaderView()) 303 308 ->setHeader($header_text); 304 309 $header = $this->addPanelHeaderActions($header); 310 + 311 + // If the Panel is Archived, show in edit mode as such. 312 + if ($panel && $panel->getIsArchived()) { 313 + $header->setSubheader( 314 + id(new PHUITagView()) 315 + ->setType(PHUITagView::TYPE_SHADE) 316 + ->setColor(PHUITagView::COLOR_RED) 317 + ->setIcon('fa-ban') 318 + ->setName(pht('Archived'))); 319 + } 305 320 break; 306 321 case self::HEADER_MODE_NORMAL: 307 322 default:
+7 -1
src/applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php
··· 71 71 foreach ($column->getPanelRefs() as $panel_ref) { 72 72 $panel_phid = $panel_ref->getPanelPHID(); 73 73 74 + $panel = idx($panels, $panel_phid); 75 + 76 + // Do not render Archived panels in view mode. 77 + if ($panel && $panel->getIsArchived() && !$is_editable) { 78 + continue; 79 + } 80 + 74 81 $panel_engine = id(new PhabricatorDashboardPanelRenderingEngine()) 75 82 ->setViewer($viewer) 76 83 ->setEnableAsyncRendering(true) ··· 83 90 ->setMovable(true) 84 91 ->setPanelHandle($handles[$panel_phid]); 85 92 86 - $panel = idx($panels, $panel_phid); 87 93 if ($panel) { 88 94 $panel_engine->setPanel($panel); 89 95 }
+7
src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php
··· 19 19 return $this; 20 20 } 21 21 22 + /** 23 + * Whether to get only the Archived (`true`), only the not 24 + * Archived (`false`) or all (`null`). Default to `null` (no filter). 25 + * 26 + * @param null|bool $archived 27 + * @return self 28 + */ 22 29 public function withArchived($archived) { 23 30 $this->archived = $archived; 24 31 return $this;
+4
webroot/rsrc/css/phui/phui-list.css
··· 287 287 border-bottom: 1px solid {$thinblueborder}; 288 288 } 289 289 290 + .dashboard-panel-disabled { 291 + color: {$lightgreytext}; 292 + } 293 + 290 294 /* - Info Stack ------------------------------------------------------------ */ 291 295 292 296 .phui-info-view + .phui-list-view {