chore(sqllab): Add logging for actions (#28876)

This commit is contained in:
JUST.in DO IT
2024-06-14 09:35:17 -07:00
committed by GitHub
parent 66bd0ce3d0
commit 05829cbda9
9 changed files with 217 additions and 12 deletions

View File

@@ -30,6 +30,8 @@ import withToasts from 'src/components/MessageToasts/withToasts';
import CopyToClipboard from 'src/components/CopyToClipboard';
import { storeQuery } from 'src/utils/common';
import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor';
import { LOG_ACTIONS_SQLLAB_COPY_LINK } from 'src/logger/LogUtils';
import useLogAction from 'src/logger/useLogAction';
interface ShareSqlLabQueryProps {
queryEditorId: string;
@@ -51,7 +53,7 @@ const ShareSqlLabQuery = ({
addDangerToast,
}: ShareSqlLabQueryProps) => {
const theme = useTheme();
const logAction = useLogAction({ queryEditorId });
const { dbId, name, schema, autorun, sql, remoteId, templateParams } =
useQueryEditor(queryEditorId, [
'dbId',
@@ -91,6 +93,9 @@ const ShareSqlLabQuery = ({
}
};
const getCopyUrl = (callback: Function) => {
logAction(LOG_ACTIONS_SQLLAB_COPY_LINK, {
shortcut: false,
});
if (isFeatureEnabled(FeatureFlag.ShareQueriesViaKvStore)) {
return getCopyUrlForKvStore(callback);
}