11<script setup lang="ts">
2- import { computed , watch } from " vue" ;
3- import { RouterLink , useRoute } from " vue-router" ;
2+ import { computed , onMounted , ref , watch } from " vue" ;
3+ import { RouterLink , useRoute , useRouter } from " vue-router" ;
44import NoData from " ../NoData.vue" ;
55import TimeSince from " ../TimeSince.vue" ;
66import FlowDiagram from " ./FlowDiagram/FlowDiagram.vue" ;
@@ -29,6 +29,7 @@ const isError = computed(() => messageId.value === undefined);
2929const isMassTransitConnected = useIsMassTransitConnected ();
3030const store = useMessageStore ();
3131const { state } = storeToRefs (store );
32+ const backLink = ref <string >(routeLinks .failedMessage .failedMessages .link );
3233const tabs = computed (() => {
3334 const currentTabs = [
3435 {
@@ -78,6 +79,13 @@ watch(
7879 { immediate: true }
7980);
8081const endpointColor = hexToCSSFilter (" #929E9E" ).filter ;
82+
83+ onMounted (() => {
84+ const back = useRouter ().currentRoute .value .query .back as string ;
85+ if (back ) {
86+ backLink .value = back ;
87+ }
88+ });
8189 </script >
8290
8391<template >
@@ -89,6 +97,7 @@ const endpointColor = hexToCSSFilter("#929E9E").filter;
8997 <LoadingOverlay v-if =" state.loading ?? false" />
9098 <div class =" row" >
9199 <div class =" col-sm-12 no-side-padding" >
100+ <RouterLink :to =" backLink" ><i class =" fa fa-chevron-left" ></i > Back</RouterLink >
92101 <div class =" active break group-title" >
93102 <h1 class =" message-type-title" >{{ state.data.message_type }}</h1 >
94103 </div >
@@ -112,7 +121,7 @@ const endpointColor = hexToCSSFilter("#929E9E").filter;
112121 <template v-if =" state .data .failure_metadata .edited " >
113122 <MetadataLabel tooltip =" Message was edited" type =" info" text =" Edited" />
114123 <span v-if =" state.data.failure_metadata.edit_of" class =" metadata metadata-link" >
115- <i class =" fa fa-history" ></i > <RouterLink :to =" { path: routeLinks.messages.failedMessage.link(state.data.failure_metadata.edit_of) }" >View previous version</RouterLink >
124+ <i class =" fa fa-history" ></i > <RouterLink :to =" { path: routeLinks.messages.failedMessage.link(state.data.failure_metadata.edit_of), query: { back: backLink } }" >View previous version</RouterLink >
116125 </span >
117126 </template >
118127 <span v-if =" state.data.failure_metadata.time_of_failure" class =" metadata" ><i class =" fa fa-clock-o" ></i > Failed: <time-since :date-utc =" state.data.failure_metadata.time_of_failure" ></time-since ></span >
@@ -173,10 +182,6 @@ button img {
173182 width : 17px ;
174183}
175184
176- .msg-tabs {
177- margin-bottom : 20px ;
178- }
179-
180185.pa-redirect-source {
181186 background-image : url (" @/assets/redirect-source.svg" );
182187 background-position : center ;
0 commit comments