Update Conpherence to use EditEngine
Summary: Moves Conpherence to use EditEngine. This removes the "First Message" field, but I think that's ok until we have direct messaging of some sort, then maybe have built-ins cover that case. Test Plan: - Visit /new/ and /edit/ for creating new rooms. - Edit a room in full conpherence - Edit a room in durable column - grep for METADATA calls Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T11729 Differential Revision: https://secure.phabricator.com/D16677
This commit is contained in:
parent
d2baa88171
commit
d6bce34a5d
|
@ -10,7 +10,7 @@ return array(
|
||||||
'conpherence.pkg.css' => 'ff161f2d',
|
'conpherence.pkg.css' => 'ff161f2d',
|
||||||
'conpherence.pkg.js' => 'b5b51108',
|
'conpherence.pkg.js' => 'b5b51108',
|
||||||
'core.pkg.css' => '84ce260a',
|
'core.pkg.css' => '84ce260a',
|
||||||
'core.pkg.js' => 'fffe0122',
|
'core.pkg.js' => '2ff7879f',
|
||||||
'darkconsole.pkg.js' => '1f9a31bc',
|
'darkconsole.pkg.js' => '1f9a31bc',
|
||||||
'differential.pkg.css' => '90b30783',
|
'differential.pkg.css' => '90b30783',
|
||||||
'differential.pkg.js' => 'ddfeb49b',
|
'differential.pkg.js' => 'ddfeb49b',
|
||||||
|
@ -378,7 +378,7 @@ return array(
|
||||||
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
|
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
|
||||||
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '4d863052',
|
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '4d863052',
|
||||||
'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762',
|
'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '9bbf3762',
|
||||||
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'aa3bd034',
|
'rsrc/js/application/conpherence/behavior-durable-column.js' => '2ae077e1',
|
||||||
'rsrc/js/application/conpherence/behavior-menu.js' => 'c9b99b77',
|
'rsrc/js/application/conpherence/behavior-menu.js' => 'c9b99b77',
|
||||||
'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8',
|
'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8',
|
||||||
'rsrc/js/application/conpherence/behavior-pontificate.js' => '55616e04',
|
'rsrc/js/application/conpherence/behavior-pontificate.js' => '55616e04',
|
||||||
|
@ -639,7 +639,7 @@ return array(
|
||||||
'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc',
|
'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc',
|
||||||
'javelin-behavior-doorkeeper-tag' => 'e5822781',
|
'javelin-behavior-doorkeeper-tag' => 'e5822781',
|
||||||
'javelin-behavior-drydock-live-operation-status' => '901935ef',
|
'javelin-behavior-drydock-live-operation-status' => '901935ef',
|
||||||
'javelin-behavior-durable-column' => 'aa3bd034',
|
'javelin-behavior-durable-column' => '2ae077e1',
|
||||||
'javelin-behavior-editengine-reorder-configs' => 'd7a74243',
|
'javelin-behavior-editengine-reorder-configs' => 'd7a74243',
|
||||||
'javelin-behavior-editengine-reorder-fields' => 'b59e1e96',
|
'javelin-behavior-editengine-reorder-fields' => 'b59e1e96',
|
||||||
'javelin-behavior-error-log' => '6882e80a',
|
'javelin-behavior-error-log' => '6882e80a',
|
||||||
|
@ -1095,6 +1095,16 @@ return array(
|
||||||
'javelin-install',
|
'javelin-install',
|
||||||
'javelin-util',
|
'javelin-util',
|
||||||
),
|
),
|
||||||
|
'2ae077e1' => array(
|
||||||
|
'javelin-behavior',
|
||||||
|
'javelin-dom',
|
||||||
|
'javelin-stratcom',
|
||||||
|
'javelin-behavior-device',
|
||||||
|
'javelin-scrollbar',
|
||||||
|
'javelin-quicksand',
|
||||||
|
'phabricator-keyboard-shortcut',
|
||||||
|
'conpherence-thread-manager',
|
||||||
|
),
|
||||||
'2b8de964' => array(
|
'2b8de964' => array(
|
||||||
'javelin-install',
|
'javelin-install',
|
||||||
'javelin-util',
|
'javelin-util',
|
||||||
|
@ -1793,16 +1803,6 @@ return array(
|
||||||
'javelin-util',
|
'javelin-util',
|
||||||
'phabricator-prefab',
|
'phabricator-prefab',
|
||||||
),
|
),
|
||||||
'aa3bd034' => array(
|
|
||||||
'javelin-behavior',
|
|
||||||
'javelin-dom',
|
|
||||||
'javelin-stratcom',
|
|
||||||
'javelin-behavior-device',
|
|
||||||
'javelin-scrollbar',
|
|
||||||
'javelin-quicksand',
|
|
||||||
'phabricator-keyboard-shortcut',
|
|
||||||
'conpherence-thread-manager',
|
|
||||||
),
|
|
||||||
'ab2f381b' => array(
|
'ab2f381b' => array(
|
||||||
'javelin-request',
|
'javelin-request',
|
||||||
'javelin-behavior',
|
'javelin-behavior',
|
||||||
|
|
|
@ -292,13 +292,13 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceCreateThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php',
|
'ConpherenceCreateThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php',
|
||||||
'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php',
|
'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php',
|
||||||
'ConpherenceDurableColumnView' => 'applications/conpherence/view/ConpherenceDurableColumnView.php',
|
'ConpherenceDurableColumnView' => 'applications/conpherence/view/ConpherenceDurableColumnView.php',
|
||||||
|
'ConpherenceEditEngine' => 'applications/conpherence/editor/ConpherenceEditEngine.php',
|
||||||
'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php',
|
'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php',
|
||||||
'ConpherenceFulltextQuery' => 'applications/conpherence/query/ConpherenceFulltextQuery.php',
|
'ConpherenceFulltextQuery' => 'applications/conpherence/query/ConpherenceFulltextQuery.php',
|
||||||
'ConpherenceIndex' => 'applications/conpherence/storage/ConpherenceIndex.php',
|
'ConpherenceIndex' => 'applications/conpherence/storage/ConpherenceIndex.php',
|
||||||
'ConpherenceLayoutView' => 'applications/conpherence/view/ConpherenceLayoutView.php',
|
'ConpherenceLayoutView' => 'applications/conpherence/view/ConpherenceLayoutView.php',
|
||||||
'ConpherenceListController' => 'applications/conpherence/controller/ConpherenceListController.php',
|
'ConpherenceListController' => 'applications/conpherence/controller/ConpherenceListController.php',
|
||||||
'ConpherenceMenuItemView' => 'applications/conpherence/view/ConpherenceMenuItemView.php',
|
'ConpherenceMenuItemView' => 'applications/conpherence/view/ConpherenceMenuItemView.php',
|
||||||
'ConpherenceNewRoomController' => 'applications/conpherence/controller/ConpherenceNewRoomController.php',
|
|
||||||
'ConpherenceNotificationPanelController' => 'applications/conpherence/controller/ConpherenceNotificationPanelController.php',
|
'ConpherenceNotificationPanelController' => 'applications/conpherence/controller/ConpherenceNotificationPanelController.php',
|
||||||
'ConpherenceParticipant' => 'applications/conpherence/storage/ConpherenceParticipant.php',
|
'ConpherenceParticipant' => 'applications/conpherence/storage/ConpherenceParticipant.php',
|
||||||
'ConpherenceParticipantController' => 'applications/conpherence/controller/ConpherenceParticipantController.php',
|
'ConpherenceParticipantController' => 'applications/conpherence/controller/ConpherenceParticipantController.php',
|
||||||
|
@ -308,6 +308,7 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceQueryThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php',
|
'ConpherenceQueryThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php',
|
||||||
'ConpherenceQueryTransactionConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php',
|
'ConpherenceQueryTransactionConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php',
|
||||||
'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php',
|
'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php',
|
||||||
|
'ConpherenceRoomEditController' => 'applications/conpherence/controller/ConpherenceRoomEditController.php',
|
||||||
'ConpherenceRoomListController' => 'applications/conpherence/controller/ConpherenceRoomListController.php',
|
'ConpherenceRoomListController' => 'applications/conpherence/controller/ConpherenceRoomListController.php',
|
||||||
'ConpherenceRoomPictureController' => 'applications/conpherence/controller/ConpherenceRoomPictureController.php',
|
'ConpherenceRoomPictureController' => 'applications/conpherence/controller/ConpherenceRoomPictureController.php',
|
||||||
'ConpherenceRoomPreferencesController' => 'applications/conpherence/controller/ConpherenceRoomPreferencesController.php',
|
'ConpherenceRoomPreferencesController' => 'applications/conpherence/controller/ConpherenceRoomPreferencesController.php',
|
||||||
|
@ -5074,13 +5075,13 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceCreateThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
|
'ConpherenceCreateThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
|
||||||
'ConpherenceDAO' => 'PhabricatorLiskDAO',
|
'ConpherenceDAO' => 'PhabricatorLiskDAO',
|
||||||
'ConpherenceDurableColumnView' => 'AphrontTagView',
|
'ConpherenceDurableColumnView' => 'AphrontTagView',
|
||||||
|
'ConpherenceEditEngine' => 'PhabricatorEditEngine',
|
||||||
'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor',
|
'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||||
'ConpherenceFulltextQuery' => 'PhabricatorOffsetPagedQuery',
|
'ConpherenceFulltextQuery' => 'PhabricatorOffsetPagedQuery',
|
||||||
'ConpherenceIndex' => 'ConpherenceDAO',
|
'ConpherenceIndex' => 'ConpherenceDAO',
|
||||||
'ConpherenceLayoutView' => 'AphrontTagView',
|
'ConpherenceLayoutView' => 'AphrontTagView',
|
||||||
'ConpherenceListController' => 'ConpherenceController',
|
'ConpherenceListController' => 'ConpherenceController',
|
||||||
'ConpherenceMenuItemView' => 'AphrontTagView',
|
'ConpherenceMenuItemView' => 'AphrontTagView',
|
||||||
'ConpherenceNewRoomController' => 'ConpherenceController',
|
|
||||||
'ConpherenceNotificationPanelController' => 'ConpherenceController',
|
'ConpherenceNotificationPanelController' => 'ConpherenceController',
|
||||||
'ConpherenceParticipant' => 'ConpherenceDAO',
|
'ConpherenceParticipant' => 'ConpherenceDAO',
|
||||||
'ConpherenceParticipantController' => 'ConpherenceController',
|
'ConpherenceParticipantController' => 'ConpherenceController',
|
||||||
|
@ -5090,6 +5091,7 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceQueryThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
|
'ConpherenceQueryThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
|
||||||
'ConpherenceQueryTransactionConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
|
'ConpherenceQueryTransactionConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
|
||||||
'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
|
'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
|
||||||
|
'ConpherenceRoomEditController' => 'ConpherenceController',
|
||||||
'ConpherenceRoomListController' => 'ConpherenceController',
|
'ConpherenceRoomListController' => 'ConpherenceController',
|
||||||
'ConpherenceRoomPictureController' => 'ConpherenceController',
|
'ConpherenceRoomPictureController' => 'ConpherenceController',
|
||||||
'ConpherenceRoomPreferencesController' => 'ConpherenceController',
|
'ConpherenceRoomPreferencesController' => 'ConpherenceController',
|
||||||
|
|
|
@ -45,8 +45,10 @@ final class PhabricatorConpherenceApplication extends PhabricatorApplication {
|
||||||
=> 'ConpherenceViewController',
|
=> 'ConpherenceViewController',
|
||||||
'columnview/'
|
'columnview/'
|
||||||
=> 'ConpherenceColumnViewController',
|
=> 'ConpherenceColumnViewController',
|
||||||
'new/'
|
$this->getEditRoutePattern('new/')
|
||||||
=> 'ConpherenceNewRoomController',
|
=> 'ConpherenceRoomEditController',
|
||||||
|
$this->getEditRoutePattern('edit/')
|
||||||
|
=> 'ConpherenceRoomEditController',
|
||||||
'picture/(?P<id>[1-9]\d*)/'
|
'picture/(?P<id>[1-9]\d*)/'
|
||||||
=> 'ConpherenceRoomPictureController',
|
=> 'ConpherenceRoomPictureController',
|
||||||
'search/(?:query/(?P<queryKey>[^/]+)/)?'
|
'search/(?:query/(?P<queryKey>[^/]+)/)?'
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
final class ConpherenceUpdateActions extends ConpherenceConstants {
|
final class ConpherenceUpdateActions extends ConpherenceConstants {
|
||||||
|
|
||||||
const METADATA = 'metadata';
|
|
||||||
const MESSAGE = 'message';
|
const MESSAGE = 'message';
|
||||||
const DRAFT = 'draft';
|
const DRAFT = 'draft';
|
||||||
const JOIN_ROOM = 'join_room';
|
const JOIN_ROOM = 'join_room';
|
||||||
|
|
|
@ -91,7 +91,8 @@ abstract class ConpherenceController extends PhabricatorController {
|
||||||
|
|
||||||
$header->addActionItem(
|
$header->addActionItem(
|
||||||
id(new PHUIIconCircleView())
|
id(new PHUIIconCircleView())
|
||||||
->setHref($this->getApplicationURI("update/{$id}/"))
|
->setHref(
|
||||||
|
$this->getApplicationURI('edit/'.$conpherence->getID()).'/')
|
||||||
->setIcon('fa-pencil')
|
->setIcon('fa-pencil')
|
||||||
->addClass('hide-on-device')
|
->addClass('hide-on-device')
|
||||||
->setColor('violet')
|
->setColor('violet')
|
||||||
|
|
|
@ -1,117 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class ConpherenceNewRoomController extends ConpherenceController {
|
|
||||||
|
|
||||||
public function handleRequest(AphrontRequest $request) {
|
|
||||||
$user = $request->getUser();
|
|
||||||
|
|
||||||
$title = pht('New Room');
|
|
||||||
$e_title = true;
|
|
||||||
$validation_exception = null;
|
|
||||||
|
|
||||||
$conpherence = ConpherenceThread::initializeNewRoom($user);
|
|
||||||
$participants = array();
|
|
||||||
if ($request->isFormPost()) {
|
|
||||||
$editor = new ConpherenceEditor();
|
|
||||||
$xactions = array();
|
|
||||||
|
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
|
||||||
->setTransactionType(ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
|
|
||||||
->setNewValue($request->getStr('title'));
|
|
||||||
|
|
||||||
$participants = $request->getArr('participants');
|
|
||||||
$participants[] = $user->getPHID();
|
|
||||||
$participants = array_unique($participants);
|
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
|
||||||
->setTransactionType(
|
|
||||||
ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE)
|
|
||||||
->setNewValue(array('+' => $participants));
|
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
|
||||||
->setTransactionType(ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
|
|
||||||
->setNewValue($request->getStr('topic'));
|
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
|
||||||
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
|
|
||||||
->setNewValue($request->getStr('viewPolicy'));
|
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
|
||||||
->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)
|
|
||||||
->setNewValue($request->getStr('editPolicy'));
|
|
||||||
|
|
||||||
try {
|
|
||||||
$editor
|
|
||||||
->setContentSourceFromRequest($request)
|
|
||||||
->setContinueOnNoEffect(true)
|
|
||||||
->setActor($user)
|
|
||||||
->applyTransactions($conpherence, $xactions);
|
|
||||||
|
|
||||||
return id(new AphrontRedirectResponse())
|
|
||||||
->setURI('/'.$conpherence->getMonogram());
|
|
||||||
} catch (PhabricatorApplicationTransactionValidationException $ex) {
|
|
||||||
$validation_exception = $ex;
|
|
||||||
|
|
||||||
$e_title = $ex->getShortMessage(
|
|
||||||
ConpherenceThreadTitleTransaction::TRANSACTIONTYPE);
|
|
||||||
|
|
||||||
$conpherence->setViewPolicy($request->getStr('viewPolicy'));
|
|
||||||
$conpherence->setEditPolicy($request->getStr('editPolicy'));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($request->getStr('participant')) {
|
|
||||||
$participants[] = $request->getStr('participant');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$policies = id(new PhabricatorPolicyQuery())
|
|
||||||
->setViewer($user)
|
|
||||||
->setObject($conpherence)
|
|
||||||
->execute();
|
|
||||||
|
|
||||||
$submit_uri = $this->getApplicationURI('new/');
|
|
||||||
$cancel_uri = $this->getApplicationURI('search/');
|
|
||||||
|
|
||||||
$dialog = $this->newDialog()
|
|
||||||
->setWidth(AphrontDialogView::WIDTH_FORM)
|
|
||||||
->setValidationException($validation_exception)
|
|
||||||
->setUser($user)
|
|
||||||
->setTitle($title)
|
|
||||||
->addCancelButton($cancel_uri)
|
|
||||||
->addSubmitButton(pht('Create Room'));
|
|
||||||
|
|
||||||
$form = id(new PHUIFormLayoutView())
|
|
||||||
->setUser($user)
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormTextControl())
|
|
||||||
->setError($e_title)
|
|
||||||
->setLabel(pht('Name'))
|
|
||||||
->setName('title')
|
|
||||||
->setValue($request->getStr('title')))
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormTextControl())
|
|
||||||
->setLabel(pht('Topic'))
|
|
||||||
->setName('topic')
|
|
||||||
->setValue($request->getStr('topic')))
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormTokenizerControl())
|
|
||||||
->setName('participants')
|
|
||||||
->setUser($user)
|
|
||||||
->setDatasource(new PhabricatorPeopleDatasource())
|
|
||||||
->setValue($participants)
|
|
||||||
->setLabel(pht('Other Participants')))
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormPolicyControl())
|
|
||||||
->setName('viewPolicy')
|
|
||||||
->setPolicyObject($conpherence)
|
|
||||||
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
|
|
||||||
->setPolicies($policies))
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormPolicyControl())
|
|
||||||
->setName('editPolicy')
|
|
||||||
->setPolicyObject($conpherence)
|
|
||||||
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
|
|
||||||
->setPolicies($policies));
|
|
||||||
|
|
||||||
$dialog->appendChild($form);
|
|
||||||
|
|
||||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ConpherenceRoomEditController
|
||||||
|
extends ConpherenceController {
|
||||||
|
|
||||||
|
public function handleRequest(AphrontRequest $request) {
|
||||||
|
return id(new ConpherenceEditEngine())
|
||||||
|
->setController($this)
|
||||||
|
->buildResponse();
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,7 +12,7 @@ final class ConpherenceUpdateController
|
||||||
|
|
||||||
$need_participants = false;
|
$need_participants = false;
|
||||||
$needed_capabilities = array(PhabricatorPolicyCapability::CAN_VIEW);
|
$needed_capabilities = array(PhabricatorPolicyCapability::CAN_VIEW);
|
||||||
$action = $request->getStr('action', ConpherenceUpdateActions::METADATA);
|
$action = $request->getStr('action');
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case ConpherenceUpdateActions::REMOVE_PERSON:
|
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||||
$person_phid = $request->getStr('remove_person');
|
$person_phid = $request->getStr('remove_person');
|
||||||
|
@ -21,7 +21,6 @@ final class ConpherenceUpdateController
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ConpherenceUpdateActions::ADD_PERSON:
|
case ConpherenceUpdateActions::ADD_PERSON:
|
||||||
case ConpherenceUpdateActions::METADATA:
|
|
||||||
$needed_capabilities[] = PhabricatorPolicyCapability::CAN_EDIT;
|
$needed_capabilities[] = PhabricatorPolicyCapability::CAN_EDIT;
|
||||||
break;
|
break;
|
||||||
case ConpherenceUpdateActions::LOAD:
|
case ConpherenceUpdateActions::LOAD:
|
||||||
|
@ -110,35 +109,6 @@ final class ConpherenceUpdateController
|
||||||
$response_mode = 'go-home';
|
$response_mode = 'go-home';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ConpherenceUpdateActions::METADATA:
|
|
||||||
$title = $request->getStr('title');
|
|
||||||
$topic = $request->getStr('topic');
|
|
||||||
|
|
||||||
// all other metadata updates are continue requests
|
|
||||||
if (!$request->isContinueRequest()) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$title = $request->getStr('title');
|
|
||||||
$topic = $request->getStr('topic');
|
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
|
||||||
->setTransactionType(
|
|
||||||
ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
|
|
||||||
->setNewValue($title);
|
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
|
||||||
->setTransactionType(
|
|
||||||
ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
|
|
||||||
->setNewValue($topic);
|
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
|
||||||
->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY)
|
|
||||||
->setNewValue($request->getStr('viewPolicy'));
|
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
|
||||||
->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY)
|
|
||||||
->setNewValue($request->getStr('editPolicy'));
|
|
||||||
if (!$request->getExists('force_ajax')) {
|
|
||||||
$response_mode = 'redirect';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ConpherenceUpdateActions::LOAD:
|
case ConpherenceUpdateActions::LOAD:
|
||||||
$updated = false;
|
$updated = false;
|
||||||
$response_mode = 'ajax';
|
$response_mode = 'ajax';
|
||||||
|
@ -208,10 +178,6 @@ final class ConpherenceUpdateController
|
||||||
case ConpherenceUpdateActions::REMOVE_PERSON:
|
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||||
$dialog = $this->renderRemovePersonDialog($conpherence);
|
$dialog = $this->renderRemovePersonDialog($conpherence);
|
||||||
break;
|
break;
|
||||||
case ConpherenceUpdateActions::METADATA:
|
|
||||||
default:
|
|
||||||
$dialog = $this->renderMetadataDialog($conpherence, $error_view);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
@ -332,62 +298,6 @@ final class ConpherenceUpdateController
|
||||||
return $dialog;
|
return $dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderMetadataDialog(
|
|
||||||
ConpherenceThread $conpherence,
|
|
||||||
$error_view) {
|
|
||||||
|
|
||||||
$request = $this->getRequest();
|
|
||||||
$user = $request->getUser();
|
|
||||||
|
|
||||||
$title = pht('Update Room');
|
|
||||||
$form = id(new PHUIFormLayoutView())
|
|
||||||
->appendChild($error_view)
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormTextControl())
|
|
||||||
->setLabel(pht('Title'))
|
|
||||||
->setName('title')
|
|
||||||
->setValue($conpherence->getTitle()))
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormTextControl())
|
|
||||||
->setLabel(pht('Topic'))
|
|
||||||
->setName('topic')
|
|
||||||
->setValue($conpherence->getTopic()));
|
|
||||||
|
|
||||||
$policies = id(new PhabricatorPolicyQuery())
|
|
||||||
->setViewer($user)
|
|
||||||
->setObject($conpherence)
|
|
||||||
->execute();
|
|
||||||
|
|
||||||
$form
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormPolicyControl())
|
|
||||||
->setName('viewPolicy')
|
|
||||||
->setPolicyObject($conpherence)
|
|
||||||
->setCapability(PhabricatorPolicyCapability::CAN_VIEW)
|
|
||||||
->setPolicies($policies))
|
|
||||||
->appendChild(
|
|
||||||
id(new AphrontFormPolicyControl())
|
|
||||||
->setName('editPolicy')
|
|
||||||
->setPolicyObject($conpherence)
|
|
||||||
->setCapability(PhabricatorPolicyCapability::CAN_EDIT)
|
|
||||||
->setPolicies($policies));
|
|
||||||
|
|
||||||
$view = id(new AphrontDialogView())
|
|
||||||
->setTitle($title)
|
|
||||||
->addHiddenInput('action', 'metadata')
|
|
||||||
->addHiddenInput(
|
|
||||||
'latest_transaction_id',
|
|
||||||
$request->getInt('latest_transaction_id'))
|
|
||||||
->addHiddenInput('__continue__', true)
|
|
||||||
->appendChild($form);
|
|
||||||
|
|
||||||
if ($request->getExists('force_ajax')) {
|
|
||||||
$view->addHiddenInput('force_ajax', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $view;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function loadAndRenderUpdates(
|
private function loadAndRenderUpdates(
|
||||||
$action,
|
$action,
|
||||||
$conpherence_id,
|
$conpherence_id,
|
||||||
|
@ -395,7 +305,6 @@ final class ConpherenceUpdateController
|
||||||
|
|
||||||
$need_transactions = false;
|
$need_transactions = false;
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case ConpherenceUpdateActions::METADATA:
|
|
||||||
case ConpherenceUpdateActions::LOAD:
|
case ConpherenceUpdateActions::LOAD:
|
||||||
$need_transactions = true;
|
$need_transactions = true;
|
||||||
break;
|
break;
|
||||||
|
@ -444,15 +353,6 @@ final class ConpherenceUpdateController
|
||||||
$header = null;
|
$header = null;
|
||||||
$people_widget = null;
|
$people_widget = null;
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case ConpherenceUpdateActions::METADATA:
|
|
||||||
$header = $this->buildHeaderPaneContent($conpherence);
|
|
||||||
$header = hsprintf('%s', $header);
|
|
||||||
$nav_item = id(new ConpherenceThreadListView())
|
|
||||||
->setUser($user)
|
|
||||||
->setBaseURI($this->getApplicationURI())
|
|
||||||
->renderThreadItem($conpherence);
|
|
||||||
$nav_item = hsprintf('%s', $nav_item);
|
|
||||||
break;
|
|
||||||
case ConpherenceUpdateActions::ADD_PERSON:
|
case ConpherenceUpdateActions::ADD_PERSON:
|
||||||
$people_widget = id(new ConpherenceParticipantView())
|
$people_widget = id(new ConpherenceParticipantView())
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
|
|
118
src/applications/conpherence/editor/ConpherenceEditEngine.php
Normal file
118
src/applications/conpherence/editor/ConpherenceEditEngine.php
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ConpherenceEditEngine
|
||||||
|
extends PhabricatorEditEngine {
|
||||||
|
|
||||||
|
const ENGINECONST = 'conpherence.thread';
|
||||||
|
|
||||||
|
public function getEngineName() {
|
||||||
|
return pht('Conpherence');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getEngineApplicationClass() {
|
||||||
|
return 'PhabricatorConpherenceApplication';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSummaryHeader() {
|
||||||
|
return pht('Configure Conpherence Forms');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSummaryText() {
|
||||||
|
return pht('Configure creation and editing forms in Conpherence.');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function newEditableObject() {
|
||||||
|
return ConpherenceThread::initializeNewRoom($this->getViewer());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function newObjectQuery() {
|
||||||
|
return new ConpherenceThreadQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectCreateTitleText($object) {
|
||||||
|
return pht('Create New Room');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectEditTitleText($object) {
|
||||||
|
return pht('Edit Room: %s', $object->getTitle());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectEditShortText($object) {
|
||||||
|
return $object->getTitle();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectCreateShortText() {
|
||||||
|
return pht('Create Room');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectName() {
|
||||||
|
return pht('Room');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectCreateCancelURI($object) {
|
||||||
|
return $this->getApplication()->getApplicationURI('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getEditorURI() {
|
||||||
|
return $this->getApplication()->getApplicationURI('edit/');
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getObjectViewURI($object) {
|
||||||
|
return $object->getURI();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isEngineConfigurable() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function buildCustomEditFields($object) {
|
||||||
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
|
if ($this->getIsCreate()) {
|
||||||
|
$participant_phids = array($viewer->getPHID());
|
||||||
|
$initial_phids = array();
|
||||||
|
} else {
|
||||||
|
$participant_phids = $object->getParticipantPHIDs();
|
||||||
|
$initial_phids = $participant_phids;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only show participants on create or conduit, not edit
|
||||||
|
$conduit_only = !$this->getIsCreate();
|
||||||
|
|
||||||
|
return array(
|
||||||
|
id(new PhabricatorTextEditField())
|
||||||
|
->setKey('name')
|
||||||
|
->setLabel(pht('Name'))
|
||||||
|
->setDescription(pht('Room name.'))
|
||||||
|
->setConduitTypeDescription(pht('New Room name.'))
|
||||||
|
->setIsRequired(true)
|
||||||
|
->setTransactionType(
|
||||||
|
ConpherenceThreadTitleTransaction::TRANSACTIONTYPE)
|
||||||
|
->setValue($object->getTitle()),
|
||||||
|
|
||||||
|
id(new PhabricatorTextEditField())
|
||||||
|
->setKey('topic')
|
||||||
|
->setLabel(pht('Topic'))
|
||||||
|
->setDescription(pht('Room topic.'))
|
||||||
|
->setConduitTypeDescription(pht('New Room topic.'))
|
||||||
|
->setTransactionType(
|
||||||
|
ConpherenceThreadTopicTransaction::TRANSACTIONTYPE)
|
||||||
|
->setValue($object->getTopic()),
|
||||||
|
|
||||||
|
id(new PhabricatorUsersEditField())
|
||||||
|
->setKey('participants')
|
||||||
|
->setValue($participant_phids)
|
||||||
|
->setInitialValue($initial_phids)
|
||||||
|
->setIsConduitOnly($conduit_only)
|
||||||
|
->setAliases(array('users', 'members', 'participants', 'userPHID'))
|
||||||
|
->setDescription(pht('Room participants.'))
|
||||||
|
->setUseEdgeTransactions(true)
|
||||||
|
->setConduitTypeDescription(pht('New Room participants.'))
|
||||||
|
->setTransactionType(
|
||||||
|
ConpherenceThreadParticipantsTransaction::TRANSACTIONTYPE)
|
||||||
|
->setLabel(pht('Initial Participants')),
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -363,9 +363,9 @@ final class ConpherenceDurableColumnView extends AphrontTagView {
|
||||||
$actions[] = array(
|
$actions[] = array(
|
||||||
'name' => pht('Edit Room'),
|
'name' => pht('Edit Room'),
|
||||||
'disabled' => !$can_edit,
|
'disabled' => !$can_edit,
|
||||||
'href' => '/conpherence/update/'.$conpherence->getID().'/?nopic',
|
'href' => '/conpherence/edit/'.$conpherence->getID().'/',
|
||||||
'icon' => 'fa-pencil',
|
'icon' => 'fa-pencil',
|
||||||
'key' => ConpherenceUpdateActions::METADATA,
|
'key' => 'go_edit',
|
||||||
);
|
);
|
||||||
$actions[] = array(
|
$actions[] = array(
|
||||||
'name' => pht('View in Conpherence'),
|
'name' => pht('View in Conpherence'),
|
||||||
|
|
|
@ -117,7 +117,7 @@ final class ConpherenceThreadListView extends AphrontView {
|
||||||
$new_icon = id(new PHUIIconView())
|
$new_icon = id(new PHUIIconView())
|
||||||
->setIcon('fa-plus-square')
|
->setIcon('fa-plus-square')
|
||||||
->addSigil('has-tooltip')
|
->addSigil('has-tooltip')
|
||||||
->setHref('/conpherence/new/')
|
->setHref('/conpherence/edit/')
|
||||||
->setWorkflow(true)
|
->setWorkflow(true)
|
||||||
->setMetaData(array(
|
->setMetaData(array(
|
||||||
'tip' => pht('New Room'),
|
'tip' => pht('New Room'),
|
||||||
|
|
|
@ -177,7 +177,7 @@ JX.behavior('durable-column', function(config, statics) {
|
||||||
var params = null;
|
var params = null;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'metadata':
|
case 'go_edit':
|
||||||
threadManager.runUpdateWorkflowFromLink(
|
threadManager.runUpdateWorkflowFromLink(
|
||||||
link,
|
link,
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue