# `MishkaCmsMigrationWeb.Flash`
[🔗](https://github.com/mishka-group/mishka_cms_migration/blob/v0.0.1/lib/mishka_cms_migration_web/flash.ex#L5)

The flashes of the migration pages, said by what they mean and drawn with the kinds the core has.

  * `:success` — something is done: Run cancelled, 553 items decided, Import of 2 items: created;
  * `:info` — something started, was queued, or did not start: Dry run started, a step the run
    refuses while another run of the site is running;
  * `:warning` — done, but the admin should look: an import with skipped items or items that wait
    for a decision, a bulk choice that left some items as they were, a dry run that could not
    start after the run was saved;
  * `:error` — failed: a failed import, a run that is not there, a choice the core refused.

The core draws the same four kinds (`MishkaCmsCore.Layouts.flash_group/1`): success green, info
blue, warning amber and error red. `put/3` puts each meaning under its own core kind
(`core_kind/1`), so a page and a test ask for the meaning and the admin sees its colour.

`result_kind/1` is the meaning of what an item's dry run or import came to.

# `kind`

```elixir
@type kind() :: :success | :info | :warning | :error
```

What a flash means.

# `core_kind`

```elixir
@spec core_kind(kind()) :: kind()
```

The kind the core draws a flash of `kind` with: `:success`, `:info`, `:warning` and `:error` each
have their own colour and icon.

# `kinds`

```elixir
@spec kinds() :: [kind()]
```

The kinds a flash can mean, from the calmest to the most serious.

# `put`

```elixir
@spec put(Phoenix.LiveView.Socket.t(), kind(), String.t()) ::
  Phoenix.LiveView.Socket.t()
```

Puts `message` on `socket`, as the core kind `core_kind/1` draws `kind` with.

# `result_kind`

```elixir
@spec result_kind(atom()) :: kind()
```

What a flash about one item means, by what its dry run or import came to: created and updated are
`:success`, failed is `:error`, and skipped, waiting for a decision or anything else the admin may
want to look at is `:warning`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
