Differential D19810 Diff 47322 src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
| Show First 20 Lines • Show All 323 Lines • ▼ Show 20 Lines | if ($comment_actions) { | ||||
| $draft_keys[] = $type; | $draft_keys[] = $type; | ||||
| } | } | ||||
| } | } | ||||
| foreach ($comment_actions as $key => $comment_action) { | foreach ($comment_actions as $key => $comment_action) { | ||||
| $key = $comment_action->getKey(); | $key = $comment_action->getKey(); | ||||
| $label = $comment_action->getLabel(); | $label = $comment_action->getLabel(); | ||||
| $action_map[$key] = array( | $action_map[$key] = array( | ||||
| 'key' => $key, | 'key' => $key, | ||||
| 'label' => $label, | 'label' => $label, | ||||
| 'type' => $comment_action->getPHUIXControlType(), | 'type' => $comment_action->getPHUIXControlType(), | ||||
| 'spec' => $comment_action->getPHUIXControlSpecification(), | 'spec' => $comment_action->getPHUIXControlSpecification(), | ||||
| 'initialValue' => $comment_action->getInitialValue(), | 'initialValue' => $comment_action->getInitialValue(), | ||||
| 'groupKey' => $comment_action->getGroupKey(), | 'groupKey' => $comment_action->getGroupKey(), | ||||
| 'conflictKey' => $comment_action->getConflictKey(), | 'conflictKey' => $comment_action->getConflictKey(), | ||||
| 'auralLabel' => pht('Remove Action: %s', $label), | 'auralLabel' => pht('Remove Action: %s', $label), | ||||
| 'buttonText' => $comment_action->getSubmitButtonText(), | |||||
| ); | ); | ||||
| $type_map[$key] = $comment_action; | $type_map[$key] = $comment_action; | ||||
| } | } | ||||
| $options = $this->newCommentActionOptions($action_map); | $options = $this->newCommentActionOptions($action_map); | ||||
| $action_id = celerity_generate_unique_node_id(); | $action_id = celerity_generate_unique_node_id(); | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | if ($comment_actions) { | ||||
| 'formID' => $this->getFormID(), | 'formID' => $this->getFormID(), | ||||
| 'placeID' => $place_id, | 'placeID' => $place_id, | ||||
| 'panelID' => $this->getPreviewPanelID(), | 'panelID' => $this->getPreviewPanelID(), | ||||
| 'timelineID' => $this->getPreviewTimelineID(), | 'timelineID' => $this->getPreviewTimelineID(), | ||||
| 'actions' => $action_map, | 'actions' => $action_map, | ||||
| 'showPreview' => $this->getShowPreview(), | 'showPreview' => $this->getShowPreview(), | ||||
| 'actionURI' => $this->getAction(), | 'actionURI' => $this->getAction(), | ||||
| 'drafts' => $draft_keys, | 'drafts' => $draft_keys, | ||||
| 'defaultButtonText' => $this->getSubmitButtonName(), | |||||
| )); | )); | ||||
| } | } | ||||
| $submit_button = id(new AphrontFormSubmitControl()) | $submit_button = id(new AphrontFormSubmitControl()) | ||||
| ->addClass('phui-comment-fullwidth-control') | ->addClass('phui-comment-fullwidth-control') | ||||
| ->addClass('phui-comment-submit-control') | ->addClass('phui-comment-submit-control') | ||||
| ->setValue($this->getSubmitButtonName()); | ->setValue($this->getSubmitButtonName()); | ||||
| $form | $form | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new PhabricatorRemarkupControl()) | id(new PhabricatorRemarkupControl()) | ||||
| ->setID($this->getCommentID()) | ->setID($this->getCommentID()) | ||||
| ->addClass('phui-comment-fullwidth-control') | ->addClass('phui-comment-fullwidth-control') | ||||
| ->addClass('phui-comment-textarea-control') | ->addClass('phui-comment-textarea-control') | ||||
| ->setCanPin(true) | ->setCanPin(true) | ||||
| ->setName('comment') | ->setName('comment') | ||||
| ->setUser($this->getUser()) | ->setUser($this->getUser()) | ||||
| ->setValue($draft_comment)) | ->setValue($draft_comment)) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSubmitControl()) | id(new AphrontFormSubmitControl()) | ||||
| ->addClass('phui-comment-fullwidth-control') | ->addClass('phui-comment-fullwidth-control') | ||||
| ->addClass('phui-comment-submit-control') | ->addClass('phui-comment-submit-control') | ||||
| ->addSigil('submit-transactions') | |||||
| ->setValue($this->getSubmitButtonName())); | ->setValue($this->getSubmitButtonName())); | ||||
| return $form; | return $form; | ||||
| } | } | ||||
| private function renderPreviewPanel() { | private function renderPreviewPanel() { | ||||
| $preview = id(new PHUITimelineView()) | $preview = id(new PHUITimelineView()) | ||||
| ▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines | |||||