mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-10 11:24:49 +01:00
Fix packages base uri and introduce a console for that base uri
Summary: The packages base uri is /packages/. Previously, the base uri pointed to the packages search engine. Because that prevents navigating to the publishers search engine and the versions search engine and because the new base uri is a 404, add a console, similar to Almanac or Nuance to link to these endpoints. This makes the forms for publishers and versions accessible without manually navigating there. Test Plan: * Clicked on the Packages application in Applications and saw a Console * Clicked on the options in the console and saw all search engines * Clicked on the packages crumb and got sent to the console * Created a package and clicked on Edit Package and didn't see a 404 Reviewers: O1 Blessed Committers, aklapper Reviewed By: O1 Blessed Committers, aklapper Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Differential Revision: https://we.phorge.it/D25881
This commit is contained in:
parent
e99e9a3003
commit
955ec77760
3 changed files with 72 additions and 1 deletions
|
@ -4057,6 +4057,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPHPConfigSetupCheck' => 'applications/config/check/PhabricatorPHPConfigSetupCheck.php',
|
||||
'PhabricatorPHPPreflightSetupCheck' => 'applications/config/check/PhabricatorPHPPreflightSetupCheck.php',
|
||||
'PhabricatorPackagesApplication' => 'applications/packages/application/PhabricatorPackagesApplication.php',
|
||||
'PhabricatorPackagesConsoleController' => 'applications/packages/controller/PhabricatorPackagesConsoleController.php',
|
||||
'PhabricatorPackagesController' => 'applications/packages/controller/PhabricatorPackagesController.php',
|
||||
'PhabricatorPackagesCreatePublisherCapability' => 'applications/packages/capability/PhabricatorPackagesCreatePublisherCapability.php',
|
||||
'PhabricatorPackagesDAO' => 'applications/packages/storage/PhabricatorPackagesDAO.php',
|
||||
|
@ -10611,6 +10612,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPHPConfigSetupCheck' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorPHPPreflightSetupCheck' => 'PhabricatorSetupCheck',
|
||||
'PhabricatorPackagesApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorPackagesConsoleController' => 'PhabricatorPackagesController',
|
||||
'PhabricatorPackagesController' => 'PhabricatorController',
|
||||
'PhabricatorPackagesCreatePublisherCapability' => 'PhabricatorPolicyCapability',
|
||||
'PhabricatorPackagesDAO' => 'PhabricatorLiskDAO',
|
||||
|
|
|
@ -15,7 +15,7 @@ final class PhabricatorPackagesApplication extends PhabricatorApplication {
|
|||
}
|
||||
|
||||
public function getBaseURI() {
|
||||
return '/packages/package/';
|
||||
return '/packages/';
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
|
@ -64,6 +64,7 @@ final class PhabricatorPackagesApplication extends PhabricatorApplication {
|
|||
),
|
||||
),
|
||||
'/packages/' => array(
|
||||
'' => 'PhabricatorPackagesConsoleController',
|
||||
'publisher/' => array(
|
||||
$this->getQueryRoutePattern() =>
|
||||
'PhabricatorPackagesPublisherListController',
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorPackagesConsoleController
|
||||
extends PhabricatorPackagesController {
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$menu = id(new PHUIObjectItemListView())
|
||||
->setViewer($viewer)
|
||||
->setBig(true);
|
||||
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Publishers'))
|
||||
->setHref($this->getApplicationURI('publisher/'))
|
||||
->setImageIcon('fa-institution')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'Manage software publishers.')));
|
||||
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Packages'))
|
||||
->setHref($this->getApplicationURI('package/'))
|
||||
->setImageIcon('fa-gift')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'Create and update software packages.')));
|
||||
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Versions'))
|
||||
->setHref($this->getApplicationURI('version/'))
|
||||
->setImageIcon('fa-birthday-cake')
|
||||
->setClickable(true)
|
||||
->addAttribute(
|
||||
pht(
|
||||
'Release and update package versions.')));
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Console'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Packages Console'))
|
||||
->setBackground(PHUIObjectBoxView::WHITE_CONFIG)
|
||||
->setObjectList($menu);
|
||||
|
||||
$launcher_view = id(new PHUILauncherView())
|
||||
->appendChild($box);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setFooter($launcher_view);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle(pht('Packages Console'))
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue