mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
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
This commit is contained in:
parent
9564b0a40e
commit
c97040de47
5 changed files with 120 additions and 70 deletions
|
@ -8,7 +8,7 @@
|
||||||
return array(
|
return array(
|
||||||
'names' => array(
|
'names' => array(
|
||||||
'core.pkg.css' => 'a9770fbb',
|
'core.pkg.css' => 'a9770fbb',
|
||||||
'core.pkg.js' => 'a77025a1',
|
'core.pkg.js' => '5a1c336d',
|
||||||
'darkconsole.pkg.js' => '8ab24e01',
|
'darkconsole.pkg.js' => '8ab24e01',
|
||||||
'differential.pkg.css' => '6641cdd5',
|
'differential.pkg.css' => '6641cdd5',
|
||||||
'differential.pkg.js' => '3fab5259',
|
'differential.pkg.js' => '3fab5259',
|
||||||
|
@ -346,12 +346,12 @@ return array(
|
||||||
'rsrc/image/texture/table_header_hover.png' => '038ec3b9',
|
'rsrc/image/texture/table_header_hover.png' => '038ec3b9',
|
||||||
'rsrc/image/texture/table_header_tall.png' => 'd56b434f',
|
'rsrc/image/texture/table_header_tall.png' => 'd56b434f',
|
||||||
'rsrc/js/application/aphlict/Aphlict.js' => '2be71d56',
|
'rsrc/js/application/aphlict/Aphlict.js' => '2be71d56',
|
||||||
'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'cc2d9c80',
|
'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '830b3278',
|
||||||
'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '851f167c',
|
'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '851f167c',
|
||||||
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761',
|
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761',
|
||||||
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
|
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
|
||||||
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
|
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
|
||||||
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'a88a26cc',
|
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'd32db212',
|
||||||
'rsrc/js/application/conpherence/behavior-menu.js' => '869e3445',
|
'rsrc/js/application/conpherence/behavior-menu.js' => '869e3445',
|
||||||
'rsrc/js/application/conpherence/behavior-pontificate.js' => '86df5915',
|
'rsrc/js/application/conpherence/behavior-pontificate.js' => '86df5915',
|
||||||
'rsrc/js/application/conpherence/behavior-widget-pane.js' => '40b1ff90',
|
'rsrc/js/application/conpherence/behavior-widget-pane.js' => '40b1ff90',
|
||||||
|
@ -541,7 +541,7 @@ return array(
|
||||||
'inline-comment-summary-css' => 'eb5f8e8c',
|
'inline-comment-summary-css' => 'eb5f8e8c',
|
||||||
'javelin-aphlict' => '2be71d56',
|
'javelin-aphlict' => '2be71d56',
|
||||||
'javelin-behavior' => '61cbc29a',
|
'javelin-behavior' => '61cbc29a',
|
||||||
'javelin-behavior-aphlict-dropdown' => 'cc2d9c80',
|
'javelin-behavior-aphlict-dropdown' => '830b3278',
|
||||||
'javelin-behavior-aphlict-listen' => '851f167c',
|
'javelin-behavior-aphlict-listen' => '851f167c',
|
||||||
'javelin-behavior-aphlict-status' => 'ea681761',
|
'javelin-behavior-aphlict-status' => 'ea681761',
|
||||||
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
|
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
|
||||||
|
@ -582,7 +582,7 @@ return array(
|
||||||
'javelin-behavior-diffusion-locate-file' => '6d3e1947',
|
'javelin-behavior-diffusion-locate-file' => '6d3e1947',
|
||||||
'javelin-behavior-diffusion-pull-lastmodified' => '2b228192',
|
'javelin-behavior-diffusion-pull-lastmodified' => '2b228192',
|
||||||
'javelin-behavior-doorkeeper-tag' => 'e5822781',
|
'javelin-behavior-doorkeeper-tag' => 'e5822781',
|
||||||
'javelin-behavior-durable-column' => 'a88a26cc',
|
'javelin-behavior-durable-column' => 'd32db212',
|
||||||
'javelin-behavior-error-log' => '6882e80a',
|
'javelin-behavior-error-log' => '6882e80a',
|
||||||
'javelin-behavior-fancy-datepicker' => 'c51ae228',
|
'javelin-behavior-fancy-datepicker' => 'c51ae228',
|
||||||
'javelin-behavior-global-drag-and-drop' => '07f199d8',
|
'javelin-behavior-global-drag-and-drop' => '07f199d8',
|
||||||
|
@ -1400,6 +1400,16 @@ return array(
|
||||||
'82ce2142' => array(
|
'82ce2142' => array(
|
||||||
'aphront-typeahead-control-css',
|
'aphront-typeahead-control-css',
|
||||||
),
|
),
|
||||||
|
'830b3278' => array(
|
||||||
|
'javelin-behavior',
|
||||||
|
'javelin-request',
|
||||||
|
'javelin-stratcom',
|
||||||
|
'javelin-vector',
|
||||||
|
'javelin-dom',
|
||||||
|
'javelin-uri',
|
||||||
|
'javelin-behavior-device',
|
||||||
|
'phabricator-title',
|
||||||
|
),
|
||||||
'834a1173' => array(
|
'834a1173' => array(
|
||||||
'javelin-behavior',
|
'javelin-behavior',
|
||||||
'javelin-scrollbar',
|
'javelin-scrollbar',
|
||||||
|
@ -1609,15 +1619,6 @@ return array(
|
||||||
'javelin-stratcom',
|
'javelin-stratcom',
|
||||||
'javelin-dom',
|
'javelin-dom',
|
||||||
),
|
),
|
||||||
'a88a26cc' => array(
|
|
||||||
'javelin-behavior',
|
|
||||||
'javelin-dom',
|
|
||||||
'javelin-stratcom',
|
|
||||||
'javelin-scrollbar',
|
|
||||||
'javelin-quicksand',
|
|
||||||
'phabricator-keyboard-shortcut',
|
|
||||||
'javelin-behavior-conpherence-widget-pane',
|
|
||||||
),
|
|
||||||
'a8d8459d' => array(
|
'a8d8459d' => array(
|
||||||
'javelin-behavior',
|
'javelin-behavior',
|
||||||
'javelin-dom',
|
'javelin-dom',
|
||||||
|
@ -1743,16 +1744,6 @@ return array(
|
||||||
'javelin-stratcom',
|
'javelin-stratcom',
|
||||||
'phabricator-phtize',
|
'phabricator-phtize',
|
||||||
),
|
),
|
||||||
'cc2d9c80' => array(
|
|
||||||
'javelin-behavior',
|
|
||||||
'javelin-request',
|
|
||||||
'javelin-stratcom',
|
|
||||||
'javelin-vector',
|
|
||||||
'javelin-dom',
|
|
||||||
'javelin-uri',
|
|
||||||
'javelin-behavior-device',
|
|
||||||
'phabricator-title',
|
|
||||||
),
|
|
||||||
'd19198c8' => array(
|
'd19198c8' => array(
|
||||||
'javelin-install',
|
'javelin-install',
|
||||||
'javelin-dom',
|
'javelin-dom',
|
||||||
|
@ -1763,6 +1754,14 @@ return array(
|
||||||
'd254d646' => array(
|
'd254d646' => array(
|
||||||
'javelin-util',
|
'javelin-util',
|
||||||
),
|
),
|
||||||
|
'd32db212' => array(
|
||||||
|
'javelin-behavior',
|
||||||
|
'javelin-dom',
|
||||||
|
'javelin-stratcom',
|
||||||
|
'javelin-scrollbar',
|
||||||
|
'javelin-quicksand',
|
||||||
|
'phabricator-keyboard-shortcut',
|
||||||
|
),
|
||||||
'd4a14807' => array(
|
'd4a14807' => array(
|
||||||
'javelin-install',
|
'javelin-install',
|
||||||
'javelin-dom',
|
'javelin-dom',
|
||||||
|
|
|
@ -209,13 +209,18 @@ final class ConpherenceUpdateController
|
||||||
->setDatasource(new PhabricatorPeopleDatasource()));
|
->setDatasource(new PhabricatorPeopleDatasource()));
|
||||||
|
|
||||||
require_celerity_resource('conpherence-update-css');
|
require_celerity_resource('conpherence-update-css');
|
||||||
return id(new AphrontDialogView())
|
$view = id(new AphrontDialogView())
|
||||||
->setTitle(pht('Add Participants'))
|
->setTitle(pht('Add Participants'))
|
||||||
->addHiddenInput('action', 'add_person')
|
->addHiddenInput('action', 'add_person')
|
||||||
->addHiddenInput(
|
->addHiddenInput(
|
||||||
'latest_transaction_id',
|
'latest_transaction_id',
|
||||||
$request->getInt('latest_transaction_id'))
|
$request->getInt('latest_transaction_id'))
|
||||||
->appendChild($form);
|
->appendChild($form);
|
||||||
|
|
||||||
|
if ($request->getExists('minimal_display')) {
|
||||||
|
$view->addHiddenInput('minimal_display', true);
|
||||||
|
}
|
||||||
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderRemovePersonDialogue(
|
private function renderRemovePersonDialogue(
|
||||||
|
|
|
@ -146,21 +146,17 @@ final class ConpherenceDurableColumnView extends AphrontTagView {
|
||||||
$dropdown_id = celerity_generate_unique_node_id();
|
$dropdown_id = celerity_generate_unique_node_id();
|
||||||
|
|
||||||
$settings_list = new PHUIListView();
|
$settings_list = new PHUIListView();
|
||||||
$cw_registry =
|
$header_actions = $this->getHeaderActionsConfig($conpherence);
|
||||||
ConpherenceWidgetConfigConstants::getWidgetRegistry();
|
foreach ($header_actions as $action) {
|
||||||
$first = true;
|
|
||||||
foreach ($cw_registry as $widget => $config) {
|
|
||||||
$settings_list->addMenuItem(
|
$settings_list->addMenuItem(
|
||||||
id(new PHUIListItemView())
|
id(new PHUIListItemView())
|
||||||
->setHref('#')
|
->setHref($action['href'])
|
||||||
->setDisabled($first)
|
->setName($action['name'])
|
||||||
->setName($config['name'])
|
->setIcon($action['icon'])
|
||||||
->setIcon($config['icon'])
|
->addSigil('conpherence-durable-column-header-action')
|
||||||
->addSigil('conpherence-durable-column-widget-selected')
|
|
||||||
->setMetadata(array(
|
->setMetadata(array(
|
||||||
'widget' => $widget,
|
'action' => $action['key'],
|
||||||
)));
|
)));
|
||||||
$first = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$settings_menu = phutil_tag(
|
$settings_menu = phutil_tag(
|
||||||
|
@ -220,6 +216,28 @@ final class ConpherenceDurableColumnView extends AphrontTagView {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getHeaderActionsConfig(ConpherenceThread $conpherence) {
|
||||||
|
return array(
|
||||||
|
array(
|
||||||
|
'name' => pht('Add Participants'),
|
||||||
|
'href' => '/conpherence/update/'.$conpherence->getID().'/',
|
||||||
|
'icon' => 'fa-plus',
|
||||||
|
'key' => ConpherenceUpdateActions::ADD_PERSON,
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'name' => pht('View in Conpherence'),
|
||||||
|
'href' => '/conpherence/'.$conpherence->getID().'/',
|
||||||
|
'icon' => 'fa-comments',
|
||||||
|
'key' => 'go_conpherence',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'name' => pht('Close Window'),
|
||||||
|
'href' => '#',
|
||||||
|
'icon' => 'fa-times',
|
||||||
|
'key' => 'close_window',
|
||||||
|
),);
|
||||||
|
}
|
||||||
|
|
||||||
private function buildTransactions() {
|
private function buildTransactions() {
|
||||||
$conpherence = $this->getSelectedConpherence();
|
$conpherence = $this->getSelectedConpherence();
|
||||||
if (!$conpherence) {
|
if (!$conpherence) {
|
||||||
|
|
|
@ -170,4 +170,8 @@ JX.behavior('aphlict-dropdown', function(config, statics) {
|
||||||
dirty = true;
|
dirty = true;
|
||||||
refresh();
|
refresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
JX.Stratcom.listen('notification-panel-close', null, function() {
|
||||||
|
set_visible(null);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
* javelin-scrollbar
|
* javelin-scrollbar
|
||||||
* javelin-quicksand
|
* javelin-quicksand
|
||||||
* phabricator-keyboard-shortcut
|
* phabricator-keyboard-shortcut
|
||||||
* javelin-behavior-conpherence-widget-pane
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
JX.behavior('durable-column', function() {
|
JX.behavior('durable-column', function() {
|
||||||
|
@ -102,8 +101,10 @@ JX.behavior('durable-column', function() {
|
||||||
// end copy / hack of stuff with big ole TODO on it
|
// end copy / hack of stuff with big ole TODO on it
|
||||||
|
|
||||||
|
|
||||||
new JX.KeyboardShortcut('\\', 'Toggle Conpherence Column')
|
function _toggleColumn() {
|
||||||
.setHandler(function() {
|
if (window.location.pathname.indexOf('/conpherence/') === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
show = !show;
|
show = !show;
|
||||||
JX.DOM.alterClass(frame, 'with-durable-column', show);
|
JX.DOM.alterClass(frame, 'with-durable-column', show);
|
||||||
var column = JX.$('conpherence-durable-column');
|
var column = JX.$('conpherence-durable-column');
|
||||||
|
@ -115,7 +116,10 @@ JX.behavior('durable-column', function() {
|
||||||
}
|
}
|
||||||
JX.Stratcom.invoke('resize');
|
JX.Stratcom.invoke('resize');
|
||||||
JX.Quicksand.setFrame(show ? quick : null);
|
JX.Quicksand.setFrame(show ? quick : null);
|
||||||
})
|
}
|
||||||
|
|
||||||
|
new JX.KeyboardShortcut('\\', 'Toggle Conpherence Column')
|
||||||
|
.setHandler(_toggleColumn)
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
new JX.Scrollbar(JX.$('conpherence-durable-column-content'));
|
new JX.Scrollbar(JX.$('conpherence-durable-column-content'));
|
||||||
|
@ -124,29 +128,49 @@ JX.behavior('durable-column', function() {
|
||||||
|
|
||||||
JX.Stratcom.listen(
|
JX.Stratcom.listen(
|
||||||
'click',
|
'click',
|
||||||
'conpherence-durable-column-widget-selected',
|
'conpherence-durable-column-header-action',
|
||||||
function (e) {
|
function (e) {
|
||||||
e.kill();
|
e.kill();
|
||||||
var data = e.getNodeData('conpherence-durable-column-widget-selected');
|
var data = e.getNodeData('conpherence-durable-column-header-action');
|
||||||
var widget = data.widget;
|
var action = data.action;
|
||||||
if (widget == 'conpherence-message-pane') {
|
var link = e.getNode('tag:a');
|
||||||
return loadThreadContent(loadThreadID);
|
|
||||||
}
|
|
||||||
|
|
||||||
_markLoading(true);
|
switch (action) {
|
||||||
var uri = '/conpherence/widget/' + loadThreadID + '/';
|
case 'add_person':
|
||||||
loadedThreadID = null;
|
JX.Stratcom.invoke('notification-panel-close');
|
||||||
|
var params = {
|
||||||
var params = { widget : widget };
|
action: action,
|
||||||
new JX.Workflow(uri)
|
latest_transaction_id: latestTransactionID,
|
||||||
|
minimal_display: true
|
||||||
|
};
|
||||||
|
var workflow = new JX.Workflow.newFromLink(link)
|
||||||
.setData(params)
|
.setData(params)
|
||||||
.setHandler(function(r) {
|
.setHandler(function(r) {
|
||||||
var body = _getColumnBodyNode();
|
var messages = _getColumnMessagesNode();
|
||||||
JX.DOM.setContent(body, JX.$H(r));
|
JX.DOM.appendContent(messages, JX.$H(r.transactions));
|
||||||
new JX.Scrollbar(JX.$('conpherence-durable-column-content'));
|
messages.scrollTop = messages.scrollHeight;
|
||||||
_markLoading(false);
|
|
||||||
})
|
latestTransactionID = r.latest_transaction_id;
|
||||||
.start();
|
// since this is a two step workflow, and the "finally" method
|
||||||
|
// gets called on the first form load, restore "updating" if
|
||||||
|
// necessary
|
||||||
|
if (updating === null) {
|
||||||
|
updating = {
|
||||||
|
threadPHID: loadedThreadPHID,
|
||||||
|
knownID: latestTransactionID
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
sync_workflow(workflow);
|
||||||
|
break;
|
||||||
|
case 'go_conpherence':
|
||||||
|
JX.$U(link.href).go();
|
||||||
|
break;
|
||||||
|
case 'close_window':
|
||||||
|
JX.Stratcom.invoke('notification-panel-close');
|
||||||
|
_toggleColumn();
|
||||||
|
break;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function _getColumnNode() {
|
function _getColumnNode() {
|
||||||
|
|
Loading…
Reference in a new issue