Skip to content
Open
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
28 changes: 0 additions & 28 deletions frontend/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -636,37 +636,9 @@ const Constants = {
],
isCustomFlagsmithUrl: () =>
Constants.getFlagsmithSDKUrl() !== 'https://edge.api.flagsmith.com/api/v1/',
modals: {
'PAYMENT': 'Payment Modal',
},
organisationPermissions: (perm: OrganisationPermission) => {
return `To manage this feature you need the <i>${OrganisationPermissionDescriptions[perm]}</i> permission for this organisation.<br/>Please contact a member of this organisation who has administrator privileges.`
},
pages: {
'ACCOUNT': 'Account Page',
'AUDIT_LOG': 'Audit Log Page',
'CHECK_EMAIL': 'Check Email Page',
'COMING_SOON': 'Coming Soon Page',
'CREATE_ENVIRONMENT': 'Create Environment Page',
'CREATE_ORGANISATION': 'Create Organisation Page',
'DOCUMENTATION': 'Documentation Page',
'EMAIL_ACTIVATION': 'Email Activation Page',
'ENVIRONMENT_SETTINGS': 'Environment Settings Page',
'FEATURES': 'Features Page',
'HOME': 'Home Page',
'INTEGRATIONS': 'Integrations Page',
'INVITE': 'User Invited Page',
'NOT_FOUND': '404 Page',
'ORGANISATION_SETTINGS': 'Organisation Settings Page',
'POLICIES': 'Terms & Policies Page',
'PRICING': 'Pricing Page',
'PROJECT_SELECT': 'Project Select Page',
'PROJECT_SETTINGS': 'Project Settings Page',
'RESET_PASSWORD': 'Reset Password Page',
'USER': 'User Page',
'USERS': 'Users Page',
'WHAT_ARE_FEATURE_FLAGS': 'What are feature flags Page',
},
projectPermissions: (perm: ProjectPermission) => {
return `To use this feature you need the <i>${ProjectPermissionDescriptions[perm]}</i> permission for this project.<br/>Please contact a member of this project who has administrator privileges.`
},
Expand Down
84 changes: 0 additions & 84 deletions frontend/common/hooks/usePageTracking.ts

This file was deleted.

22 changes: 22 additions & 0 deletions frontend/common/hooks/useSaveLastEnvironment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { useEffect } from 'react'

type LastEnvironment = {
environmentId?: string
organisationId?: number
projectId?: number
}

