Skip to content
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

Generated actions are not loadable #8

Open
wmelton opened this issue Aug 3, 2016 · 1 comment
Open

Generated actions are not loadable #8

wmelton opened this issue Aug 3, 2016 · 1 comment

Comments

@wmelton
Copy link

wmelton commented Aug 3, 2016

Unless I'm missing something, while the conditions are loadable in their exported format, actions are not loadable in their exported format.

Example -

Using the demo, if you add an action and click 'pretend submit' the following JSON is created -
[{"name":"put_on_sale","params":{"sale_percentage":"5"}}]

However if you try to load that JSON back in to actionsBuilder, it does not populate the UI. For example -

var data = { actions: [ { name: "put_on_sale", label: "Put On Sale", params: [{name: "sale_percentage", label: "Sale Percentage", fieldType : "numeric"}]}, { name: "order_more", label: "Order More", params: [{name: "number_to_order", label: "Number To Order", fieldType : "numeric"}]} ], data: [{"name":"put_on_sale","params":{"sale_percentage":"5"}}] }; actions.actionsBuilder(data);

Nothing is generated in the UI. But if you use a different input format found elsewhere in the documentation it does generate the saved fields in the UI, e.g. -

data: [ {name: "action-select", value: "put_on_sale", params: [ {name: "sale_percentage", value: 10} ]}, {name: "action-select", value: "order_more", params: [ {name: "number_to_order", value: 50} ]} ]

A little confusing since the conditions portion will accept what is exported. Am I missing something?

@wmelton
Copy link
Author

wmelton commented Aug 3, 2016

Specifically, if you try to import the json that was exported an error is thrown

actions-builder.js:189 Uncaught TypeError: Cannot read property 'length' of undefined.

I've spent some time debugging can't figure out where the discrepancy is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant