mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Remove "Moved Document from ..." notice in Phriction
Summary: Ref T13410. See PHI1431. Currently, when you move a document in Phriction, the target shows a "This document was moved from ..." banner until it is edited. This banner isn't particularly useful, and it's distracting and it isn't obvious how to dismiss it, and making a trivial edit to dismiss it is awkward. This information is also already available in the transaction log. Just remove this banner since it doesn't really serve any clear purpose. Test Plan: - Moved a page in Phriction, then loaded the destination page. Before change: header banner. After change: nothing. - Viewed a normal (non-moved) page, saw normal behavior. - Reviewed transactions, saw "Moved from ..." in the timeline. Maniphest Tasks: T13410 Differential Revision: https://secure.phabricator.com/D20800
This commit is contained in:
parent
d2e1c4163a
commit
a0ade503e1
2 changed files with 1 additions and 32 deletions
|
@ -293,37 +293,6 @@ final class PhrictionDocumentController
|
|||
} else {
|
||||
throw new Exception(pht("Unknown document status '%s'!", $doc_status));
|
||||
}
|
||||
|
||||
$move_notice = null;
|
||||
if ($current_status == PhrictionChangeType::CHANGE_MOVE_HERE) {
|
||||
$from_doc_id = $content->getChangeRef();
|
||||
|
||||
$slug_uri = null;
|
||||
|
||||
// If the old document exists and is visible, provide a link to it.
|
||||
$from_docs = id(new PhrictionDocumentQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($from_doc_id))
|
||||
->execute();
|
||||
if ($from_docs) {
|
||||
$from_doc = head($from_docs);
|
||||
$slug_uri = PhrictionDocument::getSlugURI($from_doc->getSlug());
|
||||
}
|
||||
|
||||
$move_notice = id(new PHUIInfoView())
|
||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
|
||||
|
||||
if ($slug_uri) {
|
||||
$move_notice->appendChild(
|
||||
pht(
|
||||
'This document was moved from %s.',
|
||||
phutil_tag('a', array('href' => $slug_uri), $slug_uri)));
|
||||
} else {
|
||||
// Render this for consistency, even though it's a bit silly.
|
||||
$move_notice->appendChild(
|
||||
pht('This document was moved from elsewhere.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$children = $this->renderDocumentChildren($slug);
|
||||
|
|
|
@ -49,7 +49,7 @@ final class PhrictionDocumentMoveToTransaction
|
|||
$new = $this->getNewValue();
|
||||
|
||||
return pht(
|
||||
'%s moved this document from %s',
|
||||
'%s moved this document from %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderHandle($new['phid']));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue