feat: add user_label to FieldIdentifier (#8126)

Co-authored-by: Mary Hipp Rogers <maryhipp@gmail.com>
This commit is contained in:
psychedelicious
2025-06-25 23:44:57 +10:00
committed by GitHub
parent 2ad5b5cc2e
commit 5128f072a8
4 changed files with 25 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ import { buildWorkflowWithValidation } from 'features/nodes/util/workflow/buildW
import { groupBy } from 'lodash-es';
import { useCallback } from 'react';
import { enqueueMutationFixedCacheKeyOptions, queueApi } from 'services/api/endpoints/queue';
import type { Batch, EnqueueBatchArg } from 'services/api/types';
import type { Batch, EnqueueBatchArg, S } from 'services/api/types';
import { assert } from 'tsafe';
const enqueueRequestedWorkflows = createAction('app/enqueueRequestedWorkflows');
@@ -106,12 +106,13 @@ export const useEnqueueWorkflows = () => {
// Derive the input fields from the builder's selected node field elements
const fieldIdentifiers = selectFieldIdentifiersWithInvocationTypes(state);
const inputs = getPublishInputs(fieldIdentifiers, templates);
const api_input_fields = inputs.publishable.map(({ nodeId, fieldName }) => {
const api_input_fields = inputs.publishable.map(({ nodeId, fieldName, label }) => {
return {
kind: 'input',
node_id: nodeId,
field_name: fieldName,
} as const;
user_label: label,
} satisfies S['FieldIdentifier'];
});
// Derive the output fields from the builder's selected output node
@@ -126,7 +127,8 @@ export const useEnqueueWorkflows = () => {
kind: 'output',
node_id: outputNodeId,
field_name: fieldName,
} as const;
user_label: null,
} satisfies S['FieldIdentifier'];
});
assert(nodesState.id, 'Workflow without ID cannot be used for API validation run');