mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(editor): Add telemetry to resource moving (#9720)
This commit is contained in:
parent
d62ca78a4c
commit
e84d2538b6
|
@ -23,7 +23,7 @@ const CREDENTIAL_LIST_ITEM_ACTIONS = {
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
data: ICredentialsResponse;
|
data: ICredentialsResponse;
|
||||||
readOnly: boolean;
|
readOnly?: boolean;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { useProjectsStore } from '@/stores/projects.store';
|
||||||
import Modal from '@/components/Modal.vue';
|
import Modal from '@/components/Modal.vue';
|
||||||
import { N8nCheckbox, N8nText } from 'n8n-design-system';
|
import { N8nCheckbox, N8nText } from 'n8n-design-system';
|
||||||
import { useToast } from '@/composables/useToast';
|
import { useToast } from '@/composables/useToast';
|
||||||
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
modalName: string;
|
modalName: string;
|
||||||
|
@ -21,6 +22,7 @@ const i18n = useI18n();
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const uiStore = useUIStore();
|
const uiStore = useUIStore();
|
||||||
const projectsStore = useProjectsStore();
|
const projectsStore = useProjectsStore();
|
||||||
|
const telemetry = useTelemetry();
|
||||||
|
|
||||||
const checks = ref([false, false]);
|
const checks = ref([false, false]);
|
||||||
const allChecked = computed(() => checks.value.every(Boolean));
|
const allChecked = computed(() => checks.value.every(Boolean));
|
||||||
|
@ -43,6 +45,10 @@ const confirm = async () => {
|
||||||
props.data.projectId,
|
props.data.projectId,
|
||||||
);
|
);
|
||||||
closeModal();
|
closeModal();
|
||||||
|
telemetry.track(`User successfully moved ${props.data.resourceType}`, {
|
||||||
|
[`${props.data.resourceType}_id`]: props.data.resource.id,
|
||||||
|
project_from_type: projectsStore.currentProject?.type ?? projectsStore.personalProject?.type,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.showError(
|
toast.showError(
|
||||||
error.message,
|
error.message,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import type { ICredentialsResponse, IWorkflowDb } from '@/Interface';
|
import type { ICredentialsResponse, IWorkflowDb } from '@/Interface';
|
||||||
import { useI18n } from '@/composables/useI18n';
|
import { useI18n } from '@/composables/useI18n';
|
||||||
import { useUIStore } from '@/stores/ui.store';
|
import { useUIStore } from '@/stores/ui.store';
|
||||||
|
@ -7,6 +7,7 @@ import { useProjectsStore } from '@/stores/projects.store';
|
||||||
import Modal from '@/components/Modal.vue';
|
import Modal from '@/components/Modal.vue';
|
||||||
import { PROJECT_MOVE_RESOURCE_CONFIRM_MODAL } from '@/constants';
|
import { PROJECT_MOVE_RESOURCE_CONFIRM_MODAL } from '@/constants';
|
||||||
import { splitName } from '@/utils/projects.utils';
|
import { splitName } from '@/utils/projects.utils';
|
||||||
|
import { useTelemetry } from '@/composables/useTelemetry';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
modalName: string;
|
modalName: string;
|
||||||
|
@ -19,6 +20,7 @@ const props = defineProps<{
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
const uiStore = useUIStore();
|
const uiStore = useUIStore();
|
||||||
const projectsStore = useProjectsStore();
|
const projectsStore = useProjectsStore();
|
||||||
|
const telemetry = useTelemetry();
|
||||||
|
|
||||||
const projectId = ref<string | null>(null);
|
const projectId = ref<string | null>(null);
|
||||||
const processedName = computed(() => {
|
const processedName = computed(() => {
|
||||||
|
@ -48,6 +50,13 @@ const next = () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
telemetry.track(`User clicked to move a ${props.data.resourceType}`, {
|
||||||
|
[`${props.data.resourceType}_id`]: props.data.resource.id,
|
||||||
|
project_from_type: projectsStore.currentProject?.type ?? projectsStore.personalProject?.type,
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Modal width="500px" :name="props.modalName" data-test-id="project-move-resource-modal">
|
<Modal width="500px" :name="props.modalName" data-test-id="project-move-resource-modal">
|
||||||
|
|
|
@ -36,7 +36,7 @@ const WORKFLOW_LIST_ITEM_ACTIONS = {
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
data: IWorkflowDb;
|
data: IWorkflowDb;
|
||||||
readOnly: boolean;
|
readOnly?: boolean;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
|
Loading…
Reference in a new issue