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

Provide more UI guidance when creating repositories

Summary: Ref T10923. Walk users through the "create, configure, activate" workflow a little better and set expectations more clearly.

Test Plan:
- Created a new repository, saw new UI help.
- Activated repository, saw onboarding help disappear.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10923

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

+83 -5
+18 -1
src/applications/diffusion/controller/DiffusionRepositoryEditActivateController.php
··· 47 47 $submit = pht('Deactivate Repository'); 48 48 } else { 49 49 $title = pht('Activate Repository'); 50 - $body = pht('Activate this repository?'); 50 + 51 + $is_new = $repository->isNewlyInitialized(); 52 + if ($is_new) { 53 + if ($repository->isHosted()) { 54 + $body = pht( 55 + 'This repository will become a new hosted repository. '. 56 + 'It will begin serving read and write traffic.'); 57 + } else { 58 + $body = pht( 59 + 'This repository will observe an existing remote repository. '. 60 + 'It will begin fetching changes from the remote.'); 61 + } 62 + } else { 63 + $body = pht( 64 + 'This repository will resume updates, observation, mirroring, '. 65 + 'and serving any configured read and write traffic.'); 66 + } 67 + 51 68 $submit = pht('Activate Repository'); 52 69 } 53 70
+2
src/applications/diffusion/editor/DiffusionRepositoryEditEngine.php
··· 40 40 $viewer = $this->getViewer(); 41 41 $repository = PhabricatorRepository::initializeNewRepository($viewer); 42 42 43 + $repository->setDetail('newly-initialized', true); 44 + 43 45 $vcs = $this->getVersionControlSystem(); 44 46 if ($vcs) { 45 47 $repository->setVersionControlSystem($vcs);
+32 -1
src/applications/diffusion/management/DiffusionRepositoryBasicsManagementPanel.php
··· 103 103 public function buildManagementPanelContent() { 104 104 $result = array(); 105 105 106 - $result[] = $this->newBox(pht('Repository Basics'), $this->buildBasics()); 106 + $basics = $this->newBox(pht('Repository Basics'), $this->buildBasics()); 107 + 108 + $repository = $this->getRepository(); 109 + $is_new = $repository->isNewlyInitialized(); 110 + if ($is_new) { 111 + $messages = array(); 112 + 113 + $messages[] = pht( 114 + 'This newly created repository is not active yet. Configure policies, '. 115 + 'options, and URIs. When ready, %s the repository.', 116 + phutil_tag('strong', array(), pht('Activate'))); 117 + 118 + if ($repository->isHosted()) { 119 + $messages[] = pht( 120 + 'If activated now, this repository will become a new hosted '. 121 + 'repository. To observe an existing repository instead, configure '. 122 + 'it in the %s panel.', 123 + phutil_tag('strong', array(), pht('URIs'))); 124 + } else { 125 + $messages[] = pht( 126 + 'If activated now, this repository will observe an existing remote '. 127 + 'repository and begin importing changes.'); 128 + } 129 + 130 + $info_view = id(new PHUIInfoView()) 131 + ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) 132 + ->setErrors($messages); 133 + 134 + $basics->setInfoView($info_view); 135 + } 136 + 137 + $result[] = $basics; 107 138 108 139 $description = $this->buildDescription(); 109 140 if ($description) {
+18 -2
src/applications/diffusion/management/DiffusionRepositoryURIsManagementPanel.php
··· 113 113 ->setTag('a') 114 114 ->setText(pht('Documentation'))); 115 115 116 + $is_new = $repository->isNewlyInitialized(); 117 + 116 118 $messages = array(); 117 119 if ($repository->isHosted()) { 120 + if ($is_new) { 121 + $host_message = pht('Phabricator will host this repository.'); 122 + } else { 123 + $host_message = pht('Phabricator is hosting this repository.'); 124 + } 125 + 118 126 $messages[] = array( 119 127 id(new PHUIIconView())->setIcon('fa-folder'), 120 128 ' ', 121 - pht('Phabricator is hosting this repository.'), 129 + $host_message, 122 130 ); 123 131 } else { 132 + if ($is_new) { 133 + $observe_message = pht( 134 + 'Phabricator will observe a remote repository.'); 135 + } else { 136 + $observe_message = pht( 137 + 'This repository is hosted remotely. Phabricator is observing it.'); 138 + } 139 + 124 140 $messages[] = array( 125 141 id(new PHUIIconView())->setIcon('fa-download'), 126 142 ' ', 127 - pht('This repository is hosted remotely. Phabricator is observing it.'), 143 + $observe_message, 128 144 ); 129 145 } 130 146
+9 -1
src/applications/repository/editor/PhabricatorRepositoryEditor.php
··· 138 138 $object->setVersionControlSystem($xaction->getNewValue()); 139 139 break; 140 140 case PhabricatorRepositoryTransaction::TYPE_ACTIVATE: 141 - $object->setDetail('tracking-enabled', $xaction->getNewValue()); 141 + $active = $xaction->getNewValue(); 142 + 143 + // The first time a repository is activated, clear the "new repository" 144 + // flag so we stop showing setup hints. 145 + if ($active) { 146 + $object->setDetail('newly-initialized', false); 147 + } 148 + 149 + $object->setDetail('tracking-enabled', $active); 142 150 break; 143 151 case PhabricatorRepositoryTransaction::TYPE_NAME: 144 152 $object->setName($xaction->getNewValue());
+4
src/applications/repository/storage/PhabricatorRepository.php
··· 964 964 return (bool)$this->getDetail('importing', false); 965 965 } 966 966 967 + public function isNewlyInitialized() { 968 + return (bool)$this->getDetail('newly-initialized', false); 969 + } 970 + 967 971 public function loadImportProgress() { 968 972 $progress = queryfx_all( 969 973 $this->establishConnection('r'),