1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Remove Files Widget from Conpherence

Summary: Fixes T8834. Removes everywhere I could find references to Files.

Test Plan: Use Conpherence, send a message, attach a file, try durable column, send message, send file. Seems snappy.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T8834

Differential Revision: https://secure.phabricator.com/D13936
This commit is contained in:
Chad Little 2015-08-20 08:24:42 -07:00
parent 9790f93a83
commit 167eb9a256
8 changed files with 18 additions and 202 deletions

View file

@ -51,7 +51,7 @@ return array(
'rsrc/css/application/conpherence/notification.css' => '6cdcc253',
'rsrc/css/application/conpherence/transaction.css' => '85d0974c',
'rsrc/css/application/conpherence/update.css' => 'faf6be09',
'rsrc/css/application/conpherence/widget-pane.css' => 'b0793769',
'rsrc/css/application/conpherence/widget-pane.css' => '775eaaba',
'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4',
'rsrc/css/application/countdown/timer.css' => 'e7544472',
'rsrc/css/application/daemon/bulk-job.css' => 'df9c1d4a',
@ -346,7 +346,7 @@ return array(
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '01774ab2',
'rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js' => 'cf86d16a',
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'c72aa091',
'rsrc/js/application/conpherence/behavior-menu.js' => 'd3782c93',
'rsrc/js/application/conpherence/behavior-menu.js' => '1d45c74d',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861',
'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3',
'rsrc/js/application/conpherence/behavior-widget-pane.js' => 'a8458711',
@ -514,7 +514,7 @@ return array(
'conpherence-thread-manager' => '01774ab2',
'conpherence-transaction-css' => '85d0974c',
'conpherence-update-css' => 'faf6be09',
'conpherence-widget-pane-css' => 'b0793769',
'conpherence-widget-pane-css' => '775eaaba',
'differential-changeset-view-css' => 'b6b0d1bb',
'differential-core-view-css' => '7ac3cabc',
'differential-inline-comment-editor' => 'd4c87bf4',
@ -552,7 +552,7 @@ return array(
'javelin-behavior-choose-control' => '6153c708',
'javelin-behavior-config-reorder-fields' => 'b6993408',
'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a',
'javelin-behavior-conpherence-menu' => 'd3782c93',
'javelin-behavior-conpherence-menu' => '1d45c74d',
'javelin-behavior-conpherence-pontificate' => '21ba5861',
'javelin-behavior-conpherence-widget-pane' => 'a8458711',
'javelin-behavior-countdown-timer' => 'e4cc26b3',
@ -955,6 +955,20 @@ return array(
'javelin-dom',
'javelin-vector',
),
'1d45c74d' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-workflow',
'javelin-behavior-device',
'javelin-history',
'javelin-vector',
'javelin-scrollbar',
'phabricator-title',
'phabricator-shaped-request',
'conpherence-thread-manager',
),
'1def2711' => array(
'javelin-install',
'javelin-dom',
@ -1798,20 +1812,6 @@ return array(
'd254d646' => array(
'javelin-util',
),
'd3782c93' => array(
'javelin-behavior',
'javelin-dom',
'javelin-util',
'javelin-stratcom',
'javelin-workflow',
'javelin-behavior-device',
'javelin-history',
'javelin-vector',
'javelin-scrollbar',
'phabricator-title',
'phabricator-shaped-request',
'conpherence-thread-manager',
),
'd4505101' => array(
'javelin-stratcom',
'javelin-install',

View file

@ -232,7 +232,6 @@ phutil_register_library_map(array(
'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php',
'ConpherenceDurableColumnView' => 'applications/conpherence/view/ConpherenceDurableColumnView.php',
'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php',
'ConpherenceFileWidgetView' => 'applications/conpherence/view/ConpherenceFileWidgetView.php',
'ConpherenceFormDragAndDropUploadControl' => 'applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php',
'ConpherenceFulltextQuery' => 'applications/conpherence/query/ConpherenceFulltextQuery.php',
'ConpherenceHovercardEventListener' => 'applications/conpherence/events/ConpherenceHovercardEventListener.php',
@ -3853,7 +3852,6 @@ phutil_register_library_map(array(
'ConpherenceDAO' => 'PhabricatorLiskDAO',
'ConpherenceDurableColumnView' => 'AphrontTagView',
'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor',
'ConpherenceFileWidgetView' => 'ConpherenceWidgetView',
'ConpherenceFormDragAndDropUploadControl' => 'AphrontFormControl',
'ConpherenceFulltextQuery' => 'PhabricatorOffsetPagedQuery',
'ConpherenceHovercardEventListener' => 'PhabricatorEventListener',

View file

@ -30,12 +30,6 @@ final class ConpherenceWidgetConfigConstants extends ConpherenceConstants {
'customHref' => null,
),
),
'widgets-files' => array(
'name' => pht('Files'),
'icon' => 'fa-files-o',
'deviceOnly' => false,
'hasCreate' => false,
),
'widgets-settings' => array(
'name' => pht('Notifications'),
'icon' => 'fa-wrench',

View file

@ -524,13 +524,6 @@ final class ConpherenceUpdateController
->renderSingleThread($conpherence, $policy_objects);
$nav_item = hsprintf('%s', $nav_item);
break;
case ConpherenceUpdateActions::MESSAGE:
$file_widget = id(new ConpherenceFileWidgetView())
->setUser($this->getRequest()->getUser())
->setConpherence($conpherence)
->setUpdateURI($widget_uri);
$file_widget = hsprintf('%s', $file_widget->render());
break;
case ConpherenceUpdateActions::ADD_PERSON:
$people_widget = id(new ConpherencePeopleWidgetView())
->setUser($user)

View file

@ -41,9 +41,6 @@ final class ConpherenceWidgetController extends ConpherenceController {
case 'widgets-people':
$content = $this->renderPeopleWidgetPaneContent();
break;
case 'widgets-files':
$content = $this->renderFileWidgetPaneContent();
break;
case 'widgets-settings':
$content = $this->renderSettingsWidgetPaneContent();
break;
@ -90,15 +87,6 @@ final class ConpherenceWidgetController extends ConpherenceController {
'sigil' => 'widgets-people',
),
$this->renderPeopleWidgetPaneContent());
$widgets[] = javelin_tag(
'div',
array(
'class' => 'widgets-body',
'id' => 'widgets-files',
'sigil' => 'widgets-files',
'style' => 'display: none;',
),
$this->renderFileWidgetPaneContent());
$widgets[] = phutil_tag(
'div',
array(
@ -127,12 +115,6 @@ final class ConpherenceWidgetController extends ConpherenceController {
->setUpdateURI($this->getWidgetURI());
}
private function renderFileWidgetPaneContent() {
return id(new ConpherenceFileWidgetView())
->setUser($this->getViewer())
->setConpherence($this->getConpherence())
->setUpdateURI($this->getWidgetURI());
}
private function renderSettingsWidgetPaneContent() {
$viewer = $this->getViewer();

View file

@ -1,76 +0,0 @@
<?php
final class ConpherenceFileWidgetView extends ConpherenceWidgetView {
public function render() {
$conpherence = $this->getConpherence();
$widget_data = $conpherence->getWidgetData();
$files = $widget_data['files'];
$files_authors = $widget_data['files_authors'];
$files_html = array();
foreach ($files as $file) {
$icon_class = $file->getDisplayIconForMimeType();
$icon_view = phutil_tag(
'div',
array(
'class' => 'file-icon phui-font-fa phui-icon-view '.$icon_class,
),
'');
$file_view = id(new PhabricatorFileLinkView())
->setFilePHID($file->getPHID())
->setFileName(id(new PhutilUTF8StringTruncator())
->setMaximumGlyphs(28)
->truncateString($file->getName()))
->setFileViewable($file->isViewableImage())
->setFileViewURI($file->getBestURI())
->setCustomClass('file-title');
$who_done_it_text = '';
// system generated files don't have authors
if ($file->getAuthorPHID()) {
$who_done_it_text = pht(
'By %s ',
$files_authors[$file->getPHID()]->renderLink());
}
$date_text = phabricator_relative_date(
$file->getDateCreated(),
$this->getUser());
$who_done_it = phutil_tag(
'div',
array(
'class' => 'file-uploaded-by',
),
pht('%s%s.', $who_done_it_text, $date_text));
$files_html[] = phutil_tag(
'div',
array(
'class' => 'file-entry',
),
array(
$icon_view,
$file_view,
$who_done_it,
));
}
if (empty($files)) {
$files_html[] = javelin_tag(
'div',
array(
'class' => 'no-files',
'sigil' => 'no-files',
),
pht('No files.'));
}
return phutil_tag(
'div',
array('class' => 'file-list'),
$files_html);
}
}

View file

@ -95,69 +95,6 @@
top: 142px;
}
/* files widget */
.conpherence-widget-pane #widgets-files .no-files {
width: 200px;
padding: 20px;
text-align: center;
color: {$greytext};
}
.device .conpherence-widget-pane #widgets-files .no-files {
width: 60px;
margin: 0 auto 0 auto;
}
.conpherence-widget-pane #widgets-files .file-entry {
padding: 8px 0;
margin: 0 4px 0 8px;
border-bottom: 1px solid {$thinblueborder};
}
.conpherence-widget-pane #widgets-files .file-entry a {
color: {$darkbluetext};
font-weight: bold;
}
.conpherence-widget-pane #widgets-files .file-icon {
width: 32px;
height: 32px;
float: left;
font-size: 24px;
color: {$blue};
margin: 2px 0 2px 4px;
}
.conpherence-widget-pane #widgets-files .file-title {
display: block;
position: relative;
top: -4px;
left: 0;
overflow-x: hidden;
width: 180px;
font-weight: bold;
text-overflow: ellipsis;
white-space: nowrap;
}
.conpherence-widget-pane #widgets-files .file-uploaded-by {
color: {$lightgreytext};
position: relative;
top: 0;
left: 0;
width: 180px;
font-size: {$smallestfontsize};
}
.device .conpherence-widget-pane #widgets-files .file-title,
.device .conpherence-widget-pane #widgets-files .file-uploaded-by {
width: 82%;
}
.device .conpherence-widget-pane #widgets-files .divider {
width: 80%;
margin: 8px 0px 0px 10%;
}
.conpherence-widget-pane .widget-icon {
display: block;
height: 14px;

View file

@ -66,18 +66,6 @@ JX.behavior('conpherence-menu', function(config) {
var form_root = JX.DOM.find(root, 'div', 'conpherence-form');
var textarea = JX.DOM.find(form_root, 'textarea');
if (!non_update) {
var fileWidget = null;
try {
fileWidget = JX.DOM.find(root, 'div', 'widgets-files');
} catch (ex) {
// Ignore; maybe no files widget
}
if (fileWidget) {
JX.DOM.setContent(
fileWidget,
JX.$H(r.file_widget));
}
_scrollMessageWindow();
textarea.value = '';
}