mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-20 13:52:40 +01:00
Make "New Conversation" a workflow dialog in Conpherence
Summary: Ref T2416. My actual goal here is to stop having two places where we call the "load and display a list of threads" logic, but this is generally weird and no longer necessary with drag-and-drop-to-upload-remarkup. Test Plan: {F37992} Reviewers: btrahan, chad Reviewed By: chad CC: aran Maniphest Tasks: T2416 Differential Revision: https://secure.phabricator.com/D5475
This commit is contained in:
parent
89b75c72fd
commit
e9fe1f4beb
2 changed files with 24 additions and 53 deletions
|
@ -105,10 +105,14 @@ abstract class ConpherenceController extends PhabricatorController {
|
|||
$nav->setMenuID('conpherence-menu');
|
||||
|
||||
if (!$for_application) {
|
||||
$nav->addButton(
|
||||
'new',
|
||||
pht('New Conversation'),
|
||||
$this->getApplicationURI('new/'));
|
||||
$nav->addMenuItem(
|
||||
id(new PhabricatorMenuItemView())
|
||||
->setName(pht('New Conversation'))
|
||||
->setWorkflow(true)
|
||||
->setKey('new')
|
||||
->setHref($this->getApplicationURI('new/'))
|
||||
->setType(PhabricatorMenuItemView::TYPE_BUTTON));
|
||||
|
||||
$nav->addLabel(pht('Unread'));
|
||||
$nav = $this->addConpherencesToNav(
|
||||
$unread_conpherences,
|
||||
|
|
|
@ -121,25 +121,22 @@ final class ConpherenceNewController extends ConpherenceController {
|
|||
|
||||
$submit_uri = $this->getApplicationURI('new/');
|
||||
$cancel_uri = $this->getApplicationURI();
|
||||
if ($request->isAjax()) {
|
||||
// TODO - we can get a better cancel_uri once we get better at crazy
|
||||
// ajax jonx T2086
|
||||
if ($participant_prefill) {
|
||||
$handle = $handles[$participant_prefill];
|
||||
$cancel_uri = $handle->getURI();
|
||||
}
|
||||
$form = id(new AphrontDialogView())
|
||||
->setSubmitURI($submit_uri)
|
||||
->addSubmitButton()
|
||||
->setWidth(AphrontDialogView::WIDTH_FORM)
|
||||
->addCancelButton($cancel_uri);
|
||||
} else {
|
||||
$form = id(new AphrontFormView())
|
||||
->setID('conpherence-message-pane')
|
||||
->setAction($submit_uri);
|
||||
|
||||
// TODO - we can get a better cancel_uri once we get better at crazy
|
||||
// ajax jonx T2086
|
||||
if ($participant_prefill) {
|
||||
$handle = $handles[$participant_prefill];
|
||||
$cancel_uri = $handle->getURI();
|
||||
}
|
||||
|
||||
$form
|
||||
$dialog = id(new AphrontDialogView())
|
||||
->setWidth(AphrontDialogView::WIDTH_FORM)
|
||||
->setUser($user)
|
||||
->setTitle($title)
|
||||
->addCancelButton($cancel_uri)
|
||||
->addSubmitButton(pht('Create Conversation'));
|
||||
|
||||
$form = id(new AphrontFormLayoutView())
|
||||
->setUser($user)
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
|
@ -154,40 +151,10 @@ final class ConpherenceNewController extends ConpherenceController {
|
|||
->setName('message')
|
||||
->setValue($message)
|
||||
->setLabel(pht('Message'))
|
||||
->setPlaceHolder(pht('Drag and drop to include files...'))
|
||||
->setError($e_message));
|
||||
|
||||
if ($request->isAjax()) {
|
||||
$form->setTitle($title);
|
||||
return id(new AphrontDialogResponse())
|
||||
->setDialog($form);
|
||||
}
|
||||
$dialog->appendChild($form);
|
||||
|
||||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue(pht('Submit'))
|
||||
->addCancelButton($cancel_uri));
|
||||
|
||||
$this->loadStartingConpherences();
|
||||
$this->setSelectedConpherencePHID(null);
|
||||
$this->initJavelinBehaviors();
|
||||
$nav = $this->buildSideNavView('new');
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
->setHeader($title);
|
||||
|
||||
$nav->appendChild(
|
||||
array(
|
||||
$header,
|
||||
$error_view,
|
||||
$form,
|
||||
));
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
array(
|
||||
'title' => $title,
|
||||
'device' => true,
|
||||
));
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue