@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.

Hide milestone columns when milestone is archived

Summary: Fixes T10310. This replaces the "Hide Column" / "Show Column" option for milestone columns with one that archives/unarchives, and hides milestone columns when the milestone project is archived.

Test Plan:
- Hid and unhid a normal column (got normal dialogs).
- Hid and unhid a milestone column (got "archive project" dialogs, underlying project archived/unarchived, column vanished).

Reviewers: hach-que, #blessed_reviewers, chad

Reviewed By: #blessed_reviewers, chad

Subscribers: jcowgar, Korvin

Maniphest Tasks: T10310

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

authored by

June Rhodes and committed by
epriestley
2f054edf a5bbe256

+71 -28
+66 -28
src/applications/project/controller/PhabricatorProjectColumnHideController.php
··· 52 52 ->addCancelButton($view_uri, pht('Okay')); 53 53 } 54 54 55 + $proxy = $column->getProxy(); 56 + 55 57 if ($request->isFormPost()) { 56 - if ($column->isHidden()) { 57 - $new_status = PhabricatorProjectColumn::STATUS_ACTIVE; 58 + if ($proxy) { 59 + if ($proxy->isArchived()) { 60 + $new_status = PhabricatorProjectStatus::STATUS_ACTIVE; 61 + } else { 62 + $new_status = PhabricatorProjectStatus::STATUS_ARCHIVED; 63 + } 64 + 65 + $xactions = array(); 66 + 67 + $xactions[] = id(new PhabricatorProjectTransaction()) 68 + ->setTransactionType(PhabricatorProjectTransaction::TYPE_STATUS) 69 + ->setNewValue($new_status); 70 + 71 + id(new PhabricatorProjectTransactionEditor()) 72 + ->setActor($viewer) 73 + ->setContentSourceFromRequest($request) 74 + ->setContinueOnNoEffect(true) 75 + ->setContinueOnMissingFields(true) 76 + ->applyTransactions($proxy, $xactions); 58 77 } else { 59 - $new_status = PhabricatorProjectColumn::STATUS_HIDDEN; 60 - } 78 + if ($column->isHidden()) { 79 + $new_status = PhabricatorProjectColumn::STATUS_ACTIVE; 80 + } else { 81 + $new_status = PhabricatorProjectColumn::STATUS_HIDDEN; 82 + } 61 83 62 - $type_status = PhabricatorProjectColumnTransaction::TYPE_STATUS; 63 - $xactions = array( 64 - id(new PhabricatorProjectColumnTransaction()) 65 - ->setTransactionType($type_status) 66 - ->setNewValue($new_status), 67 - ); 84 + $type_status = PhabricatorProjectColumnTransaction::TYPE_STATUS; 85 + $xactions = array( 86 + id(new PhabricatorProjectColumnTransaction()) 87 + ->setTransactionType($type_status) 88 + ->setNewValue($new_status), 89 + ); 68 90 69 - $editor = id(new PhabricatorProjectColumnTransactionEditor()) 70 - ->setActor($viewer) 71 - ->setContinueOnNoEffect(true) 72 - ->setContentSourceFromRequest($request) 73 - ->applyTransactions($column, $xactions); 91 + $editor = id(new PhabricatorProjectColumnTransactionEditor()) 92 + ->setActor($viewer) 93 + ->setContinueOnNoEffect(true) 94 + ->setContentSourceFromRequest($request) 95 + ->applyTransactions($column, $xactions); 96 + } 74 97 75 98 return id(new AphrontRedirectResponse())->setURI($view_uri); 76 99 } 77 100 78 - if ($column->isHidden()) { 79 - $title = pht('Show Column'); 101 + if ($proxy) { 102 + if ($column->isHidden()) { 103 + $title = pht('Activate and Show Column'); 104 + $body = pht( 105 + 'This column is hidden because it represents an archived '. 106 + 'subproject. Do you want to activate the subproject so the '. 107 + 'column is visible again?'); 108 + $button = pht('Activate Subproject'); 109 + } else { 110 + $title = pht('Archive and Hide Column'); 111 + $body = pht( 112 + 'This column is visible because it represents an active '. 113 + 'subproject. Do you want to hide the column by archiving the '. 114 + 'subproject?'); 115 + $button = pht('Archive Subproject'); 116 + } 80 117 } else { 81 - $title = pht('Hide Column'); 82 - } 83 - 84 - if ($column->isHidden()) { 85 - $body = pht( 86 - 'Are you sure you want to show this column?'); 87 - } else { 88 - $body = pht( 89 - 'Are you sure you want to hide this column? It will no longer '. 90 - 'appear on the workboard.'); 118 + if ($column->isHidden()) { 119 + $title = pht('Show Column'); 120 + $body = pht('Are you sure you want to show this column?'); 121 + $button = pht('Show Column'); 122 + } else { 123 + $title = pht('Hide Column'); 124 + $body = pht( 125 + 'Are you sure you want to hide this column? It will no longer '. 126 + 'appear on the workboard.'); 127 + $button = pht('Hide Column'); 128 + } 91 129 } 92 130 93 131 $dialog = $this->newDialog() ··· 96 134 ->appendChild($body) 97 135 ->setDisableWorkflowOnCancel(true) 98 136 ->addCancelButton($view_uri) 99 - ->addSubmitButton($title); 137 + ->addSubmitButton($button); 100 138 101 139 foreach ($request->getPassthroughRequestData() as $key => $value) { 102 140 $dialog->addHiddenInput($key, $value);
+5
src/applications/project/storage/PhabricatorProjectColumn.php
··· 86 86 } 87 87 88 88 public function isHidden() { 89 + $proxy = $this->getProxy(); 90 + if ($proxy) { 91 + return $proxy->isArchived(); 92 + } 93 + 89 94 return ($this->getStatus() == self::STATUS_HIDDEN); 90 95 } 91 96