diff --git a/resources/builtin/repo/repo-git.png b/resources/builtin/repo/repo-git.png new file mode 100644 index 0000000000..b8dfed8ad2 Binary files /dev/null and b/resources/builtin/repo/repo-git.png differ diff --git a/resources/builtin/repo/repo-hg.png b/resources/builtin/repo/repo-hg.png new file mode 100644 index 0000000000..d12c2e5339 Binary files /dev/null and b/resources/builtin/repo/repo-hg.png differ diff --git a/resources/builtin/repo/repo-svn.png b/resources/builtin/repo/repo-svn.png new file mode 100644 index 0000000000..702f36e794 Binary files /dev/null and b/resources/builtin/repo/repo-svn.png differ diff --git a/resources/celerity/map.php b/resources/celerity/map.php index d50a470c34..54832d23ae 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => 'e68cf1fa', 'conpherence.pkg.js' => 'b5b51108', - 'core.pkg.css' => 'cc0772c6', + 'core.pkg.css' => '0e4a68ad', 'core.pkg.js' => '5d80e0db', 'darkconsole.pkg.js' => '1f9a31bc', 'differential.pkg.css' => '45951e9e', @@ -26,7 +26,7 @@ return array( 'rsrc/audio/basic/ting.mp3' => '17660001', 'rsrc/css/aphront/aphront-bars.css' => '231ac33c', 'rsrc/css/aphront/dark-console.css' => 'f7b071f1', - 'rsrc/css/aphront/dialog-view.css' => '685c7e2d', + 'rsrc/css/aphront/dialog-view.css' => '6bfc244b', 'rsrc/css/aphront/list-filter-view.css' => '5d6f0526', 'rsrc/css/aphront/multi-column.css' => '84cc6640', 'rsrc/css/aphront/notification.css' => '3f6c89c9', @@ -42,7 +42,7 @@ return array( 'rsrc/css/application/base/main-menu-view.css' => '16053029', 'rsrc/css/application/base/notification-menu.css' => '73fefdfa', 'rsrc/css/application/base/phui-theme.css' => '9f261c6b', - 'rsrc/css/application/base/standard-page-view.css' => 'a0dae682', + 'rsrc/css/application/base/standard-page-view.css' => 'c581d2ac', 'rsrc/css/application/chatlog/chatlog.css' => 'd295b020', 'rsrc/css/application/conduit/conduit-api.css' => '7bc725c4', 'rsrc/css/application/config/config-options.css' => 'd55ed093', @@ -127,7 +127,7 @@ return array( 'rsrc/css/layout/phabricator-source-code-view.css' => 'aea41829', 'rsrc/css/phui/button/phui-button-bar.css' => 'f1ff5494', 'rsrc/css/phui/button/phui-button-simple.css' => '8e1baf68', - 'rsrc/css/phui/button/phui-button.css' => '3ca51caa', + 'rsrc/css/phui/button/phui-button.css' => '340f55c1', 'rsrc/css/phui/calendar/phui-calendar-day.css' => '572b1893', 'rsrc/css/phui/calendar/phui-calendar-list.css' => '576be600', 'rsrc/css/phui/calendar/phui-calendar-month.css' => '21154caf', @@ -149,13 +149,13 @@ return array( 'rsrc/css/phui/phui-comment-form.css' => 'ac68149f', 'rsrc/css/phui/phui-comment-panel.css' => 'f50152ad', 'rsrc/css/phui/phui-crumbs-view.css' => '6ece3bbb', - 'rsrc/css/phui/phui-curtain-view.css' => '55dd0e59', + 'rsrc/css/phui/phui-curtain-view.css' => 'ca363f15', 'rsrc/css/phui/phui-document-pro.css' => '8af7ea27', 'rsrc/css/phui/phui-document-summary.css' => '9ca48bdf', 'rsrc/css/phui/phui-document.css' => 'c32e8dec', 'rsrc/css/phui/phui-feed-story.css' => '44a9c8e9', 'rsrc/css/phui/phui-fontkit.css' => '1320ed01', - 'rsrc/css/phui/phui-form-view.css' => '6175808d', + 'rsrc/css/phui/phui-form-view.css' => 'ae9f8d16', 'rsrc/css/phui/phui-form.css' => '7aaa04e3', 'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f', 'rsrc/css/phui/phui-header-view.css' => 'e7de7ee2', @@ -484,7 +484,7 @@ return array( 'rsrc/js/core/behavior-device.js' => 'bb1dd507', 'rsrc/js/core/behavior-drag-and-drop-textarea.js' => '484a6e22', 'rsrc/js/core/behavior-error-log.js' => '6882e80a', - 'rsrc/js/core/behavior-fancy-datepicker.js' => 'a9210d03', + 'rsrc/js/core/behavior-fancy-datepicker.js' => 'ecf4e799', 'rsrc/js/core/behavior-file-tree.js' => '88236f00', 'rsrc/js/core/behavior-form.js' => '5c54cbf3', 'rsrc/js/core/behavior-gesture.js' => '3ab51e2c', @@ -539,7 +539,7 @@ return array( 'almanac-css' => 'dbb9b3af', 'aphront-bars' => '231ac33c', 'aphront-dark-console-css' => 'f7b071f1', - 'aphront-dialog-view-css' => '685c7e2d', + 'aphront-dialog-view-css' => '6bfc244b', 'aphront-list-filter-view-css' => '5d6f0526', 'aphront-multi-column-view-css' => '84cc6640', 'aphront-panel-view-css' => '8427b78d', @@ -633,7 +633,7 @@ return array( 'javelin-behavior-editengine-reorder-fields' => 'b59e1e96', 'javelin-behavior-error-log' => '6882e80a', 'javelin-behavior-event-all-day' => 'b41537c9', - 'javelin-behavior-fancy-datepicker' => 'a9210d03', + 'javelin-behavior-fancy-datepicker' => 'ecf4e799', 'javelin-behavior-global-drag-and-drop' => '960f6a39', 'javelin-behavior-herald-rule-editor' => '7ebaeed3', 'javelin-behavior-high-security-warning' => 'a464fe03', @@ -802,7 +802,7 @@ return array( 'phabricator-shaped-request' => '7cbe244b', 'phabricator-slowvote-css' => 'a94b7230', 'phabricator-source-code-view-css' => 'aea41829', - 'phabricator-standard-page-view' => 'a0dae682', + 'phabricator-standard-page-view' => 'c581d2ac', 'phabricator-textareautils' => '320810c8', 'phabricator-title' => '485aaa6c', 'phabricator-tooltip' => '358b8c04', @@ -824,7 +824,7 @@ return array( 'phui-big-info-view-css' => 'acc3492c', 'phui-box-css' => '745e881d', 'phui-button-bar-css' => 'f1ff5494', - 'phui-button-css' => '3ca51caa', + 'phui-button-css' => '340f55c1', 'phui-button-simple-css' => '8e1baf68', 'phui-calendar-css' => 'f1ddf11c', 'phui-calendar-day-css' => '572b1893', @@ -835,7 +835,7 @@ return array( 'phui-comment-form-css' => 'ac68149f', 'phui-comment-panel-css' => 'f50152ad', 'phui-crumbs-view-css' => '6ece3bbb', - 'phui-curtain-view-css' => '55dd0e59', + 'phui-curtain-view-css' => 'ca363f15', 'phui-document-summary-view-css' => '9ca48bdf', 'phui-document-view-css' => 'c32e8dec', 'phui-document-view-pro-css' => '8af7ea27', @@ -843,7 +843,7 @@ return array( 'phui-font-icon-base-css' => '870a7360', 'phui-fontkit-css' => '1320ed01', 'phui-form-css' => '7aaa04e3', - 'phui-form-view-css' => '6175808d', + 'phui-form-view-css' => 'ae9f8d16', 'phui-head-thing-view-css' => 'fd311e5f', 'phui-header-view-css' => 'e7de7ee2', 'phui-hovercard' => '1bd28176', @@ -1716,13 +1716,6 @@ return array( 'javelin-uri', 'phabricator-keyboard-shortcut', ), - 'a9210d03' => array( - 'javelin-behavior', - 'javelin-util', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-vector', - ), 'a9f88de2' => array( 'javelin-behavior', 'javelin-dom', @@ -2105,6 +2098,13 @@ return array( 'javelin-dom', 'phabricator-draggable-list', ), + 'ecf4e799' => array( + 'javelin-behavior', + 'javelin-util', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-vector', + ), 'edf8a145' => array( 'javelin-behavior', 'javelin-uri', diff --git a/resources/chatbot/example_config.json b/resources/chatbot/example_config.json deleted file mode 100644 index 7d150e65ae..0000000000 --- a/resources/chatbot/example_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "server" : "irc.freenode.net", - "port" : 6667, - "nick" : "phabot", - "join" : [ - "#phabot-test" - ], - "handlers" : [ - "PhabricatorBotObjectNameHandler", - "PhabricatorBotSymbolHandler", - "PhabricatorBotLogHandler", - "PhabricatorBotFeedNotificationHandler", - "PhabricatorBotWhatsNewHandler", - "PhabricatorBotMacroHandler" - ], - - "conduit.uri" : null, - "conduit.token" : null, - - "macro.size" : 48, - "macro.aspect" : 0.66, - - "notification.channels" : ["#phabot-test"] -} diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index afaccaacf9..2b45c3856a 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -471,6 +471,7 @@ phutil_register_library_map(array( 'DifferentialJIRAIssuesCommitMessageField' => 'applications/differential/field/DifferentialJIRAIssuesCommitMessageField.php', 'DifferentialJIRAIssuesField' => 'applications/differential/customfield/DifferentialJIRAIssuesField.php', 'DifferentialLegacyHunk' => 'applications/differential/storage/DifferentialLegacyHunk.php', + 'DifferentialLegacyQuery' => 'applications/differential/constants/DifferentialLegacyQuery.php', 'DifferentialLineAdjustmentMap' => 'applications/differential/parser/DifferentialLineAdjustmentMap.php', 'DifferentialLintField' => 'applications/differential/customfield/DifferentialLintField.php', 'DifferentialLintStatus' => 'applications/differential/constants/DifferentialLintStatus.php', @@ -1710,6 +1711,7 @@ phutil_register_library_map(array( 'PHUIBadgeExample' => 'applications/uiexample/examples/PHUIBadgeExample.php', 'PHUIBadgeMiniView' => 'view/phui/PHUIBadgeMiniView.php', 'PHUIBadgeView' => 'view/phui/PHUIBadgeView.php', + 'PHUIBigInfoExample' => 'applications/uiexample/examples/PHUIBigInfoExample.php', 'PHUIBigInfoView' => 'view/phui/PHUIBigInfoView.php', 'PHUIBoxExample' => 'applications/uiexample/examples/PHUIBoxExample.php', 'PHUIBoxView' => 'view/phui/PHUIBoxView.php', @@ -1769,7 +1771,7 @@ phutil_register_library_map(array( 'PHUIImageMaskExample' => 'applications/uiexample/examples/PHUIImageMaskExample.php', 'PHUIImageMaskView' => 'view/phui/PHUIImageMaskView.php', 'PHUIInfoExample' => 'applications/uiexample/examples/PHUIInfoExample.php', - 'PHUIInfoView' => 'view/form/PHUIInfoView.php', + 'PHUIInfoView' => 'view/phui/PHUIInfoView.php', 'PHUIInvisibleCharacterTestCase' => 'view/phui/__tests__/PHUIInvisibleCharacterTestCase.php', 'PHUIInvisibleCharacterView' => 'view/phui/PHUIInvisibleCharacterView.php', 'PHUILeftRightExample' => 'applications/uiexample/examples/PHUILeftRightExample.php', @@ -2898,7 +2900,6 @@ phutil_register_library_map(array( 'PhabricatorFilesManagementGenerateKeyWorkflow' => 'applications/files/management/PhabricatorFilesManagementGenerateKeyWorkflow.php', 'PhabricatorFilesManagementIntegrityWorkflow' => 'applications/files/management/PhabricatorFilesManagementIntegrityWorkflow.php', 'PhabricatorFilesManagementMigrateWorkflow' => 'applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php', - 'PhabricatorFilesManagementPurgeWorkflow' => 'applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php', 'PhabricatorFilesManagementRebuildWorkflow' => 'applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php', 'PhabricatorFilesManagementWorkflow' => 'applications/files/management/PhabricatorFilesManagementWorkflow.php', 'PhabricatorFilesOnDiskBuiltinFile' => 'applications/files/builtin/PhabricatorFilesOnDiskBuiltinFile.php', @@ -5446,6 +5447,7 @@ phutil_register_library_map(array( 'DifferentialJIRAIssuesCommitMessageField' => 'DifferentialCommitMessageCustomField', 'DifferentialJIRAIssuesField' => 'DifferentialStoredCustomField', 'DifferentialLegacyHunk' => 'DifferentialHunk', + 'DifferentialLegacyQuery' => 'Phobject', 'DifferentialLineAdjustmentMap' => 'Phobject', 'DifferentialLintField' => 'DifferentialHarbormasterField', 'DifferentialLintStatus' => 'Phobject', @@ -6867,6 +6869,7 @@ phutil_register_library_map(array( 'PHUIBadgeExample' => 'PhabricatorUIExample', 'PHUIBadgeMiniView' => 'AphrontTagView', 'PHUIBadgeView' => 'AphrontTagView', + 'PHUIBigInfoExample' => 'PhabricatorUIExample', 'PHUIBigInfoView' => 'AphrontTagView', 'PHUIBoxExample' => 'PhabricatorUIExample', 'PHUIBoxView' => 'AphrontTagView', @@ -8234,7 +8237,6 @@ phutil_register_library_map(array( 'PhabricatorFilesManagementGenerateKeyWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementIntegrityWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementMigrateWorkflow' => 'PhabricatorFilesManagementWorkflow', - 'PhabricatorFilesManagementPurgeWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementRebuildWorkflow' => 'PhabricatorFilesManagementWorkflow', 'PhabricatorFilesManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorFilesOnDiskBuiltinFile' => 'PhabricatorFilesBuiltinFile', diff --git a/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php b/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php index 39a6c849e1..61f6176f15 100644 --- a/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php +++ b/src/applications/celerity/postprocessor/CelerityDefaultPostprocessor.php @@ -231,6 +231,9 @@ final class CelerityDefaultPostprocessor 'green.button.color' => '#139543', 'green.button.gradient' => 'linear-gradient(to bottom, #23BB5B, #139543)', 'green.button.hover' => 'linear-gradient(to bottom, #23BB5B, #178841)', + 'red.button.color' => '#b33225', + 'red.button.gradient' => 'linear-gradient(to bottom, #d25454, #b33225)', + 'red.button.hover' => 'linear-gradient(to bottom, #d25454, #982115)', 'grey.button.color' => '#F7F7F9', 'grey.button.gradient' => 'linear-gradient(to bottom, #ffffff, #f1f0f1)', 'grey.button.hover' => 'linear-gradient(to bottom, #ffffff, #eeebec)', diff --git a/src/applications/differential/conduit/DifferentialFindConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialFindConduitAPIMethod.php index 92dce067fe..a199f599e8 100644 --- a/src/applications/differential/conduit/DifferentialFindConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialFindConduitAPIMethod.php @@ -52,12 +52,12 @@ final class DifferentialFindConduitAPIMethod switch ($type) { case 'open': $query - ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) + ->withStatus(DifferentialLegacyQuery::STATUS_OPEN) ->withAuthors($guids); break; case 'committable': $query - ->withStatus(DifferentialRevisionQuery::STATUS_ACCEPTED) + ->withStatus(DifferentialLegacyQuery::STATUS_ACCEPTED) ->withAuthors($guids); break; case 'revision-ids': @@ -88,9 +88,7 @@ final class DifferentialFindConduitAPIMethod 'uri' => PhabricatorEnv::getProductionURI('/D'.$id), 'dateCreated' => $revision->getDateCreated(), 'authorPHID' => $revision->getAuthorPHID(), - 'statusName' => - ArcanistDifferentialRevisionStatus::getNameForRevisionStatus( - $revision->getStatus()), + 'statusName' => $revision->getStatusDisplayName(), 'sourcePath' => $diff->getSourcePath(), ); } diff --git a/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php index b05efb5c15..9109849292 100644 --- a/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php @@ -83,9 +83,7 @@ final class DifferentialGetRevisionConduitAPIMethod 'uri' => PhabricatorEnv::getURI('/D'.$revision->getID()), 'title' => $revision->getTitle(), 'status' => $revision->getStatus(), - 'statusName' => - ArcanistDifferentialRevisionStatus::getNameForRevisionStatus( - $revision->getStatus()), + 'statusName' => $revision->getStatusDisplayName(), 'summary' => $revision->getSummary(), 'testPlan' => $revision->getTestPlan(), 'lineCount' => $revision->getLineCount(), diff --git a/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php index 3b88087a67..329a44c857 100644 --- a/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php @@ -25,12 +25,7 @@ final class DifferentialQueryConduitAPIMethod $hash_types = ArcanistDifferentialRevisionHash::getTypes(); $hash_const = $this->formatStringConstants($hash_types); - $status_types = array( - DifferentialRevisionQuery::STATUS_ANY, - DifferentialRevisionQuery::STATUS_OPEN, - DifferentialRevisionQuery::STATUS_ACCEPTED, - DifferentialRevisionQuery::STATUS_CLOSED, - ); + $status_types = DifferentialLegacyQuery::getAllConstants(); $status_const = $this->formatStringConstants($status_types); $order_types = array( @@ -221,9 +216,7 @@ final class DifferentialQueryConduitAPIMethod 'dateModified' => $revision->getDateModified(), 'authorPHID' => $revision->getAuthorPHID(), 'status' => $revision->getStatus(), - 'statusName' => - ArcanistDifferentialRevisionStatus::getNameForRevisionStatus( - $revision->getStatus()), + 'statusName' => $revision->getStatusDisplayName(), 'properties' => $revision->getProperties(), 'branch' => $diff->getBranch(), 'summary' => $revision->getSummary(), diff --git a/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php index 3ad5b07564..d9b0779211 100644 --- a/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php +++ b/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php @@ -69,7 +69,7 @@ final class DifferentialUpdateRevisionConduitAPIMethod throw new ConduitException('ERR_BAD_REVISION'); } - if ($revision->getStatus() == ArcanistDifferentialRevisionStatus::CLOSED) { + if ($revision->isPublished()) { throw new ConduitException('ERR_CLOSED'); } diff --git a/src/applications/differential/constants/DifferentialLegacyQuery.php b/src/applications/differential/constants/DifferentialLegacyQuery.php new file mode 100644 index 0000000000..4a20267f10 --- /dev/null +++ b/src/applications/differential/constants/DifferentialLegacyQuery.php @@ -0,0 +1,86 @@ +getLegacyKey(); + if ($legacy_key !== null) { + $values[] = $legacy_key; + } + } + + return $values; + } + + private static function getMap() { + $all = array( + DifferentialRevisionStatus::NEEDS_REVIEW, + DifferentialRevisionStatus::NEEDS_REVISION, + DifferentialRevisionStatus::CHANGES_PLANNED, + DifferentialRevisionStatus::ACCEPTED, + DifferentialRevisionStatus::PUBLISHED, + DifferentialRevisionStatus::ABANDONED, + ); + + $open = array(); + $closed = array(); + + foreach ($all as $status) { + $status_object = DifferentialRevisionStatus::newForStatus($status); + if ($status_object->isClosedStatus()) { + $closed[] = $status_object->getKey(); + } else { + $open[] = $status_object->getKey(); + } + } + + return array( + self::STATUS_ANY => $all, + self::STATUS_OPEN => $open, + self::STATUS_ACCEPTED => array( + DifferentialRevisionStatus::ACCEPTED, + ), + self::STATUS_NEEDS_REVIEW => array( + DifferentialRevisionStatus::NEEDS_REVIEW, + ), + self::STATUS_NEEDS_REVISION => array( + DifferentialRevisionStatus::NEEDS_REVISION, + ), + self::STATUS_CLOSED => $closed, + self::STATUS_ABANDONED => array( + DifferentialRevisionStatus::ABANDONED, + ), + ); + } + +} diff --git a/src/applications/differential/constants/DifferentialRevisionStatus.php b/src/applications/differential/constants/DifferentialRevisionStatus.php index 38e6a2dd49..37b51f1b3b 100644 --- a/src/applications/differential/constants/DifferentialRevisionStatus.php +++ b/src/applications/differential/constants/DifferentialRevisionStatus.php @@ -1,107 +1,158 @@ - self::COLOR_STATUS_DEFAULT, - ArcanistDifferentialRevisionStatus::NEEDS_REVISION => - self::COLOR_STATUS_RED, - ArcanistDifferentialRevisionStatus::CHANGES_PLANNED => - self::COLOR_STATUS_RED, - ArcanistDifferentialRevisionStatus::ACCEPTED => - self::COLOR_STATUS_GREEN, - ArcanistDifferentialRevisionStatus::CLOSED => - self::COLOR_STATUS_DARK, - ArcanistDifferentialRevisionStatus::ABANDONED => - self::COLOR_STATUS_DARK, - ArcanistDifferentialRevisionStatus::IN_PREPARATION => - self::COLOR_STATUS_BLUE, - ); - return idx($map, $status, $default); + public function getKey() { + return $this->key; } - public static function getRevisionStatusIcon($status) { - $default = 'fa-square-o bluegrey'; - - $map = array( - ArcanistDifferentialRevisionStatus::NEEDS_REVIEW => - 'fa-square-o bluegrey', - ArcanistDifferentialRevisionStatus::NEEDS_REVISION => - 'fa-refresh', - ArcanistDifferentialRevisionStatus::CHANGES_PLANNED => - 'fa-headphones', - ArcanistDifferentialRevisionStatus::ACCEPTED => - 'fa-check', - ArcanistDifferentialRevisionStatus::CLOSED => - 'fa-check-square-o', - ArcanistDifferentialRevisionStatus::ABANDONED => - 'fa-plane', - ArcanistDifferentialRevisionStatus::IN_PREPARATION => - 'fa-question-circle', - ); - return idx($map, $status, $default); + public function getLegacyKey() { + return idx($this->spec, 'legacy'); } - public static function renderFullDescription($status) { - $status_name = - ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($status); - - $tag = id(new PHUITagView()) - ->setName($status_name) - ->setIcon(self::getRevisionStatusIcon($status)) - ->setColor(self::getRevisionStatusColor($status)) - ->setType(PHUITagView::TYPE_SHADE); - - return $tag; + public function getIcon() { + return idx($this->spec, 'icon'); } - public static function getClosedStatuses() { - $statuses = array( - ArcanistDifferentialRevisionStatus::CLOSED, - ArcanistDifferentialRevisionStatus::ABANDONED, - ); + public function getIconColor() { + return idx($this->spec, 'color.icon', 'bluegrey'); + } - if (PhabricatorEnv::getEnvConfig('differential.close-on-accept')) { - $statuses[] = ArcanistDifferentialRevisionStatus::ACCEPTED; + public function getTagColor() { + return idx($this->spec, 'color.tag', 'bluegrey'); + } + + public function getDisplayName() { + return idx($this->spec, 'name'); + } + + public function isClosedStatus() { + return idx($this->spec, 'closed'); + } + + public function isAbandoned() { + return ($this->key === self::ABANDONED); + } + + public function isAccepted() { + return ($this->key === self::ACCEPTED); + } + + public function isNeedsReview() { + return ($this->key === self::NEEDS_REVIEW); + } + + public function isPublished() { + return ($this->key === self::PUBLISHED); + } + + public function isChangePlanned() { + return ($this->key === self::CHANGES_PLANNED); + } + + public static function newForStatus($status) { + $result = new self(); + + $map = self::getMap(); + if (isset($map[$status])) { + $result->key = $status; + $result->spec = $map[$status]; } - return $statuses; + return $result; } - public static function getOpenStatuses() { - return array_diff(self::getAllStatuses(), self::getClosedStatuses()); + public static function newForLegacyStatus($legacy_status) { + $result = new self(); + + $map = self::getMap(); + foreach ($map as $key => $spec) { + if (!isset($spec['legacy'])) { + continue; + } + + if ($spec['legacy'] != $legacy_status) { + continue; + } + + $result->key = $key; + $result->spec = $spec; + break; + } + + return $result; } - public static function getAllStatuses() { + private static function getMap() { + $close_on_accept = PhabricatorEnv::getEnvConfig( + 'differential.close-on-accept'); + return array( - ArcanistDifferentialRevisionStatus::NEEDS_REVIEW, - ArcanistDifferentialRevisionStatus::NEEDS_REVISION, - ArcanistDifferentialRevisionStatus::CHANGES_PLANNED, - ArcanistDifferentialRevisionStatus::ACCEPTED, - ArcanistDifferentialRevisionStatus::CLOSED, - ArcanistDifferentialRevisionStatus::ABANDONED, - ArcanistDifferentialRevisionStatus::IN_PREPARATION, + self::NEEDS_REVIEW => array( + 'name' => pht('Needs Review'), + 'legacy' => 0, + 'icon' => 'fa-code', + 'closed' => false, + 'color.icon' => 'grey', + 'color.tag' => 'bluegrey', + 'color.ansi' => 'magenta', + ), + self::NEEDS_REVISION => array( + 'name' => pht('Needs Revision'), + 'legacy' => 1, + 'icon' => 'fa-refresh', + 'closed' => false, + 'color.icon' => 'red', + 'color.tag' => 'red', + 'color.ansi' => 'red', + ), + self::CHANGES_PLANNED => array( + 'name' => pht('Changes Planned'), + 'legacy' => 5, + 'icon' => 'fa-headphones', + 'closed' => false, + 'color.icon' => 'red', + 'color.tag' => 'red', + 'color.ansi' => 'red', + ), + self::ACCEPTED => array( + 'name' => pht('Accepted'), + 'legacy' => 2, + 'icon' => 'fa-check', + 'closed' => $close_on_accept, + 'color.icon' => 'green', + 'color.tag' => 'green', + 'color.ansi' => 'green', + ), + self::PUBLISHED => array( + 'name' => pht('Closed'), + 'legacy' => 3, + 'icon' => 'fa-check-square-o', + 'closed' => true, + 'color.icon' => 'black', + 'color.tag' => 'indigo', + 'color.ansi' => 'cyan', + ), + self::ABANDONED => array( + 'name' => pht('Abandoned'), + 'legacy' => 4, + 'icon' => 'fa-plane', + 'closed' => true, + 'color.icon' => 'black', + 'color.tag' => 'indigo', + 'color.ansi' => null, + ), ); } - public static function isClosedStatus($status) { - return in_array($status, self::getClosedStatuses()); - } - } diff --git a/src/applications/differential/controller/DifferentialDiffViewController.php b/src/applications/differential/controller/DifferentialDiffViewController.php index dae65bb200..488d2cec82 100644 --- a/src/applications/differential/controller/DifferentialDiffViewController.php +++ b/src/applications/differential/controller/DifferentialDiffViewController.php @@ -177,7 +177,7 @@ final class DifferentialDiffViewController extends DifferentialController { $revisions = id(new DifferentialRevisionQuery()) ->setViewer($viewer) ->withAuthors(array($viewer->getPHID())) - ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) + ->withStatus(DifferentialLegacyQuery::STATUS_OPEN) ->requireCapabilities( array( PhabricatorPolicyCapability::CAN_VIEW, diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index ab03ee6d81..81b2aebda6 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -508,11 +508,13 @@ final class DifferentialRevisionViewController extends DifferentialController { ->setPolicyObject($revision) ->setHeaderIcon('fa-cog'); - $status = $revision->getStatus(); - $status_name = - DifferentialRevisionStatus::renderFullDescription($status); + $status_tag = id(new PHUITagView()) + ->setName($revision->getStatusDisplayName()) + ->setIcon($revision->getStatusIcon()) + ->setColor($revision->getStatusIconColor()) + ->setType(PHUITagView::TYPE_SHADE); - $view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_name); + $view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_tag); return $view; } @@ -806,7 +808,7 @@ final class DifferentialRevisionViewController extends DifferentialController { $query = id(new DifferentialRevisionQuery()) ->setViewer($this->getRequest()->getUser()) - ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) + ->withStatus(DifferentialLegacyQuery::STATUS_OPEN) ->withUpdatedEpochBetween($recent, null) ->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED) ->setLimit(10) diff --git a/src/applications/differential/customfield/DifferentialBranchField.php b/src/applications/differential/customfield/DifferentialBranchField.php index 16be0ce0c9..2387e3cd3f 100644 --- a/src/applications/differential/customfield/DifferentialBranchField.php +++ b/src/applications/differential/customfield/DifferentialBranchField.php @@ -76,16 +76,17 @@ final class DifferentialBranchField PhabricatorApplicationTransactionEditor $editor, array $xactions) { - $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; + $revision = $this->getObject(); // Show the "BRANCH" section only if there's a new diff or the revision // is "Accepted". - if ((!$editor->getDiffUpdateTransaction($xactions)) && - ($this->getObject()->getStatus() != $status_accepted)) { + $is_update = (bool)$editor->getDiffUpdateTransaction($xactions); + $is_accepted = $revision->isAccepted(); + if (!$is_update && !$is_accepted) { return; } - $branch = $this->getBranchDescription($this->getObject()->getActiveDiff()); + $branch = $this->getBranchDescription($revision->getActiveDiff()); if ($branch === null) { return; } diff --git a/src/applications/differential/customfield/DifferentialReviewersField.php b/src/applications/differential/customfield/DifferentialReviewersField.php index 7633bfb492..f835854e2f 100644 --- a/src/applications/differential/customfield/DifferentialReviewersField.php +++ b/src/applications/differential/customfield/DifferentialReviewersField.php @@ -68,8 +68,7 @@ final class DifferentialReviewersField public function getWarningsForRevisionHeader(array $handles) { $revision = $this->getObject(); - $status_needs_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; - if ($revision->getStatus() != $status_needs_review) { + if (!$revision->isNeedsReview()) { return array(); } diff --git a/src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php b/src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php index 9583486c98..59223f20da 100644 --- a/src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php +++ b/src/applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php @@ -35,8 +35,7 @@ final class DifferentialDoorkeeperRevisionFeedStoryPublisher } public function getActiveUserPHIDs($object) { - $status = $object->getStatus(); - if ($status == ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) { + if ($object->isNeedsReview()) { return $object->getReviewerPHIDs(); } else { return array(); @@ -44,8 +43,7 @@ final class DifferentialDoorkeeperRevisionFeedStoryPublisher } public function getPassiveUserPHIDs($object) { - $status = $object->getStatus(); - if ($status == ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) { + if ($object->isNeedsReview()) { return array(); } else { return $object->getReviewerPHIDs(); diff --git a/src/applications/differential/phid/DifferentialRevisionPHIDType.php b/src/applications/differential/phid/DifferentialRevisionPHIDType.php index 5a6cf701ae..d652a8c056 100644 --- a/src/applications/differential/phid/DifferentialRevisionPHIDType.php +++ b/src/applications/differential/phid/DifferentialRevisionPHIDType.php @@ -48,10 +48,9 @@ final class DifferentialRevisionPHIDType extends PhabricatorPHIDType { $status = $revision->getStatus(); - $icon = DifferentialRevisionStatus::getRevisionStatusIcon($status); - $color = DifferentialRevisionStatus::getRevisionStatusColor($status); - $name = ArcanistDifferentialRevisionStatus::getNameForRevisionStatus( - $status); + $icon = $revision->getStatusIcon($status); + $color = $revision->getStatusIconColor($status); + $name = $revision->getStatusDisplayName(); $handle ->setStateIcon($icon) diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php index 701463e6a7..f53ec46a9f 100644 --- a/src/applications/differential/query/DifferentialRevisionQuery.php +++ b/src/applications/differential/query/DifferentialRevisionQuery.php @@ -1,13 +1,6 @@ withStatus(DifferentialRevisionQuery::STATUS_OPEN) - * ->execute(); - * * @task config Query Configuration * @task exec Query Execution * @task internal Internals @@ -18,13 +11,6 @@ final class DifferentialRevisionQuery private $pathIDs = array(); private $status = 'status-any'; - const STATUS_ANY = 'status-any'; - const STATUS_OPEN = 'status-open'; - const STATUS_ACCEPTED = 'status-accepted'; - const STATUS_NEEDS_REVIEW = 'status-needs-review'; - const STATUS_NEEDS_REVISION = 'status-needs-revision'; - const STATUS_CLOSED = 'status-closed'; - const STATUS_ABANDONED = 'status-abandoned'; private $authors = array(); private $draftAuthors = array(); @@ -149,7 +135,7 @@ final class DifferentialRevisionQuery /** * Filter results to revisions with a given status. Provide a class constant, - * such as `DifferentialRevisionQuery::STATUS_OPEN`. + * such as `DifferentialLegacyQuery::STATUS_OPEN`. * * @param const Class STATUS constant, like STATUS_OPEN. * @return this @@ -711,57 +697,12 @@ final class DifferentialRevisionQuery // NOTE: Although the status constants are integers in PHP, the column is a // string column in MySQL, and MySQL won't use keys on string columns if // you put integers in the query. - - switch ($this->status) { - case self::STATUS_ANY: - break; - case self::STATUS_OPEN: - $where[] = qsprintf( - $conn_r, - 'r.status IN (%Ls)', - DifferentialRevisionStatus::getOpenStatuses()); - break; - case self::STATUS_NEEDS_REVIEW: - $where[] = qsprintf( - $conn_r, - 'r.status IN (%Ls)', - array( - ArcanistDifferentialRevisionStatus::NEEDS_REVIEW, - )); - break; - case self::STATUS_NEEDS_REVISION: - $where[] = qsprintf( - $conn_r, - 'r.status IN (%Ls)', - array( - ArcanistDifferentialRevisionStatus::NEEDS_REVISION, - )); - break; - case self::STATUS_ACCEPTED: - $where[] = qsprintf( - $conn_r, - 'r.status IN (%Ls)', - array( - ArcanistDifferentialRevisionStatus::ACCEPTED, - )); - break; - case self::STATUS_CLOSED: - $where[] = qsprintf( - $conn_r, - 'r.status IN (%Ls)', - DifferentialRevisionStatus::getClosedStatuses()); - break; - case self::STATUS_ABANDONED: - $where[] = qsprintf( - $conn_r, - 'r.status IN (%Ls)', - array( - ArcanistDifferentialRevisionStatus::ABANDONED, - )); - break; - default: - throw new Exception( - pht("Unknown revision status filter constant '%s'!", $this->status)); + $statuses = DifferentialLegacyQuery::getQueryValues($this->status); + if ($statuses !== null) { + $where[] = qsprintf( + $conn_r, + 'r.status IN (%Ls)', + $statuses); } $where[] = $this->buildWhereClauseParts($conn_r); diff --git a/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php b/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php index 6d83d97a47..3e6daa6317 100644 --- a/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php +++ b/src/applications/differential/query/DifferentialRevisionRequiredActionResultBucket.php @@ -134,13 +134,11 @@ final class DifferentialRevisionRequiredActionResultBucket } private function filterShouldLand(array $phids) { - $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; - $objects = $this->getRevisionsAuthored($this->objects, $phids); $results = array(); foreach ($objects as $key => $object) { - if ($object->getStatus() != $status_accepted) { + if (!$object->isAccepted()) { continue; } @@ -175,13 +173,11 @@ final class DifferentialRevisionRequiredActionResultBucket } private function filterWaitingForReview(array $phids) { - $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; - $objects = $this->getRevisionsAuthored($this->objects, $phids); $results = array(); foreach ($objects as $key => $object) { - if ($object->getStatus() != $status_review) { + if (!$object->isNeedsReview()) { continue; } @@ -217,16 +213,11 @@ final class DifferentialRevisionRequiredActionResultBucket } private function filterWaitingOnOtherReviewers(array $phids) { - $statuses = array( - ArcanistDifferentialRevisionStatus::NEEDS_REVIEW, - ); - $statuses = array_fuse($statuses); - $objects = $this->getRevisionsNotAuthored($this->objects, $phids); $results = array(); foreach ($objects as $key => $object) { - if (!isset($statuses[$object->getStatus()])) { + if (!$object->isNeedsReview()) { continue; } diff --git a/src/applications/differential/query/DifferentialRevisionResultBucket.php b/src/applications/differential/query/DifferentialRevisionResultBucket.php index 762e2d97f4..54705649eb 100644 --- a/src/applications/differential/query/DifferentialRevisionResultBucket.php +++ b/src/applications/differential/query/DifferentialRevisionResultBucket.php @@ -15,9 +15,8 @@ abstract class DifferentialRevisionResultBucket $objects = $this->getRevisionsNotAuthored($objects, $phids); - $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; foreach ($objects as $key => $object) { - if ($object->getStatus() != $status_review) { + if (!$object->isNeedsReview()) { continue; } diff --git a/src/applications/differential/query/DifferentialRevisionSearchEngine.php b/src/applications/differential/query/DifferentialRevisionSearchEngine.php index 4248119cb9..8cb8ffd2fb 100644 --- a/src/applications/differential/query/DifferentialRevisionSearchEngine.php +++ b/src/applications/differential/query/DifferentialRevisionSearchEngine.php @@ -115,7 +115,7 @@ final class DifferentialRevisionSearchEngine return $query ->setParameter('responsiblePHIDs', array($viewer->getPHID())) - ->setParameter('status', DifferentialRevisionQuery::STATUS_OPEN) + ->setParameter('status', DifferentialLegacyQuery::STATUS_OPEN) ->setParameter('bucket', $bucket_key); case 'authored': return $query @@ -129,13 +129,13 @@ final class DifferentialRevisionSearchEngine private function getStatusOptions() { return array( - DifferentialRevisionQuery::STATUS_ANY => pht('All'), - DifferentialRevisionQuery::STATUS_OPEN => pht('Open'), - DifferentialRevisionQuery::STATUS_ACCEPTED => pht('Accepted'), - DifferentialRevisionQuery::STATUS_NEEDS_REVIEW => pht('Needs Review'), - DifferentialRevisionQuery::STATUS_NEEDS_REVISION => pht('Needs Revision'), - DifferentialRevisionQuery::STATUS_CLOSED => pht('Closed'), - DifferentialRevisionQuery::STATUS_ABANDONED => pht('Abandoned'), + DifferentialLegacyQuery::STATUS_ANY => pht('All'), + DifferentialLegacyQuery::STATUS_OPEN => pht('Open'), + DifferentialLegacyQuery::STATUS_ACCEPTED => pht('Accepted'), + DifferentialLegacyQuery::STATUS_NEEDS_REVIEW => pht('Needs Review'), + DifferentialLegacyQuery::STATUS_NEEDS_REVISION => pht('Needs Revision'), + DifferentialLegacyQuery::STATUS_CLOSED => pht('Closed'), + DifferentialLegacyQuery::STATUS_ABANDONED => pht('Abandoned'), ); } @@ -235,11 +235,9 @@ final class DifferentialRevisionSearchEngine } private function loadUnlandedDependencies(array $revisions) { - $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; - $phids = array(); foreach ($revisions as $revision) { - if ($revision->getStatus() != $status_accepted) { + if (!$revision->isAccepted()) { continue; } @@ -269,7 +267,7 @@ final class DifferentialRevisionSearchEngine $blocking_revisions = id(new DifferentialRevisionQuery()) ->setViewer($viewer) ->withPHIDs($revision_phids) - ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) + ->withStatus(DifferentialLegacyQuery::STATUS_OPEN) ->execute(); $blocking_revisions = mpull($blocking_revisions, null, 'getPHID'); diff --git a/src/applications/differential/search/DifferentialRevisionFulltextEngine.php b/src/applications/differential/search/DifferentialRevisionFulltextEngine.php index 45639edbbe..cdb9f1a86d 100644 --- a/src/applications/differential/search/DifferentialRevisionFulltextEngine.php +++ b/src/applications/differential/search/DifferentialRevisionFulltextEngine.php @@ -34,8 +34,7 @@ final class DifferentialRevisionFulltextEngine // If a revision needs review, the owners are the reviewers. Otherwise, the // owner is the author (e.g., accepted, rejected, closed). - $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; - if ($revision->getStatus() == $status_review) { + if ($revision->isNeedsReview()) { $reviewers = $revision->getReviewerPHIDs(); $reviewers = array_fuse($reviewers); diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php index 0e968dccf4..a6ce99080a 100644 --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -523,7 +523,6 @@ final class DifferentialRevision extends DifferentialDAO switch ($capability) { case PhabricatorPolicyCapability::CAN_VIEW: - $description[] = pht("A revision's reviewers can always view it."); $description[] = pht( 'If a revision belongs to a repository, other users must be able '. 'to view the repository in order to view the revision.'); @@ -614,42 +613,44 @@ final class DifferentialRevision extends DifferentialDAO } public function isClosed() { - return DifferentialRevisionStatus::isClosedStatus($this->getStatus()); + return $this->getStatusObject()->isClosedStatus(); } public function isAbandoned() { - $status_abandoned = ArcanistDifferentialRevisionStatus::ABANDONED; - return ($this->getStatus() == $status_abandoned); + return $this->getStatusObject()->isAbandoned(); } public function isAccepted() { - $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; - return ($this->getStatus() == $status_accepted); + return $this->getStatusObject()->isAccepted(); + } + + public function isNeedsReview() { + return $this->getStatusObject()->isNeedsReview(); + } + + public function isChangePlanned() { + return $this->getStatusObject()->isChangePlanned(); + } + + public function isPublished() { + return $this->getStatusObject()->isPublished(); } public function getStatusIcon() { - $map = array( - ArcanistDifferentialRevisionStatus::NEEDS_REVIEW - => 'fa-code grey', - ArcanistDifferentialRevisionStatus::NEEDS_REVISION - => 'fa-refresh red', - ArcanistDifferentialRevisionStatus::CHANGES_PLANNED - => 'fa-headphones red', - ArcanistDifferentialRevisionStatus::ACCEPTED - => 'fa-check green', - ArcanistDifferentialRevisionStatus::CLOSED - => 'fa-check-square-o black', - ArcanistDifferentialRevisionStatus::ABANDONED - => 'fa-plane black', - ); - - return idx($map, $this->getStatus()); + return $this->getStatusObject()->getIcon(); } public function getStatusDisplayName() { + return $this->getStatusObject()->getDisplayName(); + } + + public function getStatusIconColor() { + return $this->getStatusObject()->getIconColor(); + } + + public function getStatusObject() { $status = $this->getStatus(); - return ArcanistDifferentialRevisionStatus::getNameForRevisionStatus( - $status); + return DifferentialRevisionStatus::newForLegacyStatus($status); } public function getFlag(PhabricatorUser $viewer) { diff --git a/src/applications/differential/view/DifferentialReviewersView.php b/src/applications/differential/view/DifferentialReviewersView.php index 034bf99edb..3fcb1c0ccf 100644 --- a/src/applications/differential/view/DifferentialReviewersView.php +++ b/src/applications/differential/view/DifferentialReviewersView.php @@ -116,7 +116,7 @@ final class DifferentialReviewersView extends AphrontView { } } else { $icon = 'fa-times-circle-o'; - $color = 'bluegrey'; + $color = 'red'; if ($authority_name !== null) { $label = pht( 'Requested Changes to Prior Diff (by %s)', @@ -158,7 +158,6 @@ final class DifferentialReviewersView extends AphrontView { private function isCurrent($action_phid) { if (!$this->diff) { - echo "A\n"; return true; } diff --git a/src/applications/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php index 5373192b31..ed97435746 100644 --- a/src/applications/differential/view/DifferentialRevisionListView.php +++ b/src/applications/differential/view/DifferentialRevisionListView.php @@ -145,8 +145,11 @@ final class DifferentialRevisionListView extends AphrontView { $item->setDisabled(true); } + $icon = $revision->getStatusIcon(); + $color = $revision->getStatusIconColor(); + $item->setStatusIcon( - $revision->getStatusIcon(), + "{$icon} {$color}", $revision->getStatusDisplayName()); $list->addItem($item); diff --git a/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php b/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php index e7cdaa2455..58152bdb67 100644 --- a/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php +++ b/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php @@ -56,9 +56,7 @@ final class DifferentialRevisionPlanChangesTransaction } protected function validateAction($object, PhabricatorUser $viewer) { - $status_planned = ArcanistDifferentialRevisionStatus::CHANGES_PLANNED; - - if ($object->getStatus() == $status_planned) { + if ($object->isChangePlanned()) { throw new Exception( pht( 'You can not request review of this revision because this '. diff --git a/src/applications/differential/xaction/DifferentialRevisionReopenTransaction.php b/src/applications/differential/xaction/DifferentialRevisionReopenTransaction.php index 84015b9286..e2b217603a 100644 --- a/src/applications/differential/xaction/DifferentialRevisionReopenTransaction.php +++ b/src/applications/differential/xaction/DifferentialRevisionReopenTransaction.php @@ -39,10 +39,7 @@ final class DifferentialRevisionReopenTransaction } protected function validateAction($object, PhabricatorUser $viewer) { - // Note that we're testing for "Closed", exactly, not just any closed - // status. - $status_closed = ArcanistDifferentialRevisionStatus::CLOSED; - if ($object->getStatus() != $status_closed) { + if ($object->isPublished()) { throw new Exception( pht( 'You can not reopen this revision because it is not closed. '. diff --git a/src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php b/src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php index 32fcb3271e..65b96d6d8e 100644 --- a/src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php +++ b/src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php @@ -37,8 +37,7 @@ final class DifferentialRevisionRequestReviewTransaction } protected function validateAction($object, PhabricatorUser $viewer) { - $status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW; - if ($object->getStatus() == $status_review) { + if ($object->isNeedsReview()) { throw new Exception( pht( 'You can not request review of this revision because this '. diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php index 06c8336f5c..32381207fa 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseController.php @@ -1758,7 +1758,7 @@ final class DiffusionBrowseController extends DiffusionController { $revisions = id(new DifferentialRevisionQuery()) ->setViewer($viewer) ->withPath($repository->getID(), $path_id) - ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) + ->withStatus(DifferentialLegacyQuery::STATUS_OPEN) ->withUpdatedEpochBetween($recent, null) ->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED) ->setLimit(10) diff --git a/src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php b/src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php index e6256989b5..cd4e3148c7 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryProfilePictureController.php @@ -109,6 +109,9 @@ final class DiffusionRepositoryProfilePictureController } $builtins = array( + 'repo/repo-git.png', + 'repo/repo-svn.png', + 'repo/repo-hg.png', 'repo/building.png', 'repo/cloud.png', 'repo/commit.png', diff --git a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php index aa2bb49ccb..a735b8d580 100644 --- a/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php +++ b/src/applications/diffusion/management/DiffusionRepositoryBranchesManagementPanel.php @@ -67,6 +67,7 @@ final class DiffusionRepositoryBranchesManagementPanel public function buildManagementPanelContent() { $repository = $this->getRepository(); $viewer = $this->getViewer(); + $content = array(); $view = id(new PHUIPropertyListView()) ->setViewer($viewer); @@ -90,8 +91,66 @@ final class DiffusionRepositoryBranchesManagementPanel } $view->addProperty(pht('Autoclose Only'), $autoclose_only); + $content[] = $this->newBox(pht('Branches'), $view); - return $this->newBox(pht('Branches'), $view); + // Branch Autoclose Table + if (!$repository->isImporting()) { + $request = $this->getRequest(); + $pager = id(new PHUIPagerView()) + ->readFromRequest($request); + + $params = array( + 'offset' => $pager->getOffset(), + 'limit' => $pager->getPageSize() + 1, + 'repository' => $repository->getID(), + ); + + $branches = id(new ConduitCall('diffusion.branchquery', $params)) + ->setUser($viewer) + ->execute(); + $branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches); + $branches = $pager->sliceResults($branches); + + $rows = array(); + foreach ($branches as $branch) { + $branch_name = $branch->getShortName(); + $tracking = $repository->shouldTrackBranch($branch_name); + $autoclosing = $repository->shouldAutocloseBranch($branch_name); + + $rows[] = array( + $branch_name, + $tracking ? pht('Tracking') : pht('Off'), + $autoclosing ? pht('Autoclose On') : pht('Off'), + ); + } + $branch_table = new AphrontTableView($rows); + $branch_table->setHeaders( + array( + pht('Branch'), + pht('Track'), + pht('Autoclose'), + )); + $branch_table->setColumnClasses( + array( + 'pri', + 'narrow', + 'wide', + )); + + $box = id(new PHUIObjectBoxView()) + ->setHeaderText(pht('Branch Status')) + ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY) + ->setTable($branch_table) + ->setPager($pager); + $content[] = $box; + } else { + $content[] = id(new PHUIInfoView()) + ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) + ->appendChild(pht('Branch status in unavailable while the repository '. + 'is still importing.')); + } + + return $content; } } diff --git a/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php b/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php index 0098fe1df9..f9e76eb523 100644 --- a/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php +++ b/src/applications/diffusion/management/DiffusionRepositoryManagementPanel.php @@ -25,6 +25,10 @@ abstract class DiffusionRepositoryManagementPanel return $this->repository; } + final public function getRequest() { + return $this->controller->getRequest(); + } + final public function setController(PhabricatorController $controller) { $this->controller = $controller; return $this; diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php index ab8f5e3e2e..a0548d5178 100644 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitFieldsQuery.php @@ -122,9 +122,8 @@ final class DiffusionLowLevelCommitFieldsQuery $revisions = array_reverse($revisions); // Try to find an accepted revision first. - $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; foreach ($revisions as $revision) { - if ($revision->getStatus() == $status_accepted) { + if ($revision->isAccepted()) { return $revision; } } diff --git a/src/applications/drydock/operation/DrydockLandRepositoryOperation.php b/src/applications/drydock/operation/DrydockLandRepositoryOperation.php index 4e306772a3..1ccc82eb7b 100644 --- a/src/applications/drydock/operation/DrydockLandRepositoryOperation.php +++ b/src/applications/drydock/operation/DrydockLandRepositoryOperation.php @@ -289,31 +289,30 @@ final class DrydockLandRepositoryOperation ); } - $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; - if ($revision->getStatus() != $status_accepted) { - switch ($revision->getStatus()) { - case ArcanistDifferentialRevisionStatus::CLOSED: - return array( - 'title' => pht('Revision Closed'), - 'body' => pht( - 'This revision has already been closed. Only open, accepted '. - 'revisions may land.'), - ); - case ArcanistDifferentialRevisionStatus::ABANDONED: - return array( - 'title' => pht('Revision Abandoned'), - 'body' => pht( - 'This revision has been abandoned. Only accepted revisions '. - 'may land.'), - ); - default: - return array( - 'title' => pht('Revision Not Accepted'), - 'body' => pht( - 'This revision is still under review. Only revisions which '. - 'have been accepted may land.'), - ); - } + if ($revision->isAccepted()) { + // We can land accepted revisions, so continue below. Otherwise, raise + // an error with tailored messaging for the most common cases. + } else if ($revision->isAbandoned()) { + return array( + 'title' => pht('Revision Abandoned'), + 'body' => pht( + 'This revision has been abandoned. Only accepted revisions '. + 'may land.'), + ); + } else if ($revision->isClosed()) { + return array( + 'title' => pht('Revision Closed'), + 'body' => pht( + 'This revision has already been closed. Only open, accepted '. + 'revisions may land.'), + ); + } else { + return array( + 'title' => pht('Revision Not Accepted'), + 'body' => pht( + 'This revision is still under review. Only revisions which '. + 'have been accepted may land.'), + ); } // Check for other operations. Eventually this should probably be more diff --git a/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php deleted file mode 100644 index bf2c04a584..0000000000 --- a/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php +++ /dev/null @@ -1,71 +0,0 @@ -setName('purge') - ->setSynopsis(pht('Delete files with missing data.')) - ->setArguments( - array( - array( - 'name' => 'all', - 'help' => pht('Update all files.'), - ), - array( - 'name' => 'dry-run', - 'help' => pht('Show what would be updated.'), - ), - array( - 'name' => 'names', - 'wildcard' => true, - ), - )); - } - - public function execute(PhutilArgumentParser $args) { - $console = PhutilConsole::getConsole(); - - $iterator = $this->buildIterator($args); - if (!$iterator) { - throw new PhutilArgumentUsageException( - pht( - 'Either specify a list of files to purge, or use `%s` '. - 'to purge all files.', - '--all')); - } - - $is_dry_run = $args->getArg('dry-run'); - - foreach ($iterator as $file) { - $fid = 'F'.$file->getID(); - - try { - $file->loadFileData(); - $okay = true; - } catch (Exception $ex) { - $okay = false; - } - - if ($okay) { - $console->writeOut( - "%s\n", - pht('%s: File data is OK, not purging.', $fid)); - } else { - if ($is_dry_run) { - $console->writeOut( - "%s\n", - pht('%s: Would purge (dry run).', $fid)); - } else { - $console->writeOut( - "%s\n", - pht('%s: Purging.', $fid)); - $file->delete(); - } - } - } - - return 0; - } -} diff --git a/src/applications/passphrase/view/PassphraseCredentialControl.php b/src/applications/passphrase/view/PassphraseCredentialControl.php index 411afd6f85..1c189e30e7 100644 --- a/src/applications/passphrase/view/PassphraseCredentialControl.php +++ b/src/applications/passphrase/view/PassphraseCredentialControl.php @@ -113,11 +113,12 @@ final class PassphraseCredentialControl extends AphrontFormControl { 'a', array( 'href' => '#', - 'class' => 'button button-grey', + 'class' => 'button button-grey mll', 'sigil' => 'passphrase-credential-add', 'mustcapture' => true, + 'style' => 'height: 20px;', // move aphront-form to tables ), - pht('Add Credential')); + pht('Add New Credential')); } else { $button = null; } diff --git a/src/applications/phortune/controller/payment/PhortunePaymentMethodCreateController.php b/src/applications/phortune/controller/payment/PhortunePaymentMethodCreateController.php index 794f97aa8e..87bddd4d33 100644 --- a/src/applications/phortune/controller/payment/PhortunePaymentMethodCreateController.php +++ b/src/applications/phortune/controller/payment/PhortunePaymentMethodCreateController.php @@ -123,7 +123,8 @@ final class PhortunePaymentMethodCreateController $next_uri = $this->getApplicationURI( "cart/{$cart_id}/checkout/?paymentMethodID=".$method->getID()); } else if ($subscription_id) { - $next_uri = $cancel_uri; + $next_uri = new PhutilURI($cancel_uri); + $next_uri->setQueryParam('added', true); } else { $account_uri = $this->getApplicationURI($account->getID().'/'); $next_uri = new PhutilURI($account_uri); diff --git a/src/applications/phortune/controller/payment/PhortunePaymentMethodDisableController.php b/src/applications/phortune/controller/payment/PhortunePaymentMethodDisableController.php index d00db2725f..f5feec8a29 100644 --- a/src/applications/phortune/controller/payment/PhortunePaymentMethodDisableController.php +++ b/src/applications/phortune/controller/payment/PhortunePaymentMethodDisableController.php @@ -25,11 +25,12 @@ final class PhortunePaymentMethodDisableController } $account = $method->getAccount(); - $account_uri = $this->getApplicationURI($account->getID().'/'); + $account_id = $account->getID(); + $account_uri = $this->getApplicationURI("/account/billing/{$account_id}/"); if ($request->isFormPost()) { - // TODO: ApplicationTransactions! + // TODO: ApplicationTransactions!!!! $method ->setStatus(PhortunePaymentMethod::STATUS_DISABLED) ->save(); diff --git a/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php b/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php index 185bbdbcc6..e7287f3d29 100644 --- a/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php +++ b/src/applications/phortune/controller/subscription/PhortuneSubscriptionEditController.php @@ -4,6 +4,7 @@ final class PhortuneSubscriptionEditController extends PhortuneController { public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); + $added = $request->getBool('added'); $subscription = id(new PhortuneSubscriptionQuery()) ->setViewer($viewer) @@ -112,6 +113,7 @@ final class PhortuneSubscriptionEditController extends PhortuneController { pht('Subscription %d', $subscription->getID()), $view_uri); $crumbs->addTextCrumb(pht('Edit')); + $crumbs->setBorder(true); $uri = $this->getApplicationURI($account->getID().'/card/new/'); @@ -127,15 +129,19 @@ final class PhortuneSubscriptionEditController extends PhortuneController { ), pht('Add Payment Method...')); + $radio = id(new AphrontFormRadioButtonControl()) + ->setName('defaultPaymentMethodPHID') + ->setLabel(pht('Autopay With')) + ->setValue($current_phid) + ->setError($e_method); + + foreach ($options as $key => $value) { + $radio->addButton($key, $value, null); + } + $form = id(new AphrontFormView()) ->setUser($viewer) - ->appendChild( - id(new AphrontFormSelectControl()) - ->setName('defaultPaymentMethodPHID') - ->setLabel(pht('Autopay With')) - ->setValue($current_phid) - ->setError($e_method) - ->setOptions($options)) + ->appendChild($radio) ->appendChild( id(new AphrontFormMarkupControl()) ->setValue($add_method_button)) @@ -151,6 +157,13 @@ final class PhortuneSubscriptionEditController extends PhortuneController { ->setFormErrors($errors) ->appendChild($form); + if ($added) { + $info_view = id(new PHUIInfoView()) + ->setSeverity(PHUIInfoView::SEVERITY_SUCCESS) + ->appendChild(pht('Payment method has been successfully added.')); + $box->setInfoView($info_view); + } + $header = id(new PHUIHeaderView()) ->setHeader(pht('Edit %s', $subscription->getSubscriptionName())) ->setHeaderIcon('fa-pencil'); diff --git a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php index bdb63e6c9c..dd67f5bc59 100644 --- a/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php +++ b/src/applications/releeph/differential/DifferentialReleephRequestFieldSpecification.php @@ -79,8 +79,7 @@ final class DifferentialReleephRequestFieldSpecification extends Phobject { return null; } - $status = $this->getRevision()->getStatus(); - if ($status == ArcanistDifferentialRevisionStatus::CLOSED) { + if ($this->getRevision()->isClosed()) { $verb = $tense[$this->releephAction]['past']; } else { $verb = $tense[$this->releephAction]['future']; diff --git a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php index f7e3a735a4..ab11a83b38 100644 --- a/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php +++ b/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php @@ -203,10 +203,7 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker $revision->getID(), $commit->getPHID()); - $status_closed = ArcanistDifferentialRevisionStatus::CLOSED; - $should_close = ($revision->getStatus() != $status_closed) && - $should_autoclose; - + $should_close = !$revision->isPublished() && $should_autoclose; if ($should_close) { $commit_close_xaction = id(new DifferentialTransaction()) ->setTransactionType(DifferentialTransaction::TYPE_ACTION) diff --git a/src/applications/uiexample/examples/PHUIBigInfoExample.php b/src/applications/uiexample/examples/PHUIBigInfoExample.php new file mode 100644 index 0000000000..519cdba88e --- /dev/null +++ b/src/applications/uiexample/examples/PHUIBigInfoExample.php @@ -0,0 +1,48 @@ +getRequest(); + $viewer = $request->getUser(); + + $image = PhabricatorFile::loadBuiltin($viewer, + 'projects/v3/rocket.png'); + + $button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Launch Away')) + ->setColor(PHUIButtonView::GREEN) + ->setHref('#'); + + $views = array(); + $views[] = id(new PHUIBigInfoView()) + ->setTitle(pht('Simply Slim')) + ->setDescription(pht('A simple description')) + ->addAction($button); + + $views[] = id(new PHUIBigInfoView()) + ->setTitle(pht('Basicly Basic')) + ->setIcon('fa-rocket') + ->setDescription(pht('A more basic description')) + ->addAction($button); + + $views[] = id(new PHUIBigInfoView()) + ->setTitle(pht('A Modern Example')) + ->setImage($image->getBestURI()) + ->setDescription(pht('A modern description with lots of frills.')) + ->addAction($button); + + + return phutil_tag_div('ml', $views); + } +} diff --git a/src/applications/uiexample/examples/PHUIButtonExample.php b/src/applications/uiexample/examples/PHUIButtonExample.php index a5ece198fd..c7107250ff 100644 --- a/src/applications/uiexample/examples/PHUIButtonExample.php +++ b/src/applications/uiexample/examples/PHUIButtonExample.php @@ -20,6 +20,7 @@ final class PHUIButtonExample extends PhabricatorUIExample { $colors = array( null, PHUIButtonView::GREEN, + PHUIButtonView::RED, PHUIButtonView::GREY, ); $sizes = array(null, PHUIButtonView::SMALL); diff --git a/src/docs/user/userguide/diffusion_autoclose.diviner b/src/docs/user/userguide/diffusion_autoclose.diviner index f2533bbdc6..796a3b0404 100644 --- a/src/docs/user/userguide/diffusion_autoclose.diviner +++ b/src/docs/user/userguide/diffusion_autoclose.diviner @@ -17,21 +17,19 @@ troubleshoot it. Troubleshooting Autoclose ========================= -You can check if a branch is currently configured to autoclose on the main -repository view, or in the branches list view. Hover over the {icon check} or -{icon times} icon and you should see one of these messages: +You can check if a branch is currently configured to autoclose on the +management page for the given repository under the branches menu item. +You should see one of these statuses next to the name of the branch: - - {icon check} **Autoclose Enabled** Autoclose is active for this branch. - - {icon times} **Repository Importing** This repository is still importing. + - **Autoclose On** Autoclose is active for this branch. + - **Repository Importing** This repository is still importing. Autoclose does not activate until a repository finishes importing for the first time. This prevents situations where you import a repository and accidentally close hundreds of related objects during import. Autoclose will activate for new commits after the initial import completes. - - {icon times} **Repository Autoclose Disabled** Autoclose is disabled for - this entire repository. You can enable it in **Edit Repository**. - - {icon times} **Branch Untracked** This branch is not tracked. Because it + - **Tracking Off** This branch is not tracked. Because it is not tracked, commits on it won't be seen and won't be discovered. - - {icon times} **Branch Autoclose Disabled** Autoclose is not enabled for + - **Autoclose Off** Autoclose is not enabled for this branch. You can adjust which branches autoclose in **Edit Repository**. This option is only available in Git. diff --git a/src/infrastructure/graph/DifferentialRevisionGraph.php b/src/infrastructure/graph/DifferentialRevisionGraph.php index 892540f610..715820e9e3 100644 --- a/src/infrastructure/graph/DifferentialRevisionGraph.php +++ b/src/infrastructure/graph/DifferentialRevisionGraph.php @@ -27,10 +27,12 @@ final class DifferentialRevisionGraph if ($object) { $status_icon = $object->getStatusIcon(); + $status_color = $object->getStatusIconColor(); $status_name = $object->getStatusDisplayName(); $status = array( - id(new PHUIIconView())->setIcon($status_icon), + id(new PHUIIconView()) + ->setIcon($status_icon, $status_color), ' ', $status_name, ); diff --git a/src/view/layout/PHUICurtainView.php b/src/view/layout/PHUICurtainView.php index af02ceb932..49ff55384a 100644 --- a/src/view/layout/PHUICurtainView.php +++ b/src/view/layout/PHUICurtainView.php @@ -46,10 +46,17 @@ final class PHUICurtainView extends AphrontTagView { $panels = $this->renderPanels(); - return id(new PHUIObjectBoxView()) + $box = id(new PHUIObjectBoxView()) ->appendChild($action_list) ->appendChild($panels) ->addClass('phui-two-column-properties'); + + // We want to hide this UI on mobile if there are no child panels + if (!$panels) { + $box->addClass('curtain-no-panels'); + } + + return $box; } private function renderPanels() { diff --git a/src/view/phui/PHUIBigInfoView.php b/src/view/phui/PHUIBigInfoView.php index ad10a9fa4a..31a458ed60 100644 --- a/src/view/phui/PHUIBigInfoView.php +++ b/src/view/phui/PHUIBigInfoView.php @@ -49,6 +49,7 @@ final class PHUIBigInfoView extends AphrontTagView { protected function getTagContent() { require_celerity_resource('phui-big-info-view-css'); + $icon = null; if ($this->icon) { $icon = id(new PHUIIconView()) ->setIcon($this->icon) diff --git a/src/view/phui/PHUIButtonView.php b/src/view/phui/PHUIButtonView.php index 1aaa1cbaad..8d6eca9ec7 100644 --- a/src/view/phui/PHUIButtonView.php +++ b/src/view/phui/PHUIButtonView.php @@ -5,6 +5,7 @@ final class PHUIButtonView extends AphrontTagView { const GREEN = 'green'; const GREY = 'grey'; const BLUE = 'blue'; + const RED = 'red'; const DISABLED = 'disabled'; const SMALL = 'small'; diff --git a/src/view/form/PHUIInfoView.php b/src/view/phui/PHUIInfoView.php similarity index 98% rename from src/view/form/PHUIInfoView.php rename to src/view/phui/PHUIInfoView.php index 8ba74056b8..18f5af3374 100644 --- a/src/view/form/PHUIInfoView.php +++ b/src/view/phui/PHUIInfoView.php @@ -95,7 +95,6 @@ final class PHUIInfoView extends AphrontTagView { } public function addButton(PHUIButtonView $button) { - $button->setColor(PHUIButtonView::GREY); $this->buttons[] = $button; return $this; } diff --git a/webroot/rsrc/css/aphront/dialog-view.css b/webroot/rsrc/css/aphront/dialog-view.css index 5809ab117e..153685548e 100644 --- a/webroot/rsrc/css/aphront/dialog-view.css +++ b/webroot/rsrc/css/aphront/dialog-view.css @@ -3,7 +3,7 @@ */ .aphront-dialog-view { - width: 560px; + width: 580px; margin: 32px auto 16px; border: 1px solid {$lightblueborder}; border-radius: 3px; @@ -32,7 +32,7 @@ } .aphront-dialog-view-width-form { - width: 640px; + width: 820px; } .aphront-dialog-view-width-full { diff --git a/webroot/rsrc/css/application/base/standard-page-view.css b/webroot/rsrc/css/application/base/standard-page-view.css index f697b1f7a8..d930a73797 100644 --- a/webroot/rsrc/css/application/base/standard-page-view.css +++ b/webroot/rsrc/css/application/base/standard-page-view.css @@ -184,6 +184,20 @@ a.handle-status-closed:hover { box-shadow: 0 0 3px 0 rgba(0,0,0,0.2); } +.device .phabricator-standard-page-tabs { + margin-bottom: 20px; +} + +.device-phone .phabricator-standard-page-tabs { + text-align: center; +} + +.device-phone + .phabricator-standard-page-tabs.phui-list-view.phui-list-tabbar > li { + display: inline-block; + float: none; +} + .phabricator-standard-page-tabs.phui-list-tabbar .phui-list-item-href { padding: 12px 24px; } diff --git a/webroot/rsrc/css/phui/button/phui-button.css b/webroot/rsrc/css/phui/button/phui-button.css index 8cdd818f12..a36d69d4bc 100644 --- a/webroot/rsrc/css/phui/button/phui-button.css +++ b/webroot/rsrc/css/phui/button/phui-button.css @@ -50,7 +50,9 @@ input[type="submit"] { button .phui-icon-view, a.button .phui-icon-view, button.button-green .phui-icon-view, -a.button.button-green .phui-icon-view { +a.button.button-green .phui-icon-view, +button.button-red .phui-icon-view, +a.button.button-red .phui-icon-view { color: white; } @@ -76,6 +78,14 @@ a.button-green.button:visited { background-image: {$green.button.gradient}; } +button.button-red, +a.button-red.button, +a.button-red.button:visited { + background-color: {$red.button.color}; + border-color: {$red.button.color}; + background-image: {$red.button.gradient}; +} + button.button-grey, input[type="submit"].button-grey, a.button-grey, @@ -123,6 +133,14 @@ button.button-green:hover { transition: 0.1s; } +a.button.button-red:hover, +button.button-red:hover { + border-color: #79150b; + background-color: #0DAD48; + background-image: {$red.button.hover}; + transition: 0.1s; +} + body a.button.disabled:hover, body button.disabled:hover, body a.button.disabled:active, diff --git a/webroot/rsrc/css/phui/phui-curtain-view.css b/webroot/rsrc/css/phui/phui-curtain-view.css index 0d7d4f942f..8bd8a331c4 100644 --- a/webroot/rsrc/css/phui/phui-curtain-view.css +++ b/webroot/rsrc/css/phui/phui-curtain-view.css @@ -46,3 +46,7 @@ .phui-side-column .phui-curtain-panel-body .phui-tag-view { white-space: pre-wrap; } + +.device .curtain-no-panels { + display: none; +} diff --git a/webroot/rsrc/css/phui/phui-form-view.css b/webroot/rsrc/css/phui/phui-form-view.css index da1a524abb..1b7400656a 100644 --- a/webroot/rsrc/css/phui/phui-form-view.css +++ b/webroot/rsrc/css/phui/phui-form-view.css @@ -196,6 +196,7 @@ .aphront-form-control-markup .aphront-form-input { font-size: {$normalfontsize}; + padding: 3px 0; } .aphront-form-control-static .aphront-form-input { diff --git a/webroot/rsrc/js/core/behavior-fancy-datepicker.js b/webroot/rsrc/js/core/behavior-fancy-datepicker.js index 15558dbfe1..afd5ff25ad 100644 --- a/webroot/rsrc/js/core/behavior-fancy-datepicker.js +++ b/webroot/rsrc/js/core/behavior-fancy-datepicker.js @@ -287,26 +287,38 @@ JX.behavior('fancy-datepicker', function(config, statics) { }; function getValidDate() { - var written_date = new Date(value_y, value_m-1, value_d); + var year_int = parseInt(value_y, 10); + if (isNaN(year_int) || year_int < 0) { + return new Date(); + } + + // If the user enters "11" for the year, interpret it as "2011" (which + // is almost certainly what they mean) not "1911" (which is the default + // behavior of Javascript). + if (year_int < 70) { + year_int += 2000; + } + + var month_int = parseInt(value_m, 10); + if (isNaN(month_int) || month_int < 1 || month_int > 12) { + return new Date(); + } + + // In Javascript, January is "0", not "1", so adjust the value down. + month_int = month_int - 1; + + var day_int = parseInt(value_d, 10); + if (isNaN(day_int) || day_int < 1 || day_int > 31) { + return new Date(); + } + + var written_date = new Date(year_int, month_int, day_int); if (isNaN(written_date.getTime())) { return new Date(); - } else { - //year 01 should be 2001, not 1901 - if (written_date.getYear() < 70) { - value_y += 2000; - written_date = new Date(value_y, value_m-1, value_d); - } - - // adjust for a date like February 31 - var adjust = 1; - while (written_date.getMonth() !== value_m-1) { - written_date = new Date(value_y, value_m-1, value_d-adjust); - adjust++; - } - - return written_date; } + + return written_date; }