Skip to content

Commit b053313

Browse files
authored
Merge pull request #2366 from Particular/john/remove-address-toggle
Remove show/hide address
2 parents 0bc5912 + 88c2a15 commit b053313

File tree

2 files changed

+33
-41
lines changed

2 files changed

+33
-41
lines changed

src/Frontend/src/components/messages2/FlowDiagram/FlowDiagram.vue

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import TimeSince from "../../TimeSince.vue";
55
import routeLinks from "@/router/routeLinks.ts";
66
import Message, { MessageIntent, MessageStatus, SagaInfo } from "@/resources/Message.ts";
77
import { NServiceBusHeaders } from "@/resources/Header.ts";
8-
import { ControlButton, Controls } from "@vue-flow/controls";
8+
import { Controls } from "@vue-flow/controls";
99
import { useMessageStore } from "@/stores/MessageStore.ts";
1010
import LoadingSpinner from "@/components/LoadingSpinner.vue";
1111
import { storeToRefs } from "pinia";
@@ -204,7 +204,7 @@ onMounted(async () => {
204204
});
205205
206206
async function layoutGraph() {
207-
nodes.value = layout(nodes.value, edges.value, showAddress.value);
207+
nodes.value = layout(nodes.value, edges.value);
208208
209209
await nextTick(() => {
210210
if (store.state.data.id) {
@@ -213,42 +213,31 @@ async function layoutGraph() {
213213
});
214214
}
215215
216-
const showAddress = ref(true);
217-
218-
async function toggleAddress() {
219-
showAddress.value = !showAddress.value;
220-
await layoutGraph();
221-
}
222-
223-
const blackColor = hexToCSSFilter("#000000").filter;
224-
const greenColor = hexToCSSFilter("#1E5E3C").filter;
225216
const errorColor = hexToCSSFilter("#be514a").filter;
217+
const selectedErrorColor = hexToCSSFilter("#e8e6e8").filter;
226218
</script>
227219

228220
<template>
229221
<div v-if="store.conversationData.failed_to_load" class="alert alert-info">FlowDiagram data is unavailable.</div>
230222
<LoadingSpinner v-else-if="store.conversationData.loading" />
231223
<div v-else id="tree-container">
232224
<VueFlow :nodes="nodes" :edges="edges" :min-zoom="0.1" :max-zoom="1.2" :only-render-visible-elements="true" @nodes-initialized="layoutGraph">
233-
<Controls :show-interactive="false" position="top-left" class="controls">
234-
<ControlButton v-tippy="showAddress ? `Hide endpoints` : `Show endpoints`" @click="toggleAddress">
235-
<i class="fa pa-flow-endpoint" :style="{ filter: showAddress ? greenColor : blackColor }"></i>
236-
</ControlButton>
237-
</Controls>
225+
<Controls :show-interactive="false" position="top-left" class="controls" />
238226
<template #node-message="{ id, data }: { id: string; data: NodeData }">
239-
<div v-if="showAddress">
240-
<TextEllipses class="address" :text="`${data.sendingEndpoint.name}@${data.sendingEndpoint.host}`" />
241-
</div>
227+
<TextEllipses class="address" :text="`${data.sendingEndpoint.name}@${data.sendingEndpoint.host}`" />
242228
<div class="node" :class="{ error: data.isError, 'current-message': id === store.state.data.id }">
243229
<div class="node-text">
244-
<i class="fa" :class="{ 'pa-flow-timeout': data.isTimeout, 'pa-flow-command': data.isCommand, 'pa-flow-event': data.isEvent }" v-tippy="data.type" />
245-
<div class="lead">
246-
<strong>
247-
<RouterLink v-if="data.isError" :to="{ path: routeLinks.messages.failedMessage.link(id), query: { back: backLink } }"><TextEllipses style="width: 204px" :text="data.label" ellipses-style="LeftSide" /></RouterLink>
248-
<RouterLink v-else :to="{ path: routeLinks.messages.successMessage.link(data.messageId, id), query: { back: backLink } }"><TextEllipses style="width: 204px" :text="data.label" ellipses-style="LeftSide" /></RouterLink>
249-
</strong>
230+
<i
231+
class="fa"
232+
:style="data.isError && id === store.state.data.id ? { filter: selectedErrorColor } : {}"
233+
:class="{ 'pa-flow-timeout': data.isTimeout, 'pa-flow-command': data.isCommand, 'pa-flow-event': data.isEvent }"
234+
v-tippy="data.type"
235+
/>
236+
<div class="typeName">
237+
<RouterLink v-if="data.isError" :to="{ path: routeLinks.messages.failedMessage.link(id), query: { back: backLink } }"><TextEllipses style="width: 204px" :text="data.label" ellipses-style="LeftSide" /></RouterLink>
238+
<RouterLink v-else :to="{ path: routeLinks.messages.successMessage.link(data.messageId, id), query: { back: backLink } }"><TextEllipses style="width: 204px" :text="data.label" ellipses-style="LeftSide" /></RouterLink>
250239
</div>
251-
<i v-if="data.isError" class="fa pa-flow-failed" :style="id !== store.state.data.id ? { filter: errorColor } : {}" />
240+
<i v-if="data.isError" class="fa pa-flow-failed" :style="id !== store.state.data.id ? { filter: errorColor } : { filter: selectedErrorColor }" />
252241
<div class="time-sent">
253242
<time-since class="time-since" :date-utc="data.timeSent" />
254243
</div>
@@ -264,9 +253,7 @@ const errorColor = hexToCSSFilter("#be514a").filter;
264253
</div>
265254
</div>
266255
</div>
267-
<div v-if="showAddress">
268-
<TextEllipses class="address" :text="`${data.receivingEndpoint.name}@${data.receivingEndpoint.host}`" />
269-
</div>
256+
<TextEllipses class="address" :text="`${data.receivingEndpoint.name}@${data.receivingEndpoint.host}`" />
270257
</template>
271258
</VueFlow>
272259
</div>
@@ -347,10 +334,14 @@ const errorColor = hexToCSSFilter("#be514a").filter;
347334
margin-right: 5px;
348335
}
349336
350-
.node-text .lead {
337+
.node-text .typeName {
351338
display: inline-block;
352339
position: relative;
353-
top: 4px;
340+
font-weight: bold;
341+
}
342+
343+
.node-text a {
344+
color: #777f7f;
354345
}
355346
356347
.address {
@@ -369,6 +360,15 @@ const errorColor = hexToCSSFilter("#be514a").filter;
369360
background-color: #be514a !important;
370361
}
371362
363+
.current-message.error .node-text .typeName a {
364+
color: #e8e6e8;
365+
font-weight: 900;
366+
}
367+
368+
.current-message.error .node-text .time-since {
369+
color: #e8e6e8;
370+
}
371+
372372
.error {
373373
border-color: #be514a;
374374
}
@@ -386,14 +386,6 @@ const errorColor = hexToCSSFilter("#be514a").filter;
386386
text-decoration: underline;
387387
}
388388
389-
.pa-flow-endpoint {
390-
background-image: url("@/assets/endpoint.svg");
391-
background-position: center;
392-
background-repeat: no-repeat;
393-
height: 15px;
394-
width: 15px;
395-
}
396-
397389
.pa-flow-failed {
398390
background-image: url("@/assets/failed-msg.svg");
399391
background-position: center;

src/Frontend/src/components/messages2/FlowDiagram/useLayout.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function useLayout() {
77

88
const graph = ref(new dagre.graphlib.Graph());
99

10-
function layout(nodes: Node[], edges: DefaultEdge[], showAddress: boolean) {
10+
function layout(nodes: Node[], edges: DefaultEdge[]) {
1111
// we create a new graph instance, in case some nodes/edges were removed, otherwise dagre would act as if they were still there
1212
const dagreGraph = new dagre.graphlib.Graph();
1313

@@ -22,7 +22,7 @@ export function useLayout() {
2222
const graphNode = findNode(node.id);
2323
if (graphNode === undefined) continue;
2424

25-
dagreGraph.setNode(node.id, { width: graphNode.dimensions.width || 250, height: (graphNode.dimensions.height || 55) + (showAddress ? 40 : 0) });
25+
dagreGraph.setNode(node.id, { width: graphNode.dimensions.width || 250, height: graphNode.dimensions.height || 55 });
2626
}
2727

2828
for (const edge of edges) {

0 commit comments

Comments
 (0)