Merge pull request #2757 from Budibase/feature/remove-analytics-platform-url
Remove platform url in the cloud, remove analytics picker completely
This commit is contained in:
commit
a0ba240821
|
@ -3,8 +3,6 @@ import PosthogClient from "./PosthogClient"
|
||||||
import IntercomClient from "./IntercomClient"
|
import IntercomClient from "./IntercomClient"
|
||||||
import SentryClient from "./SentryClient"
|
import SentryClient from "./SentryClient"
|
||||||
import { Events } from "./constants"
|
import { Events } from "./constants"
|
||||||
import { auth } from "stores/portal"
|
|
||||||
import { get } from "svelte/store"
|
|
||||||
|
|
||||||
const posthog = new PosthogClient(
|
const posthog = new PosthogClient(
|
||||||
process.env.POSTHOG_TOKEN,
|
process.env.POSTHOG_TOKEN,
|
||||||
|
@ -19,27 +17,13 @@ class AnalyticsHub {
|
||||||
}
|
}
|
||||||
|
|
||||||
async activate() {
|
async activate() {
|
||||||
// Setting the analytics env var off in the backend overrides org/tenant settings
|
|
||||||
const analyticsStatus = await api.get("/api/analytics")
|
const analyticsStatus = await api.get("/api/analytics")
|
||||||
const json = await analyticsStatus.json()
|
const json = await analyticsStatus.json()
|
||||||
|
|
||||||
// Multitenancy disabled on the backend
|
// Analytics disabled
|
||||||
if (!json.enabled) return
|
if (!json.enabled) return
|
||||||
|
|
||||||
const tenantId = get(auth).tenantId
|
|
||||||
|
|
||||||
if (tenantId) {
|
|
||||||
const res = await api.get(
|
|
||||||
`/api/global/configs/public?tenantId=${tenantId}`
|
|
||||||
)
|
|
||||||
const orgJson = await res.json()
|
|
||||||
|
|
||||||
// analytics opted out for the tenant
|
|
||||||
if (orgJson.config?.analytics === false) return
|
|
||||||
}
|
|
||||||
|
|
||||||
this.clients.forEach(client => client.init())
|
this.clients.forEach(client => client.init())
|
||||||
this.enabled = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
identify(id, metadata) {
|
identify(id, metadata) {
|
||||||
|
|
|
@ -7,13 +7,11 @@
|
||||||
Divider,
|
Divider,
|
||||||
Label,
|
Label,
|
||||||
Input,
|
Input,
|
||||||
Toggle,
|
|
||||||
Dropzone,
|
Dropzone,
|
||||||
notifications,
|
notifications,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { auth, organisation } from "stores/portal"
|
import { auth, organisation, admin } from "stores/portal"
|
||||||
import { post } from "builderStore/api"
|
import { post } from "builderStore/api"
|
||||||
import analytics from "analytics"
|
|
||||||
import { writable } from "svelte/store"
|
import { writable } from "svelte/store"
|
||||||
import { redirect } from "@roxi/routify"
|
import { redirect } from "@roxi/routify"
|
||||||
|
|
||||||
|
@ -25,7 +23,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const values = writable({
|
const values = writable({
|
||||||
analytics: analytics.enabled,
|
|
||||||
company: $organisation.company,
|
company: $organisation.company,
|
||||||
platformUrl: $organisation.platformUrl,
|
platformUrl: $organisation.platformUrl,
|
||||||
logo: $organisation.logoUrl
|
logo: $organisation.logoUrl
|
||||||
|
@ -57,7 +54,6 @@
|
||||||
const config = {
|
const config = {
|
||||||
company: $values.company ?? "",
|
company: $values.company ?? "",
|
||||||
platformUrl: $values.platformUrl ?? "",
|
platformUrl: $values.platformUrl ?? "",
|
||||||
analytics: $values.analytics,
|
|
||||||
}
|
}
|
||||||
// remove logo if required
|
// remove logo if required
|
||||||
if (!$values.logo) {
|
if (!$values.logo) {
|
||||||
|
@ -112,34 +108,22 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Divider size="S" />
|
{#if !$admin.cloud}
|
||||||
<Layout gap="XS" noPadding>
|
<Divider size="S" />
|
||||||
<Heading size="S">Platform</Heading>
|
|
||||||
<Body size="S">Here you can set up general platform settings.</Body>
|
|
||||||
</Layout>
|
|
||||||
<div class="fields">
|
|
||||||
<div class="field">
|
|
||||||
<Label size="L">Platform URL</Label>
|
|
||||||
<Input thin bind:value={$values.platformUrl} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Divider size="S" />
|
|
||||||
<Layout gap="S" noPadding>
|
|
||||||
<Layout gap="XS" noPadding>
|
<Layout gap="XS" noPadding>
|
||||||
<Heading size="S">Analytics</Heading>
|
<Heading size="S">Platform</Heading>
|
||||||
<Body size="S">
|
<Body size="S">Here you can set up general platform settings.</Body>
|
||||||
If you would like to send analytics that help us make Budibase better,
|
|
||||||
please let us know below.
|
|
||||||
</Body>
|
|
||||||
</Layout>
|
</Layout>
|
||||||
<Toggle
|
<div class="fields">
|
||||||
text="Send Analytics to Budibase"
|
<div class="field">
|
||||||
bind:value={$values.analytics}
|
<Label size="L">Platform URL</Label>
|
||||||
/>
|
<Input thin bind:value={$values.platformUrl} />
|
||||||
<div>
|
</div>
|
||||||
<Button disabled={loading} on:click={saveConfig} cta>Save</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
{/if}
|
||||||
|
<div>
|
||||||
|
<Button disabled={loading} on:click={saveConfig} cta>Save</Button>
|
||||||
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,9 @@
|
||||||
"lint:fix": "yarn run format && yarn run lint",
|
"lint:fix": "yarn run format && yarn run lint",
|
||||||
"initialise": "node scripts/initialise.js",
|
"initialise": "node scripts/initialise.js",
|
||||||
"multi:enable": "node scripts/multiTenancy.js enable",
|
"multi:enable": "node scripts/multiTenancy.js enable",
|
||||||
"multi:disable": "node scripts/multiTenancy.js disable"
|
"multi:disable": "node scripts/multiTenancy.js disable",
|
||||||
|
"selfhost:enable": "node scripts/selfhost.js enable",
|
||||||
|
"selfhost:disable": "node scripts/selfhost.js disable"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"preset": "ts-jest",
|
"preset": "ts-jest",
|
||||||
|
|
Loading…
Reference in New Issue