export function useSaveLastEnvironment({
environmentId,
organisationId,
projectId,
}: LastEnvironment): void {
useEffect(() => {
if (typeof AsyncStorage !== 'undefined' && AsyncStorage.setItem) {
AsyncStorage.setItem(
'lastEnv',
JSON.stringify({ environmentId, orgId: organisationId, projectId }),
)
}
}, [environmentId, organisationId, projectId])
}
1 change: 0 additions & 1 deletion frontend/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ declare global {
const toast: (message: string) => void
const Tooltip: FC<TooltipProps>
const API: {
trackPage: (title: string, path?: string) => void
trackEvent: (data: {
category: string
event: string
Expand Down
5 changes: 0 additions & 5 deletions frontend/web/components/modals/payment/Payment.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { FC, useEffect } from 'react'
import Constants from 'common/constants'
import InfoMessage from 'components/InfoMessage'
import BlockedOrgInfo from 'components/BlockedOrgInfo'
import { Organisation } from 'common/types/responses'
Expand Down Expand Up @@ -36,10 +35,6 @@ export const Payment: FC<PaymentProps> = ({
const { hasActiveSubscription, isAWS, plan, setYearly, yearly } =
usePaymentState({ organisation })

useEffect(() => {
API.trackPage(Constants.modals.PAYMENT)
}, [])

useEffect(() => {
if (ready && !error) {
bindChargebeeButtons({ isPaymentsEnabled })
Expand Down
6 changes: 0 additions & 6 deletions frontend/web/components/pages/CheckEmailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { Link, useHistory, useLocation } from 'react-router-dom'
import AccountStore from 'common/stores/account-store'
import Button from 'components/base/forms/Button'
import Card from 'components/Card'
import Constants from 'common/constants'
import ErrorMessage from 'components/ErrorMessage'
import InfoMessage from 'components/InfoMessage'
import NavIconSmall from 'components/icons/NavIconSmall'
import API from 'project/api'
import { useResendActivationEmailMutation } from 'common/services/useEmailActivation'

type LocationState = { email?: string } | undefined
Expand All @@ -27,10 +25,6 @@ const CheckEmailPage: FC = () => {
const [resendActivationEmail, { isError, isLoading, isSuccess }] =
useResendActivationEmailMutation()

useEffect(() => {
API.trackPage(Constants.pages.CHECK_EMAIL)
}, [])

useEffect(() => {
if (!email) {
history.replace('/login')
Expand Down
3 changes: 0 additions & 3 deletions frontend/web/components/pages/CreateEnvironmentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import ProjectProvider, {
import AccountStore from 'common/stores/account-store'
import Utils from 'common/utils/utils'
import { useHistory } from 'react-router-dom'
import API from 'project/api'
import FieldLabel from 'components/base/forms/FieldLabel'
import InputGroup from 'components/base/forms/InputGroup'
import { Environment, Role, User } from 'common/types/responses'
Expand Down Expand Up @@ -136,8 +135,6 @@ const CreateEnvironmentPage: React.FC = () => {
}

useEffect(() => {
API.trackPage(Constants.pages.CREATE_ENVIRONMENT)

if (Utils.getPlansPermission('METADATA')) {
getSupportedContentType(getStore(), {
organisation_id: AccountStore.getOrganisation().id,
Expand Down
2 changes: 0 additions & 2 deletions frontend/web/components/pages/CreateOrganisationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import FieldLabel from 'components/base/forms/FieldLabel'
import Link from 'components/base/link/Link'
import { useHistory } from 'react-router-dom'
import ConfigProvider from 'common/providers/ConfigProvider'
import Constants from 'common/constants'
import PageTitle from 'components/PageTitle'
import CondensedRow from 'components/CondensedRow'
import InputGroup from 'components/base/forms/InputGroup'
Expand Down Expand Up @@ -79,7 +78,6 @@ const CreateOrganisationPage: React.FC = () => {
}, [hosting, history, showHostingPreferences, updateTools])

useEffect(() => {
API.trackPage(Constants.pages.CREATE_ORGANISATION)
focusTimeout.current = setTimeout(() => {
inputRef.current?.focus?.()
focusTimeout.current = null
Expand Down
6 changes: 0 additions & 6 deletions frontend/web/components/pages/EmailActivationPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ import { FetchBaseQueryError } from '@reduxjs/toolkit/query'
import AccountStore from 'common/stores/account-store'
import Button from 'components/base/forms/Button'
import Card from 'components/Card'
import Constants from 'common/constants'
import ErrorMessage from 'components/ErrorMessage'
import InfoMessage from 'components/InfoMessage'
import InputGroup from 'components/base/forms/InputGroup'
import NavIconSmall from 'components/icons/NavIconSmall'
import Utils from 'common/utils/utils'
import API from 'project/api'
import {
useActivateAccountMutation,
useResendActivationEmailMutation,
Expand Down Expand Up @@ -60,10 +58,6 @@ const EmailActivationPage: FC = () => {
const status = (activationError as FetchBaseQueryError | undefined)?.status
const isLinkSpent = status === 400 || status === 403

useEffect(() => {
API.trackPage(Constants.pages.EMAIL_ACTIVATION, '/activate')
}, [])

const activate = useCallback(() => {
activateAccount({ token, uid })
.unwrap()
Expand Down
1 change: 0 additions & 1 deletion frontend/web/components/pages/IdentityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ const IdentityPage: FC = () => {
AppActions.getIdentity(environmentId, id)
getTags(getStore(), { projectId: `${projectId}` })
getActualFlags()
API.trackPage(Constants.pages.USER)
// eslint-disable-next-line
}, [])

Expand Down
7 changes: 1 addition & 6 deletions frontend/web/components/pages/IntegrationsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, { FC, useEffect } from 'react'
import React, { FC } from 'react'
import IntegrationList from 'components/IntegrationList'
import { useHasPermission } from 'common/providers/Permission'
import Constants from 'common/constants'
import PageTitle from 'components/PageTitle'
import Utils from 'common/utils/utils'
import API from 'project/api'
import { useGetProjectQuery } from 'common/services/useProject'
import { useRouteContext } from 'components/providers/RouteContext'
import {
Expand Down Expand Up @@ -33,10 +32,6 @@ export type IntegrationSummary = {

const IntegrationsPage: FC = () => {
const { organisationId, projectId } = useRouteContext()
useEffect(() => {
API.trackPage(Constants.pages.INTEGRATIONS)
}, [])

const integrationData = Utils.getIntegrationData()
const integrations = Object.keys(integrationData).sort((a, b) =>
(integrationData[a]?.title || a).localeCompare(
Expand Down
5 changes: 0 additions & 5 deletions frontend/web/components/pages/InvitePage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react'
import Constants from 'common/constants'
import { withRouter } from 'react-router-dom'
import AccountProvider from 'common/providers/AccountProvider'
const InvitePage = class extends Component {
Expand All @@ -11,10 +10,6 @@ const InvitePage = class extends Component {
AppActions.acceptInvite(this.props.match.params.id)
}

componentDidMount = () => {
API.trackPage(Constants.pages.INVITE)
}

onSave = (id) => {
AppActions.selectOrganisation(id)
this.props.history.replace(Utils.getOrganisationHomePage(id))
Expand Down
7 changes: 1 addition & 6 deletions frontend/web/components/pages/NotFoundErrorPage.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import React, { FC, useEffect } from 'react'
import Constants from 'common/constants'
import React, { FC } from 'react'

const NotFoundErrorPage: FC = () => {
useEffect(() => {
API.trackPage(Constants.pages.COMING_SOON)
}, [])

return (
<div className='app-container container'>
<h3 className='pt-5'>Oops!</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import React, { useEffect } from 'react'
import React from 'react'
import IntegrationList from 'components/IntegrationList'
import Constants from 'common/constants'
import PageTitle from 'components/PageTitle'
import Utils from 'common/utils/utils'
import AccountStore from 'common/stores/account-store'
import { OrganisationPermission } from 'common/types/permissions.types'
import { useHasPermission } from 'common/providers/Permission'
import API from 'project/api'

const OrganisationIntegrationsPage = ({ match }) => {
useEffect(() => {
API.trackPage(Constants.pages.INTEGRATIONS)
}, [])

const integrationData = Utils.getIntegrationData()
const allIntegrations = Object.keys(integrationData).sort((a, b) =>
(integrationData[a]?.title || a).localeCompare(
Expand Down
5 changes: 0 additions & 5 deletions frontend/web/components/pages/PasswordResetPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { Component } from 'react'
import Constants from 'common/constants'
import ErrorMessage from 'components/ErrorMessage'
import { withRouter } from 'react-router-dom'
const PasswordResetPage = class extends Component {
Expand All @@ -10,10 +9,6 @@ const PasswordResetPage = class extends Component {
this.state = {}
}

componentDidMount = () => {
API.trackPage(Constants.pages.RESET_PASSWORD)
}

onSave = () => {
this.props.history.replace('/login')
toast('Your password has been reset')
Expand Down
4 changes: 0 additions & 4 deletions frontend/web/components/pages/SegmentsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
useGetSegmentsQuery,
} from 'common/services/useSegment'
import { useHasPermission } from 'common/providers/Permission'
import API from 'project/api'
import Button from 'components/base/forms/Button'
import Chip from 'components/base/Chip'
import CreateSegmentModal from 'components/modals/CreateSegment'
Expand Down Expand Up @@ -75,9 +74,6 @@ const SegmentsPage: FC = () => {
ProjectStore.getMaxSegmentsAllowed(),
)

useEffect(() => {
API.trackPage(Constants.pages.FEATURES)
}, [])
useEffect(() => {
if (error) {
// Kick user back out to projects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import AddMetadataToEntity from 'components/metadata/AddMetadataToEntity'
import { getSupportedContentType } from 'common/services/useSupportedContentType'
import Format from 'common/utils/format'
import Setting from 'components/Setting'
import API from 'project/api'
import AppActions from 'common/dispatcher/app-actions'
import { Environment, Webhook, Role } from 'common/types/responses'
import PanelSearch from 'components/PanelSearch'
Expand Down Expand Up @@ -164,7 +163,6 @@ const EnvironmentSettingsPage: React.FC = () => {
}, [match.params.environmentId, getEnvironment])

useEffect(() => {
API.trackPage(Constants.pages.ENVIRONMENT_SETTINGS)
Comment thread
talissoncosta marked this conversation as resolved.
Resolved
getEnvironment()
}, [getEnvironment])

Expand Down
Loading
Loading