All files / owid-grapher/site/blocks index.ts

48.39% Statements 15/31
100% Branches 0/0
0% Functions 0/2
48.39% Lines 15/31

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 311x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x         1x 1x                         1x
import {
    hydrate as hydrateAdditionalInformation,
    render as renderAdditionalInformation,
} from "./AdditionalInformation"
import { renderHelp } from "./Help"
import { renderAuthoredProminentLinks } from "./ProminentLink"
import { runSearchCountry } from "../../site/SearchCountry"
import { runExpandableInlineBlock } from "../../site/ExpandableInlineBlock"
import { runDataTokens } from "../../site/runDataTokens"
import { shouldProgressiveEmbed } from "../../site/multiembedder/MultiEmbedder"
 
export const renderBlocks = (cheerioEl: CheerioStatic) => {
    renderAdditionalInformation(cheerioEl)
    renderHelp(cheerioEl)
    renderAuthoredProminentLinks(cheerioEl)
}
 
export const runBlocks = () => {
    if (!shouldProgressiveEmbed()) {
        // Used by Help blocks. Pierces encapsulation but considered not worth going through hydration / client side rendering for this.
        // If hydration required for other purposes, then reassess.
        document
            .getElementsByTagName("body")[0]
            .classList.add("is-not-chart-interactive")
    }
    runDataTokens()
    runExpandableInlineBlock()
    runSearchCountry()
    hydrateAdditionalInformation()
}