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;
* @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'));
$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');
}
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),