{"action":"created","issue":{"url":"https://api.github.com/repos/venmo/business-rules-ui/issues/8","repository_url":"https://api.github.com/repos/venmo/business-rules-ui","labels_url":"https://api.github.com/repos/venmo/business-rules-ui/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/venmo/business-rules-ui/issues/8/comments","events_url":"https://api.github.com/repos/venmo/business-rules-ui/issues/8/events","html_url":"https://github.com/venmo/business-rules-ui/issues/8","id":169029908,"number":8,"title":"Generated actions are not loadable","user":{"login":"wmelton","id":1544125,"avatar_url":"https://avatars.githubusercontent.com/u/1544125?v=3","gravatar_id":"","url":"https://api.github.com/users/wmelton","html_url":"https://github.com/wmelton","followers_url":"https://api.github.com/users/wmelton/followers","following_url":"https://api.github.com/users/wmelton/following{/other_user}","gists_url":"https://api.github.com/users/wmelton/gists{/gist_id}","starred_url":"https://api.github.com/users/wmelton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmelton/subscriptions","organizations_url":"https://api.github.com/users/wmelton/orgs","repos_url":"https://api.github.com/users/wmelton/repos","events_url":"https://api.github.com/users/wmelton/events{/privacy}","received_events_url":"https://api.github.com/users/wmelton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-03T01:56:32Z","updated_at":"2016-08-03T02:05:26Z","closed_at":null,"body":"Unless I'm missing something, while the conditions are loadable in their exported format, actions are not loadable in their exported format. \r\n\r\nExample - \r\n\r\nUsing the demo, if you add an action and click 'pretend submit' the following JSON is created - \r\n`[{\"name\":\"put_on_sale\",\"params\":{\"sale_percentage\":\"5\"}}]`\r\n\r\nHowever if you try to load that JSON back in to actionsBuilder, it does not populate the UI. For example - \r\n\r\n```var data = {\r\n      actions: [\r\n        { name: \"put_on_sale\",\r\n          label: \"Put On Sale\",\r\n          params: [{name: \"sale_percentage\", label: \"Sale Percentage\", fieldType : \"numeric\"}]},\r\n        { name: \"order_more\",\r\n          label: \"Order More\",\r\n          params: [{name: \"number_to_order\", label: \"Number To Order\", fieldType : \"numeric\"}]}\r\n      ],\r\n      data: [{\"name\":\"put_on_sale\",\"params\":{\"sale_percentage\":\"5\"}}]\r\n    };\r\n    actions.actionsBuilder(data); ```\r\n\r\nNothing 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. - \r\n\r\n```data: [\r\n        {name: \"action-select\", value: \"put_on_sale\", params: [\r\n          {name: \"sale_percentage\", value: 10}\r\n        ]},\r\n        {name: \"action-select\", value: \"order_more\", params: [\r\n          {name: \"number_to_order\", value: 50}\r\n        ]}\r\n      ]```\r\n\r\nA little confusing since the conditions portion will accept what is exported. Am I missing something? "},"comment":{"url":"https://api.github.com/repos/venmo/business-rules-ui/issues/comments/237111751","html_url":"https://github.com/venmo/business-rules-ui/issues/8#issuecomment-237111751","issue_url":"https://api.github.com/repos/venmo/business-rules-ui/issues/8","id":237111751,"user":{"login":"wmelton","id":1544125,"avatar_url":"https://avatars.githubusercontent.com/u/1544125?v=3","gravatar_id":"","url":"https://api.github.com/users/wmelton","html_url":"https://github.com/wmelton","followers_url":"https://api.github.com/users/wmelton/followers","following_url":"https://api.github.com/users/wmelton/following{/other_user}","gists_url":"https://api.github.com/users/wmelton/gists{/gist_id}","starred_url":"https://api.github.com/users/wmelton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmelton/subscriptions","organizations_url":"https://api.github.com/users/wmelton/orgs","repos_url":"https://api.github.com/users/wmelton/repos","events_url":"https://api.github.com/users/wmelton/events{/privacy}","received_events_url":"https://api.github.com/users/wmelton/received_events","type":"User","site_admin":false},"created_at":"2016-08-03T02:05:26Z","updated_at":"2016-08-03T02:05:26Z","body":"Specifically, if you try to import the json that was exported an error is thrown \r\n\r\n`actions-builder.js:189 Uncaught TypeError: Cannot read property 'length' of undefined`. \r\n\r\nI've spent some time debugging can't figure out where the discrepancy is. "}}
{"actor":{"display_login":"wmelton"}}