1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 22:05:23 +02:00

refactor(wizard): migrate to react [EE-2305] (#6957)

This commit is contained in:
Chaim Lev-Ari 2022-05-23 17:32:51 +03:00 committed by GitHub
parent 3aacaa7caf
commit 01dc9066b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
125 changed files with 2994 additions and 1744 deletions

View file

@ -1,5 +1,7 @@
import _ from 'lodash';
import { useSettings } from '@/portainer/settings/queries';
const categories = [
'docker',
'kubernetes',
@ -61,6 +63,18 @@ export function push(
}
}
export function useAnalytics() {
const telemetryQuery = useSettings((settings) => settings.EnableTelemetry);
return { trackEvent: handleTrackEvent };
function handleTrackEvent(...args: Parameters<typeof trackEvent>) {
if (telemetryQuery.data) {
trackEvent(...args);
}
}
}
export function trackEvent(action: string, properties: TrackEventProps) {
/**
* @description Logs an event with an event category (Videos, Music, Games...), an event