Conpherence - make ZXXX monograms a bit more useful.

Summary: Ref T7756. Now viewing individual threads in Conpherence is `ZXXX` driven. Also adds remarkup support.

Test Plan: clicked around on list of conpherences in full view and it worked. selected 'view in conpherence' action from column and loaded correct `ZXXX` uri. Typed `ZXXX` in Maniphest and saw it link to Conpherence room.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7756

Differential Revision: https://secure.phabricator.com/D12397
This commit is contained in:
Bob Trahan
2015-04-13 12:45:55 -07:00
parent f12839ffd4
commit dd22db18ff
8 changed files with 50 additions and 24 deletions

View File

@@ -258,6 +258,7 @@ phutil_register_library_map(array(
'ConpherenceThreadListView' => 'applications/conpherence/view/ConpherenceThreadListView.php',
'ConpherenceThreadMailReceiver' => 'applications/conpherence/mail/ConpherenceThreadMailReceiver.php',
'ConpherenceThreadQuery' => 'applications/conpherence/query/ConpherenceThreadQuery.php',
'ConpherenceThreadRemarkupRule' => 'applications/conpherence/remarkup/ConpherenceThreadRemarkupRule.php',
'ConpherenceThreadSearchEngine' => 'applications/conpherence/query/ConpherenceThreadSearchEngine.php',
'ConpherenceThreadTestCase' => 'applications/conpherence/__tests__/ConpherenceThreadTestCase.php',
'ConpherenceTransaction' => 'applications/conpherence/storage/ConpherenceTransaction.php',
@@ -3451,6 +3452,7 @@ phutil_register_library_map(array(
'ConpherenceThreadListView' => 'AphrontView',
'ConpherenceThreadMailReceiver' => 'PhabricatorObjectMailReceiver',
'ConpherenceThreadQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'ConpherenceThreadRemarkupRule' => 'PhabricatorObjectRemarkupRule',
'ConpherenceThreadSearchEngine' => 'PhabricatorApplicationSearchEngine',
'ConpherenceThreadTestCase' => 'ConpherenceTestCase',
'ConpherenceTransaction' => 'PhabricatorApplicationTransaction',

View File

@@ -22,6 +22,12 @@ final class PhabricatorConpherenceApplication extends PhabricatorApplication {
return "\xE2\x9C\x86";
}
public function getRemarkupRules() {
return array(
new ConpherenceThreadRemarkupRule(),
);
}
public function getEventListeners() {
return array(
new ConpherenceHovercardEventListener(),
@@ -30,6 +36,7 @@ final class PhabricatorConpherenceApplication extends PhabricatorApplication {
public function getRoutes() {
return array(
'/Z(?P<id>[1-9]\d*)' => 'ConpherenceViewController',
'/conpherence/' => array(
'' => 'ConpherenceListController',
'thread/(?P<id>[1-9]\d*)/' => 'ConpherenceListController',
@@ -62,6 +69,7 @@ final class PhabricatorConpherenceApplication extends PhabricatorApplication {
public function getQuicksandURIPatternBlacklist() {
return array(
'/conpherence/.*',
'/Z\d+',
);
}

View File

@@ -31,7 +31,7 @@ final class PhabricatorConpherenceThreadPHIDType extends PhabricatorPHIDType {
$data = $thread->getDisplayData($query->getViewer());
$handle->setName($data['title']);
$handle->setFullName($data['title']);
$handle->setURI('/conpherence/'.$thread->getID().'/');
$handle->setURI('/'.$thread->getMonogram());
}
}

View File

@@ -0,0 +1,19 @@
<?php
final class ConpherenceThreadRemarkupRule
extends PhabricatorObjectRemarkupRule {
protected function getObjectNamePrefix() {
return 'Z';
}
protected function loadObjects(array $ids) {
$viewer = $this->getEngine()->getConfig('viewer');
$threads = id(new ConpherenceThreadQuery())
->setViewer($viewer)
->withIDs($ids)
->execute();
return mpull($threads, null, 'getID');
}
}

View File

@@ -408,7 +408,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView {
array(
'name' => pht('View in Conpherence'),
'disabled' => false,
'href' => '/conpherence/'.$conpherence->getID().'/',
'href' => '/'.$conpherence->getMonogram(),
'icon' => 'fa-comments',
'key' => 'go_conpherence',
),

View File

@@ -70,7 +70,7 @@ final class ConpherenceThreadListView extends AphrontView {
$user = $this->getUser();
$uri = $this->baseURI.$thread->getID().'/';
$uri = '/'.$thread->getMonogram();
$data = $thread->getDisplayData($user);
$icon = null;
if ($thread->getIsRoom()) {