mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-12 16:10:30 +02:00
refactor(editor): Use workflowsStore.workflowId computed shorthand (no-changelog) (#28851)
This commit is contained in:
parent
89e9117d39
commit
9997203667
|
|
@ -36,7 +36,7 @@ const i18n = useI18n();
|
|||
|
||||
const workflowsStore = useWorkflowsStore();
|
||||
const workflowDocumentStore = computed(() =>
|
||||
useWorkflowDocumentStore(createWorkflowDocumentId(workflowsStore.workflow.id)),
|
||||
useWorkflowDocumentStore(createWorkflowDocumentId(workflowsStore.workflowId)),
|
||||
);
|
||||
const credentialsStore = useCredentialsStore();
|
||||
const { showMessage } = useToast();
|
||||
|
|
@ -159,7 +159,7 @@ const shouldShowFreeAiCreditsWarning = computed((): boolean => {
|
|||
async function displayActivationError() {
|
||||
let errorMessage: string | VNode;
|
||||
try {
|
||||
const errorData = await workflowsStore.getActivationError(workflowsStore.workflow.id);
|
||||
const errorData = await workflowsStore.getActivationError(workflowsStore.workflowId);
|
||||
|
||||
if (errorData === undefined) {
|
||||
errorMessage = i18n.baseText(
|
||||
|
|
@ -193,7 +193,7 @@ async function handlePublish() {
|
|||
|
||||
// Activate the workflow
|
||||
const { success, errorHandled } = await workflowActivate.publishWorkflow(
|
||||
workflowsStore.workflow.id,
|
||||
workflowsStore.workflowId,
|
||||
workflowDocumentStore.value?.versionId ?? '',
|
||||
{
|
||||
name: versionName.value,
|
||||
|
|
@ -219,7 +219,7 @@ async function handlePublish() {
|
|||
}
|
||||
|
||||
telemetry.track('User published version from canvas', {
|
||||
workflow_id: workflowsStore.workflow.id,
|
||||
workflow_id: workflowsStore.workflowId,
|
||||
});
|
||||
|
||||
// For now, just close the modal after successful activation
|
||||
|
|
@ -264,7 +264,7 @@ async function handlePublish() {
|
|||
<li v-for="node in workflowsStore.nodesWithIssues" :key="node.id">
|
||||
<N8nLink
|
||||
size="small"
|
||||
:to="`/workflow/${workflowsStore.workflow.id}/${node.id}`"
|
||||
:to="`/workflow/${workflowsStore.workflowId}/${node.id}`"
|
||||
@click="modalBus.emit('close')"
|
||||
>{{ node.name }}</N8nLink
|
||||
>
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ export function useWorkflowSaving({
|
|||
next(
|
||||
router.resolve({
|
||||
name: VIEWS.WORKFLOW,
|
||||
params: { name: workflowsStore.workflow.id },
|
||||
params: { name: workflowsStore.workflowId },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ const usageStore = useUsageStore();
|
|||
const pageRedirectionHelper = usePageRedirectionHelper();
|
||||
|
||||
const hasRuns = computed(() => {
|
||||
return evaluationStore.testRunsByWorkflowId[workflowsStore.workflow.id]?.length > 0;
|
||||
return evaluationStore.testRunsByWorkflowId[workflowsStore.workflowId]?.length > 0;
|
||||
});
|
||||
|
||||
const evaluationsAvailable = computed(() => {
|
||||
|
|
@ -74,7 +74,7 @@ const toggleStep = (index: number) => {
|
|||
function navigateToWorkflow(
|
||||
action?: 'addEvaluationTrigger' | 'addEvaluationNode' | 'executeEvaluation',
|
||||
) {
|
||||
const routeWorkflowId = workflowsStore.workflow.id || 'new';
|
||||
const routeWorkflowId = workflowsStore.workflowId || 'new';
|
||||
|
||||
void router.push({
|
||||
name: VIEWS.WORKFLOW,
|
||||
|
|
|
|||
|
|
@ -407,14 +407,14 @@ const onDragChange = (optionName: string) => {
|
|||
const trackWorkflowInputFieldTypeChange = (parameterData: IUpdateInformation) => {
|
||||
telemetry.track('User changed workflow input field type', {
|
||||
type: parameterData.value,
|
||||
workflow_id: workflowsStore.workflow.id,
|
||||
workflow_id: workflowsStore.workflowId,
|
||||
node_id: ndvStore.activeNode?.id,
|
||||
});
|
||||
};
|
||||
|
||||
const trackWorkflowInputFieldAdded = () => {
|
||||
telemetry.track('User added workflow input field', {
|
||||
workflow_id: workflowsStore.workflow.id,
|
||||
workflow_id: workflowsStore.workflowId,
|
||||
node_id: ndvStore.activeNode?.id,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -414,7 +414,7 @@ const handleDelete = (optionName: string, index?: number) => {
|
|||
|
||||
const trackFieldAdded = () => {
|
||||
telemetry.track('User added workflow input field', {
|
||||
workflow_id: workflowsStore.workflow.id,
|
||||
workflow_id: workflowsStore.workflowId,
|
||||
node_id: ndvStore.activeNode?.id,
|
||||
});
|
||||
};
|
||||
|
|
@ -422,7 +422,7 @@ const trackFieldAdded = () => {
|
|||
const trackFieldTypeChange = (parameterData: IUpdateInformation) => {
|
||||
telemetry.track('User changed workflow input field type', {
|
||||
type: parameterData.value,
|
||||
workflow_id: workflowsStore.workflow.id,
|
||||
workflow_id: workflowsStore.workflowId,
|
||||
node_id: ndvStore.activeNode?.id,
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ const currentRequestParams = computed(() => {
|
|||
credentials: props.node?.credentials ?? {},
|
||||
filter: searchFilter.value,
|
||||
projectId: projectsStore.currentProjectId,
|
||||
workflowId: workflowsStore.workflow.id,
|
||||
workflowId: workflowsStore.workflowId,
|
||||
};
|
||||
});
|
||||
|
||||
|
|
@ -835,7 +835,7 @@ async function loadResources() {
|
|||
currentNodeParameters: resolvedNodeParameters,
|
||||
credentials: props.node.credentials,
|
||||
projectId: projectsStore.currentProjectId,
|
||||
workflowId: workflowsStore.workflow.id,
|
||||
workflowId: workflowsStore.workflowId,
|
||||
};
|
||||
|
||||
if (params.filter) {
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ const createRequestParams = async (methodName: string) => {
|
|||
methodName,
|
||||
credentials: props.node.credentials,
|
||||
projectId: projectsStore.currentProjectId,
|
||||
workflowId: workflowsStore.workflow.id,
|
||||
workflowId: workflowsStore.workflowId,
|
||||
};
|
||||
|
||||
return requestParams;
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ const hasParameters = computed(() => allSections.value.some(sectionHasParameters
|
|||
const telemetryPayload = computed(() => ({
|
||||
type: ['node-group'],
|
||||
template_id: workflowDocumentStore?.value?.meta?.templateId,
|
||||
workflow_id: workflowsStore.workflow.id,
|
||||
workflow_id: workflowsStore.workflowId,
|
||||
node_types: allSections.value.map((s) => s.node.type),
|
||||
has_parameters: hasParameters.value,
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ const telemetryPayload = computed(() => {
|
|||
return {
|
||||
type: types,
|
||||
template_id: workflowDocumentStore?.value?.meta?.templateId,
|
||||
workflow_id: workflowsStore.workflow.id,
|
||||
workflow_id: workflowsStore.workflowId,
|
||||
node_types: (props.state.allNodesUsingCredential ?? [props.state.node]).map((n) => n.type),
|
||||
credential_type: props.state.credentialType,
|
||||
has_parameters: hasParameters.value,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user