Contentful App Framework - Prevent publishing when custom app has invalidating

Hi, I have a custom app built using the Contentful App Framework, this app has many input fields that are being checked/validated they have the correct data.

I can see a way to set the field (custom app) to a state of invalid and the entire custom app in the editor has a red line put against it, but I would like to implement that same behaviour as when a Contentful field is consider invalid, which is the publish button also is disabled, which prevents the bad data from being published.

So I was wondering if there is a way when using the Contentful App Framework to disable the publish button?

Cheers,
Shannon

Hello, I would like to implement the same feature.

Do you have any update on your problem? I was also able to set the the fiels to invalid but I didn’t find a way to disable the Publish button.

Cheers

+1 on this, anyone find a solution?

I found the solution. You need to set the Field as invalid using: sdk.field.setInvalid(true)

@kenyonkowal Is there really not a more elegant way of disabling the publish button?

I am searching for a way to set an entry to “locked” using the Contentful SDK so it cannot be edited/published but I cannot find anything.