1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Remove legacy "DashboardInstall" table

Summary: Depends on D20409. Ref T13272. Before "ProfileMenu", dashboards were installed on specific objects using this table. Installs are now handled via ProfileMenu and this table no longer has any meaningful readers. Remove references to the table and destroy it.

Test Plan: Grepped for `DashboardInstall`.

Reviewers: amckinley

Reviewed By: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13272

Differential Revision: https://secure.phabricator.com/D20410
This commit is contained in:
epriestley 2019-04-12 12:22:20 -07:00
parent fb994909cf
commit 80b7274e0b
5 changed files with 2 additions and 91 deletions

View file

@ -0,0 +1 @@
DROP TABLE IF EXISTS {$NAMESPACE}_dashboard.dashboard_install;

View file

@ -2924,7 +2924,6 @@ phutil_register_library_map(array(
'PhabricatorDashboardHomeInstallWorkflow' => 'applications/dashboard/install/PhabricatorDashboardHomeInstallWorkflow.php',
'PhabricatorDashboardIconSet' => 'applications/dashboard/icon/PhabricatorDashboardIconSet.php',
'PhabricatorDashboardIconTransaction' => 'applications/dashboard/xaction/dashboard/PhabricatorDashboardIconTransaction.php',
'PhabricatorDashboardInstall' => 'applications/dashboard/storage/PhabricatorDashboardInstall.php',
'PhabricatorDashboardInstallController' => 'applications/dashboard/controller/dashboard/PhabricatorDashboardInstallController.php',
'PhabricatorDashboardInstallWorkflow' => 'applications/dashboard/install/PhabricatorDashboardInstallWorkflow.php',
'PhabricatorDashboardLayoutMode' => 'applications/dashboard/layoutconfig/PhabricatorDashboardLayoutMode.php',
@ -8922,7 +8921,6 @@ phutil_register_library_map(array(
'PhabricatorDashboardHomeInstallWorkflow' => 'PhabricatorDashboardApplicationInstallWorkflow',
'PhabricatorDashboardIconSet' => 'PhabricatorIconSet',
'PhabricatorDashboardIconTransaction' => 'PhabricatorDashboardTransactionType',
'PhabricatorDashboardInstall' => 'PhabricatorDashboardDAO',
'PhabricatorDashboardInstallController' => 'PhabricatorDashboardController',
'PhabricatorDashboardInstallWorkflow' => 'Phobject',
'PhabricatorDashboardLayoutMode' => 'Phobject',

View file

@ -172,17 +172,7 @@ final class PhabricatorDashboard extends PhabricatorDashboardDAO
public function destroyObjectPermanently(
PhabricatorDestructionEngine $engine) {
$this->openTransaction();
$installs = id(new PhabricatorDashboardInstall())->loadAllWhere(
'dashboardPHID = %s',
$this->getPHID());
foreach ($installs as $install) {
$install->delete();
}
$this->delete();
$this->saveTransaction();
}

View file

@ -1,51 +0,0 @@
<?php
/**
* An install of a dashboard. Examples might be
* - the home page for a user
* - the profile page for a user
* - the profile page for a project
*/
final class PhabricatorDashboardInstall
extends PhabricatorDashboardDAO {
protected $installerPHID;
protected $objectPHID;
protected $applicationClass;
protected $dashboardPHID;
protected function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'applicationClass' => 'text64',
),
self::CONFIG_KEY_SCHEMA => array(
'objectPHID' => array(
'columns' => array('objectPHID', 'applicationClass'),
'unique' => true,
),
),
) + parent::getConfiguration();
}
public static function getDashboard(
PhabricatorUser $viewer,
$object_phid,
$application_class) {
$dashboard = null;
$dashboard_install = id(new PhabricatorDashboardInstall())
->loadOneWhere(
'objectPHID = %s AND applicationClass = %s',
$object_phid,
$application_class);
if ($dashboard_install) {
$dashboard = id(new PhabricatorDashboardQuery())
->setViewer($viewer)
->withPHIDs(array($dashboard_install->getDashboardPHID()))
->executeOne();
}
return $dashboard;
}
}

View file

@ -103,33 +103,6 @@ final class PhabricatorGuideQuickStartModule extends PhabricatorGuideModule {
->setDescription($description);
$guide_items->addItem($item);
$title = pht('Build a Dashboard');
$have_dashboard = (bool)PhabricatorDashboardInstall::getDashboard(
$viewer,
PhabricatorHomeApplication::DASHBOARD_DEFAULT,
'PhabricatorHomeApplication');
$href = PhabricatorEnv::getURI('/dashboard/');
if ($have_dashboard) {
$icon = 'fa-check';
$icon_bg = 'bg-green';
$description = pht(
"You've created at least one dashboard.");
} else {
$icon = 'fa-dashboard';
$icon_bg = 'bg-sky';
$description =
pht('Customize the default homepage layout and items.');
}
$item = id(new PhabricatorGuideItemView())
->setTitle($title)
->setHref($href)
->setIcon($icon)
->setIconBackground($icon_bg)
->setDescription($description);
$guide_items->addItem($item);
$title = pht('Personalize your Install');
$wordmark = PhabricatorEnv::getEnvConfig('ui.logo');
$href = PhabricatorEnv::getURI('/config/edit/ui.logo/');