Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove mixpanel #4862

Merged
merged 3 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ VITE_DEFAULT_NETWORK=1
VITE_PUSHER_BEAMS_INSTANCE_ID=2e080021-d495-456d-b2cf-84f9fd718442
VITE_SHUTTER_EON_PUBKEY=0x0e6493bbb4ee8b19aa9b70367685049ff01dc9382c46aed83f8bc07d2a5ba3e6030bd83b942c1fd3dff5b79bef3b40bf6b666e51e7f0be14ed62daaffad47435265f5c9403b1a801921981f7d8659a9bd91fe92fb1cf9afdb16178a532adfaf51a237103874bb03afafe9cab2118dae1be5f08a0a28bf488c1581e9db4bc23ca
VITE_ENV=develop
VITE_MIXPANEL_TOKEN=2ec6cd1b19e790f45cc9a9bb83980c8d
VITE_ALCHEMY_API_KEY=ombBQyf580z-jx2EVQgJu4eTjePU-a2z
1 change: 0 additions & 1 deletion .eslintrc-auto-import.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
"useEmailSubscription": true,
"useEmailFetchClient": true,
"useStatement": true,
"useMixpanel": true,
"useBalances": true,
"useAccount": true,
"usePayment": true,
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"kubo-rpc-client": "^3.0.2",
"lodash": "^4.17.21",
"minisearch": "^6.2.0",
"mixpanel-browser": "^2.48.1",
"remarkable": "^2.0.1",
"remove-markdown": "^0.5.0",
"typescript": "^5.2.2",
Expand Down
93 changes: 16 additions & 77 deletions src/composables/useClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export function useClient() {
const { notify } = useFlashNotification();
const { notifyModal } = useModalNotification();
const { isGnosisSafe } = useGnosis();
const { mixpanel } = useMixpanel();
const { web3 } = useWeb3();
const auth = getInstance();
const route = useRoute();
Expand Down Expand Up @@ -46,7 +45,7 @@ export function useClient() {
plugins = payload.metadata.plugins;

if (type === 'create-proposal') {
const receipt = await client.proposal(auth.web3, web3.value.account, {
return client.proposal(auth.web3, web3.value.account, {
space: space.id,
type: payload.type,
title: payload.name,
Expand All @@ -59,36 +58,19 @@ export function useClient() {
plugins: JSON.stringify(plugins),
app: DEFINED_APP
});

mixpanel.track('Propose', {
space: space.id
});

return receipt;
} else if (type === 'update-proposal') {
const receipt = await client.updateProposal(
auth.web3,
web3.value.account,
{
proposal: payload.id,
space: space.id,
type: payload.type,
title: payload.name,
body: payload.body,
discussion: payload.discussion,
choices: payload.choices,
plugins: JSON.stringify(plugins)
}
);

mixpanel.track('Update proposal', {
return client.updateProposal(auth.web3, web3.value.account, {
proposal: payload.id,
space: space.id,
proposalId: payload.id
type: payload.type,
title: payload.name,
body: payload.body,
discussion: payload.discussion,
choices: payload.choices,
plugins: JSON.stringify(plugins)
});

return receipt;
} else if (type === 'vote') {
const receipt = await client.vote(auth.web3, web3.value.account, {
return client.vote(auth.web3, web3.value.account, {
space: space.id,
proposal: payload.proposal.id,
type: payload.proposal.type,
Expand All @@ -97,74 +79,31 @@ export function useClient() {
app: DEFINED_APP,
reason: payload.reason
});

mixpanel.track('Vote', {
space: space.id,
proposalId: payload.proposal.id
});

return receipt;
} else if (type === 'delete-proposal') {
const receipt = await client.cancelProposal(
auth.web3,
web3.value.account,
{
space: space.id,
proposal: payload.proposal.id
}
);

mixpanel.track('Delete proposal', {
return client.cancelProposal(auth.web3, web3.value.account, {
space: space.id,
proposalId: payload.proposal.id
proposal: payload.proposal.id
});

return receipt;
} else if (type === 'settings') {
const receipt = await client.space(auth.web3, web3.value.account, {
return client.space(auth.web3, web3.value.account, {
space: space.id,
settings: JSON.stringify(payload)
});

mixpanel.track('Update space settings', {
space: space.id
});

return receipt;
} else if (type === 'delete-space') {
const receipt = await client.deleteSpace(auth.web3, web3.value.account, {
return client.deleteSpace(auth.web3, web3.value.account, {
space: space.id
});

mixpanel.track('Delete space', {
space: space.id
});

return receipt;
} else if (type === 'set-statement') {
const receipt = await client.statement(auth.web3, web3.value.account, {
return client.statement(auth.web3, web3.value.account, {
space: space.id,
about: payload.about,
statement: payload.statement
});

mixpanel.track('Set statement', {
space: space.id
});

return receipt;
} else if (type === 'flag-proposal') {
const receipt = await client.flagProposal(auth.web3, web3.value.account, {
return client.flagProposal(auth.web3, web3.value.account, {
space: space.id,
proposal: payload.proposal.id
});

mixpanel.track('Flag proposal', {
space: space.id,
proposalId: payload.proposal.id
});

return receipt;
}
}

Expand Down
12 changes: 0 additions & 12 deletions src/composables/useMixpanel.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createRouter, createWebHashHistory, RouteLocation } from 'vue-router';
import { useMixpanel } from '@/composables/useMixpanel';

import DelegateView from '@/views/DelegateView.vue';
import ExploreView from '@/views/ExploreView.vue';
Expand Down Expand Up @@ -29,7 +28,6 @@ import TermsView from '@/views/TermsView.vue';
// The frontend shows all spaces or just a single one, when being accessed
// through that space's custom domain.
const { domain, domainAlias } = useApp();
const { mixpanel } = useMixpanel();

const routes: any[] = [];

Expand Down Expand Up @@ -189,13 +187,6 @@ const router = createRouter({
}
});

router.afterEach(to => {
mixpanel.track_pageview({
page_name: to.name,
page_path: to.path
});
});

export { routes };

export default router;
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6757,11 +6757,6 @@ minisearch@^6.2.0:
resolved "https://registry.yarnpkg.com/minisearch/-/minisearch-6.2.0.tgz#310b50508551f22e10815f5baedeeeded03a6b5d"
integrity sha512-BECkorDF1TY2rGKt9XHdSeP9TP29yUbrAaCh/C03wpyf1vx3uYcP/+8XlMcpTkgoU0rBVnHMAOaP83Rc9Tm+TQ==

mixpanel-browser@^2.48.1:
version "2.48.1"
resolved "https://registry.yarnpkg.com/mixpanel-browser/-/mixpanel-browser-2.48.1.tgz#0fec03d87f57fe2e72c6a4b1df5924436840ece7"
integrity sha512-vXTuUzZMg+ht7sRqyjtc3dUDy/81Z/H6FLFgFkUZJqKFaAqcx1JSXmOdY/2kmsxCkUdy5JN5zW9m9TMCk+rxGQ==

mlly@^1.1.1, mlly@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.2.0.tgz#f0f6c2fc8d2d12ea6907cd869066689b5031b613"
Expand Down
Loading