@@ -94,8 +94,8 @@ const toggleEditMode = () => {
9494 // If we removed a temporary item but have no previous selection, fall back to first workflow
9595 const fallback = store .workflowEvents .find ((w ) => {
9696 if (! canceledWorkflow ) return false ;
97- const baseType = canceledWorkflow .base_event_type || canceledWorkflow . workflow_event ;
98- return baseType && (w .base_event_type === baseType || w . workflow_event === baseType || w .event_id === baseType );
97+ const baseType = canceledWorkflow .workflow_event ;
98+ return baseType && (w .workflow_event === baseType || w .event_id === baseType );
9999 }) || store .workflowEvents [0 ];
100100 if (fallback ) {
101101 store .selectedItem = fallback .event_id ;
@@ -132,12 +132,6 @@ const deleteWorkflow = async () => {
132132 return ;
133133 }
134134
135- const currentBaseEventType = store .selectedWorkflow .base_event_type || store .selectedWorkflow .workflow_event || store .selectedWorkflow .event_id ;
136- const currentCapabilities = store .selectedWorkflow .capabilities ;
137- // Extract base name without any parenthetical descriptions
138- const currentDisplayName = (store .selectedWorkflow .display_name || store .selectedWorkflow .workflow_event || store .selectedWorkflow .event_id )
139- .replace (/ \s * \( [^ )] * \) \s * / g , ' ' );
140-
141135 // If deleting a temporary workflow (new or cloned, unsaved), just remove from list
142136 if (store .selectedWorkflow .id === 0 ) {
143137 const tempIndex = store .workflowEvents .findIndex ((w ) =>
@@ -155,7 +149,7 @@ const deleteWorkflow = async () => {
155149
156150 // Find workflows for the same base event type
157151 const sameEventWorkflows = store .workflowEvents .filter ((w ) =>
158- (w .base_event_type === currentBaseEventType || w . workflow_event === currentBaseEventType )
152+ (w .workflow_event === store . selectedWorkflow . workflow_event )
159153 );
160154
161155 let workflowToSelect = null ;
@@ -198,7 +192,7 @@ const cloneWorkflow = (sourceWorkflow) => {
198192 if (! sourceWorkflow ) return ;
199193
200194 // Generate a unique temporary ID for the cloned workflow
201- const tempId = ` clone-${sourceWorkflow .base_event_type || sourceWorkflow . workflow_event }-${Date .now ()} ` ;
195+ const tempId = ` clone-${sourceWorkflow .workflow_event }-${Date .now ()} ` ;
202196
203197 // Extract base name without any parenthetical descriptions
204198 const baseName = (sourceWorkflow .display_name || sourceWorkflow .workflow_event || sourceWorkflow .event_id )
@@ -209,8 +203,7 @@ const cloneWorkflow = (sourceWorkflow) => {
209203 id: 0 , // New workflow
210204 event_id: tempId ,
211205 display_name: ` ${baseName } (Copy) ` ,
212- base_event_type: sourceWorkflow .base_event_type || sourceWorkflow .workflow_event || sourceWorkflow .event_id ,
213- workflow_event: sourceWorkflow .workflow_event || sourceWorkflow .base_event_type ,
206+ workflow_event: sourceWorkflow .workflow_event ,
214207 capabilities: sourceWorkflow .capabilities ,
215208 filters: JSON .parse (JSON .stringify (sourceWorkflow .filters || [])), // Deep clone
216209 actions: JSON .parse (JSON .stringify (sourceWorkflow .actions || [])), // Deep clone
@@ -325,12 +318,11 @@ const workflowList = computed(() => {
325318 return workflows .map ((workflow ) => ({
326319 ... workflow ,
327320 isConfigured: isWorkflowConfigured (workflow ),
328- base_event_type: workflow .base_event_type || workflow .workflow_event || workflow .event_id ,
329321 display_name: workflow .display_name || workflow .workflow_event || workflow .event_id ,
330322 }));
331323});
332324
333- const createNewWorkflow = (baseEventType , capabilities , displayName ) => {
325+ const createNewWorkflow = (eventType , capabilities , displayName ) => {
334326 // Store current selection before creating new workflow
335327 if (! isInEditMode .value ) {
336328 previousSelection .value = {
@@ -339,7 +331,7 @@ const createNewWorkflow = (baseEventType, capabilities, displayName) => {
339331 };
340332 }
341333
342- const tempId = ` new-${baseEventType }-${Date .now ()} ` ;
334+ const tempId = ` new-${eventType }-${Date .now ()} ` ;
343335 const newWorkflow = {
344336 id: 0 ,
345337 event_id: tempId ,
@@ -348,14 +340,13 @@ const createNewWorkflow = (baseEventType, capabilities, displayName) => {
348340 filters: [],
349341 actions: [],
350342 filter_summary: ' ' ,
351- base_event_type: baseEventType ,
352- workflow_event: baseEventType ,
343+ workflow_event: eventType ,
353344 enabled: true , // Ensure new workflows are enabled by default
354345 };
355346
356347 store .selectedWorkflow = newWorkflow ;
357348 // For unconfigured events, use the base event type as selected item for UI consistency
358- store .selectedItem = baseEventType ;
349+ store .selectedItem = eventType ;
359350 store .resetWorkflowData ();
360351 // Unconfigured workflows are always in edit mode by default
361352};
@@ -383,21 +374,20 @@ const selectWorkflowItem = async (item) => {
383374 } else {
384375 // This is an unconfigured event - check if we already have a workflow object for it
385376 const existingWorkflow = store .workflowEvents .find ((w ) =>
386- w .id === 0 &&
387- (w .base_event_type === item .base_event_type || w .workflow_event === item .base_event_type ),
377+ w .id === 0 && w .workflow_event === item .workflow_event ,
388378 );
389379
390380 if (existingWorkflow ) {
391381 // We already have an unconfigured workflow for this event type, select it
392382 await selectWorkflowEvent (existingWorkflow );
393383 } else {
394384 // This is truly a new unconfigured event, create new workflow
395- createNewWorkflow (item .base_event_type , item .capabilities , item .display_name );
385+ createNewWorkflow (item .workflow_event , item .capabilities , item .display_name );
396386 }
397387
398388 // Update URL for workflow
399- const newUrl = ` ${props .projectLink }/workflows/${item .base_event_type } ` ;
400- window .history .pushState ({eventId: item .base_event_type }, ' ' , newUrl );
389+ const newUrl = ` ${props .projectLink }/workflows/${item .workflow_event } ` ;
390+ window .history .pushState ({eventId: item .workflow_event }, ' ' , newUrl );
401391 }
402392};
403393
@@ -433,18 +423,17 @@ const isItemSelected = (item) => {
433423 // For configured workflows or temporary workflows (new), match by event_id
434424 return store .selectedItem === item .event_id ;
435425 }
436- // For unconfigured events, match by base_event_type
437- return store .selectedItem === item .base_event_type ;
426+ // For unconfigured events, match by workflow_event
427+ return store .selectedItem === item .workflow_event ;
438428};
439429
440430// Get display name for workflow with numbering for same types
441431const getWorkflowDisplayName = (item , index ) => {
442432 const list = workflowList .value ;
443- const baseEventType = item .base_event_type || item .workflow_event ;
444433
445434 // Find all workflows of the same type
446435 const sameTypeWorkflows = list .filter (w =>
447- ( w . base_event_type || w . workflow_event ) === baseEventType &&
436+ w . workflow_event === item . workflow_event &&
448437 (w .isConfigured || w .id === 0 ) // Only count configured workflows
449438 );
450439
@@ -517,7 +506,7 @@ watch(isInEditMode, async (newVal) => {
517506
518507const getCurrentDraftKey = () => {
519508 if (! store .selectedWorkflow ) return null ;
520- return store .selectedWorkflow .event_id || store .selectedWorkflow .base_event_type ;
509+ return store .selectedWorkflow .event_id || store .selectedWorkflow .workflow_event ;
521510};
522511
523512const persistDraftState = () => {
@@ -576,11 +565,11 @@ onMounted(async () => {
576565 // Check if eventID matches a base event type (unconfigured workflow)
577566 const items = workflowList .value ;
578567 const matchingUnconfigured = items .find ((item ) =>
579- ! item .isConfigured && (item .base_event_type === props .eventID || item .event_id === props .eventID ),
568+ ! item .isConfigured && (item .workflow_event === props .eventID || item .event_id === props .eventID ),
580569 );
581570 if (matchingUnconfigured ) {
582571 // Create new workflow for this base event type
583- createNewWorkflow (matchingUnconfigured .base_event_type , matchingUnconfigured .capabilities , matchingUnconfigured .display_name );
572+ createNewWorkflow (matchingUnconfigured .workflow_event , matchingUnconfigured .capabilities , matchingUnconfigured .display_name );
584573 } else {
585574 // Fallback: select first available item
586575 if (items .length > 0 ) {
@@ -626,10 +615,10 @@ const popstateHandler = (e) => {
626615 // Check if it's a base event type
627616 const items = workflowList .value ;
628617 const matchingUnconfigured = items .find ((item ) =>
629- ! item .isConfigured && (item .base_event_type === e .state .eventId || item .event_id === e .state .eventId ),
618+ ! item .isConfigured && (item .workflow_event === e .state .eventId || item .event_id === e .state .eventId ),
630619 );
631620 if (matchingUnconfigured ) {
632- createNewWorkflow (matchingUnconfigured .base_event_type , matchingUnconfigured .capabilities , matchingUnconfigured .display_name );
621+ createNewWorkflow (matchingUnconfigured .workflow_event , matchingUnconfigured .capabilities , matchingUnconfigured .display_name );
633622 }
634623 }
635624 }
@@ -829,6 +818,23 @@ onUnmounted(() => {
829818 </div >
830819 </div >
831820
821+ <div class =" field" v-if =" hasFilter('source_column')" >
822+ <label >When moved from column</label >
823+ <select
824+ v-if =" isInEditMode"
825+ v-model =" store.workflowFilters.source_column"
826+ class =" column-select"
827+ >
828+ <option value =" " >Any column</option >
829+ <option v-for =" column in store.projectColumns" :key =" column.id" :value =" String(column.id)" >
830+ {{ column.title }}
831+ </option >
832+ </select >
833+ <div v-else class =" readonly-value" >
834+ {{ store.projectColumns.find(c => String(c.id) === store.workflowFilters.source_column)?.title || 'Any column' }}
835+ </div >
836+ </div >
837+
832838 <div class =" field" v-if =" hasFilter('target_column')" >
833839 <label >When moved to column</label >
834840 <select
0 commit comments