2017-01-13 06:36:25 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DifferentialRevisionDraftEngine
|
|
|
|
extends PhabricatorDraftEngine {
|
|
|
|
|
|
|
|
protected function hasCustomDraftContent() {
|
|
|
|
$viewer = $this->getViewer();
|
|
|
|
$revision = $this->getObject();
|
|
|
|
|
Replace "loadUnsubmittedInlineComments()" with a modern "DiffQuery"
Summary: Ref T13513. All queries now go through a reasonably minimal set of pathways and should have consistent behavior.
Test Plan:
- Loaded a revision with inlines.
- Created a new empty inline, reloaded page, saw it vanish.
- Created a new empty inline, typed draft text, did not save, reloaded page, saw draft present.
- Created a new empty inline, typed draft text. Submitted feedback, got prompt, answered "Y", saw draft text submit.
- Created a new empty inline, typed draft text, scrolled down to bottom of page, typed non-draft text, saw preview include draft text.
- Marked and submitted "Done".
- Used hide/show on inlines, verified state persisted.
- Did much of the same stuff in Diffusion, where it all works the same way (except: there's no prompt when submitting draft is-editing inlines).
Maniphest Tasks: T13513
Differential Revision: https://secure.phabricator.com/D21234
2020-05-07 13:54:04 -07:00
|
|
|
$inlines = id(new DifferentialDiffInlineCommentQuery())
|
|
|
|
->setViewer($viewer)
|
|
|
|
->withRevisionPHIDs(array($revision->getPHID()))
|
|
|
|
->withPublishableComments(true)
|
2020-05-19 13:52:14 -07:00
|
|
|
->setReturnPartialResultsOnOverheat(true)
|
2020-05-08 05:58:49 -07:00
|
|
|
->setLimit(1)
|
Replace "loadUnsubmittedInlineComments()" with a modern "DiffQuery"
Summary: Ref T13513. All queries now go through a reasonably minimal set of pathways and should have consistent behavior.
Test Plan:
- Loaded a revision with inlines.
- Created a new empty inline, reloaded page, saw it vanish.
- Created a new empty inline, typed draft text, did not save, reloaded page, saw draft present.
- Created a new empty inline, typed draft text. Submitted feedback, got prompt, answered "Y", saw draft text submit.
- Created a new empty inline, typed draft text, scrolled down to bottom of page, typed non-draft text, saw preview include draft text.
- Marked and submitted "Done".
- Used hide/show on inlines, verified state persisted.
- Did much of the same stuff in Diffusion, where it all works the same way (except: there's no prompt when submitting draft is-editing inlines).
Maniphest Tasks: T13513
Differential Revision: https://secure.phabricator.com/D21234
2020-05-07 13:54:04 -07:00
|
|
|
->execute();
|
2017-01-13 06:36:25 -08:00
|
|
|
|
|
|
|
return (bool)$inlines;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|