@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 - get the durable column header actions working correctly

Summary:
Ref T7014. This diff addresses

- getting it to be the right set of options
- add participant
- view in conpherence
- close window
- making those options work
- make it so if you are on /conpherence/ you can't toggle the durable column

Test Plan: inspected dom via chrome tools and found last transaction. added a participant and inspected the single new transactin added for accuracy. used view in conpherence action to view in conpherence. used close window action to close window

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7014

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

+119 -69
+23 -24
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => 'a9770fbb', 11 - 'core.pkg.js' => 'a77025a1', 11 + 'core.pkg.js' => '5a1c336d', 12 12 'darkconsole.pkg.js' => '8ab24e01', 13 13 'differential.pkg.css' => '6641cdd5', 14 14 'differential.pkg.js' => '3fab5259', ··· 346 346 'rsrc/image/texture/table_header_hover.png' => '038ec3b9', 347 347 'rsrc/image/texture/table_header_tall.png' => 'd56b434f', 348 348 'rsrc/js/application/aphlict/Aphlict.js' => '2be71d56', 349 - 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'cc2d9c80', 349 + 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '830b3278', 350 350 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '851f167c', 351 351 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761', 352 352 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 353 353 'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', 354 - 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'a88a26cc', 354 + 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'd32db212', 355 355 'rsrc/js/application/conpherence/behavior-menu.js' => '869e3445', 356 356 'rsrc/js/application/conpherence/behavior-pontificate.js' => '86df5915', 357 357 'rsrc/js/application/conpherence/behavior-widget-pane.js' => '40b1ff90', ··· 541 541 'inline-comment-summary-css' => 'eb5f8e8c', 542 542 'javelin-aphlict' => '2be71d56', 543 543 'javelin-behavior' => '61cbc29a', 544 - 'javelin-behavior-aphlict-dropdown' => 'cc2d9c80', 544 + 'javelin-behavior-aphlict-dropdown' => '830b3278', 545 545 'javelin-behavior-aphlict-listen' => '851f167c', 546 546 'javelin-behavior-aphlict-status' => 'ea681761', 547 547 'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884', ··· 582 582 'javelin-behavior-diffusion-locate-file' => '6d3e1947', 583 583 'javelin-behavior-diffusion-pull-lastmodified' => '2b228192', 584 584 'javelin-behavior-doorkeeper-tag' => 'e5822781', 585 - 'javelin-behavior-durable-column' => 'a88a26cc', 585 + 'javelin-behavior-durable-column' => 'd32db212', 586 586 'javelin-behavior-error-log' => '6882e80a', 587 587 'javelin-behavior-fancy-datepicker' => 'c51ae228', 588 588 'javelin-behavior-global-drag-and-drop' => '07f199d8', ··· 1400 1400 '82ce2142' => array( 1401 1401 'aphront-typeahead-control-css', 1402 1402 ), 1403 + '830b3278' => array( 1404 + 'javelin-behavior', 1405 + 'javelin-request', 1406 + 'javelin-stratcom', 1407 + 'javelin-vector', 1408 + 'javelin-dom', 1409 + 'javelin-uri', 1410 + 'javelin-behavior-device', 1411 + 'phabricator-title', 1412 + ), 1403 1413 '834a1173' => array( 1404 1414 'javelin-behavior', 1405 1415 'javelin-scrollbar', ··· 1609 1619 'javelin-stratcom', 1610 1620 'javelin-dom', 1611 1621 ), 1612 - 'a88a26cc' => array( 1613 - 'javelin-behavior', 1614 - 'javelin-dom', 1615 - 'javelin-stratcom', 1616 - 'javelin-scrollbar', 1617 - 'javelin-quicksand', 1618 - 'phabricator-keyboard-shortcut', 1619 - 'javelin-behavior-conpherence-widget-pane', 1620 - ), 1621 1622 'a8d8459d' => array( 1622 1623 'javelin-behavior', 1623 1624 'javelin-dom', ··· 1743 1744 'javelin-stratcom', 1744 1745 'phabricator-phtize', 1745 1746 ), 1746 - 'cc2d9c80' => array( 1747 - 'javelin-behavior', 1748 - 'javelin-request', 1749 - 'javelin-stratcom', 1750 - 'javelin-vector', 1751 - 'javelin-dom', 1752 - 'javelin-uri', 1753 - 'javelin-behavior-device', 1754 - 'phabricator-title', 1755 - ), 1756 1747 'd19198c8' => array( 1757 1748 'javelin-install', 1758 1749 'javelin-dom', ··· 1762 1753 ), 1763 1754 'd254d646' => array( 1764 1755 'javelin-util', 1756 + ), 1757 + 'd32db212' => array( 1758 + 'javelin-behavior', 1759 + 'javelin-dom', 1760 + 'javelin-stratcom', 1761 + 'javelin-scrollbar', 1762 + 'javelin-quicksand', 1763 + 'phabricator-keyboard-shortcut', 1765 1764 ), 1766 1765 'd4a14807' => array( 1767 1766 'javelin-install',
+6 -1
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 209 209 ->setDatasource(new PhabricatorPeopleDatasource())); 210 210 211 211 require_celerity_resource('conpherence-update-css'); 212 - return id(new AphrontDialogView()) 212 + $view = id(new AphrontDialogView()) 213 213 ->setTitle(pht('Add Participants')) 214 214 ->addHiddenInput('action', 'add_person') 215 215 ->addHiddenInput( 216 216 'latest_transaction_id', 217 217 $request->getInt('latest_transaction_id')) 218 218 ->appendChild($form); 219 + 220 + if ($request->getExists('minimal_display')) { 221 + $view->addHiddenInput('minimal_display', true); 219 222 } 223 + return $view; 224 + } 220 225 221 226 private function renderRemovePersonDialogue( 222 227 ConpherenceThread $conpherence) {
+29 -11
src/applications/conpherence/view/ConpherenceDurableColumnView.php
··· 146 146 $dropdown_id = celerity_generate_unique_node_id(); 147 147 148 148 $settings_list = new PHUIListView(); 149 - $cw_registry = 150 - ConpherenceWidgetConfigConstants::getWidgetRegistry(); 151 - $first = true; 152 - foreach ($cw_registry as $widget => $config) { 149 + $header_actions = $this->getHeaderActionsConfig($conpherence); 150 + foreach ($header_actions as $action) { 153 151 $settings_list->addMenuItem( 154 152 id(new PHUIListItemView()) 155 - ->setHref('#') 156 - ->setDisabled($first) 157 - ->setName($config['name']) 158 - ->setIcon($config['icon']) 159 - ->addSigil('conpherence-durable-column-widget-selected') 153 + ->setHref($action['href']) 154 + ->setName($action['name']) 155 + ->setIcon($action['icon']) 156 + ->addSigil('conpherence-durable-column-header-action') 160 157 ->setMetadata(array( 161 - 'widget' => $widget, 158 + 'action' => $action['key'], 162 159 ))); 163 - $first = false; 164 160 } 165 161 166 162 $settings_menu = phutil_tag( ··· 218 214 $settings_button, 219 215 $settings_menu,)); 220 216 217 + } 218 + 219 + private function getHeaderActionsConfig(ConpherenceThread $conpherence) { 220 + return array( 221 + array( 222 + 'name' => pht('Add Participants'), 223 + 'href' => '/conpherence/update/'.$conpherence->getID().'/', 224 + 'icon' => 'fa-plus', 225 + 'key' => ConpherenceUpdateActions::ADD_PERSON, 226 + ), 227 + array( 228 + 'name' => pht('View in Conpherence'), 229 + 'href' => '/conpherence/'.$conpherence->getID().'/', 230 + 'icon' => 'fa-comments', 231 + 'key' => 'go_conpherence', 232 + ), 233 + array( 234 + 'name' => pht('Close Window'), 235 + 'href' => '#', 236 + 'icon' => 'fa-times', 237 + 'key' => 'close_window', 238 + ),); 221 239 } 222 240 223 241 private function buildTransactions() {
+4
webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
··· 170 170 dirty = true; 171 171 refresh(); 172 172 }); 173 + 174 + JX.Stratcom.listen('notification-panel-close', null, function() { 175 + set_visible(null); 176 + }); 173 177 });
+57 -33
webroot/rsrc/js/application/conpherence/behavior-durable-column.js
··· 6 6 * javelin-scrollbar 7 7 * javelin-quicksand 8 8 * phabricator-keyboard-shortcut 9 - * javelin-behavior-conpherence-widget-pane 10 9 */ 11 10 12 11 JX.behavior('durable-column', function() { ··· 102 101 // end copy / hack of stuff with big ole TODO on it 103 102 104 103 104 + function _toggleColumn() { 105 + if (window.location.pathname.indexOf('/conpherence/') === 0) { 106 + return; 107 + } 108 + show = !show; 109 + JX.DOM.alterClass(frame, 'with-durable-column', show); 110 + var column = JX.$('conpherence-durable-column'); 111 + if (show) { 112 + JX.DOM.show(column); 113 + loadThreadContent(loadThreadID); 114 + } else { 115 + JX.DOM.hide(column); 116 + } 117 + JX.Stratcom.invoke('resize'); 118 + JX.Quicksand.setFrame(show ? quick : null); 119 + } 120 + 105 121 new JX.KeyboardShortcut('\\', 'Toggle Conpherence Column') 106 - .setHandler(function() { 107 - show = !show; 108 - JX.DOM.alterClass(frame, 'with-durable-column', show); 109 - var column = JX.$('conpherence-durable-column'); 110 - if (show) { 111 - JX.DOM.show(column); 112 - loadThreadContent(loadThreadID); 113 - } else { 114 - JX.DOM.hide(column); 115 - } 116 - JX.Stratcom.invoke('resize'); 117 - JX.Quicksand.setFrame(show ? quick : null); 118 - }) 122 + .setHandler(_toggleColumn) 119 123 .register(); 120 124 121 125 new JX.Scrollbar(JX.$('conpherence-durable-column-content')); ··· 124 128 125 129 JX.Stratcom.listen( 126 130 'click', 127 - 'conpherence-durable-column-widget-selected', 131 + 'conpherence-durable-column-header-action', 128 132 function (e) { 129 133 e.kill(); 130 - var data = e.getNodeData('conpherence-durable-column-widget-selected'); 131 - var widget = data.widget; 132 - if (widget == 'conpherence-message-pane') { 133 - return loadThreadContent(loadThreadID); 134 - } 134 + var data = e.getNodeData('conpherence-durable-column-header-action'); 135 + var action = data.action; 136 + var link = e.getNode('tag:a'); 135 137 136 - _markLoading(true); 137 - var uri = '/conpherence/widget/' + loadThreadID + '/'; 138 - loadedThreadID = null; 138 + switch (action) { 139 + case 'add_person': 140 + JX.Stratcom.invoke('notification-panel-close'); 141 + var params = { 142 + action: action, 143 + latest_transaction_id: latestTransactionID, 144 + minimal_display: true 145 + }; 146 + var workflow = new JX.Workflow.newFromLink(link) 147 + .setData(params) 148 + .setHandler(function(r) { 149 + var messages = _getColumnMessagesNode(); 150 + JX.DOM.appendContent(messages, JX.$H(r.transactions)); 151 + messages.scrollTop = messages.scrollHeight; 139 152 140 - var params = { widget : widget }; 141 - new JX.Workflow(uri) 142 - .setData(params) 143 - .setHandler(function(r) { 144 - var body = _getColumnBodyNode(); 145 - JX.DOM.setContent(body, JX.$H(r)); 146 - new JX.Scrollbar(JX.$('conpherence-durable-column-content')); 147 - _markLoading(false); 148 - }) 149 - .start(); 153 + latestTransactionID = r.latest_transaction_id; 154 + // since this is a two step workflow, and the "finally" method 155 + // gets called on the first form load, restore "updating" if 156 + // necessary 157 + if (updating === null) { 158 + updating = { 159 + threadPHID: loadedThreadPHID, 160 + knownID: latestTransactionID 161 + }; 162 + } 163 + }); 164 + sync_workflow(workflow); 165 + break; 166 + case 'go_conpherence': 167 + JX.$U(link.href).go(); 168 + break; 169 + case 'close_window': 170 + JX.Stratcom.invoke('notification-panel-close'); 171 + _toggleColumn(); 172 + break; 173 + } 150 174 }); 151 175 152 176 function _getColumnNode() {