@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Conpherence - add draft support

Summary: Fixes T3497.

Test Plan: on conpherence 1, typed some stuff. clicked conpherence 2 - observed some stuff gone. clicked conpherence 1 - stuff came back! submitted conpherence 1 and reloaded - stuff did not come back. (Generally played around a bunch like this)

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Maniphest Tasks: T3497

Differential Revision: https://secure.phabricator.com/D8266

+58 -23
+14 -13
resources/celerity/map.php
··· 344 344 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '845731b8', 345 345 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 346 346 'rsrc/js/application/config/behavior-reorder-fields.js' => '69bb5094', 347 - 'rsrc/js/application/conpherence/behavior-menu.js' => '872bc8ff', 347 + 'rsrc/js/application/conpherence/behavior-menu.js' => '7ff0b011', 348 348 'rsrc/js/application/conpherence/behavior-pontificate.js' => '53f6f2dd', 349 349 'rsrc/js/application/conpherence/behavior-widget-pane.js' => 'd8ef8659', 350 350 'rsrc/js/application/countdown/timer.js' => '8454ce4f', ··· 531 531 'javelin-behavior-audit-preview' => 'be81801d', 532 532 'javelin-behavior-balanced-payment-form' => '3b3e1664', 533 533 'javelin-behavior-config-reorder-fields' => '69bb5094', 534 - 'javelin-behavior-conpherence-menu' => '872bc8ff', 534 + 'javelin-behavior-conpherence-menu' => '7ff0b011', 535 535 'javelin-behavior-conpherence-pontificate' => '53f6f2dd', 536 536 'javelin-behavior-conpherence-widget-pane' => 'd8ef8659', 537 537 'javelin-behavior-countdown-timer' => '8454ce4f', ··· 1291 1291 0 => 'javelin-behavior', 1292 1292 1 => 'javelin-history', 1293 1293 ), 1294 + '7ff0b011' => 1295 + array( 1296 + 0 => 'javelin-behavior', 1297 + 1 => 'javelin-dom', 1298 + 2 => 'javelin-util', 1299 + 3 => 'javelin-stratcom', 1300 + 4 => 'javelin-workflow', 1301 + 5 => 'javelin-behavior-device', 1302 + 6 => 'javelin-history', 1303 + 7 => 'javelin-vector', 1304 + 8 => 'phabricator-shaped-request', 1305 + ), 1294 1306 '828a2eed' => 1295 1307 array( 1296 1308 0 => 'javelin-behavior', ··· 1347 1359 0 => 'javelin-behavior', 1348 1360 1 => 'javelin-dom', 1349 1361 2 => 'javelin-stratcom', 1350 - ), 1351 - '872bc8ff' => 1352 - array( 1353 - 0 => 'javelin-behavior', 1354 - 1 => 'javelin-dom', 1355 - 2 => 'javelin-util', 1356 - 3 => 'javelin-stratcom', 1357 - 4 => 'javelin-workflow', 1358 - 5 => 'javelin-behavior-device', 1359 - 6 => 'javelin-history', 1360 - 7 => 'javelin-vector', 1361 1362 ), 1362 1363 '89889fe7' => 1363 1364 array(
+1
src/applications/conpherence/constants/ConpherenceUpdateActions.php
··· 4 4 5 5 const METADATA = 'metadata'; 6 6 const MESSAGE = 'message'; 7 + const DRAFT = 'draft'; 7 8 const ADD_PERSON = 'add_person'; 8 9 const REMOVE_PERSON = 'remove_person'; 9 10 const NOTIFICATIONS = 'notifications';
+15 -3
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 1 1 <?php 2 2 3 - /** 4 - * @group conpherence 5 - */ 6 3 final class ConpherenceUpdateController 7 4 extends ConpherenceController { 8 5 ··· 39 36 $error_view = null; 40 37 $e_file = array(); 41 38 $errors = array(); 39 + $delete_draft = false; 42 40 if ($request->isFormPost()) { 43 41 $editor = id(new ConpherenceEditor()) 44 42 ->setContinueOnNoEffect($request->isContinueRequest()) ··· 46 44 ->setActor($user); 47 45 48 46 switch ($action) { 47 + case ConpherenceUpdateActions::DRAFT: 48 + $draft = PhabricatorDraft::newFromUserAndKey( 49 + $user, 50 + $conpherence->getPHID()); 51 + $draft->setDraft($request->getStr('text')); 52 + $draft->replaceOrDelete(); 53 + break; 49 54 case ConpherenceUpdateActions::MESSAGE: 50 55 $message = $request->getStr('text'); 51 56 $xactions = $editor->generateTransactionsFromText( 52 57 $conpherence, 53 58 $message); 59 + $delete_draft = true; 54 60 break; 55 61 case ConpherenceUpdateActions::ADD_PERSON: 56 62 $xactions = array(); ··· 116 122 if ($xactions) { 117 123 try { 118 124 $xactions = $editor->applyTransactions($conpherence, $xactions); 125 + if ($delete_draft) { 126 + $draft = PhabricatorDraft::newFromUserAndKey( 127 + $user, 128 + $conpherence->getPHID()); 129 + $draft->delete(); 130 + } 119 131 } catch (PhabricatorApplicationTransactionNoEffectException $ex) { 120 132 return id(new PhabricatorApplicationTransactionNoEffectResponse()) 121 133 ->setCancelURI($this->getApplicationURI($conpherence_id.'/'))
+6 -5
src/applications/conpherence/controller/ConpherenceViewController.php
··· 1 1 <?php 2 2 3 - /** 4 - * @group conpherence 5 - */ 6 3 final class ConpherenceViewController extends 7 4 ConpherenceController { 8 5 ··· 130 127 131 128 $conpherence = $this->getConpherence(); 132 129 $user = $this->getRequest()->getUser(); 130 + $draft = PhabricatorDraft::newFromUserAndKey( 131 + $user, 132 + $conpherence->getPHID()); 133 133 $update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); 134 134 135 - Javelin::initBehavior('conpherence-pontificate'); 135 + $this->initBehavior('conpherence-pontificate'); 136 136 $is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business'); 137 137 138 138 $form = ··· 145 145 ->appendChild( 146 146 id(new PhabricatorRemarkupControl()) 147 147 ->setUser($user) 148 - ->setName('text')) 148 + ->setName('text') 149 + ->setValue($draft->getDraft())) 149 150 ->appendChild( 150 151 id(new AphrontFormSubmitControl()) 151 152 ->setValue(
+2 -2
src/applications/conpherence/view/ConpherenceLayoutView.php
··· 62 62 $selected_id = $this->thread->getPHID() . '-nav-item'; 63 63 $selected_thread_id = $this->thread->getID(); 64 64 } 65 - Javelin::initBehavior('conpherence-menu', 65 + $this->initBehavior('conpherence-menu', 66 66 array( 67 67 'baseURI' => $this->baseURI, 68 68 'layoutID' => $layout_id, ··· 74 74 'hasWidgets' => false, 75 75 )); 76 76 77 - Javelin::initBehavior( 77 + $this->initBehavior( 78 78 'conpherence-widget-pane', 79 79 array( 80 80 'widgetBaseUpdateURI' => $this->baseURI . 'update/',
+20
webroot/rsrc/js/application/conpherence/behavior-menu.js
··· 8 8 * javelin-behavior-device 9 9 * javelin-history 10 10 * javelin-vector 11 + * phabricator-shaped-request 11 12 */ 12 13 13 14 JX.behavior('conpherence-menu', function(config) { ··· 526 527 'conpherence-menu-scroller', 527 528 handleThreadScrollers 528 529 ); 530 + 531 + var onkeydownDraft = function (e) { 532 + var form = e.getNode('tag:form'); 533 + var uri = config.baseURI + 'update/' + _thread.selected + '/'; 534 + var draftRequest = new JX.PhabricatorShapedRequest( 535 + uri, 536 + JX.bag, 537 + function () { 538 + var data = JX.DOM.convertFormToDictionary(form); 539 + data.action = 'draft'; 540 + return data; 541 + }); 542 + draftRequest.start(); 543 + }; 544 + 545 + JX.Stratcom.listen( 546 + ['keydown'], 547 + 'conpherence-pontificate', 548 + onkeydownDraft); 529 549 530 550 });