1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Move search, new room into thread column in Conpherence

Summary:
Moves search and new room out of crumb bar and into the thread column. This opens up space to add "Edit Room" into the crumbs area as an action link. Also removed 'widget-edit' pathways and javascript.

Fixes T8972

Test Plan:
Search, New, Edit rooms. Click different rooms, see correct URL each time.

{F1813226}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T8972

Differential Revision: https://secure.phabricator.com/D16543
This commit is contained in:
Chad Little 2016-09-12 22:19:24 +00:00 committed by chad
parent 105be01d5f
commit d25a9530a7
7 changed files with 104 additions and 81 deletions

View file

@ -45,7 +45,7 @@ return array(
'rsrc/css/application/config/setup-issue.css' => 'f794cfc3', 'rsrc/css/application/config/setup-issue.css' => 'f794cfc3',
'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a',
'rsrc/css/application/conpherence/durable-column.css' => '194ac487', 'rsrc/css/application/conpherence/durable-column.css' => '194ac487',
'rsrc/css/application/conpherence/menu.css' => '3a0fd18a', 'rsrc/css/application/conpherence/menu.css' => '4c959efa',
'rsrc/css/application/conpherence/message-pane.css' => '31dc663d', 'rsrc/css/application/conpherence/message-pane.css' => '31dc663d',
'rsrc/css/application/conpherence/notification.css' => '6cdcc253', 'rsrc/css/application/conpherence/notification.css' => '6cdcc253',
'rsrc/css/application/conpherence/transaction.css' => '2c71247c', 'rsrc/css/application/conpherence/transaction.css' => '2c71247c',
@ -438,7 +438,7 @@ return array(
'rsrc/js/application/conpherence/behavior-menu.js' => '1d45c74d', 'rsrc/js/application/conpherence/behavior-menu.js' => '1d45c74d',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', 'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861',
'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3',
'rsrc/js/application/conpherence/behavior-widget-pane.js' => 'a8458711', 'rsrc/js/application/conpherence/behavior-widget-pane.js' => '65845387',
'rsrc/js/application/countdown/timer.js' => 'e4cc26b3', 'rsrc/js/application/countdown/timer.js' => 'e4cc26b3',
'rsrc/js/application/daemon/behavior-bulk-job-reload.js' => 'edf8a145', 'rsrc/js/application/daemon/behavior-bulk-job-reload.js' => 'edf8a145',
'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e', 'rsrc/js/application/dashboard/behavior-dashboard-async-panel.js' => '469c0d9e',
@ -614,7 +614,7 @@ return array(
'config-options-css' => '0ede4c9b', 'config-options-css' => '0ede4c9b',
'config-page-css' => '8798e14f', 'config-page-css' => '8798e14f',
'conpherence-durable-column-view' => '194ac487', 'conpherence-durable-column-view' => '194ac487',
'conpherence-menu-css' => '3a0fd18a', 'conpherence-menu-css' => '4c959efa',
'conpherence-message-pane-css' => '31dc663d', 'conpherence-message-pane-css' => '31dc663d',
'conpherence-notification-css' => '6cdcc253', 'conpherence-notification-css' => '6cdcc253',
'conpherence-thread-manager' => '01774ab2', 'conpherence-thread-manager' => '01774ab2',
@ -664,7 +664,7 @@ return array(
'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a', 'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a',
'javelin-behavior-conpherence-menu' => '1d45c74d', 'javelin-behavior-conpherence-menu' => '1d45c74d',
'javelin-behavior-conpherence-pontificate' => '21ba5861', 'javelin-behavior-conpherence-pontificate' => '21ba5861',
'javelin-behavior-conpherence-widget-pane' => 'a8458711', 'javelin-behavior-conpherence-widget-pane' => '65845387',
'javelin-behavior-countdown-timer' => 'e4cc26b3', 'javelin-behavior-countdown-timer' => 'e4cc26b3',
'javelin-behavior-dark-console' => 'f411b6ae', 'javelin-behavior-dark-console' => 'f411b6ae',
'javelin-behavior-dashboard-async-panel' => '469c0d9e', 'javelin-behavior-dashboard-async-panel' => '469c0d9e',
@ -1479,6 +1479,19 @@ return array(
'javelin-request', 'javelin-request',
'javelin-workflow', 'javelin-workflow',
), ),
65845387 => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'javelin-workflow',
'javelin-util',
'phabricator-notification',
'javelin-behavior-device',
'phuix-dropdown-menu',
'phuix-action-list-view',
'phuix-action-view',
'conpherence-thread-manager',
),
'680ea2c8' => array( '680ea2c8' => array(
'javelin-install', 'javelin-install',
'javelin-dom', 'javelin-dom',
@ -1784,19 +1797,6 @@ return array(
'javelin-stratcom', 'javelin-stratcom',
'javelin-dom', 'javelin-dom',
), ),
'a8458711' => array(
'javelin-behavior',
'javelin-dom',
'javelin-stratcom',
'javelin-workflow',
'javelin-util',
'phabricator-notification',
'javelin-behavior-device',
'phuix-dropdown-menu',
'phuix-action-list-view',
'phuix-action-view',
'conpherence-thread-manager',
),
'a8d8459d' => array( 'a8d8459d' => array(
'javelin-behavior', 'javelin-behavior',
'javelin-dom', 'javelin-dom',

View file

@ -36,12 +36,6 @@ final class ConpherenceWidgetConfigConstants extends ConpherenceConstants {
'deviceOnly' => false, 'deviceOnly' => false,
'hasCreate' => false, 'hasCreate' => false,
), ),
'widgets-edit' => array(
'name' => pht('Edit Room'),
'icon' => 'fa-pencil',
'deviceOnly' => false,
'hasCreate' => false,
),
); );
} }

