Page MenuHomePhabricator

D17355.diff
No OneTemporary

D17355.diff

diff --git a/src/applications/dashboard/customfield/PhabricatorDashboardPanelTabsCustomField.php b/src/applications/dashboard/customfield/PhabricatorDashboardPanelTabsCustomField.php
--- a/src/applications/dashboard/customfield/PhabricatorDashboardPanelTabsCustomField.php
+++ b/src/applications/dashboard/customfield/PhabricatorDashboardPanelTabsCustomField.php
@@ -15,7 +15,11 @@
$value = array();
$names = $request->getArr($this->getFieldKey().'_name');
- $panels = $request->getArr($this->getFieldKey().'_panelID');
+ $panel_ids = $request->getArr($this->getFieldKey().'_panelID');
+ $panels = array();
+ foreach ($panel_ids as $panel_id) {
+ $panels[] = $panel_id[0];
+ }
foreach ($names as $idx => $name) {
$panel_id = idx($panels, $idx);
if (strlen($name) && $panel_id) {
@@ -34,21 +38,6 @@
// when saving a tab panel that includes archied panels. This whole UI is
// hopefully temporary anyway.
- $panels = id(new PhabricatorDashboardPanelQuery())
- ->setViewer($this->getViewer())
- ->execute();
-
- $panel_map = array();
- foreach ($panels as $panel) {
- $panel_map[$panel->getID()] = pht(
- '%s %s',
- $panel->getMonogram(),
- $panel->getName());
- }
- $panel_map = array(
- '' => pht('(None)'),
- ) + $panel_map;
-
$value = $this->getFieldValue();
if (!is_array($value)) {
$value = array();
@@ -57,15 +46,22 @@
$out = array();
for ($ii = 1; $ii <= 6; $ii++) {
$tab = idx($value, ($ii - 1), array());
+ $panel = idx($tab, 'panelID', null);
+ $panel_id = array();
+ if ($panel) {
+ $panel_id[] = $panel;
+ }
$out[] = id(new AphrontFormTextControl())
->setName($this->getFieldKey().'_name[]')
->setValue(idx($tab, 'name'))
->setLabel(pht('Tab %d Name', $ii));
- $out[] = id(new AphrontFormSelectControl())
+ $out[] = id(new AphrontFormTokenizerControl())
+ ->setUser($this->getViewer())
+ ->setDatasource(new PhabricatorDashboardPanelDatasource())
->setName($this->getFieldKey().'_panelID[]')
- ->setValue(idx($tab, 'panelID'))
- ->setOptions($panel_map)
+ ->setValue($panel_id)
+ ->setLimit(1)
->setLabel(pht('Tab %d Panel', $ii));
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 10:51 AM (2 h, 57 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6774581
Default Alt Text
D17355.diff (2 KB)

Event Timeline