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:
actionsonResolve(action, resolution)targetsBySubject, aMapfrom subject IRI to an array of{ subjectIri, label, properties }, where each property haslabel,oldValue, andnewValueresolving,canResolve, anddisabledReasonisLoading(defaultfalse),failed(defaultfalse), andemptyFallback
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:
resolveresolving:subjectIriandresolution, orundefinedcanResolvedisabledReason:"Resolving needs a signed-in user.","Resolving needs an active datastore.", orundefined
canResolve is true when disabledReason is absent. resolve returns nothing.