@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

When an edit overrides an object lock, note it in the transaction record

Summary:
Ref T13244. See PHI1059. When you lock a task, users who can edit the task can currently override the lock by using "Edit Task" if they confirm that they want to do this.

Mark these edits with an emblem, similar to the "MFA" and "Silent" emblems, so it's clear that they may have bent the rules.

Also, make the "MFA" and "Silent" emblems more easily visible.

Test Plan:
Edited a locked task, overrode the lock, got marked for it.

{F6195005}

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: aeiser

Maniphest Tasks: T13244

Differential Revision: https://secure.phabricator.com/D20131

+89 -6
+3 -3
resources/celerity/map.php
··· 9 9 'names' => array( 10 10 'conpherence.pkg.css' => '3c8a0668', 11 11 'conpherence.pkg.js' => '020aebcf', 12 - 'core.pkg.css' => '08baca0c', 12 + 'core.pkg.css' => '7a73ffc5', 13 13 'core.pkg.js' => '5c737607', 14 14 'differential.pkg.css' => 'b8df73d4', 15 15 'differential.pkg.js' => '67c9ea4c', ··· 157 157 'rsrc/css/phui/phui-header-view.css' => '93cea4ec', 158 158 'rsrc/css/phui/phui-hovercard.css' => '6ca90fa0', 159 159 'rsrc/css/phui/phui-icon-set-selector.css' => '7aa5f3ec', 160 - 'rsrc/css/phui/phui-icon.css' => '281f964d', 160 + 'rsrc/css/phui/phui-icon.css' => '4cbc684a', 161 161 'rsrc/css/phui/phui-image-mask.css' => '62c7f4d2', 162 162 'rsrc/css/phui/phui-info-view.css' => '37b8d9ce', 163 163 'rsrc/css/phui/phui-invisible-character-view.css' => 'c694c4a4', ··· 823 823 'phui-hovercard' => '074f0783', 824 824 'phui-hovercard-view-css' => '6ca90fa0', 825 825 'phui-icon-set-selector-css' => '7aa5f3ec', 826 - 'phui-icon-view-css' => '281f964d', 826 + 'phui-icon-view-css' => '4cbc684a', 827 827 'phui-image-mask-css' => '62c7f4d2', 828 828 'phui-info-view-css' => '37b8d9ce', 829 829 'phui-inline-comment-view-css' => '48acce5b',
+14
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
··· 1115 1115 $transaction_open = true; 1116 1116 } 1117 1117 1118 + // We can technically test any object for CAN_INTERACT, but we can 1119 + // run into some issues in doing so (for example, in project unit tests). 1120 + // For now, only test for CAN_INTERACT if the object is explicitly a 1121 + // lockable object. 1122 + 1123 + $was_locked = false; 1124 + if ($object instanceof PhabricatorEditEngineLockableInterface) { 1125 + $was_locked = !PhabricatorPolicyFilter::canInteract($actor, $object); 1126 + } 1127 + 1118 1128 foreach ($xactions as $xaction) { 1119 1129 $this->applyInternalEffects($object, $xaction); 1120 1130 } ··· 1132 1142 } 1133 1143 1134 1144 foreach ($xactions as $xaction) { 1145 + if ($was_locked) { 1146 + $xaction->setIsLockOverrideTransaction(true); 1147 + } 1148 + 1135 1149 $xaction->setObjectPHID($object->getPHID()); 1136 1150 if ($xaction->getComment()) { 1137 1151 $xaction->setPHID($xaction->generatePHID());
+14
src/applications/transactions/storage/PhabricatorApplicationTransaction.php
··· 169 169 return (bool)$this->getMetadataValue('core.mfa', false); 170 170 } 171 171 172 + public function setIsLockOverrideTransaction($override) { 173 + return $this->setMetadataValue('core.lock-override', $override); 174 + } 175 + 176 + public function getIsLockOverrideTransaction() { 177 + return (bool)$this->getMetadataValue('core.lock-override', false); 178 + } 179 + 172 180 public function attachComment( 173 181 PhabricatorApplicationTransactionComment $comment) { 174 182 $this->comment = $comment; ··· 1528 1536 if ($xaction->getTransactionType() === $type_mfa) { 1529 1537 return false; 1530 1538 } 1539 + } 1540 + 1541 + // Don't group lock override and non-override transactions together. 1542 + $is_override = $this->getIsLockOverrideTransaction(); 1543 + if ($is_override != $xaction->getIsLockOverrideTransaction()) { 1544 + return false; 1531 1545 } 1532 1546 } 1533 1547
+2 -1
src/applications/transactions/view/PhabricatorApplicationTransactionView.php
··· 416 416 ->setColor($xaction->getColor()) 417 417 ->setHideCommentOptions($this->getHideCommentOptions()) 418 418 ->setIsSilent($xaction->getIsSilentTransaction()) 419 - ->setIsMFA($xaction->getIsMFATransaction()); 419 + ->setIsMFA($xaction->getIsMFATransaction()) 420 + ->setIsLockOverride($xaction->getIsLockOverrideTransaction()); 420 421 421 422 list($token, $token_removed) = $xaction->getToken(); 422 423 if ($token) {
+14
src/view/phui/PHUIIconView.php
··· 19 19 private $iconColor; 20 20 private $iconBackground; 21 21 private $tooltip; 22 + private $emblemColor; 22 23 23 24 public function setHref($href) { 24 25 $this->href = $href; ··· 66 67 return $this; 67 68 } 68 69 70 + public function setEmblemColor($emblem_color) { 71 + $this->emblemColor = $emblem_color; 72 + return $this; 73 + } 74 + 75 + public function getEmblemColor() { 76 + return $this->emblemColor; 77 + } 78 + 69 79 protected function getTagName() { 70 80 $tag = 'span'; 71 81 if ($this->href) { ··· 104 114 if ($this->text) { 105 115 $classes[] = 'phui-icon-has-text'; 106 116 $this->appendChild($this->text); 117 + } 118 + 119 + if ($this->emblemColor) { 120 + $classes[] = 'phui-icon-emblem phui-icon-emblem-'.$this->emblemColor; 107 121 } 108 122 109 123 $sigil = null;
+21 -2
src/view/phui/PHUITimelineEventView.php
··· 31 31 private $pinboardItems = array(); 32 32 private $isSilent; 33 33 private $isMFA; 34 + private $isLockOverride; 34 35 35 36 public function setAuthorPHID($author_phid) { 36 37 $this->authorPHID = $author_phid; ··· 195 196 196 197 public function getIsMFA() { 197 198 return $this->isMFA; 199 + } 200 + 201 + public function setIsLockOverride($is_override) { 202 + $this->isLockOverride = $is_override; 203 + return $this; 204 + } 205 + 206 + public function getIsLockOverride() { 207 + return $this->isLockOverride; 198 208 } 199 209 200 210 public function setReallyMajorEvent($me) { ··· 597 607 // not expect to have received any mail or notifications. 598 608 if ($this->getIsSilent()) { 599 609 $extra[] = id(new PHUIIconView()) 600 - ->setIcon('fa-bell-slash', 'red') 610 + ->setIcon('fa-bell-slash', 'white') 611 + ->setEmblemColor('red') 601 612 ->setTooltip(pht('Silent Edit')); 602 613 } 603 614 ··· 605 616 // provide a hint that it was extra authentic. 606 617 if ($this->getIsMFA()) { 607 618 $extra[] = id(new PHUIIconView()) 608 - ->setIcon('fa-vcard', 'pink') 619 + ->setIcon('fa-vcard', 'white') 620 + ->setEmblemColor('pink') 609 621 ->setTooltip(pht('MFA Authenticated')); 622 + } 623 + 624 + if ($this->getIsLockOverride()) { 625 + $extra[] = id(new PHUIIconView()) 626 + ->setIcon('fa-chain-broken', 'white') 627 + ->setEmblemColor('violet') 628 + ->setTooltip(pht('Lock Overridden')); 610 629 } 611 630 } 612 631
+21
webroot/rsrc/css/phui/phui-icon.css
··· 183 183 text-decoration: none; 184 184 color: #fff; 185 185 } 186 + 187 + 188 + .phui-icon-emblem { 189 + border-radius: 4px; 190 + } 191 + 192 + .phui-timeline-extra .phui-icon-emblem { 193 + padding: 4px 6px; 194 + } 195 + 196 + .phui-icon-emblem-violet { 197 + background-color: {$violet}; 198 + } 199 + 200 + .phui-icon-emblem-red { 201 + background-color: {$red}; 202 + } 203 + 204 + .phui-icon-emblem-pink { 205 + background-color: {$pink}; 206 + }