Skip to content

Commit 84b7647

Browse files
committed
add loading spinner to sequence diagram
1 parent 630e2ed commit 84b7647

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Frontend/src/components/messages2/SequenceDiagram.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useSequenceDiagramStore } from "@/stores/SequenceDiagramStore";
77
import { storeToRefs } from "pinia";
88
import useTooltips from "./SequenceDiagram/tooltipOverlay.ts";
99
import { onMounted, ref } from "vue";
10-
10+
import LoadingSpinner from "@/components/LoadingSpinner.vue";
1111
const store = useSequenceDiagramStore();
1212
const { maxWidth, maxHeight } = storeToRefs(store);
1313
const endpointYOffset = ref(0);
@@ -22,6 +22,7 @@ onMounted(() => store.refreshConversation());
2222
<div class="toolbar">
2323
<a class="help-link" target="_blank" href="https://docs.particular.net/servicepulse/sequence-diagram"><i class="fa fa-info-circle" /> Sequence Diagram Help</a>
2424
</div>
25+
<LoadingSpinner v-if="store.isLoading" />
2526
<div class="outer" @scroll="(ev) => (endpointYOffset = (ev.target as Element).scrollTop)">
2627
<svg class="sequence-diagram" :style="{ width: `max(100%, ${isNaN(maxWidth) ? 0 : maxWidth}px)` }" :height="maxHeight + 20">
2728
<Timeline />

src/Frontend/src/stores/SequenceDiagramStore.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const useSequenceDiagramStore = defineStore("SequenceDiagramStore", () =>
4040
const handlerLocations = ref<HandlerLocation[]>([]);
4141
const highlightId = ref<string>();
4242

43+
const isLoading = computed(() => state.value.loading || !endpoints.value.length || !handlers.value.length || !routes.value.length);
4344
const selectedId = computed(() => `${state.value.data.message_type ?? ""}(${state.value.data.id})`);
4445

4546
watch(
@@ -104,6 +105,7 @@ export const useSequenceDiagramStore = defineStore("SequenceDiagramStore", () =>
104105
handlerLocations,
105106
highlightId,
106107
selectedId,
108+
isLoading,
107109
setStartX,
108110
setMaxWidth,
109111
setMaxHeight,

0 commit comments

Comments
 (0)