Skip to content

Commit 56bc84a

Browse files
author
Chad Little
committed
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
1 parent f379858 commit 56bc84a

File tree

9 files changed

+490
-16
lines changed

9 files changed

+490
-16
lines changed

resources/celerity/map.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
'rsrc/css/application/feed/feed.css' => 'ecd4ec57',
7171
'rsrc/css/application/files/global-drag-and-drop.css' => '5c1b47c2',
7272
'rsrc/css/application/flag/flag.css' => '5337623f',
73+
'rsrc/css/application/guides/guides.css' => '1d5414e5',
7374
'rsrc/css/application/harbormaster/harbormaster.css' => 'f491c9f4',
7475
'rsrc/css/application/herald/herald-test.css' => 'a52e323e',
7576
'rsrc/css/application/herald/herald.css' => 'dc31f6e9',
@@ -127,7 +128,7 @@
127128
'rsrc/css/phui/phui-box.css' => '5c8387cf',
128129
'rsrc/css/phui/phui-button.css' => '4a5fbe3d',
129130
'rsrc/css/phui/phui-chart.css' => '6bf6f78e',
130-
'rsrc/css/phui/phui-cms.css' => '33064557',
131+
'rsrc/css/phui/phui-cms.css' => 'be43c8a8',
131132
'rsrc/css/phui/phui-crumbs-view.css' => '9dac418c',
132133
'rsrc/css/phui/phui-curtain-view.css' => '7148ae25',
133134
'rsrc/css/phui/phui-document-pro.css' => 'dc3d46ed',
@@ -573,6 +574,7 @@
573574
'font-fontawesome' => '2b7ebbcc',
574575
'font-lato' => 'c7ccd872',
575576
'global-drag-and-drop-css' => '5c1b47c2',
577+
'guides-app-css' => '1d5414e5',
576578
'harbormaster-css' => 'f491c9f4',
577579
'herald-css' => 'dc31f6e9',
578580
'herald-rule-editor' => 'd6a7e717',
@@ -833,7 +835,7 @@
833835
'phui-calendar-list-css' => 'fcc9fb41',
834836
'phui-calendar-month-css' => '8e10e92c',
835837
'phui-chart-css' => '6bf6f78e',
836-
'phui-cms-css' => '33064557',
838+
'phui-cms-css' => 'be43c8a8',
837839
'phui-crumbs-view-css' => '9dac418c',
838840
'phui-curtain-view-css' => '7148ae25',
839841
'phui-document-summary-view-css' => '9ca48bdf',

src/__phutil_library_map__.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,6 +2633,8 @@
26332633
'PhabricatorGuideApplication' => 'applications/guides/application/PhabricatorGuideApplication.php',
26342634
'PhabricatorGuideController' => 'applications/guides/controller/PhabricatorGuideController.php',
26352635
'PhabricatorGuideInstallController' => 'applications/guides/controller/PhabricatorGuideInstallController.php',
2636+
'PhabricatorGuideItemView' => 'applications/guides/view/PhabricatorGuideItemView.php',
2637+
'PhabricatorGuideListView' => 'applications/guides/view/PhabricatorGuideListView.php',
26362638
'PhabricatorGuideQuickStartController' => 'applications/guides/controller/PhabricatorGuideQuickStartController.php',
26372639
'PhabricatorGuideWelcomeController' => 'applications/guides/controller/PhabricatorGuideWelcomeController.php',
26382640
'PhabricatorHTTPParameterTypeTableView' => 'applications/config/view/PhabricatorHTTPParameterTypeTableView.php',
@@ -7439,6 +7441,8 @@
74397441
'PhabricatorGuideApplication' => 'PhabricatorApplication',
74407442
'PhabricatorGuideController' => 'PhabricatorController',
74417443
'PhabricatorGuideInstallController' => 'PhabricatorGuideController',
7444+
'PhabricatorGuideItemView' => 'Phobject',
7445+
'PhabricatorGuideListView' => 'AphrontView',
74427446
'PhabricatorGuideQuickStartController' => 'PhabricatorGuideController',
74437447
'PhabricatorGuideWelcomeController' => 'PhabricatorGuideController',
74447448
'PhabricatorHTTPParameterTypeTableView' => 'AphrontView',

src/applications/guides/controller/PhabricatorGuideInstallController.php

Lines changed: 154 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public function shouldAllowPublic() {
88
}
99

1010
public function handleRequest(AphrontRequest $request) {
11+
require_celerity_resource('guides-app-css');
1112
$viewer = $request->getViewer();
1213

1314
$title = pht('Installation Guide');
@@ -22,7 +23,7 @@ public function handleRequest(AphrontRequest $request) {
2223
$crumbs = $this->buildApplicationCrumbs()
2324
->addTextCrumb(pht('Installation'));
2425

25-
$content = null;
26+
$content = $this->getGuideContent($viewer);
2627

2728
$view = id(new PHUICMSView())
2829
->setCrumbs($crumbs)
@@ -37,10 +38,159 @@ public function handleRequest(AphrontRequest $request) {
3738

3839
}
3940

40-
private function getGuideContent() {
41+
private function getGuideContent($viewer) {
42+
$guide_items = new PhabricatorGuideListView();
4143

42-
$guide = null;
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+
}
4360

44-
return $guide;
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+
101+
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');
109+
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;
45195
}
46196
}

0 commit comments

Comments
 (0)