mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-28 22:49:16 +01:00
Summary: Depends on D20362. Ref T13272. Currently, Dashboards have an "Install Dashboard" flow which is pretty janky and only allows you to install things to the home page. Instead, allow users to install things to any valid target (home, favorites, portals, projects). This also provides URIs like `dashboard/install/1/home/personal/` which allow you to link users to an "install a dashboard" page; this may or may not get used. Test Plan: Installed dashboards on home, favorites, projects, and portals. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13272 Differential Revision: https://secure.phabricator.com/D20364
83 lines
2.3 KiB
PHP
83 lines
2.3 KiB
PHP
<?php
|
|
|
|
final class PhabricatorDashboardHomeInstallWorkflow
|
|
extends PhabricatorDashboardApplicationInstallWorkflow {
|
|
|
|
const WORKFLOWKEY = 'home';
|
|
|
|
public function getOrder() {
|
|
return 1000;
|
|
}
|
|
|
|
protected function newWorkflowMenuItem() {
|
|
return $this->newMenuItem()
|
|
->setHeader(pht('Add to Home Page Menu'))
|
|
->setImageIcon('fa-home')
|
|
->addAttribute(
|
|
pht(
|
|
'Add this dashboard to the menu on the home page.'));
|
|
}
|
|
|
|
protected function newProfileEngine() {
|
|
return new PhabricatorHomeProfileMenuEngine();
|
|
}
|
|
|
|
protected function newApplication() {
|
|
return new PhabricatorHomeApplication();
|
|
}
|
|
|
|
protected function newApplicationModeDialog() {
|
|
return $this->newDialog()
|
|
->setTitle(pht('Add Dashboard to Home Menu'));
|
|
}
|
|
|
|
protected function newPersonalMenuItem() {
|
|
return $this->newMenuItem()
|
|
->setHeader(pht('Add to Personal Home Menu'))
|
|
->setImageIcon('fa-user')
|
|
->addAttribute(
|
|
pht(
|
|
'Add this dashboard to your list of personal home menu items, '.
|
|
'visible to only you.'));
|
|
}
|
|
|
|
protected function newGlobalMenuItem() {
|
|
return $this->newMenuItem()
|
|
->setHeader(pht('Add to Global Home Menu'))
|
|
->setImageIcon('fa-globe')
|
|
->addAttribute(
|
|
pht(
|
|
'Add this dashboard to the global home menu, visible to all '.
|
|
'users.'));
|
|
}
|
|
|
|
protected function newGlobalPermissionDialog() {
|
|
return $this->newDialog()
|
|
->setTitle(pht('No Permission'))
|
|
->appendParagraph(
|
|
pht(
|
|
'You do not have permission to install items on the global home '.
|
|
'menu.'));
|
|
}
|
|
|
|
protected function newGlobalConfirmDialog() {
|
|
return $this->newDialog()
|
|
->setTitle(pht('Add Dashboard to Global Home Page'))
|
|
->appendParagraph(
|
|
pht(
|
|
'Add dashboard %s as a global menu item on the home page?',
|
|
$this->getDashboardDisplayName()))
|
|
->addSubmitButton(pht('Add to Home'));
|
|
}
|
|
|
|
protected function newPersonalConfirmDialog() {
|
|
return $this->newDialog()
|
|
->setTitle(pht('Add Dashboard to Personal Home Page'))
|
|
->appendParagraph(
|
|
pht(
|
|
'Add dashboard %s as a personal menu item on your home page?',
|
|
$this->getDashboardDisplayName()))
|
|
->addSubmitButton(pht('Add to Home'));
|
|
}
|
|
|
|
}
|