From 7d576c3f94b5726b461106179d5c2df74106c91a Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Mon, 26 Sep 2016 10:16:48 -0400 Subject: [PATCH 01/21] Fix a bug in the imageproxy controller Summary: Somehow this got through last week :( It's a bug that causes the controller to... *ahem*... just not work. Luckily nothing uses this yet so nothing was really affected. Test Plan: Hit `/file/imageproxy/?uri=http://i.imgur.com/nTvVrYN.jpg` and are served a nice picture of a bird Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, yelirekim Differential Revision: https://secure.phabricator.com/D16598 --- .../files/controller/PhabricatorFileImageProxyController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/files/controller/PhabricatorFileImageProxyController.php b/src/applications/files/controller/PhabricatorFileImageProxyController.php index 5155229b7f..44573aea46 100644 --- a/src/applications/files/controller/PhabricatorFileImageProxyController.php +++ b/src/applications/files/controller/PhabricatorFileImageProxyController.php @@ -99,7 +99,7 @@ final class PhabricatorFileImageProxyController ->setViewer(PhabricatorUser::getOmnipotentUser()) ->withPHIDs(array($request->getFilePHID())) ->executeOne(); - if (!file) { + if (!$file) { throw new Exception(pht( 'The underlying file does not exist, but the cached request was '. 'successful. This likely means the file record was manually deleted '. From 26b29a60c0f8c48a6cad132487ea64c501f9dc58 Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Mon, 26 Sep 2016 09:56:49 -0400 Subject: [PATCH 02/21] Remarkup rule to embed images Summary: Ref T4190. Added the remarkup rule to embed images: Syntax is as follows: `{image }` Parameters are also supported, like: `{image uri=, width=500px, height=200px, alt=picture of a moose, href=google.com}` URLs without a protocol are not supported. Test Plan: Tested with many of the syntax variations. If the provided URL doesn't point to an image, then a broken image icon will be shown. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley, yelirekim Maniphest Tasks: T4190 Differential Revision: https://secure.phabricator.com/D16597 --- src/__phutil_library_map__.php | 2 + .../PhabricatorFilesApplication.php | 1 + .../markup/PhabricatorImageRemarkupRule.php | 75 +++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 src/applications/files/markup/PhabricatorImageRemarkupRule.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 8e67eea1b9..eb8c71e31d 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2688,6 +2688,7 @@ phutil_register_library_map(array( 'PhabricatorIconSetEditField' => 'applications/transactions/editfield/PhabricatorIconSetEditField.php', 'PhabricatorIconSetIcon' => 'applications/files/iconset/PhabricatorIconSetIcon.php', 'PhabricatorImageMacroRemarkupRule' => 'applications/macro/markup/PhabricatorImageMacroRemarkupRule.php', + 'PhabricatorImageRemarkupRule' => 'applications/files/markup/PhabricatorImageRemarkupRule.php', 'PhabricatorImageTransformer' => 'applications/files/PhabricatorImageTransformer.php', 'PhabricatorImagemagickSetupCheck' => 'applications/config/check/PhabricatorImagemagickSetupCheck.php', 'PhabricatorInFlightErrorView' => 'applications/config/view/PhabricatorInFlightErrorView.php', @@ -7523,6 +7524,7 @@ phutil_register_library_map(array( 'PhabricatorIconSetEditField' => 'PhabricatorEditField', 'PhabricatorIconSetIcon' => 'Phobject', 'PhabricatorImageMacroRemarkupRule' => 'PhutilRemarkupRule', + 'PhabricatorImageRemarkupRule' => 'PhutilRemarkupRule', 'PhabricatorImageTransformer' => 'Phobject', 'PhabricatorImagemagickSetupCheck' => 'PhabricatorSetupCheck', 'PhabricatorInFlightErrorView' => 'AphrontView', diff --git a/src/applications/files/application/PhabricatorFilesApplication.php b/src/applications/files/application/PhabricatorFilesApplication.php index 4247de5bd4..4b1cb253bb 100644 --- a/src/applications/files/application/PhabricatorFilesApplication.php +++ b/src/applications/files/application/PhabricatorFilesApplication.php @@ -37,6 +37,7 @@ final class PhabricatorFilesApplication extends PhabricatorApplication { public function getRemarkupRules() { return array( new PhabricatorEmbedFileRemarkupRule(), + new PhabricatorImageRemarkupRule(), ); } diff --git a/src/applications/files/markup/PhabricatorImageRemarkupRule.php b/src/applications/files/markup/PhabricatorImageRemarkupRule.php new file mode 100644 index 0000000000..9e91bdc096 --- /dev/null +++ b/src/applications/files/markup/PhabricatorImageRemarkupRule.php @@ -0,0 +1,75 @@ +isFlatText($matches[0])) { + return $matches[0]; + } + $args = array(); + $defaults = array( + 'uri' => null, + 'alt' => null, + 'href' => null, + 'width' => null, + 'height' => null, + ); + $trimmed_match = trim($matches[2]); + if ($this->isURI($trimmed_match)) { + $args['uri'] = new PhutilURI($trimmed_match); + } else { + $parser = new PhutilSimpleOptions(); + $keys = $parser->parse($trimmed_match); + + $uri_key = ''; + foreach (array('src', 'uri', 'url') as $key) { + if (array_key_exists($key, $keys)) { + $uri_key = $key; + } + } + if ($uri_key) { + $args['uri'] = new PhutilURI($keys[$uri_key]); + } + $args += $keys; + } + + $args += $defaults; + + if ($args['href'] && !PhabricatorEnv::isValidURIForLink($args['href'])) { + $args['href'] = null; + } + + if ($args['uri']) { + $src_uri = id(new PhutilURI('/file/imageproxy/')) + ->setQueryParam('uri', (string)$args['uri']); + $img = $this->newTag( + 'img', + array( + 'src' => $src_uri, + 'alt' => $args['alt'], + 'href' => $args['href'], + 'width' => $args['width'], + 'height' => $args['height'], + )); + return $this->getEngine()->storeText($img); + } else { + return $matches[0]; + } + } + + private function isURI($uri_string) { + // Very simple check to make sure it starts with either http or https. + // If it does, we'll try to treat it like a valid URI + return preg_match('~^https?\:\/\/.*\z~i', $uri_string); + } +} From f2bb9bc061435fbbd91d05e9fa7dbb7e737ce503 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 27 Sep 2016 09:29:43 -0700 Subject: [PATCH 03/21] When summing points on a workboard, display sum with same precision as most-precise value Summary: Fixes T11703. This mostly avoids rounding errors. If point values include "0.001", we also get three digits of precision: 1.000. Maybe useful if your point field is called "bitcoins" or something. Test Plan: Before: {F1851404} After: {F1851405} Reviewers: chad Reviewed By: chad Maniphest Tasks: T11703 Differential Revision: https://secure.phabricator.com/D16601 --- resources/celerity/map.php | 12 ++++++------ .../rsrc/js/application/projects/WorkboardColumn.js | 11 +++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 802fe48b7f..eb9f2b9797 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -495,7 +495,7 @@ return array( 'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '5e9f347c', 'rsrc/js/application/projects/WorkboardBoard.js' => 'fe7cb52a', 'rsrc/js/application/projects/WorkboardCard.js' => 'c587b80f', - 'rsrc/js/application/projects/WorkboardColumn.js' => 'bae58312', + 'rsrc/js/application/projects/WorkboardColumn.js' => '21df4ff5', 'rsrc/js/application/projects/WorkboardController.js' => '55baf5ed', 'rsrc/js/application/projects/behavior-project-boards.js' => '14a1faae', 'rsrc/js/application/projects/behavior-project-create.js' => '065227cc', @@ -825,7 +825,7 @@ return array( 'javelin-websocket' => 'e292eaf4', 'javelin-workboard-board' => 'fe7cb52a', 'javelin-workboard-card' => 'c587b80f', - 'javelin-workboard-column' => 'bae58312', + 'javelin-workboard-column' => '21df4ff5', 'javelin-workboard-controller' => '55baf5ed', 'javelin-workflow' => '1e911d0f', 'lightbox-attachment-css' => '7acac05d', @@ -1162,6 +1162,10 @@ return array( 'javelin-stratcom', 'conpherence-thread-manager', ), + '21df4ff5' => array( + 'javelin-install', + 'javelin-workboard-card', + ), '2290aeef' => array( 'javelin-install', 'javelin-dom', @@ -1922,10 +1926,6 @@ return array( 'javelin-uri', 'phabricator-notification', ), - 'bae58312' => array( - 'javelin-install', - 'javelin-workboard-card', - ), 'bb1dd507' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/webroot/rsrc/js/application/projects/WorkboardColumn.js b/webroot/rsrc/js/application/projects/WorkboardColumn.js index ced39dcd73..81fba84077 100644 --- a/webroot/rsrc/js/application/projects/WorkboardColumn.js +++ b/webroot/rsrc/js/application/projects/WorkboardColumn.js @@ -222,6 +222,7 @@ JX.install('WorkboardColumn', { var points = {}; var count = 0; + var decimal_places = 0; for (var phid in cards) { var card = cards[phid]; @@ -238,6 +239,15 @@ JX.install('WorkboardColumn', { points[status] = 0; } points[status] += card_points; + + // Count the number of decimal places in the point value with the + // most decimal digits. We'll use the same precision when rendering + // the point sum. This avoids rounding errors and makes the display + // a little more consistent. + var parts = card_points.toString().split('.'); + if (parts[1]) { + decimal_places = Math.max(decimal_places, parts[1].length); + } } count++; @@ -247,6 +257,7 @@ JX.install('WorkboardColumn', { for (var k in points) { total_points += points[k]; } + total_points = total_points.toFixed(decimal_places); var limit = this.getPointLimit(); From fc821188483e8852d430f2a558357457bbe6d138 Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Mon, 26 Sep 2016 21:59:03 -0400 Subject: [PATCH 04/21] Expose conduit API methods for Phurl URLs Summary: Fixes T10681. Adds a search API endpoint and an edit API endpoint for Phurl URLs. I still need to add the ability to search by name, alias, URL, and maybe description. Test Plan: Test the methods through `/conduit/method/phurls.search/` and `/conduit/method/phurls.edit/` Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley, yelirekim Maniphest Tasks: T10681 Differential Revision: https://secure.phabricator.com/D16600 --- .../sql/autopatches/20160927.phurl.ngrams.php | 11 ++++ .../sql/autopatches/20160927.phurl.ngrams.sql | 7 +++ src/__phutil_library_map__.php | 8 +++ ...habricatorPhurlURLEditConduitAPIMethod.php | 18 ++++++ ...bricatorPhurlURLSearchConduitAPIMethod.php | 18 ++++++ .../phurl/query/PhabricatorPhurlURLQuery.php | 6 ++ .../query/PhabricatorPhurlURLSearchEngine.php | 25 ++++++++ .../phurl/storage/PhabricatorPhurlURL.php | 63 +++++++++++++++++-- .../storage/PhabricatorPhurlURLNameNgrams.php | 18 ++++++ 9 files changed, 169 insertions(+), 5 deletions(-) create mode 100644 resources/sql/autopatches/20160927.phurl.ngrams.php create mode 100644 resources/sql/autopatches/20160927.phurl.ngrams.sql create mode 100644 src/applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php create mode 100644 src/applications/phurl/conduit/PhabricatorPhurlURLSearchConduitAPIMethod.php create mode 100644 src/applications/phurl/storage/PhabricatorPhurlURLNameNgrams.php diff --git a/resources/sql/autopatches/20160927.phurl.ngrams.php b/resources/sql/autopatches/20160927.phurl.ngrams.php new file mode 100644 index 0000000000..74cf61efa5 --- /dev/null +++ b/resources/sql/autopatches/20160927.phurl.ngrams.php @@ -0,0 +1,11 @@ +getPHID(), + array( + 'force' => true, + )); +} diff --git a/resources/sql/autopatches/20160927.phurl.ngrams.sql b/resources/sql/autopatches/20160927.phurl.ngrams.sql new file mode 100644 index 0000000000..b5b35a24f5 --- /dev/null +++ b/resources/sql/autopatches/20160927.phurl.ngrams.sql @@ -0,0 +1,7 @@ +CREATE TABLE {$NAMESPACE}_phurl.phurl_phurlname_ngrams ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + objectID INT UNSIGNED NOT NULL, + ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT}, + KEY `key_object` (objectID), + KEY `key_ngram` (ngram, objectID) +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index eb8c71e31d..4e4192e4be 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3187,14 +3187,17 @@ phutil_register_library_map(array( 'PhabricatorPhurlURLAccessController' => 'applications/phurl/controller/PhabricatorPhurlURLAccessController.php', 'PhabricatorPhurlURLCommentController' => 'applications/phurl/controller/PhabricatorPhurlURLCommentController.php', 'PhabricatorPhurlURLCreateCapability' => 'applications/phurl/capability/PhabricatorPhurlURLCreateCapability.php', + 'PhabricatorPhurlURLEditConduitAPIMethod' => 'applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php', 'PhabricatorPhurlURLEditController' => 'applications/phurl/controller/PhabricatorPhurlURLEditController.php', 'PhabricatorPhurlURLEditEngine' => 'applications/phurl/editor/PhabricatorPhurlURLEditEngine.php', 'PhabricatorPhurlURLEditor' => 'applications/phurl/editor/PhabricatorPhurlURLEditor.php', 'PhabricatorPhurlURLListController' => 'applications/phurl/controller/PhabricatorPhurlURLListController.php', 'PhabricatorPhurlURLMailReceiver' => 'applications/phurl/mail/PhabricatorPhurlURLMailReceiver.php', + 'PhabricatorPhurlURLNameNgrams' => 'applications/phurl/storage/PhabricatorPhurlURLNameNgrams.php', 'PhabricatorPhurlURLPHIDType' => 'applications/phurl/phid/PhabricatorPhurlURLPHIDType.php', 'PhabricatorPhurlURLQuery' => 'applications/phurl/query/PhabricatorPhurlURLQuery.php', 'PhabricatorPhurlURLReplyHandler' => 'applications/phurl/mail/PhabricatorPhurlURLReplyHandler.php', + 'PhabricatorPhurlURLSearchConduitAPIMethod' => 'applications/phurl/conduit/PhabricatorPhurlURLSearchConduitAPIMethod.php', 'PhabricatorPhurlURLSearchEngine' => 'applications/phurl/query/PhabricatorPhurlURLSearchEngine.php', 'PhabricatorPhurlURLTransaction' => 'applications/phurl/storage/PhabricatorPhurlURLTransaction.php', 'PhabricatorPhurlURLTransactionComment' => 'applications/phurl/storage/PhabricatorPhurlURLTransactionComment.php', @@ -8104,18 +8107,23 @@ phutil_register_library_map(array( 'PhabricatorMentionableInterface', 'PhabricatorFlaggableInterface', 'PhabricatorSpacesInterface', + 'PhabricatorConduitResultInterface', + 'PhabricatorNgramsInterface', ), 'PhabricatorPhurlURLAccessController' => 'PhabricatorPhurlController', 'PhabricatorPhurlURLCommentController' => 'PhabricatorPhurlController', 'PhabricatorPhurlURLCreateCapability' => 'PhabricatorPolicyCapability', + 'PhabricatorPhurlURLEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod', 'PhabricatorPhurlURLEditController' => 'PhabricatorPhurlController', 'PhabricatorPhurlURLEditEngine' => 'PhabricatorEditEngine', 'PhabricatorPhurlURLEditor' => 'PhabricatorApplicationTransactionEditor', 'PhabricatorPhurlURLListController' => 'PhabricatorPhurlController', 'PhabricatorPhurlURLMailReceiver' => 'PhabricatorObjectMailReceiver', + 'PhabricatorPhurlURLNameNgrams' => 'PhabricatorSearchNgrams', 'PhabricatorPhurlURLPHIDType' => 'PhabricatorPHIDType', 'PhabricatorPhurlURLQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorPhurlURLReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler', + 'PhabricatorPhurlURLSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod', 'PhabricatorPhurlURLSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorPhurlURLTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorPhurlURLTransactionComment' => 'PhabricatorApplicationTransactionComment', diff --git a/src/applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php b/src/applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php new file mode 100644 index 0000000000..2f78c87489 --- /dev/null +++ b/src/applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php @@ -0,0 +1,18 @@ +withNgramsConstraint( + id(new PhabricatorPhurlURLNameNgrams()), + $ngrams); + } + public function withLongURLs(array $long_urls) { $this->longURLs = $long_urls; return $this; diff --git a/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php b/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php index 9c91adf17d..f2e2c99399 100644 --- a/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php +++ b/src/applications/phurl/query/PhabricatorPhurlURLSearchEngine.php @@ -25,6 +25,19 @@ final class PhabricatorPhurlURLSearchEngine ->setLabel(pht('Created By')) ->setKey('authorPHIDs') ->setDatasource(new PhabricatorPeopleUserFunctionDatasource()), + id(new PhabricatorSearchTextField()) + ->setLabel(pht('Name Contains')) + ->setKey('name') + ->setDescription(pht('Search for Phurl URLs by name substring.')), + id(new PhabricatorSearchStringListField()) + ->setLabel(pht('Aliases')) + ->setKey('aliases') + ->setDescription(pht('Search for Phurl URLs by alias.')), + id(new PhabricatorSearchStringListField()) + ->setLabel(pht('Long URLs')) + ->setKey('longurls') + ->setDescription( + pht('Search for Phurl URLs by the non-shortened URL.')), ); } @@ -35,6 +48,18 @@ final class PhabricatorPhurlURLSearchEngine $query->withAuthorPHIDs($map['authorPHIDs']); } + if ($map['name'] !== null) { + $query->withNameNgrams($map['name']); + } + + if ($map['aliases']) { + $query->withAliases($map['aliases']); + } + + if ($map['longurls']) { + $query->withLongURLs($map['longurls']); + } + return $query; } diff --git a/src/applications/phurl/storage/PhabricatorPhurlURL.php b/src/applications/phurl/storage/PhabricatorPhurlURL.php index db82e20baf..c36bf6e8cb 100644 --- a/src/applications/phurl/storage/PhabricatorPhurlURL.php +++ b/src/applications/phurl/storage/PhabricatorPhurlURL.php @@ -9,7 +9,9 @@ final class PhabricatorPhurlURL extends PhabricatorPhurlDAO PhabricatorDestructibleInterface, PhabricatorMentionableInterface, PhabricatorFlaggableInterface, - PhabricatorSpacesInterface { + PhabricatorSpacesInterface, + PhabricatorConduitResultInterface, + PhabricatorNgramsInterface { protected $name; protected $alias; @@ -103,12 +105,12 @@ final class PhabricatorPhurlURL extends PhabricatorPhurlDAO } else { $path = '/u/'.$this->getID(); } - $short_domain = PhabricatorEnv::getEnvConfig('phurl.short-uri'); - if (!$short_domain) { - return $path; + $domain = PhabricatorEnv::getEnvConfig('phurl.short-uri'); + if (!$domain) { + $domain = PhabricatorEnv::getEnvConfig('phabricator.base-uri'); } - $uri = new PhutilURI($short_domain); + $uri = new PhutilURI($domain); $uri->setPath($path); return (string)$uri; } @@ -202,4 +204,55 @@ final class PhabricatorPhurlURL extends PhabricatorPhurlDAO public function getSpacePHID() { return $this->spacePHID; } + +/* -( PhabricatorConduitResultInterface )---------------------------------- */ + + + public function getFieldSpecificationsForConduit() { + return array( + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('name') + ->setType('string') + ->setDescription(pht('URL name.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('alias') + ->setType('string') + ->setDescription(pht('The alias for the URL.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('longurl') + ->setType('string') + ->setDescription(pht('The pre-shortened URL.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('description') + ->setType('string') + ->setDescription(pht('A description of the URL.')), + ); + } + + public function getFieldValuesForConduit() { + return array( + 'name' => $this->getName(), + 'alias' => $this->getAlias(), + 'description' => $this->getDescription(), + 'urls' => array( + 'long' => $this->getLongURL(), + 'short' => $this->getRedirectURI(), + ), + ); + } + + public function getConduitSearchAttachments() { + return array(); + } + +/* -( PhabricatorNgramInterface )------------------------------------------ */ + + + public function newNgrams() { + return array( + id(new PhabricatorPhurlURLNameNgrams()) + ->setValue($this->getName()), + ); + } + } diff --git a/src/applications/phurl/storage/PhabricatorPhurlURLNameNgrams.php b/src/applications/phurl/storage/PhabricatorPhurlURLNameNgrams.php new file mode 100644 index 0000000000..0a760e32b9 --- /dev/null +++ b/src/applications/phurl/storage/PhabricatorPhurlURLNameNgrams.php @@ -0,0 +1,18 @@ + Date: Tue, 27 Sep 2016 01:18:11 -0400 Subject: [PATCH 05/21] Remove "Application" field from ConduitSearchEngine Summary: Fixes T9063. Removes the "Application" field from the search because it was largely redundant with the 'Name Contains' field. Test Plan: Went to `/conduit/query/modern/`, clicked on `Edit Query` and noted that there is no "Application" field anymore. The 'Name Contains' field still works however. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley, yelirekim Maniphest Tasks: T9063 Differential Revision: https://secure.phabricator.com/D16602 --- .../query/PhabricatorConduitMethodQuery.php | 16 -------------- .../query/PhabricatorConduitSearchEngine.php | 22 ------------------- 2 files changed, 38 deletions(-) diff --git a/src/applications/conduit/query/PhabricatorConduitMethodQuery.php b/src/applications/conduit/query/PhabricatorConduitMethodQuery.php index 512dc70e6f..0409e4ceb3 100644 --- a/src/applications/conduit/query/PhabricatorConduitMethodQuery.php +++ b/src/applications/conduit/query/PhabricatorConduitMethodQuery.php @@ -21,11 +21,6 @@ final class PhabricatorConduitMethodQuery return $this; } - public function withApplicationNames(array $application_names) { - $this->applicationNames = $application_names; - return $this; - } - public function withIsStable($is_stable) { $this->isStable = $is_stable; return $this; @@ -86,17 +81,6 @@ final class PhabricatorConduitMethodQuery } } - if ($this->applicationNames) { - $map = array_fuse($this->applicationNames); - foreach ($methods as $key => $method) { - $needle = $method->getApplicationName(); - $needle = phutil_utf8_strtolower($needle); - if (empty($map[$needle])) { - unset($methods[$key]); - } - } - } - if ($this->nameContains) { $needle = phutil_utf8_strtolower($this->nameContains); foreach ($methods as $key => $method) { diff --git a/src/applications/conduit/query/PhabricatorConduitSearchEngine.php b/src/applications/conduit/query/PhabricatorConduitSearchEngine.php index 22e4e19e53..3c01005722 100644 --- a/src/applications/conduit/query/PhabricatorConduitSearchEngine.php +++ b/src/applications/conduit/query/PhabricatorConduitSearchEngine.php @@ -21,11 +21,6 @@ final class PhabricatorConduitSearchEngine $saved->setParameter('isStable', $request->getStr('isStable')); $saved->setParameter('isUnstable', $request->getStr('isUnstable')); $saved->setParameter('isDeprecated', $request->getStr('isDeprecated')); - - $saved->setParameter( - 'applicationNames', - $request->getStrList('applicationNames')); - $saved->setParameter('nameContains', $request->getStr('nameContains')); return $saved; @@ -39,11 +34,6 @@ final class PhabricatorConduitSearchEngine $query->withIsDeprecated($saved->getParameter('isDeprecated')); $query->withIsInternal(false); - $names = $saved->getParameter('applicationNames', array()); - if ($names) { - $query->withApplicationNames($names); - } - $contains = $saved->getParameter('nameContains'); if (strlen($contains)) { $query->withNameContains($contains); @@ -63,18 +53,6 @@ final class PhabricatorConduitSearchEngine ->setName('nameContains') ->setValue($saved->getParameter('nameContains'))); - $names = $saved->getParameter('applicationNames', array()); - $form - ->appendChild( - id(new AphrontFormTextControl()) - ->setLabel(pht('Applications')) - ->setName('applicationNames') - ->setValue(implode(', ', $names)) - ->setCaption( - pht( - 'Example: %s', - phutil_tag('tt', array(), 'differential, paste')))); - $is_stable = $saved->getParameter('isStable'); $is_unstable = $saved->getParameter('isUnstable'); $is_deprecated = $saved->getParameter('isDeprecated'); From 0fc05ab47edd451969c025a09661ac71f5c5a708 Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Tue, 27 Sep 2016 02:15:59 -0400 Subject: [PATCH 06/21] Link to badge view from people profile view Summary: Fixes T10715. Badges on the profile view now link to the badge view Test Plan: Went to the profile view and clicked the link. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, yelirekim Maniphest Tasks: T10715 Differential Revision: https://secure.phabricator.com/D16604 --- .../people/controller/PhabricatorPeopleProfileViewController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php index 4621aba3c5..657fd0435e 100644 --- a/src/applications/people/controller/PhabricatorPeopleProfileViewController.php +++ b/src/applications/people/controller/PhabricatorPeopleProfileViewController.php @@ -293,6 +293,7 @@ final class PhabricatorPeopleProfileViewController ->setHeader($badge->getName()) ->setSubhead($badge->getFlavor()) ->setQuality($badge->getQuality()) + ->setHref($badge->getViewURI()) ->addByLine($awarder_info); $flex->addItem($item); From 700666ae0a981699724a27ca8d96456d7be74540 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 27 Sep 2016 19:26:02 -0700 Subject: [PATCH 07/21] Make Conpherence Pontificate Send-on-Enter Summary: Fixes T11623. Enables send-on-enter and shift-enter for linebreaks, per durable column. Also cleaned up UI for Joining Room or Logging In. Test Plan: See room I can join, click Join Room. Leave Room, Log out, visit room with login prompt. Login, Join Room again. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T11623 Differential Revision: https://secure.phabricator.com/D16595 --- resources/celerity/map.php | 34 ++++---- src/__phutil_library_map__.php | 2 +- .../controller/ConpherenceController.php | 44 ++++++++++- .../controller/ConpherenceViewController.php | 77 ++++++++++++------- .../view/ConpherenceLayoutView.php | 45 +++++------ src/view/form/AphrontFormView.php | 14 ++-- .../application/conpherence/message-pane.css | 62 ++++++++------- webroot/rsrc/css/phui/phui-form-view.css | 6 -- .../conpherence/behavior-pontificate.js | 27 ++++++- 9 files changed, 196 insertions(+), 115 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index eb9f2b9797..f4b3217e8a 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,9 +7,9 @@ */ return array( 'names' => array( - 'conpherence.pkg.css' => '80a3fcb3', - 'conpherence.pkg.js' => '89b4837e', - 'core.pkg.css' => 'f7b03076', + 'conpherence.pkg.css' => '5722975a', + 'conpherence.pkg.js' => '11f3e07e', + 'core.pkg.css' => '2fd26498', 'core.pkg.js' => '1d376fa9', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '3fb7f532', @@ -49,7 +49,7 @@ return array( 'rsrc/css/application/conpherence/durable-column.css' => '194ac487', 'rsrc/css/application/conpherence/header-pane.css' => '517de9fe', 'rsrc/css/application/conpherence/menu.css' => '78c7b811', - 'rsrc/css/application/conpherence/message-pane.css' => '8d13ac4d', + 'rsrc/css/application/conpherence/message-pane.css' => '1b49960e', 'rsrc/css/application/conpherence/notification.css' => '6cdcc253', 'rsrc/css/application/conpherence/participant-pane.css' => '7bba0b56', 'rsrc/css/application/conpherence/transaction.css' => '46253e19', @@ -138,7 +138,7 @@ return array( 'rsrc/css/phui/phui-document.css' => 'c32e8dec', 'rsrc/css/phui/phui-feed-story.css' => 'aa49845d', 'rsrc/css/phui/phui-fontkit.css' => '9cda225e', - 'rsrc/css/phui/phui-form-view.css' => '76b4a46c', + 'rsrc/css/phui/phui-form-view.css' => '9e22b190', 'rsrc/css/phui/phui-form.css' => 'aac1d51d', 'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f', 'rsrc/css/phui/phui-header-view.css' => '06385974', @@ -441,7 +441,7 @@ return array( 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'd3506890', 'rsrc/js/application/conpherence/behavior-menu.js' => '9eb55204', 'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8', - 'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861', + 'rsrc/js/application/conpherence/behavior-pontificate.js' => 'f2e58483', 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', 'rsrc/js/application/conpherence/behavior-toggle-widget.js' => '9bdbbab0', 'rsrc/js/application/countdown/timer.js' => 'e4cc26b3', @@ -621,7 +621,7 @@ return array( 'conpherence-durable-column-view' => '194ac487', 'conpherence-header-pane-css' => '517de9fe', 'conpherence-menu-css' => '78c7b811', - 'conpherence-message-pane-css' => '8d13ac4d', + 'conpherence-message-pane-css' => '1b49960e', 'conpherence-notification-css' => '6cdcc253', 'conpherence-participant-pane-css' => '7bba0b56', 'conpherence-thread-manager' => '01774ab2', @@ -670,7 +670,7 @@ return array( 'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a', 'javelin-behavior-conpherence-menu' => '9eb55204', 'javelin-behavior-conpherence-participant-pane' => '8604caa8', - 'javelin-behavior-conpherence-pontificate' => '21ba5861', + 'javelin-behavior-conpherence-pontificate' => 'f2e58483', 'javelin-behavior-countdown-timer' => 'e4cc26b3', 'javelin-behavior-dark-console' => 'f411b6ae', 'javelin-behavior-dashboard-async-panel' => '469c0d9e', @@ -915,7 +915,7 @@ return array( 'phui-font-icon-base-css' => '870a7360', 'phui-fontkit-css' => '9cda225e', 'phui-form-css' => 'aac1d51d', - 'phui-form-view-css' => '76b4a46c', + 'phui-form-view-css' => '9e22b190', 'phui-head-thing-view-css' => 'fd311e5f', 'phui-header-view-css' => '06385974', 'phui-hovercard' => '1bd28176', @@ -1154,14 +1154,6 @@ return array( 'javelin-uri', 'javelin-routable', ), - '21ba5861' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-util', - 'javelin-workflow', - 'javelin-stratcom', - 'conpherence-thread-manager', - ), '21df4ff5' => array( 'javelin-install', 'javelin-workboard-card', @@ -2208,6 +2200,14 @@ return array( 'f03e17be' => array( 'phui-theme-css', ), + 'f2e58483' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-util', + 'javelin-workflow', + 'javelin-stratcom', + 'conpherence-thread-manager', + ), 'f411b6ae' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 4e4192e4be..7704b557f8 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -4769,7 +4769,7 @@ phutil_register_library_map(array( 'ConpherenceFulltextQuery' => 'PhabricatorOffsetPagedQuery', 'ConpherenceImageData' => 'ConpherenceConstants', 'ConpherenceIndex' => 'ConpherenceDAO', - 'ConpherenceLayoutView' => 'AphrontView', + 'ConpherenceLayoutView' => 'AphrontTagView', 'ConpherenceListController' => 'ConpherenceController', 'ConpherenceMenuItemView' => 'AphrontTagView', 'ConpherenceNewRoomController' => 'ConpherenceController', diff --git a/src/applications/conpherence/controller/ConpherenceController.php b/src/applications/conpherence/controller/ConpherenceController.php index c89923ba83..c4750a08a8 100644 --- a/src/applications/conpherence/controller/ConpherenceController.php +++ b/src/applications/conpherence/controller/ConpherenceController.php @@ -62,9 +62,15 @@ abstract class ConpherenceController extends PhabricatorController { ->addClass((!$data['topic']) ? 'conpherence-no-topic' : null); $can_edit = PhabricatorPolicyFilter::hasCapability( - $viewer, - $conpherence, - PhabricatorPolicyCapability::CAN_EDIT); + $viewer, + $conpherence, + PhabricatorPolicyCapability::CAN_EDIT); + + $participating = $conpherence->getParticipantIfExists($viewer->getPHID()); + $can_join = PhabricatorPolicyFilter::hasCapability( + $viewer, + $conpherence, + PhabricatorPolicyCapability::CAN_JOIN); $header->addActionItem( id(new PHUIIconCircleView()) @@ -101,6 +107,38 @@ abstract class ConpherenceController extends PhabricatorController { ->setIcon('fa-group') ->setHref('#') ->addClass('conpherence-participant-toggle')); + + if ($can_join && !$participating) { + $action = ConpherenceUpdateActions::JOIN_ROOM; + $uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); + $button = phutil_tag( + 'button', + array( + 'type' => 'SUBMIT', + 'class' => 'button green mlr', + ), + pht('Join Room')); + + $hidden = phutil_tag( + 'input', + array( + 'type' => 'hidden', + 'name' => 'action', + 'value' => ConpherenceUpdateActions::JOIN_ROOM, + )); + + $form = phabricator_form( + $viewer, + array( + 'method' => 'POST', + 'action' => (string)$uri, + ), + array( + $hidden, + $button, + )); + $header->addActionItem($form); + } } return $header; diff --git a/src/applications/conpherence/controller/ConpherenceViewController.php b/src/applications/conpherence/controller/ConpherenceViewController.php index e13d020626..ab4d086510 100644 --- a/src/applications/conpherence/controller/ConpherenceViewController.php +++ b/src/applications/conpherence/controller/ConpherenceViewController.php @@ -118,6 +118,11 @@ final class ConpherenceViewController extends return id(new AphrontAjaxResponse())->setContent($content); } + $can_join = PhabricatorPolicyFilter::hasCapability( + $user, + $conpherence, + PhabricatorPolicyCapability::CAN_JOIN); + $layout = id(new ConpherenceLayoutView()) ->setUser($user) ->setBaseURI($this->getApplicationURI()) @@ -128,6 +133,12 @@ final class ConpherenceViewController extends ->setLatestTransactionID($data['latest_transaction_id']) ->setRole('thread'); + $participating = $conpherence->getParticipantIfExists($user->getPHID()); + + if (!$user->isLoggedIn()) { + $layout->addClass('conpherence-no-pontificate'); + } + return $this->newPage() ->setTitle($title) ->setPageObjectPHIDs(array($conpherence->getPHID())) @@ -149,46 +160,56 @@ final class ConpherenceViewController extends $draft = PhabricatorDraft::newFromUserAndKey( $user, $conpherence->getPHID()); - if ($participating) { - $action = ConpherenceUpdateActions::MESSAGE; - $button_text = pht('Send'); - } else if ($user->isLoggedIn()) { - $action = ConpherenceUpdateActions::JOIN_ROOM; - $button_text = pht('Join Room'); + $update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); + + if ($user->isLoggedIn()) { + $this->initBehavior('conpherence-pontificate'); + if ($participating) { + $action = ConpherenceUpdateActions::MESSAGE; + $status = pht('I\'ll find something to put here.'); + } else { + $action = ConpherenceUpdateActions::JOIN_ROOM; + $status = pht('Sending a message will also join the room.'); + } + + $form = id(new AphrontFormView()) + ->setUser($user) + ->setAction($update_uri) + ->addSigil('conpherence-pontificate') + ->setWorkflow(true) + ->addHiddenInput('action', $action) + ->appendChild( + id(new PhabricatorRemarkupControl()) + ->setUser($user) + ->setName('text') + ->setValue($draft->getDraft())); + + $status_view = phutil_tag( + 'div', + array( + 'class' => 'conpherence-room-status', + 'id' => 'conpherence-room-status', + ), + $status); + + $view = phutil_tag_div( + 'pontificate-container', array($form, $status_view)); + + return $view; + } else { // user not logged in so give them a login button. $login_href = id(new PhutilURI('/auth/start/')) ->setQueryParam('next', '/'.$conpherence->getMonogram()); return id(new PHUIFormLayoutView()) ->addClass('login-to-participate') + ->appendInstructions(pht('Log in to join this room and participate.')) ->appendChild( id(new PHUIButtonView()) ->setTag('a') ->setText(pht('Login to Participate')) ->setHref((string)$login_href)); } - $update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); - - $this->initBehavior('conpherence-pontificate'); - - $form = - id(new AphrontFormView()) - ->setUser($user) - ->setAction($update_uri) - ->addSigil('conpherence-pontificate') - ->setWorkflow(true) - ->addHiddenInput('action', $action) - ->appendChild( - id(new PhabricatorRemarkupControl()) - ->setUser($user) - ->setName('text') - ->setValue($draft->getDraft())) - ->appendChild( - id(new AphrontFormSubmitControl()) - ->setValue($button_text)) - ->render(); - - return $form; } private function getNeededTransactions( diff --git a/src/applications/conpherence/view/ConpherenceLayoutView.php b/src/applications/conpherence/view/ConpherenceLayoutView.php index 2b6ed5e0d2..f0d94d9a06 100644 --- a/src/applications/conpherence/view/ConpherenceLayoutView.php +++ b/src/applications/conpherence/view/ConpherenceLayoutView.php @@ -1,6 +1,6 @@ getUserSetting($widget_key, false); } - public function render() { + protected function getTagAttributes() { + $classes = array(); + if (!$this->getWidgetColumnVisible()) { + $classes[] = 'hide-widgets'; + } + + return array( + 'id' => 'conpherence-main-layout', + 'sigil' => 'conpherence-layout', + 'class' => 'conpherence-layout '. + implode(' ', $classes). + ' conpherence-role-'.$this->role, + ); + + } + + protected function getTagContent() { require_celerity_resource('conpherence-menu-css'); require_celerity_resource('conpherence-message-pane-css'); require_celerity_resource('conpherence-participant-pane-css'); - $layout_id = 'conpherence-main-layout'; - $selected_id = null; $selected_thread_id = null; $selected_thread_phid = null; @@ -87,7 +101,7 @@ final class ConpherenceLayoutView extends AphrontView { $this->initBehavior('conpherence-menu', array( 'baseURI' => $this->baseURI, - 'layoutID' => $layout_id, + 'layoutID' => 'conpherence-main-layout', 'selectedID' => $selected_id, 'selectedThreadID' => $selected_thread_id, 'selectedThreadPHID' => $selected_thread_phid, @@ -99,26 +113,9 @@ final class ConpherenceLayoutView extends AphrontView { 'hasWidgets' => false, )); - $classes = array(); - if (!$this->getUser()->isLoggedIn()) { - $classes[] = 'conpherence-logged-out'; - } - - if (!$this->getWidgetColumnVisible()) { - $classes[] = 'hide-widgets'; - } - $this->initBehavior('conpherence-participant-pane'); - return javelin_tag( - 'div', - array( - 'id' => $layout_id, - 'sigil' => 'conpherence-layout', - 'class' => 'conpherence-layout '. - implode(' ', $classes). - ' conpherence-role-'.$this->role, - ), + return array( javelin_tag( 'div', @@ -202,7 +199,7 @@ final class ConpherenceLayoutView extends AphrontView { nonempty($this->replyForm, '')), )), )), - )); + ); } private function buildNUXView() { diff --git a/src/view/form/AphrontFormView.php b/src/view/form/AphrontFormView.php index 3c92f72c88..3022a91f9c 100644 --- a/src/view/form/AphrontFormView.php +++ b/src/view/form/AphrontFormView.php @@ -9,11 +9,11 @@ final class AphrontFormView extends AphrontView { private $encType; private $workflow; private $id; - private $shaded = false; private $sigils = array(); private $metadata; private $controls = array(); private $fullWidth = false; + private $classes = array(); public function setMetadata($metadata) { $this->metadata = $metadata; @@ -44,11 +44,6 @@ final class AphrontFormView extends AphrontView { return $this; } - public function setShaded($shaded) { - $this->shaded = $shaded; - return $this; - } - public function addHiddenInput($key, $value) { $this->data[$key] = $value; return $this; @@ -64,6 +59,11 @@ final class AphrontFormView extends AphrontView { return $this; } + public function addClass($class) { + $this->classes[] = $class; + return $this; + } + public function setFullWidth($full_width) { $this->fullWidth = $full_width; return $this; @@ -149,7 +149,7 @@ final class AphrontFormView extends AphrontView { return phabricator_form( $this->getViewer(), array( - 'class' => $this->shaded ? 'phui-form-shaded' : null, + 'class' => implode(' ', $this->classes), 'action' => $this->action, 'method' => $this->method, 'enctype' => $this->encType, diff --git a/webroot/rsrc/css/application/conpherence/message-pane.css b/webroot/rsrc/css/application/conpherence/message-pane.css index 7209ac7085..a84d45a953 100644 --- a/webroot/rsrc/css/application/conpherence/message-pane.css +++ b/webroot/rsrc/css/application/conpherence/message-pane.css @@ -58,16 +58,12 @@ left: 240px; right: 240px; top: 103px; - bottom: 148px; + bottom: 122px; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; } -.conpherence-logged-out .conpherence-message-pane .conpherence-messages { - bottom: 42px; -} - .conpherence-messages.jx-scrollbar-frame { overflow-y: hidden; } @@ -77,7 +73,7 @@ padding-top: 20px; } -.conpherence-messages .jx-scrollbar-content .conpherence-edited:last-child { +.conpherence-messages .conpherence-edited:last-child { padding-bottom: 20px; } @@ -93,19 +89,9 @@ box-shadow: none; } -.conpherence-message-pane .messages-loading-mask { - opacity: .6; - background: #fff; - display: none; -} - -.loading .messages-loading-mask { - display: block; -} - .conpherence-message-pane .phui-form-view { border-width: 0; - height: 140px; + height: 110px; padding: 0 20px 12px; position: fixed; bottom: 0; @@ -113,18 +99,40 @@ right: 241px; } +.conpherence-room-status { + font-size: {$smallerfontsize}; + color: {$lightgreytext}; + font-style: italic; + position: absolute; + bottom: 6px; + left: 24px; +} + +.conpherence-no-pontificate .conpherence-message-pane .phui-form-view { + border-top: 1px solid {$thinblueborder}; + text-align: center; +} + +.conpherence-no-pontificate .conpherence-message-pane + .aphront-form-control-submit button, +.conpherence-no-pontificate .conpherence-message-pane + .aphront-form-control-submit a.button { + margin: 4px 0 0 0; + float: none; +} + +.conpherence-no-pontificate .phui-form-view .aphront-form-instructions { + margin: 24px 0 16px; + width: 100%; + padding: 0; + color: {$bluetext}; + font-size: {$biggestfontsize}; +} + .device .conpherence-message-pane .phui-form-view { padding: 8px 8px; } -.conpherence-message-pane .phui-form-view.login-to-participate { - height: 26px; -} - -.conpherence-message-pane .login-to-participate a.button { - float: right; -} - .conpherence-message-pane .aphront-form-control-submit button, .conpherence-message-pane .aphront-form-control-submit a.button { margin-top: 6px; @@ -152,7 +160,7 @@ border-bottom: none; border-top-left-radius: 3px; border-top-right-radius: 3px; - background-color: #f7f7f7; + background-color: {$lightgreybackground}; } .device .conpherence-message-pane .remarkup-assist-bar { @@ -313,7 +321,7 @@ } .conpherence-message-pane .remarkup-assist-textarea { - height: 80px; + height: 68px; padding: 8px; border: 2px solid {$lightgreyborder}; border-top: 1px solid {$thinblueborder}; diff --git a/webroot/rsrc/css/phui/phui-form-view.css b/webroot/rsrc/css/phui/phui-form-view.css index 3cf5111692..19f74c975a 100644 --- a/webroot/rsrc/css/phui/phui-form-view.css +++ b/webroot/rsrc/css/phui/phui-form-view.css @@ -14,12 +14,6 @@ padding: 0; } -/* only used in transaction comments */ -.phui-form-shaded .phui-form-view { - border-bottom: 1px solid #D4DAE0; - background: #F4F5F8; -} - .phui-form-view label.aphront-form-label { padding-top: 5px; width: 19%; diff --git a/webroot/rsrc/js/application/conpherence/behavior-pontificate.js b/webroot/rsrc/js/application/conpherence/behavior-pontificate.js index b810a24241..5f9e24a915 100644 --- a/webroot/rsrc/js/application/conpherence/behavior-pontificate.js +++ b/webroot/rsrc/js/application/conpherence/behavior-pontificate.js @@ -10,7 +10,7 @@ JX.behavior('conpherence-pontificate', function() { - var onsubmit = function(e) { + var _sendMessage = function(e) { e.kill(); var form = e.getNode('tag:form'); var threadManager = JX.ConpherenceThreadManager.getInstance(); @@ -20,6 +20,29 @@ JX.behavior('conpherence-pontificate', function() { JX.Stratcom.listen( ['submit', 'didSyntheticSubmit'], 'conpherence-pontificate', - onsubmit); + _sendMessage); + + // Send on enter if the shift key is not held. + JX.Stratcom.listen( + 'keydown', + 'conpherence-pontificate', + function(e) { + if (e.getSpecialKey() != 'return') { + return; + } + + var raw = e.getRawEvent(); + if (raw.shiftKey) { + // If the shift key is pressed, let the browser write a newline into + // the textarea. + return; + } + + // From here on, interpret this as a "send" action, not a literal + // newline. + e.kill(); + + _sendMessage(e); + }); }); From bc1cb06b07c1aa40ac11199da61c1dd8a23b9bb2 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 27 Sep 2016 22:21:10 -0700 Subject: [PATCH 08/21] Remove conpherence status on mobile Summary: Thought I had added this, but maybe got reverted. Hides the status line on mobile. Test Plan: Check tablet, desktop, and mobile. Don't see a status message. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16618 --- resources/celerity/map.php | 6 +++--- webroot/rsrc/css/application/conpherence/message-pane.css | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index f4b3217e8a..6e57c15def 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'conpherence.pkg.css' => '5722975a', + 'conpherence.pkg.css' => '4aa80958', 'conpherence.pkg.js' => '11f3e07e', 'core.pkg.css' => '2fd26498', 'core.pkg.js' => '1d376fa9', @@ -49,7 +49,7 @@ return array( 'rsrc/css/application/conpherence/durable-column.css' => '194ac487', 'rsrc/css/application/conpherence/header-pane.css' => '517de9fe', 'rsrc/css/application/conpherence/menu.css' => '78c7b811', - 'rsrc/css/application/conpherence/message-pane.css' => '1b49960e', + 'rsrc/css/application/conpherence/message-pane.css' => '60e10176', 'rsrc/css/application/conpherence/notification.css' => '6cdcc253', 'rsrc/css/application/conpherence/participant-pane.css' => '7bba0b56', 'rsrc/css/application/conpherence/transaction.css' => '46253e19', @@ -621,7 +621,7 @@ return array( 'conpherence-durable-column-view' => '194ac487', 'conpherence-header-pane-css' => '517de9fe', 'conpherence-menu-css' => '78c7b811', - 'conpherence-message-pane-css' => '1b49960e', + 'conpherence-message-pane-css' => '60e10176', 'conpherence-notification-css' => '6cdcc253', 'conpherence-participant-pane-css' => '7bba0b56', 'conpherence-thread-manager' => '01774ab2', diff --git a/webroot/rsrc/css/application/conpherence/message-pane.css b/webroot/rsrc/css/application/conpherence/message-pane.css index a84d45a953..9b8bdedeb4 100644 --- a/webroot/rsrc/css/application/conpherence/message-pane.css +++ b/webroot/rsrc/css/application/conpherence/message-pane.css @@ -108,6 +108,10 @@ left: 24px; } +.device .conpherence-room-status { + display: none; +} + .conpherence-no-pontificate .conpherence-message-pane .phui-form-view { border-top: 1px solid {$thinblueborder}; text-align: center; From 32d660c08f464a0f15ee04b917b088a3637d79f5 Mon Sep 17 00:00:00 2001 From: Josh Cox Date: Tue, 27 Sep 2016 10:07:59 -0400 Subject: [PATCH 09/21] Added a `token_token` table in anticipation of some data-driven tokens Summary: Ref T11217. This just adds the table that we'll store tokens in. It doesn't make use of the table at all yet. This is mostly pulled from this diff (D16178). Specifically I mostly followed Evan's instructions related to the token table here: D16178#189120. Test Plan: I ran `./bin/storage upgrade` successfully and there were no schema errors. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley, yelirekim Maniphest Tasks: T11217 Differential Revision: https://secure.phabricator.com/D16621 --- .../sql/autopatches/20160928.tokentoken.sql | 15 ++ src/__phutil_library_map__.php | 8 + .../tokens/storage/PhabricatorTokensToken.php | 157 ++++++++++++++++++ 3 files changed, 180 insertions(+) create mode 100644 resources/sql/autopatches/20160928.tokentoken.sql create mode 100644 src/applications/tokens/storage/PhabricatorTokensToken.php diff --git a/resources/sql/autopatches/20160928.tokentoken.sql b/resources/sql/autopatches/20160928.tokentoken.sql new file mode 100644 index 0000000000..cfe969f77b --- /dev/null +++ b/resources/sql/autopatches/20160928.tokentoken.sql @@ -0,0 +1,15 @@ +CREATE TABLE {$NAMESPACE}_token.token_token ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + phid VARBINARY(64) NOT NULL, + name VARCHAR(64) NOT NULL COLLATE {$COLLATE_TEXT}, + flavor VARCHAR(128) NOT NULL COLLATE {$COLLATE_TEXT}, + status VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT}, + builtinKey VARCHAR(32) COLLATE {$COLLATE_TEXT}, + dateCreated INT UNSIGNED NOT NULL, + dateModified INT UNSIGNED NOT NULL, + creatorPHID VARBINARY(64) NOT NULL, + tokenImagePHID VARBINARY(64), + UNIQUE KEY `key_phid` (phid), + UNIQUE KEY `key_builtin` (builtinKey), + KEY `key_creator` (creatorPHID, dateModified) +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 7704b557f8..4289d89ba3 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3780,6 +3780,7 @@ phutil_register_library_map(array( 'PhabricatorTokensApplication' => 'applications/tokens/application/PhabricatorTokensApplication.php', 'PhabricatorTokensCurtainExtension' => 'applications/tokens/engineextension/PhabricatorTokensCurtainExtension.php', 'PhabricatorTokensSettingsPanel' => 'applications/settings/panel/PhabricatorTokensSettingsPanel.php', + 'PhabricatorTokensToken' => 'applications/tokens/storage/PhabricatorTokensToken.php', 'PhabricatorTooltipUIExample' => 'applications/uiexample/examples/PhabricatorTooltipUIExample.php', 'PhabricatorTransactionChange' => 'applications/transactions/data/PhabricatorTransactionChange.php', 'PhabricatorTransactionRemarkupChange' => 'applications/transactions/data/PhabricatorTransactionRemarkupChange.php', @@ -8824,6 +8825,13 @@ phutil_register_library_map(array( 'PhabricatorTokensApplication' => 'PhabricatorApplication', 'PhabricatorTokensCurtainExtension' => 'PHUICurtainExtension', 'PhabricatorTokensSettingsPanel' => 'PhabricatorSettingsPanel', + 'PhabricatorTokensToken' => array( + 'PhabricatorTokenDAO', + 'PhabricatorDestructibleInterface', + 'PhabricatorSubscribableInterface', + 'PhabricatorFlaggableInterface', + 'PhabricatorConduitResultInterface', + ), 'PhabricatorTooltipUIExample' => 'PhabricatorUIExample', 'PhabricatorTransactionChange' => 'Phobject', 'PhabricatorTransactionRemarkupChange' => 'PhabricatorTransactionChange', diff --git a/src/applications/tokens/storage/PhabricatorTokensToken.php b/src/applications/tokens/storage/PhabricatorTokensToken.php new file mode 100644 index 0000000000..8cd83cd884 --- /dev/null +++ b/src/applications/tokens/storage/PhabricatorTokensToken.php @@ -0,0 +1,157 @@ + true, + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text64', + 'flavor' => 'text128', + 'status' => 'text32', + 'tokenImagePHID' => 'phid?', + 'builtinKey' => 'text32?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_creator' => array( + 'columns' => array('creatorPHID', 'dateModified'), + ), + 'key_builtin' => array( + 'columns' => array('builtinKey'), + 'unique' => true, + ), + ), + ) + parent::getConfiguration(); + } + + public function getTableName() { + return 'token_token'; + } + + public function generatePHID() { + return PhabricatorPHID::generateNewPHID( + PhabricatorTokenTokenPHIDType::TYPECONST); + } + + public static function initializeNewToken(PhabricatorUser $actor) { + $app = id(new PhabricatorApplicationQuery()) + ->setViewer($actor) + ->withClasses(array('PhabricatorTokensApplication')) + ->executeOne(); + + $token = id(new self()) + ->setCreatorPHID($actor->getPHID()) + ->setStatus(self::STATUS_ACTIVE) + ->setTokenImagePHID(''); + return $token; + } + + public function isArchived() { + return ($this->getStatus() == self::STATUS_ARCHIVED); + } + + public static function getStatusNameMap() { + return array( + self::STATUS_ACTIVE => pht('Active'), + self::STATUS_ARCHIVED => pht('Archived'), + ); + } + + public function getTokenImageURI() { + return $this->getTokenImageFile()->getBestURI(); + } + + public function attachTokenImageFile(PhabricatorFile $file) { + $this->tokenImageFile = $file; + return $this; + } + + public function getTokenImageFile() { + return $this->assertAttached($this->tokenImageFile); + } + + public function getViewURI() { + return '/tokens/view/'.$this->getID().'/'; + } + + +/* -( PhabricatorDestructibleInterface )----------------------------------- */ + + public function destroyObjectPermanently( + PhabricatorDestructionEngine $engine) { + + $this->openTransaction(); + + $tokens = id(new PhabricatorTokenGiven()) + ->loadAllWhere('tokenPHID = %s', $this->getPHID()); + foreach ($tokens as $token) { + $token->delete(); + } + if ($this->getTokenImagePHID()) { + id(new PhabricatorFile()) + ->loadOneWhere('filePHID = %s', $this->getTokenImagePHID()) + ->delete(); + } + + $this->delete(); + + $this->saveTransaction(); + } + +/* -( PhabricatorSubscribableInterface Implementation )-------------------- */ + + + public function isAutomaticallySubscribed($phid) { + return false; + } + + +/* -( PhabricatorConduitResultInterface )---------------------------------- */ + + + public function getFieldSpecificationsForConduit() { + return array( + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('name') + ->setType('string') + ->setDescription(pht('The name of the token.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('flavor') + ->setType('string') + ->setDescription(pht('Token flavor.')), + id(new PhabricatorConduitSearchFieldSpecification()) + ->setKey('status') + ->setType('string') + ->setDescription(pht('Archived or active status.')), + ); + } + + public function getFieldValuesForConduit() { + return array( + 'name' => $this->getName(), + 'flavor' => $this->getFlavor(), + 'status' => $this->getStatus(), + ); + } + + public function getConduitSearchAttachments() { + return array(); + } + +} From 360597d8eea5f9ff58772514f56f88f5e386b29c Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Wed, 28 Sep 2016 08:47:33 -0700 Subject: [PATCH 10/21] Link user name in People log view to user page Summary: Looking at IPs who recently registered more than one account in Phabricator and trying to figure out whether they are spam bots or just all on the same university network, I often want to check recent user activity of these accounts. Hence linking the entries in the User column to their user page comes in handy. Test Plan: Tested on local instance and works as expected. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D16620 --- src/applications/people/view/PhabricatorUserLogView.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/applications/people/view/PhabricatorUserLogView.php b/src/applications/people/view/PhabricatorUserLogView.php index c467a9010d..c442cfd934 100644 --- a/src/applications/people/view/PhabricatorUserLogView.php +++ b/src/applications/people/view/PhabricatorUserLogView.php @@ -33,7 +33,6 @@ final class PhabricatorUserLogView extends AphrontView { $rows = array(); foreach ($logs as $log) { - $ip = $log->getRemoteAddr(); $session = substr($log->getSession(), 0, 6); @@ -62,7 +61,7 @@ final class PhabricatorUserLogView extends AphrontView { $log->getActorPHID() ? $handles[$log->getActorPHID()]->getName() : null, - $handles[$log->getUserPHID()]->getName(), + $username = $handles[$log->getUserPHID()]->renderLink(), $ip, $session, ); From 5d1359d78f66c8fbc0f777691fc04c935a942689 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 28 Sep 2016 14:49:30 -0700 Subject: [PATCH 11/21] Fix an issue where repository message counts would never reset Summary: Fixes T11705. I did not realize that `ON DUPLICATE KEY UPDATE` was order-dependent, so the "reset" clause of this `IF(...)` never actually worked. Reorder it so we check if we're changing the message type //first//, then actually change the message type. This makes the count reset properly when a failing repository succeeds, or a working repository fails. Test Plan: - On `master`, forced a working repository to fail a `bin/repository update`, saw the message change types (expected) but keep the old count (wrong!). - With this patch, repeated the process and saw the count reset properly. - Ran the patch, verified counts reset to 0. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11705 Differential Revision: https://secure.phabricator.com/D16623 --- .../autopatches/20160928.repo.messagecount.sql | 4 ++++ .../storage/PhabricatorRepository.php | 18 +++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 resources/sql/autopatches/20160928.repo.messagecount.sql diff --git a/resources/sql/autopatches/20160928.repo.messagecount.sql b/resources/sql/autopatches/20160928.repo.messagecount.sql new file mode 100644 index 0000000000..e02b257c72 --- /dev/null +++ b/resources/sql/autopatches/20160928.repo.messagecount.sql @@ -0,0 +1,4 @@ +/* Reset message counts to fix the bug in T11705 which caused some of them to + become very large. */ +UPDATE {$NAMESPACE}_repository.repository_statusmessage + SET messageCount = 0; diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php index ee8e0ad54d..c27f562864 100644 --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -1651,8 +1651,12 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO } else { // If the existing message has the same code (e.g., we just hit an // error and also previously hit an error) we increment the message - // count by 1. This allows us to determine how many times in a row - // we've run into an error. + // count. This allows us to determine how many times in a row we've + // run into an error. + + // NOTE: The assignments in "ON DUPLICATE KEY UPDATE" are evaluated + // in order, so the "messageCount" assignment must occur before the + // "statusCode" assignment. See T11705. queryfx( $conn_w, @@ -1661,14 +1665,14 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO messageCount) VALUES (%d, %s, %s, %s, %d, %d) ON DUPLICATE KEY UPDATE - statusCode = VALUES(statusCode), - parameters = VALUES(parameters), - epoch = VALUES(epoch), messageCount = IF( statusCode = VALUES(statusCode), - messageCount + 1, - VALUES(messageCount))', + messageCount + VALUES(messageCount), + VALUES(messageCount)), + statusCode = VALUES(statusCode), + parameters = VALUES(parameters), + epoch = VALUES(epoch)', $table_name, $this->getID(), $status_type, From aa248a6b2068b8af24c4f64d674d9d700e27c2e8 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 28 Sep 2016 15:16:29 -0700 Subject: [PATCH 12/21] Use Notification Status in Conpherence Summary: Adds a connection status message in Conpherence Test Plan: Check status Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16625 --- .../conpherence/controller/ConpherenceViewController.php | 2 +- .../view/PhabricatorNotificationStatusView.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/applications/conpherence/controller/ConpherenceViewController.php b/src/applications/conpherence/controller/ConpherenceViewController.php index ab4d086510..4aec1d0e0a 100644 --- a/src/applications/conpherence/controller/ConpherenceViewController.php +++ b/src/applications/conpherence/controller/ConpherenceViewController.php @@ -166,7 +166,7 @@ final class ConpherenceViewController extends $this->initBehavior('conpherence-pontificate'); if ($participating) { $action = ConpherenceUpdateActions::MESSAGE; - $status = pht('I\'ll find something to put here.'); + $status = new PhabricatorNotificationStatusView(); } else { $action = ConpherenceUpdateActions::JOIN_ROOM; $status = pht('Sending a message will also join the room.'); diff --git a/src/applications/notification/view/PhabricatorNotificationStatusView.php b/src/applications/notification/view/PhabricatorNotificationStatusView.php index 6aecbb6dcf..988587f65c 100644 --- a/src/applications/notification/view/PhabricatorNotificationStatusView.php +++ b/src/applications/notification/view/PhabricatorNotificationStatusView.php @@ -23,4 +23,13 @@ final class PhabricatorNotificationStatusView extends AphrontTagView { ); } + protected function getTagContent() { + $have = PhabricatorEnv::getEnvConfig('notification.servers'); + if ($have) { + return pht('Connecting...'); + } else { + return pht('Notification server not enabled'); + } + } + } From 1095347832c9c665124b23ed40e37ee22cc0398e Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 29 Sep 2016 16:25:47 +0000 Subject: [PATCH 13/21] Add mobile upload button to Conpherence Summary: Fixes T11622. Moves the remarkup upload button into the text area on mobile/tablet. Test Plan: Mobile/Tablet/Desktop Conpherence Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T11622 Differential Revision: https://secure.phabricator.com/D16626 --- resources/celerity/map.php | 6 +++--- .../form/control/PhabricatorRemarkupControl.php | 4 ++++ .../css/application/conpherence/message-pane.css | 16 +++++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 6e57c15def..c390d11bd7 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'conpherence.pkg.css' => '4aa80958', + 'conpherence.pkg.css' => 'd93561e2', 'conpherence.pkg.js' => '11f3e07e', 'core.pkg.css' => '2fd26498', 'core.pkg.js' => '1d376fa9', @@ -49,7 +49,7 @@ return array( 'rsrc/css/application/conpherence/durable-column.css' => '194ac487', 'rsrc/css/application/conpherence/header-pane.css' => '517de9fe', 'rsrc/css/application/conpherence/menu.css' => '78c7b811', - 'rsrc/css/application/conpherence/message-pane.css' => '60e10176', + 'rsrc/css/application/conpherence/message-pane.css' => 'bbbb8a9b', 'rsrc/css/application/conpherence/notification.css' => '6cdcc253', 'rsrc/css/application/conpherence/participant-pane.css' => '7bba0b56', 'rsrc/css/application/conpherence/transaction.css' => '46253e19', @@ -621,7 +621,7 @@ return array( 'conpherence-durable-column-view' => '194ac487', 'conpherence-header-pane-css' => '517de9fe', 'conpherence-menu-css' => '78c7b811', - 'conpherence-message-pane-css' => '60e10176', + 'conpherence-message-pane-css' => 'bbbb8a9b', 'conpherence-notification-css' => '6cdcc253', 'conpherence-participant-pane-css' => '7bba0b56', 'conpherence-thread-manager' => '01774ab2', diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php index f32e58fb29..5fc275e063 100644 --- a/src/view/form/control/PhabricatorRemarkupControl.php +++ b/src/view/form/control/PhabricatorRemarkupControl.php @@ -203,6 +203,10 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { $classes[] = 'remarkup-assist-button'; } + if ($action == 'fa-cloud-upload') { + $classes[] = 'remarkup-assist-upload'; + } + $href = idx($spec, 'href', '#'); if ($href == '#') { $meta = array('action' => $action); diff --git a/webroot/rsrc/css/application/conpherence/message-pane.css b/webroot/rsrc/css/application/conpherence/message-pane.css index 9b8bdedeb4..dbaffdac37 100644 --- a/webroot/rsrc/css/application/conpherence/message-pane.css +++ b/webroot/rsrc/css/application/conpherence/message-pane.css @@ -168,9 +168,23 @@ } .device .conpherence-message-pane .remarkup-assist-bar { + position: absolute; + top: 12px; + left: 12px; + background: {$bluebackground}; + border-radius: 3px; + border: none; +} + +.device .remarkup-assist-button, +.device .remarkup-assist-separator { display: none; } +.device .remarkup-assist-button.remarkup-assist-upload { + display: block; +} + .device .conpherence-message-pane .phui-form-view { left: 0; right: 0; @@ -346,7 +360,7 @@ .device .conpherence-message-pane .remarkup-assist-textarea { margin: 0; - padding: 8px 68px 8px 8px; + padding: 7px 8px 6px 30px; width: 100%; height: 34px; resize: none; From 95d174956639aac7525d52368944edfff7cdb824 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 28 Sep 2016 22:27:19 -0700 Subject: [PATCH 14/21] Convert Durable Column to popup chat in footer Summary: This feels pretty reasonable with little effort, and I think I'd use it more than the full column. Test Plan: Chat a lot on various pages.... still some quicksand quirks around various pages. {F1853487} Reviewers: epriestley Reviewed By: epriestley Subscribers: scp, Korvin Differential Revision: https://secure.phabricator.com/D16627 --- resources/celerity/map.php | 42 ++-- .../view/ConpherenceDurableColumnView.php | 46 +--- webroot/rsrc/css/aphront/multi-column.css | 36 --- .../conpherence/durable-column.css | 205 ++++++------------ .../css/phui/workboards/phui-workboard.css | 8 - .../conpherence/behavior-durable-column.js | 29 +-- 6 files changed, 95 insertions(+), 271 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index c390d11bd7..35fe94b1a3 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,10 +7,10 @@ */ return array( 'names' => array( - 'conpherence.pkg.css' => 'd93561e2', + 'conpherence.pkg.css' => '3f5d038e', 'conpherence.pkg.js' => '11f3e07e', - 'core.pkg.css' => '2fd26498', - 'core.pkg.js' => '1d376fa9', + 'core.pkg.css' => '55d32e63', + 'core.pkg.js' => '32939240', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '3fb7f532', 'differential.pkg.js' => '634399e9', @@ -23,7 +23,7 @@ return array( 'rsrc/css/aphront/dialog-view.css' => '593d3f67', 'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d', 'rsrc/css/aphront/list-filter-view.css' => '5d6f0526', - 'rsrc/css/aphront/multi-column.css' => 'fd18389d', + 'rsrc/css/aphront/multi-column.css' => '84cc6640', 'rsrc/css/aphront/notification.css' => '3f6c89c9', 'rsrc/css/aphront/panel-view.css' => '8427b78d', 'rsrc/css/aphront/phabricator-nav-view.css' => 'b29426e9', @@ -46,7 +46,7 @@ return array( 'rsrc/css/application/config/config-template.css' => '8f18fa41', 'rsrc/css/application/config/setup-issue.css' => 'f794cfc3', 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', - 'rsrc/css/application/conpherence/durable-column.css' => '194ac487', + 'rsrc/css/application/conpherence/durable-column.css' => '63114a54', 'rsrc/css/application/conpherence/header-pane.css' => '517de9fe', 'rsrc/css/application/conpherence/menu.css' => '78c7b811', 'rsrc/css/application/conpherence/message-pane.css' => 'bbbb8a9b', @@ -164,7 +164,7 @@ return array( 'rsrc/css/phui/phui-timeline-view.css' => 'bc523970', 'rsrc/css/phui/phui-two-column-view.css' => 'fcfbe347', 'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7', - 'rsrc/css/phui/workboards/phui-workboard.css' => 'bda3ef58', + 'rsrc/css/phui/workboards/phui-workboard.css' => 'e09eb53a', 'rsrc/css/phui/workboards/phui-workcard.css' => '0c62d7c5', 'rsrc/css/phui/workboards/phui-workpanel.css' => '92197373', 'rsrc/css/sprite-login.css' => '6dbbbd97', @@ -438,7 +438,7 @@ return array( 'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408', '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' => 'd3506890', + 'rsrc/js/application/conpherence/behavior-durable-column.js' => '39e0ea32', 'rsrc/js/application/conpherence/behavior-menu.js' => '9eb55204', 'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8', 'rsrc/js/application/conpherence/behavior-pontificate.js' => 'f2e58483', @@ -605,7 +605,7 @@ return array( 'aphront-dark-console-css' => 'f54bf286', 'aphront-dialog-view-css' => '593d3f67', 'aphront-list-filter-view-css' => '5d6f0526', - 'aphront-multi-column-view-css' => 'fd18389d', + 'aphront-multi-column-view-css' => '84cc6640', 'aphront-panel-view-css' => '8427b78d', 'aphront-table-view-css' => '3225137a', 'aphront-tokenizer-control-css' => '056da01b', @@ -618,7 +618,7 @@ return array( 'conduit-api-css' => '7bc725c4', 'config-options-css' => '0ede4c9b', 'config-page-css' => '8798e14f', - 'conpherence-durable-column-view' => '194ac487', + 'conpherence-durable-column-view' => '63114a54', 'conpherence-header-pane-css' => '517de9fe', 'conpherence-menu-css' => '78c7b811', 'conpherence-message-pane-css' => 'bbbb8a9b', @@ -699,7 +699,7 @@ return array( 'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc', 'javelin-behavior-doorkeeper-tag' => 'e5822781', 'javelin-behavior-drydock-live-operation-status' => '901935ef', - 'javelin-behavior-durable-column' => 'd3506890', + 'javelin-behavior-durable-column' => '39e0ea32', 'javelin-behavior-editengine-reorder-configs' => 'd7a74243', 'javelin-behavior-editengine-reorder-fields' => 'b59e1e96', 'javelin-behavior-error-log' => '6882e80a', @@ -943,7 +943,7 @@ return array( 'phui-timeline-view-css' => 'bc523970', 'phui-two-column-view-css' => 'fcfbe347', 'phui-workboard-color-css' => 'ac6fe6a7', - 'phui-workboard-view-css' => 'bda3ef58', + 'phui-workboard-view-css' => 'e09eb53a', 'phui-workcard-view-css' => '0c62d7c5', 'phui-workpanel-view-css' => '92197373', 'phuix-action-list-view' => 'b5c256b8', @@ -1201,6 +1201,16 @@ return array( 'javelin-dom', 'javelin-workflow', ), + '39e0ea32' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-behavior-device', + 'javelin-scrollbar', + 'javelin-quicksand', + 'phabricator-keyboard-shortcut', + 'conpherence-thread-manager', + ), '3ab51e2c' => array( 'javelin-behavior', 'javelin-behavior-device', @@ -2034,16 +2044,6 @@ return array( 'd254d646' => array( 'javelin-util', ), - 'd3506890' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-behavior-device', - 'javelin-scrollbar', - 'javelin-quicksand', - 'phabricator-keyboard-shortcut', - 'conpherence-thread-manager', - ), 'd4505101' => array( 'javelin-stratcom', 'javelin-install', diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php index bf454c882a..5d05f962e2 100644 --- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php +++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php @@ -125,14 +125,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { $classes = array(); $classes[] = 'conpherence-durable-column-header'; - $classes[] = 'phabricator-main-menu-background'; - - $loading_mask = phutil_tag( - 'div', - array( - 'class' => 'loading-mask', - ), - ''); + $classes[] = 'grouped'; $header = phutil_tag( 'div', @@ -175,23 +168,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { $input = $this->buildTextInput(); - $footer = phutil_tag( - 'div', - array( - 'class' => 'conpherence-durable-column-footer', - ), - array( - $this->buildSendButton(), - phutil_tag( - 'div', - array( - 'class' => 'conpherence-durable-column-status', - ), - $this->buildStatusText()), - )); - return array( - $loading_mask, $header, javelin_tag( 'div', @@ -203,7 +180,6 @@ final class ConpherenceDurableColumnView extends AphrontTagView { $icon_bar, $content, $input, - $footer, )), ); } @@ -263,26 +239,10 @@ final class ConpherenceDurableColumnView extends AphrontTagView { ), '')); } - $icons[] = $this->buildSearchButton(); return $icons; } - private function buildSearchButton() { - return phutil_tag( - 'div', - array( - 'class' => 'conpherence-durable-column-search-button', - ), - id(new PHUIButtonBarView()) - ->addButton( - id(new PHUIButtonView()) - ->setTag('a') - ->setHref('/conpherence/search/') - ->setColor(PHUIButtonView::GREY) - ->setIcon('fa-search'))); - } - private function buildHeader() { $conpherence = $this->getSelectedConpherence(); @@ -354,7 +314,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { phutil_tag( 'div', array( - 'class' => 'conpherence-durable-column-header', + 'class' => 'conpherence-durable-column-header-inner', ), array( javelin_tag( @@ -401,7 +361,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { } $actions[] = array( - 'name' => pht('Hide Column'), + 'name' => pht('Hide Window'), 'disabled' => false, 'href' => '#', 'icon' => 'fa-times', diff --git a/webroot/rsrc/css/aphront/multi-column.css b/webroot/rsrc/css/aphront/multi-column.css index badae756fe..ad9931ce0b 100644 --- a/webroot/rsrc/css/aphront/multi-column.css +++ b/webroot/rsrc/css/aphront/multi-column.css @@ -182,39 +182,3 @@ margin: 0 0 16px; } } - -/* Make Dashboards with Durable reasonably display on homepage narrow widths */ -@media (max-width: 1300px) { - .device-desktop.with-durable-column .dashboard-view - .aphront-multi-column-inner { - display: block; - width: auto; - } - .device-desktop.with-durable-column .dashboard-view - .aphront-multi-column-column-outer { - display: block; - border: none; - } - .device-desktop.with-durable-column .dashboard-view - .aphront-multi-column-column.mlr { - margin: 0; - } - .device-desktop.with-durable-column .dashboard-view - .aphront-multi-column-fluid .aphront-multi-column-2-up - .aphront-multi-column-column-outer.half { - width: auto; - margin: 0 0 16px; - } - .device-desktop.with-durable-column .dashboard-view - .aphront-multi-column-fluid .aphront-multi-column-2-up - .aphront-multi-column-column-outer.thirds { - width: auto; - margin: 0 0 16px; - } - .device-desktop.with-durable-column .dashboard-view - .aphront-multi-column-fluid .aphront-multi-column-2-up - .aphront-multi-column-column-outer.third { - width: auto; - margin: 0 0 16px; - } -} diff --git a/webroot/rsrc/css/application/conpherence/durable-column.css b/webroot/rsrc/css/application/conpherence/durable-column.css index 8872e2fb22..f779b2645b 100644 --- a/webroot/rsrc/css/application/conpherence/durable-column.css +++ b/webroot/rsrc/css/application/conpherence/durable-column.css @@ -2,63 +2,22 @@ * @provides conpherence-durable-column-view */ -.with-durable-column .phabricator-standard-page-body { - margin-right: 300px; -} - -.with-durable-margin .phabricator-standard-page-body { - margin-right: 312px; -} - -.with-durable-column .phabricator-main-menu { - padding-right: 304px; -} - -.with-durable-margin .phabricator-main-menu { - padding-right: 316px; -} - -.with-durable-column -.phabricator-global-upload-instructions { - font-size: 28px; - width: 50%; -} - .global-upload-mask { pointer-events: none; } -.with-durable-column .global-upload-mask { - right: 300px; -} - -.with-durable-margin .global-upload-mask { - right: 312px; -} - .conpherence-durable-column { position: fixed; - top: 0; bottom: 0; - right: 0; + right: 12px; width: 300px; + height: 380px; background: #fff; + box-shadow: 0px 1px 8px rgba(55,55,55, .3); } -.with-durable-margin .conpherence-durable-column { - border-right: 12px solid {$lightgreybackground}; -} - -.conpherence-durable-column .loading-mask { - position: absolute; - top: 90px; - bottom: 0; - right: 1px; - width: 298px; - background: #fff; +.device .conpherence-durable-column { display: none; - opacity: .6; - z-index: 2; } .device-desktop .conpherence-durable-column.loading .loading-mask { @@ -75,60 +34,73 @@ padding-right: 4px; width: 36px; } -.conpherence-durable-column-header -.phabricator-application-menu .phui-list-item-view.core-menu-item { - display: block; + +.conpherence-durable-column-header .phabricator-application-menu + .phui-list-item-view.core-menu-item { + display: block; } -.conpherence-durable-column-header -.phabricator-application-menu .phui-list-item-name { - display: none; + +.conpherence-durable-column-header .phabricator-application-menu + .phui-list-item-name { + display: none; } -.conpherence-durable-column-header -.phabricator-application-menu .phui-list-item-view { - float: left; - position: relative; - width: 36px; - height: 36px; - margin-top: 4px; + +.conpherence-durable-column-header .phabricator-application-menu + .phui-list-item-view { + float: left; + position: relative; + width: 30px; + height: 30px; + margin-top: 2px; } -.conpherence-durable-column-header -.phabricator-application-menu .phui-list-item-href { - background: transparent; - border: none; - padding: 0; + +.conpherence-durable-column-header .phabricator-application-menu + .phui-list-item-href { + background: transparent; + border: none; + padding: 0; } -.conpherence-durable-column-header -.phabricator-dark-menu .phui-list-item-type-link { - background: transparent; -} -.conpherence-durable-column-header -.phabricator-application-menu -.phui-list-item-view.core-menu-item { - display: block; + +.conpherence-durable-column-header .phabricator-application-menu + .phui-list-item-view.core-menu-item { + display: block; } .conpherence-durable-column-header { - border-left: 1px solid rgba({$alphablack},.1); - border-right: 1px solid rgba({$alphablack},.1); + border-top-right-radius: 3px; + border-top-left-radius: 3px; + background-color: #525867; +} + +.conpherence-durable-column-header + .phabricator-main-menu-dropdown.phui-list-sidenav { + top: 30px; } .conpherence-durable-column-header-text { float: left; - padding: 13px 0 12px 12px; - font-size: 15px; - color: {$hoverwhite}; + padding: 8px 0 8px 10px; + color: #fff; width: 230px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; + text-shadow: 1px 1px 0 rgba(0,0,0,.6); +} + +.conpherence-durable-column-header .phabricator-application-menu + .phui-list-item-icon.phui-font-fa { + font-size: 14px; + margin: 8px 10px; } .conpherence-durable-column-header-text .phui-icon-view { - color: {$hoverwhite}; + color: #fff; + text-shadow: 1px 1px 0 rgba(0,0,0,.6); } .conpherence-durable-column-icon-bar { - height: 38px; + height: 32px; padding: 4px; background-color: {$lightgreybackground}; } @@ -136,23 +108,11 @@ .conpherence-durable-column-icon-bar .conpherence-durable-column-thread-icon { float: left; display: block; - height: 34px; - width: 34px; + height: 28px; + width: 28px; border: 2px solid transparent; border-radius: 3px; - margin: 0 4px 0 0; -} - -.conpherence-durable-column-icon-bar .conpherence-durable-column-search-button { - margin: 4px 0px 0px 0px; -} -.conpherence-durable-column-icon-bar .phui-button-bar { -} -.conpherence-durable-column-icon-bar .phui-button-bar a.button.has-icon { - height: 21px; -} -.conpherence-durable-column-icon-bar .phui-button-bar .button .phui-icon-view { - top: 8px; + margin: 0 2px 0 0; } .conpherence-durable-column-icon-bar @@ -164,30 +124,25 @@ .conpherence-durable-column-thread-icon span { position: relative; display: block; - width: 30px; - height: 30px; + width: 24px; + height: 24px; top: 2px; left: 2px; - background-size: 30px 30px; + background-size: 24px 24px; } .conpherence-durable-column-body { position: absolute; - top: 44px; + top: 34px; bottom: 0; right: 0; left: 0; - border-left: 1px solid {$lightblueborder}; -} - -.with-durable-margin .conpherence-durable-column-body { - border-right: 1px solid {$lightblueborder}; } .conpherence-durable-column-main { position: absolute; - top: 46px; - bottom: 134px; + top: 40px; + bottom: 36px; left: 0; right: 0; overflow-x: hidden; @@ -218,10 +173,9 @@ min-height: 0; } -.conpherence-durable-column-transactions - .conpherence-transaction-view +.conpherence-durable-column-transactions .conpherence-transaction-view .conpherence-message { - word-wrap: break-word; + word-wrap: break-word; } .conpherence-durable-column-transactions .conpherence-transaction-detail { @@ -230,9 +184,9 @@ } .conpherence-durable-column-transactions .conpherence-transaction-detail -.conpherence-transaction-header { - background: none; - padding: 0 0 2px 0; + .conpherence-transaction-header { + background: none; + padding: 0 0 2px 0; } .conpherence-durable-column-transactions @@ -295,42 +249,23 @@ img { position: absolute; left: 0; right: 0; - bottom: 34px; - height: 100px; + bottom: 0; + height: 36px; margin: 0; - border-width: 1px 0; + border-width: 1px 0 0 0; border-style: solid; border-top-color: {$thinblueborder}; - border-bottom-color: {$thinblueborder}; - padding: 8px 12px; + padding: 8px; width: 100%; resize: none; } .conpherence-durable-column-textarea:focus { outline: 0; - border-top-color: {$sky}; - border-bottom-color: {$sky}; + border-top-color: {$lightblueborder}; box-shadow: none; } .conpherence-durable-column-footer { - position: absolute; - height: 26px; - padding: 4px 8px 4px 12px; - left: 0; - right: 0; - bottom: 0; - background-color: {$lightgreybackground}; -} - -.conpherence-durable-column-footer button { - float: right; -} - -.conpherence-durable-column-status { - vertical-align: middle; - line-height: 24px; - font-size: {$smallerfontsize}; - color: {$lightbluetext}; + display: none; } diff --git a/webroot/rsrc/css/phui/workboards/phui-workboard.css b/webroot/rsrc/css/phui/workboards/phui-workboard.css index 089fbcf0a5..df51e7623d 100644 --- a/webroot/rsrc/css/phui/workboards/phui-workboard.css +++ b/webroot/rsrc/css/phui/workboards/phui-workboard.css @@ -22,14 +22,6 @@ background-color: #fff; } -.device-desktop.with-durable-column .phui-workboard-view-shadow { - right: 300px; -} - -.device-desktop.with-durable-margin .phui-workboard-view-shadow { - right: 312px; -} - .phui-workboard-view-shadow::-webkit-scrollbar { height: 8px; width: 8px; diff --git a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js index 9c3d2bba39..76ee549764 100644 --- a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js +++ b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js @@ -31,10 +31,6 @@ JX.behavior('durable-column', function(config, statics) { var margin = JX.Scrollbar.getScrollbarControlMargin(); - var columnWidth = (300 + margin); - // This is the smallest window size where we'll enable the column. - var minimumViewportWidth = (920 - margin); - var quick = JX.$('phabricator-standard-page-body'); function _getColumnNode() { @@ -46,17 +42,8 @@ JX.behavior('durable-column', function(config, statics) { return JX.DOM.find(column, 'div', 'conpherence-durable-column-main'); } - function _isViewportWideEnoughForColumn() { - var viewport = JX.Vector.getViewport(); - if (viewport.x < minimumViewportWidth) { - return false; - } else { - return true; - } - } - function _updateColumnVisibility() { - var new_value = (userVisible && _isViewportWideEnoughForColumn()); + var new_value = (userVisible); if (new_value !== show) { show = new_value; _drawColumn(show); @@ -77,10 +64,6 @@ JX.behavior('durable-column', function(config, statics) { document.body, 'with-durable-column', visible); - JX.DOM.alterClass( - document.body, - 'with-durable-margin', - visible && !!margin); var column = _getColumnNode(); if (visible) { @@ -91,16 +74,6 @@ JX.behavior('durable-column', function(config, statics) { } JX.Quicksand.setFrame(visible ? quick : null); - // When we activate the column, adjust the tablet breakpoint so that we - // convert the left side of the screen to tablet mode on narrow displays. - var breakpoint; - if (visible) { - breakpoint = minimumViewportWidth + columnWidth; - } else { - breakpoint = minimumViewportWidth; - } - JX.Device.setTabletBreakpoint(breakpoint); - JX.Stratcom.invoke('resize'); } From 8af29f2df1a176a6f597a4ac14a4b6ca40efbe66 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 29 Sep 2016 12:19:45 -0700 Subject: [PATCH 15/21] Group similar transaction comments in Conpherence Summary: Adds a CSS class if comments come in from the same user in the past 2 minutes for cleaner UI. Note will have to find some better display UI when comment editing comes. Test Plan: Test lots of random Conpherence messages with different transactions, different people, and quick commenting. Reviewers: scp, epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16632 --- resources/celerity/map.php | 6 +++--- .../ConpherenceTransactionRenderer.php | 20 +++++++++++++++++++ .../application/conpherence/message-pane.css | 10 ++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 35fe94b1a3..9690152678 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'conpherence.pkg.css' => '3f5d038e', + 'conpherence.pkg.css' => '9402e1af', 'conpherence.pkg.js' => '11f3e07e', 'core.pkg.css' => '55d32e63', 'core.pkg.js' => '32939240', @@ -49,7 +49,7 @@ return array( 'rsrc/css/application/conpherence/durable-column.css' => '63114a54', 'rsrc/css/application/conpherence/header-pane.css' => '517de9fe', 'rsrc/css/application/conpherence/menu.css' => '78c7b811', - 'rsrc/css/application/conpherence/message-pane.css' => 'bbbb8a9b', + 'rsrc/css/application/conpherence/message-pane.css' => '0d7dff02', 'rsrc/css/application/conpherence/notification.css' => '6cdcc253', 'rsrc/css/application/conpherence/participant-pane.css' => '7bba0b56', 'rsrc/css/application/conpherence/transaction.css' => '46253e19', @@ -621,7 +621,7 @@ return array( 'conpherence-durable-column-view' => '63114a54', 'conpherence-header-pane-css' => '517de9fe', 'conpherence-menu-css' => '78c7b811', - 'conpherence-message-pane-css' => 'bbbb8a9b', + 'conpherence-message-pane-css' => '0d7dff02', 'conpherence-notification-css' => '6cdcc253', 'conpherence-participant-pane-css' => '7bba0b56', 'conpherence-thread-manager' => '01774ab2', diff --git a/src/applications/conpherence/ConpherenceTransactionRenderer.php b/src/applications/conpherence/ConpherenceTransactionRenderer.php index ff8bb52510..341d287e8b 100644 --- a/src/applications/conpherence/ConpherenceTransactionRenderer.php +++ b/src/applications/conpherence/ConpherenceTransactionRenderer.php @@ -78,6 +78,7 @@ final class ConpherenceTransactionRenderer extends Phobject { ->setFullDisplay($full_display); foreach ($transactions as $transaction) { + $collapsed = false; if ($previous_transaction) { $previous_day = phabricator_format_local_time( $previous_transaction->getDateCreated(), @@ -87,6 +88,22 @@ final class ConpherenceTransactionRenderer extends Phobject { $transaction->getDateCreated(), $user, 'Ymd'); + + // See if same user / time + $previous_author = $previous_transaction->getAuthorPHID(); + $current_author = $transaction->getAuthorPHID(); + $previous_time = $previous_transaction->getDateCreated(); + $current_time = $transaction->getDateCreated(); + $previous_type = $previous_transaction->getTransactionType(); + $current_type = $transaction->getTransactionType(); + if (($previous_author == $current_author) && + ($previous_type == $current_type)) { + // Group messages within the last x seconds + if (($current_time - $previous_time) < 120) { + $collapsed = true; + } + } + // date marker transaction time! if ($previous_day != $current_day) { $date_marker_transaction->setDateCreated( @@ -97,6 +114,9 @@ final class ConpherenceTransactionRenderer extends Phobject { } $transaction_view = id(clone $transaction_view_template) ->setConpherenceTransaction($transaction); + if ($collapsed) { + $transaction_view->addClass('conpherence-transaction-collapsed'); + } $rendered_transactions[] = $transaction_view->render(); $previous_transaction = $transaction; diff --git a/webroot/rsrc/css/application/conpherence/message-pane.css b/webroot/rsrc/css/application/conpherence/message-pane.css index dbaffdac37..6df4cb8828 100644 --- a/webroot/rsrc/css/application/conpherence/message-pane.css +++ b/webroot/rsrc/css/application/conpherence/message-pane.css @@ -390,3 +390,13 @@ max-height: 200px; } +.conpherence-transaction-collapsed .conpherence-transaction-image, +.conpherence-transaction-collapsed .conpherence-transaction-header { + display: none; +} + +.conpherence-message-pane + .conpherence-transaction-collapsed.conpherence-transaction-view { + margin-top: 0; + margin-bottom: 0; +} From d5925ffc5779a09b7d89db4a5d738e1b1f46e2ed Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 29 Sep 2016 15:40:48 -0700 Subject: [PATCH 16/21] When a file is stored as chunks, show "Format: Chunks" instead of "Format: Raw" Summary: Fixes T11712. This is somewhat misleading with encryption enabled. Test Plan: Viewed chunked and unchunked files. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11712 Differential Revision: https://secure.phabricator.com/D16636 --- .../PhabricatorFileInfoController.php | 36 ++++++++++++------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/src/applications/files/controller/PhabricatorFileInfoController.php b/src/applications/files/controller/PhabricatorFileInfoController.php index 3c822b401c..4ca3bbb72e 100644 --- a/src/applications/files/controller/PhabricatorFileInfoController.php +++ b/src/applications/files/controller/PhabricatorFileInfoController.php @@ -285,12 +285,17 @@ final class PhabricatorFileInfoController extends PhabricatorFileController { pht('Engine'), $file->getStorageEngine()); - $format_key = $file->getStorageFormat(); - $format = PhabricatorFileStorageFormat::getFormat($format_key); - if ($format) { - $format_name = $format->getStorageFormatName(); + $engine = $this->loadStorageEngine($file); + if ($engine && $engine->isChunkEngine()) { + $format_name = pht('Chunks'); } else { - $format_name = pht('Unknown ("%s")', $format_key); + $format_key = $file->getStorageFormat(); + $format = PhabricatorFileStorageFormat::getFormat($format_key); + if ($format) { + $format_name = $format->getStorageFormatName(); + } else { + $format_name = pht('Unknown ("%s")', $format_key); + } } $storage_properties->addProperty(pht('Format'), $format_name); @@ -369,13 +374,7 @@ final class PhabricatorFileInfoController extends PhabricatorFileController { $box->addPropertyList($media); } - $engine = null; - try { - $engine = $file->instantiateStorageEngine(); - } catch (Exception $ex) { - // Don't bother raising this anywhere for now. - } - + $engine = $this->loadStorageEngine($file); if ($engine) { if ($engine->isChunkEngine()) { $chunkinfo = new PHUIPropertyListView(); @@ -436,4 +435,17 @@ final class PhabricatorFileInfoController extends PhabricatorFileController { } + private function loadStorageEngine(PhabricatorFile $file) { + $engine = null; + + try { + $engine = $file->instantiateStorageEngine(); + } catch (Exception $ex) { + // Don't bother raising this anywhere for now. + } + + return $engine; + } + + } From 46f11a2450f90bcc58218360597906aa0eba88f0 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 29 Sep 2016 23:28:28 +0000 Subject: [PATCH 17/21] Redesign durable column to be more a 'mini conpherence' Summary: Since I plan to add collapsing, this widens the chat window and moves the switcher to the side, for more visual space for conversation. TODO: make a magical minimizer so I can always have it open. Test Plan: Tested on my large display and little Macbook. {F1854092} Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16635 --- resources/celerity/map.php | 6 +- .../view/ConpherenceDurableColumnView.php | 2 +- .../view/ConpherenceTransactionView.php | 28 +++++---- .../conpherence/durable-column.css | 58 +++++++++++-------- 4 files changed, 50 insertions(+), 44 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 9690152678..e34fa5a704 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'conpherence.pkg.css' => '9402e1af', + 'conpherence.pkg.css' => '4901ed78', 'conpherence.pkg.js' => '11f3e07e', 'core.pkg.css' => '55d32e63', 'core.pkg.js' => '32939240', @@ -46,7 +46,7 @@ return array( 'rsrc/css/application/config/config-template.css' => '8f18fa41', 'rsrc/css/application/config/setup-issue.css' => 'f794cfc3', 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', - 'rsrc/css/application/conpherence/durable-column.css' => '63114a54', + 'rsrc/css/application/conpherence/durable-column.css' => '61f73db6', 'rsrc/css/application/conpherence/header-pane.css' => '517de9fe', 'rsrc/css/application/conpherence/menu.css' => '78c7b811', 'rsrc/css/application/conpherence/message-pane.css' => '0d7dff02', @@ -618,7 +618,7 @@ return array( 'conduit-api-css' => '7bc725c4', 'config-options-css' => '0ede4c9b', 'config-page-css' => '8798e14f', - 'conpherence-durable-column-view' => '63114a54', + 'conpherence-durable-column-view' => '61f73db6', 'conpherence-header-pane-css' => '517de9fe', 'conpherence-menu-css' => '78c7b811', 'conpherence-message-pane-css' => '0d7dff02', diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php index 5d05f962e2..ea627aeb1a 100644 --- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php +++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php @@ -229,7 +229,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { 'threadID' => $conpherence->getID(), 'threadTitle' => hsprintf('%s', $thread_title), 'tip' => $data['title'], - 'align' => 'S', + 'align' => 'W', ), ), phutil_tag( diff --git a/src/applications/conpherence/view/ConpherenceTransactionView.php b/src/applications/conpherence/view/ConpherenceTransactionView.php index e99013fda7..3b1c29ebcb 100644 --- a/src/applications/conpherence/view/ConpherenceTransactionView.php +++ b/src/applications/conpherence/view/ConpherenceTransactionView.php @@ -201,21 +201,19 @@ final class ConpherenceTransactionView extends AphrontView { private function renderTransactionImage() { $image = null; - if ($this->getFullDisplay()) { - $transaction = $this->getConpherenceTransaction(); - switch ($transaction->getTransactionType()) { - case PhabricatorTransactions::TYPE_COMMENT: - $handles = $this->getHandles(); - $author = $handles[$transaction->getAuthorPHID()]; - $image_uri = $author->getImageURI(); - $image = phutil_tag( - 'span', - array( - 'class' => 'conpherence-transaction-image', - 'style' => 'background-image: url('.$image_uri.');', - )); - break; - } + $transaction = $this->getConpherenceTransaction(); + switch ($transaction->getTransactionType()) { + case PhabricatorTransactions::TYPE_COMMENT: + $handles = $this->getHandles(); + $author = $handles[$transaction->getAuthorPHID()]; + $image_uri = $author->getImageURI(); + $image = phutil_tag( + 'span', + array( + 'class' => 'conpherence-transaction-image', + 'style' => 'background-image: url('.$image_uri.');', + )); + break; } return $image; } diff --git a/webroot/rsrc/css/application/conpherence/durable-column.css b/webroot/rsrc/css/application/conpherence/durable-column.css index f779b2645b..f80d5d5b26 100644 --- a/webroot/rsrc/css/application/conpherence/durable-column.css +++ b/webroot/rsrc/css/application/conpherence/durable-column.css @@ -9,9 +9,9 @@ .conpherence-durable-column { position: fixed; bottom: 0; - right: 12px; - width: 300px; - height: 380px; + right: 16px; + width: 400px; + height: 360px; background: #fff; box-shadow: 0px 1px 8px rgba(55,55,55, .3); } @@ -20,6 +20,16 @@ display: none; } +.conpherence-durable-column .conpherence-transaction-image { + float: left; + border-radius: 3px; + height: 24px; + width: 24px; + background-size: 24px; + position: absolute; + top: 5px; +} + .device-desktop .conpherence-durable-column.loading .loading-mask { display: block; } @@ -81,7 +91,7 @@ float: left; padding: 8px 0 8px 10px; color: #fff; - width: 230px; + width: 260px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; @@ -100,35 +110,34 @@ } .conpherence-durable-column-icon-bar { - height: 32px; - padding: 4px; + width: 36px; background-color: {$lightgreybackground}; + border-right: 1px solid {$thinblueborder}; + position: absolute; + top: 0; + left: 0; + bottom: 0; } .conpherence-durable-column-icon-bar .conpherence-durable-column-thread-icon { - float: left; - display: block; height: 28px; width: 28px; - border: 2px solid transparent; - border-radius: 3px; - margin: 0 2px 0 0; + padding: 4px; + display: block; } .conpherence-durable-column-icon-bar .conpherence-durable-column-thread-icon.selected { - border-color: {$sky}; + background-color: rgba({$alphablue},.1); } .conpherence-durable-column-icon-bar .conpherence-durable-column-thread-icon span { - position: relative; display: block; - width: 24px; - height: 24px; - top: 2px; - left: 2px; - background-size: 24px 24px; + width: 28px; + height: 28px; + border-radius: 3px; + background-size: 28px 28px; } .conpherence-durable-column-body { @@ -141,12 +150,11 @@ .conpherence-durable-column-main { position: absolute; - top: 40px; + top: 0; bottom: 36px; - left: 0; + left: 34px; right: 0; overflow-x: hidden; - border-top: 1px solid {$thinblueborder}; } .conpherence-durable-column-transactions { @@ -156,9 +164,9 @@ .conpherence-durable-column-transactions .conpherence-transaction-view.conpherence-edited { color: {$lightgreytext}; - font-size: {$smallerfontsize}; margin: 0; padding: 0; + font-style: italic; } .conpherence-durable-column-transactions .conpherence-edited @@ -180,7 +188,7 @@ .conpherence-durable-column-transactions .conpherence-transaction-detail { border: 0; - margin: 0; + margin: 0 0 0 32px; } .conpherence-durable-column-transactions .conpherence-transaction-detail @@ -191,13 +199,13 @@ .conpherence-durable-column-transactions .conpherence-transaction-view.date-marker { - margin: 20px 0px 8px; + margin: 12px 0 0; } .conpherence-durable-column-transactions .conpherence-transaction-view.date-marker .date { left: 0; - font-size: {$smallerfontsize}; + font-size: {$normalfontsize}; top: -14px; padding: 0 6px 0 0; } From 6d82fcc6d7c7f3d658952ed67c1f3c6b5db7ddf2 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 30 Sep 2016 20:24:18 +0000 Subject: [PATCH 18/21] Allow Durable Column to be minimized Summary: Add ability to minimize durable column Test Plan: Shrink and Grow, reload page, see stickyness... {F1855051} Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16638 --- resources/celerity/map.php | 32 +++--- src/__phutil_library_map__.php | 2 + .../view/ConpherenceDurableColumnView.php | 36 ++++++- ...icatorConpherenceColumnMinimizeSetting.php | 12 +++ src/view/page/PhabricatorStandardPageView.php | 10 ++ .../conpherence/durable-column.css | 101 +++++++++++++----- .../conpherence/behavior-durable-column.js | 19 +++- 7 files changed, 165 insertions(+), 47 deletions(-) create mode 100644 src/applications/settings/setting/PhabricatorConpherenceColumnMinimizeSetting.php diff --git a/resources/celerity/map.php b/resources/celerity/map.php index e34fa5a704..8906f5902f 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,10 +7,10 @@ */ return array( 'names' => array( - 'conpherence.pkg.css' => '4901ed78', + 'conpherence.pkg.css' => 'b1547973', 'conpherence.pkg.js' => '11f3e07e', 'core.pkg.css' => '55d32e63', - 'core.pkg.js' => '32939240', + 'core.pkg.js' => '975d6a27', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '3fb7f532', 'differential.pkg.js' => '634399e9', @@ -46,7 +46,7 @@ return array( 'rsrc/css/application/config/config-template.css' => '8f18fa41', 'rsrc/css/application/config/setup-issue.css' => 'f794cfc3', 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', - 'rsrc/css/application/conpherence/durable-column.css' => '61f73db6', + 'rsrc/css/application/conpherence/durable-column.css' => 'af11a2a7', 'rsrc/css/application/conpherence/header-pane.css' => '517de9fe', 'rsrc/css/application/conpherence/menu.css' => '78c7b811', 'rsrc/css/application/conpherence/message-pane.css' => '0d7dff02', @@ -438,7 +438,7 @@ return array( 'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408', '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' => '39e0ea32', + 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'e287689f', 'rsrc/js/application/conpherence/behavior-menu.js' => '9eb55204', 'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8', 'rsrc/js/application/conpherence/behavior-pontificate.js' => 'f2e58483', @@ -618,7 +618,7 @@ return array( 'conduit-api-css' => '7bc725c4', 'config-options-css' => '0ede4c9b', 'config-page-css' => '8798e14f', - 'conpherence-durable-column-view' => '61f73db6', + 'conpherence-durable-column-view' => 'af11a2a7', 'conpherence-header-pane-css' => '517de9fe', 'conpherence-menu-css' => '78c7b811', 'conpherence-message-pane-css' => '0d7dff02', @@ -699,7 +699,7 @@ return array( 'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc', 'javelin-behavior-doorkeeper-tag' => 'e5822781', 'javelin-behavior-drydock-live-operation-status' => '901935ef', - 'javelin-behavior-durable-column' => '39e0ea32', + 'javelin-behavior-durable-column' => 'e287689f', 'javelin-behavior-editengine-reorder-configs' => 'd7a74243', 'javelin-behavior-editengine-reorder-fields' => 'b59e1e96', 'javelin-behavior-error-log' => '6882e80a', @@ -1201,16 +1201,6 @@ return array( 'javelin-dom', 'javelin-workflow', ), - '39e0ea32' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-behavior-device', - 'javelin-scrollbar', - 'javelin-quicksand', - 'phabricator-keyboard-shortcut', - 'conpherence-thread-manager', - ), '3ab51e2c' => array( 'javelin-behavior', 'javelin-behavior-device', @@ -2119,6 +2109,16 @@ return array( 'javelin-stratcom', 'javelin-dom', ), + 'e287689f' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-behavior-device', + 'javelin-scrollbar', + 'javelin-quicksand', + 'phabricator-keyboard-shortcut', + 'conpherence-thread-manager', + ), 'e292eaf4' => array( 'javelin-install', ), diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 4289d89ba3..f4a7ba2fd3 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2213,6 +2213,7 @@ phutil_register_library_map(array( 'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php', 'PhabricatorConfigVersionController' => 'applications/config/controller/PhabricatorConfigVersionController.php', 'PhabricatorConpherenceApplication' => 'applications/conpherence/application/PhabricatorConpherenceApplication.php', + 'PhabricatorConpherenceColumnMinimizeSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnMinimizeSetting.php', 'PhabricatorConpherenceColumnVisibleSetting' => 'applications/settings/setting/PhabricatorConpherenceColumnVisibleSetting.php', 'PhabricatorConpherenceNotificationsSetting' => 'applications/settings/setting/PhabricatorConpherenceNotificationsSetting.php', 'PhabricatorConpherencePreferencesSettingsPanel' => 'applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php', @@ -6981,6 +6982,7 @@ phutil_register_library_map(array( 'PhabricatorConfigValidationException' => 'Exception', 'PhabricatorConfigVersionController' => 'PhabricatorConfigController', 'PhabricatorConpherenceApplication' => 'PhabricatorApplication', + 'PhabricatorConpherenceColumnMinimizeSetting' => 'PhabricatorInternalSetting', 'PhabricatorConpherenceColumnVisibleSetting' => 'PhabricatorInternalSetting', 'PhabricatorConpherenceNotificationsSetting' => 'PhabricatorSelectSetting', 'PhabricatorConpherencePreferencesSettingsPanel' => 'PhabricatorEditEngineSettingsPanel', diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php index ea627aeb1a..ed5c072c5d 100644 --- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php +++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php @@ -7,6 +7,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { private $selectedConpherence; private $transactions; private $visible; + private $minimize; private $initialLoad = false; private $policyObjects; private $quicksandConfig = array(); @@ -59,6 +60,15 @@ final class ConpherenceDurableColumnView extends AphrontTagView { return $this->visible; } + public function setMinimize($minimize) { + $this->minimize = $minimize; + return $this; + } + + public function getMinimize() { + return $this->minimize; + } + public function setInitialLoad($bool) { $this->initialLoad = $bool; return $this; @@ -109,12 +119,15 @@ final class ConpherenceDurableColumnView extends AphrontTagView { protected function getTagContent() { $column_key = PhabricatorConpherenceColumnVisibleSetting::SETTINGKEY; + $minimize_key = PhabricatorConpherenceColumnMinimizeSetting::SETTINGKEY; Javelin::initBehavior( 'durable-column', array( 'visible' => $this->getVisible(), - 'settingsURI' => '/settings/adjust/?key='.$column_key, + 'minimize' => $this->getMinimize(), + 'visibleURI' => '/settings/adjust/?key='.$column_key, + 'minimizeURI' => '/settings/adjust/?key='.$minimize_key, 'quicksandConfig' => $this->getQuicksandConfig(), )); @@ -131,6 +144,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { 'div', array( 'class' => implode(' ', $classes), + 'data-sigil' => 'conpherence-minimize-window', ), $this->buildHeader()); @@ -284,18 +298,30 @@ final class ConpherenceDurableColumnView extends AphrontTagView { 'containerDivID' => 'conpherence-durable-column', )); - $item = id(new PHUIListItemView()) + $bars = id(new PHUIListItemView()) ->setName(pht('Room Actions')) - ->setIcon('fa-bars') + ->setIcon('fa-gear') ->addClass('core-menu-item') + ->addClass('conpherence-settings-icon') ->addSigil('conpherence-settings-menu') ->setID($bubble_id) ->setHref('#') ->setAural(pht('Room Actions')) + ->setOrder(400); + + $minimize = id(new PHUIListItemView()) + ->setName(pht('Minimize Window')) + ->setIcon('fa-toggle-down') + ->addClass('core-menu-item') + ->addClass('conpherence-minimize-icon') + ->addSigil('conpherence-minimize-window') + ->setHref('#') + ->setAural(pht('Minimize Window')) ->setOrder(300); + $settings_button = id(new PHUIListView()) - ->addMenuItem($item) - ->addClass('phabricator-dark-menu') + ->addMenuItem($bars) + ->addMenuItem($minimize) ->addClass('phabricator-application-menu'); $header = null; diff --git a/src/applications/settings/setting/PhabricatorConpherenceColumnMinimizeSetting.php b/src/applications/settings/setting/PhabricatorConpherenceColumnMinimizeSetting.php new file mode 100644 index 0000000000..7ba4b27103 --- /dev/null +++ b/src/applications/settings/setting/PhabricatorConpherenceColumnMinimizeSetting.php @@ -0,0 +1,12 @@ +getUserPreference($column_key, false); } + public function getDurableColumnMinimize() { + $column_key = PhabricatorConpherenceColumnMinimizeSetting::SETTINGKEY; + return (bool)$this->getUserPreference($column_key, false); + } + public function addQuicksandConfig(array $config) { $this->quicksandConfig = $config + $this->quicksandConfig; return $this; @@ -480,12 +485,17 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView $durable_column = null; if ($this->getShowDurableColumn()) { $is_visible = $this->getDurableColumnVisible(); + $is_minimize = $this->getDurableColumnMinimize(); $durable_column = id(new ConpherenceDurableColumnView()) ->setSelectedConpherence(null) ->setUser($user) ->setQuicksandConfig($this->buildQuicksandConfig()) ->setVisible($is_visible) + ->setMinimize($is_minimize) ->setInitialLoad(true); + if ($is_minimize) { + $this->classes[] = 'minimize-column'; + } } Javelin::initBehavior('quicksand-blacklist', array( diff --git a/webroot/rsrc/css/application/conpherence/durable-column.css b/webroot/rsrc/css/application/conpherence/durable-column.css index f80d5d5b26..f4320ed1a2 100644 --- a/webroot/rsrc/css/application/conpherence/durable-column.css +++ b/webroot/rsrc/css/application/conpherence/durable-column.css @@ -13,6 +13,8 @@ width: 400px; height: 360px; background: #fff; + border-top-right-radius: 3px; + border-top-left-radius: 3px; box-shadow: 0px 1px 8px rgba(55,55,55, .3); } @@ -38,18 +40,6 @@ z-index: 1; } -.conpherence-durable-column-header .phabricator-application-menu { - display: block; - float: right; - padding-right: 4px; - width: 36px; -} - -.conpherence-durable-column-header .phabricator-application-menu - .phui-list-item-view.core-menu-item { - display: block; -} - .conpherence-durable-column-header .phabricator-application-menu .phui-list-item-name { display: none; @@ -57,11 +47,10 @@ .conpherence-durable-column-header .phabricator-application-menu .phui-list-item-view { - float: left; - position: relative; - width: 30px; - height: 30px; - margin-top: 2px; + margin: 0; + width: 28px; + height: 34px; + min-width: 28px; } .conpherence-durable-column-header .phabricator-application-menu @@ -71,17 +60,21 @@ padding: 0; } -.conpherence-durable-column-header .phabricator-application-menu - .phui-list-item-view.core-menu-item { - display: block; -} - .conpherence-durable-column-header { border-top-right-radius: 3px; border-top-left-radius: 3px; background-color: #525867; } +.conpherence-durable-column-header:hover { + cursor: pointer; + background-color: #5f6572; +} + +.conpherence-durable-column-header .phabricator-application-menu { + margin-right: 8px; +} + .conpherence-durable-column-header .phabricator-main-menu-dropdown.phui-list-sidenav { top: 30px; @@ -100,8 +93,11 @@ .conpherence-durable-column-header .phabricator-application-menu .phui-list-item-icon.phui-font-fa { - font-size: 14px; - margin: 8px 10px; + font-size: 15px; + margin: 0; + height: 15px; + width: 15px; + padding: 10px 8px 10px 8px; } .conpherence-durable-column-header-text .phui-icon-view { @@ -274,6 +270,61 @@ img { box-shadow: none; } -.conpherence-durable-column-footer { + +/* Minimized Column */ + +.minimize-column .conpherence-durable-column { + height: 32px; + width: 240px; + box-shadow: none; +} + +.minimize-column .conpherence-durable-column .conpherence-durable-column-body { display: none; } + +.minimize-column .conpherence-durable-column + .conpherence-durable-column-header { + background-color: rgba({$alphablue},.15); +} + +.minimize-column .conpherence-durable-column + .conpherence-durable-column-header:hover { + background-color: rgba({$alphablue},.2); +} + +.minimize-column .conpherence-durable-column + .conpherence-durable-column-header-text { + width: 100px; + color: {$darkbluetext}; + text-shadow: none; +} + +.minimize-column .conpherence-durable-column + .conpherence-durable-column-header-text .phui-icon-view { + color: {$darkbluetext}; + text-shadow: none; +} + +.minimize-column .conpherence-durable-column + .conpherence-durable-column-header .phabricator-application-menu + .phui-list-item-icon.phui-font-fa { + color: {$bluetext}; +} + +.minimize-column .conpherence-durable-column + .conpherence-durable-column-header .phabricator-application-menu + .phui-list-item-icon.phui-font-fa:hover { + color: {$darkbluetext}; +} + +.minimize-column .conpherence-durable-column + .conpherence-durable-column-header .phabricator-application-menu + .phui-list-item-icon.phui-font-fa:before { + content: "\f151"; +} + +.minimize-column .conpherence-durable-column .phabricator-application-menu + .conpherence-settings-icon { + display: none; +} diff --git a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js index 76ee549764..812be0f082 100644 --- a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js +++ b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js @@ -25,6 +25,7 @@ JX.behavior('durable-column', function(config, statics) { } var userVisible = config.visible; + var userMinimize = config.minimize; var show = null; var loadThreadID = null; var scrollbar = null; @@ -54,11 +55,22 @@ JX.behavior('durable-column', function(config, statics) { userVisible = !userVisible; _updateColumnVisibility(); - new JX.Request(config.settingsURI) + new JX.Request(config.visibleURI) .setData({value: (show ? 1 : 0)}) .send(); } + function _minimizeColumn(e) { + e.kill(); + userMinimize = !userMinimize; + JX.DOM.alterClass(document.body, 'minimize-column', userMinimize); + JX.Stratcom.invoke('resize'); + + new JX.Request(config.minimizeURI) + .setData({value: (userMinimize ? 1 : 0)}) + .send(); + } + function _drawColumn(visible) { JX.DOM.alterClass( document.body, @@ -81,6 +93,11 @@ JX.behavior('durable-column', function(config, statics) { .setHandler(_toggleColumn) .register(); + JX.Stratcom.listen( + 'click', + 'conpherence-minimize-window', + _minimizeColumn); + scrollbar = new JX.Scrollbar(_getColumnScrollNode()); JX.Quicksand.setFrame(userVisible ? quick : null); From 3d080460416617a59d974310e934766a7a4222bc Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 30 Sep 2016 13:48:42 -0700 Subject: [PATCH 19/21] Remove calls to attachFilePHIDs in Conpherence Reply Handler Summary: I missed removing this during the file purge of '16. Fixes T11717 Test Plan: Will test live Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T11717 Differential Revision: https://secure.phabricator.com/D16639 --- .../conpherence/mail/ConpherenceReplyHandler.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/applications/conpherence/mail/ConpherenceReplyHandler.php b/src/applications/conpherence/mail/ConpherenceReplyHandler.php index 0a07cbad29..946501c8b8 100644 --- a/src/applications/conpherence/mail/ConpherenceReplyHandler.php +++ b/src/applications/conpherence/mail/ConpherenceReplyHandler.php @@ -34,14 +34,8 @@ final class ConpherenceReplyHandler extends PhabricatorMailReplyHandler { $user = $this->getActor(); if (!$conpherence->getPHID()) { $conpherence - ->attachParticipants(array()) - ->attachFilePHIDs(array()); + ->attachParticipants(array()); } else { - $edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST; - $file_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( - $conpherence->getPHID(), - $edge_type); - $conpherence->attachFilePHIDs($file_phids); $participants = id(new ConpherenceParticipant()) ->loadAllWhere('conpherencePHID = %s', $conpherence->getPHID()); $participants = mpull($participants, null, 'getParticipantPHID'); From a3dd1eab3da78ead036528dcda7ea8ad3b1b1d40 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 30 Sep 2016 14:13:03 -0700 Subject: [PATCH 20/21] Looser spacing for durable column + minimize + footer Summary: Lets chat sit under the footer, if present. Test Plan: View new spacing with footer and minimized chat Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16640 --- resources/celerity/map.php | 6 +++--- webroot/rsrc/css/application/base/standard-page-view.css | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 8906f5902f..45043f52bc 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => 'b1547973', 'conpherence.pkg.js' => '11f3e07e', - 'core.pkg.css' => '55d32e63', + 'core.pkg.css' => 'b6cbe7ca', 'core.pkg.js' => '975d6a27', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '3fb7f532', @@ -38,7 +38,7 @@ return array( 'rsrc/css/application/base/notification-menu.css' => 'b3ab500d', 'rsrc/css/application/base/phabricator-application-launch-view.css' => '95351601', 'rsrc/css/application/base/phui-theme.css' => '027ba77e', - 'rsrc/css/application/base/standard-page-view.css' => '3026770e', + 'rsrc/css/application/base/standard-page-view.css' => '79176f5a', 'rsrc/css/application/chatlog/chatlog.css' => 'd295b020', 'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4', 'rsrc/css/application/config/config-options.css' => '0ede4c9b', @@ -869,7 +869,7 @@ return array( 'phabricator-shaped-request' => '7cbe244b', 'phabricator-slowvote-css' => 'a94b7230', 'phabricator-source-code-view-css' => 'cbeef983', - 'phabricator-standard-page-view' => '3026770e', + 'phabricator-standard-page-view' => '79176f5a', 'phabricator-textareautils' => '320810c8', 'phabricator-title' => 'df5e11d2', 'phabricator-tooltip' => '6323f942', diff --git a/webroot/rsrc/css/application/base/standard-page-view.css b/webroot/rsrc/css/application/base/standard-page-view.css index 43215df445..36294ca288 100644 --- a/webroot/rsrc/css/application/base/standard-page-view.css +++ b/webroot/rsrc/css/application/base/standard-page-view.css @@ -29,6 +29,10 @@ body.white-background { color: {$greytext}; } +.with-durable-column .phabricator-standard-page-footer { + margin: 36px 16px 28px; +} + .device .phabricator-standard-page-footer { margin: 24px 8px 16px; } From e498d4476d4f007faddb05a1b2f331c6685eb3fa Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 30 Sep 2016 14:55:04 -0700 Subject: [PATCH 21/21] Fix some Quicksand bugs Summary: Packages AppSearch, fixes body color, moves Differential filetree into differential package. Test Plan: Enable quicksand. Navigate home -> differential -> diff. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16641 --- resources/celerity/map.php | 7 ++++--- resources/celerity/packages.php | 3 ++- .../controller/PhabricatorApplicationSearchController.php | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 45043f52bc..78ec532eef 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,10 +9,10 @@ return array( 'names' => array( 'conpherence.pkg.css' => 'b1547973', 'conpherence.pkg.js' => '11f3e07e', - 'core.pkg.css' => 'b6cbe7ca', + 'core.pkg.css' => 'cfc3eabe', 'core.pkg.js' => '975d6a27', 'darkconsole.pkg.js' => 'e7393ebb', - 'differential.pkg.css' => '3fb7f532', + 'differential.pkg.css' => 'e1d704ce', 'differential.pkg.js' => '634399e9', 'diffusion.pkg.css' => '91c5d3a6', 'diffusion.pkg.js' => '84c8f8fd', @@ -2332,6 +2332,7 @@ return array( 'aphront-tokenizer-control-css', 'aphront-typeahead-control-css', 'aphront-list-filter-view-css', + 'application-search-view-css', 'phabricator-remarkup-css', 'syntax-highlighting-css', 'syntax-default-css', @@ -2344,7 +2345,6 @@ return array( 'phabricator-notification-menu-css', 'lightbox-attachment-css', 'phui-header-view-css', - 'phabricator-filetree-view-css', 'phabricator-nav-view-css', 'phui-basic-nav-view-css', 'phui-crumbs-view-css', @@ -2479,6 +2479,7 @@ return array( 'phabricator-content-source-view-css', 'inline-comment-summary-css', 'phui-inline-comment-view-css', + 'phabricator-filetree-view-css', ), 'differential.pkg.js' => array( 'phabricator-drag-and-drop-file-upload', diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php index 6e553a8c6e..a3a2a6132a 100644 --- a/resources/celerity/packages.php +++ b/resources/celerity/packages.php @@ -98,6 +98,7 @@ return array( 'aphront-tokenizer-control-css', 'aphront-typeahead-control-css', 'aphront-list-filter-view-css', + 'application-search-view-css', 'phabricator-remarkup-css', 'syntax-highlighting-css', @@ -112,7 +113,6 @@ return array( 'phabricator-notification-menu-css', 'lightbox-attachment-css', 'phui-header-view-css', - 'phabricator-filetree-view-css', 'phabricator-nav-view-css', 'phui-basic-nav-view-css', 'phui-crumbs-view-css', @@ -180,6 +180,7 @@ return array( 'phabricator-content-source-view-css', 'inline-comment-summary-css', 'phui-inline-comment-view-css', + 'phabricator-filetree-view-css', ), 'differential.pkg.js' => array( 'phabricator-drag-and-drop-file-upload', diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php index a463e50471..d36d279c55 100644 --- a/src/applications/search/controller/PhabricatorApplicationSearchController.php +++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php @@ -320,6 +320,7 @@ final class PhabricatorApplicationSearchController $crumbs->addTextCrumb($title); } + $nav->addClass('application-search-view'); require_celerity_resource('application-search-view-css'); return $this->newPage() @@ -327,8 +328,7 @@ final class PhabricatorApplicationSearchController ->setTitle(pht('Query: %s', $title)) ->setCrumbs($crumbs) ->setNavigation($nav) - ->appendChild($body) - ->addClass('application-search-view'); + ->appendChild($body); } private function processEditRequest() { @@ -419,6 +419,7 @@ final class PhabricatorApplicationSearchController ->setObjectList($list) ->addClass('application-search-results'); + $nav->addClass('application-search-view'); require_celerity_resource('application-search-view-css'); return $this->newPage() @@ -426,7 +427,6 @@ final class PhabricatorApplicationSearchController ->setTitle(pht('Saved Queries')) ->setCrumbs($crumbs) ->setNavigation($nav) - ->addClass('application-search-view') ->appendChild($box); }