8726 workflow add a test button in workflow code step (#9016)
- add test button to workflow code step - add test tab to workflow code step https://github.com/user-attachments/assets/e180a827-7321-49a2-8026-88490c557da2  
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
import { ServerlessFunctionExecutionStatus } from '~/generated-metadata/graphql';
|
||||
import { createFamilyState } from '@/ui/utilities/state/utils/createFamilyState';
|
||||
|
||||
export type ServerlessFunctionTestData = {
|
||||
input: { [field: string]: any };
|
||||
output: {
|
||||
data?: string;
|
||||
duration?: number;
|
||||
status?: ServerlessFunctionExecutionStatus;
|
||||
error?: string;
|
||||
};
|
||||
language: 'plaintext' | 'json';
|
||||
height: number;
|
||||
};
|
||||
|
||||
export const DEFAULT_OUTPUT_VALUE =
|
||||
'Enter an input above then press "run Function"';
|
||||
|
||||
export const serverlessFunctionTestDataFamilyState = createFamilyState<
|
||||
ServerlessFunctionTestData,
|
||||
string
|
||||
>({
|
||||
key: 'serverlessFunctionTestDataFamilyState',
|
||||
defaultValue: {
|
||||
language: 'plaintext',
|
||||
height: 64,
|
||||
input: {},
|
||||
output: { data: DEFAULT_OUTPUT_VALUE },
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user