diff --git a/src/lib/components/lines-and-dots/constants.ts b/src/lib/components/lines-and-dots/constants.ts index dea62c255..988451041 100644 --- a/src/lib/components/lines-and-dots/constants.ts +++ b/src/lib/components/lines-and-dots/constants.ts @@ -62,14 +62,13 @@ export const DetailsConfig: GraphConfig = { export const CategoryIcon: Record = { workflow: 'workflow', signal: 'signal', - command: 'terminal', activity: 'activity', - marker: 'marker', nexus: 'nexus', timer: 'retention', 'local-activity': 'feather', 'child-workflow': 'relationship', update: 'update', + other: 'terminal', }; export const timelineTextPosition = ( @@ -298,8 +297,7 @@ export const getStatusColor = ( export const getCategoryColor = (type: EventTypeCategory): string => { switch (type) { - case 'command': - case 'marker': + case 'other': case 'local-activity': return '#ebebeb'; case 'timer': diff --git a/src/lib/i18n/locales/en/events.ts b/src/lib/i18n/locales/en/events.ts index 18ce17637..2dc8f476d 100644 --- a/src/lib/i18n/locales/en/events.ts +++ b/src/lib/i18n/locales/en/events.ts @@ -16,6 +16,7 @@ export const Strings = { activity: 'Activity', 'child-workflow': 'Child Workflow', command: 'Command', + other: 'Other', 'local-activity': 'Local Activity', marker: 'Marker', nexus: 'Nexus', diff --git a/src/lib/models/event-history/__snapshots__/get-event-categorization.test.ts.snap b/src/lib/models/event-history/__snapshots__/get-event-categorization.test.ts.snap index a554b4299..6ddb85226 100644 --- a/src/lib/models/event-history/__snapshots__/get-event-categorization.test.ts.snap +++ b/src/lib/models/event-history/__snapshots__/get-event-categorization.test.ts.snap @@ -140,6 +140,358 @@ exports[`getEventsInCategory > should return the correct events for the child-wo exports[`getEventsInCategory > should return the correct events for the command" category 1`] = ` [ + { + "attributes": { + "newExecutionRunId": "", + "result": null, + "type": "workflowExecutionCompletedEventAttributes", + "workflowTaskCompletedEventId": "17", + }, + "category": "workflow", + "classification": "Completed", + "eventId": "18", + "eventTime": "2022-07-01T20:28:52.916373379Z", + "eventType": "WorkflowExecutionCompleted", + "id": "18", + "name": "WorkflowExecutionCompleted", + "taskId": "29887670", + "timestamp": "2022-07-01 UTC 20:28:52.91", + "version": "0", + "workflowExecutionCompletedEventAttributes": { + "newExecutionRunId": "", + "result": null, + "workflowTaskCompletedEventId": "17", + }, + }, + { + "attributes": { + "binaryChecksum": "e56c0141e58df0bd405138565d0526f9", + "identity": "83579@MacBook-Pro-2.local@", + "scheduledEventId": "15", + "startedEventId": "16", + "type": "workflowTaskCompletedEventAttributes", + }, + "category": "workflow", + "classification": "Completed", + "eventId": "17", + "eventTime": "2022-07-01T20:28:52.916365546Z", + "eventType": "WorkflowTaskCompleted", + "id": "17", + "name": "WorkflowTaskCompleted", + "taskId": "29887669", + "timestamp": "2022-07-01 UTC 20:28:52.91", + "version": "0", + "workflowTaskCompletedEventAttributes": { + "binaryChecksum": "e56c0141e58df0bd405138565d0526f9", + "identity": "83579@MacBook-Pro-2.local@", + "scheduledEventId": "15", + "startedEventId": "16", + }, + }, + { + "attributes": { + "identity": "83579@MacBook-Pro-2.local@", + "requestId": "eed1cf96-0b77-4c4f-8f84-67a141584cf4", + "scheduledEventId": "15", + "type": "workflowTaskStartedEventAttributes", + }, + "category": "workflow", + "classification": "Started", + "eventId": "16", + "eventTime": "2022-07-01T20:28:52.908801338Z", + "eventType": "WorkflowTaskStarted", + "id": "16", + "name": "WorkflowTaskStarted", + "taskId": "29887666", + "timestamp": "2022-07-01 UTC 20:28:52.90", + "version": "0", + "workflowTaskStartedEventAttributes": { + "identity": "83579@MacBook-Pro-2.local@", + "requestId": "eed1cf96-0b77-4c4f-8f84-67a141584cf4", + "scheduledEventId": "15", + }, + }, + { + "attributes": { + "attempt": 1, + "startToCloseTimeout": "20 seconds", + "taskQueue": { + "kind": "Sticky", + "name": "MacBook-Pro-2.local:0539ec5f-2f46-4d51-8dcf-a3b9b1de6611", + }, + "type": "workflowTaskScheduledEventAttributes", + }, + "category": "workflow", + "classification": "Scheduled", + "eventId": "15", + "eventTime": "2022-07-01T20:28:52.898065338Z", + "eventType": "WorkflowTaskScheduled", + "id": "15", + "name": "WorkflowTaskScheduled", + "taskId": "29887660", + "timestamp": "2022-07-01 UTC 20:28:52.89", + "version": "0", + "workflowTaskScheduledEventAttributes": { + "attempt": 1, + "startToCloseTimeout": "20s", + "taskQueue": { + "kind": "Sticky", + "name": "MacBook-Pro-2.local:0539ec5f-2f46-4d51-8dcf-a3b9b1de6611", + }, + }, + }, + { + "activityTaskCompletedEventAttributes": { + "identity": "83579@MacBook-Pro-2.local@", + "result": null, + "scheduledEventId": "12", + "startedEventId": "13", + }, + "attributes": { + "identity": "83579@MacBook-Pro-2.local@", + "result": null, + "scheduledEventId": "12", + "startedEventId": "13", + "type": "activityTaskCompletedEventAttributes", + }, + "category": "activity", + "classification": "Completed", + "eventId": "14", + "eventTime": "2022-07-01T20:28:52.898061546Z", + "eventType": "ActivityTaskCompleted", + "id": "14", + "name": "ActivityTaskCompleted", + "taskId": "29887659", + "timestamp": "2022-07-01 UTC 20:28:52.89", + "version": "0", + }, + { + "activityTaskStartedEventAttributes": { + "attempt": 1, + "identity": "83579@MacBook-Pro-2.local@", + "lastFailure": null, + "requestId": "bf8e4570-e5ec-4eb5-a704-6181cc60c562", + "scheduledEventId": "12", + }, + "attributes": { + "attempt": 1, + "identity": "83579@MacBook-Pro-2.local@", + "lastFailure": null, + "requestId": "bf8e4570-e5ec-4eb5-a704-6181cc60c562", + "scheduledEventId": "12", + "type": "activityTaskStartedEventAttributes", + }, + "category": "activity", + "classification": "Started", + "eventId": "13", + "eventTime": "2022-07-01T20:28:52.887850754Z", + "eventType": "ActivityTaskStarted", + "id": "13", + "name": "ActivityTaskStarted", + "taskId": "29887658", + "timestamp": "2022-07-01 UTC 20:28:52.88", + "version": "0", + }, + { + "activityTaskScheduledEventAttributes": { + "activityId": "12", + "activityType": { + "name": "activity.standard-visibility", + }, + "header": { + "fields": {}, + }, + "heartbeatTimeout": "0s", + "input": { + "payloads": [ + "1656707332859456300", + { + "ID": "temporal.fixture.completed.workflow.id", + "RunID": "202dcff6-7f35-4c65-995c-bcadce524fb1", + }, + ], + }, + "retryPolicy": { + "backoffCoefficient": 2, + "initialInterval": "1s", + "maximumAttempts": 0, + "maximumInterval": "100s", + "nonRetryableErrorTypes": [], + }, + "scheduleToCloseTimeout": "260s", + "scheduleToStartTimeout": "240s", + "startToCloseTimeout": "20s", + "taskQueue": { + "kind": "Normal", + "name": "canary-task-queue", + }, + "workflowTaskCompletedEventId": "11", + }, + "attributes": { + "activityId": "12", + "activityType": "activity.standard-visibility", + "header": { + "fields": {}, + }, + "heartbeatTimeout": "", + "input": { + "payloads": [ + "1656707332859456300", + { + "ID": "temporal.fixture.completed.workflow.id", + "RunID": "202dcff6-7f35-4c65-995c-bcadce524fb1", + }, + ], + }, + "retryPolicy": { + "backoffCoefficient": 2, + "initialInterval": "1s", + "maximumAttempts": 0, + "maximumInterval": "100s", + "nonRetryableErrorTypes": [], + }, + "scheduleToCloseTimeout": "4 minutes, 20 seconds", + "scheduleToStartTimeout": "4 minutes", + "startToCloseTimeout": "20 seconds", + "taskQueue": { + "kind": "Normal", + "name": "canary-task-queue", + }, + "type": "activityTaskScheduledEventAttributes", + "workflowTaskCompletedEventId": "11", + }, + "category": "activity", + "classification": "Scheduled", + "eventId": "12", + "eventTime": "2022-07-01T20:28:52.874228004Z", + "eventType": "ActivityTaskScheduled", + "id": "12", + "name": "ActivityTaskScheduled", + "taskId": "29887647", + "timestamp": "2022-07-01 UTC 20:28:52.87", + "version": "0", + }, + { + "attributes": { + "binaryChecksum": "e56c0141e58df0bd405138565d0526f9", + "identity": "83579@MacBook-Pro-2.local@", + "scheduledEventId": "9", + "startedEventId": "10", + "type": "workflowTaskCompletedEventAttributes", + }, + "category": "workflow", + "classification": "Completed", + "eventId": "11", + "eventTime": "2022-07-01T20:28:52.874198546Z", + "eventType": "WorkflowTaskCompleted", + "id": "11", + "name": "WorkflowTaskCompleted", + "taskId": "29887646", + "timestamp": "2022-07-01 UTC 20:28:52.87", + "version": "0", + "workflowTaskCompletedEventAttributes": { + "binaryChecksum": "e56c0141e58df0bd405138565d0526f9", + "identity": "83579@MacBook-Pro-2.local@", + "scheduledEventId": "9", + "startedEventId": "10", + }, + }, + { + "attributes": { + "identity": "83579@MacBook-Pro-2.local@", + "requestId": "39327011-18c2-441e-aae3-5fd2bc596632", + "scheduledEventId": "9", + "type": "workflowTaskStartedEventAttributes", + }, + "category": "workflow", + "classification": "Started", + "eventId": "10", + "eventTime": "2022-07-01T20:28:52.859456213Z", + "eventType": "WorkflowTaskStarted", + "id": "10", + "name": "WorkflowTaskStarted", + "taskId": "29887640", + "timestamp": "2022-07-01 UTC 20:28:52.85", + "version": "0", + "workflowTaskStartedEventAttributes": { + "identity": "83579@MacBook-Pro-2.local@", + "requestId": "39327011-18c2-441e-aae3-5fd2bc596632", + "scheduledEventId": "9", + }, + }, + { + "attributes": { + "attempt": 1, + "startToCloseTimeout": "20 seconds", + "taskQueue": { + "kind": "Sticky", + "name": "MacBook-Pro-2.local:0539ec5f-2f46-4d51-8dcf-a3b9b1de6611", + }, + "type": "workflowTaskScheduledEventAttributes", + }, + "category": "workflow", + "classification": "Scheduled", + "eventId": "9", + "eventTime": "2022-07-01T20:28:52.837778088Z", + "eventType": "WorkflowTaskScheduled", + "id": "9", + "name": "WorkflowTaskScheduled", + "taskId": "29887631", + "timestamp": "2022-07-01 UTC 20:28:52.83", + "version": "0", + "workflowTaskScheduledEventAttributes": { + "attempt": 1, + "startToCloseTimeout": "20s", + "taskQueue": { + "kind": "Sticky", + "name": "MacBook-Pro-2.local:0539ec5f-2f46-4d51-8dcf-a3b9b1de6611", + }, + }, + }, + { + "attributes": { + "startedEventId": "7", + "timerId": "7", + "type": "timerFiredEventAttributes", + }, + "category": "timer", + "classification": "Fired", + "eventId": "8", + "eventTime": "2022-07-01T20:28:52.837749879Z", + "eventType": "TimerFired", + "id": "8", + "name": "TimerFired", + "taskId": "29887630", + "timerFiredEventAttributes": { + "startedEventId": "7", + "timerId": "7", + }, + "timestamp": "2022-07-01 UTC 20:28:52.83", + "version": "0", + }, + { + "attributes": { + "startToFireTimeout": "4 seconds", + "timerId": "7", + "type": "timerStartedEventAttributes", + "workflowTaskCompletedEventId": "4", + }, + "category": "timer", + "classification": "Started", + "eventId": "7", + "eventTime": "2022-07-01T20:28:48.821622711Z", + "eventType": "TimerStarted", + "id": "7", + "name": "TimerStarted", + "taskId": "29887309", + "timerStartedEventAttributes": { + "startToFireTimeout": "4s", + "timerId": "7", + "workflowTaskCompletedEventId": "4", + }, + "timestamp": "2022-07-01 UTC 20:28:48.82", + "version": "0", + }, { "attributes": { "searchAttributes": { @@ -172,11 +524,6 @@ exports[`getEventsInCategory > should return the correct events for the command" }, "version": "0", }, -] -`; - -exports[`getEventsInCategory > should return the correct events for the marker" category 1`] = ` -[ { "attributes": { "details": { @@ -245,9 +592,193 @@ exports[`getEventsInCategory > should return the correct events for the marker" "timestamp": "2022-07-01 UTC 20:28:48.82", "version": "0", }, + { + "attributes": { + "binaryChecksum": "e56c0141e58df0bd405138565d0526f9", + "identity": "83579@MacBook-Pro-2.local@", + "scheduledEventId": "2", + "startedEventId": "3", + "type": "workflowTaskCompletedEventAttributes", + }, + "category": "workflow", + "classification": "Completed", + "eventId": "4", + "eventTime": "2022-07-01T20:28:48.820933044Z", + "eventType": "WorkflowTaskCompleted", + "id": "4", + "name": "WorkflowTaskCompleted", + "taskId": "29887306", + "timestamp": "2022-07-01 UTC 20:28:48.82", + "version": "0", + "workflowTaskCompletedEventAttributes": { + "binaryChecksum": "e56c0141e58df0bd405138565d0526f9", + "identity": "83579@MacBook-Pro-2.local@", + "scheduledEventId": "2", + "startedEventId": "3", + }, + }, + { + "attributes": { + "identity": "83579@MacBook-Pro-2.local@", + "requestId": "5a507f4f-fc92-45af-95b5-2a3c8f123817", + "scheduledEventId": "2", + "type": "workflowTaskStartedEventAttributes", + }, + "category": "workflow", + "classification": "Started", + "eventId": "3", + "eventTime": "2022-07-01T20:28:48.810509586Z", + "eventType": "WorkflowTaskStarted", + "id": "3", + "name": "WorkflowTaskStarted", + "taskId": "29887299", + "timestamp": "2022-07-01 UTC 20:28:48.81", + "version": "0", + "workflowTaskStartedEventAttributes": { + "identity": "83579@MacBook-Pro-2.local@", + "requestId": "5a507f4f-fc92-45af-95b5-2a3c8f123817", + "scheduledEventId": "2", + }, + }, + { + "attributes": { + "attempt": 1, + "startToCloseTimeout": "20 seconds", + "taskQueue": { + "kind": "Normal", + "name": "canary-task-queue", + }, + "type": "workflowTaskScheduledEventAttributes", + }, + "category": "workflow", + "classification": "Scheduled", + "eventId": "2", + "eventTime": "2022-07-01T20:28:48.805620294Z", + "eventType": "WorkflowTaskScheduled", + "id": "2", + "name": "WorkflowTaskScheduled", + "taskId": "29887296", + "timestamp": "2022-07-01 UTC 20:28:48.80", + "version": "0", + "workflowTaskScheduledEventAttributes": { + "attempt": 1, + "startToCloseTimeout": "20s", + "taskQueue": { + "kind": "Normal", + "name": "canary-task-queue", + }, + }, + }, + { + "attributes": { + "attempt": 1, + "continuedExecutionRunId": "", + "continuedFailure": null, + "cronSchedule": "", + "firstExecutionRunId": "202dcff6-7f35-4c65-995c-bcadce524fb1", + "firstWorkflowTaskBackoff": "", + "header": { + "fields": {}, + }, + "identity": "", + "initiator": "Unspecified", + "input": { + "payloads": [ + "1656707328774263000", + "canary", + ], + }, + "lastCompletionResult": null, + "memo": null, + "originalExecutionRunId": "202dcff6-7f35-4c65-995c-bcadce524fb1", + "parentInitiatedEventId": "10", + "parentInitiatedEventVersion": "0", + "parentWorkflowExecution": { + "runId": "971e2165-c4f8-4f78-87ca-b652a06eb234", + "workflowId": "temporal.fixture.completed.workflow.id", + }, + "parentWorkflowNamespace": "canary", + "prevAutoResetPoints": null, + "retryPolicy": null, + "searchAttributes": { + "indexedFields": { + "CustomKeywordField": "childWorkflowValue", + }, + }, + "taskQueue": { + "kind": "Normal", + "name": "canary-task-queue", + }, + "type": "workflowExecutionStartedEventAttributes", + "workflowExecutionExpirationTime": "", + "workflowExecutionTimeout": "", + "workflowRunTimeout": "20 minutes", + "workflowTaskTimeout": "20 seconds", + "workflowType": "workflow.completion", + }, + "category": "workflow", + "classification": "Started", + "eventId": "1", + "eventTime": "2022-07-01T20:28:48.796369169Z", + "eventType": "WorkflowExecutionStarted", + "id": "1", + "name": "WorkflowExecutionStarted", + "taskId": "29887292", + "timestamp": "2022-07-01 UTC 20:28:48.79", + "version": "0", + "workflowExecutionStartedEventAttributes": { + "attempt": 1, + "continuedExecutionRunId": "", + "continuedFailure": null, + "cronSchedule": "", + "firstExecutionRunId": "202dcff6-7f35-4c65-995c-bcadce524fb1", + "firstWorkflowTaskBackoff": "0s", + "header": { + "fields": {}, + }, + "identity": "", + "initiator": "Unspecified", + "input": { + "payloads": [ + "1656707328774263000", + "canary", + ], + }, + "lastCompletionResult": null, + "memo": null, + "originalExecutionRunId": "202dcff6-7f35-4c65-995c-bcadce524fb1", + "parentInitiatedEventId": "10", + "parentInitiatedEventVersion": "0", + "parentWorkflowExecution": { + "runId": "971e2165-c4f8-4f78-87ca-b652a06eb234", + "workflowId": "temporal.fixture.completed.workflow.id", + }, + "parentWorkflowNamespace": "canary", + "prevAutoResetPoints": null, + "retryPolicy": null, + "searchAttributes": { + "indexedFields": { + "CustomKeywordField": "childWorkflowValue", + }, + }, + "taskQueue": { + "kind": "Normal", + "name": "canary-task-queue", + }, + "workflowExecutionExpirationTime": null, + "workflowExecutionTimeout": "0s", + "workflowRunTimeout": "1200s", + "workflowTaskTimeout": "20s", + "workflowType": { + "name": "workflow.completion", + }, + }, + }, ] `; +exports[`getEventsInCategory > should return the correct events for the other" category 1`] = `[]`; + exports[`getEventsInCategory > should return the correct events for the signal" category 1`] = `[]`; exports[`getEventsInCategory > should return the correct events for the timer" category 1`] = ` diff --git a/src/lib/models/event-history/get-event-categorization.test.ts b/src/lib/models/event-history/get-event-categorization.test.ts index 5ba812905..132eda1fc 100644 --- a/src/lib/models/event-history/get-event-categorization.test.ts +++ b/src/lib/models/event-history/get-event-categorization.test.ts @@ -36,7 +36,7 @@ describe('Event Category Data Structures', () => { "ChildWorkflowExecutionTimedOut": "child-workflow", "ExternalWorkflowExecutionCancelRequested": "workflow", "ExternalWorkflowExecutionSignaled": "signal", - "MarkerRecorded": "marker", + "MarkerRecorded": "other", "NexusOperationCancelRequested": "nexus", "NexusOperationCanceled": "nexus", "NexusOperationCompleted": "nexus", @@ -53,7 +53,7 @@ describe('Event Category Data Structures', () => { "TimerCanceled": "timer", "TimerFired": "timer", "TimerStarted": "timer", - "UpsertWorkflowSearchAttributes": "command", + "UpsertWorkflowSearchAttributes": "other", "WorkflowExecutionCancelRequested": "workflow", "WorkflowExecutionCanceled": "workflow", "WorkflowExecutionCompleted": "workflow", @@ -67,6 +67,7 @@ describe('Event Category Data Structures', () => { "WorkflowExecutionUpdateCompleted": "update", "WorkflowExecutionUpdateRejected": "update", "WorkflowExecutionUpdateRequested": "update", + "WorkflowPropertiesModified": "other", "WorkflowTaskCompleted": "workflow", "WorkflowTaskFailed": "workflow", "WorkflowTaskScheduled": "workflow", @@ -87,18 +88,10 @@ describe('Event Category Data Structures', () => { "label": "events.category.child-workflow", "value": "child-workflow", }, - { - "label": "events.category.command", - "value": "command", - }, { "label": "events.category.local-activity", "value": "local-activity", }, - { - "label": "events.category.marker", - "value": "marker", - }, { "label": "events.category.signal", "value": "signal", @@ -119,6 +112,10 @@ describe('Event Category Data Structures', () => { "label": "events.category.workflow", "value": "workflow", }, + { + "label": "events.category.other", + "value": "other", + }, ] `); }); @@ -138,10 +135,6 @@ describe('Event Category Data Structures', () => { "label": "events.category.local-activity", "value": "local-activity", }, - { - "label": "events.category.marker", - "value": "marker", - }, { "label": "events.category.signal", "value": "signal", @@ -158,6 +151,10 @@ describe('Event Category Data Structures', () => { "label": "events.category.nexus", "value": "nexus", }, + { + "label": "events.category.other", + "value": "other", + }, ] `); }); @@ -188,8 +185,6 @@ const categories: Record< 'StartChildWorkflowExecutionInitiated', ], - marker: ['MarkerRecorded'], - signal: [ 'SignalExternalWorkflowExecutionFailed', 'SignalExternalWorkflowExecutionInitiated', @@ -218,8 +213,6 @@ const categories: Record< 'RequestCancelExternalWorkflowExecutionInitiated', ], - command: ['UpsertWorkflowSearchAttributes'], - update: [ 'WorkflowExecutionUpdateAccepted', 'WorkflowExecutionUpdateCompleted', @@ -234,6 +227,12 @@ const categories: Record< 'NexusOperationTimedOut', 'NexusOperationCancelRequested', ], + + other: [ + 'MarkerRecorded', + 'UpsertWorkflowSearchAttributes', + 'WorkflowPropertiesModified', + ], }; describe('getEventCategory', () => { @@ -246,6 +245,10 @@ describe('getEventCategory', () => { } }); +it('should return other for unknown eventType', () => { + expect(getEventCategory('crazyUnknownNewEvent' as EventType)).toBe('other'); +}); + describe('getEventsInCategory', () => { const events = eventsCompleted as unknown as WorkflowEvents; @@ -259,14 +262,6 @@ describe('getEventsInCategory', () => { expect(getEventsInCategory(events, 'child-workflow')).toMatchSnapshot(); }); - it('should return the correct events for the command" category', () => { - expect(getEventsInCategory(events, 'command')).toMatchSnapshot(); - }); - - it('should return the correct events for the marker" category', () => { - expect(getEventsInCategory(events, 'marker')).toMatchSnapshot(); - }); - it('should return the correct events for the signal" category', () => { expect(getEventsInCategory(events, 'signal')).toMatchSnapshot(); }); @@ -279,6 +274,10 @@ describe('getEventsInCategory', () => { expect(getEventsInCategory(events, 'workflow')).toMatchSnapshot(); }); + it('should return the correct events for the other" category', () => { + expect(getEventsInCategory(events, 'other')).toMatchSnapshot(); + }); + it('should return the original set of events if given an invalid category', () => { expect(getEventsInCategory(events, 'bogus')).toEqual(events); }); @@ -305,8 +304,16 @@ describe('isCategoryType', () => { expect(isCategoryType('workflow')).toBeTruthy(); }); - it('should return true for "command"', () => { - expect(isCategoryType('command')).toBeTruthy(); + it('should return true for "nexus"', () => { + expect(isCategoryType('nexus')).toBeTruthy(); + }); + + it('should return true for "local-activity"', () => { + expect(isCategoryType('local-activity')).toBeTruthy(); + }); + + it('should return true for "other"', () => { + expect(isCategoryType('other')).toBeTruthy(); }); it('should return false for "bogus"', () => { diff --git a/src/lib/models/event-history/get-event-categorization.ts b/src/lib/models/event-history/get-event-categorization.ts index d04d585a0..e29c507ce 100644 --- a/src/lib/models/event-history/get-event-categorization.ts +++ b/src/lib/models/event-history/get-event-categorization.ts @@ -11,14 +11,13 @@ export type EventTypeCategory = Categories[keyof Categories]; export const CATEGORIES = { ACTIVITY: 'activity', CHILD_WORKFLOW: 'child-workflow', - COMMAND: 'command', LOCAL_ACTIVITY: 'local-activity', - MARKER: 'marker', NEXUS: 'nexus', SIGNAL: 'signal', TIMER: 'timer', UPDATE: 'update', WORKFLOW: 'workflow', + OTHER: 'other', } as const; export const eventTypeCategorizations: Readonly< @@ -41,8 +40,6 @@ export const eventTypeCategorizations: Readonly< StartChildWorkflowExecutionFailed: CATEGORIES.CHILD_WORKFLOW, StartChildWorkflowExecutionInitiated: CATEGORIES.CHILD_WORKFLOW, - MarkerRecorded: CATEGORIES.MARKER, - SignalExternalWorkflowExecutionFailed: CATEGORIES.SIGNAL, SignalExternalWorkflowExecutionInitiated: CATEGORIES.SIGNAL, WorkflowExecutionSignaled: CATEGORIES.SIGNAL, @@ -69,8 +66,6 @@ export const eventTypeCategorizations: Readonly< RequestCancelExternalWorkflowExecutionFailed: CATEGORIES.WORKFLOW, RequestCancelExternalWorkflowExecutionInitiated: CATEGORIES.WORKFLOW, - UpsertWorkflowSearchAttributes: CATEGORIES.COMMAND, - WorkflowExecutionUpdateAccepted: CATEGORIES.UPDATE, WorkflowExecutionUpdateCompleted: CATEGORIES.UPDATE, WorkflowExecutionUpdateRequested: CATEGORIES.UPDATE, @@ -83,6 +78,10 @@ export const eventTypeCategorizations: Readonly< NexusOperationCanceled: CATEGORIES.NEXUS, NexusOperationTimedOut: CATEGORIES.NEXUS, NexusOperationCancelRequested: CATEGORIES.NEXUS, + + MarkerRecorded: CATEGORIES.OTHER, + UpsertWorkflowSearchAttributes: CATEGORIES.OTHER, + WorkflowPropertiesModified: CATEGORIES.OTHER, }; export type EventTypeOption = { @@ -99,18 +98,10 @@ export const allEventTypeOptions: EventTypeOption[] = [ label: 'events.category.child-workflow', value: CATEGORIES.CHILD_WORKFLOW, }, - { - label: 'events.category.command', - value: CATEGORIES.COMMAND, - }, { label: 'events.category.local-activity', value: CATEGORIES.LOCAL_ACTIVITY, }, - { - label: 'events.category.marker', - value: CATEGORIES.MARKER, - }, { label: 'events.category.signal', value: CATEGORIES.SIGNAL, @@ -125,6 +116,10 @@ export const allEventTypeOptions: EventTypeOption[] = [ label: 'events.category.workflow', value: CATEGORIES.WORKFLOW, }, + { + label: 'events.category.other', + value: CATEGORIES.OTHER, + }, ]; const compactEventTypes: EventTypeCategory[] = [ @@ -133,16 +128,16 @@ const compactEventTypes: EventTypeCategory[] = [ CATEGORIES.CHILD_WORKFLOW, CATEGORIES.SIGNAL, CATEGORIES.TIMER, - CATEGORIES.MARKER, CATEGORIES.UPDATE, CATEGORIES.NEXUS, + CATEGORIES.OTHER, ]; export const compactEventTypeOptions: EventTypeOption[] = allEventTypeOptions.filter(({ value }) => compactEventTypes.includes(value)); export const getEventCategory = (eventType: EventType): EventTypeCategory => { - return eventTypeCategorizations[eventType]; + return eventTypeCategorizations?.[eventType] || CATEGORIES.OTHER; }; export const isCategoryType = (value: string): value is EventTypeCategory => { diff --git a/src/lib/stores/filters.ts b/src/lib/stores/filters.ts index d9443db6d..9d5330a9d 100644 --- a/src/lib/stores/filters.ts +++ b/src/lib/stores/filters.ts @@ -87,7 +87,5 @@ export const eventClassificationFilter = writable< EventClassification[] | undefined >(undefined, updateEventClassificationFilter); -const defaultOptions = allEventTypeOptions - .map(({ value }) => value) - .filter((type) => type !== 'marker'); +const defaultOptions = allEventTypeOptions.map(({ value }) => value); export const eventTypeFilter = writable(defaultOptions); diff --git a/src/lib/types/events.ts b/src/lib/types/events.ts index 8d224054f..6e2884e13 100644 --- a/src/lib/types/events.ts +++ b/src/lib/types/events.ts @@ -235,6 +235,8 @@ export type NexusOperationTimedOutEvent = EventWithAttributes<'nexusOperationTimedOutEventAttributes'>; export type NexusOperationCancelRequestedEvent = EventWithAttributes<'nexusOperationCancelRequestedEventAttributes'>; +export type WorkflowPropertiesModifiedEvent = + EventWithAttributes<'workflowPropertiesModifiedEventAttributes'>; export type FailActivityTaskRequest = import('$lib/types').ActivityTaskFailedByIdRequest; diff --git a/src/lib/types/index.ts b/src/lib/types/index.ts index 6b1ffb529..4f913da18 100644 --- a/src/lib/types/index.ts +++ b/src/lib/types/index.ts @@ -128,6 +128,8 @@ export type ActivityTaskCompletedByIdRequest = temporal.api.workflowservice.v1.IRespondActivityTaskCompletedRequest; export type ActivityTaskCompletedByIdResponse = temporal.api.workflowservice.v1.IRespondActivityTaskCompletedResponse; +export type WorkflowPropertiesModifiedEventAttributes = + temporal.api.history.v1.IWorkflowPropertiesModifiedEventAttributes; // api.enums diff --git a/src/lib/utilities/is-event-type.ts b/src/lib/utilities/is-event-type.ts index 5028bee34..9b78e79b9 100644 --- a/src/lib/utilities/is-event-type.ts +++ b/src/lib/utilities/is-event-type.ts @@ -136,6 +136,7 @@ export const eventTypes = [ 'WorkflowExecutionUpdateCompleted', 'WorkflowExecutionUpdateRejected', 'WorkflowExecutionUpdateRequested', + 'WorkflowPropertiesModified', ] as const; export const eventAttributeKeys: Readonly = [ @@ -189,6 +190,7 @@ export const eventAttributeKeys: Readonly = [ 'nexusOperationCanceledEventAttributes', 'nexusOperationTimedOutEventAttributes', 'nexusOperationCancelRequestedEventAttributes', + 'workflowPropertiesModifiedEventAttributes', ] as const; export type ResetEventType = (typeof validResetEventTypes)[number];