Fix charmstoreURL icon path when no trailing slash #2148
Fix charmstoreURL icon path when no trailing slash #2148
Conversation
Test PASSed. |
Test FAILed. |
@@ -2688,6 +2690,8 @@ YUI.add('juju-gui', function(Y) { | |||
*/ | |||
charmstore: {}, | |||
|
|||
charmstoreURL: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have a setter with the 'ensureTrailingSlash' method in it
setter(val) {
return views.utils.ensureTrailingSlash(val);
}
var cfg = window.juju_config, | ||
charmstoreURL = (cfg && cfg.charmstoreURL) || '', | ||
localIndex = charmId.indexOf('local:'), | ||
var charmstoreURL = this.get('charmstoreURL'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work because we aren't in the context of the app instance. you'll either want to do something like this:
// If in app.js
utils.getIconPath.call(this, charmId, isBundle, env);
// If passing to another instance from app.js
utils.getIconPath.bind(this);
// Or you can require charmstoreURL as an argument when calling getIconPath.
utils.getIconPath. bind(this, this.get('charmstoreURL'));
Test FAILed. |
Test FAILed. |
5fe2549
to
129a795
Compare
Test PASSed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bac !
Status: merge request accepted. Url: http://ci.jujugui.org:8080/job/juju-gui-merge |
No description provided.