jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

Disable vanilla array buttons when readonly

Open joefreeman opened this issue 1 year ago • 1 comments

This updates the vanilla array controls (TableArrayControl and ArrayControlRenderer) to disable the buttons (for adding/removing/moving items) when the control is set to readonly (otherwise the data can be updated while readonly).

To (manually) test this, I've updated the examples to support setting the readonly property of the <JsonForms>, and added toggle actions to a couple of the array examples. (Not sure if there's a better way to do this?)

joefreeman avatar Mar 14 '24 12:03 joefreeman

Deploy Preview for jsonforms-examples ready!

Name Link
Latest commit 5e519d74ab2c3f8e4c6552849622d8eab3c40f4c
Latest deploy log https://app.netlify.com/sites/jsonforms-examples/deploys/66e2c4439a1892000856da21
Deploy Preview https://deploy-preview-2303--jsonforms-examples.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Mar 14 '24 12:03 netlify[bot]

@sdirix @joefreeman I added tests that check that buttons are rendered with expected enabled and disabled state for enabled/disabled controls.

lucas-koehler avatar Sep 12 '24 10:09 lucas-koehler

Coverage Status

coverage: 83.285% (+0.001%) from 83.284% when pulling 5e519d74ab2c3f8e4c6552849622d8eab3c40f4c on joefreeman:disable-readonly-array-buttons into a23e99003b7515d0fe9941eb7e5485263d134984 on eclipsesource:master.

coveralls avatar Sep 12 '24 10:09 coveralls