fix(frontend): stop MSK breaking the Console Home resource count
CI / checks (pull_request) Successful in 26m59s
CI / checks (pull_request) Successful in 26m59s
Console Home counted every available service through the generic resource list, but MSK and MSK Connect are available through their own pre-SPI pages with no adapter behind /resources, so each answered 501 and the Resources tile read "Resource load failed". Service descriptors now say whether the generic list serves them (listable, true when an adapter is registered), and Console Home counts only those; the MSK cards still link to their pages.
This commit is contained in:
@@ -44,6 +44,11 @@ export interface CloudServiceDescriptor {
|
||||
iconKey: string
|
||||
group: ServiceGroup
|
||||
order: number
|
||||
/**
|
||||
* Whether the generic resource list serves it. False for a service still on its
|
||||
* own pre-SPI page (MSK, MSK Connect): available, but not countable.
|
||||
*/
|
||||
listable: boolean
|
||||
}
|
||||
|
||||
export type RuntimeReachability = 'reachable' | 'unavailable' | 'coming_soon'
|
||||
|
||||
@@ -1403,6 +1403,18 @@ describe('service descriptors', () => {
|
||||
expect(secretsFor(bare)).toMatchObject({availability: 'coming_soon'})
|
||||
expect(secretsFor(gcp)).toMatchObject({availability: 'available', route: 'secrets'})
|
||||
})
|
||||
|
||||
test('marks a service listable only when an adapter serves the generic list', async () => {
|
||||
// MSK is available through its own pre-SPI page; Console Home must not count it
|
||||
// through /resources, which has no adapter behind it and answers 501.
|
||||
const body = await (await appWithRoutes([mockAdapter('aws')]).request('/api/clouds/aws/services')).json() as Array<{service: string; availability: string; listable: boolean}>
|
||||
const of = (service: string) => body.find((descriptor) => descriptor.service === service)
|
||||
|
||||
expect(of('storage')).toMatchObject({availability: 'available', listable: true})
|
||||
expect(of('msk')).toMatchObject({availability: 'available', listable: false})
|
||||
expect(of('msk-connect')).toMatchObject({availability: 'available', listable: false})
|
||||
expect(of('serverless')).toMatchObject({availability: 'coming_soon', listable: false})
|
||||
})
|
||||
})
|
||||
|
||||
describe('AppConfig nested routes', () => {
|
||||
|
||||
@@ -177,6 +177,7 @@ export class CloudProxyService {
|
||||
iconKey: entry.iconKey,
|
||||
group: entry.group,
|
||||
order: entry.order,
|
||||
listable: Boolean(adapter),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ const STARTED_AT = new Date('2026-10-23T08:00:00.000Z')
|
||||
const NOW = new Date('2026-10-23T10:30:15.000Z')
|
||||
|
||||
function descriptor(service: CloudServiceDescriptor['service'], displayName: string, availability: CloudServiceDescriptor['availability'] = 'available'): CloudServiceDescriptor {
|
||||
return {cloud: 'aws', service, displayName, availability, route: `/cloud-explorer/aws/${service}`, iconKey: service, group: 'Compute', order: 1}
|
||||
return {cloud: 'aws', service, displayName, availability, route: `/cloud-explorer/aws/${service}`, iconKey: service, group: 'Compute', order: 1, listable: availability === 'available'}
|
||||
}
|
||||
|
||||
function proxy(status: Partial<CloudStatus> = {}, descriptors: CloudServiceDescriptor[] = []) {
|
||||
|
||||
Reference in New Issue
Block a user