Skip to content

Locations 0.1.2: Activity log entries and clearer form errors

Locations 0.1.2 records every change in the PhoenixKit locations module in the activity log and makes the admin forms show their errors properly.

Creating, editing or deleting a location or a location type, changing a location’s types, and switching the module on or off now each write an entry to PhoenixKit’s activity log. Saving a location without changing its types no longer logs a change to its types.

The location and type forms now use PhoenixKit’s standard form fields. When a save fails, the errors appear next to the fields; before, they could stay hidden. Save buttons are disabled while a save is running, so a double click cannot submit twice. Error messages come from one place and can be translated.

Full release notes: Locations 0.1.2

0.1.2 · 29 April 2026

Added

  • PhoenixKitLocations.Errors module — central gettext-backed mapping from error atoms to user-facing strings.
  • Activity logging across all mutations (location + type create/update/delete, sync_location_types, add_location_type, remove_location_type, module enable/disable). Metadata is PII-audited at the source.
  • LocationTypeAssignment.changeset/2 with assoc_constraint/2 — FK violations now surface as {:error, changeset} instead of Ecto.ConstraintError.
  • @spec typespecs on every public Locations API; @type t on each schema.
  • Test infrastructure: Test.Endpoint, Test.Router, LiveCase, scope-injection on_mount hook, destructive-rescue test file.
  • README sections for Error Handling and Activity Logging.

Changed

  • sync_location_types/3 short-circuits to {:ok, :unchanged} when the requested type set matches existing assignments — no DB write, no activity log spam.
  • get_location_by/2 allowlists :name / :email / :phone; arbitrary caller-chosen atoms are rejected.
  • All admin LiveView forms now use core <.input> / <.select> / <.textarea> primitives; dropped homegrown error helpers.
  • phx-disable-with on every submit button to prevent double-submit.
  • Replaced inline section-header SVGs with <.icon name="hero-..."> from core.

Fixed

  • Save-error paths now Map.put(changeset, :action, :validate) so validation errors render via core <.input> (which gates on changeset.action != nil).
  • Feature-flag labels are now extractable by mix gettext.extract via a literal-call helper.

Quality

  • 188 tests, 0 failures (up from 73).
  • 96.89% line coverage via mix test --cover.
  • mix precommit clean (compile + format + credo –strict + dialyzer).

Locations 0.1.2. Install or update: {:phoenix_kit_locations, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.