diff --git a/lib/Dashboard/SocialWidget.php b/lib/Dashboard/SocialWidget.php index 495dddcb..b50640af 100644 --- a/lib/Dashboard/SocialWidget.php +++ b/lib/Dashboard/SocialWidget.php @@ -23,19 +23,21 @@ namespace OCA\Social\Dashboard; +use OCP\IURLGenerator; use OCP\Dashboard\IWidget; use OCP\IL10N; use OCA\Social\AppInfo\Application; class SocialWidget implements IWidget { - - /** @var IL10N */ - private $l10n; + private IL10N $l10n; + private IURLGenerator $urlGenerator; public function __construct( - IL10N $l10n + IL10N $l10n, + IURLGenerator $urlGenerator ) { $this->l10n = $l10n; + $this->urlGenerator = $urlGenerator; } /** @@ -70,14 +72,13 @@ class SocialWidget implements IWidget { * @inheritDoc */ public function getUrl(): ?string { - return \OC::$server->getURLGenerator()->linkToRoute('social.local.streamNotifications', []); + return ''; //$this->uRLGenerator->linkToRoute('social.local.streamNotifications', []); } /** * @inheritDoc */ public function load(): void { - \OC_Util::addScript(Application::APP_NAME, 'dashboard'); - \OC_Util::addStyle(Application::APP_NAME, 'dashboard'); + \OCP\Util::addScript(Application::APP_NAME, 'social-dashboard'); } -} \ No newline at end of file +} diff --git a/src/dashboard.js b/src/dashboard.js index 8c2720ef..d58ad980 100644 --- a/src/dashboard.js +++ b/src/dashboard.js @@ -14,18 +14,20 @@ import Vue from 'vue' import Dashboard from './views/Dashboard.vue' +// eslint-disable-next-line +__webpack_nonce__ = btoa(OC.requestToken); +// eslint-disable-next-line +__webpack_public_path__ = OC.linkTo('social', 'js/'); + Vue.prototype.t = t Vue.prototype.n = n Vue.prototype.OC = window.OC -Vue.prototype.OCA = window.OCA document.addEventListener('DOMContentLoaded', function() { - OCA.Dashboard.register('social_notifications', (el, { widget }) => { const View = Vue.extend(Dashboard) new View({ propsData: { title: widget.title } }).$mount(el) }) - }) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index ead86748..25a56c59 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -1,10 +1,10 @@