OSC / ood_appkit

https://osc.github.io/Open-OnDemand/
MIT License
1 stars 2 forks source link

OodAppkit.dashboard should return an empty object if dashboard url is not configured. #23

Closed brianmcmichael closed 7 years ago

brianmcmichael commented 7 years ago

Our suggested method of obtaining the OodAppkit dashboard URI is to call OodAppkit.dashboard.url.to_s

OodAppkit.dashboard currently returns nil if it is not configured, and so calling .url will raise a NoMethodError exception.

An app probably shouldn't crash if the dashboard is not configured, may be more appropriate to set url to "#" or empty string on calls to an unconfigured OodAppkit.dashboard.uri

ericfranz commented 7 years ago

I use "#" with the default PathRouter that I inject into OodApp, so "#" is the right solution.

nickjer commented 7 years ago

Are you sure it returns nil? The code sets default values if not defined...

https://github.com/OSC/ood_appkit/blob/84b3decd948b347928ee0563141a8eccf543fb61/lib/ood_appkit/configuration.rb#L89-L92

nickjer commented 7 years ago

Re-open if this is still an issue. But it seems to be fixed already.