From 68762e820417d4c84c2edd3d46c2734a58c8c906 Mon Sep 17 00:00:00 2001 From: Valerio Bozzolan Date: Tue, 25 Jun 2024 09:27:54 +0200 Subject: [PATCH] Drydock and Almanac: add welcome pages Summary: Premising that I still consider Almanac, Drydock and Harbormaster as dark magic, and premising that all my knowledge about these components is here: https://en.wikibooks.org/wiki/Phabricator_Administrator%27s_Handbook/Continuous_integration (Above guide linked from [[Community Resources]]) Hoping to be useful, I've added some welcome pages, precious to newcomers, with the goal to lower a bit the learning barrier to these tricky components. ## Drydock Blueprints Screenshot of the new welcome page in {nav Drydock > Blueprints}: {F2243109} Since Drydock Blueprints are deeply dependent to {nav Almanac}, we added an extra blue button to see its homepage. So, you are then 2-clicks away from... ## Almanac Services Screenshot of the new welcome page in {nav Almanac > Services}: {F2243110} Since Almanac Services are deeply dependent to {nav Almanac > Devices}, we added an extra blue button to see them. So, you are then 1-click away from... ## Almanac Devices Screenshot of the new welcome page in {nav Almanac > Devices}: {F2243112} Since Almanac Devices are deeply dependent to {nav Almanac > Networks}, we added an extra blue button to see them. So, you are then 1-click away from... ## Almanac Networks Screenshot of the new welcome page in {nav Almanac Networks}: {F2243111} And, that's it. ## Notes Ref T15018 ---- After this change, at least 1 newcomer will love Phorge at the maximum level. and they will never again be able to use the proprietary GitHub. bwahaha Test Plan: Visit all the following pages, forcing the welcome "new user interface" mode: http://phorge.localhost/drydock/blueprint/?nux=1 http://phorge.localhost/almanac/service/?nux=1 http://phorge.localhost/almanac/device/?nux=1 http://phorge.localhost/almanac/network/?nux=1 Test all action buttons. Write a comment with "yesyes" or "bwahaha" or "chadyes" in production too. Reviewers: O1 Blessed Committers, aklapper Reviewed By: O1 Blessed Committers, aklapper Subscribers: aklapper, tobiaswiese, Matthew, Cigaryno Maniphest Tasks: T15018 Differential Revision: https://we.phorge.it/D25675 --- .../query/AlmanacDeviceSearchEngine.php | 26 +++++++++++++++++ .../query/AlmanacNetworkSearchEngine.php | 21 ++++++++++++++ .../query/AlmanacServiceSearchEngine.php | 28 +++++++++++++++++++ .../query/DrydockBlueprintSearchEngine.php | 28 +++++++++++++++++++ 4 files changed, 103 insertions(+) diff --git a/src/applications/almanac/query/AlmanacDeviceSearchEngine.php b/src/applications/almanac/query/AlmanacDeviceSearchEngine.php index 86633ac870..b4f7836720 100644 --- a/src/applications/almanac/query/AlmanacDeviceSearchEngine.php +++ b/src/applications/almanac/query/AlmanacDeviceSearchEngine.php @@ -137,4 +137,30 @@ final class AlmanacDeviceSearchEngine return $result; } + protected function getNewUserBody() { + $see_network = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('See Networks')) + ->setHref('/almanac/network/'); + + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Device')) + ->setHref('/almanac/device/edit/') + ->setIcon('fa-plus') + ->setColor(PHUIButtonView::GREEN); + + $app_name = pht('Devices'); + $view = id(new PHUIBigInfoView()) + ->setIcon('fa-server') + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht( + 'Use Almanac devices to catalogue your build hosts '. + 'and their SSH ports your network, and more.')) + ->addAction($see_network) + ->addAction($create_button); + + return $view; + } } diff --git a/src/applications/almanac/query/AlmanacNetworkSearchEngine.php b/src/applications/almanac/query/AlmanacNetworkSearchEngine.php index 5938fd44c7..7bb8b85116 100644 --- a/src/applications/almanac/query/AlmanacNetworkSearchEngine.php +++ b/src/applications/almanac/query/AlmanacNetworkSearchEngine.php @@ -87,4 +87,25 @@ final class AlmanacNetworkSearchEngine return $result; } + + protected function getNewUserBody() { + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Network')) + ->setHref('/almanac/network/edit/') + ->setIcon('fa-plus') + ->setColor(PHUIButtonView::GREEN); + + $app_name = pht('Networks'); + $view = id(new PHUIBigInfoView()) + ->setIcon('fa-globe') + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht( + 'Use Almanac networks to catalogue private and public '. + 'computer networks.')) + ->addAction($create_button); + + return $view; + } } diff --git a/src/applications/almanac/query/AlmanacServiceSearchEngine.php b/src/applications/almanac/query/AlmanacServiceSearchEngine.php index f9786a87d2..46a9ebfbad 100644 --- a/src/applications/almanac/query/AlmanacServiceSearchEngine.php +++ b/src/applications/almanac/query/AlmanacServiceSearchEngine.php @@ -115,4 +115,32 @@ final class AlmanacServiceSearchEngine return $result; } + + protected function getNewUserBody() { + $see_devices = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('See Devices')) + ->setHref('/almanac/device/'); + + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Service')) + ->setHref('/almanac/service/edit/') + ->setIcon('fa-plus') + ->setColor(PHUIButtonView::GREEN); + + + $app_name = pht('Services'); + $view = id(new PHUIBigInfoView()) + ->setIcon('fa-plug') + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht( + 'Services describe pools of devices, and '. + 'they are available to Drydock for CI/CD, and more.')) + ->addAction($see_devices) + ->addAction($create_button); + + return $view; + } } diff --git a/src/applications/drydock/query/DrydockBlueprintSearchEngine.php b/src/applications/drydock/query/DrydockBlueprintSearchEngine.php index 244afcb986..f556f90146 100644 --- a/src/applications/drydock/query/DrydockBlueprintSearchEngine.php +++ b/src/applications/drydock/query/DrydockBlueprintSearchEngine.php @@ -138,4 +138,32 @@ final class DrydockBlueprintSearchEngine return $result; } + protected function getNewUserBody() { + $see_almanac_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('See Almanac services')) + ->setHref('/almanac/service/'); + + $create_button = id(new PHUIButtonView()) + ->setTag('a') + ->setText(pht('Create a Blueprint')) + ->setHref('/drydock/blueprint/edit/') + ->setIcon('fa-plus') + ->setColor(PHUIButtonView::GREEN); + + $app_name = pht('Blueprints'); + $view = id(new PHUIBigInfoView()) + ->setIcon('fa-map-o') + ->setTitle(pht('Welcome to %s', $app_name)) + ->setDescription( + pht( + 'Blueprints allow to lease fresh working copies of repositories, '. + 'on your Drydock devices, when needed by CI/CD workflows, and more. '. + 'Blueprints lease services defined in your Almanac.')) + ->addAction($see_almanac_button) + ->addAction($create_button); + + return $view; + } + }