1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-15 18:10:53 +01:00

(stable) Promote 2017 Week 30

This commit is contained in:
epriestley 2017-07-28 15:13:56 -07:00
commit fec09eac3c
18 changed files with 256 additions and 71 deletions

View file

@ -9,11 +9,11 @@ return array(
'names' => array(
'conpherence.pkg.css' => 'e68cf1fa',
'conpherence.pkg.js' => 'b5b51108',
'core.pkg.css' => 'f1c7630f',
'core.pkg.css' => 'd9c9cfd0',
'core.pkg.js' => '5d80e0db',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '45951e9e',
'differential.pkg.js' => '414ada25',
'differential.pkg.js' => 'b71b8c5d',
'diffusion.pkg.css' => 'a2d17c7d',
'diffusion.pkg.js' => '6134c5a1',
'favicon.ico' => '30672e08',
@ -75,7 +75,7 @@ return array(
'rsrc/css/application/diffusion/diffusion-readme.css' => '419dd5b6',
'rsrc/css/application/diffusion/diffusion-repository.css' => 'ee6f20ec',
'rsrc/css/application/diffusion/diffusion-source.css' => '750add59',
'rsrc/css/application/diffusion/diffusion.css' => '8d01932f',
'rsrc/css/application/diffusion/diffusion.css' => '67bd971b',
'rsrc/css/application/feed/feed.css' => 'ecd4ec57',
'rsrc/css/application/files/global-drag-and-drop.css' => 'b556a948',
'rsrc/css/application/flag/flag.css' => 'bba8f811',
@ -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' => '022581b4',
'rsrc/css/phui/button/phui-button.css' => '3ca51caa',
'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',
@ -156,7 +156,7 @@ return array(
'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.css' => 'efa86a27',
'rsrc/css/phui/phui-form.css' => '7aaa04e3',
'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f',
'rsrc/css/phui/phui-header-view.css' => 'e7de7ee2',
'rsrc/css/phui/phui-hovercard.css' => 'f0592bcf',
@ -398,7 +398,7 @@ return array(
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/diff/DiffChangeset.js' => '99abf4cd',
'rsrc/js/application/diff/DiffChangesetList.js' => 'cb1570cb',
'rsrc/js/application/diff/DiffChangesetList.js' => '8f1cd52c',
'rsrc/js/application/diff/DiffInline.js' => 'e83d28f3',
'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832',
'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07',
@ -571,7 +571,7 @@ return array(
'differential-revision-history-css' => '0e8eb855',
'differential-revision-list-css' => 'f3c47d33',
'differential-table-of-contents-css' => 'ae4b7a55',
'diffusion-css' => '8d01932f',
'diffusion-css' => '67bd971b',
'diffusion-icons-css' => '0c15255e',
'diffusion-readme-css' => '419dd5b6',
'diffusion-repository-css' => 'ee6f20ec',
@ -778,7 +778,7 @@ return array(
'phabricator-darkmessage' => 'c48cccdd',
'phabricator-dashboard-css' => 'fe5b1869',
'phabricator-diff-changeset' => '99abf4cd',
'phabricator-diff-changeset-list' => 'cb1570cb',
'phabricator-diff-changeset-list' => '8f1cd52c',
'phabricator-diff-inline' => 'e83d28f3',
'phabricator-drag-and-drop-file-upload' => '58dea2fa',
'phabricator-draggable-list' => 'bea6e7f4',
@ -825,7 +825,7 @@ return array(
'phui-big-info-view-css' => 'd13afcde',
'phui-box-css' => '745e881d',
'phui-button-bar-css' => 'f1ff5494',
'phui-button-css' => '022581b4',
'phui-button-css' => '3ca51caa',
'phui-button-simple-css' => '8e1baf68',
'phui-calendar-css' => 'f1ddf11c',
'phui-calendar-day-css' => '572b1893',
@ -843,7 +843,7 @@ return array(
'phui-feed-story-css' => '44a9c8e9',
'phui-font-icon-base-css' => '870a7360',
'phui-fontkit-css' => '1320ed01',
'phui-form-css' => 'efa86a27',
'phui-form-css' => '7aaa04e3',
'phui-form-view-css' => '6175808d',
'phui-head-thing-view-css' => 'fd311e5f',
'phui-header-view-css' => 'e7de7ee2',
@ -1567,6 +1567,10 @@ return array(
'8e1baf68' => array(
'phui-button-css',
),
'8f1cd52c' => array(
'javelin-install',
'phuix-button-view',
),
'8ff5e24c' => array(
'javelin-behavior',
'javelin-stratcom',
@ -1950,10 +1954,6 @@ return array(
'cae95e89' => array(
'syntax-default-css',
),
'cb1570cb' => array(
'javelin-install',
'phuix-button-view',
),
'ccf1cbf8' => array(
'javelin-install',
'javelin-dom',

View file

@ -0,0 +1,2 @@
UPDATE {$NAMESPACE}_legalpad.legalpad_documentbody
SET dateCreated = dateModified;

View file

@ -298,6 +298,9 @@ final class DifferentialChangesetListView extends AphrontView {
'Show All Inlines' => pht('Show All Inlines'),
'List Inline Comments' => pht('List Inline Comments'),
'Hide or show all inline comments.' =>
pht('Hide or show all inline comments.'),
),
));

View file

@ -4,7 +4,7 @@ final class DiffusionRepositoryController extends DiffusionController {
private $historyFuture;
private $browseFuture;
private $tagFuture;
private $branchButton = null;
private $branchFuture;
public function shouldAllowPublic() {
@ -53,15 +53,25 @@ final class DiffusionRepositoryController extends DiffusionController {
// This is a valid branch, so we necessarily have some content.
$page_has_content = true;
} else {
$empty_title = pht('No Such Branch');
$empty_message = pht(
'There is no branch named "%s" in this repository.',
$drequest->getBranch());
$default = $repository->getDefaultBranch();
if ($default != $drequest->getBranch()) {
$empty_title = pht('No Such Branch');
$empty_message = pht(
'There is no branch named "%s" in this repository.',
$drequest->getBranch());
} else {
$empty_title = pht('No Default Branch');
$empty_message = pht(
'This repository is configured with default branch "%s" but '.
'there is no branch with that name in this repository.',
$default);
}
}
}
// If we didn't find any branches, check if there are any commits at all.
// This can tailor the message for empty repositories.
$any_commit = null;
if (!$page_has_content) {
$any_commit = id(new DiffusionCommitQuery())
->setViewer($viewer)
@ -81,6 +91,9 @@ final class DiffusionRepositoryController extends DiffusionController {
if ($page_has_content) {
$content = $this->buildNormalContent($drequest);
} else {
// If we have a commit somewhere, find branches.
// TODO: Evan will replace
// $this->buildNormalContent($drequest);
$content = id(new PHUIInfoView())
->setTitle($empty_title)
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
@ -110,7 +123,7 @@ final class DiffusionRepositoryController extends DiffusionController {
$bar = id(new PHUILeftRightView())
->setLeft($locate_file)
->setRight($clone_button)
->setRight(array($this->branchButton, $clone_button))
->addClass('diffusion-action-bar');
$view = id(new PHUITwoColumnView())
@ -145,6 +158,7 @@ final class DiffusionRepositoryController extends DiffusionController {
$commit = $drequest->getCommit();
$path = $drequest->getPath();
$futures = array();
$this->historyFuture = $this->callConduitMethod(
'diffusion.historyquery',
array(
@ -153,6 +167,7 @@ final class DiffusionRepositoryController extends DiffusionController {
'offset' => 0,
'limit' => 15,
));
$futures[] = $this->historyFuture;
$browse_pager = id(new PHUIPagerView())
->readFromRequest($request);
@ -164,11 +179,19 @@ final class DiffusionRepositoryController extends DiffusionController {
'path' => $path,
'limit' => $browse_pager->getPageSize() + 1,
));
$futures[] = $this->browseFuture;
if ($this->needBranchFuture()) {
$branch_limit = $this->getBranchLimit();
$this->branchFuture = $this->callConduitMethod(
'diffusion.branchquery',
array(
'closed' => false,
'limit' => $branch_limit + 1,
));
$futures[] = $this->branchFuture;
}
$futures = array(
$this->historyFuture,
$this->browseFuture,
);
$futures = array_filter($futures);
$futures = new FutureIterator($futures);
foreach ($futures as $future) {
@ -253,6 +276,18 @@ final class DiffusionRepositoryController extends DiffusionController {
$content[] = $readme;
}
try {
$branch_button = $this->buildBranchList($drequest);
$this->branchButton = $branch_button;
} catch (Exception $ex) {
if (!$repository->isImporting()) {
$content[] = $this->renderStatusMessage(
pht('Unable to Load Branches'),
$ex->getMessage());
}
}
return $content;
}
@ -375,6 +410,67 @@ final class DiffusionRepositoryController extends DiffusionController {
return $panel;
}
private function buildBranchList(DiffusionRequest $drequest) {
$viewer = $this->getViewer();
if (!$this->needBranchFuture()) {
return null;
}
$branches = $this->branchFuture->resolve();
if (!$branches) {
return null;
}
$limit = $this->getBranchLimit();
$more_branches = (count($branches) > $limit);
$branches = array_slice($branches, 0, $limit);
$branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches);
$actions = id(new PhabricatorActionListView())
->setViewer($viewer);
foreach ($branches as $branch) {
$branch_uri = $drequest->generateURI(
array(
'action' => 'browse',
'branch' => $branch->getShortname(),
));
$actions->addAction(
id(new PhabricatorActionView())
->setName($branch->getShortname())
->setIcon('fa-code-fork')
->setHref($branch_uri));
}
if ($more_branches) {
$more_uri = $drequest->generateURI(
array(
'action' => 'branches',
));
$actions->addAction(
id(new PhabricatorActionView())
->setType(PhabricatorActionView::TYPE_DIVIDER));
$actions->addAction(
id(new PhabricatorActionView())
->setName(pht('See More Branches'))
->setIcon('fa-external-link')
->setHref($more_uri));
}
$button = id(new PHUIButtonView())
->setText(pht('Branch: %s', $drequest->getBranch()))
->setTag('a')
->addClass('mmr')
->setIcon('fa-code-fork')
->setColor(PHUIButtonView::GREY)
->setDropdown(true)
->setDropdownMenu($actions);
return $button;
}
private function buildLocateFile() {
$request = $this->getRequest();
$viewer = $request->getUser();
@ -457,7 +553,17 @@ final class DiffusionRepositoryController extends DiffusionController {
->setPager($pager);
}
private function getTagLimit() {
private function needBranchFuture() {
$drequest = $this->getDiffusionRequest();
if ($drequest->getBranch() === null) {
return false;
}
return true;
}
private function getBranchLimit() {
return 15;
}

View file

@ -58,7 +58,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
* @task sync
*/
public function synchronizeWorkingCopyAfterCreation() {
if (!$this->shouldEnableSynchronization()) {
if (!$this->shouldEnableSynchronization(false)) {
return;
}
@ -86,7 +86,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
* @task sync
*/
public function synchronizeWorkingCopyAfterHostingChange() {
if (!$this->shouldEnableSynchronization()) {
if (!$this->shouldEnableSynchronization(false)) {
return;
}
@ -133,7 +133,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
* @task sync
*/
public function synchronizeWorkingCopyBeforeRead() {
if (!$this->shouldEnableSynchronization()) {
if (!$this->shouldEnableSynchronization(true)) {
return;
}
@ -288,7 +288,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
* @task sync
*/
public function synchronizeWorkingCopyBeforeWrite() {
if (!$this->shouldEnableSynchronization()) {
if (!$this->shouldEnableSynchronization(true)) {
return;
}
@ -382,7 +382,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
public function synchronizeWorkingCopyAfterDiscovery($new_version) {
if (!$this->shouldEnableSynchronization()) {
if (!$this->shouldEnableSynchronization(true)) {
return;
}
@ -426,7 +426,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
* @task sync
*/
public function synchronizeWorkingCopyAfterWrite() {
if (!$this->shouldEnableSynchronization()) {
if (!$this->shouldEnableSynchronization(true)) {
return;
}
@ -551,7 +551,7 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
/**
* @task internal
*/
private function shouldEnableSynchronization() {
private function shouldEnableSynchronization($require_device) {
$repository = $this->getRepository();
$service_phid = $repository->getAlmanacServicePHID();
@ -563,9 +563,11 @@ final class DiffusionRepositoryClusterEngine extends Phobject {
return false;
}
$device = AlmanacKeys::getLiveDevice();
if (!$device) {
return false;
if ($require_device) {
$device = AlmanacKeys::getLiveDevice();
if (!$device) {
return false;
}
}
return true;

View file

@ -45,18 +45,23 @@ final class LegalpadDocumentEditor
}
if ($is_contribution) {
$text = $object->getDocumentBody()->getText();
$title = $object->getDocumentBody()->getTitle();
$object->setVersions($object->getVersions() + 1);
$body = $object->getDocumentBody();
$body = new LegalpadDocumentBody();
$body->setCreatorPHID($this->getActingAsPHID());
$body->setText($text);
$body->setTitle($title);
$body->setVersion($object->getVersions());
$body->setDocumentPHID($object->getPHID());
$body->save();
$object->setDocumentBodyPHID($body->getPHID());
$actor = $this->getActor();
$type = PhabricatorContributedToObjectEdgeType::EDGECONST;
id(new PhabricatorEdgeEditor())
->addEdge($actor->getPHID(), $type, $object->getPHID())
->addEdge($this->getActingAsPHID(), $type, $object->getPHID())
->save();
$type = PhabricatorObjectHasContributorEdgeType::EDGECONST;

View file

@ -24,6 +24,10 @@ final class ManiphestReplyHandler
$xactions = array();
if ($is_new) {
$xactions[] = $this->newTransaction()
->setTransactionType(PhabricatorTransactions::TYPE_CREATE)
->setNewValue(true);
$xactions[] = $this->newTransaction()
->setTransactionType(ManiphestTaskTitleTransaction::TRANSACTIONTYPE)
->setNewValue(nonempty($mail->getSubject(), pht('Untitled Task')));

View file

@ -94,7 +94,7 @@ final class PonderQuestionViewController extends PonderController {
$wiki = new PHUIRemarkupView($viewer, $question->getAnswerWiki());
$answer_wiki = id(new PHUIObjectBoxView())
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setHeaderText(pht('ANSWER SUMMARY'))
->setHeaderText(pht('Answer Summary'))
->appendChild($wiki)
->addClass('ponder-answer-wiki');
}

View file

@ -10,11 +10,11 @@ final class PonderQuestionEditor
}
public function getCreateObjectTitle($author, $object) {
return pht('%s created this question.', $author);
return pht('%s asked this question.', $author);
}
public function getCreateObjectTitleForFeed($author, $object) {
return pht('%s created %s.', $author, $object);
return pht('%s asked %s.', $author, $object);
}
/**

View file

@ -23,4 +23,11 @@ final class PonderAnswerTransaction
return 'PonderAnswerTransactionType';
}
public function getMailTags() {
$tags = parent::getMailTags();
$tags[] = PonderQuestionTransaction::MAILTAG_OTHER;
return $tags;
}
}

View file

@ -14,12 +14,29 @@ final class PonderAnswerContentTransaction
}
public function getTitle() {
$old = $this->getOldValue();
if (!strlen($old)) {
return pht(
'%s added an answer.',
$this->renderAuthor());
}
return pht(
'%s updated the answer details.',
$this->renderAuthor());
}
public function getTitleForFeed() {
$old = $this->getOldValue();
if (!strlen($old)) {
return pht(
'%s added %s.',
$this->renderAuthor(),
$this->renderObject());
}
return pht(
'%s updated the answer details for %s.',
$this->renderAuthor(),

View file

@ -554,7 +554,7 @@ final class PhabricatorApplicationSearchController
return id(new PHUIButtonView())
->setTag('a')
->setHref('#')
->setText(pht('Use Results...'))
->setText(pht('Use Results'))
->setIcon('fa-bars')
->setDropdownMenu($action_list)
->addClass('dropdown');

View file

@ -134,6 +134,7 @@ final class PHUIButtonView extends AphrontTagView {
Javelin::initBehavior('phui-dropdown-menu');
$this->addSigil('phui-dropdown-menu');
$this->setDropdown(true);
$this->setMetadata($actions->getDropdownMenuMetadata());
return $this;
@ -223,32 +224,29 @@ final class PHUIButtonView extends AphrontTagView {
protected function getTagContent() {
$icon = null;
$text = $this->text;
if ($this->icon) {
$icon = $this->icon;
$icon = $this->icon;
$text = null;
$subtext = null;
$subtext = null;
if ($this->subtext) {
$subtext = phutil_tag(
'div',
array(
'class' => 'phui-button-subtext',
),
$this->subtext);
}
if ($this->subtext) {
$subtext = phutil_tag(
'div',
array(
'class' => 'phui-button-subtext',
),
$this->subtext);
}
if ($this->text !== null) {
$text = phutil_tag(
'div',
array(
'class' => 'phui-button-text',
),
array(
$text,
$subtext,
));
}
if ($this->text !== null) {
$text = phutil_tag(
'div',
array(
'class' => 'phui-button-text',
),
array(
$this->text,
$subtext,
));
}
$caret = null;
@ -259,7 +257,7 @@ final class PHUIButtonView extends AphrontTagView {
if ($this->iconFirst == true) {
return array($icon, $text, $caret);
} else {
return array($text, $icon);
return array($text, $icon, $caret);
}
}
}

View file

@ -16,6 +16,23 @@
margin-bottom: 16px;
}
.device-phone .diffusion-action-bar {
display: block;
}
.device-phone .diffusion-action-bar .phui-lr-container {
display: block;
}
.device-phone .diffusion-action-bar .phui-lr-container .phui-left-view {
display: block;
}
.device-phone .diffusion-action-bar .phui-lr-container .phui-right-view {
padding-top: 12px;
display: block;
}
.diffusion-profile-locate .phui-form-view {
margin: 0;
padding: 0;

View file

@ -265,6 +265,14 @@ a.policy-control .phui-button-text {
right: 10px;
}
.phui-button-text {
display: inline-block;
}
.dropdown .phui-button-text {
margin-right: 8px;
}
.button.has-icon .phui-button-text {
margin-left: 16px;
}

View file

@ -22,7 +22,7 @@ div.jx-tokenizer-container {
display: inline-block;
height: 30px;
line-height: 18px;
color: {$darkbluetext};
color: inherit;
vertical-align: middle;
font: {$basefont};
-webkit-font-smoothing: antialiased;
@ -108,7 +108,6 @@ select {
background: {$page.content} url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAMAAACzvE1FAAAADFBMVEUzMzMzMzMzMzMzMzMKAG/3AAAAA3RSTlMAf4C/aSLHAAAAPElEQVR42q3NMQ4AIAgEQTn//2cLdRKppSGzBYwzVXvznNWs8C58CiussPJj8h6NwgorrKRdTvuV9v16Afn0AYFOB7aYAAAAAElFTkSuQmCC") no-repeat right 8px center;
background-size: 8px 10px;
border-radius: 3px;
color: {$darkbluetext};
border: 1px solid {$greyborder};
height: 30px;
padding: 0 24px 0 8px;

View file

@ -344,8 +344,8 @@
}
.phui-timeline-older-transactions-are-hidden {
background: {$sh-yellowbackground};
border: 1px solid {$sh-yellowborder};
background: {$gentle.highlight};
border: 1px solid {$gentle.highlight.border};
text-align: center;
padding: 12px;
color: {$darkgreytext};

View file

@ -190,6 +190,10 @@ JX.install('DiffChangesetList', {
label = pht('Collapse or expand inline comment.');
this._installKey('q', label, this._onkeycollapse);
label = pht('Hide or show all inline comments.');
this._installKey('A', label, this._onkeyhideall);
},
isAsleep: function() {
@ -448,6 +452,15 @@ JX.install('DiffChangesetList', {
this._warnUser(pht('You must select a comment to hide.'));
},
_onkeyhideall: function() {
var inlines = this._getInlinesByType();
if (inlines.visible.length) {
this._toggleInlines('all');
} else {
this._toggleInlines('show');
}
},
_warnUser: function(message) {
new JX.Notification()
.setContent(message)
@ -1701,6 +1714,10 @@ JX.install('DiffChangesetList', {
this._dropdownMenu.close();
e.prevent();
this._toggleInlines(type);
},
_toggleInlines: function(type) {
var inlines = this._getInlinesByType();
// Clear the selection state since we end up in a weird place if the