Conpherence - some cleanup type stuff
Summary: this diff does a few, not so exciting things - changes "conpher" to "conpherence" where it snuck into CSS, spritemap, etc -- I believe we now consistently call it conpherence. Feel free to change it, just change it everywhere. :D - puts the widget icons in the right order per M14 - makes the "mobile-only" widgets show the toggles only in the mobile view - also made it so clicking them does nothing for now - removes the tasks widget since we don't want it ...my time is getting chopped up funny (yay puppy) so this is just an attempt at something that can go into the codebase and not make it worse. Next up is making the widgets that show on desktop look right / not say "TODO" Test Plan: played around in Conpherence Reviewers: epriestley, chad Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2530 Differential Revision: https://secure.phabricator.com/D5334
This commit is contained in:
@@ -483,18 +483,18 @@ celerity_register_resource_map(array(
|
||||
'disk' => '/rsrc/image/sprite-apps.png',
|
||||
'type' => 'png',
|
||||
),
|
||||
'/rsrc/image/sprite-conpher-X2.png' =>
|
||||
'/rsrc/image/sprite-conpherence-X2.png' =>
|
||||
array(
|
||||
'hash' => '88f5bf563e90d99ebe1b4ec552a963fc',
|
||||
'uri' => '/res/88f5bf56/rsrc/image/sprite-conpher-X2.png',
|
||||
'disk' => '/rsrc/image/sprite-conpher-X2.png',
|
||||
'hash' => '5e47868b00933a9afb6c844e464e6b23',
|
||||
'uri' => '/res/5e47868b/rsrc/image/sprite-conpherence-X2.png',
|
||||
'disk' => '/rsrc/image/sprite-conpherence-X2.png',
|
||||
'type' => 'png',
|
||||
),
|
||||
'/rsrc/image/sprite-conpher.png' =>
|
||||
'/rsrc/image/sprite-conpherence.png' =>
|
||||
array(
|
||||
'hash' => '08dcc68a6b2a89ecce11322f9ffe9d69',
|
||||
'uri' => '/res/08dcc68a/rsrc/image/sprite-conpher.png',
|
||||
'disk' => '/rsrc/image/sprite-conpher.png',
|
||||
'hash' => 'ca51f1be25213262d68e626e4cab7f0f',
|
||||
'uri' => '/res/ca51f1be/rsrc/image/sprite-conpherence.png',
|
||||
'disk' => '/rsrc/image/sprite-conpherence.png',
|
||||
'type' => 'png',
|
||||
),
|
||||
'/rsrc/image/sprite-docs-X2.png' =>
|
||||
@@ -828,7 +828,7 @@ celerity_register_resource_map(array(
|
||||
),
|
||||
'conpherence-widget-pane-css' =>
|
||||
array(
|
||||
'uri' => '/res/2b4113f7/rsrc/css/application/conpherence/widget-pane.css',
|
||||
'uri' => '/res/f728d1fc/rsrc/css/application/conpherence/widget-pane.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
@@ -1219,7 +1219,7 @@ celerity_register_resource_map(array(
|
||||
),
|
||||
'javelin-behavior-conpherence-widget-pane' =>
|
||||
array(
|
||||
'uri' => '/res/4fb51b46/rsrc/js/application/conpherence/behavior-widget-pane.js',
|
||||
'uri' => '/res/43a0fe1b/rsrc/js/application/conpherence/behavior-widget-pane.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
@@ -3478,14 +3478,14 @@ celerity_register_resource_map(array(
|
||||
),
|
||||
'disk' => '/rsrc/css/sprite-apps-xlarge.css',
|
||||
),
|
||||
'sprite-conpher-css' =>
|
||||
'sprite-conpherence-css' =>
|
||||
array(
|
||||
'uri' => '/res/6277b31f/rsrc/css/sprite-conpher.css',
|
||||
'uri' => '/res/f6793453/rsrc/css/sprite-conpherence.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
),
|
||||
'disk' => '/rsrc/css/sprite-conpher.css',
|
||||
'disk' => '/rsrc/css/sprite-conpherence.css',
|
||||
),
|
||||
'sprite-docs-css' =>
|
||||
array(
|
||||
|
||||
@@ -51,16 +51,21 @@ final class ConpherenceWidgetController extends
|
||||
|
||||
private function renderWidgetPaneContent() {
|
||||
require_celerity_resource('conpherence-widget-pane-css');
|
||||
require_celerity_resource('sprite-conpher-css');
|
||||
require_celerity_resource('sprite-conpherence-css');
|
||||
$can_toggle = 1;
|
||||
$cant_toggle = 0;
|
||||
Javelin::initBehavior(
|
||||
'conpherence-widget-pane',
|
||||
array(
|
||||
'form_pane' => 'conpherence-form',
|
||||
'file_widget' => 'widgets-files',
|
||||
'widgetRegistery' => array(
|
||||
'widgets-files' => 1,
|
||||
'widgets-tasks' => 1,
|
||||
'widgets-calendar' => 1,
|
||||
'widgets-conpherence-list' => $cant_toggle,
|
||||
'widgets-conversation' => $cant_toggle,
|
||||
'widgets-people' => $can_toggle,
|
||||
'widgets-files' => $can_toggle,
|
||||
'widgets-calendar' => $can_toggle,
|
||||
'widgets-settings' => $can_toggle,
|
||||
)
|
||||
));
|
||||
|
||||
@@ -77,11 +82,11 @@ final class ConpherenceWidgetController extends
|
||||
array(
|
||||
'sigil' => 'conpherence-change-widget',
|
||||
'meta' => array(
|
||||
'widget' => 'widgets-files',
|
||||
'toggleClass' => 'conpher_files_on'
|
||||
'widget' => 'widgets-conpherence-list',
|
||||
'toggleClass' => 'conpherence_list_on'
|
||||
),
|
||||
'id' => 'widgets-files-toggle',
|
||||
'class' => 'sprite-conpher conpher_files_off first-icon'
|
||||
'id' => 'widgets-conpherence-list-toggle',
|
||||
'class' => 'sprite-conpherence conpherence_list_off',
|
||||
),
|
||||
''),
|
||||
javelin_tag(
|
||||
@@ -89,11 +94,35 @@ final class ConpherenceWidgetController extends
|
||||
array(
|
||||
'sigil' => 'conpherence-change-widget',
|
||||
'meta' => array(
|
||||
'widget' => 'widgets-tasks',
|
||||
'toggleClass' => 'conpher_list_on'
|
||||
'widget' => 'widgets-conversation',
|
||||
'toggleClass' => 'conpherence_conversation_on'
|
||||
),
|
||||
'id' => 'widgets-tasks-toggle',
|
||||
'class' => 'sprite-conpher conpher_list_off conpher_list_on',
|
||||
'id' => 'widgets-conpherence-conversation-toggle',
|
||||
'class' => 'sprite-conpherence conpherence_conversation_off',
|
||||
),
|
||||
''),
|
||||
javelin_tag(
|
||||
'a',
|
||||
array(
|
||||
'sigil' => 'conpherence-change-widget',
|
||||
'meta' => array(
|
||||
'widget' => 'widgets-people',
|
||||
'toggleClass' => 'conpherence_people_on'
|
||||
),
|
||||
'id' => 'widgets-people-toggle',
|
||||
'class' => 'sprite-conpherence conpherence_people_off'
|
||||
),
|
||||
''),
|
||||
javelin_tag(
|
||||
'a',
|
||||
array(
|
||||
'sigil' => 'conpherence-change-widget',
|
||||
'meta' => array(
|
||||
'widget' => 'widgets-files',
|
||||
'toggleClass' => 'conpherence_files_on'
|
||||
),
|
||||
'id' => 'widgets-files-toggle',
|
||||
'class' => 'sprite-conpherence conpherence_files_off'
|
||||
),
|
||||
''),
|
||||
javelin_tag(
|
||||
@@ -102,13 +131,32 @@ final class ConpherenceWidgetController extends
|
||||
'sigil' => 'conpherence-change-widget',
|
||||
'meta' => array(
|
||||
'widget' => 'widgets-calendar',
|
||||
'toggleClass' => 'conpher_calendar_on'
|
||||
'toggleClass' => 'conpherence_calendar_on'
|
||||
),
|
||||
'id' => 'widgets-calendar-toggle',
|
||||
'class' => 'sprite-conpher conpher_calendar_off',
|
||||
'class' => 'sprite-conpherence conpherence_calendar_off',
|
||||
),
|
||||
''),
|
||||
javelin_tag(
|
||||
'a',
|
||||
array(
|
||||
'sigil' => 'conpherence-change-widget',
|
||||
'meta' => array(
|
||||
'widget' => 'widgets-settings',
|
||||
'toggleClass' => 'conpherence_settings_on'
|
||||
),
|
||||
'id' => 'widgets-settings-toggle',
|
||||
'class' => 'sprite-conpherence conpherence_settings_off',
|
||||
),
|
||||
'')
|
||||
)).
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'widgets-body',
|
||||
'id' => 'widgets-people',
|
||||
),
|
||||
$this->renderPeopleWidgetPaneContent()).
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
@@ -120,14 +168,7 @@ final class ConpherenceWidgetController extends
|
||||
->setConpherence($conpherence)
|
||||
->setUpdateURI(
|
||||
$this->getApplicationURI('update/'.$conpherence->getID().'/'))
|
||||
->render()).
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'widgets-body',
|
||||
'id' => 'widgets-tasks',
|
||||
),
|
||||
$this->renderTaskWidgetPaneContent()).
|
||||
->render()).
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
@@ -135,44 +176,25 @@ final class ConpherenceWidgetController extends
|
||||
'id' => 'widgets-calendar',
|
||||
'style' => 'display: none;'
|
||||
),
|
||||
$this->renderCalendarWidgetPaneContent());
|
||||
$this->renderCalendarWidgetPaneContent()).
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'widgets-body',
|
||||
'id' => 'widgets-settings',
|
||||
'style' => 'display: none'
|
||||
),
|
||||
$this->renderSettingsWidgetPaneContent());
|
||||
|
||||
return array('widgets' => $widgets);
|
||||
}
|
||||
|
||||
private function renderTaskWidgetPaneContent() {
|
||||
$conpherence = $this->getConpherence();
|
||||
$widget_data = $conpherence->getWidgetData();
|
||||
$tasks = $widget_data['tasks'];
|
||||
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
|
||||
$handles = $conpherence->getHandles();
|
||||
$content = array();
|
||||
foreach ($tasks as $owner_phid => $actual_tasks) {
|
||||
$handle = $handles[$owner_phid];
|
||||
$content[] = id(new PhabricatorHeaderView())
|
||||
->setHeader($handle->getName())
|
||||
->render();
|
||||
$actual_tasks = msort($actual_tasks, 'getPriority');
|
||||
$actual_tasks = array_reverse($actual_tasks);
|
||||
$data = array();
|
||||
foreach ($actual_tasks as $task) {
|
||||
$data[] = array(
|
||||
idx($priority_map, $task->getPriority(), pht('???')),
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '/T'.$task->getID()
|
||||
),
|
||||
$task->getTitle())
|
||||
);
|
||||
}
|
||||
$table = id(new AphrontTableView($data))
|
||||
->setNoDataString(pht('No open tasks.'))
|
||||
->setHeaders(array(pht('Pri'), pht('Title')))
|
||||
->setColumnClasses(array('', 'wide'));
|
||||
$content[] = $table->render();
|
||||
}
|
||||
return new PhutilSafeHTML(implode('', $content));
|
||||
private function renderPeopleWidgetPaneContent() {
|
||||
return 'TODO - people';
|
||||
}
|
||||
|
||||
private function renderSettingsWidgetPaneContent() {
|
||||
return 'TODO - settings';
|
||||
}
|
||||
|
||||
private function renderCalendarWidgetPaneContent() {
|
||||
|
||||
@@ -150,13 +150,6 @@ final class ConpherenceThreadQuery
|
||||
$participant_phids = array_mergev($participant_phids);
|
||||
$file_phids = array_mergev($file_phids);
|
||||
|
||||
// open tasks of all participants
|
||||
$tasks = id(new ManiphestTaskQuery())
|
||||
->withOwners($participant_phids)
|
||||
->withStatus(ManiphestTaskQuery::STATUS_OPEN)
|
||||
->execute();
|
||||
$tasks = mgroup($tasks, 'getOwnerPHID');
|
||||
|
||||
// statuses of everyone currently in the conpherence
|
||||
// for a rolling one week window
|
||||
$start_of_week = phabricator_format_local_time(
|
||||
@@ -191,7 +184,6 @@ final class ConpherenceThreadQuery
|
||||
$statuses = array_mergev($statuses);
|
||||
$statuses = msort($statuses, 'getDateFrom');
|
||||
$widget_data = array(
|
||||
'tasks' => array_select_keys($tasks, $participant_phids),
|
||||
'statuses' => $statuses,
|
||||
'files' => array_select_keys($files, $conpherence->getFilePHIDs()),
|
||||
);
|
||||
|
||||
@@ -214,7 +214,8 @@ final class CeleritySpriteGenerator {
|
||||
|
||||
|
||||
public function buildConpherenceSheet() {
|
||||
$icons = $this->getDirectoryList('conpher_1x');
|
||||
$name = 'conpherence';
|
||||
$icons = $this->getDirectoryList($name.'_1x');
|
||||
$scales = array(
|
||||
'1x' => 1,
|
||||
'2x' => 2,
|
||||
@@ -226,7 +227,7 @@ final class CeleritySpriteGenerator {
|
||||
foreach ($icons as $icon) {
|
||||
$color = preg_match('/_on/', $icon) ? 'on' : 'off';
|
||||
|
||||
$prefix = 'conpher_';
|
||||
$prefix = $name.'_';
|
||||
|
||||
$sprite = id(clone $template)
|
||||
->setName($prefix.$icon);
|
||||
@@ -247,7 +248,7 @@ final class CeleritySpriteGenerator {
|
||||
$sprites[] = $sprite;
|
||||
}
|
||||
|
||||
$sheet = $this->buildSheet('conpher', true);
|
||||
$sheet = $this->buildSheet($name, true);
|
||||
$sheet->setScales($scales);
|
||||
foreach ($sprites as $sprite) {
|
||||
$sheet->addSprite($sprite);
|
||||
|
||||
Reference in New Issue
Block a user