Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/view/PHUIDiffInlineCommentView.php
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | public function newHiddenIcon() { | ||||
if ($this->isHideable()) { | if ($this->isHideable()) { | ||||
return new PHUIDiffRevealIconView(); | return new PHUIDiffRevealIconView(); | ||||
} else { | } else { | ||||
return null; | return null; | ||||
} | } | ||||
} | } | ||||
protected function getInlineCommentMetadata() { | protected function getInlineCommentMetadata() { | ||||
$viewer = $this->getViewer(); | |||||
$inline = $this->getInlineComment(); | $inline = $this->getInlineComment(); | ||||
$is_synthetic = (bool)$inline->getSyntheticAuthor(); | $is_synthetic = (bool)$inline->getSyntheticAuthor(); | ||||
$is_fixed = false; | $is_fixed = false; | ||||
switch ($inline->getFixedState()) { | switch ($inline->getFixedState()) { | ||||
case PhabricatorInlineComment::STATE_DONE: | case PhabricatorInlineComment::STATE_DONE: | ||||
case PhabricatorInlineComment::STATE_DRAFT: | case PhabricatorInlineComment::STATE_DRAFT: | ||||
$is_fixed = true; | $is_fixed = true; | ||||
break; | break; | ||||
} | } | ||||
$is_draft_done = false; | $is_draft_done = false; | ||||
switch ($inline->getFixedState()) { | switch ($inline->getFixedState()) { | ||||
case PhabricatorInlineComment::STATE_DRAFT: | case PhabricatorInlineComment::STATE_DRAFT: | ||||
case PhabricatorInlineComment::STATE_UNDRAFT: | case PhabricatorInlineComment::STATE_UNDRAFT: | ||||
$is_draft_done = true; | $is_draft_done = true; | ||||
break; | break; | ||||
} | } | ||||
$original_text = $inline->getContentForEdit($viewer); | |||||
return array( | return array( | ||||
'id' => $inline->getID(), | 'id' => $inline->getID(), | ||||
'phid' => $inline->getPHID(), | 'phid' => $inline->getPHID(), | ||||
'changesetID' => $inline->getChangesetID(), | 'changesetID' => $inline->getChangesetID(), | ||||
'number' => $inline->getLineNumber(), | 'number' => $inline->getLineNumber(), | ||||
'length' => $inline->getLineLength(), | 'length' => $inline->getLineLength(), | ||||
'isNewFile' => (bool)$inline->getIsNewFile(), | 'isNewFile' => (bool)$inline->getIsNewFile(), | ||||
'original' => $inline->getContent(), | 'original' => $original_text, | ||||
'replyToCommentPHID' => $inline->getReplyToCommentPHID(), | 'replyToCommentPHID' => $inline->getReplyToCommentPHID(), | ||||
'isDraft' => $inline->isDraft(), | 'isDraft' => $inline->isDraft(), | ||||
'isFixed' => $is_fixed, | 'isFixed' => $is_fixed, | ||||
'isGhost' => $inline->getIsGhost(), | 'isGhost' => $inline->getIsGhost(), | ||||
'isSynthetic' => $is_synthetic, | 'isSynthetic' => $is_synthetic, | ||||
'isDraftDone' => $is_draft_done, | 'isDraftDone' => $is_draft_done, | ||||
'isEditing' => $inline->getIsEditing(), | 'isEditing' => $inline->getIsEditing(), | ||||
'on_right' => $this->getIsOnRight(), | 'on_right' => $this->getIsOnRight(), | ||||
); | ); | ||||
} | } | ||||
} | } |