1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00

Remove todos

This commit is contained in:
Rory Powell 2022-06-06 11:11:13 +01:00
parent 4e77571ddb
commit 4cdfb3c110
27 changed files with 2 additions and 30 deletions

View file

@ -1,5 +1,5 @@
export const Events = {
//
// TODO: Remove most UI events
BUILDER: {
STARTED: "Builder Started",
},

View file

@ -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]

View file

@ -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)

View file

@ -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,

View file

@ -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,
})

View file

@ -426,7 +426,6 @@ export const getFrontendStore = () => {
})
// Log event
// todo: move to api
analytics.captureEvent(Events.COMPONENT.CREATED, {
name: componentInstance._component,
})

View file

@ -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")

View file

@ -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) {

View file

@ -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")

View file

@ -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) {

View file

@ -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),
})

View file

@ -72,7 +72,6 @@
}
notifications.success(`Imported successfully.`)
// todo: move to api
analytics.captureEvent(Events.QUERIES.REST.IMPORTED, {
importType: lastTouched,
newDatasource: createDatasource,

View file

@ -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()
}

View file

@ -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

View file

@ -42,7 +42,6 @@
asyncModal.hide()
publishCompleteModal.show()
} catch (error) {
// todo: move to api
analytics.captureException(error)
notifications.error("Error publishing app")
}

View file

@ -43,7 +43,6 @@
// Analytics
if (screen.template) {
// todo: move to api
analytics.captureEvent(Events.SCREEN.CREATED, {
template: "createFromScratch",
})

View file

@ -67,7 +67,6 @@
// Analytics
if (screen.template) {
// todo: move to api
analytics.captureEvent(Events.SCREEN.CREATED, {
template: screen.template,
datasource: screen.datasource,

View file

@ -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,

View file

@ -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,

View file

@ -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(

View file

@ -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")

View file

@ -57,7 +57,6 @@ export function createAuthStore() {
analytics
.activate()
.then(() => {
// todo: move to api
analytics.identify(user._id, user)
analytics.showChat({
email: user.email,

View file

@ -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, {

View file

@ -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() {

View file

@ -9,7 +9,6 @@ exports.InitTypes = {
DIGITAL_OCEAN: "do",
}
// todo: use backend core
exports.AnalyticsEvents = {
OptOut: "analytics_opt_out",
OptIn: "analytics_opt_in",

View file

@ -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 = [

View file

@ -1,4 +1,3 @@
// todo: audit
export const buildAnalyticsEndpoints = API => ({
/**
* Gets the current status of analytics for this environment