PyWorkflowApp / visual-programming

A Python Visual Programming Workspace for Data Science
MIT License
31 stars 12 forks source link

Use components in options configuration forms #63

Closed reddigari closed 4 years ago

reddigari commented 4 years ago

Sets the stage for more complex configuration data needed for flow variables. The NodeConfig component has an updateData() method that builds the form data (takes arbitrary keys and values as parameters). The method is passed as a prop to every component rendering a form field, and whenever the form is changed, the callback is fired to update the state in the NodeConfig component. When the form is saved, whatever data has been added via this method is sent as the payload to the server.

reddigari commented 4 years ago

@reelmatt Good catch, and poor explanation on my part. The React useEffect hook fires when the component gets its initial props, and triggers the callback with the initial values (whether defaults or loaded from disk). So the state in NodeConfig should always be current.