mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat: Rewrite Front End cloud and posthog hooks using TypeScript (no-changelog) (#5491)
This commit is contained in:
@@ -16,7 +16,6 @@ import {
|
||||
} from '@/constants';
|
||||
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { useWebhooksStore } from '@/stores/webhooks.store';
|
||||
import { runExternalHook } from '@/utils';
|
||||
|
||||
import { useActions } from '../composables/useActions';
|
||||
@@ -171,7 +170,7 @@ function trackActionsView() {
|
||||
trigger_action_count,
|
||||
};
|
||||
|
||||
void runExternalHook('nodeCreateList.onViewActions', useWebhooksStore(), trackingPayload);
|
||||
void runExternalHook('nodeCreateList.onViewActions', trackingPayload);
|
||||
telemetry?.trackNodesPanel('nodeCreateList.onViewActions', trackingPayload);
|
||||
}
|
||||
|
||||
@@ -192,7 +191,7 @@ function addHttpNode() {
|
||||
if (telemetry) setAddedNodeActionParameters(updateData);
|
||||
|
||||
const app_identifier = actions.value[0].key;
|
||||
void runExternalHook('nodeCreateList.onActionsCustmAPIClicked', useWebhooksStore(), {
|
||||
void runExternalHook('nodeCreateList.onActionsCustmAPIClicked', {
|
||||
app_identifier,
|
||||
});
|
||||
telemetry?.trackNodesPanel('nodeCreateList.onActionsCustmAPIClicked', { app_identifier });
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, toRefs, onBeforeUnmount } from 'vue';
|
||||
import { useWebhooksStore } from '@/stores/webhooks.store';
|
||||
import { runExternalHook } from '@/utils';
|
||||
import { useExternalHooks } from '@/composables';
|
||||
|
||||
export interface Props {
|
||||
placeholder: string;
|
||||
@@ -46,6 +45,8 @@ const state = reactive({
|
||||
inputRef: null as HTMLInputElement | null,
|
||||
});
|
||||
|
||||
const externalHooks = useExternalHooks();
|
||||
|
||||
function focus() {
|
||||
state.inputRef?.focus();
|
||||
}
|
||||
@@ -60,9 +61,7 @@ function clear() {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void runExternalHook('nodeCreator_searchBar.mount', useWebhooksStore(), {
|
||||
inputRef: state.inputRef,
|
||||
});
|
||||
void externalHooks.run('nodeCreatorSearchBar.mount', { inputRef: state.inputRef });
|
||||
setTimeout(focus, 0);
|
||||
});
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import { useNodeCreatorStore } from '@/stores/nodeCreator.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { runExternalHook } from '@/utils';
|
||||
import { useWebhooksStore } from '@/stores/webhooks.store';
|
||||
|
||||
import { sortNodeCreateElements, transformNodeType } from '../utils';
|
||||
|
||||
@@ -256,7 +255,7 @@ export const useActions = () => {
|
||||
source_mode: rootView.toLowerCase(),
|
||||
resource: (action.value as INodeParameters).resource || '',
|
||||
};
|
||||
void runExternalHook('nodeCreateList.addAction', useWebhooksStore(), payload);
|
||||
void runExternalHook('nodeCreateList.addAction', payload);
|
||||
telemetry?.trackNodesPanel('nodeCreateList.addAction', payload);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user