Member Junction
    Preparing search index...

    Picks the form to render for an entity record and exposes the full list of applicable variants so the toolbar's variant switcher can offer alternates.

    Tier order for the default pick:

    1. EntityFormOverride row matching the caller's User/Role/Global scope, Status='Active', ordered by scope tier (User > Role > Global), then Priority DESC, then __mj_CreatedAt DESC. First row wins.
    2. Existing ClassFactory.GetRegistration(BaseFormComponent, entityName) — the
    • CodeGen-generated path used today. 3. None — caller surfaces the "no form registered" error.

    Session selection. If the user previously chose a non-default variant via the variant switcher and that choice is still applicable + Active, that choice wins over the default. Choice is keyed by entity name in localStorage. Honoring this is part of the variant-switcher contract; without it, switching variants would only last for the lifetime of the record-form view.

    Performance. Backed by InteractiveFormsEngine (in MJCoreEntities) — overrides are cached in memory with BaseEntity event-driven invalidation, so resolution is an O(N) JS filter against a small set instead of a per-LoadForm RunView round-trip. Cold latency dropped from ~50ms to <1ms after the first load. The engine is lazy-Config'd here on first resolution; users who never open a record pay nothing.

    Index

    Constructors

    Properties

    EXPLICIT_DEFAULT_SENTINEL: "__codegen-default__" = '__codegen-default__'

    Sentinel stored in localStorage when the user explicitly picks the "Default form" option from the variant picker. Distinct from a missing localStorage key (= "no preference, use auto-pick rules") and from an override UUID. Without this sentinel, picking "Default" cleared the preference and pickActive re-applied the auto-pick — which always selects the first Active override, making the CodeGen/Angular fallback unreachable from the UI.

    Format: a leading __ makes it visually distinct from a UUID and impossible to collide with one (UUIDs don't contain underscores).

    Methods

    • Wipe the user's stored preference for this entity. Next load applies the auto-pick rules (first Active override in tier order). Called internally when a saved override ID is no longer valid. Fire-and-forget — the resolver doesn't need to await the delete.

      Parameters

      • entityName: string

      Returns void

    • Read the user's previously-saved variant choice for the entity. Synchronous because UserInfoEngine keeps the user-settings table in memory after bootstrap. Returns the stored UUID, the explicit- default sentinel, or null when no preference exists.

      Parameters

      • entityName: string

      Returns string | null

    • Record that the user explicitly picked the "Default form" row in the picker. pickActive reads this sentinel and returns null even when Active overrides exist for the entity, so the form-loading path falls back to CodeGen's @RegisterClass lookup.

      Parameters

      • entityName: string

      Returns void