EccClientGa4ghServiceRegistryServiceInfo Component
Overview
The ecc-client-ga4gh-service-registry-service-info component shows the service info of a GA4GH Service Registry itself (GET /service-info): its name, ID, version, type and organization, and the optional fields that the registry sets.
The version shows as a badge next to the name, the environment as a badge next to the type. Optional fields that are missing or invalid are left out: timestamps that the browser can't parse as dates (Date.parse()), and links other than http: and https: URLs (and mailto: for the contact).
Usage
Basic Service Info
The preview above shows the service info of a public service registry. See Live previews to use another registry.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
baseUrl | baseurl | string | "" | Base URL of the Service Registry API, used if no provider is set |
provider | - | ServiceRegistryProvider | undefined | Data provider for fetching the service info (see Providers) |
Set one of them; without either, the component shows an error. Changing either loads the service info again.
provider
The data provider whose getServiceInfo() returns the service info. See the Providers documentation for the available providers and how to create custom ones.
import { RestServiceRegistryProvider } from '@elixir-cloud/service-registry/providers';
const provider = new RestServiceRegistryProvider('https://registry.example.com/ga4gh/registry/v1');
<ECCClientGa4ghServiceRegistryServiceInfo provider={provider} />Events
| Event Name | React Event Name | Detail Type | Description |
|---|---|---|---|
ecc-service-info-changed | onEccServiceInfoChanged | { serviceInfo: Service | null } | Fired when the service info data changes |
ecc-service-info-changed
Emitted when the service info is loaded. If loading fails, or the provider is removed, serviceInfo is null.
<ECCClientGa4ghServiceRegistryServiceInfo
onEccServiceInfoChanged={(event) => {
document.title = event.detail.serviceInfo?.name ?? 'Service Registry';
}}
/>