mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-15 10:00:55 +01:00
(stable) Promote 2017 Week 32
This commit is contained in:
commit
5494df7228
57 changed files with 589 additions and 447 deletions
BIN
resources/builtin/repo/repo-git.png
Normal file
BIN
resources/builtin/repo/repo-git.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
BIN
resources/builtin/repo/repo-hg.png
Normal file
BIN
resources/builtin/repo/repo-hg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.7 KiB |
BIN
resources/builtin/repo/repo-svn.png
Normal file
BIN
resources/builtin/repo/repo-svn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
|
@ -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',
|
||||
|
|
|
@ -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"]
|
||||
}
|
|
@ -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',
|
||||
|
|
|
@ -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)',
|
||||
|
|
|
@ -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(),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
|
||||
final class DifferentialLegacyQuery
|
||||
extends Phobject {
|
||||
|
||||
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';
|
||||
|
||||
public static function getAllConstants() {
|
||||
return array_keys(self::getMap());
|
||||
}
|
||||
|
||||
public static function getQueryValues($status) {
|
||||
if ($status === self::STATUS_ANY) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$map = self::getMap();
|
||||
if (!isset($map[$status])) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Unknown revision status filter constant "%s".',
|
||||
$status));
|
||||
}
|
||||
|
||||
$values = array();
|
||||
foreach ($map[$status] as $status_constant) {
|
||||
$status_object = DifferentialRevisionStatus::newForStatus(
|
||||
$status_constant);
|
||||
|
||||
$legacy_key = $status_object->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,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,107 +1,158 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* NOTE: you probably want {@class:ArcanistDifferentialRevisionStatus}.
|
||||
* This class just contains a mapping for color within the Differential
|
||||
* application.
|
||||
*/
|
||||
|
||||
final class DifferentialRevisionStatus extends Phobject {
|
||||
|
||||
const COLOR_STATUS_DEFAULT = 'bluegrey';
|
||||
const COLOR_STATUS_DARK = 'indigo';
|
||||
const COLOR_STATUS_BLUE = 'blue';
|
||||
const COLOR_STATUS_GREEN = 'green';
|
||||
const COLOR_STATUS_RED = 'red';
|
||||
const NEEDS_REVIEW = 'needs-review';
|
||||
const NEEDS_REVISION = 'needs-revision';
|
||||
const CHANGES_PLANNED = 'changes-planned';
|
||||
const ACCEPTED = 'accepted';
|
||||
const PUBLISHED = 'published';
|
||||
const ABANDONED = 'abandoned';
|
||||
|
||||
public static function getRevisionStatusColor($status) {
|
||||
$default = self::COLOR_STATUS_DEFAULT;
|
||||
private $key;
|
||||
private $spec = array();
|
||||
|
||||
$map = array(
|
||||
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW =>
|
||||
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,
|
||||
);
|
||||
|
||||
if (PhabricatorEnv::getEnvConfig('differential.close-on-accept')) {
|
||||
$statuses[] = ArcanistDifferentialRevisionStatus::ACCEPTED;
|
||||
public function getIconColor() {
|
||||
return idx($this->spec, 'color.icon', 'bluegrey');
|
||||
}
|
||||
|
||||
return $statuses;
|
||||
public function getTagColor() {
|
||||
return idx($this->spec, 'color.tag', 'bluegrey');
|
||||
}
|
||||
|
||||
public static function getOpenStatuses() {
|
||||
return array_diff(self::getAllStatuses(), self::getClosedStatuses());
|
||||
public function getDisplayName() {
|
||||
return idx($this->spec, 'name');
|
||||
}
|
||||
|
||||
public static function getAllStatuses() {
|
||||
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 $result;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Flexible query API for Differential revisions. Example:
|
||||
*
|
||||
* // Load open revisions
|
||||
* $revisions = id(new DifferentialRevisionQuery())
|
||||
* ->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:
|
||||
$statuses = DifferentialLegacyQuery::getQueryValues($this->status);
|
||||
if ($statuses !== null) {
|
||||
$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);
|
||||
}
|
||||
|
||||
$where[] = $this->buildWhereClauseParts($conn_r);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 '.
|
||||
|
|
|
@ -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. '.
|
||||
|
|
|
@ -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 '.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -289,24 +289,24 @@ 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:
|
||||
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.'),
|
||||
);
|
||||
default:
|
||||
} 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(
|
||||
|
@ -314,7 +314,6 @@ final class DrydockLandRepositoryOperation
|
|||
'have been accepted may land.'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Check for other operations. Eventually this should probably be more
|
||||
// general (e.g., it's OK to land to multiple different branches
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorFilesManagementPurgeWorkflow
|
||||
extends PhabricatorFilesManagementWorkflow {
|
||||
|
||||
protected function didConstruct() {
|
||||
$this
|
||||
->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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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...'));
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($viewer)
|
||||
->appendChild(
|
||||
id(new AphrontFormSelectControl())
|
||||
$radio = id(new AphrontFormRadioButtonControl())
|
||||
->setName('defaultPaymentMethodPHID')
|
||||
->setLabel(pht('Autopay With'))
|
||||
->setValue($current_phid)
|
||||
->setError($e_method)
|
||||
->setOptions($options))
|
||||
->setError($e_method);
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
$radio->addButton($key, $value, null);
|
||||
}
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($viewer)
|
||||
->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');
|
||||
|
|
|
@ -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'];
|
||||
|
|
|
@ -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)
|
||||
|
|
48
src/applications/uiexample/examples/PHUIBigInfoExample.php
Normal file
48
src/applications/uiexample/examples/PHUIBigInfoExample.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
final class PHUIBigInfoExample extends PhabricatorUIExample {
|
||||
|
||||
public function getName() {
|
||||
return pht('Big Info View');
|
||||
}
|
||||
|
||||
public function getDescription() {
|
||||
return pht(
|
||||
'Basic New User State information block.');
|
||||
}
|
||||
|
||||
public function renderExample() {
|
||||
$request = $this->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);
|
||||
}
|
||||
}
|
|
@ -20,6 +20,7 @@ final class PHUIButtonExample extends PhabricatorUIExample {
|
|||
$colors = array(
|
||||
null,
|
||||
PHUIButtonView::GREEN,
|
||||
PHUIButtonView::RED,
|
||||
PHUIButtonView::GREY,
|
||||
);
|
||||
$sizes = array(null, PHUIButtonView::SMALL);
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -95,7 +95,6 @@ final class PHUIInfoView extends AphrontTagView {
|
|||
}
|
||||
|
||||
public function addButton(PHUIButtonView $button) {
|
||||
$button->setColor(PHUIButtonView::GREY);
|
||||
$this->buttons[] = $button;
|
||||
return $this;
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -46,3 +46,7 @@
|
|||
.phui-side-column .phui-curtain-panel-body .phui-tag-view {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.device .curtain-no-panels {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -196,6 +196,7 @@
|
|||
|
||||
.aphront-form-control-markup .aphront-form-input {
|
||||
font-size: {$normalfontsize};
|
||||
padding: 3px 0;
|
||||
}
|
||||
|
||||
.aphront-form-control-static .aphront-form-input {
|
||||
|
|
|
@ -287,27 +287,39 @@ 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(written_date.getTime())) {
|
||||
if (isNaN(year_int) || year_int < 0) {
|
||||
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++;
|
||||
// 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();
|
||||
}
|
||||
|
||||
return written_date;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Render the day-of-week and calendar views.
|
||||
|
|
Loading…
Reference in a new issue