From 80b7274e0bf6e0c3815d59e2c3293db7ec11250b Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 12 Apr 2019 12:22:20 -0700 Subject: [PATCH] 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 --- .../20190412.dashboard.02.install.sql | 1 + src/__phutil_library_map__.php | 2 - .../storage/PhabricatorDashboard.php | 12 +---- .../storage/PhabricatorDashboardInstall.php | 51 ------------------- .../PhabricatorGuideQuickStartModule.php | 27 ---------- 5 files changed, 2 insertions(+), 91 deletions(-) create mode 100644 resources/sql/autopatches/20190412.dashboard.02.install.sql delete mode 100644 src/applications/dashboard/storage/PhabricatorDashboardInstall.php diff --git a/resources/sql/autopatches/20190412.dashboard.02.install.sql b/resources/sql/autopatches/20190412.dashboard.02.install.sql new file mode 100644 index 0000000000..be3363d5c3 --- /dev/null +++ b/resources/sql/autopatches/20190412.dashboard.02.install.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS {$NAMESPACE}_dashboard.dashboard_install; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 38704f4a26..ffc4ba3c0e 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -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', diff --git a/src/applications/dashboard/storage/PhabricatorDashboard.php b/src/applications/dashboard/storage/PhabricatorDashboard.php index 9d9ef27ede..c312cf5e2c 100644 --- a/src/applications/dashboard/storage/PhabricatorDashboard.php +++ b/src/applications/dashboard/storage/PhabricatorDashboard.php @@ -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(); + $this->delete(); } diff --git a/src/applications/dashboard/storage/PhabricatorDashboardInstall.php b/src/applications/dashboard/storage/PhabricatorDashboardInstall.php deleted file mode 100644 index f8a808cecc..0000000000 --- a/src/applications/dashboard/storage/PhabricatorDashboardInstall.php +++ /dev/null @@ -1,51 +0,0 @@ - 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; - } -} diff --git a/src/applications/guides/module/PhabricatorGuideQuickStartModule.php b/src/applications/guides/module/PhabricatorGuideQuickStartModule.php index 8c4b4c2606..65b07ffe2c 100644 --- a/src/applications/guides/module/PhabricatorGuideQuickStartModule.php +++ b/src/applications/guides/module/PhabricatorGuideQuickStartModule.php @@ -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/'); -- 2.51.2