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

Conpherence - add edit control for rooms

Summary: Fixes T7582. Basically if its a room we should be able to change title + policy and if its a thread just the title. T7582 had ideas to do a dropdown but "view in column" doesn't make sense from conpherence afaik - what would the page you'd end up with the column be? (maybe home?) Anyway, that is iteration we can add laters

Test Plan: edited room metadata successfully from main and column view. edtied thread title from main and column view.

Reviewers: epriestley, chad

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7582

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

+52 -13
+51 -12
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 120 120 ->setContent($result); 121 121 break; 122 122 case ConpherenceUpdateActions::METADATA: 123 - $updated = false; 124 123 // all metadata updates are continue requests 125 124 if (!$request->isContinueRequest()) { 126 125 break; 127 126 } 128 127 129 128 $title = $request->getStr('title'); 130 - if ($title != $conpherence->getTitle()) { 129 + $xactions[] = id(new ConpherenceTransaction()) 130 + ->setTransactionType(ConpherenceTransactionType::TYPE_TITLE) 131 + ->setNewValue($title); 132 + if ($conpherence->getIsRoom()) { 133 + $xactions[] = id(new ConpherenceTransaction()) 134 + ->setTransactionType(PhabricatorTransactions::TYPE_VIEW_POLICY) 135 + ->setNewValue($request->getStr('viewPolicy')); 131 136 $xactions[] = id(new ConpherenceTransaction()) 132 - ->setTransactionType(ConpherenceTransactionType::TYPE_TITLE) 133 - ->setNewValue($title); 134 - $updated = true; 135 - if (!$request->getExists('force_ajax')) { 136 - $response_mode = 'redirect'; 137 - } 137 + ->setTransactionType(PhabricatorTransactions::TYPE_EDIT_POLICY) 138 + ->setNewValue($request->getStr('editPolicy')); 139 + $xactions[] = id(new ConpherenceTransaction()) 140 + ->setTransactionType(PhabricatorTransactions::TYPE_JOIN_POLICY) 141 + ->setNewValue($request->getStr('joinPolicy')); 138 142 } 139 - if (!$updated) { 140 - $errors[] = pht( 141 - 'That was a non-update. Try cancel.'); 143 + if (!$request->getExists('force_ajax')) { 144 + $response_mode = 'redirect'; 142 145 } 143 146 break; 144 147 case ConpherenceUpdateActions::LOAD: ··· 163 166 return id(new PhabricatorApplicationTransactionNoEffectResponse()) 164 167 ->setCancelURI($this->getApplicationURI($conpherence_id.'/')) 165 168 ->setException($ex); 169 + } 170 + // xactions had no effect...! 171 + if (empty($xactions)) { 172 + $errors[] = pht( 173 + 'That was a non-update. Try cancel.'); 166 174 } 167 175 } 168 176 ··· 293 301 $error_view) { 294 302 295 303 $request = $this->getRequest(); 304 + $user = $request->getUser(); 305 + 296 306 $form = id(new PHUIFormLayoutView()) 297 307 ->appendChild($error_view) 298 308 ->appendChild( ··· 301 311 ->setName('title') 302 312 ->setValue($conpherence->getTitle())); 303 313 314 + if ($conpherence->getIsRoom()) { 315 + $title = pht('Update Room'); 316 + $policies = id(new PhabricatorPolicyQuery()) 317 + ->setViewer($user) 318 + ->setObject($conpherence) 319 + ->execute(); 320 + 321 + $form->appendChild( 322 + id(new AphrontFormPolicyControl()) 323 + ->setName('viewPolicy') 324 + ->setPolicyObject($conpherence) 325 + ->setCapability(PhabricatorPolicyCapability::CAN_VIEW) 326 + ->setPolicies($policies)) 327 + ->appendChild( 328 + id(new AphrontFormPolicyControl()) 329 + ->setName('editPolicy') 330 + ->setPolicyObject($conpherence) 331 + ->setCapability(PhabricatorPolicyCapability::CAN_EDIT) 332 + ->setPolicies($policies)) 333 + ->appendChild( 334 + id(new AphrontFormPolicyControl()) 335 + ->setName('joinPolicy') 336 + ->setPolicyObject($conpherence) 337 + ->setCapability(PhabricatorPolicyCapability::CAN_JOIN) 338 + ->setPolicies($policies)); 339 + } else { 340 + $title = pht('Update Thread'); 341 + } 342 + 304 343 require_celerity_resource('conpherence-update-css'); 305 344 $view = id(new AphrontDialogView()) 306 - ->setTitle(pht('Update Conpherence')) 345 + ->setTitle($title) 307 346 ->addHiddenInput('action', 'metadata') 308 347 ->addHiddenInput( 309 348 'latest_transaction_id',
+1 -1
src/applications/conpherence/view/ConpherenceDurableColumnView.php
··· 381 381 382 382 private function getHeaderActionsConfig(ConpherenceThread $conpherence) { 383 383 if ($conpherence->getIsRoom()) { 384 - $rename_label = pht('Rename Room'); 384 + $rename_label = pht('Edit Room'); 385 385 } else { 386 386 $rename_label = pht('Rename Thread'); 387 387 }