mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(editor): Add telemetry events for data tables (no-changelog) (#19091)
This commit is contained in:
committed by
GitHub
parent
4313aa315f
commit
d666b65a7f
@@ -931,6 +931,7 @@ function valueChanged(untypedValue: unknown) {
|
|||||||
is_custom: value === CUSTOM_API_CALL_KEY,
|
is_custom: value === CUSTOM_API_CALL_KEY,
|
||||||
push_ref: ndvStore.pushRef,
|
push_ref: ndvStore.pushRef,
|
||||||
parameter: props.parameter.name,
|
parameter: props.parameter.name,
|
||||||
|
value: value as string,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Track workflow input data mode change
|
// Track workflow input data mode change
|
||||||
|
|||||||
@@ -345,11 +345,11 @@ const setSorting = async (sort: string, persistUpdate = true) => {
|
|||||||
sortBy.value = sort;
|
sortBy.value = sort;
|
||||||
if (persistUpdate) {
|
if (persistUpdate) {
|
||||||
await savePaginationPreferences();
|
await savePaginationPreferences();
|
||||||
|
sendSortingTelemetry();
|
||||||
}
|
}
|
||||||
emit('update:pagination-and-sort', {
|
emit('update:pagination-and-sort', {
|
||||||
sort,
|
sort,
|
||||||
});
|
});
|
||||||
sendSortingTelemetry();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const setCurrentPage = async (page: number, persistUpdate = true) => {
|
const setCurrentPage = async (page: number, persistUpdate = true) => {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { useUIStore } from '@/stores/ui.store';
|
|||||||
import { useToast } from '@/composables/useToast';
|
import { useToast } from '@/composables/useToast';
|
||||||
import { useRoute, useRouter } from 'vue-router';
|
import { useRoute, useRouter } from 'vue-router';
|
||||||
import { DATA_STORE_DETAILS, PROJECT_DATA_STORES } from '@/features/dataStore/constants';
|
import { DATA_STORE_DETAILS, PROJECT_DATA_STORES } from '@/features/dataStore/constants';
|
||||||
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
modalName: string;
|
modalName: string;
|
||||||
@@ -20,6 +21,7 @@ const route = useRoute();
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
|
const telemetry = useTelemetry();
|
||||||
|
|
||||||
const dataStoreName = ref('');
|
const dataStoreName = ref('');
|
||||||
const inputRef = ref<HTMLInputElement | null>(null);
|
const inputRef = ref<HTMLInputElement | null>(null);
|
||||||
@@ -37,14 +39,18 @@ const onSubmit = async () => {
|
|||||||
dataStoreName.value,
|
dataStoreName.value,
|
||||||
route.params.projectId as string,
|
route.params.projectId as string,
|
||||||
);
|
);
|
||||||
|
telemetry.track('User created data table', {
|
||||||
|
data_table_id: newDataStore.id,
|
||||||
|
data_table_project_id: newDataStore.project?.id,
|
||||||
|
});
|
||||||
|
dataStoreName.value = '';
|
||||||
|
uiStore.closeModal(props.modalName);
|
||||||
void router.push({
|
void router.push({
|
||||||
name: DATA_STORE_DETAILS,
|
name: DATA_STORE_DETAILS,
|
||||||
params: {
|
params: {
|
||||||
id: newDataStore.id,
|
id: newDataStore.id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
dataStoreName.value = '';
|
|
||||||
uiStore.closeModal(props.modalName);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(error, i18n.baseText('dataStore.add.error'));
|
toast.showError(error, i18n.baseText('dataStore.add.error'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { useMessage } from '@/composables/useMessage';
|
|||||||
import { MODAL_CONFIRM } from '@/constants';
|
import { MODAL_CONFIRM } from '@/constants';
|
||||||
import { useDataStoreStore } from '@/features/dataStore/dataStore.store';
|
import { useDataStoreStore } from '@/features/dataStore/dataStore.store';
|
||||||
import { useToast } from '@/composables/useToast';
|
import { useToast } from '@/composables/useToast';
|
||||||
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
dataStore: DataStore;
|
dataStore: DataStore;
|
||||||
@@ -34,6 +35,7 @@ const dataStoreStore = useDataStoreStore();
|
|||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
|
const telemetry = useTelemetry();
|
||||||
|
|
||||||
const actions = computed<Array<UserAction<IUser>>>(() => {
|
const actions = computed<Array<UserAction<IUser>>>(() => {
|
||||||
const availableActions = [
|
const availableActions = [
|
||||||
@@ -93,6 +95,10 @@ const deleteDataStore = async () => {
|
|||||||
throw new Error(i18n.baseText('generic.unknownError'));
|
throw new Error(i18n.baseText('generic.unknownError'));
|
||||||
}
|
}
|
||||||
emit('onDeleted');
|
emit('onDeleted');
|
||||||
|
telemetry.track('User deleted data table', {
|
||||||
|
data_table_id: props.dataStore.id,
|
||||||
|
data_table_project_id: props.dataStore.projectId,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(error, i18n.baseText('dataStore.delete.error'));
|
toast.showError(error, i18n.baseText('dataStore.delete.error'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import DataStoreActions from '@/features/dataStore/components/DataStoreActions.v
|
|||||||
import { PROJECT_DATA_STORES } from '@/features/dataStore/constants';
|
import { PROJECT_DATA_STORES } from '@/features/dataStore/constants';
|
||||||
import { useDataStoreStore } from '@/features/dataStore/dataStore.store';
|
import { useDataStoreStore } from '@/features/dataStore/dataStore.store';
|
||||||
import { useToast } from '@/composables/useToast';
|
import { useToast } from '@/composables/useToast';
|
||||||
|
import { telemetry } from '@/plugins/telemetry';
|
||||||
|
|
||||||
const BREADCRUMBS_SEPARATOR = '/';
|
const BREADCRUMBS_SEPARATOR = '/';
|
||||||
|
|
||||||
@@ -77,6 +78,10 @@ const onNameSubmit = async (name: string) => {
|
|||||||
throw new Error(i18n.baseText('generic.unknownError'));
|
throw new Error(i18n.baseText('generic.unknownError'));
|
||||||
}
|
}
|
||||||
editableName.value = name;
|
editableName.value = name;
|
||||||
|
telemetry.track('User renamed data table', {
|
||||||
|
data_table_id: props.dataStore.id,
|
||||||
|
data_table_project_id: props.dataStore.projectId,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Revert to original name if rename fails
|
// Revert to original name if rename fails
|
||||||
editableName.value = props.dataStore.name;
|
editableName.value = props.dataStore.name;
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ import ElDatePickerCellEditor from '@/features/dataStore/components/dataGrid/ElD
|
|||||||
import { onClickOutside } from '@vueuse/core';
|
import { onClickOutside } from '@vueuse/core';
|
||||||
import { useClipboard } from '@/composables/useClipboard';
|
import { useClipboard } from '@/composables/useClipboard';
|
||||||
import { reorderItem } from '@/features/dataStore/utils';
|
import { reorderItem } from '@/features/dataStore/utils';
|
||||||
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
|
|
||||||
// Register only the modules we actually use
|
// Register only the modules we actually use
|
||||||
ModuleRegistry.registerModules([
|
ModuleRegistry.registerModules([
|
||||||
@@ -105,6 +106,7 @@ const i18n = useI18n();
|
|||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
const { mapToAGCellType } = useDataStoreTypes();
|
const { mapToAGCellType } = useDataStoreTypes();
|
||||||
|
const telemetry = useTelemetry();
|
||||||
|
|
||||||
const dataStoreStore = useDataStoreStore();
|
const dataStoreStore = useDataStoreStore();
|
||||||
|
|
||||||
@@ -226,6 +228,11 @@ const onDeleteColumn = async (columnId: string) => {
|
|||||||
props.dataStore.projectId,
|
props.dataStore.projectId,
|
||||||
columnId,
|
columnId,
|
||||||
);
|
);
|
||||||
|
telemetry.track('User deleted data table column', {
|
||||||
|
column_id: columnId,
|
||||||
|
column_type: columnToDelete.cellDataType,
|
||||||
|
data_table_id: props.dataStore.id,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(error, i18n.baseText('dataStore.deleteColumn.error'));
|
toast.showError(error, i18n.baseText('dataStore.deleteColumn.error'));
|
||||||
colDefs.value.splice(columnToDeleteIndex, 0, columnToDelete);
|
colDefs.value.splice(columnToDeleteIndex, 0, columnToDelete);
|
||||||
@@ -253,6 +260,11 @@ const onAddColumn = async (column: DataStoreColumnCreatePayload) => {
|
|||||||
return { ...row, [newColumn.name]: null };
|
return { ...row, [newColumn.name]: null };
|
||||||
});
|
});
|
||||||
refreshGridData();
|
refreshGridData();
|
||||||
|
telemetry.track('User added data table column', {
|
||||||
|
column_id: newColumn.id,
|
||||||
|
column_type: newColumn.type,
|
||||||
|
data_table_id: props.dataStore.id,
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(error, i18n.baseText('dataStore.addColumn.error'));
|
toast.showError(error, i18n.baseText('dataStore.addColumn.error'));
|
||||||
@@ -421,6 +433,9 @@ const onAddRowClick = async () => {
|
|||||||
refreshGridData();
|
refreshGridData();
|
||||||
await nextTick();
|
await nextTick();
|
||||||
focusFirstEditableCell(newRow.id as number);
|
focusFirstEditableCell(newRow.id as number);
|
||||||
|
telemetry.track('User added row to data table', {
|
||||||
|
data_table_id: props.dataStore.id,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(error, i18n.baseText('dataStore.addRow.error'));
|
toast.showError(error, i18n.baseText('dataStore.addRow.error'));
|
||||||
} finally {
|
} finally {
|
||||||
@@ -529,6 +544,12 @@ const onCellValueChanged = async (params: CellValueChangedEvent<DataStoreRow>) =
|
|||||||
await dataStoreStore.updateRow(props.dataStore.id, props.dataStore.projectId, id, {
|
await dataStoreStore.updateRow(props.dataStore.id, props.dataStore.projectId, id, {
|
||||||
[fieldName]: value,
|
[fieldName]: value,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
telemetry.track('User edited data table content', {
|
||||||
|
data_table_id: props.dataStore.id,
|
||||||
|
column_id: colDef.colId,
|
||||||
|
column_type: colDef.cellDataType,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Revert cell to original value if the update fails
|
// Revert cell to original value if the update fails
|
||||||
const validOldValue = isDataStoreValue(oldValue) ? oldValue : null;
|
const validOldValue = isDataStoreValue(oldValue) ? oldValue : null;
|
||||||
@@ -764,6 +785,11 @@ const handleDeleteSelected = async () => {
|
|||||||
message: '',
|
message: '',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
telemetry.track('User deleted rows in data table', {
|
||||||
|
data_table_id: props.dataStore.id,
|
||||||
|
deleted_row_count: idsToDelete.length,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(error, i18n.baseText('dataStore.deleteRows.error'));
|
toast.showError(error, i18n.baseText('dataStore.deleteRows.error'));
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user