ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

WORK IN PROGRESS: fix(ui5-illustrated-message): organize and load illustrations based o…

Open dobrinyonkov opened this issue 1 year ago • 0 comments

Closes: #8145

We have the following structure of illustrations:

dist/illustrations-v4 dist/illustrations-v4/AddColumn.js dist/illustrations-v4/tnt/Fingerprint.js

dist/illustrations-v5 dist/illustrations-v5/AddColumn.js currently no such illustrations but is taken into account as well dist/illustrations-v5/tnt/Fingerprint.js

dist/illustrations-v5-hc dist/illustrations-v5-hc/tnt/Fingerprint.js

The new script illustrations-root-imports.js collects information about in how many collections an illustrations exists and then creates its import file accordingly.

The script goes through the illustrations folders and creates new files with the following structure, when any of these files is laoded, they ensure that all collections are being registered: dist/illustrations/AddColumn.js dist/illustrations/tnt/Fingerprint.js

An example of such file is:

mport { registerIllustration } from "@ui5/webcomponents-base/dist/asset-registries/Illustrations.js";
import pathDatav4 from "@ui5/webcomponents-fiori/dist/illustrations-v4/tnt/ChartArea.js"
import pathDatav5 from "@ui5/webcomponents-fiori/dist/illustrations-v5/tnt/ChartArea.js"
import pathDatav5hc from "@ui5/webcomponents-fiori/dist/illustrations-v5-hc/tnt/ChartArea.js"

[pathDatav4, pathDatav5, pathDatav5hc].forEach((pathData) => {
    registerIllustration(pathData.name, {
        dialogSvg: pathData.dialogSvg,
        sceneSvg: pathData.sceneSvg,
        spotSvg: pathData.spotSvg,
        dotSvg: pathData.dotSvg,
        title: pathData.title,
        subtitle: pathData.subtitle,
        set: pathData.set,
        collection: pathData.collection,
    });
});

dobrinyonkov avatar Mar 15 '24 08:03 dobrinyonkov