@@ -6,7 +6,9 @@ import { useMessageStore } from "@/stores/MessageStore";
6
6
import { storeToRefs } from " pinia" ;
7
7
import ToolbarEndpointIcon from " @/assets/Shell_ToolbarEndpoint.svg" ;
8
8
import { SagaViewModel , parseSagaUpdates } from " ./SagaDiagram/useSagaDiagramParser" ;
9
+ import { typeToName } from " @/composables/typeHumanizer" ;
9
10
11
+ // Subcomponents
10
12
import NoSagaData from " ./SagaDiagram/NoSagaData.vue" ;
11
13
import SagaPluginNeeded from " ./SagaDiagram/SagaPluginNeeded.vue" ;
12
14
import SagaHeader from " ./SagaDiagram/SagaHeader.vue" ;
@@ -45,22 +47,30 @@ const vm = computed<SagaViewModel>(() => {
45
47
const completedUpdate = sagaDiagramStore .sagaHistory ?.changes .find ((update ) => update .status === " completed" );
46
48
const completionTime = completedUpdate ? new Date (completedUpdate .finish_time ) : null ;
47
49
50
+ const { data } = messageState .value ;
51
+ const { invoked_saga : saga } = data ;
52
+ const sagaHistory = sagaDiagramStore .sagaHistory ;
53
+
48
54
return {
49
- SagaTitle: typeToName (messageState .value .data .invoked_saga .saga_type ) || " Unknown saga" ,
50
- SagaGuid: messageState .value .data .invoked_saga .saga_id || " Missing guid" ,
51
- MessageIdUrl: messageState .value && routeLinks .messages .successMessage .link (messageState .value .data .message_id || " " , messageState .value .data .id || " " ),
52
- ParticipatedInSaga: messageState .value .data .invoked_saga .has_saga || false ,
53
- HasSagaData: !! sagaDiagramStore .sagaHistory ,
54
- ShowNoPluginActiveLegend: (! sagaDiagramStore .sagaHistory && messageState .value .data .invoked_saga .has_saga ) || false ,
55
+ // Saga metadata
56
+ SagaTitle: typeToName (saga .saga_type ) || " Unknown saga" ,
57
+ SagaGuid: saga .saga_id || " Missing guid" ,
58
+
59
+ // Navigation
60
+ MessageIdUrl: routeLinks .messages .successMessage .link (data .message_id || " " , data .id || " " ),
61
+
62
+ // Status flags
63
+ ParticipatedInSaga: saga .has_saga || false ,
64
+ HasSagaData: !! sagaHistory ,
65
+ ShowNoPluginActiveLegend: (! sagaHistory && saga .has_saga ) || false ,
55
66
SagaCompleted: !! completedUpdate ,
67
+
68
+ // Display data
56
69
FormattedCompletionTime: completionTime ? ` ${completionTime .toLocaleDateString ()} ${completionTime .toLocaleTimeString ()} ` : " " ,
57
- SagaUpdates: parseSagaUpdates (sagaDiagramStore . sagaHistory ),
70
+ SagaUpdates: parseSagaUpdates (sagaHistory ),
58
71
ShowMessageData: showMessageData .value ,
59
72
};
60
73
});
61
-
62
- // Import typeToName for saga title
63
- import { typeToName } from " @/composables/typeHumanizer" ;
64
74
</script >
65
75
66
76
<template >
0 commit comments