@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 - fix some ajax bugs

Summary: the people widget was returning a comma-delimited list of HTML nodes so kill that noise with some hsprintf action. We also weren't consistently updating the latest transaction id so simplify those codepaths (widgets vs pontificate) a bit. Fixes T3336.

Test Plan: left some messages, added some participants. noted that the people widget looked good and only the pertinent transactions were pulled down on updates.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3336

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

+18 -20
+5 -1
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 319 319 break; 320 320 } 321 321 322 + $people_html = null; 323 + if ($people_widget) { 324 + $people_html = hsprintf('%s', $people_widget->render()); 325 + } 322 326 $content = array( 323 327 'transactions' => hsprintf('%s', $rendered_transactions), 324 328 'latest_transaction_id' => $new_latest_transaction_id, ··· 326 330 'conpherence_phid' => $conpherence->getPHID(), 327 331 'header' => hsprintf('%s', $header), 328 332 'file_widget' => $file_widget ? $file_widget->render() : null, 329 - 'people_widget' => $people_widget ? $people_widget->render() : null, 333 + 'people_widget' => $people_html, 330 334 ); 331 335 332 336 return $content;
+2 -5
src/applications/conpherence/controller/ConpherenceViewController.php
··· 156 156 'type' => 'hidden', 157 157 'name' => 'latest_transaction_id', 158 158 'value' => $latest_transaction_id, 159 - 'sigil' => 'latest-transaction-id', 160 - 'meta' => array( 161 - 'id' => $latest_transaction_id 162 - ) 159 + 'sigil' => 'latest-transaction-id' 163 160 ), 164 - '')) 161 + '')) 165 162 ->render(); 166 163 167 164 return $form;
+5 -7
webroot/rsrc/js/application/conpherence/behavior-pontificate.js
··· 38 38 ); 39 39 } 40 40 41 - var inputs = JX.DOM.scry(form, 'input'); 42 - for (var ii = 0; ii < inputs.length; ii++) { 43 - if (inputs[ii].name == 'latest_transaction_id') { 44 - inputs[ii].value = r.latest_transaction_id; 45 - break; 46 - } 47 - } 41 + var latest_transaction_dom = JX.DOM.find( 42 + root, 43 + 'input', 44 + 'latest-transaction-id'); 45 + latest_transaction_dom.value = r.latest_transaction_id; 48 46 49 47 var textarea = JX.DOM.find(form, 'textarea'); 50 48 textarea.value = '';
+6 -7
webroot/rsrc/js/application/conpherence/behavior-widget-pane.js
··· 258 258 } 259 259 260 260 var root = JX.DOM.find(document, 'div', 'conpherence-layout'); 261 - var latest_transaction_data = JX.Stratcom.getData( 262 - JX.DOM.find( 263 - root, 264 - 'input', 265 - 'latest-transaction-id' 266 - )); 261 + var latest_transaction_dom = JX.DOM.find( 262 + root, 263 + 'input', 264 + 'latest-transaction-id'); 267 265 var data = { 268 - latest_transaction_id : latest_transaction_data.id, 266 + latest_transaction_id : latest_transaction_dom.value, 269 267 action : create_data.action 270 268 }; 271 269 272 270 new JX.Workflow(href, data) 273 271 .setHandler(function (r) { 272 + latest_transaction_dom.value = r.latest_transaction_id; 274 273 if (create_data.refreshFromResponse) { 275 274 var messages = null; 276 275 try {