@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

Rough in of NUX Guide steps

Summary: Ref T11132. Will work on CSS tomorrow, but wanted to rough in the UI Steps to get guidance. Not sure what you have in mind for the "app" part, if you want to explain it and I build or you build.

Test Plan: Visit each page and click on links. Very rough and unfinished.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11132

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

+490 -16
+4 -2
resources/celerity/map.php
··· 70 70 'rsrc/css/application/feed/feed.css' => 'ecd4ec57', 71 71 'rsrc/css/application/files/global-drag-and-drop.css' => '5c1b47c2', 72 72 'rsrc/css/application/flag/flag.css' => '5337623f', 73 + 'rsrc/css/application/guides/guides.css' => '1d5414e5', 73 74 'rsrc/css/application/harbormaster/harbormaster.css' => 'f491c9f4', 74 75 'rsrc/css/application/herald/herald-test.css' => 'a52e323e', 75 76 'rsrc/css/application/herald/herald.css' => 'dc31f6e9', ··· 127 128 'rsrc/css/phui/phui-box.css' => '5c8387cf', 128 129 'rsrc/css/phui/phui-button.css' => '4a5fbe3d', 129 130 'rsrc/css/phui/phui-chart.css' => '6bf6f78e', 130 - 'rsrc/css/phui/phui-cms.css' => '33064557', 131 + 'rsrc/css/phui/phui-cms.css' => 'be43c8a8', 131 132 'rsrc/css/phui/phui-crumbs-view.css' => '9dac418c', 132 133 'rsrc/css/phui/phui-curtain-view.css' => '7148ae25', 133 134 'rsrc/css/phui/phui-document-pro.css' => 'dc3d46ed', ··· 573 574 'font-fontawesome' => '2b7ebbcc', 574 575 'font-lato' => 'c7ccd872', 575 576 'global-drag-and-drop-css' => '5c1b47c2', 577 + 'guides-app-css' => '1d5414e5', 576 578 'harbormaster-css' => 'f491c9f4', 577 579 'herald-css' => 'dc31f6e9', 578 580 'herald-rule-editor' => 'd6a7e717', ··· 833 835 'phui-calendar-list-css' => 'fcc9fb41', 834 836 'phui-calendar-month-css' => '8e10e92c', 835 837 'phui-chart-css' => '6bf6f78e', 836 - 'phui-cms-css' => '33064557', 838 + 'phui-cms-css' => 'be43c8a8', 837 839 'phui-crumbs-view-css' => '9dac418c', 838 840 'phui-curtain-view-css' => '7148ae25', 839 841 'phui-document-summary-view-css' => '9ca48bdf',
+4
src/__phutil_library_map__.php
··· 2633 2633 'PhabricatorGuideApplication' => 'applications/guides/application/PhabricatorGuideApplication.php', 2634 2634 'PhabricatorGuideController' => 'applications/guides/controller/PhabricatorGuideController.php', 2635 2635 'PhabricatorGuideInstallController' => 'applications/guides/controller/PhabricatorGuideInstallController.php', 2636 + 'PhabricatorGuideItemView' => 'applications/guides/view/PhabricatorGuideItemView.php', 2637 + 'PhabricatorGuideListView' => 'applications/guides/view/PhabricatorGuideListView.php', 2636 2638 'PhabricatorGuideQuickStartController' => 'applications/guides/controller/PhabricatorGuideQuickStartController.php', 2637 2639 'PhabricatorGuideWelcomeController' => 'applications/guides/controller/PhabricatorGuideWelcomeController.php', 2638 2640 'PhabricatorHTTPParameterTypeTableView' => 'applications/config/view/PhabricatorHTTPParameterTypeTableView.php', ··· 7439 7441 'PhabricatorGuideApplication' => 'PhabricatorApplication', 7440 7442 'PhabricatorGuideController' => 'PhabricatorController', 7441 7443 'PhabricatorGuideInstallController' => 'PhabricatorGuideController', 7444 + 'PhabricatorGuideItemView' => 'Phobject', 7445 + 'PhabricatorGuideListView' => 'AphrontView', 7442 7446 'PhabricatorGuideQuickStartController' => 'PhabricatorGuideController', 7443 7447 'PhabricatorGuideWelcomeController' => 'PhabricatorGuideController', 7444 7448 'PhabricatorHTTPParameterTypeTableView' => 'AphrontView',
+154 -4
src/applications/guides/controller/PhabricatorGuideInstallController.php
··· 8 8 } 9 9 10 10 public function handleRequest(AphrontRequest $request) { 11 + require_celerity_resource('guides-app-css'); 11 12 $viewer = $request->getViewer(); 12 13 13 14 $title = pht('Installation Guide'); ··· 22 23 $crumbs = $this->buildApplicationCrumbs() 23 24 ->addTextCrumb(pht('Installation')); 24 25 25 - $content = null; 26 + $content = $this->getGuideContent($viewer); 26 27 27 28 $view = id(new PHUICMSView()) 28 29 ->setCrumbs($crumbs) ··· 37 38 38 39 } 39 40 40 - private function getGuideContent() { 41 + private function getGuideContent($viewer) { 42 + $guide_items = new PhabricatorGuideListView(); 43 + 44 + $title = pht('Resolve Setup Issues'); 45 + $issues_resolved = !PhabricatorSetupCheck::getOpenSetupIssueKeys(); 46 + $href = PhabricatorEnv::getURI('/config/issue/'); 47 + if ($issues_resolved) { 48 + $icon = 'fa-check'; 49 + $icon_bg = 'bg-green'; 50 + $skip = null; 51 + $description = pht( 52 + "You've resolved (or ignored) all outstanding setup issues."); 53 + } else { 54 + $icon = 'fa-warning'; 55 + $icon_bg = 'bg-red'; 56 + $skip = '#'; 57 + $description = 58 + pht('You have some unresolved setup issues to take care of.'); 59 + } 60 + 61 + $item = id(new PhabricatorGuideItemView()) 62 + ->setTitle($title) 63 + ->setHref($href) 64 + ->setIcon($icon) 65 + ->setIconBackground($icon_bg) 66 + ->setSkipHref($skip) 67 + ->setDescription($description); 68 + $guide_items->addItem($item); 69 + 70 + $configs = id(new PhabricatorAuthProviderConfigQuery()) 71 + ->setViewer(PhabricatorUser::getOmnipotentUser()) 72 + ->execute(); 73 + 74 + $title = pht('Login and Registration'); 75 + $href = PhabricatorEnv::getURI('/auth/'); 76 + $have_auth = (bool)$configs; 77 + if ($have_auth) { 78 + $icon = 'fa-check'; 79 + $icon_bg = 'bg-green'; 80 + $skip = null; 81 + $description = pht( 82 + "You've configured at least one authentication provider."); 83 + } else { 84 + $icon = 'fa-key'; 85 + $icon_bg = 'bg-sky'; 86 + $skip = '#'; 87 + $description = pht( 88 + 'Authentication providers allow users to register accounts and '. 89 + 'log in to Phabricator.'); 90 + } 91 + 92 + $item = id(new PhabricatorGuideItemView()) 93 + ->setTitle($title) 94 + ->setHref($href) 95 + ->setIcon($icon) 96 + ->setIconBackground($icon_bg) 97 + ->setSkipHref($skip) 98 + ->setDescription($description); 99 + $guide_items->addItem($item); 100 + 41 101 42 - $guide = null; 102 + $title = pht('Configure Phabricator'); 103 + $href = PhabricatorEnv::getURI('/config/'); 104 + 105 + // Just load any config value at all; if one exists the install has figured 106 + // out how to configure things. 107 + $have_config = (bool)id(new PhabricatorConfigEntry())->loadAllWhere( 108 + '1 = 1 LIMIT 1'); 43 109 44 - return $guide; 110 + if ($have_config) { 111 + $icon = 'fa-check'; 112 + $icon_bg = 'bg-green'; 113 + $skip = null; 114 + $description = pht( 115 + "You've configured at least one setting from the web interface."); 116 + } else { 117 + $icon = 'fa-sliders'; 118 + $icon_bg = 'bg-sky'; 119 + $skip = '#'; 120 + $description = pht( 121 + 'Learn how to configure mail and other options in Phabricator.'); 122 + } 123 + 124 + $item = id(new PhabricatorGuideItemView()) 125 + ->setTitle($title) 126 + ->setHref($href) 127 + ->setIcon($icon) 128 + ->setIconBackground($icon_bg) 129 + ->setSkipHref($skip) 130 + ->setDescription($description); 131 + $guide_items->addItem($item); 132 + 133 + 134 + $title = pht('User Account Settings'); 135 + $href = PhabricatorEnv::getURI('/settings/'); 136 + $preferences = id(new PhabricatorUserPreferencesQuery()) 137 + ->setViewer($viewer) 138 + ->withUsers(array($viewer)) 139 + ->executeOne(); 140 + 141 + $have_settings = ($preferences && $preferences->getPreferences()); 142 + if ($have_settings) { 143 + $icon = 'fa-check'; 144 + $icon_bg = 'bg-green'; 145 + $skip = null; 146 + $description = pht( 147 + "You've adjusted at least one setting on your account."); 148 + } else { 149 + $icon = 'fa-wrench'; 150 + $icon_bg = 'bg-sky'; 151 + $skip = '#'; 152 + $description = pht( 153 + 'Configure account settings for all users, or just yourself'); 154 + } 155 + 156 + $item = id(new PhabricatorGuideItemView()) 157 + ->setTitle($title) 158 + ->setHref($href) 159 + ->setIcon($icon) 160 + ->setIconBackground($icon_bg) 161 + ->setSkipHref($skip) 162 + ->setDescription($description); 163 + $guide_items->addItem($item); 164 + 165 + 166 + $title = pht('Notification Server'); 167 + $href = PhabricatorEnv::getURI('/config/notifications/'); 168 + // TODO: Wire up a notifications check 169 + $have_notifications = false; 170 + if ($have_notifications) { 171 + $icon = 'fa-check'; 172 + $icon_bg = 'bg-green'; 173 + $skip = null; 174 + $description = pht( 175 + "You've set up a real-time notification server."); 176 + } else { 177 + $icon = 'fa-bell'; 178 + $icon_bg = 'bg-sky'; 179 + $skip = '#'; 180 + $description = pht( 181 + 'Phabricator can deliver notifications in real-time with WebSockets.'); 182 + } 183 + 184 + $item = id(new PhabricatorGuideItemView()) 185 + ->setTitle($title) 186 + ->setHref($href) 187 + ->setIcon($icon) 188 + ->setIconBackground($icon_bg) 189 + ->setSkipHref($skip) 190 + ->setDescription($description); 191 + 192 + $guide_items->addItem($item); 193 + 194 + return $guide_items; 45 195 } 46 196 }
+168 -4
src/applications/guides/controller/PhabricatorGuideQuickStartController.php
··· 8 8 } 9 9 10 10 public function handleRequest(AphrontRequest $request) { 11 + require_celerity_resource('guides-app-css'); 11 12 $viewer = $request->getViewer(); 12 13 13 14 $title = pht('Quick Start Guide'); ··· 22 23 $crumbs = $this->buildApplicationCrumbs() 23 24 ->addTextCrumb(pht('Quick Start')); 24 25 25 - $content = null; 26 + $content = $this->getGuideContent($viewer); 26 27 27 28 $view = id(new PHUICMSView()) 28 29 ->setCrumbs($crumbs) ··· 37 38 38 39 } 39 40 40 - private function getGuideContent() { 41 + private function getGuideContent($viewer) { 42 + $guide_items = new PhabricatorGuideListView(); 43 + 44 + $title = pht('Configure Applications'); 45 + $apps_check = true; 46 + $href = PhabricatorEnv::getURI('/applications/'); 47 + if ($apps_check) { 48 + $icon = 'fa-check'; 49 + $icon_bg = 'bg-green'; 50 + $skip = null; 51 + $description = pht( 52 + "You've uninstalled any unneeded applications for now."); 53 + } else { 54 + $icon = 'fa-globe'; 55 + $icon_bg = 'bg-sky'; 56 + $skip = '#'; 57 + $description = 58 + pht('Use all our applications, or uninstall the ones you don\'t want.'); 59 + } 60 + 61 + $item = id(new PhabricatorGuideItemView()) 62 + ->setTitle($title) 63 + ->setHref($href) 64 + ->setIcon($icon) 65 + ->setIconBackground($icon_bg) 66 + ->setSkipHref($skip) 67 + ->setDescription($description); 68 + $guide_items->addItem($item); 41 69 42 - $guide = null; 43 70 44 - return $guide; 71 + $title = pht('Invite Collaborators'); 72 + $people_check = true; 73 + $href = PhabricatorEnv::getURI('/people/invite/'); 74 + if ($people_check) { 75 + $icon = 'fa-check'; 76 + $icon_bg = 'bg-green'; 77 + $skip = null; 78 + $description = pht( 79 + 'You will not be alone on this journey.'); 80 + } else { 81 + $icon = 'fa-group'; 82 + $icon_bg = 'bg-sky'; 83 + $skip = '#'; 84 + $description = 85 + pht('Invite the rest of your team to get started on Phabricator.'); 86 + } 87 + 88 + $item = id(new PhabricatorGuideItemView()) 89 + ->setTitle($title) 90 + ->setHref($href) 91 + ->setIcon($icon) 92 + ->setIconBackground($icon_bg) 93 + ->setSkipHref($skip) 94 + ->setDescription($description); 95 + $guide_items->addItem($item); 96 + 97 + 98 + $title = pht('Create a Repository'); 99 + $repository_check = true; 100 + $href = PhabricatorEnv::getURI('/diffusion/'); 101 + if ($repository_check) { 102 + $icon = 'fa-check'; 103 + $icon_bg = 'bg-green'; 104 + $skip = null; 105 + $description = pht( 106 + "You've created at least one repository."); 107 + } else { 108 + $icon = 'fa-code'; 109 + $icon_bg = 'bg-sky'; 110 + $skip = '#'; 111 + $description = 112 + pht('If you are here for code review, let\'s set up your first '. 113 + 'repository.'); 114 + } 115 + 116 + $item = id(new PhabricatorGuideItemView()) 117 + ->setTitle($title) 118 + ->setHref($href) 119 + ->setIcon($icon) 120 + ->setIconBackground($icon_bg) 121 + ->setSkipHref($skip) 122 + ->setDescription($description); 123 + $guide_items->addItem($item); 124 + 125 + 126 + $title = pht('Create a Project'); 127 + $project_check = true; 128 + $href = PhabricatorEnv::getURI('/project/'); 129 + if ($project_check) { 130 + $icon = 'fa-check'; 131 + $icon_bg = 'bg-green'; 132 + $skip = null; 133 + $description = pht( 134 + "You've created at least one project."); 135 + } else { 136 + $icon = 'fa-briefcase'; 137 + $icon_bg = 'bg-sky'; 138 + $skip = '#'; 139 + $description = 140 + pht('Project tags define everything. Create them for teams, tags, '. 141 + 'or actual projects.'); 142 + } 143 + 144 + $item = id(new PhabricatorGuideItemView()) 145 + ->setTitle($title) 146 + ->setHref($href) 147 + ->setIcon($icon) 148 + ->setIconBackground($icon_bg) 149 + ->setSkipHref($skip) 150 + ->setDescription($description); 151 + $guide_items->addItem($item); 152 + 153 + 154 + $title = pht('Build a Dashboard'); 155 + $dashboard_check = true; 156 + $href = PhabricatorEnv::getURI('/dashboard/'); 157 + if ($dashboard_check) { 158 + $icon = 'fa-check'; 159 + $icon_bg = 'bg-green'; 160 + $skip = null; 161 + $description = pht( 162 + "You've created at least one dashboard."); 163 + } else { 164 + $icon = 'fa-dashboard'; 165 + $icon_bg = 'bg-sky'; 166 + $skip = '#'; 167 + $description = 168 + pht('Customize the default homepage layout and items.'); 169 + } 170 + 171 + $item = id(new PhabricatorGuideItemView()) 172 + ->setTitle($title) 173 + ->setHref($href) 174 + ->setIcon($icon) 175 + ->setIconBackground($icon_bg) 176 + ->setSkipHref($skip) 177 + ->setDescription($description); 178 + $guide_items->addItem($item); 179 + 180 + 181 + $title = pht('Personalize your Install'); 182 + $ui_check = true; 183 + $href = PhabricatorEnv::getURI('/config/group/ui/'); 184 + if ($dashboard_check) { 185 + $icon = 'fa-check'; 186 + $icon_bg = 'bg-green'; 187 + $skip = null; 188 + $description = pht( 189 + 'It looks amazing, good work. Home Sweet Home.'); 190 + } else { 191 + $icon = 'fa-home'; 192 + $icon_bg = 'bg-sky'; 193 + $skip = '#'; 194 + $description = 195 + pht('Change the name and add your company logo, just to give it a '. 196 + 'little extra polish.'); 197 + } 198 + 199 + $item = id(new PhabricatorGuideItemView()) 200 + ->setTitle($title) 201 + ->setHref($href) 202 + ->setIcon($icon) 203 + ->setIconBackground($icon_bg) 204 + ->setSkipHref($skip) 205 + ->setDescription($description); 206 + $guide_items->addItem($item); 207 + 208 + return $guide_items; 45 209 } 46 210 }
+11 -4
src/applications/guides/controller/PhabricatorGuideWelcomeController.php
··· 8 8 } 9 9 10 10 public function handleRequest(AphrontRequest $request) { 11 + require_celerity_resource('guides-app-css'); 11 12 $viewer = $request->getViewer(); 12 13 13 14 $title = pht('Welcome to Phabricator'); ··· 22 23 $crumbs = $this->buildApplicationCrumbs() 23 24 ->addTextCrumb(pht('Welcome')); 24 25 25 - $content = null; 26 + $content = id(new PHUIDocumentViewPro()) 27 + ->appendChild($this->getGuideContent($viewer)); 26 28 27 29 $view = id(new PHUICMSView()) 28 30 ->setCrumbs($crumbs) ··· 37 39 38 40 } 39 41 40 - private function getGuideContent() { 42 + private function getGuideContent($viewer) { 41 43 42 - $guide = null; 44 + $content = pht( 45 + 'You have successfully installed Phabricator. These next guides will '. 46 + 'take you through configuration and new user orientation. '. 47 + 'These steps are optional, and you can go through them in any order. '. 48 + 'If you want to get back to this guide later on, you can find it in '. 49 + 'the **Config** application under **Welcome Guide**.'); 43 50 44 - return $guide; 51 + return new PHUIRemarkupView($viewer, $content); 45 52 } 46 53 }
+67
src/applications/guides/view/PhabricatorGuideItemView.php
··· 1 + <?php 2 + 3 + final class PhabricatorGuideItemView extends Phobject { 4 + 5 + private $title; 6 + private $href; 7 + private $description; 8 + private $icon; 9 + private $iconBackground; 10 + private $skipHref; 11 + 12 + public function setTitle($title) { 13 + $this->title = $title; 14 + return $this; 15 + } 16 + 17 + public function setDescription($description) { 18 + $this->description = $description; 19 + return $this; 20 + } 21 + 22 + public function setHref($href) { 23 + $this->href = $href; 24 + return $this; 25 + } 26 + 27 + public function setIcon($icon) { 28 + $this->icon = $icon; 29 + return $this; 30 + } 31 + 32 + public function setIconBackground($background) { 33 + $this->iconBackground = $background; 34 + return $this; 35 + } 36 + 37 + public function setSkipHref($href) { 38 + $this->skipHref = $href; 39 + return $this; 40 + } 41 + 42 + public function getTitle() { 43 + return $this->title; 44 + } 45 + 46 + public function getDescription() { 47 + return $this->description; 48 + } 49 + 50 + public function getHref() { 51 + return $this->href; 52 + } 53 + 54 + public function getIcon() { 55 + return $this->icon; 56 + } 57 + 58 + public function getIconBackground() { 59 + return $this->iconBackground; 60 + } 61 + 62 + public function getSkipHref() { 63 + return $this->skipHref; 64 + } 65 + 66 + 67 + }
+45
src/applications/guides/view/PhabricatorGuideListView.php
··· 1 + <?php 2 + 3 + final class PhabricatorGuideListView extends AphrontView { 4 + 5 + private $items = array(); 6 + 7 + public function addItem(PhabricatorGuideItemView $item) { 8 + $this->items[] = $item; 9 + return $this; 10 + } 11 + 12 + public function render() { 13 + require_celerity_resource('guides-app-css'); 14 + 15 + $list = id(new PHUIObjectItemListView()) 16 + ->addClass('guides-app'); 17 + 18 + foreach ($this->items as $item) { 19 + $icon = id(new PHUIIconView()) 20 + ->setIcon($item->getIcon()) 21 + ->setBackground($item->getIconBackground()); 22 + 23 + $list_item = id(new PHUIObjectItemView()) 24 + ->setHeader($item->getTitle()) 25 + ->setHref($item->getHref()) 26 + ->setImageIcon($icon) 27 + ->addAttribute($item->getDescription()); 28 + 29 + $skip_href = $item->getSkipHref(); 30 + if ($skip_href) { 31 + $skip = id(new PHUIButtonView()) 32 + ->setText(pht('Skip')) 33 + ->setTag('a') 34 + ->setHref($skip_href) 35 + ->setColor(PHUIButtonView::GREY); 36 + $list_item->setLaunchButton($skip); 37 + } 38 + $list->addItem($list_item); 39 + } 40 + 41 + return $list; 42 + 43 + } 44 + 45 + }
+34
webroot/rsrc/css/application/guides/guides.css
··· 1 + /** 2 + * @provides guides-app-css 3 + */ 4 + 5 + .guides-app ul.phui-object-item-list-view { 6 + margin: 0; 7 + padding: 20px; 8 + } 9 + 10 + .guides-app .phui-object-item-no-bar .phui-object-item-frame { 11 + border: 0; 12 + } 13 + 14 + .guides-app .phui-object-item-image-icon { 15 + margin: 8px 2px 12px; 16 + } 17 + 18 + .guides-app a.phui-object-item-link { 19 + color: #000; 20 + font-size: {$biggestfontsize}; 21 + } 22 + 23 + .guides-app .phui-object-item-name { 24 + padding-top: 6px; 25 + } 26 + 27 + .guides-app .phui-object-item-launch-button a.button { 28 + font-size: {$normalfontsize}; 29 + padding: 3px 12px 4px; 30 + } 31 + 32 + .device-desktop .guides-app .phui-object-item { 33 + margin-bottom: 8px; 34 + }
+3 -2
webroot/rsrc/css/phui/phui-cms.css
··· 35 35 border: none; 36 36 } 37 37 38 - .phui-cms-view .phui-profile-header { 38 + .phui-cms-view .phui-cms-page-content .phui-profile-header { 39 39 padding: 32px 20px; 40 40 border-bottom: 1px solid {$thinblueborder}; 41 41 } 42 42 43 43 .phui-cms-view .phui-document-view.phui-document-view-pro { 44 44 width: auto; 45 - padding: 32px 20px; 45 + max-width: inherit; 46 + padding: 0 20px; 46 47 margin: 0; 47 48 }