11<script setup lang="ts">
2- import { computed , onUnmounted , watch } from " vue" ;
2+ import { computed , onUnmounted , watch , ref } from " vue" ;
33import routeLinks from " @/router/routeLinks" ;
44import { useSagaDiagramStore } from " @/stores/SagaDiagramStore" ;
55import { useMessageStore } from " @/stores/MessageStore" ;
@@ -13,6 +13,12 @@ import SagaHeader from "./SagaDiagram/SagaHeader.vue";
1313import SagaUpdateNode from " ./SagaDiagram/SagaUpdateNode.vue" ;
1414import SagaCompletedNode from " ./SagaDiagram/SagaCompletedNode.vue" ;
1515
16+ const showMessageData = ref (false );
17+
18+ const toggleMessageData = () => {
19+ showMessageData .value = ! showMessageData .value ;
20+ };
21+
1622const store = useMessageStore ();
1723const { state : messageState } = storeToRefs (store );
1824
@@ -49,6 +55,7 @@ const vm = computed<SagaViewModel>(() => {
4955 SagaCompleted: !! completedUpdate ,
5056 FormattedCompletionTime: completionTime ? ` ${completionTime .toLocaleDateString ()} ${completionTime .toLocaleTimeString ()} ` : " " ,
5157 SagaUpdates: parseSagaUpdates (sagaDiagramStore .sagaHistory ),
58+ ShowMessageData: showMessageData .value ,
5259 };
5360});
5461
@@ -60,7 +67,10 @@ import { typeToName } from "@/composables/typeHumanizer";
6067 <div class =" saga-container" >
6168 <!-- Toolbar header -->
6269 <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 >
6474 </div >
6575
6676 <!-- No saga Data Available container -->
@@ -76,7 +86,7 @@ import { typeToName } from "@/composables/typeHumanizer";
7686 <SagaHeader :saga-title =" vm.SagaTitle" :saga-guid =" vm.SagaGuid" :message-id-url =" vm.MessageIdUrl" />
7787
7888 <!-- 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 " />
8090
8191 <!-- Saga Completed section -->
8292 <SagaCompletedNode v-if =" vm.SagaCompleted" :completion-time =" vm.FormattedCompletionTime" />
0 commit comments