Manta Developers
GitHub
Menu

Manual actions

Show a plan's manual steps and resolve one.

When a change cannot be applied automatically, it is a manual action. useResolveManualAction records how someone resolved it. ManualActionListView renders the list.

What it is

Resolving needs a signed-in user and an active datastore. The resolution is COMPLETED, RETRY, or REJECTED. The same module also exports PlanManualActions, which loads a plan’s actions and renders this view.

Import

import { useResolveManualAction } from "@manta-eu/react/hooks/useResolveManualAction";
import { ManualActionListView } from "@manta-eu/react/components/planning/ManualActionList";

Example

const { resolve, resolving, canResolve, disabledReason } = useResolveManualAction({
  planGraphIri,
  userId,
  datastoreId,
});

return (
  <ManualActionListView
    actions={actions}
    resolving={resolving}
    canResolve={canResolve}
    disabledReason={disabledReason}
    onResolve={(action, resolution) => resolve(action.subjectIri, resolution)}
  />
);

Request

useResolveManualAction({ planGraphIri, userId, datastoreId }).

resolve(subjectIri, resolution) with resolution of COMPLETED, RETRY, or REJECTED.

ManualActionListView takes:

  • actions
  • onResolve(action, resolution)
  • targetsBySubject, a Map from subject IRI to an array of { subjectIri, label, properties }, where each property has label, oldValue, and newValue
  • resolving, canResolve, and disabledReason
  • isLoading (default false), failed (default false), and emptyFallback

Each action has subjectIri, subjectLabel, typeIri, typeName, status (PENDING, COMPLETED, REJECTED, RETRY, or null), assignees, and optional label, description, observedValue, aboutIri, retryable, defaultResolution (COMPLETED, RETRY, or null), and unstarted.

PlanManualActions takes the view props except actions, targetsBySubject, isLoading, and failed, plus planGraphIri, includeUnstarted (default true), and refetchIntervalMs (default false).

Response

The hook returns:

  • resolve
  • resolving: subjectIri and resolution, or undefined
  • canResolve
  • disabledReason: "Resolving needs a signed-in user.", "Resolving needs an active datastore.", or undefined

canResolve is true when disabledReason is absent. resolve returns nothing.