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

Use typeahead for tab panel selection

Summary: Fixes T11449. Feels.... magical? Probably a more efficient way of doing this, but only 6 tabs so...

Test Plan: Create a tab panel in old UI. Edit panel in new UI. Create a panel in new UI, edit panel in new UI.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11449

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

+15 -19
+15 -19
src/applications/dashboard/customfield/PhabricatorDashboardPanelTabsCustomField.php
··· 15 15 $value = array(); 16 16 17 17 $names = $request->getArr($this->getFieldKey().'_name'); 18 - $panels = $request->getArr($this->getFieldKey().'_panelID'); 18 + $panel_ids = $request->getArr($this->getFieldKey().'_panelID'); 19 + $panels = array(); 20 + foreach ($panel_ids as $panel_id) { 21 + $panels[] = $panel_id[0]; 22 + } 19 23 foreach ($names as $idx => $name) { 20 24 $panel_id = idx($panels, $idx); 21 25 if (strlen($name) && $panel_id) { ··· 34 38 // when saving a tab panel that includes archied panels. This whole UI is 35 39 // hopefully temporary anyway. 36 40 37 - $panels = id(new PhabricatorDashboardPanelQuery()) 38 - ->setViewer($this->getViewer()) 39 - ->execute(); 40 - 41 - $panel_map = array(); 42 - foreach ($panels as $panel) { 43 - $panel_map[$panel->getID()] = pht( 44 - '%s %s', 45 - $panel->getMonogram(), 46 - $panel->getName()); 47 - } 48 - $panel_map = array( 49 - '' => pht('(None)'), 50 - ) + $panel_map; 51 - 52 41 $value = $this->getFieldValue(); 53 42 if (!is_array($value)) { 54 43 $value = array(); ··· 57 46 $out = array(); 58 47 for ($ii = 1; $ii <= 6; $ii++) { 59 48 $tab = idx($value, ($ii - 1), array()); 49 + $panel = idx($tab, 'panelID', null); 50 + $panel_id = array(); 51 + if ($panel) { 52 + $panel_id[] = $panel; 53 + } 60 54 $out[] = id(new AphrontFormTextControl()) 61 55 ->setName($this->getFieldKey().'_name[]') 62 56 ->setValue(idx($tab, 'name')) 63 57 ->setLabel(pht('Tab %d Name', $ii)); 64 58 65 - $out[] = id(new AphrontFormSelectControl()) 59 + $out[] = id(new AphrontFormTokenizerControl()) 60 + ->setUser($this->getViewer()) 61 + ->setDatasource(new PhabricatorDashboardPanelDatasource()) 66 62 ->setName($this->getFieldKey().'_panelID[]') 67 - ->setValue(idx($tab, 'panelID')) 68 - ->setOptions($panel_map) 63 + ->setValue($panel_id) 64 + ->setLimit(1) 69 65 ->setLabel(pht('Tab %d Panel', $ii)); 70 66 } 71 67