1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 19:22: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:
epriestley 2019-09-11 21:01:56 -07:00
parent d2e1c4163a
commit a0ade503e1
2 changed files with 1 additions and 32 deletions

View file

@ -293,37 +293,6 @@ final class PhrictionDocumentController
} else { } else {
throw new Exception(pht("Unknown document status '%s'!", $doc_status)); 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); $children = $this->renderDocumentChildren($slug);

View file

@ -49,7 +49,7 @@ final class PhrictionDocumentMoveToTransaction
$new = $this->getNewValue(); $new = $this->getNewValue();
return pht( return pht(
'%s moved this document from %s', '%s moved this document from %s.',
$this->renderAuthor(), $this->renderAuthor(),
$this->renderHandle($new['phid'])); $this->renderHandle($new['phid']));
} }