1
1
<script setup lang="ts">
2
- import { computed , onUnmounted , watch } from " vue" ;
2
+ import { computed , onUnmounted , watch , ref } from " vue" ;
3
3
import routeLinks from " @/router/routeLinks" ;
4
4
import { useSagaDiagramStore } from " @/stores/SagaDiagramStore" ;
5
5
import { useMessageStore } from " @/stores/MessageStore" ;
@@ -13,6 +13,12 @@ import SagaHeader from "./SagaDiagram/SagaHeader.vue";
13
13
import SagaUpdateNode from " ./SagaDiagram/SagaUpdateNode.vue" ;
14
14
import SagaCompletedNode from " ./SagaDiagram/SagaCompletedNode.vue" ;
15
15
16
+ const showMessageData = ref (false );
17
+
18
+ const toggleMessageData = () => {
19
+ showMessageData .value = ! showMessageData .value ;
20
+ };
21
+
16
22
const store = useMessageStore ();
17
23
const { state : messageState } = storeToRefs (store );
18
24
@@ -49,6 +55,7 @@ const vm = computed<SagaViewModel>(() => {
49
55
SagaCompleted: !! completedUpdate ,
50
56
FormattedCompletionTime: completionTime ? ` ${completionTime .toLocaleDateString ()} ${completionTime .toLocaleTimeString ()} ` : " " ,
51
57
SagaUpdates: parseSagaUpdates (sagaDiagramStore .sagaHistory ),
58
+ ShowMessageData: showMessageData .value ,
52
59
};
53
60
});
54
61
@@ -60,7 +67,10 @@ import { typeToName } from "@/composables/typeHumanizer";
60
67
<div class =" saga-container" >
61
68
<!-- Toolbar header -->
62
69
<div v-if =" vm.HasSagaData" class =" header" >
63
- <button class =" saga-button" aria-label =" message-not-involved-in-saga" ><img class =" saga-button-icon" :src =" ToolbarEndpointIcon" alt =" " />Show Message Data</button >
70
+ <button :class =" ['saga-button', { 'saga-button--active': vm.ShowMessageData }]" aria-label =" show-message-data-button" @click =" toggleMessageData" >
71
+ <img class =" saga-button-icon" :src =" ToolbarEndpointIcon" alt =" " />
72
+ {{ vm.ShowMessageData ? "Hide Message Data" : "Show Message Data" }}
73
+ </button >
64
74
</div >
65
75
66
76
<!-- No saga Data Available container -->
@@ -76,7 +86,7 @@ import { typeToName } from "@/composables/typeHumanizer";
76
86
<SagaHeader :saga-title =" vm.SagaTitle" :saga-guid =" vm.SagaGuid" :message-id-url =" vm.MessageIdUrl" />
77
87
78
88
<!-- Iterate through each saga update -->
79
- <SagaUpdateNode v-for =" (update, index) in vm.SagaUpdates" :key =" index" :update =" update" />
89
+ <SagaUpdateNode v-for =" (update, index) in vm.SagaUpdates" :key =" index" :update =" update" :show-message-data = " vm.ShowMessageData " />
80
90
81
91
<!-- Saga Completed section -->
82
92
<SagaCompletedNode v-if =" vm.SagaCompleted" :completion-time =" vm.FormattedCompletionTime" />
0 commit comments