Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15283760
D16459.id39589.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D16459.id39589.diff
View Options
diff --git a/src/applications/settings/panel/PhabricatorHomePreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorHomePreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorHomePreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorHomePreferencesSettingsPanel.php
@@ -67,7 +67,19 @@
unset($options['PhabricatorApplicationsApplication']);
if ($request->isFormPost()) {
- $pin = $request->getStr('pin');
+ $pins = $request->getArr('pin');
+ $phid = head($pins);
+ $app = id(new PhabricatorApplicationQuery())
+ ->setViewer($viewer)
+ ->withPHIDs(array($phid))
+ ->executeOne();
+ if ($app) {
+ $pin = get_class($app);
+ } else {
+ // This likely means the user submitted an empty form
+ // which will cause nothing to happen.
+ $pin = '';
+ }
if (isset($options[$pin]) && !in_array($pin, $pinned)) {
$pinned[] = $pin;
@@ -78,18 +90,18 @@
}
}
- $options_control = id(new AphrontFormSelectControl())
+ $options_control = id(new AphrontFormTokenizerControl())
->setName('pin')
->setLabel(pht('Application'))
- ->setOptions($options)
- ->setDisabledOptions(array_keys($app_list));
+ ->setDatasource(new PhabricatorApplicationDatasource())
+ ->setLimit(1);
$form = id(new AphrontFormView())
->setViewer($viewer)
->addHiddenInput('add', 'true')
->appendRemarkupInstructions(
pht('Choose an application to pin to your home page.'))
- ->appendChild($options_control);
+ ->appendControl($options_control);
return $this->newDialog()
->setWidth(AphrontDialogView::WIDTH_FORM)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 5, 8:26 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7224206
Default Alt Text
D16459.id39589.diff (1 KB)
Attached To
Mode
D16459: Converted the pinned applications selector to a typeahead.
Attached
Detach File
Event Timeline
Log In to Comment