@@ -9,32 +9,17 @@ import { type WorkflowHistoryEventDetailsConfig } from '../workflow-history-even
99import WorkflowHistoryEventDetailsJson from '../workflow-history-event-details-json/workflow-history-event-details-json' ;
1010import WorkflowHistoryEventDetailsPlaceholderText from '../workflow-history-event-details-placeholder-text/workflow-history-event-details-placeholder-text' ;
1111
12- /**
13- * Configuration array for customizing how workflow history event details are rendered.
14- * Each config entry defines matching criteria and rendering behavior for specific event fields.
15- * Configs are evaluated in order, and the first matching config is applied to each field.
16- */
1712const workflowHistoryEventDetailsConfig = [
18- /**
19- * Hides fields with null or undefined values from the event details display.
20- */
2113 {
2214 name : 'Filter empty value' ,
2315 customMatcher : ( { value } ) => value === null || value === undefined ,
2416 hide : ( ) => true ,
2517 } ,
26- /**
27- * Hides internal fields (taskId, eventType) that are not useful for display.
28- */
2918 {
3019 name : 'Filter unneeded values' ,
3120 pathRegex : '(taskId|eventType)$' ,
3221 hide : ( ) => true ,
3322 } ,
34- /**
35- * Displays a placeholder text for timeout/retry fields that are set to 0 (not configured).
36- * Also removes the "Seconds" suffix from labels since formatted durations may be in minutes/hours.
37- */
3823 {
3924 name : 'Not set placeholder' ,
4025 customMatcher : ( { value, path } ) => {
@@ -49,17 +34,11 @@ const workflowHistoryEventDetailsConfig = [
4934 valueComponent : ( ) =>
5035 createElement ( WorkflowHistoryEventDetailsPlaceholderText ) ,
5136 } ,
52- /**
53- * Formats Date objects as human-readable time strings.
54- */
5537 {
5638 name : 'Date object as time string' ,
5739 customMatcher : ( { value } ) => value instanceof Date ,
5840 valueComponent : ( { entryValue } ) => formatDate ( entryValue ) ,
5941 } ,
60- /**
61- * Renders task list names as clickable links that navigate to the task list view.
62- */
6342 {
6443 name : 'Tasklists as links' ,
6544 key : 'taskList' ,
@@ -71,32 +50,20 @@ const workflowHistoryEventDetailsConfig = [
7150 } ) ;
7251 } ,
7352 } ,
74- /**
75- * Renders JSON fields (input, result, details, etc.) as formatted PrettyJson components.
76- * Uses forceWrap to ensure proper wrapping of long JSON content.
77- */
7853 {
7954 name : 'Json as PrettyJson' ,
8055 pathRegex :
8156 '(input|result|details|failureDetails|Error|lastCompletionResult|heartbeatDetails|lastFailureDetails)$' ,
8257 valueComponent : WorkflowHistoryEventDetailsJson ,
8358 forceWrap : true ,
8459 } ,
85- /**
86- * Formats duration fields (ending in TimeoutSeconds, BackoffSeconds, or InSeconds) as human-readable durations.
87- * Removes the "Seconds" suffix from labels since formatted durations may be in minutes/hours.
88- */
8960 {
9061 name : 'Duration & interval seconds' ,
9162 pathRegex : '(TimeoutSeconds|BackoffSeconds|InSeconds)$' ,
9263 getLabel : ( { key } ) => key . replace ( / I n S e c o n d s | S e c o n d s | $ / , '' ) , // remove seconds suffix from label as formatted duration can be minutes/hours etc.
9364 valueComponent : ( { entryValue } ) =>
9465 formatDuration ( { seconds : entryValue > 0 ? entryValue : 0 , nanos : 0 } ) ,
9566 } ,
96- /**
97- * Renders workflow execution objects as clickable links that navigate to the workflow view.
98- * Applies to parentWorkflowExecution, externalWorkflowExecution, and workflowExecution fields.
99- */
10067 {
10168 name : 'WorkflowExecution as link' ,
10269 pathRegex :
@@ -110,10 +77,6 @@ const workflowHistoryEventDetailsConfig = [
11077 } ) ;
11178 } ,
11279 } ,
113- /**
114- * Renders run ID fields as clickable links that navigate to the corresponding workflow run.
115- * Applies to firstExecutionRunId, originalExecutionRunId, newExecutionRunId, and continuedExecutionRunId.
116- */
11780 {
11881 name : 'RunIds as link' ,
11982 pathRegex :
@@ -127,9 +90,6 @@ const workflowHistoryEventDetailsConfig = [
12790 } ) ;
12891 } ,
12992 } ,
130- /**
131- * Renames the "attempt" field label to "retryAttempt" for better clarity.
132- */
13393 {
13494 name : 'Retry config attempt as retryAttempt' ,
13595 key : 'attempt' ,
0 commit comments