mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +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');
|
$nav->setMenuID('conpherence-menu');
|
||||||
|
|
||||||
if (!$for_application) {
|
if (!$for_application) {
|
||||||
$nav->addButton(
|
$nav->addMenuItem(
|
||||||
'new',
|
id(new PhabricatorMenuItemView())
|
||||||
pht('New Conversation'),
|
->setName(pht('New Conversation'))
|
||||||
$this->getApplicationURI('new/'));
|
->setWorkflow(true)
|
||||||
|
->setKey('new')
|
||||||
|
->setHref($this->getApplicationURI('new/'))
|
||||||
|
->setType(PhabricatorMenuItemView::TYPE_BUTTON));
|
||||||
|
|
||||||
$nav->addLabel(pht('Unread'));
|
$nav->addLabel(pht('Unread'));
|
||||||
$nav = $this->addConpherencesToNav(
|
$nav = $this->addConpherencesToNav(
|
||||||
$unread_conpherences,
|
$unread_conpherences,
|
||||||
|
|
|
@ -121,25 +121,22 @@ final class ConpherenceNewController extends ConpherenceController {
|
||||||
|
|
||||||
$submit_uri = $this->getApplicationURI('new/');
|
$submit_uri = $this->getApplicationURI('new/');
|
||||||
$cancel_uri = $this->getApplicationURI();
|
$cancel_uri = $this->getApplicationURI();
|
||||||
if ($request->isAjax()) {
|
|
||||||
// TODO - we can get a better cancel_uri once we get better at crazy
|
// TODO - we can get a better cancel_uri once we get better at crazy
|
||||||
// ajax jonx T2086
|
// ajax jonx T2086
|
||||||
if ($participant_prefill) {
|
if ($participant_prefill) {
|
||||||
$handle = $handles[$participant_prefill];
|
$handle = $handles[$participant_prefill];
|
||||||
$cancel_uri = $handle->getURI();
|
$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);
|
|
||||||
}
|
|
||||||
|
|
||||||
$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)
|
->setUser($user)
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
|
@ -154,40 +151,10 @@ final class ConpherenceNewController extends ConpherenceController {
|
||||||
->setName('message')
|
->setName('message')
|
||||||
->setValue($message)
|
->setValue($message)
|
||||||
->setLabel(pht('Message'))
|
->setLabel(pht('Message'))
|
||||||
->setPlaceHolder(pht('Drag and drop to include files...'))
|
|
||||||
->setError($e_message));
|
->setError($e_message));
|
||||||
|
|
||||||
if ($request->isAjax()) {
|
$dialog->appendChild($form);
|
||||||
$form->setTitle($title);
|
|
||||||
return id(new AphrontDialogResponse())
|
|
||||||
->setDialog($form);
|
|
||||||
}
|
|
||||||
|
|
||||||
$form
|
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||||
->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,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue