From 95c9e45adf17c1c0c2e7910b78d2f4aa9c7e70dc Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sat, 15 Jul 2023 10:36:19 -0300 Subject: [PATCH 1/6] Fix linter Signed-off-by: Vitor Mattos From 56733bec0dac8b1c2c7b32c2b56b8bf5419da526 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sat, 15 Jul 2023 11:07:45 -0300 Subject: [PATCH 2/6] Add pending method Signed-off-by: Vitor Mattos --- lib/Controller/PageController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index a169ae4..86dd655 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -26,5 +26,4 @@ public function index(string $path): TemplateResponse { return $response; } - } From 3757af6f8b699f1537916ce347f0389233299c61 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sat, 15 Jul 2023 13:10:34 -0300 Subject: [PATCH 3/6] Partial implementation of Notifications Problems: - Fix problems to use Store of Announcements app, problems when build - List the annoucements Signed-off-by: Vitor Mattos --- src/components/LeftSidebar.vue | 7 ++++ src/views/Notifications.vue | 68 ++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 src/views/Notifications.vue diff --git a/src/components/LeftSidebar.vue b/src/components/LeftSidebar.vue index 4a846f4..34c052e 100644 --- a/src/components/LeftSidebar.vue +++ b/src/components/LeftSidebar.vue @@ -21,3 +21,10 @@ export default { }, } + + diff --git a/src/views/Notifications.vue b/src/views/Notifications.vue new file mode 100644 index 0000000..e5530c2 --- /dev/null +++ b/src/views/Notifications.vue @@ -0,0 +1,68 @@ + + + From 8a2cf4a8e7f5bd0ba795b7a42cebd9ea2e69770f Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Sun, 16 Jul 2023 16:21:03 -0300 Subject: [PATCH 4/6] List Notifications Signed-off-by: Vitor Mattos --- src/store/index.js | 5 ++++- src/views/Notifications.vue | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index 84a1269..e7e30e2 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -3,6 +3,9 @@ import Vuex, { Store } from 'vuex' import storeConfig from './storeConfig.js' +// eslint-disable-next-line n/no-missing-import, import/no-unresolved +import announcementsStore from 'apps/announcementcenter/src/store/announcementsStore.js' + Vue.use(Vuex) -export default new Store(storeConfig) +export default new Store({...storeConfig, ...announcementsStore}) diff --git a/src/views/Notifications.vue b/src/views/Notifications.vue index e5530c2..a82cb80 100644 --- a/src/views/Notifications.vue +++ b/src/views/Notifications.vue @@ -63,6 +63,37 @@ export default { this.$store.dispatch('addAnnouncement', announcement) }) }, + + /** + * Load the comments of the announcements + * + * @param {number} id the announcement + */ + async onClickAnnouncement(id) { + if (id === this.activeId) { + return + } + + this.activeId = id + + if (!this.activateAnnouncementHasComments) { + return + } + + if (id === 0) { + // Destroy the comments view as the sidebar is destroyed + this.commentsView = null + return + } + + if (!this.commentsView) { + // Create a new comments view when there is none + this.commentsView = new OCA.Comments.View('announcement') + } + + await this.commentsView.update(id) + this.commentsView.$mount(this.$refs.sidebar) + }, }, } From b74450257a06e32e73cdf0f3fb284d82a29dbeb7 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 17 Jul 2023 13:25:21 -0300 Subject: [PATCH 5/6] Add icon to notifications menu TODO: - [ ] The icon didn't appear, necessary to fix this Task suspended to be possible work at most important features Signed-off-by: Vitor Mattos --- src/components/LeftSidebar.vue | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/components/LeftSidebar.vue b/src/components/LeftSidebar.vue index 34c052e..7763d52 100644 --- a/src/components/LeftSidebar.vue +++ b/src/components/LeftSidebar.vue @@ -5,6 +5,11 @@ :title="t('my_company', 'Home')" icon="icon-home" :exact="true" /> + + + @@ -12,19 +17,21 @@ - - From 9b516476679d903d0e37652afac757e38e7e3b3e Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 17 Jul 2023 20:05:06 -0300 Subject: [PATCH 6/6] npm lint:fix Signed-off-by: Vitor Mattos --- src/components/LeftSidebar.vue | 7 ++++--- src/store/index.js | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/LeftSidebar.vue b/src/components/LeftSidebar.vue index 7763d52..754516e 100644 --- a/src/components/LeftSidebar.vue +++ b/src/components/LeftSidebar.vue @@ -15,12 +15,13 @@ diff --git a/src/store/index.js b/src/store/index.js index e7e30e2..5a63407 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,11 +1,10 @@ +// eslint-disable-next-line n/no-missing-import, import/no-unresolved +import announcementsStore from 'apps/announcementcenter/src/store/announcementsStore.js' import Vue from 'vue' import Vuex, { Store } from 'vuex' import storeConfig from './storeConfig.js' -// eslint-disable-next-line n/no-missing-import, import/no-unresolved -import announcementsStore from 'apps/announcementcenter/src/store/announcementsStore.js' - Vue.use(Vuex) -export default new Store({...storeConfig, ...announcementsStore}) +export default new Store({ ...storeConfig, ...announcementsStore })