satellite/analytics: Track Project Details Updates (#5451)

This commit is contained in:
prerna-parashar 2023-01-11 21:25:41 +05:30 committed by GitHub
parent b5d0021fb6
commit 6e9567cb25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 62 deletions

View File

@ -15,66 +15,70 @@ import (
) )
const ( const (
eventAccountCreated = "Account Created" eventAccountCreated = "Account Created"
eventSignedIn = "Signed In" eventSignedIn = "Signed In"
eventProjectCreated = "Project Created" eventProjectCreated = "Project Created"
eventAccessGrantCreated = "Access Grant Created" eventAccessGrantCreated = "Access Grant Created"
eventAccountVerified = "Account Verified" eventAccountVerified = "Account Verified"
eventGatewayCredentialsCreated = "Credentials Created" eventGatewayCredentialsCreated = "Credentials Created"
eventPassphraseCreated = "Passphrase Created" eventPassphraseCreated = "Passphrase Created"
eventExternalLinkClicked = "External Link Clicked" eventExternalLinkClicked = "External Link Clicked"
eventPathSelected = "Path Selected" eventPathSelected = "Path Selected"
eventLinkShared = "Link Shared" eventLinkShared = "Link Shared"
eventObjectUploaded = "Object Uploaded" eventObjectUploaded = "Object Uploaded"
eventAPIKeyGenerated = "API Key Generated" eventAPIKeyGenerated = "API Key Generated"
eventCreditCardAdded = "Credit Card Added" eventCreditCardAdded = "Credit Card Added"
eventUpgradeBannerClicked = "Upgrade Banner Clicked" eventUpgradeBannerClicked = "Upgrade Banner Clicked"
eventModalAddCard = "Credit Card Added In Modal" eventModalAddCard = "Credit Card Added In Modal"
eventModalAddTokens = "Storj Token Added In Modal" eventModalAddTokens = "Storj Token Added In Modal"
eventSearchBuckets = "Search Buckets" eventSearchBuckets = "Search Buckets"
eventNavigateProjects = "Navigate Projects" eventNavigateProjects = "Navigate Projects"
eventManageProjectsClicked = "Manage Projects Clicked" eventManageProjectsClicked = "Manage Projects Clicked"
eventCreateNewClicked = "Create New Clicked" eventCreateNewClicked = "Create New Clicked"
eventViewDocsClicked = "View Docs Clicked" eventViewDocsClicked = "View Docs Clicked"
eventViewForumClicked = "View Forum Clicked" eventViewForumClicked = "View Forum Clicked"
eventViewSupportClicked = "View Support Clicked" eventViewSupportClicked = "View Support Clicked"
eventCreateAnAccessGrantClicked = "Create an Access Grant Clicked" eventCreateAnAccessGrantClicked = "Create an Access Grant Clicked"
eventUploadUsingCliClicked = "Upload Using CLI Clicked" eventUploadUsingCliClicked = "Upload Using CLI Clicked"
eventUploadInWebClicked = "Upload In Web Clicked" eventUploadInWebClicked = "Upload In Web Clicked"
eventNewProjectClicked = "New Project Clicked" eventNewProjectClicked = "New Project Clicked"
eventLogoutClicked = "Logout Clicked" eventLogoutClicked = "Logout Clicked"
eventProfileUpdated = "Profile Updated" eventProfileUpdated = "Profile Updated"
eventPasswordChanged = "Password Changed" eventPasswordChanged = "Password Changed"
eventMfaEnabled = "MFA Enabled" eventMfaEnabled = "MFA Enabled"
eventBucketCreated = "Bucket Created" eventBucketCreated = "Bucket Created"
eventBucketDeleted = "Bucket Deleted" eventBucketDeleted = "Bucket Deleted"
eventProjectLimitError = "Project Limit Error" eventProjectLimitError = "Project Limit Error"
eventAPIAccessCreated = "API Access Created" eventAPIAccessCreated = "API Access Created"
eventUploadFileClicked = "Upload File Clicked" eventUploadFileClicked = "Upload File Clicked"
eventUploadFolderClicked = "Upload Folder Clicked" eventUploadFolderClicked = "Upload Folder Clicked"
eventStorjTokenAdded = "Storj Token Added" eventStorjTokenAdded = "Storj Token Added"
eventCreateKeysClicked = "Create Keys Clicked" eventCreateKeysClicked = "Create Keys Clicked"
eventDownloadTxtClicked = "Download txt clicked" eventDownloadTxtClicked = "Download txt clicked"
eventEncryptMyAccessClicked = "Encrypt My Access Clicked" eventEncryptMyAccessClicked = "Encrypt My Access Clicked"
eventCopyToClipboardClicked = "Copy to Clipboard Clicked" eventCopyToClipboardClicked = "Copy to Clipboard Clicked"
eventCreateAccessGrantClicked = "Create Access Grant Clicked" eventCreateAccessGrantClicked = "Create Access Grant Clicked"
eventCreateS3CredentialsClicked = "Create S3 Credentials Clicked" eventCreateS3CredentialsClicked = "Create S3 Credentials Clicked"
eventKeysForCLIClicked = "Create Keys For CLI Clicked" eventKeysForCLIClicked = "Create Keys For CLI Clicked"
eventSeePaymentsClicked = "See Payments Clicked" eventSeePaymentsClicked = "See Payments Clicked"
eventEditPaymentMethodClicked = "Edit Payment Method Clicked" eventEditPaymentMethodClicked = "Edit Payment Method Clicked"
eventUsageDetailedInfoClicked = "Usage Detailed Info Clicked" eventUsageDetailedInfoClicked = "Usage Detailed Info Clicked"
eventAddNewPaymentMethodClicked = "Add New Payment Method Clicked" eventAddNewPaymentMethodClicked = "Add New Payment Method Clicked"
eventApplyNewCouponClicked = "Apply New Coupon Clicked" eventApplyNewCouponClicked = "Apply New Coupon Clicked"
eventCreditCardRemoved = "Credit Card Removed" eventCreditCardRemoved = "Credit Card Removed"
eventCouponCodeApplied = "Coupon Code Applied" eventCouponCodeApplied = "Coupon Code Applied"
eventInvoiceDownloaded = "Invoice Downloaded" eventInvoiceDownloaded = "Invoice Downloaded"
eventCreditCardAddedFromBilling = "Credit Card Added From Billing" eventCreditCardAddedFromBilling = "Credit Card Added From Billing"
eventStorjTokenAddedFromBilling = "Storj Token Added From Billing" eventStorjTokenAddedFromBilling = "Storj Token Added From Billing"
eventAddFundsClicked = "Add Funds Clicked" eventAddFundsClicked = "Add Funds Clicked"
eventProjectMembersInviteSent = "Project Members Invite Sent" eventProjectMembersInviteSent = "Project Members Invite Sent"
eventProjectMemberAdded = "Project Member Added" eventProjectMemberAdded = "Project Member Added"
eventProjectMemberDeleted = "Project Member Deleted" eventProjectMemberDeleted = "Project Member Deleted"
eventError = "UI error occurred" eventError = "UI error occurred"
eventProjectNameUpdated = "Project Name Updated"
eventProjectDescriptionUpdated = "Project Description Updated"
eventProjectStorageLimitUpdated = "Project Storage Limit Updated"
eventProjectBandwidthLimitUpdated = "Project Bandwidth Limit Updated"
) )
var ( var (
@ -124,7 +128,8 @@ func NewService(log *zap.Logger, config Config, satelliteName string) *Service {
eventCopyToClipboardClicked, eventCreateAccessGrantClicked, eventCreateS3CredentialsClicked, eventKeysForCLIClicked, eventCopyToClipboardClicked, eventCreateAccessGrantClicked, eventCreateS3CredentialsClicked, eventKeysForCLIClicked,
eventSeePaymentsClicked, eventEditPaymentMethodClicked, eventUsageDetailedInfoClicked, eventAddNewPaymentMethodClicked, eventSeePaymentsClicked, eventEditPaymentMethodClicked, eventUsageDetailedInfoClicked, eventAddNewPaymentMethodClicked,
eventApplyNewCouponClicked, eventCreditCardRemoved, eventCouponCodeApplied, eventInvoiceDownloaded, eventCreditCardAddedFromBilling, eventApplyNewCouponClicked, eventCreditCardRemoved, eventCouponCodeApplied, eventInvoiceDownloaded, eventCreditCardAddedFromBilling,
eventStorjTokenAddedFromBilling, eventAddFundsClicked, eventProjectMembersInviteSent, eventError} { eventStorjTokenAddedFromBilling, eventAddFundsClicked, eventProjectMembersInviteSent, eventError, eventProjectNameUpdated, eventProjectDescriptionUpdated,
eventProjectStorageLimitUpdated, eventProjectBandwidthLimitUpdated} {
service.clientEvents[name] = true service.clientEvents[name] = true
} }

View File

@ -210,7 +210,8 @@ import {
ProjectFields, ProjectLimits, ProjectFields, ProjectLimits,
} from '@/types/projects'; } from '@/types/projects';
import { MetaUtils } from '@/utils/meta'; import { MetaUtils } from '@/utils/meta';
import { AnalyticsErrorEventSource } from '@/utils/constants/analyticsEventNames'; import { AnalyticsErrorEventSource, AnalyticsEvent } from '@/utils/constants/analyticsEventNames';
import { AnalyticsHttpApi } from '@/api/analytics';
import VButton from '@/components/common/VButton.vue'; import VButton from '@/components/common/VButton.vue';
@ -238,6 +239,8 @@ export default class EditProjectDetails extends Vue {
public storageLimitValue = 0; public storageLimitValue = 0;
public bandwidthLimitValue = 0; public bandwidthLimitValue = 0;
private readonly analytics: AnalyticsHttpApi = new AnalyticsHttpApi();
/** /**
* Returns selected project from store. * Returns selected project from store.
*/ */
@ -512,6 +515,7 @@ export default class EditProjectDetails extends Vue {
} }
this.toggleNameEditing(); this.toggleNameEditing();
this.analytics.eventTriggered(AnalyticsEvent.PROJECT_NAME_UPDATED);
await this.$notify.success('Project name updated successfully!'); await this.$notify.success('Project name updated successfully!');
} }
@ -528,6 +532,7 @@ export default class EditProjectDetails extends Vue {
} }
this.toggleDescriptionEditing(); this.toggleDescriptionEditing();
this.analytics.eventTriggered(AnalyticsEvent.PROJECT_DESCRIPTION_UPDATED);
await this.$notify.success('Project description updated successfully!'); await this.$notify.success('Project description updated successfully!');
} }
@ -552,6 +557,7 @@ export default class EditProjectDetails extends Vue {
} }
this.toggleStorageLimitEditing(); this.toggleStorageLimitEditing();
this.analytics.eventTriggered(AnalyticsEvent.PROJECT_STORAGE_LIMIT_UPDATED);
await this.$notify.success('Project storage limit updated successfully!'); await this.$notify.success('Project storage limit updated successfully!');
} }
@ -576,6 +582,7 @@ export default class EditProjectDetails extends Vue {
} }
this.toggleBandwidthLimitEditing(); this.toggleBandwidthLimitEditing();
this.analytics.eventTriggered(AnalyticsEvent.PROJECT_BANDWIDTH_LIMIT_UPDATED);
await this.$notify.success('Project bandwidth limit updated successfully!'); await this.$notify.success('Project bandwidth limit updated successfully!');
} }

View File

@ -54,6 +54,10 @@ export enum AnalyticsEvent {
ADD_FUNDS_CLICKED = 'Add Funds Clicked', ADD_FUNDS_CLICKED = 'Add Funds Clicked',
PROJECT_MEMBERS_INVITE_SENT = 'Project Members Invite Sent', PROJECT_MEMBERS_INVITE_SENT = 'Project Members Invite Sent',
UI_ERROR = 'UI error occurred', UI_ERROR = 'UI error occurred',
PROJECT_NAME_UPDATED = 'Project Name Updated',
PROJECT_DESCRIPTION_UPDATED = 'Project Description Updated',
PROJECT_STORAGE_LIMIT_UPDATED = 'Project Storage Limit Updated',
PROJECT_BANDWIDTH_LIMIT_UPDATED = 'Project Bandwidth Limit Updated',
} }
export enum AnalyticsErrorEventSource { export enum AnalyticsErrorEventSource {