From 91fe5c5f014e467ae9489384dc8bb9e58ae20ea0 Mon Sep 17 00:00:00 2001 From: Tomasz Masternak Date: Fri, 13 Nov 2026 08:31:56 +0100 Subject: [PATCH 01/11] Add a trial license mock scenario --- src/Frontend/test/mocks/scenarios/index.ts | 2 ++ .../scenarios/licensing/trial-license.ts | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/Frontend/test/mocks/scenarios/licensing/trial-license.ts diff --git a/src/Frontend/test/mocks/scenarios/index.ts b/src/Frontend/test/mocks/scenarios/index.ts index 2e4195989..623f6dbff 100644 --- a/src/Frontend/test/mocks/scenarios/index.ts +++ b/src/Frontend/test/mocks/scenarios/index.ts @@ -36,6 +36,8 @@ const scenarios: Record Promise> = { "monitoring-available": () => import("./monitoring/monitoring-available"), "monitoring-unavailable": () => import("./monitoring/monitoring-unavailable"), "monitoring-no-endpoints": () => import("./monitoring/monitoring-no-endpoints"), + // Licensing scenarios + "trial-license": () => import("./licensing/trial-license"), // Platform health scenarios "platform-health": () => import("./platform-health/platform-health"), // Recoverability scenarios diff --git a/src/Frontend/test/mocks/scenarios/licensing/trial-license.ts b/src/Frontend/test/mocks/scenarios/licensing/trial-license.ts new file mode 100644 index 000000000..19f12d757 --- /dev/null +++ b/src/Frontend/test/mocks/scenarios/licensing/trial-license.ts @@ -0,0 +1,34 @@ +/** + * Scenario: Trial License + * + * ServiceControl and Monitoring are available and the license is a valid trial that is not close to expiring. + * + * Usage: + * set VITE_MOCK_SCENARIO=trial-license + * npm run dev:mocks + * + * Test: + * 1. Open browser to the dev server URL + * 2. Every page should show the "Trial license, non-production use only" bar at the bottom + */ +import { createScenario } from "../scenario-helper"; +import * as precondition from "../../../preconditions"; +import { LicenseStatus } from "@/resources/LicenseInfo"; +import { createDateWithDayOffset } from "@/composables/formatter"; + +const { worker, runScenario } = createScenario(); + +export { worker }; +export const setupComplete = runScenario(async ({ driver }) => { + await driver.setUp(precondition.serviceControlWithMonitoring); + const activeLicense = precondition.hasActiveLicense({ driver }); + driver.mockEndpoint(`${window.defaultConfig.service_control_url}license`, { + body: { + ...activeLicense, + license_type: "Trial", + trial_license: true, + license_status: LicenseStatus.Valid, + expiration_date: createDateWithDayOffset(60).toISOString(), + }, + }); +}); From df60b435f5978733794583d08927f16ae6260b56 Mon Sep 17 00:00:00 2001 From: Tomasz Masternak Date: Fri, 13 Nov 2026 08:31:56 +0100 Subject: [PATCH 02/11] Mock a message conversation in the audit-available scenario Message details, the message body, and the sequence and flow diagrams had no mock data, so the layout check could not cover them. --- .agents/skills/servicepulse-ui/SKILL.md | 2 +- .../mocks/scenarios/audit/audit-available.ts | 8 ++- src/Frontend/test/preconditions/index.ts | 1 + .../test/preconditions/messageConversation.ts | 60 +++++++++++++++++++ 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 src/Frontend/test/preconditions/messageConversation.ts diff --git a/.agents/skills/servicepulse-ui/SKILL.md b/.agents/skills/servicepulse-ui/SKILL.md index ef99e8c71..43a08f21b 100644 --- a/.agents/skills/servicepulse-ui/SKILL.md +++ b/.agents/skills/servicepulse-ui/SKILL.md @@ -31,7 +31,7 @@ The guideline sets which views and widths to check. When a `docs/` page of the a 4. Keep the mock instance of the change running while you ask the person who asked for the change to accept a difference. 5. Give them a link to the view in that instance, with the mock scenario, the width to set, and any step needed to reach the state, such as a tab to open. -For a change to the shell or to shared styles, cover at least Dashboard, Failed Messages with a message's details, Monitoring with an endpoint's details, All Messages (`audit-available` scenario), Platform health, and Configuration. No mock scenario serves message details or conversations, so check a message's sequence diagram against a running ServiceControl with audit data. +For a change to the shell or to shared styles, cover at least Dashboard, Failed Messages with a message's details, Monitoring with an endpoint's details, All Messages with a message's sequence diagram (`audit-available` scenario), Platform health, and Configuration. ## Check before opening a pull request diff --git a/src/Frontend/test/mocks/scenarios/audit/audit-available.ts b/src/Frontend/test/mocks/scenarios/audit/audit-available.ts index e28390309..d8d550cdb 100644 --- a/src/Frontend/test/mocks/scenarios/audit/audit-available.ts +++ b/src/Frontend/test/mocks/scenarios/audit/audit-available.ts @@ -12,6 +12,7 @@ * 2. Navigate to Messages view * 3. Audit capability card should show "Available" status * 4. Messages should be visible in the list + * 5. Opening a message should show its details, and the Sequence Diagram tab should show the conversation */ import { createScenario } from "../scenario-helper"; import * as precondition from "../../../preconditions"; @@ -19,4 +20,9 @@ import * as precondition from "../../../preconditions"; const { worker, runScenario } = createScenario(); export { worker }; -export const setupComplete = runScenario(precondition.scenarioAuditAvailable); +export const setupComplete = runScenario(async ({ driver }) => { + await driver.setUp(precondition.scenarioAuditAvailable); + const conversation = precondition.createMessageConversation(); + await driver.setUp(precondition.hasSuccessfulMessages(conversation)); + await driver.setUp(precondition.hasMessageConversation(conversation)); +}); diff --git a/src/Frontend/test/preconditions/index.ts b/src/Frontend/test/preconditions/index.ts index 8133350e2..5d4cda33d 100644 --- a/src/Frontend/test/preconditions/index.ts +++ b/src/Frontend/test/preconditions/index.ts @@ -31,3 +31,4 @@ export { hasEndpointSettings } from "./hasEndpointSettings"; export * from "./configuration"; export * from "./authentication"; export * from "./platformCapabilities"; +export * from "./messageConversation"; diff --git a/src/Frontend/test/preconditions/messageConversation.ts b/src/Frontend/test/preconditions/messageConversation.ts new file mode 100644 index 000000000..b9935ceed --- /dev/null +++ b/src/Frontend/test/preconditions/messageConversation.ts @@ -0,0 +1,60 @@ +import type { SetupFactoryOptions } from "../driver"; +import { type default as Message, MessageIntent, MessageStatus } from "@/resources/Message"; +import { NServiceBusHeaders } from "@/resources/Header"; + +const conversationId = "conv-1"; + +function createConversationMessage(id: string, messageType: string, intent: MessageIntent, from: string, to: string, secondsAfterStart: number, relatedTo?: string): Message { + const timeSent = new Date(Date.now() - 5 * 60_000 + secondsAfterStart * 1000).toISOString(); + const fullType = `Shop.Messages.${messageType}, Shop.Messages`; + const headers = [ + { key: NServiceBusHeaders.MessageId, value: id }, + { key: NServiceBusHeaders.NServiceBusVersion, value: "9.2.3" }, + { key: NServiceBusHeaders.TimeSent, value: timeSent }, + { key: NServiceBusHeaders.ProcessingEndpoint, value: to }, + { key: NServiceBusHeaders.EnclosedMessageTypes, value: fullType }, + { key: NServiceBusHeaders.ContentType, value: "application/json" }, + ...(relatedTo ? [{ key: NServiceBusHeaders.RelatedTo, value: relatedTo }] : []), + ]; + + return { + id, + message_id: id, + message_type: fullType, + sending_endpoint: { name: from, host_id: `host-${from}`, host: "localhost" }, + receiving_endpoint: { name: to, host_id: `host-${to}`, host: "localhost" }, + time_sent: timeSent, + processed_at: new Date(Date.parse(timeSent) + 150).toISOString(), + critical_time: "00:00:00.1500000", + processing_time: "00:00:00.0500000", + delivery_time: "00:00:00.1000000", + is_system_message: false, + conversation_id: conversationId, + headers, + status: MessageStatus.Successful, + message_intent: intent, + body_url: `/messages/${id}/body`, + body_size: 64, + instance_id: "instance-1", + }; +} + +/** A conversation that starts with PlaceOrder and fans out to three endpoints. The first message keeps the id `msg-1`. */ +export function createMessageConversation(): Message[] { + return [ + createConversationMessage("msg-1", "PlaceOrder", MessageIntent.Send, "Shop.ClientUI", "Shop.Sales", 0), + createConversationMessage("msg-2", "OrderPlaced", MessageIntent.Publish, "Shop.Sales", "Shop.Billing", 1, "msg-1"), + createConversationMessage("msg-3", "OrderPlaced", MessageIntent.Publish, "Shop.Sales", "Shop.Shipping", 1, "msg-1"), + createConversationMessage("msg-4", "OrderBilled", MessageIntent.Publish, "Shop.Billing", "Shop.Shipping", 2, "msg-2"), + ]; +} + +/** Precondition: message details, the conversation behind the sequence and flow diagrams, and message bodies */ +export const hasMessageConversation = + (messages: Message[] = createMessageConversation()) => + ({ driver }: SetupFactoryOptions) => { + const serviceControlUrl = window.defaultConfig.service_control_url; + driver.mockEndpointDynamic(`${serviceControlUrl}messages/search/:messageId`, "get", (_url, params) => Promise.resolve({ body: messages.filter((message) => message.message_id === decodeURIComponent(String(params.messageId))) })); + driver.mockEndpointDynamic(`${serviceControlUrl}conversations/:conversationId`, "get", (_url, params) => Promise.resolve({ body: messages.filter((message) => message.conversation_id === params.conversationId) })); + driver.mockEndpointDynamic(`${serviceControlUrl}messages/:id/body`, "get", (_url, params) => Promise.resolve({ body: { OrderId: `order-for-${params.id}`, Total: 42.5 } })); + }; From 69fd01d2b00e54c158f1ec05edf68e27d1853587 Mon Sep 17 00:00:00 2001 From: Tomasz Masternak Date: Fri, 13 Nov 2026 08:32:06 +0100 Subject: [PATCH 03/11] Add shell design tokens tokens.css holds the colours, sizes, and rounding of the application shell as CSS custom properties. Count badges take their colour from the danger token. --- src/Frontend/src/assets/main.css | 3 ++- src/Frontend/src/assets/tokens.css | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/Frontend/src/assets/tokens.css diff --git a/src/Frontend/src/assets/main.css b/src/Frontend/src/assets/main.css index 35ec15b28..33b569c49 100644 --- a/src/Frontend/src/assets/main.css +++ b/src/Frontend/src/assets/main.css @@ -1,4 +1,5 @@ @import "bootstrap/dist/css/bootstrap.css"; +@import "tokens.css"; @import "footer.css"; @import "tabs.css"; @import "dropdown.css"; @@ -46,7 +47,7 @@ body { } .badge.badge-important { - background-color: #ce4844; + background-color: var(--sp-danger); background-image: none; border: none; } diff --git a/src/Frontend/src/assets/tokens.css b/src/Frontend/src/assets/tokens.css new file mode 100644 index 000000000..59167d4f9 --- /dev/null +++ b/src/Frontend/src/assets/tokens.css @@ -0,0 +1,19 @@ +/* Design tokens for the application shell. */ +:root { + --sp-canvas: #f2f6f7; + --sp-danger: #ce4844; + --sp-trial: #b22222; + --sp-healthy: #00c468; + + --sp-chrome: #1a1a1a; + --sp-chrome-ink: #b5b5b5; + --sp-chrome-ink-active: #ffffff; + --sp-chrome-hover: #2b2b2b; + --sp-chrome-divider: #333333; + --sp-chrome-strip: #0d0d0d; + --sp-chrome-strip-ink: #a6a6a6; + + --sp-side-bar-width: 224px; + --sp-side-bar-collapsed-width: 64px; + --sp-radius-sm: 4px; +} From 5ab1cc1bf1734b9f932da5a4d8748e0f1bc67256 Mon Sep 17 00:00:00 2001 From: Tomasz Masternak Date: Fri, 13 Nov 2026 08:32:06 +0100 Subject: [PATCH 04/11] Add a shared screen-reader class The UI guideline limits Bootstrap utilities to layout, so main.css provides .sr-only for text that only screen readers need. --- src/Frontend/src/assets/main.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Frontend/src/assets/main.css b/src/Frontend/src/assets/main.css index 33b569c49..aeb1c7422 100644 --- a/src/Frontend/src/assets/main.css +++ b/src/Frontend/src/assets/main.css @@ -27,6 +27,19 @@ --fa-width: auto; } +/* Hidden visually, still read by screen readers. */ +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} + body { padding-top: 0px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; From 9986cbeb7f964f3e87acf58b607f280082b7a527 Mon Sep 17 00:00:00 2001 From: Tomasz Masternak Date: Fri, 13 Nov 2026 08:32:06 +0100 Subject: [PATCH 05/11] Let the Monitoring title take its natural width The title had a fixed third of the header row and truncated when the content area got narrower. --- src/Frontend/src/components/monitoring/MonitoringHead.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Frontend/src/components/monitoring/MonitoringHead.vue b/src/Frontend/src/components/monitoring/MonitoringHead.vue index ef66dade5..08c5fb3e7 100644 --- a/src/Frontend/src/components/monitoring/MonitoringHead.vue +++ b/src/Frontend/src/components/monitoring/MonitoringHead.vue @@ -9,10 +9,10 @@ const { isMassTransitConnected } = storeToRefs(configurationStore);