-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Page Layout Statistics - MEED-6885 - Meeds-io/MIPs#133 (#72)
- Loading branch information
Showing
18 changed files
with
244 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
layout-webapp/src/main/resources/locale/portlet/Analytics_en.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
analytics.field.label.applicationName=Application Name | ||
|
||
analytics.field.label.pageTemplateId=Page Template Id | ||
analytics.field.label.pageTemplateName=Page Template Name | ||
analytics.field.label.pageTemplateCategory=Page Template Category | ||
analytics.field.label.pageTemplateDisabled=Is Page Template Disabled | ||
analytics.field.label.pageTemplateSystem=Is Page Template System | ||
analytics.field.label.pageTemplateIllustrationId=Page Template illustration id | ||
analytics.field.label.pageTemplatePage=Page Template originating page | ||
analytics.field.label.pageReference=Page reference | ||
analytics.field.label.siteName=Site name | ||
analytics.field.label.siteType=Site type | ||
analytics.field.label.pageType=Page type | ||
analytics.field.label.pageName=Page name | ||
|
||
analytics.pageLayout=Page Layout | ||
analytics.createPageLayout=Create Page Layout | ||
analytics.createPageTemplate=Create Page Template | ||
analytics.updatePageTemplate=Update Page Template | ||
analytics.deletePageTemplate=Delete Page Template | ||
analytics.enablePageTemplate=Enable Page Template | ||
analytics.disablePageTemplate=Disable Page Template | ||
analytics.siteNavigation=Site topbar navigation | ||
analytics.siteManagement=Sites Management | ||
analytics.pageTemplateManagement=Page Templates Management | ||
analytics.pageLayoutEditor=Layout Editor | ||
|
||
analytics.customized=Customized | ||
analytics.blank=Blank | ||
analytics.analytics=Analytics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
layout-webapp/src/main/webapp/vue-app/common/components/LayoutAnalytics.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<script> | ||
export default { | ||
props: { | ||
applicationName: { | ||
type: String, | ||
default: null, | ||
}, | ||
}, | ||
created() { | ||
this.$root.$on('page-templates-created', this.handlePageTemplateCreation); | ||
this.$root.$on('page-templates-updated', this.handlePageTemplateUpdate); | ||
this.$root.$on('page-templates-deleted', this.handlePageTemplateDeletion); | ||
this.$root.$on('page-templates-enabled', this.handlePageTemplateEnabled); | ||
this.$root.$on('page-templates-disabled', this.handlePageTemplateDisabled); | ||
this.$root.$on('page-layout-created', this.handlePageCreated); | ||
}, | ||
beforeDestroy() { | ||
this.$root.$off('page-templates-created', this.handlePageTemplateCreation); | ||
this.$root.$off('page-templates-updated', this.handlePageTemplateUpdate); | ||
this.$root.$off('page-templates-deleted', this.handlePageTemplateDeletion); | ||
this.$root.$off('page-templates-enabled', this.handlePageTemplateEnabled); | ||
this.$root.$off('page-templates-disabled', this.handlePageTemplateDisabled); | ||
this.$root.$off('page-layout-created', this.handlePageCreated); | ||
}, | ||
methods: { | ||
handlePageCreated(page, pageTemplate) { | ||
this.sendAnalytics('pageLayout', 'createPageLayout', { | ||
pageTemplateId: pageTemplate?.id || null, | ||
pageTemplateName: pageTemplate?.name || null, | ||
pageTemplateCategory: pageTemplate?.id && (pageTemplate?.category || 'customized') || null, | ||
pageTemplateDisabled: pageTemplate?.id && `${pageTemplate.disabled}` || null, | ||
pageTemplateSystem: pageTemplate?.id && `${pageTemplate.system}` || null, | ||
pageTemplateIllustrationId: pageTemplate?.id && pageTemplate.illustrationId || null, | ||
pageName: page?.state?.displayName, | ||
pageReference: page?.key?.ref, | ||
pageType: page?.state?.type, | ||
siteName: page?.key?.site?.name, | ||
siteType: page?.key?.site?.type, | ||
}); | ||
}, | ||
handlePageTemplateCreation(pageTemplate, pageRef) { | ||
this.sendAnalytics('pageTemplate', 'createPageTemplate', { | ||
pageTemplateId: pageTemplate.id, | ||
pageTemplateName: pageTemplate.name, | ||
pageTemplateCategory: pageTemplate.category || 'customized', | ||
pageTemplateDisabled: `${pageTemplate.disabled}`, | ||
pageTemplateSystem: `${pageTemplate.system}`, | ||
pageTemplateIllustrationId: pageTemplate.illustrationId, | ||
pageTemplatePage: pageRef, | ||
}); | ||
}, | ||
handlePageTemplateUpdate(pageTemplate) { | ||
this.sendAnalytics('pageTemplate', 'updatePageTemplate', { | ||
pageTemplateId: pageTemplate.id, | ||
pageTemplateName: pageTemplate.name, | ||
pageTemplateCategory: pageTemplate.category, | ||
pageTemplateDisabled: `${pageTemplate.disabled}`, | ||
pageTemplateSystem: `${pageTemplate.system}`, | ||
pageTemplateIllustrationId: pageTemplate.illustrationId, | ||
}); | ||
}, | ||
handlePageTemplateDeletion(pageTemplate) { | ||
this.sendAnalytics('pageTemplate', 'deletePageTemplate', { | ||
pageTemplateId: pageTemplate.id, | ||
pageTemplateName: pageTemplate.name, | ||
pageTemplateCategory: pageTemplate.category, | ||
pageTemplateDisabled: `${pageTemplate.disabled}`, | ||
pageTemplateSystem: `${pageTemplate.system}`, | ||
pageTemplateIllustrationId: pageTemplate.illustrationId, | ||
}); | ||
}, | ||
handlePageTemplateEnabled(pageTemplate) { | ||
this.sendAnalytics('pageTemplate', 'enablePageTemplate', { | ||
pageTemplateId: pageTemplate.id, | ||
pageTemplateName: pageTemplate.name, | ||
pageTemplateCategory: pageTemplate.category, | ||
pageTemplateDisabled: `${pageTemplate.disabled}`, | ||
pageTemplateSystem: `${pageTemplate.system}`, | ||
pageTemplateIllustrationId: pageTemplate.illustrationId, | ||
}); | ||
}, | ||
handlePageTemplateDisabled(pageTemplate) { | ||
this.sendAnalytics('pageTemplate', 'disablePageTemplate', { | ||
pageTemplateId: pageTemplate.id, | ||
pageTemplateName: pageTemplate.name, | ||
pageTemplateCategory: pageTemplate.category, | ||
pageTemplateDisabled: `${pageTemplate.disabled}`, | ||
pageTemplateSystem: `${pageTemplate.system}`, | ||
pageTemplateIllustrationId: pageTemplate.illustrationId, | ||
}); | ||
}, | ||
sendAnalytics(subModule, operation, parameters) { | ||
parameters.applicationName = this.applicationName; | ||
document.dispatchEvent(new CustomEvent('exo-statistic-message', { | ||
detail: { | ||
module: 'layout', | ||
subModule, | ||
userId: eXo.env.portal.userIdentityId, | ||
userName: eXo.env.portal.userName, | ||
spaceId: eXo.env.portal.spaceId || 0, | ||
operation, | ||
timestamp: Date.now(), | ||
parameters, | ||
} | ||
})); | ||
}, | ||
}, | ||
}; | ||
</script> |
28 changes: 28 additions & 0 deletions
28
layout-webapp/src/main/webapp/vue-app/common/initComponents.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* This file is part of the Meeds project (https://meeds.io/). | ||
* | ||
* Copyright (C) 2020 - 2024 Meeds Association [email protected] | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser 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 | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
import LayoutAnalytics from './components/LayoutAnalytics.vue'; | ||
|
||
const components = { | ||
'layout-analytics': LayoutAnalytics, | ||
}; | ||
|
||
for (const key in components) { | ||
Vue.component(key, components[key]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.