Remove todos
This commit is contained in:
parent
4e77571ddb
commit
4cdfb3c110
|
@ -1,5 +1,5 @@
|
|||
export const Events = {
|
||||
//
|
||||
// TODO: Remove most UI events
|
||||
BUILDER: {
|
||||
STARTED: "Builder Started",
|
||||
},
|
||||
|
|
|
@ -11,7 +11,7 @@ const posthog = new PosthogClient(
|
|||
const sentry = new SentryClient(process.env.SENTRY_DSN)
|
||||
const intercom = new IntercomClient(process.env.INTERCOM_TOKEN)
|
||||
|
||||
//
|
||||
// TODO: Remove most UI events
|
||||
class AnalyticsHub {
|
||||
constructor() {
|
||||
this.clients = [posthog, sentry, intercom]
|
||||
|
|
|
@ -22,9 +22,6 @@ export const API = createAPIClient({
|
|||
onError: error => {
|
||||
const { url, message, status, method, handled } = error || {}
|
||||
|
||||
// Log all API errors to Sentry
|
||||
// todo: move to api
|
||||
// analytics.captureException(error)
|
||||
// Log any errors that we haven't manually handled
|
||||
if (!handled) {
|
||||
console.error("Unhandled error from API client", error)
|
||||
|
|
|
@ -31,7 +31,6 @@ export async function saveDatasource(config, skipFetch = false) {
|
|||
// update the tables incase data source plus
|
||||
await tables.fetch()
|
||||
await datasources.select(resp._id)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.DATASOURCE.CREATED, {
|
||||
name: resp.name,
|
||||
source: resp.source,
|
||||
|
|
|
@ -125,7 +125,6 @@ const automationActions = store => ({
|
|||
state.selectedBlock = newBlock
|
||||
return state
|
||||
})
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.AUTOMATION.BLOCK_ADDED, {
|
||||
name: block.name,
|
||||
})
|
||||
|
|
|
@ -426,7 +426,6 @@ export const getFrontendStore = () => {
|
|||
})
|
||||
|
||||
// Log event
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.COMPONENT.CREATED, {
|
||||
name: componentInstance._component,
|
||||
})
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
notifications.success(`Automation ${name} created`)
|
||||
|
||||
$goto(`./${$automationStore.selectedAutomation.automation._id}`)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.AUTOMATION.CREATED, { name })
|
||||
} catch (error) {
|
||||
notifications.error("Error creating automation")
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
}
|
||||
await automationStore.actions.save(updatedAutomation)
|
||||
notifications.success(`Automation ${name} updated successfully`)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.AUTOMATION.SAVED, { name })
|
||||
hide()
|
||||
} catch (error) {
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
try {
|
||||
views.save(view)
|
||||
notifications.success(`View ${view.name} saved`)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.VIEW.ADDED_CALCULATE, { field: view.field })
|
||||
} catch (error) {
|
||||
notifications.error("Error saving view")
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
field,
|
||||
})
|
||||
notifications.success(`View ${name} created`)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.VIEW.CREATED, { name })
|
||||
$goto(`../../view/${name}`)
|
||||
} catch (error) {
|
||||
|
|
|
@ -75,7 +75,6 @@
|
|||
try {
|
||||
views.save(view)
|
||||
notifications.success(`View ${view.name} saved`)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.VIEW.ADDED_FILTER, {
|
||||
filters: JSON.stringify(view.filters),
|
||||
})
|
||||
|
|
|
@ -72,7 +72,6 @@
|
|||
}
|
||||
|
||||
notifications.success(`Imported successfully.`)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.QUERIES.REST.IMPORTED, {
|
||||
importType: lastTouched,
|
||||
newDatasource: createDatasource,
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
}
|
||||
await datasources.save(updatedDatasource)
|
||||
notifications.success(`Datasource ${name} updated successfully.`)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.DATASOURCE.UPDATED, updatedDatasource)
|
||||
hide()
|
||||
}
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
try {
|
||||
table = await tables.save(newTable)
|
||||
notifications.success(`Table ${name} created successfully.`)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.TABLE.CREATED, { name })
|
||||
|
||||
// Navigate to new table
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
asyncModal.hide()
|
||||
publishCompleteModal.show()
|
||||
} catch (error) {
|
||||
// todo: move to api
|
||||
analytics.captureException(error)
|
||||
notifications.error("Error publishing app")
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
|
||||
// Analytics
|
||||
if (screen.template) {
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.SCREEN.CREATED, {
|
||||
template: "createFromScratch",
|
||||
})
|
||||
|
|
|
@ -67,7 +67,6 @@
|
|||
|
||||
// Analytics
|
||||
if (screen.template) {
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.SCREEN.CREATED, {
|
||||
template: screen.template,
|
||||
datasource: screen.datasource,
|
||||
|
|
|
@ -103,7 +103,6 @@
|
|||
|
||||
// Create App
|
||||
const createdApp = await API.createApp(data)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.APP.CREATED, {
|
||||
name: $values.name,
|
||||
appId: createdApp.instance._id,
|
||||
|
|
|
@ -138,7 +138,6 @@
|
|||
|
||||
// Create App
|
||||
const createdApp = await API.createApp(data)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.APP.CREATED, {
|
||||
name: appName,
|
||||
appId: createdApp.instance._id,
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
smtpConfig._id = savedConfig._id
|
||||
await admin.getChecklist()
|
||||
notifications.success(`Settings saved`)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.SMTP.SAVED)
|
||||
} catch (error) {
|
||||
notifications.error(
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
try {
|
||||
const res = await users.invite({ email: $email, builder, admin })
|
||||
notifications.success(res.message)
|
||||
// todo: move to api
|
||||
analytics.captureEvent(Events.USER.INVITE, { type: selected })
|
||||
} catch (error) {
|
||||
notifications.error("Error inviting user")
|
||||
|
|
|
@ -57,7 +57,6 @@ export function createAuthStore() {
|
|||
analytics
|
||||
.activate()
|
||||
.then(() => {
|
||||
// todo: move to api
|
||||
analytics.identify(user._id, user)
|
||||
analytics.showChat({
|
||||
email: user.email,
|
||||
|
|
|
@ -6,7 +6,6 @@ const {
|
|||
} = require("../constants")
|
||||
const ConfigManager = require("../structures/ConfigManager")
|
||||
|
||||
// use backend core
|
||||
class AnalyticsClient {
|
||||
constructor() {
|
||||
this.client = new PostHog(BUDIBASE_POSTHOG_TOKEN, {
|
||||
|
|
|
@ -3,8 +3,6 @@ const { CommandWords } = require("../constants")
|
|||
const { success, error } = require("../utils")
|
||||
const AnalyticsClient = require("./Client")
|
||||
|
||||
// use backend core
|
||||
|
||||
const client = new AnalyticsClient()
|
||||
|
||||
async function optOut() {
|
||||
|
|
|
@ -9,7 +9,6 @@ exports.InitTypes = {
|
|||
DIGITAL_OCEAN: "do",
|
||||
}
|
||||
|
||||
// todo: use backend core
|
||||
exports.AnalyticsEvents = {
|
||||
OptOut: "analytics_opt_out",
|
||||
OptIn: "analytics_opt_in",
|
||||
|
|
|
@ -15,7 +15,6 @@ const makeEnv = require("./makeEnv")
|
|||
const axios = require("axios")
|
||||
const AnalyticsClient = require("../analytics/Client")
|
||||
|
||||
// todo: use backend core
|
||||
const BUDIBASE_SERVICES = ["app-service", "worker-service", "proxy-service"]
|
||||
const ERROR_FILE = "docker-error.log"
|
||||
const FILE_URLS = [
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// todo: audit
|
||||
export const buildAnalyticsEndpoints = API => ({
|
||||
/**
|
||||
* Gets the current status of analytics for this environment
|
||||
|
|
Loading…
Reference in New Issue