Workflow status bar

I’m working with workflows and was hoping that i’d be able to implement a custom plugin to display the workflow status more clearly to the user editing the record.

currently
At the moment the workflow status and selector is in the right hand panel. It actually took me a second to realise this because I assumed that it would be tied to the Publish Button in some way.

Anyway, I’d like to more clearly communicate the flow and current status to the member, and ideally this layout woudl appear at the top of the record.

Like below.

Questions

  • Is it possible to insert a custom view/layout to the model view for a record? i.e a hook for the top/bottom of the record view?
  • I’m going to assume that the workflow data is accessible from the ctx object so i can render the fields and current status.
  • If I wanted the user to be able to click the status they want to set the record to, is that similar to how you set a new value to a field? In fact, is the workflow status just a field of the record?
  • Additionally, i’d like to pull the permission a user has, and compare those to the permission applied to the workflow. Is that data easily referencable from the ctx object in the plugin SDK?

Hey @emile.swain!

  • not possible ATM to render something above the record form via plugin, would sidebar panels work for you?
  • yes, it’s available at ctx.item.meta.stage;
  • to change it, your plugin needs the currentUserAccessToken additional permission, then you can perform an update record API call:
client.items.update(itemId, {
  type: "item",
  id: itemId,
  attributes: {},
  meta: { stage: newStageId },
});
  • you can use ctx.currentRole to get the current user permission, and know to which stages the current user can move a record into!
1 Like

Thanks.
I’m built a v2 plugin currently called Workflow Tracker (github) that leverages the current custom field editor and binds to a field with the id workflowfield. Replacing the editor with a custom layout that shows the stages and the current stage as a button group.

Seem to work ok so far.

2 Likes