-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Columns not validating with string classname #368
Comments
I have tried in different ways, to render the already created form, but without having to load the editor, but the final view of how the form would look, this is my second example and I get this error: Code example 2:
|
Hello! I have the same problem, I have not been able to render the form from the editor
|
Hola tengo el mismo problema no he podido renderizar el formulario desde el editor |
I can have this fixed today if someone can provide a demo online that reproduces the issue. formData may be enough too. But so far I have not been able to truly repro the issue |
formData = {"id":"bd33d6a7-972c-4717-b4d4-9b3f939cc236","stages":{"d3b3dbf5-ac01-4818-85de-a6fff2c3f23b":{"children":["38e87f79-85d9-4164-a562-75c3bc350f07","408ce2a1-309f-4355-a33e-20d4f895e1c0"],"id":"d3b3dbf5-ac01-4818-85de-a6fff2c3f23b"}},"rows":{"38e87f79-85d9-4164-a562-75c3bc350f07":{"config":{"fieldset":false,"legend":"","inputGroup":false},"children":["206fb660-1d90-4ab8-bfa6-88c45b3052d1","ab0bb6fc-216d-439d-ae26-1dceaf9231aa"],"className":["formeo-row"],"id":"38e87f79-85d9-4164-a562-75c3bc350f07"},"408ce2a1-309f-4355-a33e-20d4f895e1c0":{"config":{"fieldset":false,"legend":"","inputGroup":false},"children":["b40f0588-d7be-4e32-9311-2a22666d840d"],"className":["formeo-row"],"id":"408ce2a1-309f-4355-a33e-20d4f895e1c0"}},"columns":{"206fb660-1d90-4ab8-bfa6-88c45b3052d1":{"config":{"width":"50%"},"children":["4f2130f0-203f-432b-b843-354e09cdf551"],"className":["formeo-column"],"id":"206fb660-1d90-4ab8-bfa6-88c45b3052d1"},"ab0bb6fc-216d-439d-ae26-1dceaf9231aa":{"config":{"width":"50%"},"children":["c1272f3f-8067-483d-bc6d-0ff13b348ffa"],"className":["formeo-column"],"id":"ab0bb6fc-216d-439d-ae26-1dceaf9231aa"},"b40f0588-d7be-4e32-9311-2a22666d840d":{"config":{"width":"100%"},"children":["18defa6d-d33a-4e38-8f38-57a818a4bd46"],"className":["formeo-column"],"id":"b40f0588-d7be-4e32-9311-2a22666d840d"}},"fields":{"4f2130f0-203f-432b-b843-354e09cdf551":{"tag":"input","attrs":{"required":false,"type":"text","className":""},"config":{"label":"Text Input","controlId":"text-input"},"id":"4f2130f0-203f-432b-b843-354e09cdf551"},"c1272f3f-8067-483d-bc6d-0ff13b348ffa":{"tag":"input","attrs":{"required":false,"type":"text","className":""},"config":{"label":"Text Input","controlId":"text-input"},"id":"c1272f3f-8067-483d-bc6d-0ff13b348ffa"},"18defa6d-d33a-4e38-8f38-57a818a4bd46":{"tag":"textarea","config":{"label":"TextArea","controlId":"textarea"},"attrs":{"required":false},"id":"18defa6d-d33a-4e38-8f38-57a818a4bd46"}}} |
|
|
based on the comments there were a few things happening in this issue. some were actually #377 all should be resolved now. I am currently working on a rewrite of conditions. once the conditions rewrite is finished focus will be on adding more tests to ensure stability. |
🎉 This issue has been resolved in version 3.0.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Here is an example where we created a basic form with only a Header, Textbox and Number on the form. Here is a JSON view of the payload that will be saved for that basic form:
Here is the payload itself:
{"Template":"{\"id\":\"ac62994f-e1b9-4880-b523-b23a2d568e9b\",\"stages\":{\"2d7d7981-04e2-4fe7-95ec-834ebe94d6a9\":{\"children\":[\"b2bb51a2-f37f-4255-9190-d51ab7fcd2d3\",\"d36e2b1e-2942-4e38-8686-d1b8414d99e3\",\"8cf7df6b-9fdc-4f03-bbe2-bb41b82b5922\"],\"id\":\"2d7d7981-04e2-4fe7-95ec-834ebe94d6a9\"}},\"rows\":{\"b2bb51a2-f37f-4255-9190-d51ab7fcd2d3\":{\"config\":{\"fieldset\":false,\"legend\":\"\",\"inputGroup\":false},\"children\":[\"1c71ea88-5ab0-41c5-951e-5c53f4a4b69b\"],\"className\":[\"formeo-row\"],\"id\":\"b2bb51a2-f37f-4255-9190-d51ab7fcd2d3\"},\"d36e2b1e-2942-4e38-8686-d1b8414d99e3\":{\"config\":{\"fieldset\":false,\"legend\":\"\",\"inputGroup\":false},\"children\":[\"eb2d3f15-e6d2-4783-a70f-6e213a4fbcac\"],\"className\":[\"formeo-row\"],\"id\":\"d36e2b1e-2942-4e38-8686-d1b8414d99e3\"},\"8cf7df6b-9fdc-4f03-bbe2-bb41b82b5922\":{\"config\":{\"fieldset\":false,\"legend\":\"\",\"inputGroup\":false},\"children\":[\"0b1f44f3-e740-4527-a55b-58ebef9a031d\"],\"className\":[\"formeo-row\"],\"id\":\"8cf7df6b-9fdc-4f03-bbe2-bb41b82b5922\"}},\"columns\":{\"1c71ea88-5ab0-41c5-951e-5c53f4a4b69b\":{\"config\":{\"width\":\"100%\"},\"children\":[\"c9b2078f-05c8-4f98-82af-68c01640126c\"],\"className\":[\"formeo-column\"],\"id\":\"1c71ea88-5ab0-41c5-951e-5c53f4a4b69b\"},\"eb2d3f15-e6d2-4783-a70f-6e213a4fbcac\":{\"config\":{\"width\":\"100%\"},\"children\":[\"929b7c6d-fe6d-47a1-b6d2-748aae0eca52\"],\"className\":[\"formeo-column\"],\"id\":\"eb2d3f15-e6d2-4783-a70f-6e213a4fbcac\"},\"0b1f44f3-e740-4527-a55b-58ebef9a031d\":{\"config\":{\"width\":\"100%\"},\"children\":[\"08f91142-fd27-4235-bc3b-fdbf3483ebc1\"],\"className\":[\"formeo-column\"],\"id\":\"0b1f44f3-e740-4527-a55b-58ebef9a031d\"}},\"fields\":{\"c9b2078f-05c8-4f98-82af-68c01640126c\":{\"conditions\":[{\"if\":[{\"source\":\"\",\"sourceProperty\":\"value\",\"comparison\":\"equals\",\"target\":\"\",\"targetProperty\":\"value\"}],\"then\":[{\"target\":\"\",\"targetProperty\":\"value\",\"assignment\":\"equals\",\"value\":\"\"}]}],\"tag\":\"h1\",\"attrs\":{\"tag\":[{\"label\":\"H1\",\"value\":\"h1\",\"selected\":true},{\"label\":\"H2\",\"value\":\"h2\",\"selected\":false},{\"label\":\"H3\",\"value\":\"h3\",\"selected\":false},{\"label\":\"H4\",\"value\":\"h4\",\"selected\":false}],\"className\":\"\"},\"config\":{\"label\":\"Header\",\"hideLabel\":true,\"editableContent\":true},\"meta\":{\"group\":\"html\",\"icon\":\"header\",\"id\":\"html.header\"},\"content\":\"Header\",\"action\":{},\"id\":\"c9b2078f-05c8-4f98-82af-68c01640126c\"},\"929b7c6d-fe6d-47a1-b6d2-748aae0eca52\":{\"conditions\":[{\"if\":[{\"source\":\"\",\"sourceProperty\":\"value\",\"comparison\":\"equals\",\"target\":\"\",\"targetProperty\":\"value\"}],\"then\":[{\"target\":\"\",\"targetProperty\":\"value\",\"assignment\":\"equals\",\"value\":\"\"}]}],\"tag\":\"input\",\"attrs\":{\"required\":false,\"type\":\"text\",\"className\":\"\"},\"config\":{\"label\":\"Text Input\"},\"meta\":{\"group\":\"common\",\"icon\":\"text-input\",\"id\":\"text-input\"},\"id\":\"929b7c6d-fe6d-47a1-b6d2-748aae0eca52\"},\"08f91142-fd27-4235-bc3b-fdbf3483ebc1\":{\"conditions\":[{\"if\":[{\"source\":\"\",\"sourceProperty\":\"value\",\"comparison\":\"equals\",\"target\":\"\",\"targetProperty\":\"value\"}],\"then\":[{\"target\":\"\",\"targetProperty\":\"value\",\"assignment\":\"equals\",\"value\":\"\"}]}],\"tag\":\"input\",\"attrs\":{\"type\":\"number\",\"required\":false,\"className\":\"\"},\"config\":{\"label\":\"Number\"},\"meta\":{\"group\":\"common\",\"icon\":\"hash\",\"id\":\"number\"},\"id\":\"08f91142-fd27-4235-bc3b-fdbf3483ebc1\"}}}"}1
We save this payload to the database, so it can be loaded when we are using the form to capture data.
We use objects that we have defined to represent the structure of the payload, one of these is a Columns object to represent the column in the Formeo control. This has always had the property ClassName defined as a string, but since the recent updates (20 Oct 2024) it has given an error when trying to put data into the Columns object because it wants to put an array in the ClassName property instead. This is the code change we had to make in order to get it to save:
However, we have hundreds of forms saved already with their layout having the ClassName defined as a string. When these forms attempt to load, it gives an error because the data has ClassName stored as a string, but it is attempting to put in into the array object that we have had to change.
I hope this makes sense! If you need more info please let me know.
Originally posted by @Adrian-PIMSS in #359 (comment)
The text was updated successfully, but these errors were encountered: