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

Remove the dashboard "template" workflow

Summary:
Depends on D20364. Ref T13272. When you create a dashboard, we currently give you a modal choice between an empty dashboard and a "simple template" dashboard.

Remove this choice, and create an empty dashboard in all cases instead.

I think this template dashboard flow isn't terribly useful, and is partly covering over other deficiencies in the workflow. I'm fixing many of those and suspect we can get away without this now. Users on this flow also may not really know what they want. This also contributes to having a lot of extra unmoored panels floating around.

If we did rebuild this, I'd like to address more specific use cases and probably build it as "Add a Template Panel..." or similar, as an action you can use to quickly update an existing workboard. This would be a lot more flexible than create-a-whole-template-board.

Test Plan: Created a new board, no more "template: yes or no?" gate.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13272

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

-164
-164
src/applications/dashboard/controller/dashboard/PhabricatorDashboardEditController.php
··· 27 27 $v_projects = array_reverse($v_projects); 28 28 $is_new = false; 29 29 } else { 30 - if (!$request->getStr('edit')) { 31 - if ($request->isFormPost()) { 32 - switch ($request->getStr('template')) { 33 - case 'empty': 34 - break; 35 - default: 36 - return $this->processBuildTemplateRequest($request); 37 - } 38 - } else { 39 - return $this->processTemplateRequest($request); 40 - } 41 - } 42 - 43 30 $dashboard = PhabricatorDashboard::initializeNewDashboard($viewer); 44 31 $v_projects = array(); 45 32 $is_new = true; ··· 197 184 ->appendChild($view); 198 185 } 199 186 200 - private function processTemplateRequest(AphrontRequest $request) { 201 - $viewer = $request->getUser(); 202 - 203 - $template_control = id(new AphrontFormRadioButtonControl()) 204 - ->setName(pht('template')) 205 - ->setValue($request->getStr('template', 'empty')) 206 - ->addButton( 207 - 'empty', 208 - pht('Empty'), 209 - pht('Start with a blank canvas.')) 210 - ->addButton( 211 - 'simple', 212 - pht('Simple Template'), 213 - pht( 214 - 'Start with a simple dashboard with a welcome message, a feed of '. 215 - 'recent events, and a few starter panels.')); 216 - 217 - $form = id(new AphrontFormView()) 218 - ->setUser($viewer) 219 - ->appendRemarkupInstructions( 220 - pht('Choose a dashboard template to start with.')) 221 - ->appendChild($template_control); 222 - 223 - return $this->newDialog() 224 - ->setTitle(pht('Create Dashboard')) 225 - ->setWidth(AphrontDialogView::WIDTH_FORM) 226 - ->appendChild($form->buildLayoutView()) 227 - ->addCancelButton('/dashboard/') 228 - ->addSubmitButton(pht('Continue')); 229 - } 230 - 231 - private function processBuildTemplateRequest(AphrontRequest $request) { 232 - $viewer = $request->getUser(); 233 - $template = $request->getStr('template'); 234 - 235 - $bare_panel = PhabricatorDashboardPanel::initializeNewPanel($viewer); 236 - $panel_phids = array(); 237 - 238 - switch ($template) { 239 - case 'simple': 240 - $v_name = pht("%s's Dashboard", $viewer->getUsername()); 241 - 242 - $welcome_panel = $this->newPanel( 243 - $request, 244 - $viewer, 245 - 'text', 246 - pht('Welcome'), 247 - array( 248 - 'text' => pht( 249 - "This is a simple template dashboard. You can edit this panel ". 250 - "to change this text and replace it with a welcome message, or ". 251 - "leave this placeholder text as-is to give your dashboard a ". 252 - "rustic, authentic feel.\n\n". 253 - "You can drag, remove, add, and edit panels to customize the ". 254 - "rest of this dashboard to show the information you want.\n\n". 255 - "To install this dashboard on the home page, edit your personal ". 256 - "or global menu on the homepage and click Dashboard under ". 257 - "New Menu Item on the right."), 258 - )); 259 - $panel_phids[] = $welcome_panel->getPHID(); 260 - 261 - $feed_panel = $this->newPanel( 262 - $request, 263 - $viewer, 264 - 'query', 265 - pht('Recent Activity'), 266 - array( 267 - 'class' => 'PhabricatorFeedSearchEngine', 268 - 'key' => 'all', 269 - )); 270 - $panel_phids[] = $feed_panel->getPHID(); 271 - 272 - $revision_panel = $this->newPanel( 273 - $request, 274 - $viewer, 275 - 'query', 276 - pht('Active Revisions'), 277 - array( 278 - 'class' => 'DifferentialRevisionSearchEngine', 279 - 'key' => 'active', 280 - )); 281 - $panel_phids[] = $revision_panel->getPHID(); 282 - 283 - $task_panel = $this->newPanel( 284 - $request, 285 - $viewer, 286 - 'query', 287 - pht('Assigned Tasks'), 288 - array( 289 - 'class' => 'ManiphestTaskSearchEngine', 290 - 'key' => 'assigned', 291 - )); 292 - $panel_phids[] = $task_panel->getPHID(); 293 - 294 - $commit_panel = $this->newPanel( 295 - $request, 296 - $viewer, 297 - 'query', 298 - pht('Recent Commits'), 299 - array( 300 - 'class' => 'PhabricatorCommitSearchEngine', 301 - 'key' => 'all', 302 - )); 303 - $panel_phids[] = $commit_panel->getPHID(); 304 - 305 - $mode_2_and_1 = PhabricatorDashboardLayoutConfig::MODE_THIRDS_AND_THIRD; 306 - $layout = id(new PhabricatorDashboardLayoutConfig()) 307 - ->setLayoutMode($mode_2_and_1) 308 - ->setPanelLocation(0, $welcome_panel->getPHID()) 309 - ->setPanelLocation(0, $revision_panel->getPHID()) 310 - ->setPanelLocation(0, $task_panel->getPHID()) 311 - ->setPanelLocation(0, $commit_panel->getPHID()) 312 - ->setPanelLocation(1, $feed_panel->getPHID()); 313 - 314 - break; 315 - default: 316 - throw new Exception(pht('Unknown dashboard template %s!', $template)); 317 - } 318 - 319 - // Create the dashboard. 320 - 321 - $dashboard = PhabricatorDashboard::initializeNewDashboard($viewer) 322 - ->setLayoutConfigFromObject($layout); 323 - 324 - $xactions = array(); 325 - 326 - $xactions[] = id(new PhabricatorDashboardTransaction()) 327 - ->setTransactionType(PhabricatorDashboardTransaction::TYPE_NAME) 328 - ->setNewValue($v_name); 329 - 330 - $xactions[] = id(new PhabricatorDashboardTransaction()) 331 - ->setTransactionType(PhabricatorTransactions::TYPE_EDGE) 332 - ->setMetadataValue( 333 - 'edge:type', 334 - PhabricatorDashboardDashboardHasPanelEdgeType::EDGECONST) 335 - ->setNewValue( 336 - array( 337 - '+' => array_fuse($panel_phids), 338 - )); 339 - 340 - $editor = id(new PhabricatorDashboardTransactionEditor()) 341 - ->setActor($viewer) 342 - ->setContinueOnNoEffect(true) 343 - ->setContentSourceFromRequest($request) 344 - ->applyTransactions($dashboard, $xactions); 345 - 346 - return id(new AphrontRedirectResponse()) 347 - ->setURI($dashboard->getURI()); 348 - } 349 - 350 187 private function newPanel( 351 188 AphrontRequest $request, 352 189 PhabricatorUser $viewer, ··· 372 209 373 210 return $panel; 374 211 } 375 - 376 212 377 213 }