@@ -72,6 +72,7 @@ export type BudPipelineItem = {
7272 updated_at ?: string ;
7373 step_count : number ;
7474 dag : DAGDefinition ;
75+ icon ?: string ;
7576 warnings ?: string [ ] ;
7677 execution_count ?: number ;
7778 last_execution_at ?: string ;
@@ -645,8 +646,8 @@ type BudPipelineStore = {
645646 getWorkflow : ( id : string ) => Promise < void > ;
646647 getExecutions : ( workflowId ?: string , page ?: number , pageSize ?: number ) => Promise < void > ;
647648 getExecution : ( executionId : string ) => Promise < void > ;
648- createWorkflow : ( dag : DAGDefinition ) => Promise < BudPipelineItem | null > ;
649- updateWorkflow : ( id : string , dag : DAGDefinition ) => Promise < BudPipelineItem | null > ;
649+ createWorkflow : ( dag : DAGDefinition , icon ?: string ) => Promise < BudPipelineItem | null > ;
650+ updateWorkflow : ( id : string , dag : DAGDefinition , icon ?: string ) => Promise < BudPipelineItem | null > ;
650651 executeWorkflow : ( workflowId : string , params : Record < string , any > ) => Promise < PipelineExecution | null > ;
651652 deleteWorkflow : ( id : string ) => Promise < boolean > ;
652653 validatePipeline : ( dag : DAGDefinition ) => Promise < ValidationResult > ;
@@ -852,7 +853,7 @@ export const useBudPipeline = create<BudPipelineStore>((set, get) => ({
852853 } ,
853854
854855 // Create workflow
855- createWorkflow : async ( dag : DAGDefinition ) => {
856+ createWorkflow : async ( dag : DAGDefinition , icon ?: string ) => {
856857 set ( { isLoading : true , error : null } ) ;
857858
858859 if ( USE_MOCK_DATA ) {
@@ -865,6 +866,7 @@ export const useBudPipeline = create<BudPipelineStore>((set, get) => ({
865866 created_at : new Date ( ) . toISOString ( ) ,
866867 step_count : dag . steps . length ,
867868 dag,
869+ icon,
868870 execution_count : 0 ,
869871 } ;
870872 set ( ( state ) => ( {
@@ -878,6 +880,7 @@ export const useBudPipeline = create<BudPipelineStore>((set, get) => ({
878880 const response = await AppRequest . Post ( BUDPIPELINE_API , {
879881 dag,
880882 name : dag . name ,
883+ icon,
881884 } ) ;
882885 const newWorkflow = response . data ;
883886 set ( ( state ) => ( {
@@ -896,7 +899,7 @@ export const useBudPipeline = create<BudPipelineStore>((set, get) => ({
896899 } ,
897900
898901 // Update workflow
899- updateWorkflow : async ( id : string , dag : DAGDefinition ) => {
902+ updateWorkflow : async ( id : string , dag : DAGDefinition , icon ?: string ) => {
900903 set ( { isLoading : true , error : null } ) ;
901904
902905 if ( USE_MOCK_DATA ) {
@@ -910,6 +913,7 @@ export const useBudPipeline = create<BudPipelineStore>((set, get) => ({
910913 updated_at : new Date ( ) . toISOString ( ) ,
911914 step_count : dag . steps . length ,
912915 dag,
916+ icon,
913917 execution_count : get ( ) . workflows . find ( ( w ) => w . id === id ) ?. execution_count || 0 ,
914918 } ;
915919 set ( ( state ) => ( {
@@ -924,6 +928,7 @@ export const useBudPipeline = create<BudPipelineStore>((set, get) => ({
924928 const response = await AppRequest . Put ( `${ BUDPIPELINE_API } /${ id } ` , {
925929 dag,
926930 name : dag . name ,
931+ icon,
927932 } ) ;
928933 const updatedWorkflow = response . data ;
929934 set ( ( state ) => ( {
0 commit comments