Page MenuHomePhabricator

D16677.id40242.diff
No OneTemporary

D16677.id40242.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -10,7 +10,7 @@
'conpherence.pkg.css' => 'f934296b',
'conpherence.pkg.js' => 'cbe4d9be',
'core.pkg.css' => 'b99bbf5e',
- 'core.pkg.js' => '30185d95',
+ 'core.pkg.js' => 'e83b851b',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => 'e1d704ce',
'differential.pkg.js' => '634399e9',
@@ -437,7 +437,7 @@
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '01774ab2',
'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '3e137827',
- 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'c5238acb',
+ 'rsrc/js/application/conpherence/behavior-durable-column.js' => '3288fd65',
'rsrc/js/application/conpherence/behavior-menu.js' => '07928ca3',
'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8',
'rsrc/js/application/conpherence/behavior-pontificate.js' => 'f2e58483',
@@ -695,7 +695,7 @@
'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc',
'javelin-behavior-doorkeeper-tag' => 'e5822781',
'javelin-behavior-drydock-live-operation-status' => '901935ef',
- 'javelin-behavior-durable-column' => 'c5238acb',
+ 'javelin-behavior-durable-column' => '3288fd65',
'javelin-behavior-editengine-reorder-configs' => 'd7a74243',
'javelin-behavior-editengine-reorder-fields' => 'b59e1e96',
'javelin-behavior-error-log' => '6882e80a',
@@ -1211,6 +1211,16 @@
'javelin-dom',
'javelin-workflow',
),
+ '3288fd65' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-behavior-device',
+ 'javelin-scrollbar',
+ 'javelin-quicksand',
+ 'phabricator-keyboard-shortcut',
+ 'conpherence-thread-manager',
+ ),
'3ab51e2c' => array(
'javelin-behavior',
'javelin-behavior-device',
@@ -1966,16 +1976,6 @@
'javelin-install',
'javelin-dom',
),
- 'c5238acb' => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-behavior-device',
- 'javelin-scrollbar',
- 'javelin-quicksand',
- 'phabricator-keyboard-shortcut',
- 'conpherence-thread-manager',
- ),
'c587b80f' => array(
'javelin-install',
),
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -290,13 +290,13 @@
'ConpherenceCreateThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceCreateThreadConduitAPIMethod.php',
'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php',
'ConpherenceDurableColumnView' => 'applications/conpherence/view/ConpherenceDurableColumnView.php',
+ 'ConpherenceEditEngine' => 'applications/conpherence/editor/ConpherenceEditEngine.php',
'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php',
'ConpherenceFulltextQuery' => 'applications/conpherence/query/ConpherenceFulltextQuery.php',
'ConpherenceIndex' => 'applications/conpherence/storage/ConpherenceIndex.php',
'ConpherenceLayoutView' => 'applications/conpherence/view/ConpherenceLayoutView.php',
'ConpherenceListController' => 'applications/conpherence/controller/ConpherenceListController.php',
'ConpherenceMenuItemView' => 'applications/conpherence/view/ConpherenceMenuItemView.php',
- 'ConpherenceNewRoomController' => 'applications/conpherence/controller/ConpherenceNewRoomController.php',
'ConpherenceNotificationPanelController' => 'applications/conpherence/controller/ConpherenceNotificationPanelController.php',
'ConpherenceParticipant' => 'applications/conpherence/storage/ConpherenceParticipant.php',
'ConpherenceParticipantController' => 'applications/conpherence/controller/ConpherenceParticipantController.php',
@@ -307,6 +307,7 @@
'ConpherenceQueryThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php',
'ConpherenceQueryTransactionConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php',
'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php',
+ 'ConpherenceRoomEditController' => 'applications/conpherence/controller/ConpherenceRoomEditController.php',
'ConpherenceRoomListController' => 'applications/conpherence/controller/ConpherenceRoomListController.php',
'ConpherenceRoomPictureController' => 'applications/conpherence/controller/ConpherenceRoomPictureController.php',
'ConpherenceRoomTestCase' => 'applications/conpherence/__tests__/ConpherenceRoomTestCase.php',
@@ -4829,13 +4830,13 @@
'ConpherenceCreateThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
'ConpherenceDAO' => 'PhabricatorLiskDAO',
'ConpherenceDurableColumnView' => 'AphrontTagView',
+ 'ConpherenceEditEngine' => 'PhabricatorEditEngine',
'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor',
'ConpherenceFulltextQuery' => 'PhabricatorOffsetPagedQuery',
'ConpherenceIndex' => 'ConpherenceDAO',
'ConpherenceLayoutView' => 'AphrontTagView',
'ConpherenceListController' => 'ConpherenceController',
'ConpherenceMenuItemView' => 'AphrontTagView',
- 'ConpherenceNewRoomController' => 'ConpherenceController',
'ConpherenceNotificationPanelController' => 'ConpherenceController',
'ConpherenceParticipant' => 'ConpherenceDAO',
'ConpherenceParticipantController' => 'ConpherenceController',
@@ -4846,6 +4847,7 @@
'ConpherenceQueryThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
'ConpherenceQueryTransactionConduitAPIMethod' => 'ConpherenceConduitAPIMethod',
'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
+ 'ConpherenceRoomEditController' => 'ConpherenceController',
'ConpherenceRoomListController' => 'ConpherenceController',
'ConpherenceRoomPictureController' => 'ConpherenceController',
'ConpherenceRoomTestCase' => 'ConpherenceTestCase',
diff --git a/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php b/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
--- a/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
+++ b/src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php
@@ -64,7 +64,9 @@
// test add by creator
$participant_phids[] = $friend_2->getPHID();
- $this->addParticipants($creator, $conpherence, array($friend_2->getPHID()));
+ $this->changeParticipants($creator,
+ $conpherence,
+ $participant_phids);
$this->assertEqual(
$participant_phids,
$conpherence->getRecentParticipantPHIDs());
@@ -77,10 +79,10 @@
$friend_1->getPHID(),
$friend_3->getPHID(), // new addition
);
- $this->addParticipants(
+ $this->changeParticipants(
$friend_2,
$conpherence,
- array($friend_3->getPHID()));
+ $participant_phids);
$this->assertEqual(
$participant_phids,
$conpherence->getRecentParticipantPHIDs());
@@ -99,17 +101,20 @@
$friend_3->getPHID() => $friend_3,
);
+ $old_participant_phids = array_keys($participant_map);
+
$conpherence = $this->createRoom(
$creator,
- array_keys($participant_map));
+ $old_participant_phids);
- foreach ($participant_map as $phid => $user) {
- $this->removeParticipants($user, $conpherence, array($phid));
- unset($participant_map[$phid]);
- $this->assertEqual(
- count($participant_map),
- count($conpherence->getParticipants()));
- }
+ unset($participant_map[$friend_1->getPHID()]);
+ unset($participant_map[$friend_2->getPHID()]);
+ $this->changeParticipants($creator,
+ $conpherence,
+ array_keys($participant_map));
+ $this->assertEqual(
+ count($participant_map),
+ count($conpherence->getParticipants()));
}
private function createRoom(
@@ -121,7 +126,7 @@
$xactions = array();
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
- ->setNewValue(array('+' => $participant_phids));
+ ->setNewValue($participant_phids);
$xactions[] = id(new ConpherenceTransaction())
->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
->setNewValue(pht('Test'));
diff --git a/src/applications/conpherence/__tests__/ConpherenceTestCase.php b/src/applications/conpherence/__tests__/ConpherenceTestCase.php
--- a/src/applications/conpherence/__tests__/ConpherenceTestCase.php
+++ b/src/applications/conpherence/__tests__/ConpherenceTestCase.php
@@ -2,7 +2,7 @@
abstract class ConpherenceTestCase extends PhabricatorTestCase {
- protected function addParticipants(
+ protected function changeParticipants(
PhabricatorUser $actor,
ConpherenceThread $conpherence,
array $participant_phids) {
@@ -10,7 +10,7 @@
$xactions = array(
id(new ConpherenceTransaction())
->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
- ->setNewValue(array('+' => $participant_phids)),
+ ->setNewValue($participant_phids),
);
$editor = id(new ConpherenceEditor())
->setActor($actor)
@@ -19,22 +19,6 @@
}
- protected function removeParticipants(
- PhabricatorUser $actor,
- ConpherenceThread $conpherence,
- array $participant_phids) {
-
- $xactions = array(
- id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
- ->setNewValue(array('-' => $participant_phids)),
- );
- $editor = id(new ConpherenceEditor())
- ->setActor($actor)
- ->setContentSource($this->newContentSource())
- ->applyTransactions($conpherence, $xactions);
- }
-
protected function addMessageWithFile(
PhabricatorUser $actor,
ConpherenceThread $conpherence) {
diff --git a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
--- a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
+++ b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
@@ -45,8 +45,10 @@
=> 'ConpherenceViewController',
'columnview/'
=> 'ConpherenceColumnViewController',
- 'new/'
- => 'ConpherenceNewRoomController',
+ $this->getEditRoutePattern('new/')
+ => 'ConpherenceRoomEditController',
+ $this->getEditRoutePattern('edit/')
+ => 'ConpherenceRoomEditController',
'picture/(?P<id>[1-9]\d*)/'
=> 'ConpherenceRoomPictureController',
'search/(?:query/(?P<queryKey>[^/]+)/)?'
diff --git a/src/applications/conpherence/constants/ConpherenceUpdateActions.php b/src/applications/conpherence/constants/ConpherenceUpdateActions.php
--- a/src/applications/conpherence/constants/ConpherenceUpdateActions.php
+++ b/src/applications/conpherence/constants/ConpherenceUpdateActions.php
@@ -2,7 +2,6 @@
final class ConpherenceUpdateActions extends ConpherenceConstants {
- const METADATA = 'metadata';
const MESSAGE = 'message';
const DRAFT = 'draft';
const JOIN_ROOM = 'join_room';
diff --git a/src/applications/conpherence/controller/ConpherenceController.php b/src/applications/conpherence/controller/ConpherenceController.php
--- a/src/applications/conpherence/controller/ConpherenceController.php
+++ b/src/applications/conpherence/controller/ConpherenceController.php
@@ -80,7 +80,7 @@
$header->addActionItem(
id(new PHUIIconCircleView())
->setHref(
- $this->getApplicationURI('update/'.$conpherence->getID()).'/')
+ $this->getApplicationURI('edit/'.$conpherence->getID()).'/')
->setIcon('fa-pencil')
->addClass('hide-on-device')
->setColor('violet')
diff --git a/src/applications/conpherence/controller/ConpherenceNewRoomController.php b/src/applications/conpherence/controller/ConpherenceNewRoomController.php
deleted file mode 100644
--- a/src/applications/conpherence/controller/ConpherenceNewRoomController.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-
-final class ConpherenceNewRoomController extends ConpherenceController {
-
- public function handleRequest(AphrontRequest $request) {
- $user = $request->getUser();
-
- $title = pht('New Room');
- $e_title = true;
- $v_message = null;
- $validation_exception = null;
-
- $conpherence = ConpherenceThread::initializeNewRoom($user);
- $participants = array();
- if ($request->isFormPost()) {
- $editor = new ConpherenceEditor();
- $xactions = array();
-
- $xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
- ->setNewValue($request->getStr('title'));
-
- $participants = $request->getArr('participants');
- $participants[] = $user->getPHID();
- $participants = array_unique($participants);
- $xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
- ->setNewValue(array('+' => $participants));
- $xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TOPIC)
- ->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'));
- $xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(PhabricatorTransactions::TYPE_JOIN_POLICY)
- ->setNewValue($request->getStr('joinPolicy'));
-
- $v_message = $request->getStr('message');
- if (strlen($v_message)) {
- $message_xactions = $editor->generateTransactionsFromText(
- $user,
- $conpherence,
- $v_message);
- $xactions = array_merge($xactions, $message_xactions);
- }
-
- 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(ConpherenceTransaction::TYPE_TITLE);
-
- $conpherence->setViewPolicy($request->getStr('viewPolicy'));
- $conpherence->setEditPolicy($request->getStr('editPolicy'));
- $conpherence->setJoinPolicy($request->getStr('joinPolicy'));
- }
- } 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))
- ->appendChild(
- id(new AphrontFormPolicyControl())
- ->setName('joinPolicy')
- ->setPolicyObject($conpherence)
- ->setCapability(PhabricatorPolicyCapability::CAN_JOIN)
- ->setPolicies($policies))
- ->appendChild(
- id(new PhabricatorRemarkupControl())
- ->setUser($user)
- ->setName('message')
- ->setLabel(pht('First Message'))
- ->setValue($v_message));
-
- $dialog->appendChild($form);
-
- return id(new AphrontDialogResponse())->setDialog($dialog);
- }
-
-}
diff --git a/src/applications/conpherence/controller/ConpherenceRoomEditController.php b/src/applications/conpherence/controller/ConpherenceRoomEditController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conpherence/controller/ConpherenceRoomEditController.php
@@ -0,0 +1,11 @@
+<?php
+
+final class ConpherenceRoomEditController
+ extends ConpherenceController {
+
+ public function handleRequest(AphrontRequest $request) {
+ return id(new ConpherenceEditEngine())
+ ->setController($this)
+ ->buildResponse();
+ }
+}
diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php
--- a/src/applications/conpherence/controller/ConpherenceUpdateController.php
+++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php
@@ -12,7 +12,7 @@
$need_participants = false;
$needed_capabilities = array(PhabricatorPolicyCapability::CAN_VIEW);
- $action = $request->getStr('action', ConpherenceUpdateActions::METADATA);
+ $action = $request->getStr('action');
switch ($action) {
case ConpherenceUpdateActions::REMOVE_PERSON:
$person_phid = $request->getStr('remove_person');
@@ -21,7 +21,6 @@
}
break;
case ConpherenceUpdateActions::ADD_PERSON:
- case ConpherenceUpdateActions::METADATA:
$needed_capabilities[] = PhabricatorPolicyCapability::CAN_EDIT;
break;
case ConpherenceUpdateActions::JOIN_ROOM:
@@ -128,36 +127,6 @@
->setURI('/'.$conpherence->getMonogram());
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(ConpherenceTransaction::TYPE_TITLE)
- ->setNewValue($title);
- $xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(ConpherenceTransaction::TYPE_TOPIC)
- ->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'));
- $xactions[] = id(new ConpherenceTransaction())
- ->setTransactionType(PhabricatorTransactions::TYPE_JOIN_POLICY)
- ->setNewValue($request->getStr('joinPolicy'));
- if (!$request->getExists('force_ajax')) {
- $response_mode = 'redirect';
- }
- break;
case ConpherenceUpdateActions::LOAD:
$updated = false;
$response_mode = 'ajax';
@@ -230,10 +199,6 @@
case ConpherenceUpdateActions::REMOVE_PERSON:
$dialog = $this->renderRemovePersonDialog($conpherence);
break;
- case ConpherenceUpdateActions::METADATA:
- default:
- $dialog = $this->renderMetadataDialog($conpherence, $error_view);
- break;
}
return
@@ -422,71 +387,6 @@
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))
- ->appendChild(
- id(new AphrontFormPolicyControl())
- ->setName('joinPolicy')
- ->setPolicyObject($conpherence)
- ->setCapability(PhabricatorPolicyCapability::CAN_JOIN)
- ->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('minimal_display')) {
- $view->addHiddenInput('minimal_display', true);
- }
- if ($request->getExists('force_ajax')) {
- $view->addHiddenInput('force_ajax', true);
- }
-
- return $view;
- }
-
private function loadAndRenderUpdates(
$action,
$conpherence_id,
@@ -496,7 +396,6 @@
$need_transactions = false;
$need_participant_cache = true;
switch ($action) {
- case ConpherenceUpdateActions::METADATA:
case ConpherenceUpdateActions::LOAD:
$need_transactions = true;
break;
@@ -549,21 +448,6 @@
$people_widget = null;
if (!$minimal_display) {
switch ($action) {
- case ConpherenceUpdateActions::METADATA:
- $policy_objects = id(new PhabricatorPolicyQuery())
- ->setViewer($user)
- ->setObject($conpherence)
- ->execute();
- $header = $this->buildHeaderPaneContent(
- $conpherence,
- $policy_objects);
- $header = hsprintf('%s', $header);
- $nav_item = id(new ConpherenceThreadListView())
- ->setUser($user)
- ->setBaseURI($this->getApplicationURI())
- ->renderSingleThread($conpherence, $policy_objects);
- $nav_item = hsprintf('%s', $nav_item);
- break;
case ConpherenceUpdateActions::ADD_PERSON:
$people_widget = id(new ConpherenceParticipantView())
->setUser($user)
diff --git a/src/applications/conpherence/editor/ConpherenceEditEngine.php b/src/applications/conpherence/editor/ConpherenceEditEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conpherence/editor/ConpherenceEditEngine.php
@@ -0,0 +1,102 @@
+<?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();
+ }
+
+ protected function buildCustomEditFields($object) {
+ $viewer = $this->getViewer();
+
+ if ($this->getIsCreate()) {
+ $participant_phids = array($viewer->getPHID());
+ } else {
+ $participant_phids = $object->getParticipantPHIDs();
+ }
+
+ return array(
+ id(new PhabricatorTextEditField())
+ ->setKey('name')
+ ->setLabel(pht('Name'))
+ ->setDescription(pht('Room name.'))
+ ->setConduitTypeDescription(pht('New Room name.'))
+ ->setIsRequired(true)
+ ->setTransactionType(ConpherenceTransaction::TYPE_TITLE)
+ ->setValue($object->getTitle()),
+
+ id(new PhabricatorTextEditField())
+ ->setKey('topic')
+ ->setLabel(pht('Topic'))
+ ->setDescription(pht('Room topic.'))
+ ->setConduitTypeDescription(pht('New Room topic.'))
+ ->setTransactionType(ConpherenceTransaction::TYPE_TOPIC)
+ ->setValue($object->getTopic()),
+
+ id(new PhabricatorUsersEditField())
+ ->setKey('participants')
+ ->setValue($participant_phids)
+ ->setDescription(pht('Room participants.'))
+ ->setConduitTypeDescription(pht('New Room participants.'))
+ ->setTransactionType(ConpherenceTransaction::TYPE_PARTICIPANTS)
+ ->setLabel(pht('Participants')),
+
+ );
+ }
+
+}
diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php
--- a/src/applications/conpherence/editor/ConpherenceEditor.php
+++ b/src/applications/conpherence/editor/ConpherenceEditor.php
@@ -127,7 +127,7 @@
case ConpherenceTransaction::TYPE_PICTURE:
return $xaction->getNewValue();
case ConpherenceTransaction::TYPE_PARTICIPANTS:
- return $this->getPHIDTransactionNewValue($xaction);
+ return $xaction->getNewValue();
}
}
@@ -179,7 +179,7 @@
// this participation data will be updated, particularly the
// behindTransactionPHID which is just a generated dummy for now.
$participants = array();
- $phids = $this->getPHIDTransactionNewValue($xaction, array());
+ $phids = $xaction->getNewValue();
foreach ($phids as $phid) {
if ($phid == $this->getActor()->getPHID()) {
$status = ConpherenceParticipationStatus::UP_TO_DATE;
@@ -592,7 +592,7 @@
break;
case ConpherenceTransaction::TYPE_PARTICIPANTS:
foreach ($xactions as $xaction) {
- $new_phids = $this->getPHIDTransactionNewValue($xaction, array());
+ $new_phids = $xaction->getNewValue();
$old_phids = nonempty($object->getParticipantPHIDs(), array());
$phids = array_diff($new_phids, $old_phids);
diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php
--- a/src/applications/conpherence/storage/ConpherenceThread.php
+++ b/src/applications/conpherence/storage/ConpherenceThread.php
@@ -74,6 +74,10 @@
return parent::save();
}
+ public function getURI() {
+ return '/'.$this->getMonogram();
+ }
+
public function getMonogram() {
return 'Z'.$this->getID();
}
diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php
--- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php
+++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php
@@ -363,9 +363,9 @@
$actions[] = array(
'name' => pht('Edit Room'),
'disabled' => !$can_edit,
- 'href' => '/conpherence/update/'.$conpherence->getID().'/?nopic',
+ 'href' => '/conpherence/edit/'.$conpherence->getID().'/',
'icon' => 'fa-pencil',
- 'key' => ConpherenceUpdateActions::METADATA,
+ 'key' => 'go_edit',
);
$actions[] = array(
'name' => pht('View in Conpherence'),
diff --git a/src/applications/conpherence/view/ConpherenceThreadListView.php b/src/applications/conpherence/view/ConpherenceThreadListView.php
--- a/src/applications/conpherence/view/ConpherenceThreadListView.php
+++ b/src/applications/conpherence/view/ConpherenceThreadListView.php
@@ -199,7 +199,7 @@
$new_icon = id(new PHUIIconView())
->setIcon('fa-plus-square')
->addSigil('has-tooltip')
- ->setHref('/conpherence/new/')
+ ->setHref('/conpherence/edit/')
->setWorkflow(true)
->setMetaData(array(
'tip' => pht('New Room'),
diff --git a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js
--- a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js
+++ b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js
@@ -178,7 +178,7 @@
var params = null;
switch (action) {
- case 'metadata':
+ case 'go_edit':
threadManager.runUpdateWorkflowFromLink(
link,
{

File Metadata

Mime Type
text/plain
Expires
Sun, May 19, 1:30 AM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6301504
Default Alt Text
D16677.id40242.diff (30 KB)

Event Timeline