From 07313e3f0633125e7b288fe94f5c731b1a631688 Mon Sep 17 00:00:00 2001 From: Aleksei Efremov Date: Thu, 7 Mar 2024 15:26:12 +0200 Subject: [PATCH 1/2] Tracking --- src/components/AddLinkButton.vue | 5 +++++ src/mixins/SharesMixin.js | 5 +++++ src/views/SharingDetailsTab.vue | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/src/components/AddLinkButton.vue b/src/components/AddLinkButton.vue index 2e23562..740bef4 100644 --- a/src/components/AddLinkButton.vue +++ b/src/components/AddLinkButton.vue @@ -51,6 +51,11 @@ export default { this.$emit('add:share', newShare, resolve) }) showSuccess(t('files_sharing', 'Link share created')) + this.sendUtagInfo({ + wt_link_id: "button.add-link-share", + page_content_id: "files.sharing", + page_type: "files" + }) } catch (data) { const message = data?.response?.data?.ocs?.meta?.message diff --git a/src/mixins/SharesMixin.js b/src/mixins/SharesMixin.js index d4a62c5..7a3b8e5 100755 --- a/src/mixins/SharesMixin.js +++ b/src/mixins/SharesMixin.js @@ -375,5 +375,10 @@ export default { debounceQueueUpdate: debounce(500, function(property) { this.queueUpdate(property) }), + + sendUtagInfo: (data) => { + if (typeof utag === 'undefined' || !utag.view()) return + utag.view(data) + } }, } diff --git a/src/views/SharingDetailsTab.vue b/src/views/SharingDetailsTab.vue index e90ffa3..372b1a1 100755 --- a/src/views/SharingDetailsTab.vue +++ b/src/views/SharingDetailsTab.vue @@ -660,8 +660,18 @@ export default { const share = await this.addShare(incomingShare, this.fileInfo, this.config) this.share = share this.$emit('add:share', this.share) + this.sendUtagInfo({ + wt_link_id: "button.create-share", + page_content_id: "files.sharing", + page_type: "files" + }) } else { this.queueUpdate(...permissionsAndAttributes) + this.sendUtagInfo({ + wt_link_id: "button.update-share", + page_content_id: "files.sharing", + page_type: "files" + }) } this.$emit('close-sharing-details') From 4a35ac5613134173e756aeab687f6cfeccb028c2 Mon Sep 17 00:00:00 2001 From: Aleksei Efremov Date: Thu, 21 Mar 2024 11:50:22 +0200 Subject: [PATCH 2/2] Fix eslint errors --- src/components/AddLinkButton.vue | 6 +++--- src/mixins/SharesMixin.js | 4 +++- src/utils/CollaboraMimeTypes.js | 2 +- src/views/SharingDetailsTab.vue | 12 ++++++------ 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/AddLinkButton.vue b/src/components/AddLinkButton.vue index 740bef4..4739039 100644 --- a/src/components/AddLinkButton.vue +++ b/src/components/AddLinkButton.vue @@ -52,9 +52,9 @@ export default { }) showSuccess(t('files_sharing', 'Link share created')) this.sendUtagInfo({ - wt_link_id: "button.add-link-share", - page_content_id: "files.sharing", - page_type: "files" + wt_link_id: 'button.add-link-share', + page_content_id: 'files.sharing', + page_type: 'files', }) } catch (data) { diff --git a/src/mixins/SharesMixin.js b/src/mixins/SharesMixin.js index 7a3b8e5..f24a835 100755 --- a/src/mixins/SharesMixin.js +++ b/src/mixins/SharesMixin.js @@ -25,6 +25,8 @@ * */ +/* global utag */ + import { showError, showSuccess } from '@nextcloud/dialogs' import { getCurrentUser } from '@nextcloud/auth' // eslint-disable-next-line import/no-unresolved, n/no-missing-import @@ -379,6 +381,6 @@ export default { sendUtagInfo: (data) => { if (typeof utag === 'undefined' || !utag.view()) return utag.view(data) - } + }, }, } diff --git a/src/utils/CollaboraMimeTypes.js b/src/utils/CollaboraMimeTypes.js index d4ccb82..fe66902 100644 --- a/src/utils/CollaboraMimeTypes.js +++ b/src/utils/CollaboraMimeTypes.js @@ -15,5 +15,5 @@ export const COLLABORA_MIME_TYPES = [ 'application/vnd.oasis.opendocument.graphics', 'application/vnd.visio', 'text/plain', - 'text/markdown' + 'text/markdown', ] diff --git a/src/views/SharingDetailsTab.vue b/src/views/SharingDetailsTab.vue index 372b1a1..62a2431 100755 --- a/src/views/SharingDetailsTab.vue +++ b/src/views/SharingDetailsTab.vue @@ -661,16 +661,16 @@ export default { this.share = share this.$emit('add:share', this.share) this.sendUtagInfo({ - wt_link_id: "button.create-share", - page_content_id: "files.sharing", - page_type: "files" + wt_link_id: 'button.create-share', + page_content_id: 'files.sharing', + page_type: 'files', }) } else { this.queueUpdate(...permissionsAndAttributes) this.sendUtagInfo({ - wt_link_id: "button.update-share", - page_content_id: "files.sharing", - page_type: "files" + wt_link_id: 'button.update-share', + page_content_id: 'files.sharing', + page_type: 'files', }) }