Skip to content

Commit 06c9779

Browse files
authored
chore(ui): ent telemetry (#400)
* chore(ui): ent telemetry * update submodule * remove console logging
1 parent 5134ba6 commit 06c9779

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

packages/browser-tests/questdb

Submodule questdb updated 334 files

packages/web-console/src/providers/SettingsProvider/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { ConsoleConfig, Settings, Warning } from "./types"
99
import { CenteredLayout } from "../../components"
1010
import { Box, Button, Text } from "@questdb/react-components"
1111
import { Refresh } from "@styled-icons/remix-line"
12+
import {setValue} from "../../utils/localStorage";
13+
import {StoreKey} from "../../utils/localStorage/types";
1214

1315
enum View {
1416
loading = 0,
@@ -109,10 +111,10 @@ export const SettingsProvider = ({
109111
)
110112
if (settings) {
111113
setSettings(settings)
114+
setValue(StoreKey.RELEASE_TYPE, settings["release.type"])
112115
}
113116
if (warnings) {
114117
setWarnings(warnings)
115-
// setWarnings(warningMock)
116118
}
117119
if (consoleConfig) {
118120
setConsoleConfig(consoleConfig)

packages/web-console/src/store/Telemetry/epics.ts

+13
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ export const getRemoteConfig: Epic<StoreAction, TelemetryAction, StoreShape> = (
100100
withLatestFrom(state$),
101101
switchMap(([_, state]) => {
102102
const config = selectors.telemetry.getConfig(state)
103+
104+
const isEE = getValue(StoreKey.RELEASE_TYPE) === "EE"
105+
if (isEE) {
106+
fetch(`${API}/add-ent`, {
107+
method: "POST",
108+
headers: {
109+
"Content-Type": "application/json",
110+
},
111+
body: JSON.stringify(config),
112+
}).catch( () => {
113+
})
114+
}
115+
103116
if (config?.enabled) {
104117
return fromFetch<Partial<TelemetryRemoteConfigShape>>(
105118
`${API}/config`,

packages/web-console/src/utils/localStorage/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
******************************************************************************/
2424

2525
export enum StoreKey {
26+
RELEASE_TYPE = "RELEASE_TYPE",
2627
AUTH_PAYLOAD = "AUTH_PAYLOAD",
2728
AUTH_REFRESH_TOKEN = "AUTH_REFRESH_TOKEN",
2829
OAUTH_REDIRECT_COUNT = "oauth.redirect.count",

0 commit comments

Comments
 (0)