]> source.dussan.org Git - nextcloud-server.git/commitdiff
Load sidebar on dashboard
authorJulius Härtl <jus@bitgrid.net>
Wed, 5 Aug 2020 05:51:24 +0000 (07:51 +0200)
committerJulius Härtl <jus@bitgrid.net>
Wed, 5 Aug 2020 15:03:38 +0000 (17:03 +0200)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/dashboard/lib/Controller/DashboardController.php
apps/dashboard/src/main.js
apps/dashboard/templates/index.php

index 07cfaf071e250b5030df4560cdc0a13c8895d55d..d7f9453cb4e2c7234bbe934e2e6966fc8df56329 100644 (file)
@@ -27,6 +27,7 @@ declare(strict_types=1);
 namespace OCA\Dashboard\Controller;
 
 use OCA\Dashboard\AppInfo\Application;
+use OCA\Files\Event\LoadSidebar;
 use OCA\Viewer\Event\LoadViewer;
 use OCP\AppFramework\Controller;
 use OCP\AppFramework\Http\JSONResponse;
@@ -76,6 +77,11 @@ class DashboardController extends Controller {
         * @return TemplateResponse
         */
        public function index(): TemplateResponse {
+               $this->eventDispatcher->dispatchTyped(new LoadSidebar());
+               if (class_exists(LoadViewer::class)) {
+                       $this->eventDispatcher->dispatchTyped(new LoadViewer());
+               }
+
                $this->eventDispatcher->dispatchTyped(new RegisterWidgetEvent($this->dashboardManager));
 
                $userLayout = explode(',', $this->config->getUserValue($this->userId, 'dashboard', 'layout', 'recommendations,spreed,mail,calendar'));
@@ -92,10 +98,6 @@ class DashboardController extends Controller {
                $this->inititalStateService->provideInitialState('dashboard', 'firstRun', $this->config->getUserValue($this->userId, 'dashboard', 'firstRun', '1') === '1');
                $this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0');
 
-               if (class_exists(LoadViewer::class)) {
-                       $this->eventDispatcher->dispatchTyped(new LoadViewer());
-               }
-
                return new TemplateResponse('dashboard', 'index');
        }
 
index 74d7cb69d4dff9e92d063edad2cd02179d687975..049582e489a770c9cef70db9d0c397e8f168ff23 100644 (file)
@@ -3,8 +3,11 @@ import App from './App.vue'
 import { translate as t } from '@nextcloud/l10n'
 Vue.prototype.t = t
 
+// FIXME workaround to make the sidebar work
+Object.assign(window.OCA.Files, { App: { fileList: { filesClient: OC.Files.getClient() } } }, window.OCA.Files)
+
 const Dashboard = Vue.extend(App)
-const Instance = new Dashboard({}).$mount('#app')
+const Instance = new Dashboard({}).$mount('#app-content-vue')
 
 window.OCA.Dashboard = {
        register: (app, callback) => Instance.register(app, callback),
index bca9fa30494682d0dcf6789e8f50aeee96450579..e4056ce06e26903e55d03d26664e251d84eb517a 100644 (file)
@@ -1,4 +1,4 @@
 <?php
        \OCP\Util::addScript('dashboard', 'dashboard');
 ?>
-<div id="app"></div>
+<div id="app-content-vue"></div>