diff --git a/resources/sql/autopatches/20190412.dashboard.02.install.sql b/resources/sql/autopatches/20190412.dashboard.02.install.sql new file mode 100644 --- /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 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2924,7 +2924,6 @@ '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 @@ '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 --- a/src/applications/dashboard/storage/PhabricatorDashboard.php +++ b/src/applications/dashboard/storage/PhabricatorDashboard.php @@ -172,17 +172,7 @@ 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 --- 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 --- a/src/applications/guides/module/PhabricatorGuideQuickStartModule.php +++ b/src/applications/guides/module/PhabricatorGuideQuickStartModule.php @@ -103,33 +103,6 @@ ->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/');