Member Junction
    Preparing search index...

    Reusable slide-in panel that previews a restore operation against a historical MJRecordChangeEntity and lets the user confirm with field-level granularity.

    This component is rendered by both:

    • The Record Changes timeline (for restoring a live record from any past change row)
    • The Recycle Bin (for re-creating a hard-deleted record from its delete snapshot)

    It does NOT perform the save itself — the host component receives a RestoreCommitEvent with the selected field values and is responsible for applying them to a BaseEntity, setting the restore context, and calling Save(). This keeps the component purely presentational and reusable in any context.

    The preview compares the full snapshot captured in the source change's FullRecordJSON to the current live record (or to nothing in un-delete mode). It does NOT roll back a single delta — restoring v2 means "make the record look like it did at v2", not "undo v3's changes".

    Live restore from the timeline
    <mj-restore-preview-panel
    [Visible]="showPreview"
    [Mode]="'live'"
    [RecordChange]="selectedChange"
    [LiveRecord]="record"
    (RestoreConfirmed)="onRestoreConfirmed($event)"
    (RestoreCancelled)="showPreview = false">
    </mj-restore-preview-panel>
    Un-delete from the Recycle Bin
    <mj-restore-preview-panel
    [Visible]="showPreview"
    [Mode]="'undelete'"
    [RecordChange]="deletedChange"
    [EntityName]="'Customers'"
    (RestoreConfirmed)="onRecreate($event)"
    (RestoreCancelled)="showPreview = false">
    </mj-restore-preview-panel>

    Hierarchy (View Summary)

    Implements

    • OnInit
    Index

    Constructors

    Properties

    BeforeRestoreCommit: EventEmitter<BeforeRestoreCommitEvent> = ...

    Cancelable event fired when the user clicks Restore but before RestoreConfirmed emits. Consumers can set cancel = true on the event arg to abort the operation — useful for custom approval workflows or for taking over the save themselves.

    ChangedCount: number = 0

    Number of rows where the current value differs from the snapshot.

    DriftCount: number = 0

    Number of rows the schema has dropped or renamed since the snapshot.

    EntityName: string | null = null

    The entity name. Required in 'undelete' mode (since there's no live record to read it from). In 'live' mode it can be omitted and is inferred from the LiveRecord.

    HideReason: boolean = false

    When true, hides the optional reason text area entirely. Default: false.

    IsRestoring: boolean = false
    Mode: RestorePreviewMode = 'live'

    Operating mode — 'live' for restoring an existing record from a snapshot, 'undelete' for re-creating a hard-deleted record.

    Provider: IMetadataProvider | null

    If specified, this provider will be used for communication and for all metadata purposes. By default, if not provided, the Metadata and RunView classes are used for this and the default GraphQLDataProvider is used which is connected to the same back-end MJAPI instance as the Metadata and RunView classes. If you want to have this component connect to a different MJAPI back-end, create an instance of a ProviderBase sub-class like GraphQLDataProvider/etc, and configure it as appropriate to connect to the MJAPI back-end you want to use, and then pass it in here.

    Reason: string = ''
    RequireReason: boolean = false

    When true, the Restore button is disabled until the user enters a non-empty reason. Useful for regulated environments where every reversal needs justification. Default: false.

    RestoreCancelled: EventEmitter<void> = ...

    Emitted when the user cancels the preview without restoring.

    RestoreConfirmed: EventEmitter<RestoreCommitEvent> = ...

    Emitted after the user confirms the restore (and BeforeRestoreCommit was not cancelled). The host is responsible for applying the field values to a BaseEntity, calling SetRestoreContext, and invoking Save().

    Rows: RestoreFieldRow[] = []
    SelectedCount: number = 0

    Number of rows that are checked (will be applied on restore).

    ShowUnchanged: boolean = false
    "ɵdir": unknown
    "ɵfac": unknown

    Accessors

    • get ProviderToUse(): IMetadataProvider

      Returns either the default Metadata provider or the one specified in the Provider property, if it was specified

      Returns IMetadataProvider

    • get RunQueryToUse(): IRunQueryProvider

      Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified

      Returns IRunQueryProvider

    • get RunReportToUse(): IRunReportProvider

      Returns either the default RunReport provider or the one specified in the Provider property, if it was specified

      Returns IRunReportProvider

    • get RunViewToUse(): IRunViewProvider

      Returns either the default RunView provider or the one specified in the Provider property, if it was specified

      Returns IRunViewProvider

    Methods

    • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

      Returns void