Closed rhysyngsun closed 5 years ago
I think one other thing it would be good to parameterize is the fetch wrapper to be used for API calls. In open-discussions we have an existing fetch wrapper which handles all of the authentication stuff and we'd like to re-use that without having to duplicate the code over in this repository.
haha, hadn't seen #8 yet
The latest versions of the two packages now support passing the userSettings object into the WidgetList as a prop. I've updated the README as well. I haven't solved all the CSRF issues on the sample app but you have hanled that with your fetch wrapper so it will hopefully work. URLs are built off of a custom setting called siteBaseUrl using the util function apiPath. @rhysyngsun was that what you meant by relative API urls?
Versions should be @zagaran/open-widget-framework - 0.1.19 open-widget-framework (django) - 0.1.8
As far as being functional from the defaults, the only thing that is required is the url base right now. The default is set to the default django localhost. I'm not aware of how to bypass that requirement. Perhaps it should be moved out of user settings and made a separate required prop?
fixed in parallel with #8
Currently there is a global
widgetFrameworkSettings
that is used, these values should instead be passed as props instead if we need to override the defaults. Ideally, the components should be functional from the defaults.siteBaseUrl
and instead use relative API urls