Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/Frontend/src/views/throughputreport/EndpointsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import LegendNServiceBusEndpoint from "./LegendNServiceBusEndpoint.vue";
import LegendNServiceBusEndpointNoLongerInUse from "./LegendNServiceBusEndpointNoLongerInUse.vue";
import LegendTransactionalSessionProcessorEndpoint from "./LegendTransactionalSessionProcessorEndpoint.vue";
import LegendSendOnlyEndpoint from "./LegendSendOnlyEndpoint.vue";
import LegendPlannedToDecommission from "./LegendPlannedToDecommission.vue";
import LegendNotNServiceBusEndpoint from "./LegendNotNServiceBusEndpoint.vue";
import LegendGatewayOrBridgeEndpoint from "./LegendGatewayOrBridgeEndpoint.vue";
import LegendParticularPlatformEndpoint from "./LegendParticularPlatformEndpoint.vue";
Expand All @@ -32,13 +31,12 @@ const showLegend = ref(false);

const legendOptions = new Map<UserIndicator, Component>([
[UserIndicator.NServiceBusEndpoint, LegendNServiceBusEndpoint],
[UserIndicator.NServiceBusEndpointNoLongerInUse, LegendNServiceBusEndpointNoLongerInUse],
[UserIndicator.TransactionalSessionProcessorEndpoint, LegendTransactionalSessionProcessorEndpoint],
[UserIndicator.SendOnlyEndpoint, LegendSendOnlyEndpoint],
[UserIndicator.PlannedToDecommission, LegendPlannedToDecommission],
[UserIndicator.NotNServiceBusEndpoint, LegendNotNServiceBusEndpoint],
[UserIndicator.TransactionalSessionProcessorEndpoint, LegendTransactionalSessionProcessorEndpoint],
[UserIndicator.GatewayOrBridgingEndpoint, LegendGatewayOrBridgeEndpoint],
[UserIndicator.ParticularPlatformEndpoint, LegendParticularPlatformEndpoint],
[UserIndicator.NServiceBusEndpointNoLongerInUse, LegendNServiceBusEndpointNoLongerInUse],
[UserIndicator.NotNServiceBusEndpoint, LegendNotNServiceBusEndpoint],
]);

