MishkaCmsCoreWeb.Live.Admin.Components.ShareCardField (Mishka CMS Core v0.0.1)

Copy Markdown View Source

The share card a page or a record shows where a link to it is shared (MishkaCmsCore.Runtime.ShareCard), in its edit modal: the card as drawn, and Regenerate, which draws it again over the old file (ShareCard.refresh(site_id, target, force: true)) and shows the new one once it is written.

Handed the target (MishkaCmsCore.Runtime.ShareCard.target/0) — the page builder's SEO tab — or the record a form edits and target_of, a function of it returning the target, nil for a record that shows none: what MishkaCmsCoreWeb.UIAdapters.Admin.text_input/1 hands it for a field whose ui says extra %{share_card: &target/1}. target_of runs with the card's read, in the background, never while the modal is drawn.

A card not drawn yet is queued when the panel opens (ShareCard.refresh/3) and shown once it is written; a record saved while its modal is open is read again.

It is its own component because it reads the card in the background and keeps looking until a regenerated one is written.