MishkaCmsMigrationWeb.Live.Admin.Dashboard.Home.RunDetails (Mishka CMS Migration v0.0.1)

Copy Markdown View Source

A run's expanded row on the migration page (MishkaCmsMigrationWeb.Live.Admin.Dashboard.Home.Index), drawn as the admin dashboard's cards are drawn (MishkaCmsCore.Dashboard.Widget). panel/1 takes the run as the page reads it.

  • The head says where the run is (MishkaCmsMigration.MigrationRun.status_label/1), what the report it shows came from and when that finished: the import of a run that is done, its last dry run otherwise. Under it, how many items the source listed, a bar of what came of them and a pill for each outcome counted more than none of (MishkaCmsMigration.MigrationRun.result_outcomes/1), with the icon and colours of the row's Result pills (outcome_icon/1, outcome_class/1). A failed run says why it stopped, in words for the reasons a source and the job give (MishkaCmsMigration.Report.reason/1) and as it is for any other.
  • A card for each kind the report counts, with its icon (kind_icon/1) and name (kind_label/1): how many items of it the source listed, a bar of their outcomes, and how many of them wait for the admin's decision, else failed, else were skipped, with the reason most of those entries give (reason_label/1): "54 skipped: No public address at the source" when that reason covers all 54, "most often" before it when others are among them.
  • The latest items, the report's last entries newest first, each with links to its CMS record when it has one (item_paths/2, MishkaCmsMigration.MigrationRun.record_links/1), and how many more it counted, which opens the run's Items page.
  • After a dry run that would bring files, a note that duplicate files are found only by the import, which downloads them (MishkaCmsMigration.Targets.CmsMedia), so one may ask for a decision then that the dry run did not show.
  • When the links an import writes may not match the site's language addresses, the warning that says so (MishkaCmsMigrationWeb.Live.Admin.Dashboard.LanguageNotice), under the head, and, when an import created users, the warning that their passwords cannot be carried over (MishkaCmsMigrationWeb.Live.Admin.Dashboard.PasswordNotice).
  • A cancelled run says so, in the alert the Items page shows (MishkaCmsMigration.MigrationRun.cancelled_words/1).
  • What the source said of itself when the run connected (extra: a WordPress site's name, its address, which opens in a new tab, its timezone and who signed in) and the admin's choices (options, read with MishkaCmsMigration.MigrationRun.Options.builder/1), in words.

A run waiting for its first dry run says so, what a dry run reads and where to start one. A run dry running or importing shows how far its job is instead of its last report: the kind it reads among the source's kinds (MishkaCmsMigration.Source.kinds/0) and the counts so far, from progress.

An address a source gave is a link only when it is an http or https one. The bars are SVG shapes, not style attributes, so the admin's Content-Security-Policy may close style-src-attr. Every part carries a data-role, and its figures data-* attributes, so a test reads what the panel says without reading its markup.

Summary

Functions

The CMS record paths (MishkaCmsMigration.MigrationRun.record_paths/2) of run's latest items, by {kind, source id}, read as user under the run's site. An item with no record, one whose record is gone, and every item when the read fails, have none.

The report's entries the panel lists as the latest items, newest first.

The expanded row of run: its head, its kinds, its latest items and its source.

Functions

item_paths(run, user)

@spec item_paths(MishkaCmsMigration.MigrationRun.t(), map()) :: %{
  required({String.t(), String.t()}) => map()
}

The CMS record paths (MishkaCmsMigration.MigrationRun.record_paths/2) of run's latest items, by {kind, source id}, read as user under the run's site. An item with no record, one whose record is gone, and every item when the read fails, have none.

latest_entries(arg)

@spec latest_entries(map()) :: [MishkaCmsMigration.Report.entry()]

The report's entries the panel lists as the latest items, newest first.

panel(assigns)

The expanded row of run: its head, its kinds, its latest items and its source.

Attributes

  • run (MishkaCmsMigration.MigrationRun) (required) - the run, with its report, progress and extra.
  • paths (:map) - the CMS record paths of the latest items by {kind, source id}, from item_paths/2. Defaults to %{}.
  • created (:integer) - how many users the run created, from PasswordNotice.created/2. Defaults to 0.