Skip to content

Commit 0b0f590

Browse files
committed
address comments from review
1 parent c926f54 commit 0b0f590

File tree

7 files changed

+31
-28
lines changed

7 files changed

+31
-28
lines changed

src/Frontend/src/components/heartbeats/EndpointInstances.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async function deleteInstance(instance: EndpointsView) {
8989
9090
async function deleteAllInstances() {
9191
try {
92-
await Promise.all(sortedInstances.value.filter((instance: EndpointsView) => instance.name === endpointName).map((instance: EndpointsView) => store.deleteEndpointInstance(instance)));
92+
await Promise.all(sortedInstances.value.filter((instance) => instance.name === endpointName).map((instance) => store.deleteEndpointInstance(instance)));
9393
useShowToast(TYPE.SUCCESS, "Endpoint deleted", "", false, { timeout: 1000 });
9494
await router.replace(backLink.value);
9595
} catch {

src/Frontend/src/components/heartbeats/HeartbeatConfiguration.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import HeartbeatsList from "./HeartbeatsList.vue";
1010
import { ref } from "vue";
1111
import ConfirmDialog from "@/components/ConfirmDialog.vue";
1212
import ResultsCount from "../ResultsCount.vue";
13-
import { LogicalEndpoint } from "@/resources/Heartbeat";
1413
1514
enum Operation {
1615
Track = "track",
@@ -36,7 +35,7 @@ async function proceedWarningDialog() {
3635
3736
try {
3837
await store.updateEndpointSettings(
39-
filteredEndpoints.value.filter((endpoint: LogicalEndpoint) => (dialogWarningOperation.value === Operation.Track && !endpoint.track_instances) || (dialogWarningOperation.value === Operation.DoNotTrack && endpoint.track_instances))
38+
filteredEndpoints.value.filter((endpoint) => (dialogWarningOperation.value === Operation.Track && !endpoint.track_instances) || (dialogWarningOperation.value === Operation.DoNotTrack && endpoint.track_instances))
4039
);
4140
useShowToast(TYPE.SUCCESS, `All endpoints set to '${dialogWarningOperation.value}'`, "", false, { timeout: 1000 });
4241
} catch {

src/Frontend/src/components/messages/SequenceDiagram/HandlersComponent.vue

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,21 @@ function setMessageTypeRef(el: SVGTextElement, index: number) {
6969
</script>
7070

7171
<template>
72-
<g>
73-
<g v-for="(handler, i) in handlerItems" :key="handler.id" :transform="`translate(${handler.left}, ${handler.y})`">
74-
<!--Handler Activation Box-->
75-
<rect :width="Handler_Width" :height="handler.height" :class="handler.incomingId && 'clickable'" :fill="handler.fill" @mouseover="() => store.setHighlightId(handler.incomingId)" @mouseleave="() => store.setHighlightId()" />
76-
<path v-if="handler.icon" :d="handler.icon" fill="white" :transform="`translate(${Handler_Width / 2 - handler.iconSize / 2}, ${handler.height / 2 - handler.iconSize / 2})`" />
77-
<!--Message Type and Icon-->
78-
<g
79-
v-if="handler.messageType"
80-
:transform="`translate(${handler.messageTypeOffset}, 4)`"
81-
class="clickable"
82-
:fill="handler.messageTypeHighlight ? 'var(--highlight)' : 'var(--gray40)'"
83-
@mouseover="() => store.setHighlightId(handler.incomingId)"
84-
@mouseleave="() => store.setHighlightId()"
85-
>
86-
<path d="M9,3L9,3 9,0 0,0 0,3 4,3 4,6 0,6 0,9 4,9 4,12 0,12 0,15 9,15 9,12 5,12 5,9 9,9 9,6 5,6 5,3z" />
87-
<text x="14" y="10" alignment-baseline="middle" :ref="(el) => setMessageTypeRef(el as SVGTextElement, i)">{{ handler.messageType }}</text>
88-
</g>
72+
<g v-for="(handler, i) in handlerItems" :key="handler.id" :transform="`translate(${handler.left}, ${handler.y})`">
73+
<!--Handler Activation Box-->
74+
<rect :width="Handler_Width" :height="handler.height" :class="handler.incomingId && 'clickable'" :fill="handler.fill" @mouseover="() => store.setHighlightId(handler.incomingId)" @mouseleave="() => store.setHighlightId()" />
75+
<path v-if="handler.icon" :d="handler.icon" fill="white" :transform="`translate(${Handler_Width / 2 - handler.iconSize / 2}, ${handler.height / 2 - handler.iconSize / 2})`" />
76+
<!--Message Type and Icon-->
77+
<g
78+
v-if="handler.messageType"
79+
:transform="`translate(${handler.messageTypeOffset}, 4)`"
80+
class="clickable"
81+
:fill="handler.messageTypeHighlight ? 'var(--highlight)' : 'var(--gray40)'"
82+
@mouseover="() => store.setHighlightId(handler.incomingId)"
83+
@mouseleave="() => store.setHighlightId()"
84+
>
85+
<path d="M9,3L9,3 9,0 0,0 0,3 4,3 4,6 0,6 0,9 4,9 4,12 0,12 0,15 9,15 9,12 5,12 5,9 9,9 9,6 5,6 5,3z" />
86+
<text x="14" y="10" alignment-baseline="middle" :ref="(el) => setMessageTypeRef(el as SVGTextElement, i)">{{ handler.messageType }}</text>
8987
</g>
9088
</g>
9189
</template>

src/Frontend/src/components/messages/SequenceDiagram/RoutesComponent.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ function setMessageTypeRef(el: SVGTextElement, index: number) {
8282
@mouseover="() => store.setHighlightId(arrow.id)"
8383
@mouseleave="() => store.setHighlightId()"
8484
>
85-
<rect v-if="arrow.highlight && arrow.messageTypeOffset" :width="arrow.highlightTextWidth + 19 + 4 + 4" :height="arrow.highlightTextHeight + 4 + 4" fill="var(--highlight-background)" />
85+
<!--19 is width of MessageType icon, plus a gap-->
86+
<rect
87+
v-if="arrow.highlight && arrow.messageTypeOffset"
88+
:width="arrow.highlightTextWidth + 19 + Message_Type_Margin + Message_Type_Margin"
89+
:height="arrow.highlightTextHeight + Message_Type_Margin + Message_Type_Margin"
90+
fill="var(--highlight-background)"
91+
/>
8692
<svg :x="Message_Type_Margin" :y="Message_Type_Margin" width="15" height="15" viewBox="0 0 32 32">
8793
<path
8894
v-if="arrow.type === RoutedMessageType.Timeout"

src/Frontend/src/resources/SequenceDiagram/Endpoint.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ export function createSendingEndpoint(message: Message): Endpoint {
3030
}
3131

3232
export class EndpointRegistry {
33-
_store = new Map<string, EndpointItem>();
33+
#store = new Map<string, EndpointItem>();
3434

3535
register(item: Endpoint) {
36-
let endpoint = this._store.get(item.name);
36+
let endpoint = this.#store.get(item.name);
3737
if (!endpoint) {
3838
endpoint = item as EndpointItem;
39-
this._store.set(endpoint.name, endpoint);
39+
this.#store.set(endpoint.name, endpoint);
4040
}
4141

4242
item.hosts.forEach((host) => endpoint.addHost(host as Host));
4343
}
4444

4545
get(item: Endpoint) {
46-
return this._store.get(item.name)! as Endpoint;
46+
return this.#store.get(item.name)! as Endpoint;
4747
}
4848
}
4949

src/Frontend/src/stores/HeartbeatInstancesStore.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe("HeartbeatInstancesStore tests", () => {
8181
[{ name: "", track_instances: true }]
8282
);
8383

84-
const names = () => filteredInstances.value.map((value: EndpointsView) => value.host_display_name);
84+
const names = () => filteredInstances.value.map((value) => value.host_display_name);
8585
sortByInstances.value = { property: ColumnNames.InstanceName, isAscending: true };
8686
expect(names()).toEqual(["Anna", "John", "Oliver"]);
8787

src/Frontend/src/stores/HeartbeatsStore.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as precondition from "../../test/preconditions";
1010
import { EndpointSettings } from "@/resources/EndpointSettings";
1111
import { serviceControlWithHeartbeats } from "@/components/heartbeats/serviceControlWithHeartbeats";
1212
import flushPromises from "flush-promises";
13-
import { EndpointStatus, LogicalEndpoint } from "@/resources/Heartbeat";
13+
import { EndpointStatus } from "@/resources/Heartbeat";
1414
import { ColumnNames, useHeartbeatsStore } from "@/stores/HeartbeatsStore";
1515

1616
describe("HeartbeatsStore tests", () => {
@@ -302,7 +302,7 @@ describe("HeartbeatsStore tests", () => {
302302
]
303303
);
304304

305-
const names = () => filteredHealthyEndpoints.value.map((value: LogicalEndpoint) => value.name);
305+
const names = () => filteredHealthyEndpoints.value.map((value) => value.name);
306306

307307
sortByInstances.value = { property: ColumnNames.Name, isAscending: true };
308308
expect(names()).toEqual(["Anna", "John", "Oliver"]);

0 commit comments

Comments
 (0)