From 5794d45da31f7a816ea76c9277297def9280714e Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 5 Sep 2015 10:05:02 -0700 Subject: [PATCH 01/16] Fix word-break on remarkup tables Summary: Tables headers break all kinds of funky even though we set `word-break` to word presumably because width is not calculated. Just use normal breaks. Test Plan: Test developer documentation table in sand box, table is readable on desktop, phone break points. Reviewers: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D14063 --- resources/celerity/map.php | 10 +++++----- webroot/rsrc/css/core/remarkup.css | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index cc948cc4f5..a468a918cf 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => 'eb8c668d', + 'core.pkg.css' => '7d2aec87', 'core.pkg.js' => '47dc9ebb', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', @@ -104,7 +104,7 @@ return array( 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/uiexample/example.css' => '528b19de', 'rsrc/css/core/core.css' => 'a76cefc9', - 'rsrc/css/core/remarkup.css' => 'ef286a6e', + 'rsrc/css/core/remarkup.css' => '1c4ac273', 'rsrc/css/core/syntax.css' => '9fd11da8', 'rsrc/css/core/z-index.css' => '57ddcaa2', 'rsrc/css/diviner/diviner-shared.css' => '5a337049', @@ -138,7 +138,7 @@ return array( 'rsrc/css/phui/phui-info-view.css' => '5b16bac6', 'rsrc/css/phui/phui-list.css' => '125599df', 'rsrc/css/phui/phui-object-box.css' => '407eaf5a', - 'rsrc/css/phui/phui-object-item-list-view.css' => 'ab1bf393', + 'rsrc/css/phui/phui-object-item-list-view.css' => '26c30d3f', 'rsrc/css/phui/phui-pager.css' => 'bea33d23', 'rsrc/css/phui/phui-pinboard-view.css' => '2495140e', 'rsrc/css/phui/phui-property-list-view.css' => '03904f6b', @@ -737,7 +737,7 @@ return array( 'phabricator-object-selector-css' => '85ee8ce6', 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => '6920d200', - 'phabricator-remarkup-css' => 'ef286a6e', + 'phabricator-remarkup-css' => '1c4ac273', 'phabricator-search-results-css' => '7dea472c', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-side-menu-view-css' => 'bec2458e', @@ -791,7 +791,7 @@ return array( 'phui-inline-comment-view-css' => '0fdb3667', 'phui-list-view-css' => '125599df', 'phui-object-box-css' => '407eaf5a', - 'phui-object-item-list-view-css' => 'ab1bf393', + 'phui-object-item-list-view-css' => '26c30d3f', 'phui-pager-css' => 'bea33d23', 'phui-pinboard-view-css' => '2495140e', 'phui-property-list-view-css' => '03904f6b', diff --git a/webroot/rsrc/css/core/remarkup.css b/webroot/rsrc/css/core/remarkup.css index 207b69618c..9a3906f3b8 100644 --- a/webroot/rsrc/css/core/remarkup.css +++ b/webroot/rsrc/css/core/remarkup.css @@ -339,12 +339,13 @@ border-spacing: 1px; background: {$lightblueborder}; margin: 12px 0; + word-break: normal; } .phabricator-remarkup table.remarkup-table th { font-weight: bold; padding: 4px 6px; - background: #F8F9FC; + background: {$lightbluebackground}; } .phabricator-remarkup table.remarkup-table td { From 6915011067d619780c390e3ad9ecb820132bbe84 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 7 Sep 2015 17:18:35 -0700 Subject: [PATCH 02/16] Provide an AphrontController implementation of willSendResponse() Summary: This is required by Aphront now but not given a default implementation in the base class. Test Plan: CORGI sites now work. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D14079 --- resources/celerity/map.php | 10 +++++----- src/aphront/AphrontController.php | 4 ++++ webroot/rsrc/css/aphront/list-filter-view.css | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index a468a918cf..a478e285db 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => '7d2aec87', + 'core.pkg.css' => 'e9f745e2', 'core.pkg.js' => '47dc9ebb', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', @@ -20,7 +20,7 @@ return array( 'rsrc/css/aphront/dark-console.css' => '6378ef3d', 'rsrc/css/aphront/dialog-view.css' => 'fe58b18d', 'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d', - 'rsrc/css/aphront/list-filter-view.css' => 'aa5ffcb9', + 'rsrc/css/aphront/list-filter-view.css' => '5d6f0526', 'rsrc/css/aphront/multi-column.css' => 'fd18389d', 'rsrc/css/aphront/notification.css' => '9c279160', 'rsrc/css/aphront/panel-view.css' => '8427b78d', @@ -104,7 +104,7 @@ return array( 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/uiexample/example.css' => '528b19de', 'rsrc/css/core/core.css' => 'a76cefc9', - 'rsrc/css/core/remarkup.css' => '1c4ac273', + 'rsrc/css/core/remarkup.css' => 'ef286a6e', 'rsrc/css/core/syntax.css' => '9fd11da8', 'rsrc/css/core/z-index.css' => '57ddcaa2', 'rsrc/css/diviner/diviner-shared.css' => '5a337049', @@ -493,7 +493,7 @@ return array( 'aphront-bars' => '231ac33c', 'aphront-dark-console-css' => '6378ef3d', 'aphront-dialog-view-css' => 'fe58b18d', - 'aphront-list-filter-view-css' => 'aa5ffcb9', + 'aphront-list-filter-view-css' => '5d6f0526', 'aphront-multi-column-view-css' => 'fd18389d', 'aphront-panel-view-css' => '8427b78d', 'aphront-table-view-css' => 'e3632cc9', @@ -737,7 +737,7 @@ return array( 'phabricator-object-selector-css' => '85ee8ce6', 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => '6920d200', - 'phabricator-remarkup-css' => '1c4ac273', + 'phabricator-remarkup-css' => 'ef286a6e', 'phabricator-search-results-css' => '7dea472c', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-side-menu-view-css' => 'bec2458e', diff --git a/src/aphront/AphrontController.php b/src/aphront/AphrontController.php index ded0b362a3..4e5df8afbd 100644 --- a/src/aphront/AphrontController.php +++ b/src/aphront/AphrontController.php @@ -37,6 +37,10 @@ abstract class AphrontController extends Phobject { 'processRequest()')); } + public function willSendResponse(AphrontResponse $response) { + return $response; + } + final public function setRequest(AphrontRequest $request) { $this->request = $request; return $this; diff --git a/webroot/rsrc/css/aphront/list-filter-view.css b/webroot/rsrc/css/aphront/list-filter-view.css index f41008cb34..50d43f2383 100644 --- a/webroot/rsrc/css/aphront/list-filter-view.css +++ b/webroot/rsrc/css/aphront/list-filter-view.css @@ -39,7 +39,7 @@ padding: 0 0 4px 4px; } -/* When a list filter view contains two consecuitive forms, lay them out +/* When a list filter view contains two consecutive forms, lay them out without much white space in between them so they look more contiugous. At the time of writing, this is used only in the Diffusion repository search UI. */ From 7425407c126bbcee265982916068c75bdefa9870 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 8 Sep 2015 08:49:33 -0700 Subject: [PATCH 03/16] Improve `bin/config set` errors for complex values Summary: - Fix missing space before "For example:". - Fix instruction to run `bin/config set value` instead of `bin/config set key value`. - Minor cleanup. Test Plan: Tried to set `files.image-mime-types`, `load-libraries`. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D14080 --- resources/celerity/map.php | 6 ++-- ...PhabricatorConfigManagementSetWorkflow.php | 32 ++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index a478e285db..fd885f0f34 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => 'e9f745e2', + 'core.pkg.css' => '3fcfaed8', 'core.pkg.js' => '47dc9ebb', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', @@ -104,7 +104,7 @@ return array( 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/uiexample/example.css' => '528b19de', 'rsrc/css/core/core.css' => 'a76cefc9', - 'rsrc/css/core/remarkup.css' => 'ef286a6e', + 'rsrc/css/core/remarkup.css' => '1c4ac273', 'rsrc/css/core/syntax.css' => '9fd11da8', 'rsrc/css/core/z-index.css' => '57ddcaa2', 'rsrc/css/diviner/diviner-shared.css' => '5a337049', @@ -737,7 +737,7 @@ return array( 'phabricator-object-selector-css' => '85ee8ce6', 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => '6920d200', - 'phabricator-remarkup-css' => 'ef286a6e', + 'phabricator-remarkup-css' => '1c4ac273', 'phabricator-search-results-css' => '7dea472c', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-side-menu-view-css' => 'bec2458e', diff --git a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php index 1da30408ee..97586a77dd 100644 --- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php +++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php @@ -96,25 +96,35 @@ final class PhabricatorConfigManagementSetWorkflow if (!is_array($value)) { switch ($type) { case 'set': + $command = csprintf( + './bin/config set %R %s', + $key, + '{"value1": true, "value2": true}'); + $message = sprintf( - "%s%s\n\n %s\n", - pht( - "Config key '%s' is of type '%s'. Specify it in JSON.", - $key, - $type), - pht('For example:'), - './bin/config set \'{"value1": true, "value2": true}\''); + "%s\n\n %s\n", + pht( + 'Config key "%s" is of type "%s". Specify it in JSON. '. + 'For example:', + $key, + $type), + $command); break; default: if (preg_match('/^list Date: Tue, 8 Sep 2015 16:20:58 -0700 Subject: [PATCH 04/16] Fix missing `willUpload` hook for drag-and-drop chunked upload Summary: Ref T9324. When you upload a normal file, we call `willUpload` and then `didUpload`. When you upload a chunked file, we never call `willUpload`. This can get things out of sync. Make sure we invoke this event for both chunked and non-chunked uploads. Test Plan: Got cleaner behavior (redirect after all uploads finish) in new Phacility file upload area. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9324 Differential Revision: https://secure.phabricator.com/D14083 --- resources/celerity/map.php | 22 +++++++++---------- webroot/rsrc/js/core/DragAndDropFileUpload.js | 2 ++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index fd885f0f34..9e02f6bb8b 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -11,7 +11,7 @@ return array( 'core.pkg.js' => '47dc9ebb', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', - 'differential.pkg.js' => '813c1633', + 'differential.pkg.js' => '52d725be', 'diffusion.pkg.css' => '385e85b3', 'diffusion.pkg.js' => '0115b37c', 'maniphest.pkg.css' => '4845691a', @@ -429,7 +429,7 @@ return array( 'rsrc/js/application/uiexample/gesture-example.js' => '558829c2', 'rsrc/js/application/uiexample/notification-example.js' => '8ce821c5', 'rsrc/js/core/Busy.js' => '59a7976a', - 'rsrc/js/core/DragAndDropFileUpload.js' => '07de8873', + 'rsrc/js/core/DragAndDropFileUpload.js' => 'ad10aeac', 'rsrc/js/core/DraggableList.js' => 'a16ec1c6', 'rsrc/js/core/FileUpload.js' => '477359c8', 'rsrc/js/core/Hovercard.js' => '14ac66f5', @@ -718,7 +718,7 @@ return array( 'phabricator-core-css' => 'a76cefc9', 'phabricator-countdown-css' => 'e7544472', 'phabricator-dashboard-css' => 'eb458607', - 'phabricator-drag-and-drop-file-upload' => '07de8873', + 'phabricator-drag-and-drop-file-upload' => 'ad10aeac', 'phabricator-draggable-list' => 'a16ec1c6', 'phabricator-fatal-config-template-css' => '8e6c6fcd', 'phabricator-feed-css' => 'ecd4ec57', @@ -885,14 +885,6 @@ return array( 'javelin-stratcom', 'javelin-workflow', ), - '07de8873' => array( - 'javelin-install', - 'javelin-util', - 'javelin-request', - 'javelin-dom', - 'javelin-uri', - 'phabricator-file-upload', - ), '087e919c' => array( 'javelin-install', 'javelin-dom', @@ -1658,6 +1650,14 @@ return array( 'javelin-stratcom', 'javelin-install', ), + 'ad10aeac' => array( + 'javelin-install', + 'javelin-util', + 'javelin-request', + 'javelin-dom', + 'javelin-uri', + 'phabricator-file-upload', + ), 'b064af76' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/webroot/rsrc/js/core/DragAndDropFileUpload.js b/webroot/rsrc/js/core/DragAndDropFileUpload.js index f457b3540c..cee617061c 100644 --- a/webroot/rsrc/js/core/DragAndDropFileUpload.js +++ b/webroot/rsrc/js/core/DragAndDropFileUpload.js @@ -230,6 +230,8 @@ JX.install('PhabricatorDragAndDropFileUpload', { .setStatus('allocate') .update(); + this.invoke('willUpload', file); + var alloc_uri = this._getUploadURI(file) .setQueryParam('allocate', 1); From 345cc66f0f90cc1da572112e577bc3eacbc8ca26 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 9 Sep 2015 14:06:49 -0700 Subject: [PATCH 05/16] Fix some missing "@" in doclinks Summary: Fixes T9368. Test Plan: Grepped for "Adding New Classes". Reviewers: chad Reviewed By: chad Maniphest Tasks: T9368 Differential Revision: https://secure.phabricator.com/D14087 --- src/docs/user/configuration/managing_daemons.diviner | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/docs/user/configuration/managing_daemons.diviner b/src/docs/user/configuration/managing_daemons.diviner index d82421496f..b8d102a13d 100644 --- a/src/docs/user/configuration/managing_daemons.diviner +++ b/src/docs/user/configuration/managing_daemons.diviner @@ -109,7 +109,7 @@ This daemon will daemonize and run normally. just those started with `phd start`. If you're writing a restart script, have it launch any custom daemons explicitly after `phd restart`. - You can write your own daemons and manage them with `phd` by extending - @{class:PhabricatorDaemon}. See {article@contributor:Adding New Classes}. + @{class:PhabricatorDaemon}. See @{article@contributor:Adding New Classes}. - See @{article:Diffusion User Guide} for details about tuning the repository daemon. @@ -137,4 +137,4 @@ Continue by: - learning about the repository daemon with @{article:Diffusion User Guide}; or - - writing your own daemons with {article@contributor:Adding New Classes}. + - writing your own daemons with @{article@contributor:Adding New Classes}. From de01f3e2e08e7c8b1e492ef4203541fe2d503a9d Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 9 Sep 2015 14:07:07 -0700 Subject: [PATCH 06/16] Add Maniphest Task email creator to CCs Summary: Fixes T9369. Test Plan: - Sent a mail with Mail.app to `bugs@local.phacility.com`. - Used "View Raw Mail", copy-pasted it into `mail.txt` on disk. - Ran `cat mail.txt | ./scripts/mail/manage_mail.php --process-duplicates`. - Saw task get created and me get added as CC. - Changed "To" to include another user, ran command again, saw task get created and other user get added as CC. Reviewers: chad Reviewed By: chad Subscribers: Korvin Maniphest Tasks: T9369 Differential Revision: https://secure.phabricator.com/D14086 --- .../mail/ConpherenceCreateThreadMailReceiver.php | 2 +- .../mail/ManiphestCreateMailReceiver.php | 2 +- .../maniphest/mail/ManiphestReplyHandler.php | 15 +++++++++++++-- .../receiver/PhabricatorObjectMailReceiver.php | 2 +- .../storage/PhabricatorMetaMTAReceivedMail.php | 2 +- ...bricatorApplicationTransactionReplyHandler.php | 8 ++++---- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/applications/conpherence/mail/ConpherenceCreateThreadMailReceiver.php b/src/applications/conpherence/mail/ConpherenceCreateThreadMailReceiver.php index aacf4426d4..543233df6e 100644 --- a/src/applications/conpherence/mail/ConpherenceCreateThreadMailReceiver.php +++ b/src/applications/conpherence/mail/ConpherenceCreateThreadMailReceiver.php @@ -56,7 +56,7 @@ final class ConpherenceCreateThreadMailReceiver ->setMailReceiver(ConpherenceThread::initializeNewRoom($sender)) ->setMailAddedParticipantPHIDs($phids) ->setActor($sender) - ->setExcludeMailRecipientPHIDs($mail->loadExcludeMailRecipientPHIDs()) + ->setExcludeMailRecipientPHIDs($mail->loadAllRecipientPHIDs()) ->processEmail($mail); if ($conpherence) { diff --git a/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php b/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php index 0102b1bd7b..767a11d267 100644 --- a/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php +++ b/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php @@ -24,7 +24,7 @@ final class ManiphestCreateMailReceiver extends PhabricatorMailReceiver { $handler->setActor($sender); $handler->setExcludeMailRecipientPHIDs( - $mail->loadExcludeMailRecipientPHIDs()); + $mail->loadAllRecipientPHIDs()); if ($this->getApplicationEmail()) { $handler->setApplicationEmail($this->getApplicationEmail()); } diff --git a/src/applications/maniphest/mail/ManiphestReplyHandler.php b/src/applications/maniphest/mail/ManiphestReplyHandler.php index af96de70da..bc9b2456d4 100644 --- a/src/applications/maniphest/mail/ManiphestReplyHandler.php +++ b/src/applications/maniphest/mail/ManiphestReplyHandler.php @@ -19,17 +19,28 @@ final class ManiphestReplyHandler $object = $this->getMailReceiver(); $is_new = !$object->getID(); + $actor = $this->getActor(); $xactions = array(); if ($is_new) { - $xactions[] = $object->getApplicationTransactionTemplate() + $xactions[] = $this->newTransaction() ->setTransactionType(ManiphestTransaction::TYPE_TITLE) ->setNewValue(nonempty($mail->getSubject(), pht('Untitled Task'))); - $xactions[] = $object->getApplicationTransactionTemplate() + $xactions[] = $this->newTransaction() ->setTransactionType(ManiphestTransaction::TYPE_DESCRIPTION) ->setNewValue($body); + + $actor_phid = $actor->getPHID(); + if ($actor_phid) { + $xactions[] = $this->newTransaction() + ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) + ->setNewValue( + array( + '+' => array($actor_phid), + )); + } } return $xactions; diff --git a/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php b/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php index 062eb52502..81f8ade37b 100644 --- a/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php +++ b/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php @@ -49,7 +49,7 @@ abstract class PhabricatorObjectMailReceiver extends PhabricatorMailReceiver { return $handler ->setMailReceiver($object) ->setActor($sender) - ->setExcludeMailRecipientPHIDs($mail->loadExcludeMailRecipientPHIDs()) + ->setExcludeMailRecipientPHIDs($mail->loadAllRecipientPHIDs()) ->processEmail($mail); } diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php index 60e8a5e468..f6c9474255 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php @@ -82,7 +82,7 @@ final class PhabricatorMetaMTAReceivedMail extends PhabricatorMetaMTADAO { return $this->getRawEmailAddresses(idx($this->headers, 'to')); } - public function loadExcludeMailRecipientPHIDs() { + public function loadAllRecipientPHIDs() { $addresses = array_merge( $this->getToAddresses(), $this->getCCAddresses()); diff --git a/src/applications/transactions/replyhandler/PhabricatorApplicationTransactionReplyHandler.php b/src/applications/transactions/replyhandler/PhabricatorApplicationTransactionReplyHandler.php index 82f3eca2cc..560a750f00 100644 --- a/src/applications/transactions/replyhandler/PhabricatorApplicationTransactionReplyHandler.php +++ b/src/applications/transactions/replyhandler/PhabricatorApplicationTransactionReplyHandler.php @@ -39,7 +39,7 @@ abstract class PhabricatorApplicationTransactionReplyHandler return $editor; } - private function newTransaction() { + protected function newTransaction() { return $this->getMailReceiver()->getApplicationTransactionTemplate(); } @@ -80,15 +80,15 @@ abstract class PhabricatorApplicationTransactionReplyHandler $xactions = $this->didReceiveMail($mail, $body); // If this object is subscribable, subscribe all the users who were - // CC'd on the message. + // recipients on the message. if ($object instanceof PhabricatorSubscribableInterface) { - $subscriber_phids = $mail->loadCCPHIDs(); + $subscriber_phids = $mail->loadAllRecipientPHIDs(); if ($subscriber_phids) { $xactions[] = $this->newTransaction() ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) ->setNewValue( array( - '+' => array($viewer->getPHID()), + '+' => $subscriber_phids, )); } } From 25786df3a14030efda63d43d80a8b42acc059d9a Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 9 Sep 2015 19:18:08 -0700 Subject: [PATCH 07/16] Give "Arcanist Client Results" a more clear name Summary: Fixes T9380. See that task for discussion. This doesn't feel awesome but is maybe the least-bad fix? I think this name is clearer. Test Plan: Looked at autoplan in Harbormaster, saw new name. Reviewers: meitros, chad Reviewed By: chad Maniphest Tasks: T9380 Differential Revision: https://secure.phabricator.com/D14088 --- .../harbormaster/autoplan/HarbormasterBuildArcanistAutoplan.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/harbormaster/autoplan/HarbormasterBuildArcanistAutoplan.php b/src/applications/harbormaster/autoplan/HarbormasterBuildArcanistAutoplan.php index 7b4d5f8433..f5b68334ed 100644 --- a/src/applications/harbormaster/autoplan/HarbormasterBuildArcanistAutoplan.php +++ b/src/applications/harbormaster/autoplan/HarbormasterBuildArcanistAutoplan.php @@ -10,7 +10,7 @@ final class HarbormasterBuildArcanistAutoplan } public function getAutoplanName() { - return pht('Arcanist Client Results'); + return pht('arc lint + arc unit'); } } From 738cb1fa7827c613f4cf157b9e181db6fe89e8f6 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 10 Sep 2015 05:34:20 -0700 Subject: [PATCH 08/16] Fix Mercurial unable to authenticate with HTTP when pulling Summary: As described in T7959, it looks like Diffusion does not provide Mercurial the required HTTP credentials when pulling from an external repository. Test Plan: Add an external Mercurial repository to Diffusion, that requires HTTP authentication. A private BitBucket repository for example. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley Projects: #mercurial, #diffusion Differential Revision: https://secure.phabricator.com/D14092 --- .../repository/engine/PhabricatorRepositoryPullEngine.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php index d725148771..41f6dbfa0f 100644 --- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php +++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php @@ -430,7 +430,8 @@ final class PhabricatorRepositoryPullEngine $path = $repository->getLocalPath(); // This is a local command, but needs credentials. - $future = $repository->getRemoteCommandFuture('pull -u'); + $remote = $repository->getRemoteURIEnvelope(); + $future = $repository->getRemoteCommandFuture('pull -u -- %P', $remote); $future->setCWD($path); try { From 093a6256984cb14cc89f2cea64adf15197b3887a Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 10 Sep 2015 11:36:38 -0700 Subject: [PATCH 09/16] Show users what's wrong when they try to edit an inline with an editor already open Summary: Fixes T8572. Ideally we would probably just permit this, but clean up the behavior until the day arrives when inline code is actually rewritten. Test Plan: - Tried to launch editors in Differential and Diffusion while comments were already open. - Verified that "Jump to inline" works in both cases. {F788008} {F788009} Reviewers: chad Reviewed By: chad Maniphest Tasks: T8572 Differential Revision: https://secure.phabricator.com/D14094 --- resources/celerity/map.php | 42 +++++++++---------- .../PhabricatorInlineCommentController.php | 13 ++++++ .../DifferentialInlineCommentEditor.js | 24 +++++++++-- .../behavior-edit-inline-comments.js | 16 +++++-- 4 files changed, 68 insertions(+), 27 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 9e02f6bb8b..e3e81484cc 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -11,7 +11,7 @@ return array( 'core.pkg.js' => '47dc9ebb', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', - 'differential.pkg.js' => '52d725be', + 'differential.pkg.js' => '6223dd9d', 'diffusion.pkg.css' => '385e85b3', 'diffusion.pkg.js' => '0115b37c', 'maniphest.pkg.css' => '4845691a', @@ -357,13 +357,13 @@ return array( 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 'rsrc/js/application/differential/ChangesetViewManager.js' => '58562350', - 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'd4c87bf4', + 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => '64a5550f', 'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => 'e10f8e18', 'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d', 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76', 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 'rsrc/js/application/differential/behavior-dropdown-menus.js' => '2035b9cb', - 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '037b59eb', + 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '65ef6074', 'rsrc/js/application/differential/behavior-keyboard-nav.js' => '2c426492', 'rsrc/js/application/differential/behavior-populate.js' => '8694b1df', 'rsrc/js/application/differential/behavior-toggle-files.js' => 'ca3f91eb', @@ -517,7 +517,7 @@ return array( 'conpherence-widget-pane-css' => '775eaaba', 'differential-changeset-view-css' => 'b6b0d1bb', 'differential-core-view-css' => '7ac3cabc', - 'differential-inline-comment-editor' => 'd4c87bf4', + 'differential-inline-comment-editor' => '64a5550f', 'differential-revision-add-comment-css' => 'c47f8c40', 'differential-revision-comment-css' => '14b8565a', 'differential-revision-history-css' => '0e8eb855', @@ -568,7 +568,7 @@ return array( 'javelin-behavior-differential-comment-jump' => '4fdb476d', 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 'javelin-behavior-differential-dropdown-menus' => '2035b9cb', - 'javelin-behavior-differential-edit-inline-comments' => '037b59eb', + 'javelin-behavior-differential-edit-inline-comments' => '65ef6074', 'javelin-behavior-differential-feedback-preview' => 'b064af76', 'javelin-behavior-differential-keyboard-navigation' => '2c426492', 'javelin-behavior-differential-populate' => '8694b1df', @@ -853,14 +853,6 @@ return array( 'javelin-behavior-device', 'phabricator-title', ), - '037b59eb' => array( - 'javelin-behavior', - 'javelin-stratcom', - 'javelin-dom', - 'javelin-util', - 'javelin-vector', - 'differential-inline-comment-editor', - ), '048330fa' => array( 'javelin-behavior', 'javelin-typeahead-ondemand-source', @@ -1289,6 +1281,22 @@ return array( 'javelin-workflow', 'javelin-dom', ), + '64a5550f' => array( + 'javelin-dom', + 'javelin-util', + 'javelin-stratcom', + 'javelin-install', + 'javelin-request', + 'javelin-workflow', + ), + '65ef6074' => array( + 'javelin-behavior', + 'javelin-stratcom', + 'javelin-dom', + 'javelin-util', + 'javelin-vector', + 'differential-inline-comment-editor', + ), '665cf6ac' => array( 'javelin-behavior', 'javelin-util', @@ -1817,14 +1825,6 @@ return array( 'javelin-dom', 'javelin-view', ), - 'd4c87bf4' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - 'javelin-request', - 'javelin-workflow', - ), 'd4eecc63' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/infrastructure/diff/PhabricatorInlineCommentController.php b/src/infrastructure/diff/PhabricatorInlineCommentController.php index fd847b5aca..aa37d29c72 100644 --- a/src/infrastructure/diff/PhabricatorInlineCommentController.php +++ b/src/infrastructure/diff/PhabricatorInlineCommentController.php @@ -94,6 +94,19 @@ abstract class PhabricatorInlineCommentController $op = $this->getOperation(); switch ($op) { + case 'busy': + if ($request->isFormPost()) { + return new AphrontAjaxResponse(); + } + + return $this->newDialog() + ->setTitle(pht('Already Editing')) + ->appendParagraph( + pht( + 'You are already editing an inline comment. Finish editing '. + 'your current comment before adding new comments.')) + ->addCancelButton('/') + ->addSubmitButton(pht('Jump to Inline')); case 'hide': case 'show': if (!$request->validateCSRF()) { diff --git a/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js b/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js index 9842da11f5..8defff554d 100644 --- a/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js +++ b/webroot/rsrc/js/application/differential/DifferentialInlineCommentEditor.js @@ -250,12 +250,30 @@ JX.install('DifferentialInlineCommentEditor', { JX.DifferentialInlineCommentEditor._undoRows = rows; }, - start : function() { - this._registerUndoListener(); + _onBusyWorkflow: function() { + // If the user clicks the "Jump to Inline" button, scroll to the row + // being edited. + JX.DOM.scrollTo(this.getRow()); + }, - var data = this._buildRequestData(); + start : function() { var op = this.getOperation(); + // The user is already editing a comment, we're going to give them an + // error message. + if (op == 'busy') { + var onbusy = JX.bind(this, this._onBusyWorkflow); + + new JX.Workflow(this._uri, {op: op}) + .setHandler(onbusy) + .start(); + + return this; + } + + this._registerUndoListener(); + var data = this._buildRequestData(); + if (op == 'delete' || op == 'refdelete' || op == 'undelete') { this._setRowState('loading'); diff --git a/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js b/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js index 821d279f50..aac66d66b7 100644 --- a/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js +++ b/webroot/rsrc/js/application/differential/behavior-edit-inline-comments.js @@ -138,13 +138,23 @@ JX.behavior('differential-edit-inline-comments', function(config) { 'mousedown', ['differential-changeset', 'tag:th'], function(e) { - if (editor || - selecting || - e.isRightButton() || + if (e.isRightButton() || getRowNumber(e.getTarget()) === undefined) { return; } + if (editor) { + new JX.DifferentialInlineCommentEditor(config.uri) + .setOperation('busy') + .setRow(editor.getRow().previousSibling) + .start(); + return; + } + + if (selecting) { + return; + } + selecting = true; root = e.getNode('differential-changeset'); From f8080ce93142cdb8f954b4a524fa8f65905da14d Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 10 Sep 2015 13:32:31 -0700 Subject: [PATCH 10/16] Add CustomField support to Owners Summary: Fixes T9351. This is straightforward since this application is now relatively modern and doesn't have any bizarre craziness. Test Plan: {F787981} {F787982} Reviewers: chad Reviewed By: chad Maniphest Tasks: T9351 Differential Revision: https://secure.phabricator.com/D14093 --- .../autopatches/20150910.owners.custom.1.sql | 25 +++++++ src/__phutil_library_map__.php | 14 ++++ .../config/PhabricatorOwnersConfigOptions.php | 26 +++++++ .../PhabricatorOwnersDetailController.php | 21 +++++- .../PhabricatorOwnersEditController.php | 70 +++++++++++-------- ...PhabricatorOwnersConfiguredCustomField.php | 23 ++++++ .../PhabricatorOwnersCustomField.php | 18 +++++ ...abricatorOwnersCustomFieldNumericIndex.php | 10 +++ .../PhabricatorOwnersCustomFieldStorage.php | 10 +++ ...habricatorOwnersCustomFieldStringIndex.php | 10 +++ .../storage/PhabricatorOwnersPackage.php | 25 ++++++- .../user/configuration/custom_fields.diviner | 21 +++--- 12 files changed, 233 insertions(+), 40 deletions(-) create mode 100644 resources/sql/autopatches/20150910.owners.custom.1.sql create mode 100644 src/applications/owners/customfield/PhabricatorOwnersConfiguredCustomField.php create mode 100644 src/applications/owners/customfield/PhabricatorOwnersCustomField.php create mode 100644 src/applications/owners/storage/PhabricatorOwnersCustomFieldNumericIndex.php create mode 100644 src/applications/owners/storage/PhabricatorOwnersCustomFieldStorage.php create mode 100644 src/applications/owners/storage/PhabricatorOwnersCustomFieldStringIndex.php diff --git a/resources/sql/autopatches/20150910.owners.custom.1.sql b/resources/sql/autopatches/20150910.owners.custom.1.sql new file mode 100644 index 0000000000..112802a0b8 --- /dev/null +++ b/resources/sql/autopatches/20150910.owners.custom.1.sql @@ -0,0 +1,25 @@ +CREATE TABLE {$NAMESPACE}_owners.owners_customfieldstorage ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + objectPHID VARBINARY(64) NOT NULL, + fieldIndex BINARY(12) NOT NULL, + fieldValue LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT}, + UNIQUE KEY (objectPHID, fieldIndex) +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; + +CREATE TABLE {$NAMESPACE}_owners.owners_customfieldstringindex ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + objectPHID VARBINARY(64) NOT NULL, + indexKey BINARY(12) NOT NULL, + indexValue LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}, + KEY `key_join` (objectPHID, indexKey, indexValue(64)), + KEY `key_find` (indexKey, indexValue(64)) +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; + +CREATE TABLE {$NAMESPACE}_owners.owners_customfieldnumericindex ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + objectPHID VARBINARY(64) NOT NULL, + indexKey BINARY(12) NOT NULL, + indexValue BIGINT NOT NULL, + KEY `key_join` (objectPHID, indexKey, indexValue), + KEY `key_find` (indexKey, indexValue) +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index f01d82e40f..a25782a7c5 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2437,7 +2437,12 @@ phutil_register_library_map(array( 'PhabricatorOwnerPathQuery' => 'applications/owners/query/PhabricatorOwnerPathQuery.php', 'PhabricatorOwnersApplication' => 'applications/owners/application/PhabricatorOwnersApplication.php', 'PhabricatorOwnersConfigOptions' => 'applications/owners/config/PhabricatorOwnersConfigOptions.php', + 'PhabricatorOwnersConfiguredCustomField' => 'applications/owners/customfield/PhabricatorOwnersConfiguredCustomField.php', 'PhabricatorOwnersController' => 'applications/owners/controller/PhabricatorOwnersController.php', + 'PhabricatorOwnersCustomField' => 'applications/owners/customfield/PhabricatorOwnersCustomField.php', + 'PhabricatorOwnersCustomFieldNumericIndex' => 'applications/owners/storage/PhabricatorOwnersCustomFieldNumericIndex.php', + 'PhabricatorOwnersCustomFieldStorage' => 'applications/owners/storage/PhabricatorOwnersCustomFieldStorage.php', + 'PhabricatorOwnersCustomFieldStringIndex' => 'applications/owners/storage/PhabricatorOwnersCustomFieldStringIndex.php', 'PhabricatorOwnersDAO' => 'applications/owners/storage/PhabricatorOwnersDAO.php', 'PhabricatorOwnersDetailController' => 'applications/owners/controller/PhabricatorOwnersDetailController.php', 'PhabricatorOwnersEditController' => 'applications/owners/controller/PhabricatorOwnersEditController.php', @@ -6425,7 +6430,15 @@ phutil_register_library_map(array( 'PhabricatorOwnerPathQuery' => 'Phobject', 'PhabricatorOwnersApplication' => 'PhabricatorApplication', 'PhabricatorOwnersConfigOptions' => 'PhabricatorApplicationConfigOptions', + 'PhabricatorOwnersConfiguredCustomField' => array( + 'PhabricatorOwnersCustomField', + 'PhabricatorStandardCustomFieldInterface', + ), 'PhabricatorOwnersController' => 'PhabricatorController', + 'PhabricatorOwnersCustomField' => 'PhabricatorCustomField', + 'PhabricatorOwnersCustomFieldNumericIndex' => 'PhabricatorCustomFieldNumericIndexStorage', + 'PhabricatorOwnersCustomFieldStorage' => 'PhabricatorCustomFieldStorage', + 'PhabricatorOwnersCustomFieldStringIndex' => 'PhabricatorCustomFieldStringIndexStorage', 'PhabricatorOwnersDAO' => 'PhabricatorLiskDAO', 'PhabricatorOwnersDetailController' => 'PhabricatorOwnersController', 'PhabricatorOwnersEditController' => 'PhabricatorOwnersController', @@ -6435,6 +6448,7 @@ phutil_register_library_map(array( 'PhabricatorOwnersDAO', 'PhabricatorPolicyInterface', 'PhabricatorApplicationTransactionInterface', + 'PhabricatorCustomFieldInterface', ), 'PhabricatorOwnersPackageDatasource' => 'PhabricatorTypeaheadDatasource', 'PhabricatorOwnersPackageFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource', diff --git a/src/applications/owners/config/PhabricatorOwnersConfigOptions.php b/src/applications/owners/config/PhabricatorOwnersConfigOptions.php index 7d7b3e958d..5c5766a43a 100644 --- a/src/applications/owners/config/PhabricatorOwnersConfigOptions.php +++ b/src/applications/owners/config/PhabricatorOwnersConfigOptions.php @@ -20,9 +20,35 @@ final class PhabricatorOwnersConfigOptions } public function getOptions() { + $custom_field_type = 'custom:PhabricatorCustomFieldConfigOptionType'; + $default_fields = array(); + + $field_base_class = id(new PhabricatorOwnersPackage()) + ->getCustomFieldBaseClass(); + + $fields_example = array( + 'mycompany:lore' => array( + 'name' => pht('Package Lore'), + 'type' => 'remarkup', + 'caption' => pht('Tales of adventure for this package.'), + ), + ); + $fields_example = id(new PhutilJSON())->encodeFormatted($fields_example); + return array( $this->newOption('metamta.package.subject-prefix', 'string', '[Package]') ->setDescription(pht('Subject prefix for Owners email.')), + $this->newOption('owners.fields', $custom_field_type, $default_fields) + ->setCustomData($field_base_class) + ->setDescription(pht('Select and reorder package fields.')), + $this->newOption('owners.custom-field-definitions', 'wild', array()) + ->setSummary(pht('Custom Owners fields.')) + ->setDescription( + pht( + 'Map of custom fields for Owners packages. For details on '. + 'adding custom fields to Owners, see "Configuring Custom '. + 'Fields" in the documentation.')) + ->addExample($fields_example, pht('Valid Setting')), ); } diff --git a/src/applications/owners/controller/PhabricatorOwnersDetailController.php b/src/applications/owners/controller/PhabricatorOwnersDetailController.php index 19f305dc09..7edcf010b6 100644 --- a/src/applications/owners/controller/PhabricatorOwnersDetailController.php +++ b/src/applications/owners/controller/PhabricatorOwnersDetailController.php @@ -37,8 +37,15 @@ final class PhabricatorOwnersDetailController $repositories = array(); } + $field_list = PhabricatorCustomField::getObjectFields( + $package, + PhabricatorCustomField::ROLE_VIEW); + $field_list + ->setViewer($viewer) + ->readFieldsFromStorage($package); + $actions = $this->buildPackageActionView($package); - $properties = $this->buildPackagePropertyView($package); + $properties = $this->buildPackagePropertyView($package, $field_list); $properties->setActionList($actions); if ($package->isArchived()) { @@ -156,7 +163,10 @@ final class PhabricatorOwnersDetailController } - private function buildPackagePropertyView(PhabricatorOwnersPackage $package) { + private function buildPackagePropertyView( + PhabricatorOwnersPackage $package, + PhabricatorCustomFieldList $field_list) { + $viewer = $this->getViewer(); $view = id(new PHUIPropertyListView()) @@ -187,6 +197,13 @@ final class PhabricatorOwnersDetailController $viewer)); } + $view->invokeWillRenderEvent(); + + $field_list->appendFieldsToPropertyList( + $package, + $viewer, + $view); + return $view; } diff --git a/src/applications/owners/controller/PhabricatorOwnersEditController.php b/src/applications/owners/controller/PhabricatorOwnersEditController.php index af5ae29be8..277e922129 100644 --- a/src/applications/owners/controller/PhabricatorOwnersEditController.php +++ b/src/applications/owners/controller/PhabricatorOwnersEditController.php @@ -36,6 +36,11 @@ final class PhabricatorOwnersEditController $v_description = $package->getDescription(); $v_status = $package->getStatus(); + $field_list = PhabricatorCustomField::getObjectFields( + $package, + PhabricatorCustomField::ROLE_EDIT); + $field_list->setViewer($viewer); + $field_list->readFieldsFromStorage($package); $errors = array(); if ($request->isFormPost()) { @@ -75,6 +80,12 @@ final class PhabricatorOwnersEditController ->setNewValue($v_status); } + $field_xactions = $field_list->buildFieldTransactionsFromRequest( + new PhabricatorOwnersPackageTransaction(), + $request); + + $xactions = array_merge($xactions, $field_xactions); + $editor = id(new PhabricatorOwnersPackageTransactionEditor()) ->setActor($viewer) ->setContentSourceFromRequest($request) @@ -126,41 +137,44 @@ final class PhabricatorOwnersEditController ->setName('owners') ->setValue($v_owners)); - if (!$is_new) { - $form->appendChild( - id(new AphrontFormSelectControl()) - ->setLabel(pht('Status')) - ->setName('status') - ->setValue($v_status) - ->setOptions($package->getStatusNameMap())); - } - + if (!$is_new) { $form->appendChild( id(new AphrontFormSelectControl()) - ->setName('auditing') - ->setLabel(pht('Auditing')) - ->setCaption( - pht( - 'With auditing enabled, all future commits that touch '. - 'this package will be reviewed to make sure an owner '. - 'of the package is involved and the commit message has '. - 'a valid revision, reviewed by, and author.')) - ->setOptions( - array( - 'disabled' => pht('Disabled'), - 'enabled' => pht('Enabled'), - )) - ->setValue(($v_auditing ? 'enabled' : 'disabled'))) + ->setLabel(pht('Status')) + ->setName('status') + ->setValue($v_status) + ->setOptions($package->getStatusNameMap())); + } + + $form->appendChild( + id(new AphrontFormSelectControl()) + ->setName('auditing') + ->setLabel(pht('Auditing')) + ->setCaption( + pht( + 'With auditing enabled, all future commits that touch '. + 'this package will be reviewed to make sure an owner '. + 'of the package is involved and the commit message has '. + 'a valid revision, reviewed by, and author.')) + ->setOptions( + array( + 'disabled' => pht('Disabled'), + 'enabled' => pht('Enabled'), + )) + ->setValue(($v_auditing ? 'enabled' : 'disabled'))) ->appendChild( id(new PhabricatorRemarkupControl()) ->setUser($viewer) ->setLabel(pht('Description')) ->setName('description') - ->setValue($v_description)) - ->appendChild( - id(new AphrontFormSubmitControl()) - ->addCancelButton($cancel_uri) - ->setValue($button_text)); + ->setValue($v_description)); + + $field_list->appendFieldsToForm($form); + + $form->appendChild( + id(new AphrontFormSubmitControl()) + ->addCancelButton($cancel_uri) + ->setValue($button_text)); $form_box = id(new PHUIObjectBoxView()) ->setHeaderText($title) diff --git a/src/applications/owners/customfield/PhabricatorOwnersConfiguredCustomField.php b/src/applications/owners/customfield/PhabricatorOwnersConfiguredCustomField.php new file mode 100644 index 0000000000..a35296311f --- /dev/null +++ b/src/applications/owners/customfield/PhabricatorOwnersConfiguredCustomField.php @@ -0,0 +1,23 @@ +assertAttached($this->customFields); + } + + public function attachCustomFields(PhabricatorCustomFieldAttachment $fields) { + $this->customFields = $fields; + return $this; + } + } diff --git a/src/docs/user/configuration/custom_fields.diviner b/src/docs/user/configuration/custom_fields.diviner index 41adfbd092..6643a0518f 100644 --- a/src/docs/user/configuration/custom_fields.diviner +++ b/src/docs/user/configuration/custom_fields.diviner @@ -16,11 +16,12 @@ These applications currently support custom fields: | Application | Support | |-------------|---------| -| Maniphest | Full Support | -| Projects | Full Support | -| People | Full Support | | Differential | Partial Support | | Diffusion | Limited Support | +| Maniphest | Full Support | +| Owners | Full Support | +| People | Full Support | +| Projects | Full Support | Custom fields can appear in many interfaces and support search, editing, and other features. @@ -38,11 +39,12 @@ The relevant configuration settings are: | Application | Add Fields | Select Fields | |-------------|------------|---------------| -| Maniphest | `maniphest.custom-field-definitions` | `maniphest.fields` | -| Projects | `projects.custom-field-definitions` | `projects.fields` | -| People | `user.custom-field-definitions` | `user.fields` | | Differential | Planned | `differential.fields` | | Diffusion | Planned | Planned | +| Maniphest | `maniphest.custom-field-definitions` | `maniphest.fields` | +| Owners | `owners.custom-field-definitions` | `owners.fields` | +| People | `user.custom-field-definitions` | `user.fields` | +| Projects | `projects.custom-field-definitions` | `projects.fields` | When adding fields, you'll specify a JSON blob like this (for example, as the value of `maniphest.custom-field-definitions`): @@ -157,11 +159,12 @@ want to add a field to: | Application | Extend | |-------------|---------| -| Maniphest | @{class:ManiphestCustomField} | -| Projects | @{class:PhabricatorProjectCustomField} | -| People | @{class:PhabricatorUserCustomField} | | Differential | @{class:DifferentialCustomField} | | Diffusion | @{class:PhabricatorCommitCustomField} | +| Maniphest | @{class:ManiphestCustomField} | +| Owners | @{class:PhabricatorOwnersCustomField} | +| People | @{class:PhabricatorUserCustomField} | +| Projects | @{class:PhabricatorProjectCustomField} | The easiest way to get started is to drop your subclass into `phabricator/src/extensions/`, which should make it immediately available in the From ae0348aac931aa87e48063575bac9162245390d2 Mon Sep 17 00:00:00 2001 From: Mihir Kedia Date: Thu, 10 Sep 2015 14:18:52 -0700 Subject: [PATCH 11/16] Add dialog to purge opcode/data caches Summary: Reachable via the cache config page, restricted to admins only. This makes it convenient to hotfix phabricator without requiring a restart. Test Plan: - Local dev machine doesn't have apc, so I get the not installed message. - Faked the name and isEnabled parameters, verified dialog shows up as expected. - Didn't test clear code Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: tycho.tatitscheff, joshuaspence, Korvin Differential Revision: https://secure.phabricator.com/D14064 --- src/__phutil_library_map__.php | 2 + ...habricatorCacheManagementPurgeWorkflow.php | 3 +- .../cache/spec/PhabricatorCacheSpec.php | 9 +++ .../cache/spec/PhabricatorDataCacheSpec.php | 9 ++- .../cache/spec/PhabricatorOpcodeCacheSpec.php | 9 ++- .../PhabricatorConfigApplication.php | 5 +- .../PhabricatorConfigCacheController.php | 16 ++++- .../PhabricatorConfigPurgeCacheController.php | 62 +++++++++++++++++++ 8 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 src/applications/config/controller/PhabricatorConfigPurgeCacheController.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index a25782a7c5..c9db433f4b 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1842,6 +1842,7 @@ phutil_register_library_map(array( 'PhabricatorConfigOptionType' => 'applications/config/custom/PhabricatorConfigOptionType.php', 'PhabricatorConfigPHIDModule' => 'applications/config/module/PhabricatorConfigPHIDModule.php', 'PhabricatorConfigProxySource' => 'infrastructure/env/PhabricatorConfigProxySource.php', + 'PhabricatorConfigPurgeCacheController' => 'applications/config/controller/PhabricatorConfigPurgeCacheController.php', 'PhabricatorConfigRequestExceptionHandlerModule' => 'applications/config/module/PhabricatorConfigRequestExceptionHandlerModule.php', 'PhabricatorConfigResponse' => 'applications/config/response/PhabricatorConfigResponse.php', 'PhabricatorConfigSchemaQuery' => 'applications/config/schema/PhabricatorConfigSchemaQuery.php', @@ -5748,6 +5749,7 @@ phutil_register_library_map(array( 'PhabricatorConfigOptionType' => 'Phobject', 'PhabricatorConfigPHIDModule' => 'PhabricatorConfigModule', 'PhabricatorConfigProxySource' => 'PhabricatorConfigSource', + 'PhabricatorConfigPurgeCacheController' => 'PhabricatorConfigController', 'PhabricatorConfigRequestExceptionHandlerModule' => 'PhabricatorConfigModule', 'PhabricatorConfigResponse' => 'AphrontStandaloneHTMLResponse', 'PhabricatorConfigSchemaQuery' => 'Phobject', diff --git a/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php b/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php index 2523a1e333..160fe4f5db 100644 --- a/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php +++ b/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php @@ -6,7 +6,8 @@ final class PhabricatorCacheManagementPurgeWorkflow protected function didConstruct() { $this ->setName('purge') - ->setSynopsis(pht('Drop data from caches.')) + ->setSynopsis(pht('Drop data from caches. APC-based caches can be '. + 'purged from the web interface.')) ->setArguments( array( array( diff --git a/src/applications/cache/spec/PhabricatorCacheSpec.php b/src/applications/cache/spec/PhabricatorCacheSpec.php index 1688cb07fd..1ed4e713f1 100644 --- a/src/applications/cache/spec/PhabricatorCacheSpec.php +++ b/src/applications/cache/spec/PhabricatorCacheSpec.php @@ -5,6 +5,7 @@ abstract class PhabricatorCacheSpec extends Phobject { private $name; private $isEnabled = false; private $version; + private $clearCacheCallback = null; private $issues = array(); private $usedMemory = 0; @@ -108,4 +109,12 @@ abstract class PhabricatorCacheSpec extends Phobject { ->addPHPConfig('apc.enabled'); } + public function setClearCacheCallback($callback) { + $this->clearCacheCallback = $callback; + return $this; + } + + public function getClearCacheCallback() { + return $this->clearCacheCallback; + } } diff --git a/src/applications/cache/spec/PhabricatorDataCacheSpec.php b/src/applications/cache/spec/PhabricatorDataCacheSpec.php index b1364ff569..f5fe1c6277 100644 --- a/src/applications/cache/spec/PhabricatorDataCacheSpec.php +++ b/src/applications/cache/spec/PhabricatorDataCacheSpec.php @@ -34,7 +34,9 @@ final class PhabricatorDataCacheSpec extends PhabricatorCacheSpec { ->setVersion(phpversion('apc')); if (ini_get('apc.enabled')) { - $this->setIsEnabled(true); + $this + ->setIsEnabled(true) + ->setClearCacheCallback('apc_clear_cache'); $this->initAPCCommonSpec(); } else { $this->setIsEnabled(false); @@ -48,7 +50,9 @@ final class PhabricatorDataCacheSpec extends PhabricatorCacheSpec { ->setVersion(phpversion('apcu')); if (ini_get('apc.enabled')) { - $this->setIsEnabled(true); + $this + ->setIsEnabled(true) + ->setClearCacheCallback('apc_clear_cache'); $this->initAPCCommonSpec(); } else { $this->setIsEnabled(false); @@ -118,5 +122,4 @@ final class PhabricatorDataCacheSpec extends PhabricatorCacheSpec { return $key; } - } diff --git a/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php b/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php index c129fb0fa0..f9739a0328 100644 --- a/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php +++ b/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php @@ -23,7 +23,9 @@ final class PhabricatorOpcodeCacheSpec extends PhabricatorCacheSpec { ->setVersion(phpversion('apc')); if (ini_get('apc.enabled')) { - $this->setIsEnabled(true); + $this + ->setIsEnabled(true) + ->setClearCacheCallback('apc_clear_cache'); $mem = apc_sma_info(); $this->setTotalMemory($mem['num_seg'] * $mem['seg_size']); @@ -109,7 +111,9 @@ final class PhabricatorOpcodeCacheSpec extends PhabricatorCacheSpec { ->setVersion(phpversion('Zend OPcache')); if (ini_get('opcache.enable')) { - $this->setIsEnabled(true); + $this + ->setIsEnabled(true) + ->setClearCacheCallback('opcache_reset'); $status = opcache_get_status(); $memory = $status['memory_usage']; @@ -199,5 +203,4 @@ final class PhabricatorOpcodeCacheSpec extends PhabricatorCacheSpec { $this->raiseInstallAPCIssue(); } } - } diff --git a/src/applications/config/application/PhabricatorConfigApplication.php b/src/applications/config/application/PhabricatorConfigApplication.php index 8375881c24..36bac1d25b 100644 --- a/src/applications/config/application/PhabricatorConfigApplication.php +++ b/src/applications/config/application/PhabricatorConfigApplication.php @@ -55,7 +55,10 @@ final class PhabricatorConfigApplication extends PhabricatorApplication { '' => 'PhabricatorConfigIssueListController', '(?P[^/]+)/' => 'PhabricatorConfigIssueViewController', ), - 'cache/' => 'PhabricatorConfigCacheController', + 'cache/' => array( + '' => 'PhabricatorConfigCacheController', + 'purge/' => 'PhabricatorConfigPurgeCacheController', + ), 'module/' => array( '(?P[^/]+)/' => 'PhabricatorConfigModuleController', ), diff --git a/src/applications/config/controller/PhabricatorConfigCacheController.php b/src/applications/config/controller/PhabricatorConfigCacheController.php index a27be465e2..90c1b3a2fd 100644 --- a/src/applications/config/controller/PhabricatorConfigCacheController.php +++ b/src/applications/config/controller/PhabricatorConfigCacheController.php @@ -39,8 +39,22 @@ final class PhabricatorConfigCacheController $this->renderCommonProperties($properties, $cache); + $purge_icon = id(new PHUIIconView()) + ->setIconFont('fa-exclamation-triangle'); + + $purge_button = id(new PHUIButtonView()) + ->setText(pht('Purge Caches')) + ->setHref('/config/cache/purge/') + ->setTag('a') + ->setWorkflow(true) + ->setIcon($purge_icon); + + $header = id(new PHUIHeaderView()) + ->setHeader(pht('Opcode Cache')) + ->addActionLink($purge_button); + return id(new PHUIObjectBoxView()) - ->setHeaderText(pht('Opcode Cache')) + ->setHeader($header) ->addPropertyList($properties); } diff --git a/src/applications/config/controller/PhabricatorConfigPurgeCacheController.php b/src/applications/config/controller/PhabricatorConfigPurgeCacheController.php new file mode 100644 index 0000000000..9f40453fde --- /dev/null +++ b/src/applications/config/controller/PhabricatorConfigPurgeCacheController.php @@ -0,0 +1,62 @@ +getViewer(); + $cancel_uri = $this->getApplicationURI('cache/'); + + $opcode_cache = PhabricatorOpcodeCacheSpec::getActiveCacheSpec(); + $data_cache = PhabricatorDataCacheSpec::getActiveCacheSpec(); + + $opcode_clearable = $opcode_cache->getClearCacheCallback(); + $data_clearable = $data_cache->getClearCacheCallback(); + + if (!$opcode_clearable && !$data_clearable) { + return $this->newDialog() + ->setTitle(pht('No Caches to Reset')) + ->appendParagraph( + pht('None of the caches on this page can be cleared.')) + ->addCancelButton($cancel_uri); + } + + if ($request->isDialogFormPost()) { + if ($opcode_clearable) { + call_user_func($opcode_cache->getClearCacheCallback()); + } + + if ($data_clearable) { + call_user_func($data_cache->getClearCacheCallback()); + } + + return id(new AphrontRedirectResponse())->setURI($cancel_uri); + } + + $caches = id(new PHUIPropertyListView()) + ->setUser($viewer); + + if ($opcode_clearable) { + $caches->addProperty( + pht('Opcode'), + $opcode_cache->getName()); + } + + if ($data_clearable) { + $caches->addProperty( + pht('Data'), + $data_cache->getName()); + } + + return $this->newDialog() + ->setTitle(pht('Really Clear Cache?')) + ->setShortTitle(pht('Really Clear Cache')) + ->appendParagraph(pht('This will only affect the current web '. + 'frontend. Daemons and any other web frontends may continue '. + 'to use older, cached code from their opcache.')) + ->appendParagraph(pht('The following caches will be cleared:')) + ->appendChild($caches) + ->addSubmitButton(pht('Clear Cache')) + ->addCancelButton($cancel_uri); + } +} From 15837388428d6dd3c37cf4b1d302e78657fce24e Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 10 Sep 2015 19:06:36 -0700 Subject: [PATCH 12/16] Allow search results to be snippeted, roughly Summary: Ref T8646. This is fairly rough: This interface is very niche, and not really flexible enough to accommodate other result customization (but I don't think we have any plans here)? I'm just //summarizing// the content of documents, basically showing the first paragraph of their content, summary, etc. This isn't what Google does: it shows snippets surrounding the actual search terms. However, this is more involved and might be less useful in structured data: for example, I'd imagine that the first line of most phriciton documents, maniphest tasks and Differential revisions really might be the best machine-generatable summary of them. The actual contextual snippeting in Google doesn't often seem hugely useful to me. But this might also not be very useful. There's not much design, not sure if you had any ideas. I only implemented this for tasks, revisions and the wiki since those seem most useful. I'm generally on the fence about this, but it's not a ton of work to swap out for something else later. Maybe we can see how it feels? But happy to toss it or rethink the approach. Test Plan: {F788026} Reviewers: chad Reviewed By: chad Maniphest Tasks: T8646 Differential Revision: https://secure.phabricator.com/D14095 --- resources/celerity/map.php | 46 +++++++++---------- src/__phutil_library_map__.php | 4 ++ .../storage/DifferentialRevision.php | 17 ++++++- .../maniphest/storage/ManiphestTask.php | 17 ++++++- .../phriction/storage/PhrictionDocument.php | 18 +++++++- .../PhabricatorSearchSnippetInterface.php | 11 +++++ ...abricatorSearchApplicationSearchEngine.php | 1 + .../view/PhabricatorSearchResultView.php | 18 ++++++++ .../css/application/search/search-results.css | 5 ++ 9 files changed, 111 insertions(+), 26 deletions(-) create mode 100644 src/applications/search/interface/PhabricatorSearchSnippetInterface.php diff --git a/resources/celerity/map.php b/resources/celerity/map.php index e3e81484cc..2181877bfc 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -11,7 +11,7 @@ return array( 'core.pkg.js' => '47dc9ebb', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', - 'differential.pkg.js' => '6223dd9d', + 'differential.pkg.js' => '52d725be', 'diffusion.pkg.css' => '385e85b3', 'diffusion.pkg.js' => '0115b37c', 'maniphest.pkg.css' => '4845691a', @@ -99,7 +99,7 @@ return array( 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', 'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd', 'rsrc/css/application/releeph/releeph-request-typeahead.css' => '667a48ae', - 'rsrc/css/application/search/search-results.css' => '7dea472c', + 'rsrc/css/application/search/search-results.css' => '586db3a4', 'rsrc/css/application/slowvote/slowvote.css' => '475b4bd2', 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/uiexample/example.css' => '528b19de', @@ -357,13 +357,13 @@ return array( 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 'rsrc/js/application/differential/ChangesetViewManager.js' => '58562350', - 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => '64a5550f', + 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'd4c87bf4', 'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => 'e10f8e18', 'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d', 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76', 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 'rsrc/js/application/differential/behavior-dropdown-menus.js' => '2035b9cb', - 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '65ef6074', + 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '037b59eb', 'rsrc/js/application/differential/behavior-keyboard-nav.js' => '2c426492', 'rsrc/js/application/differential/behavior-populate.js' => '8694b1df', 'rsrc/js/application/differential/behavior-toggle-files.js' => 'ca3f91eb', @@ -517,7 +517,7 @@ return array( 'conpherence-widget-pane-css' => '775eaaba', 'differential-changeset-view-css' => 'b6b0d1bb', 'differential-core-view-css' => '7ac3cabc', - 'differential-inline-comment-editor' => '64a5550f', + 'differential-inline-comment-editor' => 'd4c87bf4', 'differential-revision-add-comment-css' => 'c47f8c40', 'differential-revision-comment-css' => '14b8565a', 'differential-revision-history-css' => '0e8eb855', @@ -568,7 +568,7 @@ return array( 'javelin-behavior-differential-comment-jump' => '4fdb476d', 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 'javelin-behavior-differential-dropdown-menus' => '2035b9cb', - 'javelin-behavior-differential-edit-inline-comments' => '65ef6074', + 'javelin-behavior-differential-edit-inline-comments' => '037b59eb', 'javelin-behavior-differential-feedback-preview' => 'b064af76', 'javelin-behavior-differential-keyboard-navigation' => '2c426492', 'javelin-behavior-differential-populate' => '8694b1df', @@ -738,7 +738,7 @@ return array( 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => '6920d200', 'phabricator-remarkup-css' => '1c4ac273', - 'phabricator-search-results-css' => '7dea472c', + 'phabricator-search-results-css' => '586db3a4', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-side-menu-view-css' => 'bec2458e', 'phabricator-slowvote-css' => '475b4bd2', @@ -853,6 +853,14 @@ return array( 'javelin-behavior-device', 'phabricator-title', ), + '037b59eb' => array( + 'javelin-behavior', + 'javelin-stratcom', + 'javelin-dom', + 'javelin-util', + 'javelin-vector', + 'differential-inline-comment-editor', + ), '048330fa' => array( 'javelin-behavior', 'javelin-typeahead-ondemand-source', @@ -1281,22 +1289,6 @@ return array( 'javelin-workflow', 'javelin-dom', ), - '64a5550f' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - 'javelin-request', - 'javelin-workflow', - ), - '65ef6074' => array( - 'javelin-behavior', - 'javelin-stratcom', - 'javelin-dom', - 'javelin-util', - 'javelin-vector', - 'differential-inline-comment-editor', - ), '665cf6ac' => array( 'javelin-behavior', 'javelin-util', @@ -1825,6 +1817,14 @@ return array( 'javelin-dom', 'javelin-view', ), + 'd4c87bf4' => array( + 'javelin-dom', + 'javelin-util', + 'javelin-stratcom', + 'javelin-install', + 'javelin-request', + 'javelin-workflow', + ), 'd4eecc63' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index c9db433f4b..14f128558d 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2840,6 +2840,7 @@ phutil_register_library_map(array( 'PhabricatorSearchResultView' => 'applications/search/view/PhabricatorSearchResultView.php', 'PhabricatorSearchSelectController' => 'applications/search/controller/PhabricatorSearchSelectController.php', 'PhabricatorSearchSelectField' => 'applications/search/field/PhabricatorSearchSelectField.php', + 'PhabricatorSearchSnippetInterface' => 'applications/search/interface/PhabricatorSearchSnippetInterface.php', 'PhabricatorSearchStringListField' => 'applications/search/field/PhabricatorSearchStringListField.php', 'PhabricatorSearchSubscribersField' => 'applications/search/field/PhabricatorSearchSubscribersField.php', 'PhabricatorSearchTextField' => 'applications/search/field/PhabricatorSearchTextField.php', @@ -4132,6 +4133,7 @@ phutil_register_library_map(array( 'PhabricatorMentionableInterface', 'PhabricatorDestructibleInterface', 'PhabricatorProjectInterface', + 'PhabricatorSearchSnippetInterface', ), 'DifferentialRevisionAffectedFilesHeraldField' => 'DifferentialRevisionHeraldField', 'DifferentialRevisionAuthorHeraldField' => 'DifferentialRevisionHeraldField', @@ -5025,6 +5027,7 @@ phutil_register_library_map(array( 'PhabricatorApplicationTransactionInterface', 'PhabricatorProjectInterface', 'PhabricatorSpacesInterface', + 'PhabricatorSearchSnippetInterface', ), 'ManiphestTaskAssignHeraldAction' => 'HeraldAction', 'ManiphestTaskAssignOtherHeraldAction' => 'ManiphestTaskAssignHeraldAction', @@ -7623,6 +7626,7 @@ phutil_register_library_map(array( 'PhabricatorTokenReceiverInterface', 'PhabricatorDestructibleInterface', 'PhabricatorApplicationTransactionInterface', + 'PhabricatorSearchSnippetInterface', ), 'PhrictionDocumentAuthorHeraldField' => 'PhrictionDocumentHeraldField', 'PhrictionDocumentContentHeraldField' => 'PhrictionDocumentHeraldField', diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index 84b77f0c48..ff007e2638 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -13,7 +13,8 @@ final class DifferentialRevision extends DifferentialDAO PhabricatorApplicationTransactionInterface, PhabricatorMentionableInterface, PhabricatorDestructibleInterface, - PhabricatorProjectInterface { + PhabricatorProjectInterface, + PhabricatorSearchSnippetInterface { protected $title = ''; protected $originalTitle; @@ -629,4 +630,18 @@ final class DifferentialRevision extends DifferentialDAO $this->saveTransaction(); } + +/* -( PhabricatorSearchSnippetInterface )---------------------------------- */ + + + public function renderSearchResultSnippet(PhabricatorUser $viewer) { + $content = $this->getSummary(); + $content = PhabricatorMarkupEngine::summarize($content); + $content = PhabricatorMarkupEngine::renderOneObject( + id(new PhabricatorMarkupOneOff())->setContent($content), + 'default', + $viewer); + return $content; + } + } diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php index 7fbc806bae..453d8c3458 100644 --- a/src/applications/maniphest/storage/ManiphestTask.php +++ b/src/applications/maniphest/storage/ManiphestTask.php @@ -13,7 +13,8 @@ final class ManiphestTask extends ManiphestDAO PhabricatorDestructibleInterface, PhabricatorApplicationTransactionInterface, PhabricatorProjectInterface, - PhabricatorSpacesInterface { + PhabricatorSpacesInterface, + PhabricatorSearchSnippetInterface { const MARKUP_FIELD_DESCRIPTION = 'markup:desc'; @@ -390,4 +391,18 @@ final class ManiphestTask extends ManiphestDAO return $this->spacePHID; } + +/* -( PhabricatorSearchSnippetInterface )---------------------------------- */ + + + public function renderSearchResultSnippet(PhabricatorUser $viewer) { + $content = $this->getDescription(); + $content = PhabricatorMarkupEngine::summarize($content); + $content = PhabricatorMarkupEngine::renderOneObject( + id(new PhabricatorMarkupOneOff())->setContent($content), + 'default', + $viewer); + return $content; + } + } diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php index f274d87ad4..661feda3c3 100644 --- a/src/applications/phriction/storage/PhrictionDocument.php +++ b/src/applications/phriction/storage/PhrictionDocument.php @@ -7,7 +7,8 @@ final class PhrictionDocument extends PhrictionDAO PhabricatorFlaggableInterface, PhabricatorTokenReceiverInterface, PhabricatorDestructibleInterface, - PhabricatorApplicationTransactionInterface { + PhabricatorApplicationTransactionInterface, + PhabricatorSearchSnippetInterface { protected $slug; protected $depth; @@ -252,4 +253,19 @@ final class PhrictionDocument extends PhrictionDAO $this->saveTransaction(); } + +/* -( PhabricatorSearchSnippetInterface )---------------------------------- */ + + + public function renderSearchResultSnippet(PhabricatorUser $viewer) { + $content = $this->getContent()->getContent(); + $content = PhabricatorMarkupEngine::summarize($content); + $content = PhabricatorMarkupEngine::renderOneObject( + id(new PhabricatorMarkupOneOff())->setContent($content), + 'default', + $viewer); + return $content; + } + + } diff --git a/src/applications/search/interface/PhabricatorSearchSnippetInterface.php b/src/applications/search/interface/PhabricatorSearchSnippetInterface.php new file mode 100644 index 0000000000..0d0543a61c --- /dev/null +++ b/src/applications/search/interface/PhabricatorSearchSnippetInterface.php @@ -0,0 +1,11 @@ + $handle) { $view = id(new PhabricatorSearchResultView()) + ->setUser($viewer) ->setHandle($handle) ->setQuery($query) ->setObject(idx($objects, $phid)) diff --git a/src/applications/search/view/PhabricatorSearchResultView.php b/src/applications/search/view/PhabricatorSearchResultView.php index 63219b3252..2c20b60620 100644 --- a/src/applications/search/view/PhabricatorSearchResultView.php +++ b/src/applications/search/view/PhabricatorSearchResultView.php @@ -21,7 +21,13 @@ final class PhabricatorSearchResultView extends AphrontView { return $this; } + public function getObject() { + return $this->object; + } + public function render() { + $viewer = $this->getUser(); + $handle = $this->handle; if (!$handle->isComplete()) { return; @@ -46,6 +52,18 @@ final class PhabricatorSearchResultView extends AphrontView { $item->addAttribute(pht('Closed')); } + $object = $this->getObject(); + if ($object instanceof PhabricatorSearchSnippetInterface) { + $snippet = $object->renderSearchResultSnippet($viewer); + $snippet = phutil_tag( + 'div', + array( + 'class' => 'phui-search-snippet', + ), + $snippet); + $item->appendChild($snippet); + } + return $item; } diff --git a/webroot/rsrc/css/application/search/search-results.css b/webroot/rsrc/css/application/search/search-results.css index f02efe1315..19f1e77572 100644 --- a/webroot/rsrc/css/application/search/search-results.css +++ b/webroot/rsrc/css/application/search/search-results.css @@ -16,3 +16,8 @@ font-weight: normal; color: #000; } + +.phui-search-snippet { + margin: 0 8px; + color: {$greytext}; +} From 4e181a5611fb2a7a59d2f3f51feba159af9f66aa Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 10 Sep 2015 19:28:49 -0700 Subject: [PATCH 13/16] Clean up browse/history links in Diffusion Summary: Fixes T9126. In particular: - Add "Browse" links to all history views. - Use icons to show "Browse" and "History" links, instead of text. - Use FontAwesome. - Generally standardize handling of these elements. This might need a little design attention, but I think it's an improvement overall. Test Plan: - Viewed repository history. - Viewed branch history. - Viewed file history. - Viewed table of contents on a commit. - Viewed merged changes on a merge commit. - Viewed a directory containing an external. - Viewed a deleted file. {F788419} {F788420} {F788421} {F788422} Reviewers: chad Reviewed By: chad Maniphest Tasks: T9126 Differential Revision: https://secure.phabricator.com/D14096 --- resources/celerity/map.php | 62 +++++----- .../constants/DifferentialChangeType.php | 15 +++ .../controller/DiffusionCommitController.php | 20 +-- .../controller/DiffusionHistoryController.php | 13 +- .../DiffusionRepositoryController.php | 7 +- .../view/DiffusionBrowseTableView.php | 35 ++---- .../view/DiffusionEmptyResultView.php | 31 +++-- .../view/DiffusionHistoryTableView.php | 21 +++- .../diffusion/view/DiffusionView.php | 117 +++++++++--------- .../view/PHUIDiffTableOfContentsListView.php | 2 +- webroot/rsrc/css/aphront/table-view.css | 6 + .../application/diffusion/diffusion-icons.css | 33 ++--- webroot/rsrc/image/icon/fatcow/folder.png | Bin 632 -> 0 bytes webroot/rsrc/image/icon/fatcow/folder_go.png | Bin 803 -> 0 bytes .../image/icon/fatcow/page_white_link.png | Bin 732 -> 0 bytes .../image/icon/fatcow/page_white_text.png | Bin 568 -> 0 bytes 16 files changed, 186 insertions(+), 176 deletions(-) delete mode 100644 webroot/rsrc/image/icon/fatcow/folder.png delete mode 100644 webroot/rsrc/image/icon/fatcow/folder_go.png delete mode 100644 webroot/rsrc/image/icon/fatcow/page_white_link.png delete mode 100644 webroot/rsrc/image/icon/fatcow/page_white_text.png diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 2181877bfc..8875583e99 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,12 +7,12 @@ */ return array( 'names' => array( - 'core.pkg.css' => '3fcfaed8', + 'core.pkg.css' => 'a2cf2f6c', 'core.pkg.js' => '47dc9ebb', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', - 'differential.pkg.js' => '52d725be', - 'diffusion.pkg.css' => '385e85b3', + 'differential.pkg.js' => '6223dd9d', + 'diffusion.pkg.css' => 'f45955ed', 'diffusion.pkg.js' => '0115b37c', 'maniphest.pkg.css' => '4845691a', 'maniphest.pkg.js' => '3ec6a6d5', @@ -25,7 +25,7 @@ return array( 'rsrc/css/aphront/notification.css' => '9c279160', 'rsrc/css/aphront/panel-view.css' => '8427b78d', 'rsrc/css/aphront/phabricator-nav-view.css' => 'a24cb589', - 'rsrc/css/aphront/table-view.css' => 'e3632cc9', + 'rsrc/css/aphront/table-view.css' => '34ee903e', 'rsrc/css/aphront/tokenizer.css' => '04875312', 'rsrc/css/aphront/tooltip.css' => '7672b60f', 'rsrc/css/aphront/typeahead-browse.css' => 'd8581d2c', @@ -65,7 +65,7 @@ return array( 'rsrc/css/application/differential/revision-history.css' => '0e8eb855', 'rsrc/css/application/differential/revision-list.css' => 'f3c47d33', 'rsrc/css/application/differential/table-of-contents.css' => 'ae4b7a55', - 'rsrc/css/application/diffusion/diffusion-icons.css' => '4ba18923', + 'rsrc/css/application/diffusion/diffusion-icons.css' => '2941baf1', 'rsrc/css/application/diffusion/diffusion-readme.css' => '2106ea08', 'rsrc/css/application/diffusion/diffusion-source.css' => '66fdf661', 'rsrc/css/application/feed/feed.css' => 'ecd4ec57', @@ -99,7 +99,7 @@ return array( 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', 'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd', 'rsrc/css/application/releeph/releeph-request-typeahead.css' => '667a48ae', - 'rsrc/css/application/search/search-results.css' => '586db3a4', + 'rsrc/css/application/search/search-results.css' => '7dea472c', 'rsrc/css/application/slowvote/slowvote.css' => '475b4bd2', 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/uiexample/example.css' => '528b19de', @@ -276,14 +276,10 @@ return array( 'rsrc/image/icon/fatcow/flag_purple.png' => 'cc517522', 'rsrc/image/icon/fatcow/flag_red.png' => '04ec726f', 'rsrc/image/icon/fatcow/flag_yellow.png' => '73946fd4', - 'rsrc/image/icon/fatcow/folder.png' => '95a435af', - 'rsrc/image/icon/fatcow/folder_go.png' => '001cbc94', 'rsrc/image/icon/fatcow/key_question.png' => '52a0c26a', 'rsrc/image/icon/fatcow/link.png' => '7afd4d5e', 'rsrc/image/icon/fatcow/page_white_edit.png' => '39a2eed8', - 'rsrc/image/icon/fatcow/page_white_link.png' => 'a90023c7', 'rsrc/image/icon/fatcow/page_white_put.png' => '08c95a0c', - 'rsrc/image/icon/fatcow/page_white_text.png' => '1e1f79c3', 'rsrc/image/icon/fatcow/source/conduit.png' => '4ea01d2f', 'rsrc/image/icon/fatcow/source/email.png' => '9bab3239', 'rsrc/image/icon/fatcow/source/fax.png' => '04195e68', @@ -357,13 +353,13 @@ return array( 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', 'rsrc/js/application/differential/ChangesetViewManager.js' => '58562350', - 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => 'd4c87bf4', + 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => '64a5550f', 'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => 'e10f8e18', 'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d', 'rsrc/js/application/differential/behavior-comment-preview.js' => 'b064af76', 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', 'rsrc/js/application/differential/behavior-dropdown-menus.js' => '2035b9cb', - 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '037b59eb', + 'rsrc/js/application/differential/behavior-edit-inline-comments.js' => '65ef6074', 'rsrc/js/application/differential/behavior-keyboard-nav.js' => '2c426492', 'rsrc/js/application/differential/behavior-populate.js' => '8694b1df', 'rsrc/js/application/differential/behavior-toggle-files.js' => 'ca3f91eb', @@ -496,7 +492,7 @@ return array( 'aphront-list-filter-view-css' => '5d6f0526', 'aphront-multi-column-view-css' => 'fd18389d', 'aphront-panel-view-css' => '8427b78d', - 'aphront-table-view-css' => 'e3632cc9', + 'aphront-table-view-css' => '34ee903e', 'aphront-tokenizer-control-css' => '04875312', 'aphront-tooltip-css' => '7672b60f', 'aphront-typeahead-control-css' => '0e403212', @@ -517,13 +513,13 @@ return array( 'conpherence-widget-pane-css' => '775eaaba', 'differential-changeset-view-css' => 'b6b0d1bb', 'differential-core-view-css' => '7ac3cabc', - 'differential-inline-comment-editor' => 'd4c87bf4', + 'differential-inline-comment-editor' => '64a5550f', 'differential-revision-add-comment-css' => 'c47f8c40', 'differential-revision-comment-css' => '14b8565a', 'differential-revision-history-css' => '0e8eb855', 'differential-revision-list-css' => 'f3c47d33', 'differential-table-of-contents-css' => 'ae4b7a55', - 'diffusion-icons-css' => '4ba18923', + 'diffusion-icons-css' => '2941baf1', 'diffusion-readme-css' => '2106ea08', 'diffusion-source-css' => '66fdf661', 'diviner-shared-css' => '5a337049', @@ -568,7 +564,7 @@ return array( 'javelin-behavior-differential-comment-jump' => '4fdb476d', 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 'javelin-behavior-differential-dropdown-menus' => '2035b9cb', - 'javelin-behavior-differential-edit-inline-comments' => '037b59eb', + 'javelin-behavior-differential-edit-inline-comments' => '65ef6074', 'javelin-behavior-differential-feedback-preview' => 'b064af76', 'javelin-behavior-differential-keyboard-navigation' => '2c426492', 'javelin-behavior-differential-populate' => '8694b1df', @@ -738,7 +734,7 @@ return array( 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => '6920d200', 'phabricator-remarkup-css' => '1c4ac273', - 'phabricator-search-results-css' => '586db3a4', + 'phabricator-search-results-css' => '7dea472c', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-side-menu-view-css' => 'bec2458e', 'phabricator-slowvote-css' => '475b4bd2', @@ -853,14 +849,6 @@ return array( 'javelin-behavior-device', 'phabricator-title', ), - '037b59eb' => array( - 'javelin-behavior', - 'javelin-stratcom', - 'javelin-dom', - 'javelin-util', - 'javelin-vector', - 'differential-inline-comment-editor', - ), '048330fa' => array( 'javelin-behavior', 'javelin-typeahead-ondemand-source', @@ -1289,6 +1277,22 @@ return array( 'javelin-workflow', 'javelin-dom', ), + '64a5550f' => array( + 'javelin-dom', + 'javelin-util', + 'javelin-stratcom', + 'javelin-install', + 'javelin-request', + 'javelin-workflow', + ), + '65ef6074' => array( + 'javelin-behavior', + 'javelin-stratcom', + 'javelin-dom', + 'javelin-util', + 'javelin-vector', + 'differential-inline-comment-editor', + ), '665cf6ac' => array( 'javelin-behavior', 'javelin-util', @@ -1817,14 +1821,6 @@ return array( 'javelin-dom', 'javelin-view', ), - 'd4c87bf4' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - 'javelin-request', - 'javelin-workflow', - ), 'd4eecc63' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/applications/differential/constants/DifferentialChangeType.php b/src/applications/differential/constants/DifferentialChangeType.php index fb0fd58883..2bf4b217a7 100644 --- a/src/applications/differential/constants/DifferentialChangeType.php +++ b/src/applications/differential/constants/DifferentialChangeType.php @@ -66,6 +66,21 @@ final class DifferentialChangeType extends Phobject { return idx($names, coalesce($type, '?'), '???'); } + public static function getIconForFileType($type) { + static $icons = array( + self::FILE_TEXT => 'fa-file-text-o', + self::FILE_IMAGE => 'fa-file-image-o', + self::FILE_BINARY => 'fa-file', + self::FILE_DIRECTORY => 'fa-folder-open', + self::FILE_SYMLINK => 'fa-link', + self::FILE_DELETED => 'fa-file', + self::FILE_NORMAL => 'fa-file-text-o', + self::FILE_SUBMODULE => 'fa-folder-open-o', + ); + + return idx($icons, $type, 'fa-file'); + } + public static function isOldLocationChangeType($type) { static $types = array( self::TYPE_MOVE_AWAY => true, diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 6117bcdaca..8a7d7d7d7c 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -856,6 +856,7 @@ final class DiffusionCommitController extends DiffusionController { } private function buildMergesTable(PhabricatorRepositoryCommit $commit) { + $viewer = $this->getViewer(); $drequest = $this->getDiffusionRequest(); $repository = $drequest->getRepository(); @@ -892,15 +893,12 @@ final class DiffusionCommitController extends DiffusionController { new PhutilNumber($limit))); } - $history_table = new DiffusionHistoryTableView(); - $history_table->setUser($this->getRequest()->getUser()); - $history_table->setDiffusionRequest($drequest); - $history_table->setHistory($merges); - $history_table->loadRevisions(); + $history_table = id(new DiffusionHistoryTableView()) + ->setUser($viewer) + ->setDiffusionRequest($drequest) + ->setHistory($merges); - $phids = $history_table->getRequiredHandlePHIDs(); - $handles = $this->loadViewerHandles($phids); - $history_table->setHandles($handles); + $history_table->loadRevisions(); $panel = new PHUIObjectBoxView(); $panel->setHeaderText(pht('Merged Changes')); @@ -1110,7 +1108,11 @@ final class DiffusionCommitController extends DiffusionController { $anchor = substr(md5($path), 0, 8); $history_link = $diffusion_view->linkHistory($path); - $browse_link = $diffusion_view->linkBrowse($path); + $browse_link = $diffusion_view->linkBrowse( + $path, + array( + 'type' => $changeset->getFileType(), + )); $item = id(new PHUIDiffTableOfContentsItemView()) ->setChangeset($changeset) diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionHistoryController.php index 9dbcfc86dc..f69dbe2936 100644 --- a/src/applications/diffusion/controller/DiffusionHistoryController.php +++ b/src/applications/diffusion/controller/DiffusionHistoryController.php @@ -42,15 +42,12 @@ final class DiffusionHistoryController extends DiffusionController { $show_graph = !strlen($drequest->getPath()); $content = array(); - $history_table = new DiffusionHistoryTableView(); - $history_table->setUser($request->getUser()); - $history_table->setDiffusionRequest($drequest); - $history_table->setHistory($history); - $history_table->loadRevisions(); + $history_table = id(new DiffusionHistoryTableView()) + ->setUser($request->getUser()) + ->setDiffusionRequest($drequest) + ->setHistory($history); - $phids = $history_table->getRequiredHandlePHIDs(); - $handles = $this->loadViewerHandles($phids); - $history_table->setHandles($handles); + $history_table->loadRevisions(); if ($show_graph) { $history_table->setParents($history_results['parents']); diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php index 7f2201e7fd..5b63f16d71 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php @@ -177,8 +177,7 @@ final class DiffusionRepositoryController extends DiffusionController { $content[] = $this->buildHistoryTable( $history_results, $history, - $history_exception, - $handles); + $history_exception); try { $content[] = $this->buildTagListTable($drequest); @@ -519,8 +518,7 @@ final class DiffusionRepositoryController extends DiffusionController { private function buildHistoryTable( $history_results, $history, - $history_exception, - array $handles) { + $history_exception) { $request = $this->getRequest(); $viewer = $request->getUser(); @@ -544,7 +542,6 @@ final class DiffusionRepositoryController extends DiffusionController { $history_table = id(new DiffusionHistoryTableView()) ->setUser($viewer) ->setDiffusionRequest($drequest) - ->setHandles($handles) ->setHistory($history); // TODO: Super sketchy. diff --git a/src/applications/diffusion/view/DiffusionBrowseTableView.php b/src/applications/diffusion/view/DiffusionBrowseTableView.php index 35ba945f57..a8eb745fe4 100644 --- a/src/applications/diffusion/view/DiffusionBrowseTableView.php +++ b/src/applications/diffusion/view/DiffusionBrowseTableView.php @@ -40,25 +40,26 @@ final class DiffusionBrowseTableView extends DiffusionView { $browse_link = phutil_tag('strong', array(), $this->linkBrowse( $base_path.$path->getPath().$dir_slash, array( - 'text' => $this->renderPathIcon('dir', $browse_text), + 'type' => $file_type, + 'name' => $browse_text, ))); } else if ($file_type == DifferentialChangeType::FILE_SUBMODULE) { $browse_text = $path->getPath().'/'; - $browse_link = phutil_tag('strong', array(), $this->linkExternal( - $path->getHash(), - $path->getExternalURI(), - $this->renderPathIcon('ext', $browse_text))); + $browse_link = phutil_tag('strong', array(), $this->linkBrowse( + null, + array( + 'type' => $file_type, + 'name' => $browse_text, + 'hash' => $path->getHash(), + 'external' => $path->getExternalURI(), + ))); } else { - if ($file_type == DifferentialChangeType::FILE_SYMLINK) { - $type = 'link'; - } else { - $type = 'file'; - } $browse_text = $path->getPath(); $browse_link = $this->linkBrowse( $base_path.$path->getPath(), array( - 'text' => $this->renderPathIcon($type, $browse_text), + 'type' => $file_type, + 'name' => $browse_text, )); } @@ -151,16 +152,4 @@ final class DiffusionBrowseTableView extends DiffusionView { return $view->render(); } - private function renderPathIcon($type, $text) { - - require_celerity_resource('diffusion-icons-css'); - - return phutil_tag( - 'span', - array( - 'class' => 'diffusion-path-icon diffusion-path-icon-'.$type, - ), - $text); - } - } diff --git a/src/applications/diffusion/view/DiffusionEmptyResultView.php b/src/applications/diffusion/view/DiffusionEmptyResultView.php index 74a131e9d7..12def83e76 100644 --- a/src/applications/diffusion/view/DiffusionEmptyResultView.php +++ b/src/applications/diffusion/view/DiffusionEmptyResultView.php @@ -17,11 +17,11 @@ final class DiffusionEmptyResultView extends DiffusionView { public function render() { $drequest = $this->getDiffusionRequest(); + $repository = $drequest->getRepository(); $commit = $drequest->getCommit(); - $callsign = $drequest->getRepository()->getCallsign(); if ($commit) { - $commit = "r{$callsign}{$commit}"; + $commit = $repository->formatCommitName($commit); } else { $commit = 'HEAD'; } @@ -37,29 +37,38 @@ final class DiffusionEmptyResultView extends DiffusionView { break; case DiffusionBrowseResultSet::REASON_IS_EMPTY: $title = pht('Empty Directory'); - $body = pht("This path was an empty directory at %s.\n", $commit); + $body = pht('This path was an empty directory at %s.', $commit); $severity = PHUIInfoView::SEVERITY_NOTICE; break; case DiffusionBrowseResultSet::REASON_IS_DELETED: $deleted = $this->browseResultSet->getDeletedAtCommit(); $existed = $this->browseResultSet->getExistedAtCommit(); - $browse = $this->linkBrowse( - $drequest->getPath(), + $existed_text = $repository->formatCommitName($existed); + $existed_href = $drequest->generateURI( array( - 'text' => 'existed', + 'action' => 'browse', + 'path' => $drequest->getPath(), 'commit' => $existed, - 'params' => array('view' => $this->view), + 'params' => array( + 'view' => $this->view, + ), )); + $existed_link = phutil_tag( + 'a', + array( + 'href' => $existed_href, + ), + $existed_text); + $title = pht('Path Was Deleted'); $body = pht( - 'This path does not exist at %s. It was deleted in %s and last %s '. - 'at %s.', + 'This path does not exist at %s. It was deleted in %s and last '. + 'existed at %s.', $commit, self::linkCommit($drequest->getRepository(), $deleted), - $browse, - "r{$callsign}{$existed}"); + $existed_link); $severity = PHUIInfoView::SEVERITY_WARNING; break; case DiffusionBrowseResultSet::REASON_IS_UNTRACKED_PARENT: diff --git a/src/applications/diffusion/view/DiffusionHistoryTableView.php b/src/applications/diffusion/view/DiffusionHistoryTableView.php index ce1a693696..fd5f463b34 100644 --- a/src/applications/diffusion/view/DiffusionHistoryTableView.php +++ b/src/applications/diffusion/view/DiffusionHistoryTableView.php @@ -36,7 +36,7 @@ final class DiffusionHistoryTableView extends DiffusionView { return $this; } - public function getRequiredHandlePHIDs() { + private function getRequiredHandlePHIDs() { $phids = array(); foreach ($this->history as $item) { $data = $item->getCommitData(); @@ -87,7 +87,8 @@ final class DiffusionHistoryTableView extends DiffusionView { public function render() { $drequest = $this->getDiffusionRequest(); - $handles = $this->handles; + $viewer = $this->getUser(); + $handles = $viewer->loadHandles($this->getRequiredHandlePHIDs()); $graph = null; if ($this->parents) { @@ -188,8 +189,17 @@ final class DiffusionHistoryTableView extends DiffusionView { } } + $browse = $this->linkBrowse( + $history->getPath(), + array( + 'commit' => $history->getCommitIdentifier(), + 'branch' => $drequest->getBranch(), + 'type' => $history->getFileType(), + )); + $rows[] = array( $graph ? $graph[$ii++] : null, + $browse, self::linkCommit( $drequest->getRepository(), $history->getCommitIdentifier()), @@ -207,9 +217,10 @@ final class DiffusionHistoryTableView extends DiffusionView { $view = new AphrontTableView($rows); $view->setHeaders( array( - '', + null, + null, pht('Commit'), - '', + null, pht('Revision'), pht('Author/Committer'), pht('Details'), @@ -219,6 +230,7 @@ final class DiffusionHistoryTableView extends DiffusionView { $view->setColumnClasses( array( 'threads', + 'nudgeright', 'n', 'icon', 'n', @@ -237,6 +249,7 @@ final class DiffusionHistoryTableView extends DiffusionView { true, true, true, + true, false, true, false, diff --git a/src/applications/diffusion/view/DiffusionView.php b/src/applications/diffusion/view/DiffusionView.php index 0bc51f8347..b7b3599a2d 100644 --- a/src/applications/diffusion/view/DiffusionView.php +++ b/src/applications/diffusion/view/DiffusionView.php @@ -13,36 +13,6 @@ abstract class DiffusionView extends AphrontView { return $this->diffusionRequest; } - final public function linkChange( - $change_type, - $file_type, - $path = null, - $commit_identifier = null) { - - $text = DifferentialChangeType::getFullNameForChangeType($change_type); - if ($change_type == DifferentialChangeType::TYPE_CHILD) { - // TODO: Don't link COPY_AWAY without a direct change. - return $text; - } - if ($file_type == DifferentialChangeType::FILE_DIRECTORY) { - return $text; - } - - $href = $this->getDiffusionRequest()->generateURI( - array( - 'action' => 'change', - 'path' => $path, - 'commit' => $commit_identifier, - )); - - return phutil_tag( - 'a', - array( - 'href' => $href, - ), - $text); - } - final public function linkHistory($path) { $href = $this->getDiffusionRequest()->generateURI( array( @@ -50,50 +20,83 @@ abstract class DiffusionView extends AphrontView { 'path' => $path, )); - return phutil_tag( + return javelin_tag( 'a', array( 'href' => $href, + 'class' => 'diffusion-link-icon', + 'sigil' => 'has-tooltip', + 'meta' => array( + 'tip' => pht('History'), + 'align' => 'E', + ), ), - pht('History')); + id(new PHUIIconView())->setIconFont('fa-list-ul blue')); } final public function linkBrowse($path, array $details = array()) { + require_celerity_resource('diffusion-icons-css'); + Javelin::initBehavior('phabricator-tooltips'); - $href = $this->getDiffusionRequest()->generateURI( - $details + array( - 'action' => 'browse', - 'path' => $path, - )); + $file_type = idx($details, 'type'); + unset($details['type']); - if (isset($details['text'])) { - $text = $details['text']; - } else { - $text = pht('Browse'); + $display_name = idx($details, 'name'); + unset($details['name']); + + if (strlen($display_name)) { + $display_name = phutil_tag( + 'span', + array( + 'class' => 'diffusion-browse-name', + ), + $display_name); } - return phutil_tag( - 'a', - array( - 'href' => $href, - ), - $text); - } - - final public function linkExternal($hash, $uri, $text) { - $href = id(new PhutilURI('/diffusion/external/')) - ->setQueryParams( - array( - 'uri' => $uri, - 'id' => $hash, + if (isset($details['external'])) { + $href = id(new PhutilURI('/diffusion/external/')) + ->setQueryParams( + array( + 'uri' => idx($details, 'external'), + 'id' => idx($details, 'hash'), + )); + $tip = pht('Browse External'); + } else { + $href = $this->getDiffusionRequest()->generateURI( + $details + array( + 'action' => 'browse', + 'path' => $path, )); + $tip = pht('Browse'); + } - return phutil_tag( + $icon = DifferentialChangeType::getIconForFileType($file_type); + $icon_view = id(new PHUIIconView())->setIconFont("{$icon} blue"); + + // If we're rendering a file or directory name, don't show the tooltip. + if ($display_name !== null) { + $sigil = null; + $meta = null; + } else { + $sigil = 'has-tooltip'; + $meta = array( + 'tip' => $tip, + 'align' => 'E', + ); + } + + return javelin_tag( 'a', array( 'href' => $href, + 'class' => 'diffusion-link-icon', + 'sigil' => $sigil, + 'meta' => $meta, ), - $text); + array( + $icon_view, + $display_name, + )); } final public static function nameCommit( diff --git a/src/infrastructure/diff/view/PHUIDiffTableOfContentsListView.php b/src/infrastructure/diff/view/PHUIDiffTableOfContentsListView.php index c24acf7bb0..f54b6f3fd7 100644 --- a/src/infrastructure/diff/view/PHUIDiffTableOfContentsListView.php +++ b/src/infrastructure/diff/view/PHUIDiffTableOfContentsListView.php @@ -107,7 +107,7 @@ final class PHUIDiffTableOfContentsListView extends AphrontView { )) ->setColumnClasses( array( - 'center', + null, 'differential-toc-char center', 'differential-toc-prop center', 'differential-toc-ftype center', diff --git a/webroot/rsrc/css/aphront/table-view.css b/webroot/rsrc/css/aphront/table-view.css index d26a8268c5..8b31b33b8d 100644 --- a/webroot/rsrc/css/aphront/table-view.css +++ b/webroot/rsrc/css/aphront/table-view.css @@ -175,6 +175,10 @@ th.aphront-table-view-sortable-selected { text-align: right; } +.aphront-table-view td.nudgeright, .aphront-table-view th.nudgeright { + padding-right: 0; +} + .aphront-table-view td.wrap { white-space: normal; } @@ -194,6 +198,8 @@ th.aphront-table-view-sortable-selected { padding: 0px; } + + div.single-display-line-bounds { width: 100%; position: relative; diff --git a/webroot/rsrc/css/application/diffusion/diffusion-icons.css b/webroot/rsrc/css/application/diffusion/diffusion-icons.css index b472283001..087ce9362e 100644 --- a/webroot/rsrc/css/application/diffusion/diffusion-icons.css +++ b/webroot/rsrc/css/application/diffusion/diffusion-icons.css @@ -2,31 +2,6 @@ * @provides diffusion-icons-css */ -.diffusion-path-icon { - display: block; - padding-left: 28px; - background-repeat: no-repeat; - background-position: 1px 1px; - height: 18px; - padding-top: 1px; -} - -.diffusion-path-icon-ext { - background-image: url(/rsrc/image/icon/fatcow/folder_go.png); -} - -.diffusion-path-icon-dir { - background-image: url(/rsrc/image/icon/fatcow/folder.png); -} - -.diffusion-path-icon-file { - background-image: url(/rsrc/image/icon/fatcow/page_white_text.png); -} - -.diffusion-path-icon-link { - background-image: url(/rsrc/image/icon/fatcow/page_white_link.png); -} - input.diffusion-clone-uri { display: block; width: 100%; @@ -37,3 +12,11 @@ input.diffusion-clone-uri { text-align: right; color: {$lightgreytext}; } + +.diffusion-browse-name { + margin-left: 8px; +} + +.diffusion-link-icon + .diffusion-link-icon { + margin-left: 6px; +} diff --git a/webroot/rsrc/image/icon/fatcow/folder.png b/webroot/rsrc/image/icon/fatcow/folder.png deleted file mode 100644 index f1ed9abe0338be5a0401f4aee1b3bb168b4d815f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 632 zcmV-;0*C#HP)4gUbq(tw1lgoXx`HVs0gK|-QT;Nk*gBnKlTn_z-{ zmhYU)-7d3t&KJ-ik94}dotgJ$-pr9P27{QufTqgxGmAP3uNoaE7bGM|sxpx{$6x!S zseeO+ZJ)Bq=VzY*TTvP$C03r?ILjc0=nnu+A|W7D<`Wa0NdS!2oVvxShDKmPGuu1Z{X#D3g|-0BZ&qN9*G%zO46N zD4sVu^%@Qrc`Ds1baRPAMG7LbeA>HftOGIA&>{S+y14WB!(!4xyYUUh=}X*79hA*; zs@NUjK4So91b$-;-y6->tMfCSvO&Q{3%OG#fnJLTF^s=9aIa;Dv9bIfwI98O6QfM# z&RzC+V0j(IuuEljHs;@Ei!vnIlXu^Ym7iYmY~+PRvHvr>_inmd1OCpx1sDLU%fF)P S!b7P50000 diff --git a/webroot/rsrc/image/icon/fatcow/folder_go.png b/webroot/rsrc/image/icon/fatcow/folder_go.png deleted file mode 100644 index 3c36ef0c952ed9208f4ed85dd6a65d1805989d0b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 803 zcmV+;1Kj+HP)o*gzXL=J%ShAkvAH^%Kt>r`^G#q-050@7#>JKxfQ&}Tc?IF|>yVN` z&pwJh^>+cz5>c&(v^Jq*sHG-T(={hC84xie86rgr=`|R$y$NH*fDsUjot0q}JpT-- zCBFE7g$s8$C?92ME)y+EmuYJ$)5bLp-+%`T{=h0B0!B5M5GdGc`$TnnWC7q0v?K)} zVxcV74Br0F$k=E@e&v0Of>ff4P4yy>q1L)e5mRVkOnex}ymx9{+8nth1=yUE3HV#F z%hiO^Jivi0G?bo)A#<^`Z1fApIaUH*gntL&JljcWnpP@WGBDLfNIIQ$q|jB}fph5S zYr@s{4{&;01-{QmItBF`OMyw)x914bE*&AD*IS%<-|?NuTw z*%BARKGb#-YN$B<(zp#e83x%XY#S_RA^T9Hw_QH!!GkCyrU?32N4x*Ld;j3Ql6=_8|qDMv}TtQb=-1O5##>4f5U; zWP=;>;6*%F`tlp<%c4afp?IF0rXZaqp*Gm#OK0$LtTFKVDY6@Gid;|5KK%2k{(qIM h?h7Q|_~l;#1^{hH`BJynySM-V002ovPDHLkV1ffOXORE^ diff --git a/webroot/rsrc/image/icon/fatcow/page_white_link.png b/webroot/rsrc/image/icon/fatcow/page_white_link.png deleted file mode 100644 index fcb5f80f7fbc32237934c80cab577f4795e6beb8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 732 zcmV<20wev2P)i)4(F-r%_kKT~_xYaZ4;2?z6}pOKF5(Ya*xf1m*bOYYHq@nt}cjTOzH0P`?0dT44wWsTAEtW-F+21 zzf#ET?!v#YfM78AU8wY5T3W*Wdw20@Xc+73>u4t1n1xKTG+o%(_=&*RAY!73?VTMw zA00&~6gpegAfL};Yb%CQv51F*19&lJ$E!&@Vp0N`Ool#I6mzq)xY&6C)7}|`!(ru{ zR{_|Y^YnI&MuRc?I1+IQ!z0g-PNx+S^RypNB$Q+qGgLDsLdBN0Gi~tse7N4*3rUg? z2n67EyV1~450lA+Rr=!R+uLC_n^7RPo12@EVzDy!+Tr-D)oL#@H$Hy)g56XK$Li~m zrZGyi`}^-ePySC#Od|3l0*l3hY&MHzGMOM(ZZi!}QR?vjQDEBt5nup$gF|~<@}}M{P)&t)G`DS3bj zbwLG$42l$$aw!)z*&tv+5pO|wfhg$$Shjrv6c&&Rh#hQrkgC8g0;ydP5;0?+9=nst zgi_l6($V<%^38AiSP&6TPEWrFQYJ_#5aQCAfF%Tk5H~B!%gJbjsNbkH8uT}{S}i)N z*Q;@W4l7Rkc6r5djmxWR^VPZ5ezl5ZGKn|2+=rt^;~?(Q=@~VNV{5A%8rla7%fij= zEmElzrgFLUdb8IXTS&eu~LEOO|oT$Lg76s Date: Thu, 10 Sep 2015 19:52:36 -0700 Subject: [PATCH 14/16] Leafy vegetables from out-of-order lands. --- resources/celerity/map.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 8875583e99..e3e198a2d3 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -99,7 +99,7 @@ return array( 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', 'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd', 'rsrc/css/application/releeph/releeph-request-typeahead.css' => '667a48ae', - 'rsrc/css/application/search/search-results.css' => '7dea472c', + 'rsrc/css/application/search/search-results.css' => '586db3a4', 'rsrc/css/application/slowvote/slowvote.css' => '475b4bd2', 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/uiexample/example.css' => '528b19de', @@ -734,7 +734,7 @@ return array( 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => '6920d200', 'phabricator-remarkup-css' => '1c4ac273', - 'phabricator-search-results-css' => '7dea472c', + 'phabricator-search-results-css' => '586db3a4', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-side-menu-view-css' => 'bec2458e', 'phabricator-slowvote-css' => '475b4bd2', From 1c45a7d8e2c54789c60b0ddead370b3aad92c82b Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 10 Sep 2015 20:57:26 -0700 Subject: [PATCH 15/16] Revert "Allow search results to be snippeted, roughly" Summary: This reverts commit 15837388428d6dd3c37cf4b1d302e78657fce24e. See T8646 for discussion. This version of the feature feels terrible on real data. Test Plan: Strict revert. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D14097 --- resources/celerity/map.php | 4 ++-- src/__phutil_library_map__.php | 4 ---- .../storage/DifferentialRevision.php | 17 +---------------- .../maniphest/storage/ManiphestTask.php | 17 +---------------- .../phriction/storage/PhrictionDocument.php | 18 +----------------- .../PhabricatorSearchSnippetInterface.php | 11 ----------- ...habricatorSearchApplicationSearchEngine.php | 1 - .../view/PhabricatorSearchResultView.php | 18 ------------------ .../css/application/search/search-results.css | 5 ----- 9 files changed, 5 insertions(+), 90 deletions(-) delete mode 100644 src/applications/search/interface/PhabricatorSearchSnippetInterface.php diff --git a/resources/celerity/map.php b/resources/celerity/map.php index e3e198a2d3..8875583e99 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -99,7 +99,7 @@ return array( 'rsrc/css/application/releeph/releeph-preview-branch.css' => 'b7a6f4a5', 'rsrc/css/application/releeph/releeph-request-differential-create-dialog.css' => '8d8b92cd', 'rsrc/css/application/releeph/releeph-request-typeahead.css' => '667a48ae', - 'rsrc/css/application/search/search-results.css' => '586db3a4', + 'rsrc/css/application/search/search-results.css' => '7dea472c', 'rsrc/css/application/slowvote/slowvote.css' => '475b4bd2', 'rsrc/css/application/tokens/tokens.css' => '3d0f239e', 'rsrc/css/application/uiexample/example.css' => '528b19de', @@ -734,7 +734,7 @@ return array( 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => '6920d200', 'phabricator-remarkup-css' => '1c4ac273', - 'phabricator-search-results-css' => '586db3a4', + 'phabricator-search-results-css' => '7dea472c', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-side-menu-view-css' => 'bec2458e', 'phabricator-slowvote-css' => '475b4bd2', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 14f128558d..c9db433f4b 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2840,7 +2840,6 @@ phutil_register_library_map(array( 'PhabricatorSearchResultView' => 'applications/search/view/PhabricatorSearchResultView.php', 'PhabricatorSearchSelectController' => 'applications/search/controller/PhabricatorSearchSelectController.php', 'PhabricatorSearchSelectField' => 'applications/search/field/PhabricatorSearchSelectField.php', - 'PhabricatorSearchSnippetInterface' => 'applications/search/interface/PhabricatorSearchSnippetInterface.php', 'PhabricatorSearchStringListField' => 'applications/search/field/PhabricatorSearchStringListField.php', 'PhabricatorSearchSubscribersField' => 'applications/search/field/PhabricatorSearchSubscribersField.php', 'PhabricatorSearchTextField' => 'applications/search/field/PhabricatorSearchTextField.php', @@ -4133,7 +4132,6 @@ phutil_register_library_map(array( 'PhabricatorMentionableInterface', 'PhabricatorDestructibleInterface', 'PhabricatorProjectInterface', - 'PhabricatorSearchSnippetInterface', ), 'DifferentialRevisionAffectedFilesHeraldField' => 'DifferentialRevisionHeraldField', 'DifferentialRevisionAuthorHeraldField' => 'DifferentialRevisionHeraldField', @@ -5027,7 +5025,6 @@ phutil_register_library_map(array( 'PhabricatorApplicationTransactionInterface', 'PhabricatorProjectInterface', 'PhabricatorSpacesInterface', - 'PhabricatorSearchSnippetInterface', ), 'ManiphestTaskAssignHeraldAction' => 'HeraldAction', 'ManiphestTaskAssignOtherHeraldAction' => 'ManiphestTaskAssignHeraldAction', @@ -7626,7 +7623,6 @@ phutil_register_library_map(array( 'PhabricatorTokenReceiverInterface', 'PhabricatorDestructibleInterface', 'PhabricatorApplicationTransactionInterface', - 'PhabricatorSearchSnippetInterface', ), 'PhrictionDocumentAuthorHeraldField' => 'PhrictionDocumentHeraldField', 'PhrictionDocumentContentHeraldField' => 'PhrictionDocumentHeraldField', diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index ff007e2638..84b77f0c48 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -13,8 +13,7 @@ final class DifferentialRevision extends DifferentialDAO PhabricatorApplicationTransactionInterface, PhabricatorMentionableInterface, PhabricatorDestructibleInterface, - PhabricatorProjectInterface, - PhabricatorSearchSnippetInterface { + PhabricatorProjectInterface { protected $title = ''; protected $originalTitle; @@ -630,18 +629,4 @@ final class DifferentialRevision extends DifferentialDAO $this->saveTransaction(); } - -/* -( PhabricatorSearchSnippetInterface )---------------------------------- */ - - - public function renderSearchResultSnippet(PhabricatorUser $viewer) { - $content = $this->getSummary(); - $content = PhabricatorMarkupEngine::summarize($content); - $content = PhabricatorMarkupEngine::renderOneObject( - id(new PhabricatorMarkupOneOff())->setContent($content), - 'default', - $viewer); - return $content; - } - } diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php index 453d8c3458..7fbc806bae 100644 --- a/src/applications/maniphest/storage/ManiphestTask.php +++ b/src/applications/maniphest/storage/ManiphestTask.php @@ -13,8 +13,7 @@ final class ManiphestTask extends ManiphestDAO PhabricatorDestructibleInterface, PhabricatorApplicationTransactionInterface, PhabricatorProjectInterface, - PhabricatorSpacesInterface, - PhabricatorSearchSnippetInterface { + PhabricatorSpacesInterface { const MARKUP_FIELD_DESCRIPTION = 'markup:desc'; @@ -391,18 +390,4 @@ final class ManiphestTask extends ManiphestDAO return $this->spacePHID; } - -/* -( PhabricatorSearchSnippetInterface )---------------------------------- */ - - - public function renderSearchResultSnippet(PhabricatorUser $viewer) { - $content = $this->getDescription(); - $content = PhabricatorMarkupEngine::summarize($content); - $content = PhabricatorMarkupEngine::renderOneObject( - id(new PhabricatorMarkupOneOff())->setContent($content), - 'default', - $viewer); - return $content; - } - } diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php index 661feda3c3..f274d87ad4 100644 --- a/src/applications/phriction/storage/PhrictionDocument.php +++ b/src/applications/phriction/storage/PhrictionDocument.php @@ -7,8 +7,7 @@ final class PhrictionDocument extends PhrictionDAO PhabricatorFlaggableInterface, PhabricatorTokenReceiverInterface, PhabricatorDestructibleInterface, - PhabricatorApplicationTransactionInterface, - PhabricatorSearchSnippetInterface { + PhabricatorApplicationTransactionInterface { protected $slug; protected $depth; @@ -253,19 +252,4 @@ final class PhrictionDocument extends PhrictionDAO $this->saveTransaction(); } - -/* -( PhabricatorSearchSnippetInterface )---------------------------------- */ - - - public function renderSearchResultSnippet(PhabricatorUser $viewer) { - $content = $this->getContent()->getContent(); - $content = PhabricatorMarkupEngine::summarize($content); - $content = PhabricatorMarkupEngine::renderOneObject( - id(new PhabricatorMarkupOneOff())->setContent($content), - 'default', - $viewer); - return $content; - } - - } diff --git a/src/applications/search/interface/PhabricatorSearchSnippetInterface.php b/src/applications/search/interface/PhabricatorSearchSnippetInterface.php deleted file mode 100644 index 0d0543a61c..0000000000 --- a/src/applications/search/interface/PhabricatorSearchSnippetInterface.php +++ /dev/null @@ -1,11 +0,0 @@ - $handle) { $view = id(new PhabricatorSearchResultView()) - ->setUser($viewer) ->setHandle($handle) ->setQuery($query) ->setObject(idx($objects, $phid)) diff --git a/src/applications/search/view/PhabricatorSearchResultView.php b/src/applications/search/view/PhabricatorSearchResultView.php index 2c20b60620..63219b3252 100644 --- a/src/applications/search/view/PhabricatorSearchResultView.php +++ b/src/applications/search/view/PhabricatorSearchResultView.php @@ -21,13 +21,7 @@ final class PhabricatorSearchResultView extends AphrontView { return $this; } - public function getObject() { - return $this->object; - } - public function render() { - $viewer = $this->getUser(); - $handle = $this->handle; if (!$handle->isComplete()) { return; @@ -52,18 +46,6 @@ final class PhabricatorSearchResultView extends AphrontView { $item->addAttribute(pht('Closed')); } - $object = $this->getObject(); - if ($object instanceof PhabricatorSearchSnippetInterface) { - $snippet = $object->renderSearchResultSnippet($viewer); - $snippet = phutil_tag( - 'div', - array( - 'class' => 'phui-search-snippet', - ), - $snippet); - $item->appendChild($snippet); - } - return $item; } diff --git a/webroot/rsrc/css/application/search/search-results.css b/webroot/rsrc/css/application/search/search-results.css index 19f1e77572..f02efe1315 100644 --- a/webroot/rsrc/css/application/search/search-results.css +++ b/webroot/rsrc/css/application/search/search-results.css @@ -16,8 +16,3 @@ font-weight: normal; color: #000; } - -.phui-search-snippet { - margin: 0 8px; - color: {$greytext}; -} From d199560a6bf938156204f4ad537d2184c29096bf Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 11 Sep 2015 08:59:56 -0700 Subject: [PATCH 16/16] Add a box around the pager in Diffusion Summary: Fixes T9392, adds some sweet sweet margin to the pager. Test Plan: See pager with new padding, test different pages, breakpoints. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9392 Differential Revision: https://secure.phabricator.com/D14098 --- .../diffusion/controller/DiffusionHistoryController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionHistoryController.php index f69dbe2936..65286e9d34 100644 --- a/src/applications/diffusion/controller/DiffusionHistoryController.php +++ b/src/applications/diffusion/controller/DiffusionHistoryController.php @@ -79,6 +79,10 @@ final class DiffusionHistoryController extends DiffusionController { 'view' => 'history', )); + $pager = id(new PHUIBoxView()) + ->addClass('ml') + ->appendChild($pager); + return $this->buildApplicationPage( array( $crumbs,