function toggleOptionsLegendVisible() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ const { testResults } = storeToRefs(store);
ariaLabel="Detected broker queues"
:indicator-options="[
UserIndicator.NServiceBusEndpoint,
UserIndicator.NotNServiceBusEndpoint,
UserIndicator.TransactionalSessionProcessorEndpoint,
UserIndicator.SendOnlyEndpoint,
UserIndicator.NServiceBusEndpointNoLongerInUse,
UserIndicator.PlannedToDecommission,
UserIndicator.TransactionalSessionProcessorEndpoint,
UserIndicator.GatewayOrBridgingEndpoint,
UserIndicator.ParticularPlatformEndpoint,
UserIndicator.NServiceBusEndpointNoLongerInUse,
UserIndicator.NotNServiceBusEndpoint,
]"
:legacy-indicator-options="[UserIndicator.PlannedToDecommission]"
:source="DataSource.Broker"
column-title="Queue Name"
:show-endpoint-type-placeholder="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ const { isBrokerTransport, hasErrors } = storeToRefs(store);
ariaLabel="Detected endpoints"
:indicator-options="[
UserIndicator.NServiceBusEndpoint,
UserIndicator.TransactionalSessionProcessorEndpoint,
UserIndicator.SendOnlyEndpoint,
UserIndicator.NServiceBusEndpointNoLongerInUse,
UserIndicator.PlannedToDecommission,
UserIndicator.TransactionalSessionProcessorEndpoint,
UserIndicator.GatewayOrBridgingEndpoint,
UserIndicator.ParticularPlatformEndpoint,
UserIndicator.NServiceBusEndpointNoLongerInUse,
]"
:legacy-indicator-options="[UserIndicator.PlannedToDecommission]"
:source="DataSource.WellKnownEndpoint"
column-title="Endpoint Name"
:show-endpoint-type-placeholder="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ describe("DetectedListView tests", () => {
await renderComponent({ source: DataSource.Broker, indicatorOptions: [UserIndicator.NServiceBusEndpoint], ariaLabel: tableName }, async (driver) => {
await driver.setUp(
precondition.hasLicensingEndpoints([
...[...Array(5).keys()].map((i) => ({ name: `${i}Beta`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.PlannedToDecommission, max_daily_throughput: i })),
...[...Array(8).keys()].map((i) => ({ name: `${i}Beta`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.PlannedToDecommission, max_daily_throughput: i })),
...[...Array(2).keys()].map((i) => ({ name: `${i}Delta${i}`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.PlannedToDecommission, max_daily_throughput: i })),
...[...Array(5).keys()].map((i) => ({ name: `${i}Beta`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.NServiceBusEndpointNoLongerInUse, max_daily_throughput: i })),
...[...Array(8).keys()].map((i) => ({ name: `${i}Beta`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.NServiceBusEndpointNoLongerInUse, max_daily_throughput: i })),
...[...Array(2).keys()].map((i) => ({ name: `${i}Delta${i}`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.NServiceBusEndpointNoLongerInUse, max_daily_throughput: i })),
{ name: "boo", name_hash: "", is_known_endpoint: false, user_indicator: "", max_daily_throughput: 11 },
])
);
Expand Down Expand Up @@ -194,7 +194,7 @@ describe("DetectedListView tests", () => {

await renderComponent({ source: DataSource.Broker, indicatorOptions: [UserIndicator.NServiceBusEndpoint], ariaLabel: tableName }, async (driver) => {
await driver.setUp(
precondition.hasLicensingEndpoints([...[...Array(dataLength).keys()].map((i) => ({ name: `${i}Beta`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.PlannedToDecommission, max_daily_throughput: i }))])
precondition.hasLicensingEndpoints([...[...Array(dataLength).keys()].map((i) => ({ name: `${i}Beta`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.NServiceBusEndpointNoLongerInUse, max_daily_throughput: i }))])
);
});

Expand Down Expand Up @@ -245,7 +245,9 @@ describe("DetectedListView tests", () => {
];

await renderComponent({ source: DataSource.Broker, indicatorOptions: [UserIndicator.NServiceBusEndpoint], ariaLabel: tableName }, async (driver) => {
await driver.setUp(precondition.hasLicensingEndpoints([...[...unsortedNames].map((name, idx) => ({ name, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.PlannedToDecommission, max_daily_throughput: idx }))]));
await driver.setUp(
precondition.hasLicensingEndpoints([...[...unsortedNames].map((name, idx) => ({ name, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.NServiceBusEndpointNoLongerInUse, max_daily_throughput: idx }))])
);
});

const user = userEvent.setup();
Expand Down Expand Up @@ -293,11 +295,11 @@ describe("DetectedListView tests", () => {
const setup = async () => {
const tableName = "Special table";

const { driver } = await renderComponent({ source: DataSource.Broker, indicatorOptions: [UserIndicator.PlannedToDecommission, UserIndicator.NServiceBusEndpoint], ariaLabel: tableName }, async (driver) => {
const { driver } = await renderComponent({ source: DataSource.Broker, indicatorOptions: [UserIndicator.NServiceBusEndpointNoLongerInUse, UserIndicator.NServiceBusEndpoint], ariaLabel: tableName }, async (driver) => {
await driver.setUp(
precondition.hasLicensingEndpoints([
{ name: `Not set yet`, name_hash: "", is_known_endpoint: false, user_indicator: "", max_daily_throughput: 100 },
{ name: `Set and needs updating`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.PlannedToDecommission, max_daily_throughput: 50 },
{ name: `Set and needs updating`, name_hash: "", is_known_endpoint: false, user_indicator: UserIndicator.NServiceBusEndpointNoLongerInUse, max_daily_throughput: 50 },
])
);
await driver.setUp(updateLicensingEndpoints());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface DetectedListViewProps {
columnTitle: string;
showEndpointTypePlaceholder: boolean;
indicatorOptions: UserIndicator[];
legacyIndicatorOptions?: UserIndicator[];
source: DataSource;
}

Expand Down Expand Up @@ -258,6 +259,9 @@ async function save() {
<select class="form-select endpointType format-text" @change="(event) => updateIndicator(event, row.name)">
<option v-if="props.showEndpointTypePlaceholder" value="">Pick the most appropriate option</option>
<option v-for="item in props.indicatorOptions" :key="item" :value="item" :selected="(dataChanges.get(row.name)?.indicator ?? getDefaultEndpointType(row)) === item">{{ userIndicatorMapper.get(item) }}</option>
<option v-for="item in props.legacyIndicatorOptions?.filter((legacy) => row.user_indicator === legacy)" :key="item" :value="item" :selected="(dataChanges.get(row.name)?.indicator ?? getDefaultEndpointType(row)) === item">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't want default item here, since it only applies for rows without a selected item

Suggested change
<option v-for="item in props.legacyIndicatorOptions?.filter((legacy) => row.user_indicator === legacy)" :key="item" :value="item" :selected="(dataChanges.get(row.name)?.indicator ?? getDefaultEndpointType(row)) === item">
<option v-for="item in props.legacyIndicatorOptions?.filter((legacy) => row.user_indicator === legacy)" :key="item" :value="item" :selected="(dataChanges.get(row.name)?.indicator) === item">

{{ userIndicatorMapper.get(item) }}
</option>
</select>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export enum UserIndicator {
TransactionalSessionProcessorEndpoint = "TransactionalSessionProcessorEndpoint",
SendOnlyEndpoint = "SendOnlyEndpoint",
NServiceBusEndpointNoLongerInUse = "NServiceBusEndpointNoLongerInUse",
PlannedToDecommission = "PlannedToDecommission",
GatewayOrBridgingEndpoint = "GatewayOrBridgingEndpoint",
ParticularPlatformEndpoint = "ParticularPlatformEndpoint",
PlannedToDecommission = "PlannedToDecommission",
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export const userIndicatorMapper = new Map<UserIndicator, string>([
[UserIndicator.NServiceBusEndpointNoLongerInUse, "No longer in use"],
[UserIndicator.TransactionalSessionProcessorEndpoint, "Transactional Session Processor Endpoint"],
[UserIndicator.SendOnlyEndpoint, "Send-Only Endpoint"],
[UserIndicator.PlannedToDecommission, "Planned to be decommissioned"],
[UserIndicator.NotNServiceBusEndpoint, "Not an NServiceBus Endpoint"],
[UserIndicator.GatewayOrBridgingEndpoint, "Gateway or Bridging Endpoint"],
[UserIndicator.ParticularPlatformEndpoint, "Particular Platform Infrastructure Endpoint"],
[UserIndicator.PlannedToDecommission, "Planned to be decommissioned"],
]);
Loading