Skip to content

Commit

Permalink
Remove analytics collection
Browse files Browse the repository at this point in the history
  • Loading branch information
jsayol committed Feb 1, 2019
1 parent dc2213e commit 7906d6c
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 183 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,6 @@
"semver": "^5.6.0",
"tmp": "^0.0.33",
"tslib": "^1.9.3",
"universal-analytics": "^0.4.20",
"uuid": "^3.3.2",
"yauzl": "^2.10.0"
},
"resolutions": {
Expand Down
5 changes: 0 additions & 5 deletions src/accounts/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { AccountItem } from '../projects/ProjectsProvider';
import { generateNonce } from '../utils';
import { AccountManager } from './AccountManager';
import { endLogin, initiateLogin } from './login';
import { analytics } from '../analytics';

let context: vscode.ExtensionContext;

Expand All @@ -23,8 +22,6 @@ export function registerAccountsCommands(_context: vscode.ExtensionContext) {
}

async function addAccount(): Promise<void> {
analytics.event('Accounts', 'addAccount');

const account = await vscode.window.withProgress(
{
title: 'Waiting for login to complete...',
Expand All @@ -51,8 +48,6 @@ async function addAccount(): Promise<void> {
}

function removeAccount(element: AccountItem): void {
analytics.event('Accounts', 'removeAccount');

const selectedAccout = context.globalState.get('selectedAccount');
if (selectedAccout === element.account) {
context.globalState.update('selectedAccount', undefined);
Expand Down
52 changes: 0 additions & 52 deletions src/analytics.ts

This file was deleted.

15 changes: 0 additions & 15 deletions src/apps/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { getCertTypeForFingerprint } from '../utils';
import { FirebaseProject } from '../projects/ProjectManager';
import { AppsAPI } from './api';
import { AccountInfo } from '../accounts/AccountManager';
import { analytics } from '../analytics';

let context: vscode.ExtensionContext;

Expand Down Expand Up @@ -69,8 +68,6 @@ export function registerAppsCommands(_context: vscode.ExtensionContext) {
}

function refreshApps(): void {
analytics.event('Apps', 'refreshApps');

const appsProvider = providerStore.get<AppsProvider>('apps');
appsProvider.refresh();
}
Expand All @@ -80,8 +77,6 @@ async function editAppName(element: AppsProviderItem): Promise<void> {
return;
}

analytics.event('Apps', 'editAppName');

const app: IosApp | AndroidApp = element.app;
let packageName: string;

Expand Down Expand Up @@ -131,8 +126,6 @@ function showAppConfig(element: AppsProviderItem): void {
return;
}

analytics.event('Apps', 'showAppConfig');

vscode.window.withProgress(
{
title: `Loading configuration for "${element.app.appName}" ...`,
Expand Down Expand Up @@ -170,8 +163,6 @@ async function addAppCertificate(
return;
}

analytics.event('Apps', 'addAppCertificate');

const shaHash = await vscode.window.showInputBox({
placeHolder:
'00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00',
Expand Down Expand Up @@ -218,8 +209,6 @@ function copyAppCertificate(element: FingerprintItem): void {
return;
}

analytics.event('Apps', 'copyAppCertificate');

vscode.env.clipboard.writeText(element.label!);
}

Expand All @@ -228,8 +217,6 @@ async function deleteAppCertificate(element: FingerprintItem): Promise<void> {
return;
}

analytics.event('Apps', 'deleteAppCertificate');

const confirmation = await vscode.window.showWarningMessage(
'Delete certificate fingerprint?\n' +
'Warning: Any calls made to a Google API signed with this certificate may fail.\n\n' +
Expand Down Expand Up @@ -263,8 +250,6 @@ async function deleteAppCertificate(element: FingerprintItem): Promise<void> {
}

async function createNewApp(): Promise<void> {
analytics.event('Apps', 'createNewApp');

const appOptions: (vscode.QuickPickItem & {
options: { type: string; field: string; prompt: string };
})[] = [
Expand Down
15 changes: 0 additions & 15 deletions src/database/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { DatabaseProviderItem, DatabaseProvider } from './DatabaseProvider';
import { getFullPath } from '../utils';
import { DatabaseAPI } from './api';
import { providerStore } from '../stores';
import { analytics } from '../analytics';

export function registerDatabaseCommands(context: vscode.ExtensionContext) {
context.subscriptions.push(
Expand Down Expand Up @@ -57,8 +56,6 @@ export function registerDatabaseCommands(context: vscode.ExtensionContext) {
}

function refreshDatabase(): void {
analytics.event('Database', 'refreshDatabase');

const provider = providerStore.get<DatabaseProvider>('database');
provider.refresh();
}
Expand All @@ -68,8 +65,6 @@ async function editEntryValue(element: DatabaseProviderItem): Promise<void> {
return;
}

analytics.event('Database', 'editEntryValue');

const fullPath = getFullPath(element.parentPath, element.name);
let newValueStr = await vscode.window.showInputBox({
placeHolder: 'Enter value',
Expand Down Expand Up @@ -130,8 +125,6 @@ async function deleteEntry(element: DatabaseProviderItem): Promise<void> {
return;
}

analytics.event('Database', 'deleteEntry');

const fullPath = getFullPath(element.parentPath, element.name);

const confirmation = await vscode.window.showWarningMessage(
Expand Down Expand Up @@ -176,8 +169,6 @@ function copyName(element: DatabaseProviderItem): void {
return;
}

analytics.event('Database', 'copyName');

vscode.env.clipboard.writeText(element.name);
}

Expand All @@ -186,8 +177,6 @@ function copyPath(element: DatabaseProviderItem): void {
return;
}

analytics.event('Database', 'copyPath');

vscode.env.clipboard.writeText(
'/' + getFullPath(element.parentPath, element.name)
);
Expand All @@ -198,8 +187,6 @@ function copySnippetJS_ref(element: DatabaseProviderItem): void {
return;
}

analytics.event('Database', 'copySnippetJS_ref');

const fullPath = getFullPath(element.parentPath, element.name);
vscode.env.clipboard.writeText(`firebase.database().ref('${fullPath}')`);
}
Expand All @@ -209,8 +196,6 @@ function copySnippetJS_OnValue(element: DatabaseProviderItem): void {
return;
}

analytics.event('Database', 'copySnippetJS_OnValue');

const fullPath = getFullPath(element.parentPath, element.name);
vscode.env.clipboard.writeText(
[
Expand Down
6 changes: 0 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as vscode from 'vscode';
import { AccountManager } from './accounts/AccountManager';
import { getCliAccount } from './accounts/cli';
import { registerAccountsCommands } from './accounts/commands';
import { analytics } from './analytics';
import { AppsProvider } from './apps/AppsProvider';
import { registerAppsCommands } from './apps/commands';
import { registerDatabaseCommands } from './database/commands';
Expand Down Expand Up @@ -43,8 +42,6 @@ export async function activate(context: vscode.ExtensionContext) {
registerProjectsCommands(context);
registerFirestoreCommands(context);
registerDatabaseCommands(context);

analytics.event('Extension', 'activate');
}

export function deactivate() {
Expand All @@ -68,9 +65,6 @@ async function initialize(context: vscode.ExtensionContext): Promise<void> {
// context.globalState.update('config', undefined);
}

// Initialize analytics
analytics.initialize(context);

let extensionConfig = context.globalState.get<ExtensionConfig>('config');

if (!extensionConfig) {
Expand Down
21 changes: 0 additions & 21 deletions src/firestore/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from './FirestoreProvider';
import { getFieldValue, FirestoreAPI } from './api';
import { getFullPath } from '../utils';
import { analytics } from '../analytics';

export function registerFirestoreCommands(context: vscode.ExtensionContext) {
context.subscriptions.push(
Expand Down Expand Up @@ -105,8 +104,6 @@ export function registerFirestoreCommands(context: vscode.ExtensionContext) {
}

function providerRefresh(element?: FirestoreProviderItem): void {
analytics.event('Firestore', 'providerRefresh');

const firestoreProvider = providerStore.get<FirestoreProvider>('firestore');
firestoreProvider.refresh(element);
}
Expand All @@ -116,8 +113,6 @@ function copyItemName(element: CollectionItem | DocumentItem): void {
return;
}

analytics.event('Firestore', 'copyItemName');

vscode.env.clipboard.writeText(element.name);
}

Expand All @@ -126,8 +121,6 @@ function copyItemPath(element: CollectionItem | DocumentItem): void {
return;
}

analytics.event('Firestore', 'copyItemPath');

vscode.env.clipboard.writeText(
'/' + getFullPath(element.parentPath, element.name)
);
Expand All @@ -138,8 +131,6 @@ function copySnippetJS_ref(element: CollectionItem | DocumentItem): void {
return;
}

analytics.event('Firestore', 'copySnippetJS_ref');

const method = element instanceof CollectionItem ? 'collection' : 'doc';
const fullPath = getFullPath(element.parentPath, element.name);
vscode.env.clipboard.writeText(
Expand All @@ -152,8 +143,6 @@ function copySnippetJS_doc_onSnapshot(element: DocumentItem): void {
return;
}

analytics.event('Firestore', 'copySnippetJS_doc_onSnapshot');

const fullPath = getFullPath(element.parentPath, element.name);
vscode.env.clipboard.writeText(
[
Expand All @@ -171,8 +160,6 @@ function copySnippetJS_collection_onSnapshot(element: CollectionItem): void {
return;
}

analytics.event('Firestore', 'copySnippetJS_collection_onSnapshot');

const fullPath = getFullPath(element.parentPath, element.name);
vscode.env.clipboard.writeText(
[
Expand All @@ -192,8 +179,6 @@ async function copyDocumentContent(element: DocumentItem): Promise<void> {
return;
}

analytics.event('Firestore', 'copyDocumentContent');

// Documents that have been deleted don't have a "createTime" property
if (element.document.createTime && !element.document.fields) {
element.document = await vscode.window.withProgress(
Expand Down Expand Up @@ -229,8 +214,6 @@ async function deleteDocument(element: DocumentItem): Promise<void> {
return;
}

analytics.event('Firestore', 'deleteDocument');

const fullPath = getFullPath(element.parentPath, element.name);

const confirmation = await vscode.window.showWarningMessage(
Expand Down Expand Up @@ -266,8 +249,6 @@ function copyDocumentFieldName(element: DocumentFieldItem): void {
return;
}

analytics.event('Firestore', 'copyDocumentFieldName');

vscode.env.clipboard.writeText(element.name);
}

Expand All @@ -276,8 +257,6 @@ function copyDocumentFieldValue(element: DocumentFieldItem): void {
return;
}

analytics.event('Firestore', 'copyDocumentFieldValue');

try {
let value = JSON.stringify(getFieldValue(element.fieldValue));
vscode.env.clipboard.writeText(value);
Expand Down
Loading

0 comments on commit 7906d6c

Please sign in to comment.