Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Version 0.6.5

Features

  • Added showRoundedTo prop to the Result Table component. This prop accepts a callback function that receives a number and returns a tooltip message. When defined, numeric cells display a tooltip on hover using the Tooltip component.

Breaking changes

  • Removed indicateApproximation prop from the Result Table and Result Summary components. Use the new showRoundedTo prop on the Result Table component instead for a more informative user experience.
  • The negotiateOptions.siteMappings array has been removed. If you use negotiation, you must migrate your top-level siteMappings values from plain strings to objects with displayName and collectionId fields, so Lens can derive the collection IDs from there.

Migration guide

Removal of indicateApproximation

The indicateApproximation prop has been removed from both lens-result-table and lens-result-summary components.

If you were using indicateApproximation on the result table:

Before:

<lens-result-table indicateApproximation={true}></lens-result-table>

After:

<lens-result-table showRoundedTo={() => "Rounded to the nearest multiple of 10"}
></lens-result-table>

The new showRoundedTo prop provides more flexibility by allowing you to specify the tooltip message dynamically based on the value. For example:

<lens-result-table
    showRoundedTo={(value) => {
        if (value < 10) return "Exact value";
        if (value < 100) return "Rounded to the nearest multiple of 10";
        return "Rounded to the nearest multiple of 100";
    }}
></lens-result-table>

If you were using indicateApproximation on the result summary, simply remove the prop as this feature is no longer available on that component:

Before:

<lens-result-summary indicateApproximation={true}></lens-result-summary>

After:

<lens-result-summary></lens-result-summary>

Removal of negotiateOptions.siteMappings

The negotiateOptions.siteMappings array has been removed. If you use negotiation, you must switch your top-level siteMappings values to the new object format, which includes a collectionId field. Lens now derives the collection IDs directly from the top-level siteMappings instead.

If you do not use negotiation, plain string values in siteMappings continue to work and no migration is needed.

A new top-level collectionBaseUrl option has also been added to configure the base URL used when linking to a collection.

Before:

{
    "siteMappings": {
        "berlin": "Berlin",
        "heidelberg": "Heidelberg"
    },
    "negotiateOptions": {
        "url": "https://negotiator.example.org/api/v3/requests",
        "authorizationHeader": "Basic ...",
        "siteMappings": [
            {
                "site": "Berlin",
                "collection": "bbmri-eric:ID:DE_ZeBanC:collection:COVID19",
                "site_id": "bbmri-eric:ID:DE_ZeBanC",
                "collection_name": "Existing collection of COVID-19 cases"
            },
            {
                "site": "Heidelberg",
                "collection": "bbmri-eric:ID:DE_BMBH:collection:Lungenbiobank",
                "site_id": "bbmri-eric:ID:DE_BMBH",
                "collection_name": "Lungenbiobank"
            }
        ]
    }
}

After:

{
    "collectionBaseUrl": "https://directory.bbmri-eric.eu/ERIC/directory/#/collection/",
    "siteMappings": {
        "berlin": {
            "displayName": "Berlin",
            "collectionId": "bbmri-eric:ID:DE_ZeBanC:collection:COVID19"
        },
        "heidelberg": {
            "displayName": "Heidelberg",
            "collectionId": "bbmri-eric:ID:DE_BMBH:collection:Lungenbiobank"
        }
    },
    "negotiateOptions": {
        "url": "https://negotiator.example.org/api/v3/requests",
        "authorizationHeader": "Basic ..."
    }
}

For each site that participates in negotiation, replace the plain string value in siteMappings with an object containing:

  • displayName — the human-readable name previously used as the plain string value
  • collectionId — the collection identifier previously listed in negotiateOptions.siteMappings as the collection field

Then remove the negotiateOptions.siteMappings array entirely. Sites that are not involved in negotiation can keep plain string values.