mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor: Telemetry updates (#3529)
* Init unit tests for telemetry * Update telemetry tests * Test Workflow execution errored event * Add new tracking logic in pulse * cleanup * interfaces * Add event_version for Workflow execution count event * add version_cli in all events * add user saved credentials event * update manual wf exec finished, fixes * improve typings, lint * add node_graph_string in User clicked execute workflow button event * add User set node operation or mode event * Add instance started event in FE * Add User clicked retry execution button event * add expression editor event * add input node type to add node event * add User stopped workflow execution wvent * add error message in saved credential event * update stop execution event * add execution preflight event * Remove instance started even tfrom FE, add session started to FE,BE * improve typing * remove node_graph as property from all events * move back from default export * move psl npm package to cli package * cr * update webhook node domain logic * fix is_valid for User saved credentials event * fix Expression Editor variable selector event * add caused_by_credential in preflight event * undo webhook_domain * change node_type to full type * add webhook_domain property in manual execution event (#3680) * add webhook_domain property in manual execution event * lint fix
This commit is contained in:
@@ -102,6 +102,59 @@ export default mixins(
|
||||
itemSelected (eventData: IVariableItemSelected) {
|
||||
(this.$refs.inputFieldExpression as any).itemSelected(eventData); // tslint:disable-line:no-any
|
||||
this.$externalHooks().run('expressionEdit.itemSelected', { parameter: this.parameter, value: this.value, selectedItem: eventData });
|
||||
|
||||
const trackProperties: {
|
||||
event_version: string;
|
||||
node_type_dest: string;
|
||||
node_type_source?: string;
|
||||
parameter_name_dest: string;
|
||||
parameter_name_source?: string;
|
||||
variable_type?: string;
|
||||
is_immediate_input: boolean;
|
||||
variable_expression: string;
|
||||
node_name: string;
|
||||
} = {
|
||||
event_version: '2',
|
||||
node_type_dest: this.$store.getters.activeNode.type,
|
||||
parameter_name_dest: this.parameter.displayName,
|
||||
is_immediate_input: false,
|
||||
variable_expression: eventData.variable,
|
||||
node_name: this.$store.getters.activeNode.name,
|
||||
};
|
||||
|
||||
if (eventData.variable) {
|
||||
let splitVar = eventData.variable.split('.');
|
||||
|
||||
if (eventData.variable.startsWith('Object.keys')) {
|
||||
splitVar = eventData.variable.split('(')[1].split(')')[0].split('.');
|
||||
trackProperties.variable_type = 'Keys';
|
||||
} else if (eventData.variable.startsWith('Object.values')) {
|
||||
splitVar = eventData.variable.split('(')[1].split(')')[0].split('.');
|
||||
trackProperties.variable_type = 'Values';
|
||||
} else {
|
||||
trackProperties.variable_type = 'Raw value';
|
||||
}
|
||||
|
||||
if (splitVar[0].startsWith('$node')) {
|
||||
const sourceNodeName = splitVar[0].split('"')[1];
|
||||
trackProperties.node_type_source = this.$store.getters.getNodeByName(sourceNodeName).type;
|
||||
const nodeConnections: Array<Array<{ node: string }>> = this.$store.getters.outgoingConnectionsByNodeName(sourceNodeName).main;
|
||||
trackProperties.is_immediate_input = (nodeConnections && nodeConnections[0] && !!nodeConnections[0].find(({ node }) => node === this.$store.getters.activeNode.name)) ? true : false;
|
||||
|
||||
if (splitVar[1].startsWith('parameter')) {
|
||||
trackProperties.parameter_name_source = splitVar[1].split('"')[1];
|
||||
}
|
||||
|
||||
} else {
|
||||
trackProperties.is_immediate_input = true;
|
||||
|
||||
if(splitVar[0].startsWith('$parameter')) {
|
||||
trackProperties.parameter_name_source = splitVar[0].split('"')[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.$telemetry.track('User inserted item from Expression Editor variable selector', trackProperties);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
Reference in New Issue
Block a user