From f7ada020b867ddf3bbd372d51960dd741dc04a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Mon, 26 Oct 2020 12:35:51 +0100 Subject: [PATCH 1/3] new and fav chats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Röhrl --- lib/AppInfo/Application.php | 2 + lib/Dashboard/TalkWidget2.php | 90 ++++++++++++++++ src/dashboard.js | 8 ++ src/views/Dashboard2.vue | 195 ++++++++++++++++++++++++++++++++++ 4 files changed, 295 insertions(+) create mode 100644 lib/Dashboard/TalkWidget2.php create mode 100644 src/views/Dashboard2.vue diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 787db6da2f3..fd1f1de995f 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -36,6 +36,7 @@ use OCA\Talk\Collaboration\Resources\Listener as ResourceListener; use OCA\Talk\Config; use OCA\Talk\Dashboard\TalkWidget; +use OCA\Talk\Dashboard\TalkWidget2; use OCA\Talk\Events\ChatEvent; use OCA\Talk\Events\RoomEvent; use OCA\Talk\Files\Listener as FilesListener; @@ -102,6 +103,7 @@ public function register(IRegistrationContext $context): void { $context->registerSearchProvider(MessageSearch::class); $context->registerDashboardWidget(TalkWidget::class); + $context->registerDashboardWidget(TalkWidget2::class); } public function boot(IBootContext $context): void { diff --git a/lib/Dashboard/TalkWidget2.php b/lib/Dashboard/TalkWidget2.php new file mode 100644 index 00000000000..82e9d867e8d --- /dev/null +++ b/lib/Dashboard/TalkWidget2.php @@ -0,0 +1,90 @@ + + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Talk\Dashboard; + +use OCP\Dashboard\IWidget; +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\Util; + +class TalkWidget2 implements IWidget { + + /** @var IURLGenerator */ + private $url; + /** @var IL10N */ + private $l10n; + + public function __construct( + IURLGenerator $url, + IL10N $l10n + ) { + $this->url = $url; + $this->l10n = $l10n; + } + + /** + * @inheritDoc + */ + public function getId(): string { + return 'spreed'; + } + + /** + * @inheritDoc + */ + public function getTitle(): string { + return $this->l10n->t('Unread and favourites conversations'); + } + + /** + * @inheritDoc + */ + public function getOrder(): int { + return 10; + } + + /** + * @inheritDoc + */ + public function getIconClass(): string { + return 'icon-talk'; + } + + /** + * @inheritDoc + */ + public function getUrl(): ?string { + return $this->url->linkToRouteAbsolute('spreed.Page.index'); + } + + /** + * @inheritDoc + */ + public function load(): void { + Util::addStyle('spreed', 'icons'); + Util::addScript('spreed', 'dashboard'); + } +} diff --git a/src/dashboard.js b/src/dashboard.js index b516f8d26a2..5bf01e2a465 100644 --- a/src/dashboard.js +++ b/src/dashboard.js @@ -25,6 +25,7 @@ import { generateFilePath } from '@nextcloud/router' import { getRequestToken } from '@nextcloud/auth' import { translate, translatePlural } from '@nextcloud/l10n' import Dashboard from './views/Dashboard' +import Dashboard2 from './views/Dashboard2' // CSP config for webpack dynamic chunk loading // eslint-disable-next-line @@ -51,4 +52,11 @@ document.addEventListener('DOMContentLoaded', function() { }).$mount(el) }) + OCA.Dashboard2.register('spreed', (el) => { + const View = Vue.extend(Dashboard2) + new View({ + propsData: {}, + }).$mount(el) + }) + }) diff --git a/src/views/Dashboard2.vue b/src/views/Dashboard2.vue new file mode 100644 index 00000000000..649bf93dfd4 --- /dev/null +++ b/src/views/Dashboard2.vue @@ -0,0 +1,195 @@ + + + + + + + From 9ab66ca580833feeae3f223f694f4c5e1e93c190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Mon, 26 Oct 2020 12:36:42 +0100 Subject: [PATCH 2/3] Revert "new and fav chats" This reverts commit f7ada020b867ddf3bbd372d51960dd741dc04a6f. --- lib/AppInfo/Application.php | 2 - lib/Dashboard/TalkWidget2.php | 90 ---------------- src/dashboard.js | 8 -- src/views/Dashboard2.vue | 195 ---------------------------------- 4 files changed, 295 deletions(-) delete mode 100644 lib/Dashboard/TalkWidget2.php delete mode 100644 src/views/Dashboard2.vue diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index fd1f1de995f..787db6da2f3 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -36,7 +36,6 @@ use OCA\Talk\Collaboration\Resources\Listener as ResourceListener; use OCA\Talk\Config; use OCA\Talk\Dashboard\TalkWidget; -use OCA\Talk\Dashboard\TalkWidget2; use OCA\Talk\Events\ChatEvent; use OCA\Talk\Events\RoomEvent; use OCA\Talk\Files\Listener as FilesListener; @@ -103,7 +102,6 @@ public function register(IRegistrationContext $context): void { $context->registerSearchProvider(MessageSearch::class); $context->registerDashboardWidget(TalkWidget::class); - $context->registerDashboardWidget(TalkWidget2::class); } public function boot(IBootContext $context): void { diff --git a/lib/Dashboard/TalkWidget2.php b/lib/Dashboard/TalkWidget2.php deleted file mode 100644 index 82e9d867e8d..00000000000 --- a/lib/Dashboard/TalkWidget2.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * @author Julius Härtl - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -namespace OCA\Talk\Dashboard; - -use OCP\Dashboard\IWidget; -use OCP\IL10N; -use OCP\IURLGenerator; -use OCP\Util; - -class TalkWidget2 implements IWidget { - - /** @var IURLGenerator */ - private $url; - /** @var IL10N */ - private $l10n; - - public function __construct( - IURLGenerator $url, - IL10N $l10n - ) { - $this->url = $url; - $this->l10n = $l10n; - } - - /** - * @inheritDoc - */ - public function getId(): string { - return 'spreed'; - } - - /** - * @inheritDoc - */ - public function getTitle(): string { - return $this->l10n->t('Unread and favourites conversations'); - } - - /** - * @inheritDoc - */ - public function getOrder(): int { - return 10; - } - - /** - * @inheritDoc - */ - public function getIconClass(): string { - return 'icon-talk'; - } - - /** - * @inheritDoc - */ - public function getUrl(): ?string { - return $this->url->linkToRouteAbsolute('spreed.Page.index'); - } - - /** - * @inheritDoc - */ - public function load(): void { - Util::addStyle('spreed', 'icons'); - Util::addScript('spreed', 'dashboard'); - } -} diff --git a/src/dashboard.js b/src/dashboard.js index 5bf01e2a465..b516f8d26a2 100644 --- a/src/dashboard.js +++ b/src/dashboard.js @@ -25,7 +25,6 @@ import { generateFilePath } from '@nextcloud/router' import { getRequestToken } from '@nextcloud/auth' import { translate, translatePlural } from '@nextcloud/l10n' import Dashboard from './views/Dashboard' -import Dashboard2 from './views/Dashboard2' // CSP config for webpack dynamic chunk loading // eslint-disable-next-line @@ -52,11 +51,4 @@ document.addEventListener('DOMContentLoaded', function() { }).$mount(el) }) - OCA.Dashboard2.register('spreed', (el) => { - const View = Vue.extend(Dashboard2) - new View({ - propsData: {}, - }).$mount(el) - }) - }) diff --git a/src/views/Dashboard2.vue b/src/views/Dashboard2.vue deleted file mode 100644 index 649bf93dfd4..00000000000 --- a/src/views/Dashboard2.vue +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - From 690ae9d6f8081d0c04e1ac3103e7fe0cc963ec73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Mon, 26 Oct 2020 12:38:57 +0100 Subject: [PATCH 3/3] new and fav chats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Röhrl --- lib/AppInfo/Application.php | 2 + lib/Dashboard/TalkWidget2.php | 90 ++++++++++++++++ src/dashboard.js | 8 ++ src/views/Dashboard2.vue | 195 ++++++++++++++++++++++++++++++++++ 4 files changed, 295 insertions(+) create mode 100644 lib/Dashboard/TalkWidget2.php create mode 100644 src/views/Dashboard2.vue diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 787db6da2f3..fd1f1de995f 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -36,6 +36,7 @@ use OCA\Talk\Collaboration\Resources\Listener as ResourceListener; use OCA\Talk\Config; use OCA\Talk\Dashboard\TalkWidget; +use OCA\Talk\Dashboard\TalkWidget2; use OCA\Talk\Events\ChatEvent; use OCA\Talk\Events\RoomEvent; use OCA\Talk\Files\Listener as FilesListener; @@ -102,6 +103,7 @@ public function register(IRegistrationContext $context): void { $context->registerSearchProvider(MessageSearch::class); $context->registerDashboardWidget(TalkWidget::class); + $context->registerDashboardWidget(TalkWidget2::class); } public function boot(IBootContext $context): void { diff --git a/lib/Dashboard/TalkWidget2.php b/lib/Dashboard/TalkWidget2.php new file mode 100644 index 00000000000..82e9d867e8d --- /dev/null +++ b/lib/Dashboard/TalkWidget2.php @@ -0,0 +1,90 @@ + + * + * @author Julius Härtl + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCA\Talk\Dashboard; + +use OCP\Dashboard\IWidget; +use OCP\IL10N; +use OCP\IURLGenerator; +use OCP\Util; + +class TalkWidget2 implements IWidget { + + /** @var IURLGenerator */ + private $url; + /** @var IL10N */ + private $l10n; + + public function __construct( + IURLGenerator $url, + IL10N $l10n + ) { + $this->url = $url; + $this->l10n = $l10n; + } + + /** + * @inheritDoc + */ + public function getId(): string { + return 'spreed'; + } + + /** + * @inheritDoc + */ + public function getTitle(): string { + return $this->l10n->t('Unread and favourites conversations'); + } + + /** + * @inheritDoc + */ + public function getOrder(): int { + return 10; + } + + /** + * @inheritDoc + */ + public function getIconClass(): string { + return 'icon-talk'; + } + + /** + * @inheritDoc + */ + public function getUrl(): ?string { + return $this->url->linkToRouteAbsolute('spreed.Page.index'); + } + + /** + * @inheritDoc + */ + public function load(): void { + Util::addStyle('spreed', 'icons'); + Util::addScript('spreed', 'dashboard'); + } +} diff --git a/src/dashboard.js b/src/dashboard.js index b516f8d26a2..5bf01e2a465 100644 --- a/src/dashboard.js +++ b/src/dashboard.js @@ -25,6 +25,7 @@ import { generateFilePath } from '@nextcloud/router' import { getRequestToken } from '@nextcloud/auth' import { translate, translatePlural } from '@nextcloud/l10n' import Dashboard from './views/Dashboard' +import Dashboard2 from './views/Dashboard2' // CSP config for webpack dynamic chunk loading // eslint-disable-next-line @@ -51,4 +52,11 @@ document.addEventListener('DOMContentLoaded', function() { }).$mount(el) }) + OCA.Dashboard2.register('spreed', (el) => { + const View = Vue.extend(Dashboard2) + new View({ + propsData: {}, + }).$mount(el) + }) + }) diff --git a/src/views/Dashboard2.vue b/src/views/Dashboard2.vue new file mode 100644 index 00000000000..649bf93dfd4 --- /dev/null +++ b/src/views/Dashboard2.vue @@ -0,0 +1,195 @@ + + + + + + +