View file

@ -38,28 +38,8 @@ abstract class ConpherenceController extends PhabricatorController {
$crumbs = parent::buildApplicationCrumbs(); $crumbs = parent::buildApplicationCrumbs();
$crumbs->setBorder(true); $crumbs->setBorder(true);
$crumbs->addAction( if (!$is_rooms) {
id(new PHUIListItemView())
->setName(pht('Search'))
->setHref($this->getApplicationURI('search/'))
->setIcon('fa-search'));
if ($is_rooms) {
$crumbs $crumbs
->addAction(
id(new PHUIListItemView())
->setName(pht('New Room'))
->setHref($this->getApplicationURI('new/'))
->setIcon('fa-plus-square')
->setWorkflow(true));
} else {
$crumbs
->addAction(
id(new PHUIListItemView())
->setName(pht('New Room'))
->setHref($this->getApplicationURI('new/'))
->setIcon('fa-plus-square')
->setWorkflow(true))
->addAction( ->addAction(
id(new PHUIListItemView()) id(new PHUIListItemView())
->setName(pht('Room')) ->setName(pht('Room'))
@ -76,6 +56,7 @@ abstract class ConpherenceController extends PhabricatorController {
ConpherenceThread $conpherence, ConpherenceThread $conpherence,
array $policy_objects) { array $policy_objects) {
assert_instances_of($policy_objects, 'PhabricatorPolicy'); assert_instances_of($policy_objects, 'PhabricatorPolicy');
$viewer = $this->getViewer();
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$data = $conpherence->getDisplayData($this->getViewer()); $data = $conpherence->getDisplayData($this->getViewer());
@ -84,6 +65,21 @@ abstract class ConpherenceController extends PhabricatorController {
->setName($data['title']) ->setName($data['title'])
->setHref('/'.$conpherence->getMonogram())); ->setHref('/'.$conpherence->getMonogram()));
$can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer,
$conpherence,
PhabricatorPolicyCapability::CAN_EDIT);
$crumbs
->addAction(
id(new PHUIListItemView())
->setName(pht('Edit Room'))
->setHref(
$this->getApplicationURI('update/'.$conpherence->getID()).'/')
->setIcon('fa-pencil')
->setDisabled(!$can_edit)
->setWorkflow(true));
return hsprintf( return hsprintf(
'%s', '%s',
array( array(

View file

@ -82,13 +82,6 @@ final class ConpherenceWidgetController extends ConpherenceController {
'style' => 'display: none', 'style' => 'display: none',
), ),
$this->renderSettingsWidgetPaneContent()); $this->renderSettingsWidgetPaneContent());
$widgets[] = phutil_tag(
'div',
array(
'class' => 'widgets-body',
'id' => 'widgets-edit',
'style' => 'display: none',
));
// without this implosion we get "," between each element in our widgets // without this implosion we get "," between each element in our widgets
// array // array

View file

@ -99,9 +99,7 @@ final class ConpherenceThreadListView extends AphrontView {
array $rooms, array $rooms,
array $policy_objects) { array $policy_objects) {
$header = $this->renderMenuItemHeader( $header = $this->renderMenuItemHeader();
pht('Rooms'),
'conpherence-room-list-header');
$menu->addMenuItem($header); $menu->addMenuItem($header);
if (empty($rooms)) { if (empty($rooms)) {
@ -189,11 +187,53 @@ final class ConpherenceThreadListView extends AphrontView {
return $menu; return $menu;
} }
private function renderMenuItemHeader($title, $class = null) { private function renderMenuItemHeader() {
$rooms = phutil_tag(
'a',
array(
'class' => 'room-list-href',
'href' => '/conpherence/search/',
),
pht('Rooms'));
$new_icon = id(new PHUIIconView())
->setIcon('fa-plus-square')
->addSigil('has-tooltip')
->setHref('/conpherence/new/')
->setWorkflow(true)
->setMetaData(array(
'tip' => pht('New Room'),
));
$search_icon = id(new PHUIIconView())
->setIcon('fa-search')
->addSigil('has-tooltip')
->setHref('/conpherence/search/')
->setMetaData(array(
'tip' => pht('Search Rooms'),
));
$icons = phutil_tag(
'span',
array(
'class' => 'room-list-icons',
),
array(
$new_icon,
$search_icon,
));
$new_icon = id(new PHUIIconView())
->setIcon('fa-plus-square')
->setHref('/conpherence/new/')
->setWorkflow(true);
$custom = array($rooms, $icons);
$item = id(new PHUIListItemView()) $item = id(new PHUIListItemView())
->setType(PHUIListItemView::TYPE_LABEL) ->setType(PHUIListItemView::TYPE_CUSTOM)
->setName($title) ->setName($custom)
->addClass($class); ->addClass('conpherence-room-list-header');
return $item; return $item;
} }

View file

@ -51,8 +51,24 @@
display: none; display: none;
} }
.conpherence-menu-pane.phabricator-side-menu .phui-list-item-type-label { .conpherence-menu-pane.phabricator-side-menu .room-list-href {
padding: 10px 0 9px 8px; padding: 10px 0 9px 8px;
display: inline-block;
text-transform: uppercase;
color: {$darkgreytext};
font-weight: bold;
font-size: {$smallerfontsize};
}
.conpherence-menu-pane.phabricator-side-menu .room-list-icons {
display: inline-block;
float: right;
padding: 8px 0 5px;
}
.conpherence-menu-pane .conpherence-room-list-header {
clear: both;
overflow: hidden;
} }
.conpherence-menu-pane .conpherence-room-list-header .conpherence-menu-pane .conpherence-room-list-header
@ -60,7 +76,7 @@
font-weight: bold; font-weight: bold;
float: right; float: right;
text-transform: none; text-transform: none;
margin: 0px 8px 0px 0px; padding: 4px;
} }
.conpherence-menu-pane .conpherence-room-list-header .conpherence-menu-pane .conpherence-room-list-header

View file

@ -83,27 +83,11 @@ JX.behavior('conpherence-widget-pane', function(config) {
var handler; var handler;
var href; var href;
if (widget == 'widgets-edit') { handler = JX.bind(null, function(widget, e) {
var threadManager = JX.ConpherenceThreadManager.getInstance(); toggleWidget({widget: widget});
handler = function(e) { e.prevent();
e.prevent(); menu.close();
menu.close(); }, widget);
threadManager.runUpdateWorkflowFromLink(
e.getTarget(),
{
action : 'metadata',
force_ajax : true,
stage : 'submit'
});
};
href = threadManager._getUpdateURI();
} else {
handler = JX.bind(null, function(widget, e) {
toggleWidget({widget: widget});
e.prevent();
menu.close();
}, widget);
}
var item = new JX.PHUIXActionView() var item = new JX.PHUIXActionView()
.setIcon(widget_data.icon || 'none') .setIcon(widget_data.icon || 'none')
.setName(widget_data.name) .setName(widget_data.name)