mitodl / open-widget-framework

A django + react app for managing user-configurable widgets
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Improve configuration fliexibility of components #7

Closed rhysyngsun closed 5 years ago

rhysyngsun commented 5 years ago

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.

alicewriteswrongs commented 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.

alicewriteswrongs commented 5 years ago

haha, hadn't seen #8 yet

jklingen92 commented 5 years ago

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

jklingen92 commented 5 years ago

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?

kyfantaz commented 5 years ago

fixed in parallel with #8